aboutsummaryrefslogtreecommitdiff
path: root/test/unit/CMakeLists.txt
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2019-04-05 00:18:16 +1300
committerMike Taves <mwtoews@gmail.com>2019-04-05 22:49:43 +1300
commite41b9f143c783651ce8576f0ccc5ca612883c9e6 (patch)
tree6256dc65b4f4d4adb76b6b8b2f74c47e65b99633 /test/unit/CMakeLists.txt
parent1e2e512f9a671df504f6f01eee53dc26939b3c0a (diff)
downloadPROJ-e41b9f143c783651ce8576f0ccc5ca612883c9e6.tar.gz
PROJ-e41b9f143c783651ce8576f0ccc5ca612883c9e6.zip
CMake: cache C/C++ warn flags to compile PROJ targets
Remove (most) needs to fiddle with CMAKE_C_FLAGS / CMAKE_CXX_FLAGS
Diffstat (limited to 'test/unit/CMakeLists.txt')
-rw-r--r--test/unit/CMakeLists.txt15
1 files changed, 3 insertions, 12 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 66a69c3f..40a3dd06 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -11,12 +11,6 @@ else()
message(STATUS "Using internal GTest")
-# FIXME: Deal with our old-school CMakeLists.txt behaving badly
-set(_save_c_flags "${CMAKE_C_FLAGS}")
-set(_save_cxx_flags "${CMAKE_CXX_FLAGS}")
-string(REGEX REPLACE "\\-W[a-z\\-]+" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
-string(REGEX REPLACE "\\-W[a-z\\-]+" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-
#
# Build Google Test
#
@@ -48,12 +42,6 @@ add_subdirectory(
${CMAKE_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
-# FIXME: Deal with our old-school CMakeLists.txt behaving badly
-set(CMAKE_C_FLAGS "${_save_c_flags}")
-set(CMAKE_CXX_FLAGS "${_save_cxx_flags}")
-unset(_save_c_flags)
-unset(_save_cxx_flags)
-
# Provide the same target name as find_package(GTest)
add_library(GTest::gtest ALIAS gtest)
@@ -72,6 +60,9 @@ include_directories(${SQLITE3_INCLUDE_DIR})
# Add the directory containing proj_config.h
include_directories(${CMAKE_BINARY_DIR}/src)
+# Apply to targets in the current directory and below
+add_compile_options(${PROJ_CXX_WARN_FLAGS})
+
add_executable(proj_pj_transform_test
main.cpp
pj_transform_test.cpp)