CMakeLists.txt 1.15 KB
Newer Older
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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)
IF(Boost_FOUND)
  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)

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()