From d4c98052a3cf5cf7d418b1831e55f85a63bb5038 Mon Sep 17 00:00:00 2001 From: Martin Beseda <martinbeseda@seznam.cz> Date: Thu, 13 Sep 2018 19:19:44 +0200 Subject: [PATCH] FIX: Trying to fix compilation on Windows with dependencies linked dynamically --- CMakeLists.txt | 6 ------ FindBoost.cmake | 9 ++++----- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a8515ce..295817c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,12 +66,6 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) set(Boost_USE_MULTITHREADED ON) set(Boost_DEBUG ON) -#set(CMAKE_INCLUDE_PATH ${BOOST_INCLUDEDIR} "${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost" ${CMAKE_INCLUDE_PATH}) -#set(CMAKE_LIBRARY_PATH ${BOOST_LIBRARYDIR} "${CMAKE_CURRENT_LIST_DIR}/external_dependencies/boost/stage/lib" ${CMAKE_LIBRARY_PATH}) - -message("CMAKE_INCLUDE_PATH: ${CMAKE_INCLUDE_PATH}") -message("CMAKE_LIBRARY_PATH: ${CMAKE_LIBRARY_PATH}") - find_package( Boost diff --git a/FindBoost.cmake b/FindBoost.cmake index 3c6ff905..08a79a21 100644 --- a/FindBoost.cmake +++ b/FindBoost.cmake @@ -76,8 +76,10 @@ if(NOT DEPENDENCIES_LINK_TYPE) message(FATAL_ERROR "Variable DEPENDENCIES_LINK_TYPE is not set! Set it to 'static' or 'shared'.") endif() +set(LIB_PREFIX "lib") set(LIB_SUFFIX "a") # suffix for Linux static libraries if("${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared" AND WIN32) + set(LIB_PREFIX "") set(LIB_SUFFIX "dll") elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "static" AND WIN32) set(LIB_SUFFIX "lib") @@ -85,16 +87,13 @@ elseif("${DEPENDENCIES_LINK_TYPE}" STREQUAL "shared") set(LIB_SUFFIX "so") endif() -set(LIB_PREFIX "lib") -#if(WIN32) -# set(LIB_PREFIX "") -#endif() - set(REQUESTED_BOOST_LIBS "") foreach(COMPONENT ${Boost_FIND_COMPONENTS}) list(APPEND REQUESTED_BOOST_LIBS "${LIB_PREFIX}boost_${COMPONENT}.${LIB_SUFFIX}") endforeach() +message("REQUESTED_BOOST_LIBS: ${REQUESTED_BOOST_LIBS}") + # Look for libraries specified by COMPONENTS flag set(Boost_LIBRARY_DIRS "Boost_LIBRARY_DIRS-NOTFOUND") find_path( -- GitLab