-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
54 lines (41 loc) · 1.64 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
cmake_minimum_required(VERSION 3.8)
project(xcb-imdkit VERSION 1.0.9)
find_package(ECM 0.0.11 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
option(USE_SYSTEM_UTHASH "Enable system utash" On)
include(GenerateExportHeader)
include(CheckFunctionExists)
include(CMakePackageConfigHelpers)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(uninstall)
if (USE_SYSTEM_UTHASH)
find_package(UTHash)
endif()
if (NOT TARGET UTHash::UTHash)
add_library(UTHash::UTHash INTERFACE IMPORTED )
set_target_properties(UTHash::UTHash PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/uthash"
)
endif()
set(CMAKE_C_EXTENSIONS OFF)
set(CMAKE_C_STANDARD_REQUIRED TRUE)
set(CMAKE_C_STANDARD 11)
include(GNUInstallDirs)
# directory needed by bsd
if(NOT CMAKE_INSTALL_LIBDATADIR)
set(CMAKE_INSTALL_LIBDATADIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "libdata root (LIBDIR)")
set(CMAKE_INSTALL_LIBDATADIR "${CMAKE_INSTALL_LIBDIR}")
mark_as_advanced(CMAKE_INSTALL_LIBDATADIR)
endif()
set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/XCBImdkit")
add_definitions(-D_GNU_SOURCE)
set(CMAKE_C_FLAGS "-fPIC -Wall -Wextra -Wno-unused-parameter -fvisibility=hidden ${CMAKE_C_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined ${CMAKE_SHARED_LINKER_FLAGS}")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_MODULE_LINKER_FLAGS}")
find_package(XCB REQUIRED COMPONENTS XCB UTIL KEYSYMS)
enable_testing()
add_subdirectory(src)
add_subdirectory(test)
# Write out the features
feature_summary (WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)