Commit ef000207 authored by Markus Rampp's avatar Markus Rampp

use canonical cmake procedure to link selected boost components

* this fixes the issue of a missing rpath to the shared objects
parent 448a268c
cmake_minimum_required(VERSION 2.6)
project(BioEM)
###use g++ and gcc instead of c++ and cc
##this works but would change the default cmake toolchain precedence c++,g++,...
#if (NOT (CMAKE_CXX_COMPILER OR $ENV{CXX}))
# set (CMAKE_CXX_COMPILER g++)
#endif()
##this works but would change the default cmake toolchain precedence cc,gcc,...
#if (NOT (CMAKE_C_COMPILER OR $ENV{CC}))
# set (CMAKE_C_COMPILER gcc)
#endif()
###Set up options
option (USE_CUDA "Build BioEM with CUDA support" OFF)
option (USE_OPENMP "Build BioEM with OpenMP support" ON)
......@@ -8,6 +21,7 @@ option (USE_MPI "Build BioEM with MPI support" ON)
option (PRINT_CMAKE_VARIABLES "List all CMAKE Variables" OFF)
option (CUDA_FORCE_GCC "Force GCC as host compiler for CUDA part (If standard host compiler is incompatible with CUDA)" ON)
###Set up general variables
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
......@@ -35,8 +49,10 @@ if (NOT FFTW_FOUND)
endif()
include_directories(${FFTW_INCLUDE_DIRS})
find_package(Boost 1.43 REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
find_package( Boost 1.43 REQUIRED COMPONENTS program_options )
include_directories( ${Boost_INCLUDE_DIRS} )
###Find Optional Packages
......@@ -127,7 +143,7 @@ if (FFTWF_LIBRARIES)
else()
target_link_libraries(bioEM -L${FFTW_LIBDIR} -lfftw3 -lfftw3f)
endif()
target_link_libraries(bioEM -L${Boost_LIBRARY_DIRS} -lboost_program_options)
target_link_libraries(bioEM ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (MPI_FOUND)
target_link_libraries(bioEM ${MPI_LIBRARIES})
......@@ -150,4 +166,3 @@ if (PRINT_CMAKE_VARIABLES)
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment