-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (41 loc) · 1.48 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
cmake_minimum_required (VERSION 3.22)
project (ibus-afrim)
add_compile_options(-Wall -Wextra)
include(GNUInstallDirs)
set(LIBEXECDIR ${CMAKE_INSTALL_FULL_LIBEXECDIR})
set(PKGDATADIR ${CMAKE_INSTALL_FULL_DATADIR})
set(LOCALEDIR ${CMAKE_INSTALL_FULL_LOCALEDIR})
set(CORROSION_SRC_DIR "${CMAKE_BINARY_DIR}/_deps/corrosion-src")
add_definitions(
-DPACKAGE_NAME="${PROJECT_NAME}"
-DGETTEXT_PACKAGE="${PROJECT_NAME}"
-DPACKAGE_VERSION="0.0.1"
-DPACKAGE_BUGREPORT="https://github.com/fodydev/ibus-afrim/issues"
-DLOCALEDIR="${LOCALEDIR}"
-DPKGDATADIR="${PKGDATADIR}"
-DLIBEXECDIR="${LIBEXECDIR}"
)
### Require out-of-source builds
file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
message(FATAL_ERROR "You cannot build in a source directory (or any directory with a CMakeLists.txt file). Please make a build subdirectory. Feel free to remove CMakeCache.txt and CMakeFiles.")
endif()
find_package(PkgConfig)
pkg_check_modules(IBUS REQUIRED ibus-1.0)
include(FetchContent)
# Corrosion tools
if(EXISTS ${CORROSION_SRC_DIR})
add_subdirectory(${CORROSION_SRC_DIR})
else()
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.5 # Optionally specify a commit hash, version tag or branch here
)
FetchContent_MakeAvailable(Corrosion)
endif()
# Adds Corrosion
# The compiled library code is here
add_subdirectory(src)
# The executable code is here
add_subdirectory(apps)