-
-
Notifications
You must be signed in to change notification settings - Fork 293
/
CMakeLists.txt
76 lines (63 loc) · 2.13 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# tslib/CMakeLists.txt
#
# Copyright (C) 2018 Tuomo Rinne.
#
# This file is placed under the LGPL. Please see the file
# COPYING for more details.
#
#
cmake_minimum_required(VERSION 3.3)
project(tslib LANGUAGES C)
include(GNUInstallDirs)
option(BUILD_SHARED_LIBS "ON: tslib is build as shared;
OFF: tslib is build as static" ON)
option(ENABLE_TOOLS "build additional tools" ON)
set(LIBTS_VERSION_CURRENT 10)
set(LIBTS_VERSION_REVISION 5)
set(LIBTS_VERSION_AGE 10)
set(PACKAGE_VERSION 1.23+)
set(TS_POINTERCAL ${CMAKE_INSTALL_FULL_SYSCONFDIR}/pointercal)
set(TS_CONF ${CMAKE_INSTALL_FULL_SYSCONFDIR}/ts.conf)
add_subdirectory(src)
add_subdirectory(plugins)
add_subdirectory(tests)
if (ENABLE_TOOLS)
add_subdirectory(tools)
endif ()
add_subdirectory(etc)
add_subdirectory(doc)
#create Config files to help other lbiraries to find the package
include(CMakePackageConfigHelpers)
set(config_package_location cmake)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/tslibConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
configure_package_config_file(cmake/tslibConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tslibConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tslib)
install(EXPORT tslibTargets
FILE tslibTargets.cmake
NAMESPACE tslib::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tslib)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/tslibConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/tslibConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/tslib)
# this is done in a function to have a local scope for the additional variables
function(pkgc_setup_file)
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
set(PACKAGE tslib)
set(PACKAGE_DESCRIPTION "Touchscreen Access Library")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/tslib.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/tslib.pc"
@ONLY)
endfunction()
pkgc_setup_file()
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tslib.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)