-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
executable file
·58 lines (49 loc) · 1.67 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
cmake_minimum_required(VERSION 2.8.10)
project(OGREDEPS)
set(CMAKE_MODULE_PATH "${OGREDEPS_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
if (WIN32)
add_definitions(-DWINVER=0x0500)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()
endif ()
if (APPLE AND NOT ANDROID)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
endif()
if( NOT WIN32 )
add_definitions(-DHAVE_UNISTD_H=1)
endif()
if (APPLE AND OGRE_BUILD_PLATFORM_APPLE_IOS)
# Set build variables
set(XCODE_ATTRIBUTE_SDKROOT iphoneos)
set(CMAKE_OSX_SYSROOT iphoneos)
if(XCODE_VERSION VERSION_LESS 5.0)
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_BIT)")
else()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
endif()
elseif (APPLE AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
# OgreNext no longer targets OpenGL on Apple and the first
# macOS with Metal support was El Capitan
# Also see https://github.com/OGRECave/ogre-next-deps/issues/11
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11)
if (NOT CMAKE_OSX_ARCHITECTURES)
if(XCODE_VERSION VERSION_LESS 11.0)
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
else()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
endif()
endif()
endif ()
if (ANDROID)
SET(TargetPlatform "Android")
SET(OGRE_PLATFORM OGRE_PLATFORM_ANDROID)
endif()
if (EMSCRIPTEN)
set(TargetPlatform "Emscripten")
set(OGRE_PLATFORM OGRE_PLATFORM_EMSCRIPTEN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-warn-absolute-paths -Werror=implicit-function-declaration")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-warn-absolute-paths -Werror=implicit-function-declaration")
endif()
add_subdirectory(src)