-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
34 lines (34 loc) · 1.16 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
# Min. CMake Version: 3.13
cmake_minimum_required(VERSION 3.13)
# Set project and language
project(kermit-term C)
# Set target name
set(TARGET "kermit")
# Add project source as executable
add_executable(${TARGET} src/${TARGET}.c src/${TARGET}.h)
# Check PkgConfig
find_package(PkgConfig REQUIRED)
if (PKG_CONFIG_FOUND)
# Check, add and link GTK3
pkg_check_modules(GTK REQUIRED "gtk+-3.0>=3.18.9")
if (GTK_FOUND)
target_link_libraries(${TARGET} ${GTK_LIBRARIES})
add_definitions(${GTK_CFLAGS} ${GTK_CFLAGS_OTHER})
endif()
# Check, add and link VTE
pkg_check_modules(VTE REQUIRED "vte-2.91>=0.42.5")
if (VTE_FOUND)
target_link_libraries(${TARGET} ${VTE_LIBRARIES})
add_definitions(${VTE_CFLAGS} ${VTE_CFLAGS_OTHER})
endif()
endif()
# Compile options
target_compile_options(${TARGET} PRIVATE -Wall -Wno-deprecated-declarations)
# Install target to bin directory
install(TARGETS ${TARGET} RUNTIME DESTINATION bin)
# Install manpage
install(FILES man/${TARGET}.1 DESTINATION share/man/man1)
# Install desktop entry
install(FILES .config/kermit.desktop DESTINATION share/applications)
# Install README.md
install(FILES README.md DESTINATION share/doc/${TARGET})