# HG changeset patch # User koda # Date 1370991647 -7200 # Node ID 4d69569baabbba534695ba224d67eab512dec5d5 # Parent 37c37026f7ec944fdeff7d1f138bd3c0b8ce0bad also physlayer can be comiled as static or shared now diff -r 37c37026f7ec -r 4d69569baabb hedgewars/uPhysFSLayer.pas --- 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; diff -r 37c37026f7ec -r 4d69569baabb misc/libphyslayer/CMakeLists.txt --- 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)