-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (38 loc) · 1.25 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.16.3)
project(CXML C)
set(CMAKE_C_STANDARD 99)
set(PROJECT_NAME CXML)
set(CLI_APP_VERSION 1.9)
set(GTK_APP_VERSION 1.8)
set(CLI_APP_NAME ${PROJECT_NAME}_CLI_${CLI_APP_VERSION})
set(GTK_APP_NAME ${PROJECT_NAME}_GTK_${GTK_APP_VERSION})
set(required_files
functions/log.c
functions/dtd_parser.c
functions/dtd_rules.c
functions/xml_parser.c
functions/xml_finder.c
functions/str_tools.c
functions/console_color.c
functions/cli_menu.c
functions/dtd_validation.c)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)
include_directories(${GTK3_INCLUDE_DIRS} functions dtd_files xml_files)
link_directories(${GTK3_LIBRARY_DIRS})
add_definitions(${GTK3_CFLAGS_OTHER})
if (UNIX)
set(CMAKE_EXE_LINKER_FLAGS "-Wl,-export-dynamic")
endif (UNIX)
add_executable(unit_test main.c
tests/xml_parsing_test.c
${required_files})
add_executable(${CLI_APP_NAME}
main_release_cli.c
${required_files})
add_executable(${GTK_APP_NAME}
main_gtk.c
functions/gtkFunctions.c
${required_files})
target_link_libraries(${GTK_APP_NAME} ${GTK3_LIBRARIES})
target_compile_definitions(${GTK_APP_NAME} PRIVATE gtk)