libtreestore

annotate 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
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@3 26 install(TARGETS treestore
nuclear@3 27 RUNTIME DESTINATION bin
nuclear@3 28 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
nuclear@3 29 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
nuclear@3 30
nuclear@3 31 install(TARGETS treestore-static
nuclear@3 32 RUNTIME DESTINATION bin
nuclear@3 33 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
nuclear@3 34 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
nuclear@3 35
nuclear@3 36 install(FILES ${pubhdr} DESTINATION include)