Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/forks/sandbox_light/src/CMakeLists.txt @ 11020

Last change on this file since 11020 was 7908, checked in by rgrieder, 14 years ago

Stripped down trunk to form a new light sandbox.

  • Property svn:eol-style set to native
File size: 4.5 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 Behaviour (dependencies) ########
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)
40# If no defines are specified, these libs get linked dynamically
41#ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       WIN32 NOT LINK_TCL_DYNAMIC)
42
43######### Library Behaviour (external) ##########
44
45# Default linking for externals is SHARED
46SET(ORXONOX_EXTERNAL_LINK_MODE SHARED CACHE STRING "Link mode for external libraries that we build ourselves. Note: on Windows, some libraries cannot be linked shared.")
47
48IF(ORXONOX_EXTERNAL_LINK_MODE STREQUAL "SHARED")
49  SET(_external_shared_link TRUE)
50ELSE()
51  SET(_external_shared_link FALSE)
52ENDIF()
53
54############## Include Directories ##############
55
56# Set the search paths for include files
57INCLUDE_DIRECTORIES(
58  # External
59  ${Boost_INCLUDE_DIRS}
60  ${POCO_INCLUDE_DIR}
61
62  # All includes in "externals" should be prefixed with the path
63  # relative to "external" to avoid conflicts
64  ${CMAKE_CURRENT_SOURCE_DIR}/external
65  # Include directories needed even if only included by Orxonox
66  #${CMAKE_CURRENT_SOURCE_DIR}/external/ois
67
68  # OrxonoxConfig.h
69  ${CMAKE_CURRENT_BINARY_DIR}
70)
71
72IF (DBGHELP_FOUND)
73  INCLUDE_DIRECTORIES(${DBGHELP_INCLUDE_DIR})
74ENDIF()
75
76################ Sub Directories ################
77
78ADD_SUBDIRECTORY(external)
79ADD_SUBDIRECTORY(libraries)
80ADD_SUBDIRECTORY(orxonox)
81
82################## Executable ###################
83
84INCLUDE_DIRECTORIES(
85  ${CMAKE_CURRENT_SOURCE_DIR}/libraries
86  ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
87)
88
89# Translate argument
90IF(ORXONOX_USE_WINMAIN)
91  SET(ORXONOX_WIN32 WIN32)
92ENDIF()
93
94ORXONOX_ADD_EXECUTABLE(orxonox-main
95  # When defined as WIN32 this removes the console window on Windows
96  ${ORXONOX_WIN32}
97  LINK_LIBRARIES
98    orxonox
99  SOURCE_FILES
100    Orxonox.cc
101  OUTPUT_NAME orxonox
102)
103
104# Get name to configure the run scripts
105GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)
106GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
107SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
108
109
110# When using Visual Studio we want to use the output directory as working
111# directory and we also want to specify where the external dlls
112# (lua, ogre, etc.) are. The problem hereby is that these information cannot
113# be specified in CMake because they are not stored in the actual project file.
114# This workaround will create a configured *.vcproj.user file that holds the
115# right values. When starting the solution for the first time,
116# these get written to the *vcproj.yourPCname.yourname.user
117IF(MSVC)
118  IF(CMAKE_CL_64)
119    SET(MSVC_PLATFORM "x64")
120  ELSE()
121    SET(MSVC_PLATFORM "Win32")
122  ENDIF()
123  STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
124         VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
125  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
126ENDIF(MSVC)
127
128#################### Doxygen ####################
129
130# Prepare include paths for Doxygen. This is necessary to display
131# the correct path to use when including a file, e.g.
132# core/XMLPort.h instead of src/core/XMLPort.h
133
134INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/modules)
135GET_DIRECTORY_PROPERTY(_temp INCLUDE_DIRECTORIES)
136# Replace ';' by spaces
137STRING(REPLACE ";" " " _temp "${_temp}")
138SET(DOXYGEN_INCLUDE_DIRECTORIES "${_temp}" PARENT_SCOPE)
Note: See TracBrowser for help on using the repository browser.