misc/libphyslayer/CMakeLists.txt
changeset 9202 4d69569baabb
parent 8526 9f2bd885d773
child 9225 d8d929f92633
equal deleted inserted replaced
9200:37c37026f7ec 9202:4d69569baabb
    10     physfsrwops.c
    10     physfsrwops.c
    11     physfslualoader.c
    11     physfslualoader.c
    12     hwpacksmounter.c
    12     hwpacksmounter.c
    13 )
    13 )
    14 
    14 
    15 set(build_type STATIC)
    15 #compiles and links actual library
    16 set(lib_prefix ${CMAKE_STATIC_LIBRARY_PREFIX})
    16 add_library (physlayer ${PHYSLAYER_SRCS})
    17 set(lib_suffix ${CMAKE_STATIC_LIBRARY_SUFFIX})
    17 #TODO: find good VERSION and SOVERSION values
       
    18 target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY})
       
    19 install(TARGETS physlayer RUNTIME DESTINATION ${target_binary_install_dir}
       
    20                           LIBRARY DESTINATION ${target_library_install_dir}
       
    21                           ARCHIVE DESTINATION ${target_library_install_dir})
       
    22 get_target_property(physlayer_fullpath physlayer LOCATION)
    18 
    23 
    19 if(WIN32)
       
    20     set(build_type SHARED)
       
    21     set(lib_prefix ${CMAKE_SHARED_LIBRARY_PREFIX})
       
    22     set(lib_suffix ${CMAKE_SHARED_LIBRARY_SUFFIX})
       
    23 endif(WIN32)
       
    24 
       
    25 #compiles and links actual library
       
    26 add_library (physlayer ${build_type} ${PHYSLAYER_SRCS})
       
    27 
       
    28 if(WIN32)
       
    29     target_link_libraries(physlayer ${SDL_LIBRARY} ${LUA_LIBRARY} ${PHYSFS_LIBRARY})
       
    30     install(TARGETS physlayer RUNTIME DESTINATION ${target_library_install_dir})
       
    31 endif()
       
    32 
    24 
    33 ## added standard variables (FORCE or cmake won't pick 'em)
    25 ## added standard variables (FORCE or cmake won't pick 'em)
    34 set(PHYSLAYER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/misc/libphyslayer/ CACHE STRING "" FORCE)
    26 set(PHYSLAYER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE STRING "Physlayer include dir" FORCE)
    35 set(PHYSLAYER_LIBRARY ${LIBRARY_OUTPUT_PATH}/${lib_prefix}physlayer${lib_suffix} CACHE STRING "" FORCE)
    27 set(PHYSLAYER_LIBRARY ${physlayer_fullpath} CACHE STRING "Physlayer library" FORCE)
    36 
    28