Browse Source

default to debug configuration

Thomas Buck 10 years ago
parent
commit
e10e884d34
2 changed files with 18 additions and 6 deletions
  1. 14
    0
      CMakeLists.txt
  2. 4
    6
      README.md

+ 14
- 0
CMakeLists.txt View File

@@ -10,6 +10,16 @@ set (OpenRaider_VERSION_RELEASE -git)
10 10
 # Build Host
11 11
 set (OpenRaider_BUILD_HOST ${CMAKE_HOST_SYSTEM})
12 12
 
13
+#################################################################
14
+
15
+# Set a default build type if none was specified
16
+if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
17
+    message(STATUS "Setting build type to 'Debug' as none was specified.")
18
+    set(CMAKE_BUILD_TYPE Debug)
19
+endif()
20
+
21
+#################################################################
22
+
13 23
 # Configuration Header file
14 24
 configure_file (
15 25
     "${PROJECT_SOURCE_DIR}/cmake/Config.h.in"
@@ -23,6 +33,8 @@ include_directories ("${PROJECT_BINARY_DIR}")
23 33
 # Include External Modules
24 34
 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
25 35
 
36
+#################################################################
37
+
26 38
 # Build warnings
27 39
 set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
28 40
 set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
@@ -46,6 +58,8 @@ set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -DNDEBUG -O2"
46 58
 set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -ffast-math -funroll-loops")
47 59
 set (OpenRaider_CXX_FLAGS_RELEASE "${OpenRaider_CXX_FLAGS_RELEASE} -fomit-frame-pointer")
48 60
 
61
+#################################################################
62
+
49 63
 # Add subdirectories
50 64
 add_subdirectory (src)
51 65
 add_subdirectory (test)

+ 4
- 6
README.md View File

@@ -54,13 +54,11 @@ Linux Distributions will probably provide an ALUT library ready to install with
54 54
 
55 55
 ## Building
56 56
 
57
-Do a standard cmake out-of-source build and then run the resulting executable:
57
+Do a standard cmake out-of-source build to get a debug configuration and then run the resulting executable:
58 58
 
59
-    mkdir build
60
-    cd build
61
-    cmake -DCMAKE_BUILD_TYPE=Debug ..
62
-    make
63
-    ./src/OpenRaider
59
+    mkdir build && cd build
60
+    cmake ..
61
+    make run
64 62
 
65 63
 On Mac OS X, running `make install` will produce a (more or less) distributable OpenRaider.app bundle.
66 64
 

Loading…
Cancel
Save