diff --git a/CMakeLists.txt b/CMakeLists.txt index a9d507c8e..d98868f8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,15 @@ elseif(WIN32) option(USE_EXTERNAL_TINYXML2 "Use a system-installed version of tinyxml2" OFF) endif() +#-------------------------------------- +# Option: Should we skip tests of deprecated functionality +option(SKIP_DEPRECATED_TESTS "Skip testing deprecated funcationality" OFF) +# Option: Should we skip building deprecated functionality entirely +option(SKIP_DEPRECATED "Skip building deprecated functionality" OFF) + +if(SKIP_DEPRECATED) + set(SKIP_DEPRECATED_TESTS ON) +endif() #============================================================================ # Search for project-specific dependencies diff --git a/include/ignition/common/CMakeLists.txt b/include/ignition/common/CMakeLists.txt index c786bcee2..aa657bac4 100644 --- a/include/ignition/common/CMakeLists.txt +++ b/include/ignition/common/CMakeLists.txt @@ -1,2 +1,22 @@ +if(SKIP_DEPRECATED) + set(EXCLUDE_FILES + Plugin.hh + PluginInfo.hh + PluginLoader.hh + PluginMacros.hh + PluginPtr.hh + SpecializedPlugin.hh + SpecializedPluginPtr.hh + TemplateHelpers.hh + detail/Plugin.hh + detail/PluginLoader.hh + detail/PluginMacros.hh + detail/PluginPtr.hh + detail/SpecializedPlugin.hh + detail/TemplateHelpers.hh + ) +else() + set(EXCLUDE_FILES) +endif() -ign_install_all_headers() +ign_install_all_headers(EXCLUDE_FILES ${EXCLUDE_FILES}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62cc2ef15..da161144a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,6 +3,23 @@ # "gtest_sources" variable ign_get_libsources_and_unittests(sources gtest_sources) +if(SKIP_DEPRECATED) + list(REMOVE_ITEM sources + Plugin.cc + PluginLoader.cc + PluginUtils.hh + ) +endif() + +if(SKIP_DEPRECATED_TESTS) + list(REMOVE_ITEM gtest_sources + PluginLoader_TEST.cc + PluginUtils_TEST.cc + TemplateHelpers_TEST.cc + ) +endif() + + # Create the library target ign_create_core_library( SOURCES ${sources} diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ff32b05f3..6ee50aa20 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,7 +15,10 @@ set(GTEST_MAIN_LIBRARY "${PROJECT_BINARY_DIR}/test/libgtest_main.a") add_subdirectory(integration) add_subdirectory(performance) add_subdirectory(regression) -add_subdirectory(plugins) -add_subdirectory(static_assertions) + +if(NOT SKIP_DEPRECATED) + add_subdirectory(plugins) + add_subdirectory(static_assertions) +endif() configure_file(test_config.h.in ${PROJECT_BINARY_DIR}/test_config.h) diff --git a/test/integration/CMakeLists.txt b/test/integration/CMakeLists.txt index 1aa52c366..c39242e9a 100644 --- a/test/integration/CMakeLists.txt +++ b/test/integration/CMakeLists.txt @@ -11,6 +11,10 @@ if (SKIP_av OR INTERNAL_SKIP_av) list(REMOVE_ITEM tests video_encoder.cc) endif() +if(SKIP_DEPRECATED_TESTS) + list(REMOVE_ITEM tests plugin.cc) +endif() + ign_build_tests( TYPE INTEGRATION SOURCES ${tests} diff --git a/test/performance/CMakeLists.txt b/test/performance/CMakeLists.txt index 56babb295..dd3a85f9f 100644 --- a/test/performance/CMakeLists.txt +++ b/test/performance/CMakeLists.txt @@ -7,6 +7,11 @@ if("${CMAKE_BUILD_TYPE_UPPERCASE}" STREQUAL "COVERAGE") plugin_specialization.cc) endif() +if(SKIP_DEPRECATED_TESTS) + list(REMOVE_ITEM tests + plugin_specialization.cc) +endif() + link_directories(${PROJECT_BINARY_DIR}/test) ign_build_tests(