conditional build scripts with boost xor eigen
This commit is contained in:
parent
42be24628e
commit
766ac33c5a
11 changed files with 134 additions and 14 deletions
|
|
@ -29,25 +29,57 @@ SET(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT
|
|||
######################################################################################
|
||||
|
||||
# include useful features for cmake
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
|
||||
|
||||
INCLUDE(FindDoxygen)
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
FIND_PACKAGE(Boost 1.33.0)
|
||||
IF( WITH_BOOST AND WITH_EIGEN )
|
||||
MESSAGE( "ERROR: You have to choose between Boost:ublas and Eigen, you cannot compile with both libraries" )
|
||||
SET(IS_FATAL 1)
|
||||
ELSEIF( NOT WITH_BOOST AND NOT WITH_EIGEN )
|
||||
#MESSAGE( "WARNING: Boost:ublas and Eigen are both deactivated, some features may lack." )
|
||||
# FIXME ideally, we would have a minimal implementation with STL vectors…
|
||||
MESSAGE( "FIXME: Boost:ublas and Eigen are both deactivated, too much features will lack, you should choose one." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
|
||||
IF(WITH_BOOST)
|
||||
FIND_PACKAGE(Boost 1.33.0)
|
||||
IF( Boost_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
|
||||
ADD_DEFINITIONS( -DWITH_BOOST )
|
||||
ELSE()
|
||||
MESSAGE( "ERROR: You asked for Boost:ublas but it has nost been found." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
ELSEIF( WITH_EIGEN )
|
||||
# FIXME FindEigen3.cmake does not work
|
||||
#find_package(Eigen3)
|
||||
#include_directories(EIGEN3_INCLUDE_DIR)
|
||||
SET( EIGEN3_FOUND 1)
|
||||
SET( EIGEN3_INCLUDE_DIR "/usr/include/eigen3/" )
|
||||
|
||||
IF( EIGEN3_FOUND )
|
||||
INCLUDE_DIRECTORIES( ${EIGEN3_INCLUDE_DIR} )
|
||||
ADD_DEFINITIONS( -DWITH_EIGEN )
|
||||
ELSE()
|
||||
MESSAGE( "ERROR: You asked for Eigen but it has nost been found." )
|
||||
SET(IS_FATAL 1)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(EO)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${EO_INCLUDE_DIRS}
|
||||
${MO_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
# /Dev/ometah-0.3/common
|
||||
)
|
||||
)
|
||||
|
||||
LINK_DIRECTORIES(
|
||||
${EO_LIBRARY_DIRS}
|
||||
)
|
||||
)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
|
@ -58,7 +90,7 @@ LINK_DIRECTORIES(
|
|||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
)
|
||||
)
|
||||
|
||||
######################################################################################
|
||||
|
||||
|
|
|
|||
Reference in a new issue