-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
85 lines (62 loc) · 2.03 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
cmake_minimum_required(VERSION 3.5)
set (CMAKE_CXX_STANDARD 11)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug")
endif()
project(cldl VERSION 1.0 LANGUAGES CXX)
include(GNUInstallDirs)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_subdirectory(tests)
set(LIBSRC
lib/Neuron.cpp
lib/Net.cpp
lib/Layer.cpp
lib/bpThread.cpp)
set(PRIVATEHEADERS
include/cldl/Neuron.h
include/cldl/Net.h
include/cldl/Layer.h
include/cldl/bpThread.h
include/cldl/CppThread.h)
if(UNIX)
add_library(cldl
SHARED
${LIBSRC}
include/cldl/CppThread.h include/cldl/bpThread.h lib/bpThread.cpp)
target_include_directories(cldl PRIVATE cldl)
set_target_properties(cldl PROPERTIES
SOVERSION 1
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER "${PUBLICHEADERS}"
PRIVATE_HEADER "${PRIVATEHEADERS}")
install(TARGETS cldl
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cldl)
endif(UNIX)
add_library(cldl_static
STATIC
${LIBSRC}
)
find_package(Threads)
target_link_libraries(cldl_static ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(cldl_static PRIVATE cldl)
set_target_properties(cldl_static PROPERTIES
VERSION ${PROJECT_VERSION}
PUBLIC_HEADER "${PUBLICHEADERS}"
PRIVATE_HEADER "${PRIVATEHEADERS}")
install(TARGETS cldl_static
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PRIVATE_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cldl)
find_package(Doxygen)
if(DOXYGEN_FOUND)
add_custom_target(docs
COMMAND ${DOXYGEN_EXECUTABLE}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
endif()