1 | # |
---|
2 | # ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | # > www.orxonox.net < |
---|
4 | # |
---|
5 | # This program is free software; you can redistribute it and/or |
---|
6 | # modify it under the terms of the GNU General Public License |
---|
7 | # as published by the Free Software Foundation; either version 2 |
---|
8 | # of the License, or (at your option) any later version. |
---|
9 | # |
---|
10 | # This program is distributed in the hope that it will be useful, |
---|
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | # GNU General Public License for more details. |
---|
14 | # |
---|
15 | # You should have received a copy of the GNU General Public License along |
---|
16 | # with this program; if not, write to the Free Software Foundation, |
---|
17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
18 | # |
---|
19 | |
---|
20 | SET_SOURCE_FILES(ORXONOX_SRC_FILES |
---|
21 | CameraManager.cc |
---|
22 | GraphicsEngine.cc |
---|
23 | LevelManager.cc |
---|
24 | Main.cc |
---|
25 | PawnManager.cc |
---|
26 | PlayerManager.cc |
---|
27 | ) |
---|
28 | ADD_SUBDIRECTORY(gamestates) |
---|
29 | ADD_SUBDIRECTORY(gui) |
---|
30 | ADD_SUBDIRECTORY(objects) |
---|
31 | ADD_SUBDIRECTORY(overlays) |
---|
32 | ADD_SUBDIRECTORY(tools) |
---|
33 | GET_ALL_HEADER_FILES(ORXONOX_HDR_FILES) |
---|
34 | SET(ORXONOX_FILES ${ORXONOX_SRC_FILES} ${ORXONOX_HDR_FILES}) |
---|
35 | |
---|
36 | GENERATE_SOURCE_GROUPS(${ORXONOX_FILES}) |
---|
37 | GENERATE_TOLUA_BINDINGS(Orxonox ORXONOX_FILES INPUTFILES gui/GUIManager.h) |
---|
38 | |
---|
39 | # Not using precompiled header files: Avoid dependencies |
---|
40 | INCLUDE_DIRECTORIES(pch/nopch) |
---|
41 | |
---|
42 | ADD_EXECUTABLE(orxonox ${ORXONOX_FILES}) |
---|
43 | GET_TARGET_PROPERTY(_exec_loc orxonox LOCATION) |
---|
44 | GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME) |
---|
45 | SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "") |
---|
46 | |
---|
47 | IF(NETWORKTRAFFIC_TESTING_ENABLED) |
---|
48 | SET(ORXONOXS_SRC_FILES |
---|
49 | GraphicsEngine.cc |
---|
50 | objects/Camera.cc |
---|
51 | CameraManager.cc |
---|
52 | ) |
---|
53 | ADD_LIBRARY(orxonoxs SHARED ${ORXONOXS_SRC_FILES}) |
---|
54 | ENDIF(NETWORKTRAFFIC_TESTING_ENABLED) |
---|
55 | |
---|
56 | TARGET_LINK_LIBRARIES(orxonox |
---|
57 | ${OGRE_LIBRARY} |
---|
58 | ${CEGUI_LIBRARY} |
---|
59 | ${LUA_LIBRARIES} |
---|
60 | ${CEGUILUA_LIBRARY} |
---|
61 | ${Boost_SYSTEM_LIBRARY} |
---|
62 | ogreceguirenderer_orxonox |
---|
63 | tinyxml++_orxonox |
---|
64 | tolua++_orxonox |
---|
65 | bullet_orxonox |
---|
66 | util |
---|
67 | core |
---|
68 | network |
---|
69 | #audio |
---|
70 | ) |
---|
71 | |
---|
72 | ORXONOX_INSTALL(orxonox) |
---|
73 | |
---|
74 | |
---|
75 | # When using Visual Studio we want to use the output directory as working |
---|
76 | # directory and we also want to specify where the external dlls |
---|
77 | # (lua, ogre, etc.) are. The problem hereby is that these information cannot |
---|
78 | # be specified in CMake because they are not stored in the actual project file. |
---|
79 | # This workaround will create a configured *.vcproj.user file that holds the |
---|
80 | # right values. When starting the solution for the first time, |
---|
81 | # these get written to the *vcproj.yourPCname.yourname.user |
---|
82 | IF(MSVC) |
---|
83 | IF(CMAKE_CL_64) |
---|
84 | SET(MSVC_PLATFORM "x64") |
---|
85 | ELSE() |
---|
86 | SET(MSVC_PLATFORM "Win32") |
---|
87 | ENDIF() |
---|
88 | STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1" |
---|
89 | VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}") |
---|
90 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox.vcproj.user" "${CMAKE_CURRENT_BINARY_DIR}/orxonox.vcproj.user") |
---|
91 | ENDIF(MSVC) |
---|