-
Notifications
You must be signed in to change notification settings - Fork 34
/
CMakeLists.txt
69 lines (53 loc) · 1.86 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
cmake_minimum_required(VERSION 2.8.11)
project(Enki)
# additional CMake modules
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
enable_testing()
find_package(Qt5 COMPONENTS Core Gui Widgets OpenGL)
find_package(OpenGL REQUIRED)
# check for SDL2
find_package(SDL2)
# library version
set(LIB_INSTALL_DIR lib CACHE FILEPATH "Where to install libraries")
set(LIB_VERSION_MAJOR 2) # Must be bumped for incompatible ABI changes
set(LIB_VERSION_MINOR 0)
set(LIB_VERSION_PATCH 0)
set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
add_subdirectory(enki)
if (Qt5Widgets_FOUND AND Qt5OpenGL_FOUND)
add_subdirectory(viewer)
endif()
add_subdirectory(python)
add_subdirectory(tests)
add_subdirectory(examples)
# Documentation
find_package(Doxygen)
option(BUILD_DOCUMENTATION
"Create and install the HTML based API documentation (requires Doxygen)"
${DOXYGEN_FOUND})
if (BUILD_DOCUMENTATION)
if (NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target(doc
COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc OPTIONAL)
endif()
# generate configure file
configure_file(enkiConfig.cmake.in "${PROJECT_BINARY_DIR}/enkiConfig.cmake" @ONLY)
if (WIN32 AND NOT CYGWIN)
set(INSTALL_CMAKE_DIR CMake)
else()
if (APPLE)
set(INSTALL_CMAKE_DIR Frameworks/enki.framework/Resources/CMake/)
else()
set(INSTALL_CMAKE_DIR share/enki/CMake)
endif()
endif()
install(FILES "${PROJECT_BINARY_DIR}/enkiConfig.cmake" DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)