diff --git a/CMakeLists.txt b/CMakeLists.txt index 65a6f9420..f24f17304 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -649,6 +649,12 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Matches Clang & AppleClang. endif(HAVE_RETURN_TYPE_C_LINKAGE) endif () +# Disable warnings about deprecated interfaces while we are +# transitioning from LocalParameterization to Manifolds. +add_compile_options( + $<$,$,$>:-Wno-deprecated-declarations> + $<$:/wd4996>) + # Configure the Ceres config.h compile options header using the current # compile options and put the configured header into the Ceres build # directory. Note that the ceres/internal subdir in /config where diff --git a/internal/ceres/CMakeLists.txt b/internal/ceres/CMakeLists.txt index d009ac2ce..5ac71a9da 100644 --- a/internal/ceres/CMakeLists.txt +++ b/internal/ceres/CMakeLists.txt @@ -262,13 +262,6 @@ set_target_properties(ceres PROPERTIES VERSION ${CERES_VERSION} SOVERSION ${CERES_VERSION_MAJOR}) -# Disable warnings about deprecated interfaces while we are -# transitioning from LocalParameterization to Manifolds. -target_compile_options(ceres PRIVATE - $<$,$,$>: - -Wno-deprecated-declarations> - $<$: /wd4996>) - if (BUILD_SHARED_LIBS) set_target_properties(ceres PROPERTIES # Set the default symbol visibility to hidden to unify the behavior among @@ -443,13 +436,6 @@ if (BUILD_TESTING AND GFLAGS) ${CERES_LIBRARY_PRIVATE_DEPENDENCIES_INCLUDE_DIRS}) - # Disable warnings about deprecated interfaces while we are - # transitioning from LocalParameterization to Manifolds. - target_compile_options(${NAME}_test PRIVATE - $<$,$,$>: - -Wno-deprecated-declarations> - $<$: /wd4996>) - target_link_libraries(${NAME}_test PUBLIC test_util Ceres::ceres gtest) if (BUILD_SHARED_LIBS) # Define gtest-specific shared library flags for linking.