Skip to content
Snippets Groups Projects
Commit ef000207 authored by Markus Rampp's avatar Markus Rampp
Browse files

use canonical cmake procedure to link selected boost components

* this fixes the issue of a missing rpath to the shared objects
parent 448a268c
Branches
Tags
No related merge requests found
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(BioEM) 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 ###Set up options
option (USE_CUDA "Build BioEM with CUDA support" OFF) option (USE_CUDA "Build BioEM with CUDA support" OFF)
option (USE_OPENMP "Build BioEM with OpenMP support" ON) option (USE_OPENMP "Build BioEM with OpenMP support" ON)
...@@ -8,6 +21,7 @@ option (USE_MPI "Build BioEM with MPI 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 (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) 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 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}/cmake/Modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
...@@ -35,8 +49,10 @@ if (NOT FFTW_FOUND) ...@@ -35,8 +49,10 @@ if (NOT FFTW_FOUND)
endif() endif()
include_directories(${FFTW_INCLUDE_DIRS}) include_directories(${FFTW_INCLUDE_DIRS})
find_package(Boost 1.43 REQUIRED) find_package( Boost 1.43 REQUIRED COMPONENTS program_options )
include_directories(${Boost_INCLUDE_DIRS}) include_directories( ${Boost_INCLUDE_DIRS} )
###Find Optional Packages ###Find Optional Packages
...@@ -127,7 +143,7 @@ if (FFTWF_LIBRARIES) ...@@ -127,7 +143,7 @@ if (FFTWF_LIBRARIES)
else() else()
target_link_libraries(bioEM -L${FFTW_LIBDIR} -lfftw3 -lfftw3f) target_link_libraries(bioEM -L${FFTW_LIBDIR} -lfftw3 -lfftw3f)
endif() endif()
target_link_libraries(bioEM -L${Boost_LIBRARY_DIRS} -lboost_program_options) target_link_libraries(bioEM ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (MPI_FOUND) if (MPI_FOUND)
target_link_libraries(bioEM ${MPI_LIBRARIES}) target_link_libraries(bioEM ${MPI_LIBRARIES})
...@@ -150,4 +166,3 @@ if (PRINT_CMAKE_VARIABLES) ...@@ -150,4 +166,3 @@ if (PRINT_CMAKE_VARIABLES)
message(STATUS "${_variableName}=${${_variableName}}") message(STATUS "${_variableName}=${${_variableName}}")
endforeach() endforeach()
endif() endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment