diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 17ee0199..00f66ae8 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -105,9 +105,13 @@ find_package(Boost COMPONENTS unit_test_framework REQUIRED) set(PREVIOUSLY_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") set(PREVIOUSLY_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") +set(PREVIOUSLY_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") list(APPEND CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIRS}) list(APPEND CMAKE_REQUIRED_LIBRARIES ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) +if(APPLE) + list(APPEND CMAKE_REQUIRED_FLAGS "-std=c++11") +endif() message(STATUS "Boost_INCLUDE_DIRS = ${Boost_INCLUDE_DIRS}") message(STATUS "Boost_UNIT_TEST_FRAMEWORK_LIBRARY = ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}") @@ -138,9 +142,15 @@ BOOST_AUTO_TEST_CASE(proforma) { BOOST_TEST(true); } set(CMAKE_REQUIRED_INCLUDES "${PREVIOUSLY_REQUIRED_INCLUDES}") set(CMAKE_REQUIRED_LIBRARIES "${PREVIOUSLY_REQUIRED_LIBRARIES}") +set(CMAKE_REQUIRED_FLAGS "${PREVIOUSLY_REQUIRED_FLAGS}") unset(PREVIOUSLY_REQUIRED_INCLUDES) unset(PREVIOUSLY_REQUIRED_LIBRARIES) +unset(PREVIOUSLY_REQUIRED_FLAGS) + +message(STATUS "CMAKE_REQUIRED_INCLUDES = ${CMAKE_REQUIRED_INCLUDES }") +message(STATUS "CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") +message(STATUS "CMAKE_REQUIRED_FLAGS = ${CMAKE_REQUIRED_FLAGS }") if(TOML11_WITH_BOOST_TEST_DYNAMIC) add_definitions(-DUNITTEST_FRAMEWORK_LIBRARY_EXIST -DBOOST_TEST_DYN_LINK)