also physlayer can be comiled as static or shared now
authorkoda
Wed, 12 Jun 2013 01:00:47 +0200
changeset 9202 4d69569baabb
parent 9200 37c37026f7ec
child 9203 bcc25cb9b122
also physlayer can be comiled as static or shared now
hedgewars/uPhysFSLayer.pas
misc/libphyslayer/CMakeLists.txt
--- a/hedgewars/uPhysFSLayer.pas	Wed Jun 12 00:07:19 2013 +0200
+++ b/hedgewars/uPhysFSLayer.pas	Wed Jun 12 01:00:47 2013 +0200
@@ -9,11 +9,6 @@
 {$IFNDEF WIN32}
     {$linklib physfs}
     {$linklib physlayer}
-
-    {statically linking physfs brings IOKit dependency on OSX}
-    {$IFDEF DARWIN}
-        {$linkframework IOKit}
-    {$ENDIF}
 {$ENDIF}
 
 procedure initModule;
--- a/misc/libphyslayer/CMakeLists.txt	Wed Jun 12 00:07:19 2013 +0200
+++ b/misc/libphyslayer/CMakeLists.txt	Wed Jun 12 01:00:47 2013 +0200
@@ -12,25 +12,17 @@
     hwpacksmounter.c
 )
 
-set(build_type STATIC)
-set(lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX})
-set(lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX})
+#compiles and links actual library
+add_library (physlayer ${PHYSLAYER_SRCS})
+#TODO: find good VERSION and SOVERSION values
+target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY})
+install(TARGETS physlayer RUNTIME DESTINATION ${target_binary_install_dir}
+                          LIBRARY DESTINATION ${target_library_install_dir}
+                          ARCHIVE DESTINATION ${target_library_install_dir})
+get_target_property(physlayer_fullpath physlayer LOCATION)
 
-if(WIN32)
-    set(build_type SHARED)
-    set(lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX})
-    set(lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX})
-endif(WIN32)
-
-#compiles and links actual library
-add_library (physlayer ${build_type} ${PHYSLAYER_SRCS})
-
-if(WIN32)
-    target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY})
-    install(TARGETS physlayer RUNTIME DESTINATION ${target_library_install_dir})
-endif()
 
 ## added standard variables (FORCE or cmake won't pick 'em)
-set(PHYSLAYER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/libphyslayer/ CACHE STRING "" FORCE)
-set(PHYSLAYER_LIBRARY ${LIBRARY_OUTPUT_PATH}/${lib_prefix}physlayer${lib_suffix} CACHE STRING "" FORCE)
+set(PHYSLAYER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Physlayer include dir" FORCE)
+set(PHYSLAYER_LIBRARY ${physlayer_fullpath} CACHE STRING "Physlayer library" FORCE)