Skip to content

Commit 915c8a2

Browse files
committed
Cleaning up the cmake some by moving options to the top and adding a documentation flag to generate doxygen documentation
1 parent fb72986 commit 915c8a2

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎CMakeLists.txt‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.16)
22

33
project(dbc VERSION 0.2.0 DESCRIPTION "C++ DBC Parser")
44

5+
# -- PROJECT OPTIONS -- #
6+
option(DEBUG "use debug flag" NO)
7+
option(ENABLE_TESTS "Enable Unittests" ON)
8+
# Turn OFF, if you are using FetchContent to include it to your project
9+
option(FETCH_CONTENT_INCLUSION "Include project with FetchContent_Declare in another project. In this case the headers and the cmake files are not needed, only the library" OFF)
10+
option(GENERATE_DOCS "Use doxygen if installed to generated documentation files" OFF)
11+
# ---------------------- #
12+
513
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
614

715
# package
@@ -12,11 +20,6 @@ set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
1220
set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
1321
include(CPack)
1422

15-
option(DEBUG "use debug flag" NO)
16-
option(ENABLE_TESTS "Enable Unittests" ON)
17-
# Turn OFF, if you are using FetchContent to include it to your project
18-
option(FETCH_CONTENT_INCLUSION "Include project with FetchContent_Declare in another project. In this case the headers and the cmake files are not needed, only the library" OFF)
19-
2023
# defines variables used in the dbc.pc.in
2124
include(GNUInstallDirs)
2225

@@ -73,7 +76,9 @@ if(ENABLE_TESTS)
7376
add_subdirectory(test)
7477
endif()
7578

76-
add_subdirectory(doc)
79+
if(GENERATE_DOCS)
80+
add_subdirectory(doc)
81+
endif()
7782

7883
add_library(${PROJECT_NAME} STATIC ${SOURCE})
7984
target_link_libraries(${PROJECT_NAME} FastFloat::fast_float)

0 commit comments

Comments
 (0)