libtreestore
annotate CMakeLists.txt @ 5:f3ade599cfbb
ts_free*/ts_destroy* functions shouldn't bork when passed a null pointer
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 13 Nov 2016 20:40:07 +0200 |
parents | 48d75df3ef04 |
children |
rev | line source |
---|---|
nuclear@3 | 1 cmake_minimum_required(VERSION 3.0) |
nuclear@3 | 2 project(libtreestore) |
nuclear@3 | 3 |
nuclear@3 | 4 include(GNUInstallDirs) |
nuclear@3 | 5 |
nuclear@3 | 6 set(SO_MAJOR 0) |
nuclear@3 | 7 set(SO_MINOR 1) |
nuclear@3 | 8 |
nuclear@3 | 9 file(GLOB src "src/*.c") |
nuclear@3 | 10 file(GLOB hdr "src/*.h") |
nuclear@3 | 11 file(GLOB pubhdr "include/*.h") |
nuclear@3 | 12 |
nuclear@3 | 13 add_library(treestore SHARED ${src} ${hdr} ${pubhdr}) |
nuclear@3 | 14 add_library(treestore-static STATIC ${src} ${hdr} ${pubhdr}) |
nuclear@3 | 15 |
nuclear@3 | 16 set_target_properties(treestore PROPERTIES VERSION ${SO_MAJOR}.${SO_MINOR}) |
nuclear@3 | 17 set_target_properties(treestore PROPERTIES SOVERSION ${SO_MAJOR}) |
nuclear@3 | 18 |
nuclear@3 | 19 if(NOT WIN32) |
nuclear@3 | 20 set_target_properties(treestore-static PROPERTIES OUTPUT_NAME treestore) |
nuclear@3 | 21 endif() |
nuclear@3 | 22 |
nuclear@3 | 23 target_include_directories(treestore PUBLIC include) |
nuclear@3 | 24 target_include_directories(treestore-static PUBLIC include) |
nuclear@3 | 25 |
nuclear@4 | 26 target_link_libraries(treestore -lexpat) |
nuclear@4 | 27 target_link_libraries(treestore-static -lexpat) |
nuclear@4 | 28 |
nuclear@3 | 29 install(TARGETS treestore |
nuclear@3 | 30 RUNTIME DESTINATION bin |
nuclear@3 | 31 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
nuclear@3 | 32 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
nuclear@3 | 33 |
nuclear@3 | 34 install(TARGETS treestore-static |
nuclear@3 | 35 RUNTIME DESTINATION bin |
nuclear@3 | 36 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} |
nuclear@3 | 37 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) |
nuclear@3 | 38 |
nuclear@3 | 39 install(FILES ${pubhdr} DESTINATION include) |