-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
45 lines (38 loc) · 1.15 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
cmake_minimum_required (VERSION 3.4)
project (KMC
VERSION 0.1.0
DESCRIPTION "A C++ project using CMake"
LANGUAGES CXX
)
## Require C++11 for Catch2
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
if(DEBUG)
set(CMAKE_BUILD_TYPE "Debug")
else()
set(CMAKE_BUILD_TYPE "Release")
endif()
## Add external dependencies here, e.g.:
## add_subdirectory(extern/example_sub_project)
## The directory for the library
add_subdirectory(KMC)
## Only build documentation if this is the main project, and not if it is included through add_subdirectory
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
## Docs only available if this is the main project
find_package(Doxygen QUIET)
if(Doxygen_FOUND)
add_subdirectory(docs)
else()
message(STATUS "Doxygen not found, not building docs")
endif()
## The example executable is only available for main project
#add_subdirectory(examples)
endif()
## Allow testing for main and subprojects if -DTESTS=TRUE
if(TESTS)
if(NOT DEBUG)
message("!! Diagnostic testing is not run when compiled in release mode.")
endif()
enable_testing()
add_subdirectory(tests)
endif()