libtreestore

view 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
line source
1 cmake_minimum_required(VERSION 3.0)
2 project(libtreestore)
4 include(GNUInstallDirs)
6 set(SO_MAJOR 0)
7 set(SO_MINOR 1)
9 file(GLOB src "src/*.c")
10 file(GLOB hdr "src/*.h")
11 file(GLOB pubhdr "include/*.h")
13 add_library(treestore SHARED ${src} ${hdr} ${pubhdr})
14 add_library(treestore-static STATIC ${src} ${hdr} ${pubhdr})
16 set_target_properties(treestore PROPERTIES VERSION ${SO_MAJOR}.${SO_MINOR})
17 set_target_properties(treestore PROPERTIES SOVERSION ${SO_MAJOR})
19 if(NOT WIN32)
20 set_target_properties(treestore-static PROPERTIES OUTPUT_NAME treestore)
21 endif()
23 target_include_directories(treestore PUBLIC include)
24 target_include_directories(treestore-static PUBLIC include)
26 target_link_libraries(treestore -lexpat)
27 target_link_libraries(treestore-static -lexpat)
29 install(TARGETS treestore
30 RUNTIME DESTINATION bin
31 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
32 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
34 install(TARGETS treestore-static
35 RUNTIME DESTINATION bin
36 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
37 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
39 install(FILES ${pubhdr} DESTINATION include)