-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
106 lines (77 loc) · 2.13 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 3.11.0)
project(fcl VERSION 2.2.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
if (MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wconversion -Wextra -pedantic)
endif()
include(GNUInstallDirs)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_subdirectory(tests_c)
find_package(Qt5 COMPONENTS Widgets Core OpenGL)
find_package(OpenGL)
if(Qt5_FOUND AND OPENGL_FOUND)
add_subdirectory(linefollower)
endif()
set(LIBSRC
fcl/neuron.cpp
fcl/bandpass.cpp
fcl/layer.cpp
fcl.cpp
fcl_util.cpp
)
set(PUBLICHEADERS
fcl.h
fcl_util.h
)
set(PRIVATEHEADERS
fcl/neuron.h
fcl/bandpass.h
fcl/layer.h
fcl/globals.h
)
if(UNIX)
add_library(fcl
SHARED
${LIBSRC}
)
target_include_directories(fcl PRIVATE fcl)
set_target_properties(fcl PROPERTIES
SOVERSION 2
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER "${PUBLICHEADERS}"
PRIVATE_HEADER "${PRIVATEHEADERS}")
install(TARGETS fcl
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fcl)
endif(UNIX)
add_library(fcl_static
STATIC
${LIBSRC}
)
find_package(Threads)
target_link_libraries(fcl_static ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(fcl_static PRIVATE fcl)
set_target_properties(fcl_static PROPERTIES
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER "${PUBLICHEADERS}"
PRIVATE_HEADER "${PRIVATEHEADERS}")
install(TARGETS fcl_static
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fcl)
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
endif()