From eac27f149a988353ee7c9a6f3efcd304f51bdcc5 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Thu, 1 Jan 2015 18:10:21 +0100 Subject: [PATCH] Enable in-package substitute of tr1/tuple In clang 6.0 the tr1/tuple header is not present, and this cause a compilation error inside of the gtest framework. However, if we set a define, it will use its own substitute of tr1/tuple, which is sufficient for the unit tests. --- .../FileInterface/FileInterface_UnitTests/CMakeLists.txt | 4 ++++ .../ModelVisualization_UnitTests/CMakeLists.txt | 4 ++++ .../ReservoirDataModel_UnitTests/CMakeLists.txt | 2 ++ 3 files changed, 10 insertions(+) diff --git a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt index 092d8d9098..722f928d99 100644 --- a/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt +++ b/ApplicationCode/FileInterface/FileInterface_UnitTests/CMakeLists.txt @@ -75,6 +75,10 @@ set( LINK_LIBRARIES ${QT_LIBRARIES} ) +if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_CXX_FLAGS "-DGTEST_USE_OWN_TR1_TUPLE=1") +endif() + add_executable( ${ProjectName} ${CODE_HEADER_FILES} diff --git a/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt b/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt index 97e839bfc1..3f8c05e07e 100644 --- a/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ModelVisualization/ModelVisualization_UnitTests/CMakeLists.txt @@ -61,6 +61,10 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set( EXTERNAL_LINK_LIBRARIES pthread ) +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set( CMAKE_CXX_FLAGS + "-DGTEST_USE_OWN_TR1_TUPLE=1" + ) ENDIF() target_link_libraries( ${ProjectName} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES}) diff --git a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt index 6152868dbe..e46aef6985 100644 --- a/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt +++ b/ApplicationCode/ReservoirDataModel/ReservoirDataModel_UnitTests/CMakeLists.txt @@ -87,6 +87,8 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ") +ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(CMAKE_CXX_FLAGS "-DGTEST_USE_OWN_TR1_TUPLE=1") ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")