This repository has been archived by the owner on Jul 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
/
CMakeLists.txt
185 lines (143 loc) · 6.33 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
cmake_minimum_required(VERSION 2.8)
if(POLICY CMP0040)
cmake_policy(SET CMP0040 OLD)
endif()
PROJECT(VSXu)
set(VSXU_VERSION_MAJOR "0")
set(VSXU_VERSION_MINOR "6")
set(VSXU_VERSION_PATCH "3")
set(VSXU_VERSION ${VSXU_VERSION_MAJOR}.${VSXU_VERSION_MINOR}.${VSXU_VERSION_PATCH})
message("---------------------------------------------------------------------")
message(" Configuring Vovoid VSXu ")
message("=====================================================================")
################################################################################
# CMAKE MODULE PATH ############################################################
################################################################################
set (CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
################################################################################
# GLOBAL INSTALL VARIABLES #####################################################
################################################################################
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(VSXU_INSTALL_INCLUDE_DIR "include/vsxu")
set(VSXU_INSTALL_LIB_DIR "lib${LIB_SUFFIX}")
set(VSXU_INSTALL_BIN_DIR "bin")
set(VSXU_INSTALL_SHARE_DIR "share/vsxu")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (VSXU_WINDOWS_LIB_BUILD)
set(VSXU_INSTALL_INCLUDE_DIR "include/vsxu")
set(VSXU_INSTALL_LIB_DIR "lib${LIB_SUFFIX}")
set(VSXU_INSTALL_BIN_DIR "bin")
set(VSXU_INSTALL_SHARE_DIR "share/vsxu")
else()
set(VSXU_INSTALL_INCLUDE_DIR "include")
set(VSXU_INSTALL_LIB_DIR ".")
set(VSXU_INSTALL_BIN_DIR ".")
set(VSXU_INSTALL_SHARE_DIR "share")
endif()
endif()
######################################################################################
enable_testing()
######################################################################################
# Install the Global Headers so as to install VSXu as a library
if (UNIX OR VSXU_WINDOWS_LIB_BUILD)
file(GLOB HEADERS "*.h")
install (FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/${VSXU_INSTALL_INCLUDE_DIR} COMPONENT Devel)
endif()
################################################################################
# DEFINES ######################################################################
################################################################################
# C++14: set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive" )
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -MP8")
set(VSXU_STATIC 1)
add_definitions(-DVSXU_STATIC)
add_definitions(-DGLEW_STATIC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
include_directories( dependencies/SDL2_prebuilt_windows/include )
include_directories( dependencies/glew-1.7.0/include )
include_directories( lib/engine_graphics/thirdparty/ftgl)
include_directories( lib/engine_graphics/thirdparty/ftgl/src)
include_directories( lib/engine_graphics/thirdparty/freetype2/include )
include_directories( lib/engine_graphics/thirdparty/freetype2/include/freetype )
include_directories( lib/engine_graphics/thirdparty/freetype2/include/freetype/config )
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
add_definitions( -Wall -Wno-sign-compare)
add_definitions(-fmax-errors=500)
if (VSXU_STATIC EQUAL 1)
add_definitions(-g)
add_definitions(-DVSXU_STATIC)
add_definitions(-DGLEW_STATIC)
endif()
if(VSXU_DEBUG_SYMBOLS)
add_definitions(-g)
endif()
endif()
if (VSXU_STATIC_AUDIO_SINK EQUAL 1)
add_definitions(-DVSXU_AUDIO_SINK=1)
endif()
if (VSX_PRINTF_TO_FILE EQUAL 1)
add_definitions(-DVSX_PRINTF_TO_FILE)
endif()
include (cmake/optimization.txt)
add_definitions(-DVSXU_INSTALL_LIB_DIR="${VSXU_INSTALL_LIB_DIR}")
#add_definitions(-DVSX_VECTOR_TYPE_DOUBLE=1)
################################################################################
# VSXU LIBRARIES ###############################################################
################################################################################
add_subdirectory(lib/engine_graphics)
# order matters - need to add plugins before engine to create static glue ######
add_subdirectory(plugins)
################################################################################
add_subdirectory(lib/application)
add_subdirectory(lib/common)
add_subdirectory(lib/compression)
add_subdirectory(lib/engine)
add_subdirectory(lib/widget)
################################################################################
# VSXU IMPLEMENTATIONS/BINARIES ################################################
################################################################################
add_subdirectory(programs/launcher)
add_subdirectory(programs/artiste)
add_subdirectory(programs/player)
if (VSXU_DEMO_PLAYER)
add_subdirectory(programs/player_demo)
endif()
add_subdirectory(programs/profiler)
if(UNIX)
add_subdirectory(programs/server)
endif(UNIX)
add_subdirectory(programs/tools/vsxbt)
add_subdirectory(programs/tools/vsxz)
add_subdirectory(programs/tools/obj2vxm)
add_subdirectory(programs/tools/raw2wav)
if(UNIX)
add_subdirectory(programs/tools/vsxl)
endif(UNIX)
################################################################################
# The pkg-config file
################################################################################
IF (UNIX OR VSXU_WINDOWS_LIB_BUILD)
if (VSXU_STATIC EQUAL 1 AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/plugins/static_factory_pkgconfig_libs")
file (STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/plugins/static_factory_pkgconfig_libs" VSXU_PLUGIN_PKGCONFIG_LIBS)
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/libvsx.pc.in.static
${CMAKE_CURRENT_BINARY_DIR}/libvsx.pc
@ONLY)
else()
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/libvsx.pc.in.dynamic
${CMAKE_CURRENT_BINARY_DIR}/libvsx.pc
@ONLY)
endif()
INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/libvsx.pc
DESTINATION ${VSXU_INSTALL_LIB_DIR}/pkgconfig)
ENDIF()
include(CPackLists.txt)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)