forked from petrocket/spacescape
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
59 lines (48 loc) · 1.8 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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
if(POLICY CMP0020)
cmake_policy(SET CMP0020 NEW) # remove if CMake >= 2.8.11 required
endif()
if(POLICY CMP0021)
cmake_policy(SET CMP0021 NEW) # remove if CMake >= 2.8.11 required
endif()
PROJECT(Spacescape)
# As moc files are generated tell CMake to look for includes there
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
# Tell Cmake to run moc when necessary
SET(CMAKE_AUTOMOC ON)
IF(APPLE)
SET(CMAKE_PREFIX_PATH "~/Qt/5.3/clang_64/lib/cmake/Qt5Widgets")
ENDIF(APPLE)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake/")
FIND_PACKAGE(OGRE REQUIRED CONFIG)
FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(POCO QUIET)
IF(APPLE)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Spacescape/app/mac/${CMAKE_BUILD_TYPE})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Spacescape/app/mac/${CMAKE_BUILD_TYPE})
ELSEIF(UNIX)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Spacescape/app/linux/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Spacescape/app/linux/bin)
ELSEIF(WIN32)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Spacescape/app/win/${CMAKE_BUILD_TYPE})
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Spacescape/app/win/${CMAKE_BUILD_TYPE})
ENDIF(APPLE)
if (NOT APPLE)
# Create debug libraries with _d postfix
set(CMAKE_DEBUG_POSTFIX "_d")
endif ()
if(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
endif(WIN32)
ADD_DEFINITIONS(-DTIXML_USE_TICPP -DEXR_SUPPORT)
INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIRS})
IF(APPLE)
INCLUDE_DIRECTORIES(${OGRE_CONFIG_INCLUDE_DIR}/OSX)
ADD_DEFINITIONS(-DQ_WS_MAC)
ENDIF(APPLE)
ADD_SUBDIRECTORY(Spacescape)
ADD_SUBDIRECTORY(SpacescapePlugin)
IF(WIN32)
ADD_SUBDIRECTORY(SpacescapeLauncher)
ENDIF(WIN32)