From 76828e68aa9b30c4c6afac2fbbac1964d11226b6 Mon Sep 17 00:00:00 2001 From: Daniel Guzman Date: Wed, 6 Apr 2016 22:07:07 +0200 Subject: Fixed shared library compilation. - Fixed that when ENTITYX_BUILD_SHARED=1 was compiling the static library and the shared_library. Now it only compiles one of them, shared or static, but not both. Using visual studio compiler, now, the shared library doesn't create a .lib file (because it doesn't export anything which is OK). This will be the next step. --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 993badb..8760165 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,11 +129,9 @@ message("-- Checking misc features") require(HAVE_STDINT_H "stdint.h") # Things to install -set(install_libs entityx) + set(sources entityx/System.cc entityx/Event.cc entityx/Entity.cc entityx/help/Timer.cc entityx/help/Pool.cc) -add_library(entityx STATIC ${sources}) -set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx) if (ENTITYX_BUILD_SHARED) message("-- Building shared libraries (-DENTITYX_BUILD_SHARED=0 to only build static librarires)") @@ -147,7 +145,11 @@ if (ENTITYX_BUILD_SHARED) VERSION ${ENTITYX_VERSION} SOVERSION ${ENTITYX_MAJOR_VERSION} FOLDER entityx) - list(APPEND install_libs entityx_shared) + set(install_libs entityx_shared) +else() + add_library(entityx STATIC ${sources}) + set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx) + set(install_libs entityx) endif (ENTITYX_BUILD_SHARED) if (ENTITYX_BUILD_TESTING) @@ -197,4 +199,5 @@ install( TARGETS ${install_libs} LIBRARY DESTINATION "${libdir}" ARCHIVE DESTINATION "${libdir}" + RUNTIME DESTINATION "bin" ) -- cgit v1.2.3