-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.old
110 lines (79 loc) · 3.24 KB
/
CMakeLists.old
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
107
108
109
110
cmake_minimum_required(VERSION 2.8)
project(cpp)
#Variables
set(Boost_INCLUDE_DIR "/home/prass/Libraries/boost_1_64_0")
set(OpenCV_DIR "/home/prass/Libraries/opencv-3.2.0/build")
#Defaults
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -fPIC") #No Warnings while compiling
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
#set(BUILD_SHARED_LIBS OFF)
#Openmp flags
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
#Boost
#set(Boost_USE_STATIC_LIBS ON)
find_package(Boost COMPONENTS program_options python serialization numpy)
message("Include dirs of boost: " ${Boost_INCLUDE_DIRS} )
message("Libs of boost: " ${Boost_LIBRARIES} )
#Python
#
#message("Include dirs of Python: " ${PYTHON_INCLUDE_DIRS} )
#message("Libs of Python: " ${PYTHON_LIBRARIES} )
#OpenCV
#set(OpenCV_STATIC ON)
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
message("Include dirs of boost: " ${OpenCV_INCLUDE_DIRS} )
#LINK_LIBRARIES(${Boost_LIBRARIES} ${PYTHON_LIBRARIES}) # Deprecated but so convenient!
include_directories(
${Boost_INCLUDE_DIRS}
)
set(SOURCE_FILES
source/Classification.cpp
source/CommandLineParser.cpp
source/CumulativeNormalDistribution.cpp
source/DataPointCollection.cpp
#demo/source/DensityEstimation.cpp
source/dibCodec.cpp
source/FeatureResponseFunctions.cpp
source/FloydWarshall.cpp
source/Graphics.cpp
source/main.cpp
source/Platform.cpp
source/PlotCanvas.cpp
#demo/source/Regression.cpp
#demo/source/SemiSupervisedClassification.cpp
source/StatisticsAggregators.cpp)
include_directories("${CMAKE_SOURCE_DIR}/lib")
include_directories("${CMAKE_SOURCE_DIR}/demo/source")
#Main Stuff
add_executable(rf ${SOURCE_FILES})
#target_link_libraries(sw ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} svmlib svm)
target_link_libraries(rf ${Boost_LIBRARIES} ${OpenCV_LIBS} )
add_library(rflib ${SOURCE_FILES})
target_link_libraries(rflib ${Boost_LIBRARIES} ${OpenCV_LIBS} )
##PYWRAPPER - BOOST TEST
find_package(PythonLibs 2.7 REQUIRED)
find_package(PythonInterp 2.7 REQUIRED)
#find_package(BoostNumPy REQUIRED)
find_package(OpenMP)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${BOOST_PYTHON_INCLUDE_DIR})
#include_directories(${BOOST_NUMPY_INCLUDE_DIR})
add_library(rfsvm SHARED pyWrapper/wrapper.cpp)
# Ensure the output binary is called TestModule.so on Linux (not libTestModule.so)
set_target_properties(rfsvm PROPERTIES PREFIX "")
if(WIN32)
# Ensure the output binary is called TestModule.pyd on Windows (not TestModule.dll)
set_target_properties(rfsvm PROPERTIES SUFFIX ".pyd")
endif(WIN32)
#target_link_libraries(rfsvm ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${BOOST_NUMPY_LIBRARY} rflib)
target_link_libraries(rfsvm ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} rflib)