-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
39 lines (30 loc) · 1.02 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.12)
project(qrqma)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
file(GLOB_RECURSE CPP_SRCS ./*.cpp)
add_library(qrqma SHARED ${CPP_SRCS})
set(DEST_DIR "${CMAKE_INSTALL_PREFIX}")
execute_process(
COMMAND git describe --tags
OUTPUT_VARIABLE VERSION
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
ERROR_VARIABLE VERSION_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(VERSION STREQUAL "")
message(FATAL_ERROR "cannot generate version string")
endif()
message("qrqma version: " ${VERSION})
configure_file(qrqma.pc.in qrqma.pc @ONLY)
install(TARGETS qrqma DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
loader.h
template.h
unique_function.h
symbol.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qrqma)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qrqma.pc
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig)
install(FILES LICENSE
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/licenses/${PROJECT_NAME})