hashmap/CMakeLists.txt

12 lines
796 B
CMake
Raw Normal View History

2018-05-19 17:29:47 +00:00
cmake_minimum_required(VERSION 3.9.1)
project(hashmap VERSION 1.0.1 DESCRIPTION "A small hashmap written in C to use with some other projects")
add_library(hashmap SHARED src src/hashmap.c src/linkedlist.c src/node.c)
set_target_properties(hashmap PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(hashmap PROPERTIES SOVERSION 1)
2018-05-20 02:36:01 +00:00
set_target_properties(hashmap PROPERTIES PUBLIC_HEADER "include/hashmap.h;include/linkedlist.h;include/node.h")
2018-05-19 17:29:47 +00:00
target_include_directories(hashmap PRIVATE include)
include(GNUInstallDirs)
configure_file(hashmap.pc.in hashmap.pc @ONLY)
install(TARGETS hashmap LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES ${CMAKE_BINARY_DIR}/hashmap.pc DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig)