-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·58 lines (45 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
# ---------------------------------------------------------------------------- #
# #
# Copyright: (c) 2010 - 2019 DLR (German Aerospace Center) #
# #
# ---------------------------------------------------------------------------- #
project(OpenSG CXX)
cmake_minimum_required(VERSION 3.12)
if (${CMAKE_VERSION} GREATER_EQUAL 3.16)
option(OPENSG_USE_PRECOMPILED_HEADERS "Turn on generation of precompiled headers" OFF)
set(CMAKE_UNITY_BUILD_BATCH_SIZE 20)
endif()
# use cmake 3.12's <PACKAGE>_ROOT variabled for searching
cmake_policy(SET CMP0074 NEW)
find_package(OpenGL REQUIRED)
if (WIN32)
add_definitions("/W0 /MP /bigobj -DOSG_BUILD_DLL -D_OSG_HAVE_CONFIGURED_H_ -D_CRT_SECURE_NO_WARNINGS")
else()
add_definitions("-s -Ofast -Wno-deprecated -Wno-write-strings -Wno-narrowing -Wno-unused-parameter -Wno-undefined-var-template")
endif()
option(OPENSG_INFINITE_REVERSE_PROJECTION "Use a reverse infinite projection instead of the standard OpenGL projection" OFF)
if(OPENSG_INFINITE_REVERSE_PROJECTION)
add_definitions("-DOSG_INFINITE_REVERSE_PROJECTION")
endif(OPENSG_INFINITE_REVERSE_PROJECTION)
include_directories(
"OSGBase"
"OSGSystem"
"OSGSystem/LexGenerated"
)
add_subdirectory(OSGBase)
add_subdirectory(OSGSystem)
option(OPENSG_BUILD_TESTS "Turn off building on test applications" ON)
option(OPENSG_BUILD_WINDOW "Turn on building the window API" ON)
if (OPENSG_BUILD_WINDOW)
find_package(GLUT REQUIRED)
add_definitions("-DOSG_WITH_GLUT")
include_directories("OSGWindowGLUT")
add_subdirectory(OSGWindowGLUT)
endif()
if (OPENSG_BUILD_TESTS)
if (OPENSG_BUILD_WINDOW)
add_subdirectory(Test)
else()
message(WARNING "OSGWindow not enabled, but required for building tests. Skipping tests.")
endif()
endif()