-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (52 loc) · 1.92 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
cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0054 NEW)
set(PROJECT_NAME "dynamic_bitset")
project(${PROJECT_NAME})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/Bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/Bin)
option(TESTS "Enable unit tests" ON)
option(DOCS "BUILD DOCS" OFF)
add_executable(${PROJECT_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
)
# Include Source directory as a subdirectory
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/Source)
# Add Source directory to include paths
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/Source)
get_target_property(INCLUDE_DIRS ${PROJECT_NAME} INCLUDE_DIRECTORIES)
message("Include directories for ${PROJECT_NAME}: ${INCLUDE_DIRS}")
if(TESTS)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/Tests/)
enable_testing()
endif(TESTS)
if(DOCS)
find_package(Doxygen REQUIRED)
find_package(Doxygen REQUIRED dot)
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Docs/)
set(DOXYGEN_PROJECT_NAME ${PROJECT_NAME})
set(DOXYGEN_CALL_GRAPH YES)
set(DOXYGEN_CALLER_GRAPH YES)
set(DOXYGEN_WARN_AS_ERROR YES)
set(DOXYGEN_SOURCE_BROWSER YES)
set(DOXYGEN_EXTRACT_ALL YES)
set(DOXYGEN_SORT_MEMBER_DOCS NO)
set(DOXYGEN_FILE_PATTERNS *.cpp *.h *.hpp)
set(DOXYGEN_EXCLUDE_PATTERNS */Bin/* */build/* */Tests/* *.cc main.cpp)
doxygen_add_docs(
doxygen_doc
ALL
${CMAKE_CURRENT_LIST_DIR}
COMMENT "Generate doxygen documentation for ${PROJECT_NAME}"
)
set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Docs/)
set(DOXYGEN_GENERATE_HTML YES)
set(DOXYGEN_GENERATE_MAN NO)
set(DOXYGEN_EXTRACT_ALL YES)
message("Doxygen output directory: ${DOXYGEN_OUTPUT_DIRECTORY}")
doxygen_add_docs(
doc
${CMAKE_SOURCE_DIR}/Source/dynamic_bitset.hpp
COMMENT "Generating API documentation with Doxygen"
)
endif(DOCS)