forked from TechTinkerer42/pixellight-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·129 lines (111 loc) · 4.62 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
#*********************************************************#
#* File: CMakeLists.txt *
#*
#* Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/)
#*
#* This file is part of PixelLight.
#*
#* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
#* and associated documentation files (the "Software"), to deal in the Software without
#* restriction, including without limitation the rights to use, copy, modify, merge, publish,
#* distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
#* Software is furnished to do so, subject to the following conditions:
#*
#* The above copyright notice and this permission notice shall be included in all copies or
#* substantial portions of the Software.
#*
#* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
#* BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
#* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
#* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
#* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#*********************************************************#
##################################################
## CMake
##################################################
cmake_minimum_required(VERSION 2.8.3)
##################################################
## Project
##################################################
project(PixelLight)
##################################################
## Includes
##################################################
include(cmake/CMakeTools.cmake)
include(cmake/CMakeTools_Apps.cmake)
include(cmake/CMakeTools_Docs.cmake)
include(cmake/CMakeTools_Externals.cmake)
include(PixelLight/PixelLight.cmake)
##################################################
## Prerequisites
##################################################
# Create PixelLight header file
configure_file("PixelLight/PixelLight.h.in" "${CMAKE_BINARY_DIR}/PixelLight.h")
# Create 'Bin'-directory
set(PL_BIN_DIR "${CMAKE_SOURCE_DIR}/Bin-${CMAKETOOLS_CONFIG_NAME}")
file(MAKE_DIRECTORY ${PL_BIN_DIR})
# Create 'Runtime'-directory
file(MAKE_DIRECTORY ${PL_BIN_DIR}/Runtime)
set(PL_RUNTIME_BIN_DIR "${PL_BIN_DIR}/Runtime/${CMAKETOOLS_TARGET_ARCHBITSIZE}")
file(MAKE_DIRECTORY ${PL_RUNTIME_BIN_DIR})
set(PL_RUNTIME_BIN_GITDIR "${CMAKE_SOURCE_DIR}/Bin/Runtime/${CMAKETOOLS_TARGET_ARCHBITSIZE}") # Points to the directory directly within the Git repository
# Create 'Lib'-directory
file(MAKE_DIRECTORY ${PL_BIN_DIR}/Lib)
set(PL_LIB_DIR "${PL_BIN_DIR}/Lib/${CMAKETOOLS_TARGET_ARCHBITSIZE}")
file(MAKE_DIRECTORY ${PL_LIB_DIR})
# Copy copyright and notes
copy_file(${CMAKE_SOURCE_DIR}/AUTHORS ${PL_BIN_DIR})
copy_file(${CMAKE_SOURCE_DIR}/COPYING ${PL_BIN_DIR})
copy_file(${CMAKE_SOURCE_DIR}/cc-by-nc-sa-3.txt ${PL_BIN_DIR})
copy_file(${CMAKE_SOURCE_DIR}/ReleaseNotes.txt ${PL_BIN_DIR})
# Copy Microsoft Visual C++ Redistributables
if(WIN32)
file(MAKE_DIRECTORY ${PL_RUNTIME_BIN_DIR}/VC2010_Redistributable)
copy_files("${PL_RUNTIME_BIN_GITDIR}/VC2010_Redistributable/*.*" "${PL_RUNTIME_BIN_DIR}/VC2010_Redistributable")
endif()
##################################################
## Target
##################################################
add_custom_target(PixelLight)
##################################################
## Projects
##################################################
add_subdirectory(External)
add_subdirectory(Base)
add_subdirectory(Plugins)
if(PL_SAMPLES)
add_subdirectory(Samples)
endif()
if(PL_TESTS)
add_subdirectory(Tests)
endif()
add_subdirectory(Tools)
add_subdirectory(Docs EXCLUDE_FROM_ALL)
##################################################
## Install
##################################################
# Copyright and notes
install(FILES ${CMAKE_SOURCE_DIR}/AUTHORS
${CMAKE_SOURCE_DIR}/COPYING
${CMAKE_SOURCE_DIR}/cc-by-nc-sa-3.txt
${CMAKE_SOURCE_DIR}/ReleaseNotes.txt
DESTINATION ${PL_INSTALL_ROOT} COMPONENT SDK
)
# Microsoft Visual C++ Redistributables
if(WIN32)
install(DIRECTORY ${PL_RUNTIME_BIN_GITDIR}/VC2010_Redistributable
DESTINATION ${PL_INSTALL_RUNTIME_BIN} COMPONENT SDK
)
endif()
##################################################
## Packages
##################################################
if(CMAKE_BUILD_TYPE MATCHES Release)
add_subdirectory(Packages)
endif()
##################################################
## Testing
##################################################
if(CMAKETOOLS_CONFIG_NIGHTLY)
include(CTest)
endif()