aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-03-26 04:58:16 +0100
committerNaios <naios-dev@live.de>2016-04-11 21:41:15 +0200
commit3b4f754b06f4af98de8a50cc42714880246e4d7d (patch)
tree4a3ef20fdeccefb46694195ffb0220211abfd45d
parentf93617c3c9e6a6cc76b2c69229808beb77755364 (diff)
CMake: Fix a misbehaviour of the boost no scoped enums test
* Sometimes added the definition in MSVC although the test passed which lead MSVC to rebuild the whole solution even on a CMAKE_INSTALL_PREFIX change. (cherry picked from commit a8ce2b68ebace22d3660430be0a812338edaab71)
-rw-r--r--dep/boost/CMakeLists.txt31
1 files changed, 17 insertions, 14 deletions
diff --git a/dep/boost/CMakeLists.txt b/dep/boost/CMakeLists.txt
index 118635c85bd..6cda5fbec4e 100644
--- a/dep/boost/CMakeLists.txt
+++ b/dep/boost/CMakeLists.txt
@@ -35,19 +35,14 @@ include (CheckCXXSourceCompiles)
set(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_IOSTREAMS_LIBRARY})
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
-unset(boost_filesystem_copy_links_without_NO_SCOPED_ENUM CACHE)
check_cxx_source_compiles("
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
int main() { boost::filesystem::copy_file(boost::filesystem::path(), boost::filesystem::path()); }"
boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
-unset(CMAKE_REQUIRED_INCLUDES CACHE)
-unset(CMAKE_REQUIRED_LIBRARIES CACHE)
-unset(CMAKE_REQUIRED_FLAGS CACHE)
-
-if (NOT boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
- set(OPTIONAL_BOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS)
-endif()
+unset(CMAKE_REQUIRED_INCLUDES)
+unset(CMAKE_REQUIRED_LIBRARIES)
+unset(CMAKE_REQUIRED_FLAGS)
add_library(boost INTERFACE)
@@ -59,9 +54,17 @@ target_include_directories(boost
INTERFACE
${Boost_INCLUDE_DIRS})
-target_compile_definitions(boost
- INTERFACE
- -DBOOST_DATE_TIME_NO_LIB
- -DBOOST_REGEX_NO_LIB
- -DBOOST_CHRONO_NO_LIB
- ${OPTIONAL_BOOST_NO_SCOPED_ENUMS})
+if (boost_filesystem_copy_links_without_NO_SCOPED_ENUM)
+ target_compile_definitions(boost
+ INTERFACE
+ -DBOOST_DATE_TIME_NO_LIB
+ -DBOOST_REGEX_NO_LIB
+ -DBOOST_CHRONO_NO_LIB)
+else()
+ target_compile_definitions(boost
+ INTERFACE
+ -DBOOST_DATE_TIME_NO_LIB
+ -DBOOST_REGEX_NO_LIB
+ -DBOOST_CHRONO_NO_LIB
+ -DBOOST_NO_CXX11_SCOPED_ENUMS)
+endif()