-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
64 lines (50 loc) · 1.92 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
set(PROJECT_NAME "ParticleUniverse")
project(${PROJECT_NAME} CXX C)
cmake_minimum_required(VERSION 3.3)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN TRUE)
# Avoid source tree pollution
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files already created:\nrm -rf CMakeCache.txt CMakeFiles")
endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
# We want the binaries to be easily accessible
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# Append _d for debug builds
set(CMAKE_DEBUG_POSTFIX "_d")
if(UNIX)
add_definitions(-DOGRE_GCC_VISIBILITY)
endif()
# Add the libraries
# OGRE
find_package(OGRE REQUIRED CONFIG)
link_directories(${OGRE_LIBRARY_DIRS})
include_directories(${OGRE_INCLUDE_DIRS})
list(APPEND LIBS ${OGRE_LIBRARIES})
add_subdirectory(Plugins/ParticleUniverse)
# Samples and tools
set(PU_BUILD_SAMPLES ON CACHE BOOL "Build plugin samples")
set(PU_BUILD_TOOLS ON CACHE BOOL "Build tools")
if(PU_BUILD_SAMPLES)
add_subdirectory(Samples/ParticleUniverseDemo)
endif()
if(PU_BUILD_TOOLS)
add_subdirectory(Tools/AtlasImageTool)
endif()
# doxygen stuff
find_package(Doxygen)
if (DOXYGEN_FOUND)
# prepare doxygen configuration file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Plugins/ParticleUniverse/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
add_custom_target( docs
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating documentation with Doxygen."
VERBATIM
)
# cleanup $build/api-doc on "make clean"
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES docs)
endif (DOXYGEN_FOUND)