forked from enki-community/enki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
47 lines (37 loc) · 1.19 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
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()
if(ENKI_BUILD_TESTS)
add_subdirectory(tests)
endif()
if(ENKI_BUILD_EXAMPLES)
add_subdirectory(examples)
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)