misc/libphyslayer/CMakeLists.txt
changeset 9202 4d69569baabb
parent 8526 9f2bd885d773
child 9225 d8d929f92633
--- 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)