summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKamil Kaminski <kamilkss@gmail.com>2011-08-01 18:23:59 -0500
committerKamil Kaminski <kamilkss@gmail.com>2011-08-01 18:23:59 -0500
commit50a784906f0307a7b828f9b514f77c81765c309a (patch)
tree1dc1f3122dc424273c8900d3c61b70aa3b9d02af /CMakeLists.txt
parent7d6ce57508ace1e3257a409e49900715ef5cbe11 (diff)
downloadcstring++-50a784906f0307a7b828f9b514f77c81765c309a.tar.gz
cstring++-50a784906f0307a7b828f9b514f77c81765c309a.tar.bz2
cstring++-50a784906f0307a7b828f9b514f77c81765c309a.zip
add a cmake configuration
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..682da9f
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,30 @@
+cmake_minimum_required(VERSION 2.6)
+project(cstring++)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+# preprocessor
+add_definitions(-DDEBUG)
+
+# compiler flags
+set(CMAKE_CXX_FLAGS "-Wall -std=gnu++98 -pedantic")
+if($ENV{DEBUG})
+ message("-- Enabling debug flags")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
+ set(CMAKE_BUILD_TYPE Debug)
+else($ENV{DEBUG})
+ message("-- Enabling release flags")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -march=native -mtune=native")
+ set(CMAKE_BUILD_TYPE Release)
+endif($ENV{DEBUG})
+message("-- CXX flags: ${CMAKE_CXX_FLAGS}")
+
+set(SRC_FILES
+ string.cpp
+ main.cpp
+)
+set(CMAKE_BINARY_DIR bin)
+
+include_directories(${APP_SOURCE_DIR})
+add_executable(${PROJECT_NAME} ${SRC_FILES})
+