ref: 33bc39397f3bef48d5c1c688bfec929db653c9d5
parent: fa1413c69747f35c396fce8bbd8d2fba005bb11e
author: Tuomas Virtanen <[email protected]>
date: Fri Apr 4 12:05:43 EDT 2014
CMake improvements and cleanups Add missing "-msse" flag, clean up old BUILD_SHARED flags (cmake has its own system for doing this) and add a couple more build targets.
--- a/dumb/cmake/CMakeLists.txt
+++ b/dumb/cmake/CMakeLists.txt
@@ -1,13 +1,12 @@
cmake_minimum_required(VERSION 2.6)
project(libdumb C)
-OPTION(BUILD_SHARED "Build Shared Library (OFF for Static)" ON)
+set(CMAKE_C_FLAGS "-Wall -DDUMB_DECLARE_DEPRECATED -D_USE_SSE -msse -Wno-unused-variable -Wno-unused-but-set-variable")
+set(CMAKE_C_FLAGS_DEBUG "-ggdb -DDEBUGMODE=1 -D_DEBUG")
+set(CMAKE_C_FLAGS_RELEASE "-ffast-math -O2 -DNDEBUG")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "-ffast-math -g -O2 -DNDEBUG")
+set(CMAKE_C_FLAGS_MINSIZEREL "-ffast-math -Os -DNDEBUG")
-set(COMMON_FLAGS "-Wall -DDUMB_DECLARE_DEPRECATED -D_USE_SSE -Wno-unused-but-set-variable")
-set(CMAKE_C_FLAGS "${COMMON_FLAGS} -ffast-math -O2")
-set(CMAKE_C_FLAGS_DEBUG "${COMMON_FLAGS} -ggdb -DDEBUGMODE")
-set(CMAKE_C_FLAGS_RELEASE "${COMMON_FLAGS} -ffast-math -O2")
-
# Make sure the dylib install name path is set on OSX so you can include dumb in app bundles
IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_target_properties(dumb PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
@@ -108,12 +107,7 @@
../include/dumb.h
)
-IF(BUILD_SHARED)
- add_library(dumb SHARED ${SOURCES})
-ELSE(BUILD_SHARED)
- add_library(dumb STATIC ${SOURCES})
-ENDIF(BUILD_SHARED)
-
+add_library(dumb ${SOURCES})
set_target_properties(dumb PROPERTIES DEBUG_POSTFIX d)
INSTALL(FILES ${INSTALL_HEADERS} DESTINATION include/dumb/)