-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
49 lines (40 loc) · 1.32 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
40
41
42
43
44
45
46
47
48
49
# SPDX-FileCopyrightText: 2018 Lutz Freitag
# SPDX-License-Identifier: CC0-1.0
cmake_minimum_required(VERSION 3.12)
project(simplyfile)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
file(GLOB_RECURSE CPP_SRCS ./*.cpp)
add_library(simplyfile 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("simplyfile version: " ${VERSION})
configure_file(simplyfile.pc.in simplyfile.pc @ONLY)
install(TARGETS simplyfile DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES
Epoll.h
Event.h
FileDescriptor.h
INotify.h
Process.h
SerialPort.h
ThreadTime.h
Timer.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
install(FILES
socket/Host.h
socket/Socket.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/socket)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/simplyfile.pc
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig)
install(DIRECTORY LICENSES
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/licenses/${PROJECT_NAME})