forked from leovandriel/cvplot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
49 lines (38 loc) · 1.42 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
cmake_minimum_required(VERSION 2.6)
project (cvplot)
find_package(OpenCV REQUIRED)
include_directories(include)
include_directories(${OpenCV_INCLUDE_DIRS})
find_library(GTEST_LIB gtest)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC ")
set(CVPLOT_LIB cvplot)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
if (DEFINED CVPLOT_LIB)
file(GLOB LIB_SOURCES "${PROJECT_SOURCE_DIR}/src/cvplot/*.cc")
add_library(${CVPLOT_LIB} ${LIB_SOURCES})
endif()
if (${CVPLOT_DEMO})
file(GLOB BIN_SOURCES "${PROJECT_SOURCE_DIR}/src/demo/*.cc")
foreach(filename ${BIN_SOURCES})
get_filename_component(name ${filename} NAME_WE)
add_executable(${name} ${filename})
target_link_libraries(${name} ${CVPLOT_LIB} ${OpenCV_LIBS})
endforeach()
endif()
target_include_directories ( cvplot PUBLIC ../include )
target_include_directories ( cvplot PRIVATE ../src )
install ( TARGETS cvplot
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
install ( DIRECTORY include DESTINATION .
PATTERN CMakeLists.txt EXCLUDE )
if (${CVPLOT_TEST})
file(GLOB TEST_SOURCES "${PROJECT_SOURCE_DIR}/test/cvplot/*_test.cc")
foreach(filename ${TEST_SOURCES})
get_filename_component(name ${filename} NAME_WE)
add_executable(${name} ${filename})
target_link_libraries(${name} ${CVPLOT_LIB} ${OpenCV_LIBS} ${GTEST_LIB})
endforeach()
endif()