1 | # |
---|
2 | # ORXONOX - the hottest 3D action shooter ever to exist |
---|
3 | # > www.orxonox.net < |
---|
4 | # |
---|
5 | # |
---|
6 | # License notice: |
---|
7 | # |
---|
8 | # This program is free software; you can redistribute it and/or |
---|
9 | # modify it under the terms of the GNU General Public License |
---|
10 | # as published by the Free Software Foundation; either version 2 |
---|
11 | # of the License, or (at your option) any later version. |
---|
12 | # |
---|
13 | # This program is distributed in the hope that it will be useful, |
---|
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | # GNU General Public License for more details. |
---|
17 | # |
---|
18 | # You should have received a copy of the GNU General Public License |
---|
19 | # along with this program; if not, write to the Free Software |
---|
20 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
21 | # |
---|
22 | # Author: |
---|
23 | # Reto Grieder |
---|
24 | # Co-authors: |
---|
25 | # ... |
---|
26 | # |
---|
27 | |
---|
28 | # If you want to set specific options for your platform, simply |
---|
29 | # create a file called "ConfigUser.cmake" in the binary folder |
---|
30 | # (see at the bottom of the file) |
---|
31 | |
---|
32 | ############ Misc Default Options ############### |
---|
33 | |
---|
34 | SET(LIBRARY_DEBUG_POSTFIX "_d") |
---|
35 | |
---|
36 | OPTION(EXTRA_WARNINGS "Enable some extra warnings (pollutes the output heavily)") |
---|
37 | IF(EXTRA_WARNINGS) |
---|
38 | SET(ORXONOX_WARNING_FLAGS "-Wextra --Wno-unsued-parameter") |
---|
39 | ELSE(EXTRA_WARNINGS) |
---|
40 | SET(ORXONOX_WARNING_FLAGS "-Wall") |
---|
41 | ENDIF(EXTRA_WARNINGS) |
---|
42 | |
---|
43 | MARK_AS_ADVANCED( |
---|
44 | LIBRARY_DEBUG_POSTFIX |
---|
45 | ORXONOX_WARNINGS_FLAGS |
---|
46 | ) |
---|
47 | |
---|
48 | ###### Default Compiler/Linker Options ########## |
---|
49 | # Most people use GCC to compile orxonox, so use that as default |
---|
50 | |
---|
51 | SET(CMAKE_C_FLAGS "$ENV{CFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") |
---|
52 | SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} ${ORXONOX_WARNING_FLAGS} -fPIC") |
---|
53 | # These flags are added to the flags above |
---|
54 | SET(CMAKE_C_FLAGS_DEBUG " -g -ggdb") |
---|
55 | SET(CMAKE_CXX_FLAGS_DEBUG " -g -ggdb") |
---|
56 | SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") |
---|
57 | SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") |
---|
58 | SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") |
---|
59 | SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -ggdb -DNDEBUG") |
---|
60 | SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG") |
---|
61 | SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") |
---|
62 | |
---|
63 | SET(CMAKE_LD_FLAGS "$ENV{LDFLAGS}") |
---|
64 | SET(CMAKE_EXE_LINKER_FLAGS " --no-undefined") |
---|
65 | SET(CMAKE_SHARED_LINKER_FLAGS " --no-undefined") |
---|
66 | SET(CMAKE_MODULE_LINKER_FLAGS " --no-undefined") |
---|
67 | |
---|
68 | ########## Plaform Specific Config ############## |
---|
69 | |
---|
70 | # Set the platform specific options and paths |
---|
71 | INCLUDE(ConfigTardis) |
---|
72 | INCLUDE(ConfigMSVC) |
---|
73 | INCLUDE(ConfigMinGW) |
---|
74 | # User can create his own file if required |
---|
75 | IF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake) |
---|
76 | INCLUDE(${CMAKE_BINARY_DIR}/ConfigUser) |
---|
77 | ENDIF(EXISTS ${CMAKE_BINARY_DIR}/ConfigUser.cmake) |
---|