Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: sandbox_light/src/CMakeLists.txt @ 7451

Last change on this file since 7451 was 5789, checked in by rgrieder, 15 years ago

Stripped sandbox further down to get a light version that excludes almost all core features.
Also, the Ogre dependency has been removed and a little ogremath library been added.

  • Property svn:eol-style set to native
File size: 3.8 KB
Line 
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 #  Author:
21 #    Reto Grieder
22 #  Description:
23 #    Configures the compilers and sets build options.
24 #
25
26# Required macros and functions
27INCLUDE(FlagUtilities)
28INCLUDE(TargetUtilities)
29
30# Configure the two headers and set some options
31INCLUDE(OrxonoxConfig.cmake)
32
33################ Library Defines ################
34
35# Disable Boost auto linking completely
36ADD_COMPILER_FLAGS("-DBOOST_ALL_NO_LIB")
37
38# If no defines are specified, these libs get linked statically
39ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" WIN32 LINK_BOOST_DYNAMIC)
40ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   WIN32 LINK_LUA_DYNAMIC)
41
42############## Include Directories ##############
43
44# Set the search paths for include files
45INCLUDE_DIRECTORIES(
46  # External
47  ${Boost_INCLUDE_DIRS}
48  ${LUA_INCLUDE_DIR}
49  ${VLD_INCLUDE_DIR}
50
51  # All includes in "externals" should be prefixed with the path
52  # relative to "external" to avoid conflicts
53  ${CMAKE_CURRENT_SOURCE_DIR}/external
54
55  # OrxonoxConfig.h
56  ${CMAKE_CURRENT_BINARY_DIR}
57)
58
59################### Tolua Bind ##################
60
61# Create directory because the tolua application doesn't work otherwise
62IF(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR})
63  FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR})
64ENDIF()
65
66INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/toluabind/${CMAKE_CFG_INTDIR})
67
68################ Sub Directories ################
69
70ADD_SUBDIRECTORY(external)
71ADD_SUBDIRECTORY(libraries)
72ADD_SUBDIRECTORY(orxonox)
73
74################ Executable ################
75
76INCLUDE_DIRECTORIES(
77  ${CMAKE_CURRENT_SOURCE_DIR}/libraries
78  ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
79)
80
81# Translate argument
82IF(ORXONOX_USE_WINMAIN)
83  SET(ORXONOX_WIN32 WIN32)
84ENDIF()
85
86ORXONOX_ADD_EXECUTABLE(orxonox-main
87  # When defined as WIN32 this removes the console window on Windows
88  ${ORXONOX_WIN32}
89  LINK_LIBRARIES
90    orxonox
91  SOURCE_FILES
92    Orxonox.cc
93  OUTPUT_NAME orxonox
94)
95
96# Get name to configure the run scripts
97GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)
98GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
99SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
100
101
102# When using Visual Studio we want to use the output directory as working
103# directory and we also want to specify where the external dlls
104# (lua, ogre, etc.) are. The problem hereby is that these information cannot
105# be specified in CMake because they are not stored in the actual project file.
106# This workaround will create a configured *.vcproj.user file that holds the
107# right values. When starting the solution for the first time,
108# these get written to the *vcproj.yourPCname.yourname.user
109IF(MSVC)
110  IF(CMAKE_CL_64)
111    SET(MSVC_PLATFORM "x64")
112  ELSE()
113    SET(MSVC_PLATFORM "Win32")
114  ENDIF()
115  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
116         VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
117  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
118ENDIF(MSVC)
Note: See TracBrowser for help on using the repository browser.