Thomas Buck 10 anni fa
parent
commit
30fac87b2a
3 ha cambiato i file con 59 aggiunte e 68 eliminazioni
  1. 15
    0
      CMakeLists.txt
  2. 44
    59
      src/CMakeLists.txt
  3. 0
    9
      test/CMakeLists.txt

+ 15
- 0
CMakeLists.txt Vedi File

@@ -15,8 +15,23 @@ configure_file (
15 15
     "${PROJECT_SOURCE_DIR}/cmake/Config.h.in"
16 16
     "${PROJECT_BINARY_DIR}/Config.h"
17 17
 )
18
+
19
+# Include directories
20
+include_directories ("${PROJECT_SOURCE_DIR}/include")
18 21
 include_directories ("${PROJECT_BINARY_DIR}")
19 22
 
23
+# Include External Modules
24
+set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
25
+
26
+# Build warnings
27
+set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
28
+set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
29
+set (WARNINGS "${WARNINGS} -Wno-documentation-unknown-command -Wno-c++98-compat-pedantic")
30
+set (WARNINGS "${WARNINGS} -Wno-missing-prototypes -Wno-missing-variable-declarations")
31
+set (WARNINGS "${WARNINGS} -Wno-disabled-macro-expansion")
32
+
33
+set (WARNINGS "${WARNINGS} -Wno-shorten-64-to-32 -Wno-sign-conversion")
34
+
20 35
 # Add subdirectories
21 36
 add_subdirectory (src)
22 37
 add_subdirectory (test)

+ 44
- 59
src/CMakeLists.txt Vedi File

@@ -48,6 +48,24 @@ endif (APPLE)
48 48
 
49 49
 #################################################################
50 50
 
51
+# Flags for all builds
52
+set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11 ${WARNINGS}")
53
+set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -DUSING_EMITTER")
54
+
55
+# Flags for Debug build
56
+set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -g -O0")
57
+set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DDEBUG")
58
+set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DEXPERIMENTAL")
59
+
60
+# Flags for Releasae builds
61
+set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -ffast-math -funroll-loops")
62
+set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -fomit-frame-pointer -O2")
63
+
64
+# Apply Flags
65
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenRaider_CXX_FLAGS}")
66
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OpenRaider_CXX_FLAGS} ${OpenRaider_CXX_FLAGS_DEBUG}")
67
+set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenRaider_CXX_FLAGS} ${OpenRaider_CXX_FLAGS_RELEASE}")
68
+
51 69
 # Add utils directory
52 70
 add_subdirectory (utils)
53 71
 
@@ -57,30 +75,32 @@ add_executable (OpenRaider MACOSX_BUNDLE ${SRCS})
57 75
 #################################################################
58 76
 
59 77
 if (APPLE)
