libtreestore

view CMakeLists.txt @ 3:48d75df3ef04

picking this up again, converted to cmake, and started a text format reader/writer
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 10 Nov 2016 16:19:44 +0200
parents
children bb873449cf59
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 install(TARGETS treestore
27 RUNTIME DESTINATION bin
28 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
29 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
31 install(TARGETS treestore-static
32 RUNTIME DESTINATION bin
33 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
34 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
36 install(FILES ${pubhdr} DESTINATION include)