aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Thomas <alec@swapoff.org>2012-10-19 15:07:17 -0400
committerAlec Thomas <alec@swapoff.org>2012-10-19 15:07:17 -0400
commit3d10171faf5db898479919fd4eb136b1ad5a0f76 (patch)
treed44b7d8b3d66a0eda8985b19a7737233d7a9cc45
parente88636d40577776db26d34d8adacddbba5bd6da8 (diff)
More install cleanup.
-rw-r--r--CMakeLists.txt40
1 files changed, 22 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f868d34..af95f27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,11 @@ macro(create_test TARGET_NAME SOURCE)
add_test(${TARGET_NAME} ${TARGET_NAME})
endmacro()
+if (NOT CMAKE_BUILD_TYPE)
+ message("-- Defaulting to release build (use -DCMAKE_BUILD_TYPE:STRING=Debug for debug build)")
+ set(CMAKE_BUILD_TYPE "Release")
+endif()
+
message("-- Checking C++ features")
require(HAS_CXX11_AUTO "C++11 auto support")
require(HAS_CXX11_NULLPTR "C++11 nullptr support")
@@ -47,20 +52,14 @@ set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.48.0 REQUIRED COMPONENTS signals)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-variable -std=c++11")
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
-set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g")
+set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
+set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
-add_library(
- entityx
- STATIC SHARED
- entityx/Components.cc
- entityx/System.cc
- entityx/Event.cc
- entityx/Entity.cc
- entityx/World.cc
- )
+set(sources entityx/Components.cc entityx/System.cc entityx/Event.cc entityx/Entity.cc entityx/World.cc)
+add_library(entityx STATIC ${sources})
+add_library(entityx_shared SHARED ${sources})
include_directories(
${Boost_INCLUDE_DIR}
@@ -73,9 +72,14 @@ create_test(event_test entityx/Event_test.cc)
create_test(system_test entityx/System_test.cc)
file(GLOB headers "${CMAKE_CURRENT_SOURCE_DIR}/entityx/*.h")
-install(FILES ${headers} DESTINATION "include/entityx")
-install(TARGETS entityx
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib
-)
+install(
+ FILES ${headers}
+ DESTINATION "include/entityx"
+ )
+
+install(
+ TARGETS entityx entityx_shared
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+ )