-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
72 lines (55 loc) · 2.23 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
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 17)
# Metadata
project(LogiSceneGraph VERSION 0.1.0 LANGUAGES CXX)
# Add path to CMake custom modules.
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
# C++ Google Test
option(BUILD_TESTS "Build tests." ON)
option(BUILD_DOC "Build documentation" OFF)
##############################################
# BUILD LOGI LIBRARY
##############################################
# Libraries path
include(ExternalDependencies.cmake)
file(GLOB_RECURSE SRC_LIST "src/*.cpp")
add_library(LogiSceneGraph STATIC ${SRC_LIST})
target_include_directories(LogiSceneGraph PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libs/tinygltf>
$<INSTALL_INTERFACE:include>
)
target_include_directories(LogiSceneGraph PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(LogiSceneGraph GLM::glm Vulkan::Vulkan)
##########################################################
####################### DOXYGEN ##########################
##########################################################
if (BUILD_DOC)
# Check if Doxygen is installed
find_package(Doxygen)
if (DOXYGEN_FOUND)
# Set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
# Request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message("Doxygen build started")
# Note the option ALL which allows to build the docs together with the application
add_custom_target(doc_doxygen ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
else (DOXYGEN_FOUND)
message("Doxygen need to be installed to generate the doxygen documentation")
endif (DOXYGEN_FOUND)
endif (BUILD_DOC)
##############################################
# TESTS
##############################################
if (BUILD_TESTS)
enable_testing()
add_subdirectory(test)
endif (BUILD_TESTS)