Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/SourceConfig.cmake @ 12324

Last change on this file since 12324 was 11713, checked in by landauf, 7 years ago

mark includes of external libraries as "SYSTEM" includes to avoid compiler warnings about code that we can't change anyways. in gcc this leads to the -isystem option being used instead of -I

  • Property svn:eol-style set to native
File size: 4.9 KB
RevLine 
[2710]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 #
[5695]19 #
20 #  Author:
21 #    Reto Grieder
22 #  Description:
23 #    Configures the compilers and sets build options.
24 #
[1505]25
[5695]26# Required macros and functions
[2710]27INCLUDE(FlagUtilities)
28
[7163]29####### Library Behaviour (dependencies) ########
[2710]30
[7955]31# Disable auto linking completely for Boost and POCO
[5695]32ADD_COMPILER_FLAGS("-DBOOST_ALL_NO_LIB")
[7955]33ADD_COMPILER_FLAGS("-DPOCO_NO_AUTOMATIC_LIBS")
[2710]34
[8351]35IF(WIN32)
36  # If no defines are specified, these libs get linked statically
37  ADD_COMPILER_FLAGS("-DBOOST_ALL_DYN_LINK" LINK_BOOST_DYNAMIC)
38  #ADD_COMPILER_FLAGS("-DENET_DLL"           LINK_ENET_DYNAMIC)
39  ADD_COMPILER_FLAGS("-DLUA_BUILD_AS_DLL"   LINK_LUA5.1_DYNAMIC)
40  # If no defines are specified, these libs get linked dynamically
41  ADD_COMPILER_FLAGS("-DCEGUI_STATIC -DTOLUA_STATIC" NOT LINK_CEGUI_DYNAMIC)
42  ADD_COMPILER_FLAGS("-DOGRE_STATIC_LIB"    NOT LINK_OGRE_DYNAMIC)
43  ADD_COMPILER_FLAGS("-DSTATIC_BUILD"       NOT LINK_TCL_DYNAMIC)
[2710]44
[8351]45  # Target Windows XP as minimum Windows version
46  # And try to catch all the different macro defines for that...
[11113]47  ADD_COMPILER_FLAGS("-D_WIN32_WINNT=0x0501")
48  ADD_COMPILER_FLAGS("-D_WIN32_WINDOWS=0x0501")
49  ADD_COMPILER_FLAGS("-DWINVER=0x0501")
50  ADD_COMPILER_FLAGS("-DNTDDI_VERSION=0x05010000")
[8351]51ENDIF(WIN32)
52
[8412]53# Visual Leak Dectector configuration
54IF(MSVC AND VLD_FOUND)
55  OPTION(VISUAL_LEAK_DETECTOR_ENABLE "Memory leak detector" OFF)
56  IF(VISUAL_LEAK_DETECTOR_ENABLE)
57    # Force library linking by forcing the inclusion of a symbol
[10209]58    ADD_LINKER_FLAGS("-INCLUDE:__imp_?g_vld@@3VVisualLeakDetector@@A" Debug)
[8412]59    IF(MSVC90)
60      # VS 2008 incremental linker crashes with /INCLUDE most of the time
61      REMOVE_LINKER_FLAGS("-INCREMENTAL:YES" Debug)
62      ADD_LINKER_FLAGS   ("-INCREMENTAL:NO"  Debug)
63    ENDIF()
64  ENDIF()
65ENDIF()
66
[7163]67######### Library Behaviour (external) ##########
68
[5781]69# Use TinyXML++
70ADD_COMPILER_FLAGS("-DTIXML_USE_TICPP")
71
[8416]72# Default linking for externals
73IF(CMAKE_BUILD_TYPE MATCHES "(Debug|RelForDevs)")
74  SET(_default_link_mode "SHARED")
75ELSE()
76  SET(_default_link_mode "STATIC")
77ENDIF()
[8417]78SET(_message "Link mode for external libraries that we build ourselves.
79MSVC Note: certain libraries will not be linked shared.")
[8416]80SET(ORXONOX_EXTERNAL_LINK_MODE "${_default_link_mode}" CACHE STRING "${_message}")
[7163]81
82IF(ORXONOX_EXTERNAL_LINK_MODE STREQUAL "SHARED")
83  SET(_external_shared_link TRUE)
84ELSE()
85  SET(_external_shared_link FALSE)
86ENDIF()
87# If no defines are specified, these libs get linked dynamically
[7459]88ADD_COMPILER_FLAGS("-DENET_DLL"                    WIN32     _external_shared_link)
[7163]89ADD_COMPILER_FLAGS("-DOGRE_GUIRENDERER_STATIC_LIB" WIN32 NOT _external_shared_link)
90ADD_COMPILER_FLAGS("-DOIS_STATIC_LIB"              WIN32 NOT _external_shared_link)
91
[2710]92############## Include Directories ##############
93
94# Set the search paths for include files
95INCLUDE_DIRECTORIES(
[8351]96  # OrxonoxConfig.h
97  ${CMAKE_CURRENT_BINARY_DIR}
98
99  # All includes in "externals" should be prefixed with the path
100  # relative to "external" to avoid conflicts
[9667]101  ../src/external
[8351]102  # Include directories needed even if only included by Orxonox
[9667]103  ../src/external/bullet
104  ../src/external/ois
[11713]105)
[8351]106
[11713]107INCLUDE_DIRECTORIES(
108  SYSTEM
109 
[2710]110  # External
111  ${OGRE_INCLUDE_DIR}
[5781]112  ${CEGUI_INCLUDE_DIR}
[8351]113  ${CEGUI_TOLUA_INCLUDE_DIR}
[7459]114  #${ENET_INCLUDE_DIR}
[2710]115  ${Boost_INCLUDE_DIRS}
[7224]116  ${POCO_INCLUDE_DIR}
[5781]117  ${OPENAL_INCLUDE_DIRS}
118  ${ALUT_INCLUDE_DIR}
119  ${VORBIS_INCLUDE_DIR}
120  ${OGG_INCLUDE_DIR}
[8351]121  ${LUA5.1_INCLUDE_DIR}
[5781]122  ${TCL_INCLUDE_PATH}
123  ${DIRECTX_INCLUDE_DIR}
124  ${ZLIB_INCLUDE_DIR}
[2710]125)
126
[8351]127IF(CEGUI_OLD_VERSION)
[11713]128  INCLUDE_DIRECTORIES(SYSTEM ${CEGUILUA_INCLUDE_DIR})
[5781]129ENDIF()
130
[7451]131IF (DBGHELP_FOUND)
[11713]132  INCLUDE_DIRECTORIES(SYSTEM ${DBGHELP_INCLUDE_DIR})
[7451]133ENDIF()
134
[8351]135############## CEGUI OGRE Renderer ##############
136
137IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
138  SET(CEGUI_OGRE_RENDERER_LIBRARY ogreceguirenderer_orxonox)
139ENDIF()
140
[5752]141################### Tolua Bind ##################
142
[8729]143# Add hook script to the lua code that generates the bindings
144SET(TOLUA_PARSER_HOOK_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/libraries/core/ToluaInterfaceHook.lua)
145SET(TOLUA_PARSER_DEPENDENCIES ${TOLUA_PARSER_DEPENDENCIES} ${TOLUA_PARSER_HOOK_SCRIPT})
Note: See TracBrowser for help on using the repository browser.