-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
88 lines (67 loc) · 1.9 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
77
78
79
80
81
82
83
84
85
86
87
88
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
project(xstarter)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE)
endif()
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake")
set(PROJECT_VERSION "0.8.2")
if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(CMAKE_C_FLAGS "-g -Wall -pedantic")
else()
set(CMAKE_C_FLAGS "-Wall -pedantic -O3")
endif()
# cpack
set(CPACK_PACKAGE_CONTACT "Maciej Lechowski")
set(CPACK_GENERATOR "DEB;RPM;ZIP;TGZ")
set(CPACK_PACKAGE_DESCRIPTION, "Application launcher for Linux")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
# deb stuff
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://lchsk.com/xstarter.html")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libncurses5 (>= 5.0)")
# rpm stuff
set(CPACK_RPM_PACKAGE_LICENSE "GPL")
set(CPACK_RPM_PACKAGE_URL "https://lchsk.com/xstarter.html")
set(CPACK_RPM_PACKAGE_DESCRIPTION "Application launcher for Linux")
set(CPACK_RPM_PACKAGE_REQUIRES "ncurses >= 5.0")
include(CPack)
# end cpack
add_definitions(-std=c99)
find_package(PkgConfig REQUIRED)
message(STATUS "Cmake build type: " ${CMAKE_BUILD_TYPE})
message(STATUS "Curses include directory: " ${CURSES_INCLUDE_DIR})
pkg_check_modules(CURSES REQUIRED ncurses)
add_library(lib-inih STATIC
external/inih/ini.c
external/inih/ini.h
)
set_target_properties(lib-inih PROPERTIES LINKER_LANGUAGE C)
include_directories(
${CURSES_INCLUDE_DIRS}
external/
)
add_executable(xstarter
src/main.c
src/scan.c
src/settings.c
src/term.c
src/utils.c
src/utils_string.c
src/list.c
xstarter.1
)
target_link_libraries(xstarter
${CURSES_LIBRARIES}
-pthread
-linih
)
install(TARGETS xstarter DESTINATION bin)
install(FILES xstarter.1 DESTINATION share/man/man1)
add_executable(xstarter_tests
src/utils.c
src/utils_string.c
src/settings.c
tests/test.c
)
target_link_libraries(xstarter_tests
-linih
)