-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (30 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
# Set the name and the supported language of the project
project(Railway_reservation C)
# Set the minimum version of cmake required to build this project
cmake_minimum_required(VERSION 2.6)
# Use the package PkgConfig to detect GTK+ headers/library files and others
find_package(PkgConfig REQUIRED)
find_package(Threads REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package (SQLite3)
# Setup CMake to use GTK+, tell the compiler where to look for headers and to the linker where to look for libraries
include_directories(${GTK3_INCLUDE_DIRS})
link_directories(${GTK3_LIBRARY_DIRS})
include_directories(${SQLITE3_INCLUDE_DIRS})
# Add other flags to the compiler
add_definitions(${GTK3_CFLAGS_OTHER})
# Add an executable compiled from hello.c
add_executable(${PROJECT_NAME} main.c functions.c slots.c sqlite_funcs.c thread_funcs.c ../APP/resources/rsc.c)
# Link the target to the GTK+ and other libraries
target_link_libraries(${PROJECT_NAME} ${GTK3_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
target_link_libraries (${PROJECT_NAME} LINK_PUBLIC sqlite3)
# Adding custom files
if(WIN32)
FILE(COPY rsc/bins/wkhtmltopdf.exe DESTINATION "${CMAKE_BINARY_DIR}/rsc/bins/")
FILE(COPY rsc/bins/wkhtmltoimage.exe DESTINATION "${CMAKE_BINARY_DIR}/rsc/bins/")
else()
FILE(COPY rsc/bins/wkhtmltopdf DESTINATION "${CMAKE_BINARY_DIR}/rsc/bins/")
FILE(COPY rsc/bins/wkhtmltoimage DESTINATION "${CMAKE_BINARY_DIR}/rsc/bins/")
endif()