CMakeLists.txt 1.36 KB
Newer Older
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
1
2
3
4
5
6
7
8
9
10
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF()

IF(NOT BOOST_NUMPY_DIR)
  SET(BOOST_NUMPY_DIR ".")
ENDIF()

FIND_PACKAGE(Boost 1.45.0)
Nicolas Mansard's avatar
IVIGIT.    
Nicolas Mansard committed
11

Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
12
IF(Boost_FOUND)
Nicolas Mansard's avatar
IVIGIT.    
Nicolas Mansard committed
13

Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" "/usr/include/python2.7" "/usr/include/eigen3" "Boost.NumPy")
  LINK_DIRECTORIES(${BOOST_NUMPY_DIR})

  SET(Boost_USE_STATIC_LIBS OFF)
  SET(Boost_USE_MULTITHREADED ON)
  SET(Boost_USE_STATIC_RUNTIME OFF)
  FIND_PACKAGE(Boost 1.45.0 COMPONENTS python)

  ADD_LIBRARY(simple SHARED src/simple.cpp)
  TARGET_LINK_LIBRARIES(simple ${Boost_LIBRARIES})

  ADD_LIBRARY(mystring SHARED src/mystring.cpp)
  TARGET_LINK_LIBRARIES(mystring ${Boost_LIBRARIES})

  ADD_LIBRARY(bnpy SHARED src/bnpy.cpp)
  TARGET_LINK_LIBRARIES(bnpy ${Boost_LIBRARIES})

  ADD_LIBRARY(eigen SHARED src/eigen.cpp)
  TARGET_LINK_LIBRARIES(eigen ${Boost_LIBRARIES} libboost_numpy.so)

Nicolas Mansard's avatar
IVIGIT.    
Nicolas Mansard committed
34
35
36
37
38
39
  ADD_LIBRARY(eigenc SHARED src/eigenc.cpp)
  TARGET_LINK_LIBRARIES(eigenc ${Boost_LIBRARIES})

  ADD_LIBRARY(eigentemplate SHARED src/eigentemplate.cpp)
  TARGET_LINK_LIBRARIES(eigentemplate ${Boost_LIBRARIES})

Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
40
41
42
43
44
45
46
47
48
49
ELSEIF(NOT Boost_FOUND)
  MESSAGE(FATAL_ERROR "Unable to find correct Boost version. Did you set BOOST_ROOT?")
ENDIF()


IF(CMAKE_COMPILER_IS_GNUCXX)
  ADD_DEFINITIONS("-Wall")
ELSE()
  MESSAGE(FATAL_ERROR "CMakeLists.txt has not been tested/written for your compiler.")
ENDIF()