Skip to content
Snippets Groups Projects
Commit 1f46bb72 authored by Sören Peters's avatar Sören Peters
Browse files

Merge branch 'feature/boost_header_only' into 'develop'

Add the option for call linkBoost() without components. Closes #2

Closes #2

See merge request irmb/VirtualFluids_dev!17
parents d96ed0ad 6b519831
No related branches found
No related tags found
1 merge request!17Add the option for call linkBoost() without components. Closes #2
function(linkBoost components) function(linkBoost)
set( options )
set( oneValueArgs )
set( multiValueArgs COMPONENTS)
cmake_parse_arguments( ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
if (WIN32) if (WIN32)
set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_LIBS ON)
...@@ -20,8 +26,16 @@ function(linkBoost components) ...@@ -20,8 +26,16 @@ function(linkBoost components)
# add_definitions( -DBOOST_ALL_DYN_LINK ) # add_definitions( -DBOOST_ALL_DYN_LINK )
endif() endif()
vf_get_library_name(library_name) vf_get_library_name(library_name)
find_package( Boost REQUIRED COMPONENTS ${components}) if(DEFINED ARG_COMPONENTS)
find_package( Boost REQUIRED COMPONENTS ${ARG_COMPONENTS})
target_link_libraries(${library_name} PRIVATE ${Boost_LIBRARIES})
message("here")
else()
find_package( Boost REQUIRED)
message("or here")
endif()
target_include_directories(${library_name} PRIVATE ${Boost_INCLUDE_DIR}) target_include_directories(${library_name} PRIVATE ${Boost_INCLUDE_DIR})
target_link_libraries(${library_name} PRIVATE ${Boost_LIBRARIES})
endfunction() endfunction()
...@@ -11,7 +11,7 @@ vf_add_library(PRIVATE_LINK ${libsToLink}) ...@@ -11,7 +11,7 @@ vf_add_library(PRIVATE_LINK ${libsToLink})
linkMPI() linkMPI()
linkCUDA() linkCUDA()
linkBoost("serialization") linkBoost(COMPONENTS "serialization")
#SET(TPN_WIN32 "/EHsc") #SET(TPN_WIN32 "/EHsc")
#https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake #https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment