Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/CMakeLists.txt @ 10081

Last change on this file since 10081 was 9595, checked in by landauf, 12 years ago

merged r9594 to trunk

  • Property svn:eol-style set to native
File size: 3.8 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)
[3196]28INCLUDE(TargetUtilities)
[2710]29
[9550]30INCLUDE(SourceConfig.cmake)
31
[5695]32# Configure the two headers and set some options
33INCLUDE(OrxonoxConfig.cmake)
[2710]34
35################ Sub Directories ################
36
[5738]37ADD_SUBDIRECTORY(external)
38ADD_SUBDIRECTORY(libraries)
[5752]39ADD_SUBDIRECTORY(orxonox)
[8079]40SET(ORXONOX_MODULES CACHE INTERNAL "")
[5738]41ADD_SUBDIRECTORY(modules)
[1505]42
[7401]43################## Executable ###################
[1854]44
[5752]45INCLUDE_DIRECTORIES(
46  ${CMAKE_CURRENT_SOURCE_DIR}/libraries
47  ${CMAKE_CURRENT_SOURCE_DIR}/orxonox
48)
49
[5738]50# Translate argument
51IF(ORXONOX_USE_WINMAIN)
52  SET(ORXONOX_WIN32 WIN32)
[2710]53ENDIF()
[1810]54
[8351]55SET(ORXONOX_MAIN_FILES Orxonox.cc)
56
57# Add special source file for OS X
58IF(APPLE)
59  LIST(APPEND ORXONOX_MAIN_FILES OrxonoxMac.mm)
60ENDIF()
61
[5738]62ORXONOX_ADD_EXECUTABLE(orxonox-main
63  # When defined as WIN32 this removes the console window on Windows
64  ${ORXONOX_WIN32}
65  LINK_LIBRARIES
66    orxonox
67  SOURCE_FILES
[8351]68    ${ORXONOX_MAIN_FILES}
[5738]69  OUTPUT_NAME orxonox
70)
[7401]71# Main executable should depend on all modules
72ADD_DEPENDENCIES(orxonox-main ${ORXONOX_MODULES})
[1810]73
[5752]74# Get name to configure the run scripts
[5738]75GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)
76GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
77SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
[5744]78
79
[8351]80# Apple Mac OS X specific build settings
81IF(APPLE)
82  # On Apple we need to link to AppKit and Foundation frameworks
83  TARGET_LINK_LIBRARIES(orxonox-main
84    "-framework AppKit"
85    "-framework Foundation"
86  )
87
88  # Post-build step for the creation of the Dev-App bundle
89  INCLUDE(PrepareDevBundle)
90  ADD_CUSTOM_COMMAND(
91    TARGET orxonox-main
92    POST_BUILD
93    # Copy the executable into the Orxonox.app
94    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${ORXONOX_EXECUTABLE_NAME}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
95    # Copy the dev-build marker file to Orxonox.app
96    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/orxonox_dev_build.keep_me" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app/Contents/MacOS"
97    # Create a shortcut of the application to the root of the build tree
98    COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${PROJECT_NAME}.app" "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app"
99  )
100ENDIF(APPLE)
101
[7401]102#################### Doxygen ####################
103
104# Prepare include paths for Doxygen. This is necessary to display
105# the correct path to use when including a file, e.g.
106# core/XMLPort.h instead of src/core/XMLPort.h
107
108INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/modules)
109GET_DIRECTORY_PROPERTY(_temp INCLUDE_DIRECTORIES)
110# Replace ';' by spaces
111STRING(REPLACE ";" " " _temp "${_temp}")
112SET(DOXYGEN_INCLUDE_DIRECTORIES "${_temp}" PARENT_SCOPE)
Note: See TracBrowser for help on using the repository browser.