Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/buildsystem3/src/CMakeLists.txt @ 2685

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

Fixed install target:

  • log and config file go a to separate folder each
  • The SignalHandler crash log is now "orxonox_crash.log" to avoid opening the file twice which might result in problems
  • moved tcl scripts to media/tcl8.#/ as a temporary solution. I've also created a ticket to fix this.
  • UPDATE YOUR MEDIA REPOSITORY
  • orxonox.log pre-main gets written to either %TEMP% (windows) or /tmp (Unix) and when the path was set, the content is copied.
  • removed Settings class and moved media path to Core
  • media, log and config path are now all in Core where only the media path can be configured via ini file or command line
  • Core::isDevBuild() tells whether we are running in the build or the installation directory (determined by the presence of "orxonox_dev_build.kepp_me" in the binary dir)
  • renamed Settings::getDataPath to Core::getMediaPath
  • Property svn:eol-style set to native
File size: 4.6 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################ Various Options ################
21
22# various macro includes
23INCLUDE(FlagUtilities)
24INCLUDE(GenerateToluaBindings)
25INCLUDE(InstallUtilities)
26INCLUDE(SourceFileUtilities)
27
28# Use TinyXML++
29ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")
30# OIS dynamic linking requires macro definition, at least for Windows
31ADD_COMPILER_FLAGS("-DOIS_DYNAMIC_LIB")
32# Tolua binding speedup if required
33ADD_COMPILER_FLAGS("-DTOLUA_RELEASE" Release MinSizeRel TOLUA_PARSER_RELEASE)
34
35################ OrxonoxConfig.h ################
36
37# Check endianness
38INCLUDE(TestBigEndian)
39TEST_BIG_ENDIAN(ORXONOX_BIG_ENDIAN)
40IF(NOT ORXONOX_BIG_ENDIAN)
41  SET(ORXONOX_LITTLE_ENDIAN TRUE)
42ENDIF()
43
44# 32/64 bit system check
45IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
46  SET(ORXONOX_ARCH_64 TRUE)
47ELSE()
48  SET(ORXONOX_ARCH_32 TRUE)
49ENDIF()
50
51# Platforms
52SET(ORXONOX_PLATFORM_WINDOWS ${WIN32})
53SET(ORXONOX_PLATFORM_APPLE ${APPLE})
54SET(ORXONOX_PLATFORM_UNIX ${UNIX})
55IF(UNIX AND NOT APPLE)
56  SET(ORXONOX_PLATFORM_LINUX TRUE)
57ENDIF()
58
59# Check __forceinline
60INCLUDE(CheckCXXSourceCompiles)
61SET(_source "int main() { return 0; } __forceinline void test() { return; }")
62CHECK_CXX_SOURCE_COMPILES("${_source}" HAVE_FORCEINLINE)
63
64# Check ciso646 include (operators in words)
65INCLUDE(CheckIncludeFileCXX)
66CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
67
68# XCode and Visual Studio support multiple configurations. In order to tell the
69# which one we have to define the macros separately for each configuration
70ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
71ADD_COMPILER_FLAGS("-DCMAKE_BIULD_TYPE=Release"        Release)
72ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
73ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
74
75SET(GENERATED_FILE_COMMENT
76   "DO NOT EDIT THIS FILE!
77    It has been automatically generated by CMake from OrxonoxConfig.h.in")
78# Copy and configure OrxonoxConfig which gets included in every file
79CONFIGURE_FILE(OrxonoxConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/OrxonoxConfig.h)
80
81
82############## Include Directories ##############
83
84# Set the search paths for include files
85INCLUDE_DIRECTORIES(
86  # External
87  ${OGRE_INCLUDE_DIR}
88  ${CEGUI_INCLUDE_DIR}
89  ${ENET_INCLUDE_DIR}
90  ${Boost_INCLUDE_DIRS}
91  ${OPENAL_INCLUDE_DIRS}
92  ${ALUT_INCLUDE_DIR}
93  ${VORBIS_INCLUDE_DIR}
94  ${OGG_INCLUDE_DIR}
95  ${LUA_INCLUDE_DIR}
96  ${TCL_INCLUDE_PATH}
97  ${DIRECTX_INCLUDE_DIR}
98  ${ZLIB_INCLUDE_DIR}
99
100  # All library includes are prefixed with the path to avoid conflicts
101  ${CMAKE_CURRENT_SOURCE_DIR}
102  # Bullet headers really need the include directory
103  ${CMAKE_CURRENT_SOURCE_DIR}/bullet
104  # Convenience directory
105  ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
106  # OrxonoxConfig.h
107  ${CMAKE_CURRENT_BINARY_DIR}
108  # Tolua bind files for Core
109  ${CMAKE_CURRENT_BINARY_DIR}/core/${CMAKE_CFG_INTDIR}
110  # Tolua bind files for Orxonox
111  ${CMAKE_CURRENT_BINARY_DIR}/orxonox/${CMAKE_CFG_INTDIR}
112)
113
114
115################ Sub Directories ################
116
117# Third party libraries
118ADD_SUBDIRECTORY(tolua)
119
120# Include CEGUILua if not requested otherwise
121IF(CEGUILUA_USE_INTERNAL_LIBRARY)
122  IF(NOT IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ceguilua/ceguilua-${CEGUI_VERSION})
123    MESSAGE(FATAL_ERROR "CEGUILua version not found in src folder. Update list of supported versions in LibraryConfig.cmake!")
124  ENDIF()
125
126  INCLUDE_DIRECTORIES(ceguilua/ceguilua-${CEGUI_VERSION})
127  ADD_SUBDIRECTORY(ceguilua)
128ENDIF()
129
130ADD_SUBDIRECTORY(bullet)
131ADD_SUBDIRECTORY(cpptcl)
132ADD_SUBDIRECTORY(ogreceguirenderer)
133ADD_SUBDIRECTORY(ois)
134ADD_SUBDIRECTORY(tinyxml)
135
136# Orxonox code
137ADD_SUBDIRECTORY(util)
138ADD_SUBDIRECTORY(core)
139#ADD_SUBDIRECTORY(audio)
140ADD_SUBDIRECTORY(network)
141ADD_SUBDIRECTORY(orxonox)
142
143# Apply version info
144SET_TARGET_PROPERTIES(util core network orxonox
145  PROPERTIES VERSION ${ORXONOX_VERSION})
Note: See TracBrowser for help on using the repository browser.