-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
39 lines (32 loc) · 1.06 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
cmake_minimum_required(VERSION 3.11)
project(ANN)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
include_directories(include)
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
add_executable(dnn ${SOURCES})
if(NOT TARGET spdlog)
# Stand-alone build
find_package(spdlog REQUIRED)
endif()
target_link_libraries(dnn PRIVATE spdlog::spdlog $<$<BOOL:${MINGW}>:ws2_32>)
# Used to turn on all types of logs. The default
# value of the variable DEBUG is OFF and
# can be activated using `cmake -DDEBUG=ON`
option(DEBUG "Enable debug mod" OFF)
if(DEBUG)
add_compile_definitions(DEBUG)
endif()
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/test")
enable_testing()
# Doxygen
find_package(Doxygen REQUIRED)
add_custom_target(
documentation ALL
COMMAND [ -d "./doc" ] && echo "./doc already exists" || mkdir "./doc"
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile 2> "./doc/warning.txt"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating doc with Doxygen"
VERBATIM
)