-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeListsExampleForUseLibraryInYourProject.txt
137 lines (53 loc) · 2.07 KB
/
CMakeListsExampleForUseLibraryInYourProject.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
######################CMAKE FOR BUILD PROJECT WITH ROBOTLABLIBRARY#####################
cmake_minimum_required(VERSION 2.8.8)
set(ROBOTLABLIBRARY_PATH /home/adrien/Documents/testAPI/RobotLabLibrary)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${ROBOTLABLIBRARY_PATH}/cmake/Modules/")
#project declaration
project(myProject)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif(NOT WIN32)
if(NOT WIN32)
find_package(OpenCV)
find_package(PocketSphinx)
find_package(SphinxBase)
endif(NOT WIN32)
#variable declaration
set(EXEC_NAME myProject)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
if(WIN32)
set(POCKETSPHINX_LIB pocketsphinx sphinxbase)
set(OPENCV_LIB opencv_ts300 opencv_world300)
endif(WIN32)
#add link for the lib
if(WIN32)
include_directories(${ROBOTLABLIBRARY_PATH}/3rdparty/opencv/include)
include_directories(${ROBOTLABLIBRARY_PATH}/3rdparty/pocketSphinx/include)
include_directories(${ROBOTLABLIBRARY_PATH}/3rdparty/sphinxbase/include)
link_directories(${ROBOTLABLIBRARY_PATH}/3rdparty/pocketSphinx/bin)
link_directories(${ROBOTLABLIBRARY_PATH}/3rdparty/opencv/bin)
else(WIN32)
include_directories(${POCKETSPHINX_INCLUDE_DIRS})
include_directories(${SPHINXBASE_INCLUDE_DIRS})
endif(WIN32)
#For RobotLabLibrary
set(ROBOTLAB_LIB RobotLabLibrary)
include_directories(${ROBOTLABLIBRARY_PATH}/include)
if(WIN32)
link_directories(${ROBOTLABLIBRARY_PATH}/bin)
else(WIN32)
SET(BUILD_SAMPLE OFF CACHE BOOL "Build RobotLabLibrary")
add_subdirectory(${ROBOTLABLIBRARY_PATH} ${ROBOTLABLIBRARY_PATH}/bin/ubuntu)
endif(WIN32)
#executions config
add_executable(
${EXEC_NAME}
myProject.cpp
)
if(WIN32)
target_link_libraries( ${EXEC_NAME} ${OPENCV_LIB} ${POCKETSPHINX_LIB} ${ROBOTLAB_LIB})
else(WIN32)
target_link_libraries( ${EXEC_NAME} ${POCKETSPHINX_LIBRARIES} ${SPHINXBASE_LIBRARIES} ${SPHINXAD_LIBRARIES} ${OpenCV_LIBS} ${ROBOTLAB_LIB})
endif(WIN32)