CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0) PROJECT(unqlite) # If the user did not customize the install prefix, # set it to live under build so we don't inadvertently pollute /usr/local IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "default install path" FORCE) ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR}/src) SET(HEADERS_UNQLITE unqlite.h ) SET(SOURCES_UNQLITE unqlite.c ) SET(UNQLITE_STATIC_LIB unqlite) ADD_LIBRARY(${UNQLITE_STATIC_LIB} ${HEADERS_UNQLITE} ${SOURCES_UNQLITE}) INSTALL(TARGETS ${UNQLITE_STATIC_LIB} COMPONENT devel ARCHIVE DESTINATION lib) INSTALL(FILES ${HEADERS_UNQLITE} COMPONENT devel DESTINATION include)