-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
68 lines (53 loc) · 1.39 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
cmake_minimum_required(VERSION 3.1)
project(rapid-af)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 11)
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
find_package(OpenCV REQUIRED)
find_package(Threads REQUIRED)
set(OTHER_FILES
.gitignore
uncrustify.cfg
README.md
Doxyfile
)
add_custom_target(project-related-files SOURCES ${OTHER_FILES})
add_library(rapid-af SHARED rapid-af.cpp)
install(TARGETS rapid-af
DESTINATION lib
EXPORT rapidAfTargets
)
install(FILES rapid-af.h
DESTINATION include
)
install(EXPORT rapidAfTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/rapid-af)
target_include_directories(rapid-af
PUBLIC
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
)
target_link_libraries(rapid-af
${OpenCV_LIBS}
Threads::Threads
)
add_executable(rapid-af-bin main.cpp)
target_link_libraries(rapid-af-bin
PUBLIC rapid-af
)
set_target_properties(rapid-af-bin
PROPERTIES OUTPUT_NAME rapid-af)
target_include_directories(rapid-af-bin
PUBLIC
$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
)
install(TARGETS rapid-af-bin DESTINATION bin)
install(
FILES
rapid-af-config.cmake
DESTINATION
${CMAKE_INSTALL_LIBDIR}/cmake/rapid-af
COMPONENT
Devel
)