-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
49 lines (36 loc) · 1.48 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
cmake_minimum_required(VERSION 2.6)
project(generator)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GNUInstallDirs)
if(MSVC)
add_definitions(/W3)
else()
add_definitions(-std=c++11 -pedantic -Wall -Wextra)
endif()
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)
include_directories(${CMAKE_SOURCE_DIR}/include)
option(GENERATOR_USE_GLM "Use GLM instead of GML (experimental)" OFF)
if(GENERATOR_USE_GLM)
message(STATUS "Using GLM instead of GML for math (note the similar names). Support for this is experimental!")
add_definitions(-DGENERATOR_USE_GLM -DGLM_ENABLE_EXPERIMENTAL)
endif()
if(GENERATOR_USE_GLM)
option(GENERATOR_SUFFIX_GLM "Suffix library name with 'glm' when using GLM (otherwise, does nothing)" OFF)
set(GLM_INCLUDE_DIR "" CACHE FILEPATH "GLM include path")
if(GENERATOR_SUFFIX_GLM AND GENERATOR_USE_GLM)
set(SUFFIX "-glm")
endif()
else()
set(GML_INCLUDE_DIR "" CACHE FILEPATH "GML include path")
endif()
if(GML_INCLUDE_DIR AND NOT GENERATOR_USE_GLM)
include_directories(SYSTEM ${GML_INCLUDE_DIR})
elseif(GLM_INCLUDE_DIR AND GENERATOR_USE_GLM)
include_directories(SYSTEM ${GLM_INCLUDE_DIR})
endif()
set(TARGET_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}generator${SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX})
message(STATUS "Target name is '${TARGET_NAME}'")
add_subdirectory(src)
add_subdirectory(images)
install(DIRECTORY include/generator DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES lib/${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})