Vec3/CMakeLists.txt

38 lines
1.1 KiB
Text
Raw Normal View History

2025-04-15 19:07:31 +00:00
cmake_minimum_required(VERSION 3.9)
2025-04-15 17:48:33 -04:00
project(Vec3)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
2025-04-15 19:07:31 +00:00
add_compile_options(-Wall -Wextra -Wpedantic)
set(CMAKE_CXX_STANDARD 17)
2025-04-15 17:48:33 -04:00
include_directories(include)
add_subdirectory(include)
2025-04-15 19:07:31 +00:00
add_subdirectory(tests)
# Doxygen Build
option(BUILD_DOC "Build Documentation" ON)
find_package(Doxygen)
if(DOXYGEN_FOUND)
set(BUILD_DOC_DIR ${CMAKE_SOURCE_DIR}/build/docs)
if(NOT EXISTS ${BUILD_DOC_DIR})
file(MAKE_DIRECTORY ${BUILD_DOC_DIR})
endif()
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen buld started")
2025-04-15 18:45:16 -04:00
add_custom_target(Doxygen_${CMAKE_PROJECT_NAME} ALL
2025-04-15 19:07:31 +00:00
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
else(DOXYGEN_FOUND)
message("Doxygen needs to be installed to generate the documentation.")
endif(DOXYGEN_FOUND)