-
Notifications
You must be signed in to change notification settings - Fork 38
/
CMakeLists.txt
107 lines (85 loc) · 2.83 KB
/
CMakeLists.txt
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
cmake_minimum_required(VERSION 2.8)
project(PEER)
#build options
#bindings
#PYTHON on by default
option(BUILD_PYTHON_PACKAGE "Enable Python bindings" ON)
#R optional
option(BUILD_R_PACKAGE "Enable R bindings" OFF)
#build stuff
option(BUILD_UNIVERSAL "Build both 32 and 64 bit versions" OFF)
#compile i386+x86_64 universal binaries on OS X
if (BUILD_UNIVERSAL)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif (BUILD_UNIVERSAL)
## Documentation for final package
# manual installation paths
##PYTHON build options##
# Path to python executable. If specified peer is built against this
# python version, otherwise "which python" is used for auto-detection
#SET(PYTHON_EXECUTABLE "")
#Python include directory
#normally there is no need to specify them;instead these are
#auto-determined from the location of the binary.
#SET(PYTHON_INCLUDE_DIRS "")
#Python install directory
#If specified, the peer module will be installed here. Otherwise the
#default site-packages location of the respective python installation
#is used.
#SET(PYTHON_INSTDIR "")
#Numpy header fiels.
#Usually there is no need to specify them as they are automatically
#determined from the python binary.
#Note: it is vital that peer is built against the exact same python
#installation that you are aiming to use.
#SET(NUMPY_INCLUDE_DIR "")
#
##/PYTHON END##
##R build options###
#set(R_EXECUTABLE "")
#R executable
#set(R_HOME "")
#R home directory
#set(R_H "")
#R include directory for headers
#set(R_INCLUDEDIR "")
#R include dir
#set(LIBR_SO)
#R dylib or dynamic link SO
##/R END##
# OLI's build options
#set(LIBR_SO "/opt/local/lib/R/lib/x86_64/libR.dylib")
##/R END
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#There are lots of scripts with cmake
#for finding external libraries.
#see /usr/local/share/cmake-2.6/Modules/Find*.cmake for more examples
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_SWIG_FLAGS "")
set(CMAKE_MODULE_PATH "${PEER_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include_directories(./include)
add_definitions(-g -Wextra -D_BSD_SOURCE)
#fPic while compiling on
#this seems to be needed on some linux systems
#set(CMAKE_CXX_FLAGS "-fPIC -O3 -march=core2")
set(CMAKE_CXX_FLAGS "-fPIC")
include_directories(./External/alglib/src)
#add Cmake modules
add_subdirectory(./External/alglib/src)
add_subdirectory(./External/csv_parser)
add_subdirectory(./src)
IF (BUILD_PEERTOOL)
add_subdirectory(./External/yaml-cpp)
endif (BUILD_PEERTOOL)
#### build external interface (optional) #####
if (BUILD_PYTHON_PACKAGE)
add_subdirectory(./python)
endif (BUILD_PYTHON_PACKAGE)
if (BUILD_R_PACKAGE)
add_subdirectory(./R)
endif (BUILD_R_PACKAGE)