diff options
| author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2019-02-03 03:21:09 -0500 |
|---|---|---|
| committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2019-02-04 05:26:08 -0500 |
| commit | 7c9e460a4a8115553e6e4c71872bc2df1a45fb94 (patch) | |
| tree | a44ef5a016a7e51cc7f85519f99247fa9f9827b8 /test/unit/CMakeLists.txt | |
| parent | 561a6639c45a4e35a638c2e87869c5991fc7d69e (diff) | |
| download | PROJ-7c9e460a4a8115553e6e4c71872bc2df1a45fb94.tar.gz PROJ-7c9e460a4a8115553e6e4c71872bc2df1a45fb94.zip | |
Allow building against external GTest with CMake.
Diffstat (limited to 'test/unit/CMakeLists.txt')
| -rw-r--r-- | test/unit/CMakeLists.txt | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt index a157f630..86e3484a 100644 --- a/test/unit/CMakeLists.txt +++ b/test/unit/CMakeLists.txt @@ -1,5 +1,16 @@ # CMake configuration for PROJ unit tests +option(USE_EXTERNAL_GTEST "Compile against external GTest" OFF) + +if (USE_EXTERNAL_GTEST) + +message(STATUS "Using external GTest") +find_package(GTest 1.8.0) + +else (USE_EXTERNAL_GTEST) + +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}") @@ -47,6 +58,8 @@ set(CMAKE_CXX_FLAGS "${_save_cxx_flags}") unset(_save_c_flags) unset(_save_cxx_flags) +endif(USE_EXTERNAL_GTEST) + # # Build PROJ unit tests # |