60
-    # Copy setup script
61
-    add_custom_command (TARGET OpenRaider POST_BUILD
62
-        COMMAND echo "Injecting setup script..."
63
-        COMMAND cp "${PROJECT_SOURCE_DIR}/cmake/setup_mac.sh" "${PROJECT_BINARY_DIR}/src/OpenRaider.app/Contents/MacOS/OpenRaider.sh"
64
-    )
65
-
66
-    # Fix executable name, so setup script will be called
67
-    add_custom_command (TARGET OpenRaider POST_BUILD
68
-        COMMAND echo "Changing executable name..."
69
-        COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleExecutable OpenRaider.sh" Info.plist
70
-        WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/OpenRaider.app/Contents
71
-    )
72
-
73
-    # Preparing the bundle on install
74
-    # http://www.cmake.org/Wiki/BundleUtilitiesExample
75
-    set (plugin_dest_dir OpenRaider.app/Contents/MacOS)
76
-    set (APPS "${PROJECT_BINARY_DIR}/src/OpenRaider.app")
77
-    install (CODE "
78
-        file(GLOB_RECURSE PLUGINS
79
-            \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
80
-        include(BundleUtilities)
81
-        fixup_bundle(\"${APPS}\" \"\${PLUGINS}\" \"\")
82
-        " COMPONENT Runtime
83
-    )
78
+    if (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
79
+        # Copy setup script
80
+        add_custom_command (TARGET OpenRaider POST_BUILD
81
+            COMMAND echo "Injecting setup script..."
82
+            COMMAND cp "${PROJECT_SOURCE_DIR}/cmake/setup_mac.sh" "${PROJECT_BINARY_DIR}/src/OpenRaider.app/Contents/MacOS/OpenRaider.sh"
83
+        )
84
+
85
+        # Fix executable name, so setup script will be called
86
+        add_custom_command (TARGET OpenRaider POST_BUILD
87
+            COMMAND echo "Changing executable name..."
88
+            COMMAND /usr/libexec/PlistBuddy -c "Set :CFBundleExecutable OpenRaider.sh" Info.plist
89
+            WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/src/OpenRaider.app/Contents
90
+        )
91
+
92
+        # Preparing the bundle on install
93
+        # http://www.cmake.org/Wiki/BundleUtilitiesExample
94
+        set (plugin_dest_dir OpenRaider.app/Contents/MacOS)
95
+        set (APPS "${PROJECT_BINARY_DIR}/src/OpenRaider.app")
96
+        install (CODE "
97
+            file(GLOB_RECURSE PLUGINS
98
+                \"\${CMAKE_INSTALL_PREFIX}/${plugin_dest_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
99
+            include(BundleUtilities)
100
+            fixup_bundle(\"${APPS}\" \"\${PLUGINS}\" \"\")
101
+            " COMPONENT Runtime
102
+        )
103
+    endif (${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
84 104
 endif (APPLE)
85 105
 
86 106
 #################################################################
@@ -94,41 +114,6 @@ endif (NOT APPLE)
94 114
 
95 115
 #################################################################
96 116
 
97
-# Debug build warnings
98
-set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
99
-set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
100
-set (WARNINGS "${WARNINGS} -Wno-documentation-unknown-command -Wno-c++98-compat-pedantic")
101
-set (WARNINGS "${WARNINGS} -Wno-missing-prototypes -Wno-missing-variable-declarations")
102
-set (WARNINGS "${WARNINGS} -Wno-disabled-macro-expansion")
103
-
104
-set (WARNINGS "${WARNINGS} -Wno-shorten-64-to-32 -Wno-sign-conversion")
105
-
106
-# Flags for all builds
107
-set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11")
108
-set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -DUSING_EMITTER")
109
-
110
-# Flags for Debug build
111
-set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -g -O0 ${WARNINGS}")
112
-set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DDEBUG")
113
-set (OpenRaider_CXX_FLAGS_DEBUG "${OpenRaider_CXX_FLAGS_DEBUG} -DEXPERIMENTAL")
114
-
115
-# Flags for Releasae builds
116
-set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -ffast-math -funroll-loops")
117
-set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -fomit-frame-pointer -O2")
118
-
119
-# Apply Flags
120
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenRaider_CXX_FLAGS}")
121
-set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${OpenRaider_CXX_FLAGS} ${OpenRaider_CXX_FLAGS_DEBUG}")
122
-set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${OpenRaider_CXX_FLAGS} ${OpenRaider_CXX_FLAGS_RELEASE}")
123
-
124
-# Include directory
125
-include_directories ("${PROJECT_SOURCE_DIR}/include")
126
-
127
-# Include External Modules
128
-set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
129
-
130
-#################################################################
131
-
132 117
 # Add Math Library
133 118
 set (LIBS ${LIBS} m)
134 119
 

+ 0
- 9
test/CMakeLists.txt Vedi File

@@ -4,15 +4,6 @@ include_directories ("${PROJECT_SOURCE_DIR}/include")
4 4
 # Include External Modules
5 5
 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
6 6
 
7
-# Warnings
8
-set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
9
-set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
10
-set (WARNINGS "${WARNINGS} -Wno-documentation-unknown-command -Wno-c++98-compat-pedantic")
11
-set (WARNINGS "${WARNINGS} -Wno-missing-prototypes -Wno-missing-variable-declarations")
12
-set (WARNINGS "${WARNINGS} -Wno-disabled-macro-expansion")
13
-
14
-set (WARNINGS "${WARNINGS} -Wno-shorten-64-to-32 -Wno-sign-conversion")
15
-
16 7
 # Flags for all builds
17 8
 set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11")
18 9
 set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -g -O0 ${WARNINGS}")

Loading…
Annulla
Salva