13 lines
808 B
CMake
13 lines
808 B
CMake
|
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)
|
||
|
set_target_properties(hashmap PROPERTIES PUBLIC_HEADER include/hashmap.c)
|
||
|
target_include_directories(hashmap PRIVATE include)
|
||
|
# target_include_directories(hashmap PRIVATE src)
|
||
|
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)
|