diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2019-06-13 14:15:10 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2019-06-13 15:19:24 +0300 |
commit | 821ca0e36a4d85d19ca01b404967f53672b5625f (patch) | |
tree | 5a9c59dabe03740e1dc992f924eb4ab20bc2454c /CMakeLists.txt | |
parent | 9805417028c142784900ec5efbca9cd7f150c80b (diff) |
Build fix when boost is not in prefix/boost
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index de435813d..b4e0224f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,17 +240,34 @@ if(NOT WIN32) set(MINIMUM_BOOST_VERSION "1.64.0") endif() find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS system filesystem thread log locale regex) -if(Boost_FOUND) -# message("Boost include dir: ${Boost_INCLUDE_DIRS}") -# message("Boost library dirs: ${Boost_LIBRARY_DIRS}") -# message("Boost libraries: ${Boost_LIBRARIES}") - if (APPLE) - # BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339 - add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE) - endif() - if(NOT SLIC3R_STATIC) - add_definitions(-DBOOST_LOG_DYN_LINK) - endif() + +add_library(boost_libs INTERFACE) +add_library(boost_headeronly INTERFACE) + +if (APPLE) + # BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339 + target_compile_definitions(boost_headeronly INTERFACE BOOST_ASIO_DISABLE_KQUEUE) +endif() + +if(NOT SLIC3R_STATIC) + target_compile_definitions(boost_headeronly INTERFACE BOOST_LOG_DYN_LINK) +endif() + +if(TARGET Boost::system) + message(STATUS "Boost::boost exists") + target_link_libraries(boost_headeronly INTERFACE Boost::boost) + target_link_libraries(boost_libs INTERFACE + boost_headeronly # includes the custom compile definitions as well + Boost::system + Boost::filesystem + Boost::thread + Boost::log + Boost::locale + Boost::regex + ) +else() + target_include_directories(boost_headeronly INTERFACE ${Boost_INCLUDE_DIRS}) + target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES}) endif() # Find and configure intel-tbb |