-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
57 lines (49 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
52
53
54
55
56
project (maleo)
cmake_minimum_required (VERSION 2.6)
# tell cmake where its modules can be found in our project directory
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# where we install data directory (if we have any)
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set (PKGDATADIR "${DATADIR}/maleo")
set (EXEC_NAME "maleo")
set (RELEASE_NAME "A simple HTML5 app runner.")
set (VERSION "2.0.0")
set (VERSION_INFO "complete rewrite")
# find pkgconfig to make sure dependencies are installed
find_package(PkgConfig)
# check for the required dependencies
pkg_check_modules(DEPS REQUIRED
webkit2gtk-4.0
libxml-2.0
gtk+-3.0
)
add_definitions(${DEPS_CFLAGS})
link_libraries(${DEPS_LIBRARIES})
link_directories(${DEPS_LIBRARY_DIRS})
# disable c compiler warnings
add_definitions(-w)
add_definitions(-DGETTEXT_PACKAGE="maleo")
# make sure we have vala
find_package(Vala REQUIRED)
# make sure we use vala
include(ValaVersion)
# make sure it's the desired version of vala
ensure_vala_version("0.16" MINIMUM)
# files we want to compile
include(ValaPrecompile)
vala_precompile(VALA_C ${EXEC_NAME}
src/view/MainWindow.vala
src/view/WebView.vala
src/Config.vala
src/Utils.vala
src/Main.vala
# tell what libraries to use when compiling
PACKAGES
webkit2gtk-4.0
libxml-2.0
gtk+-3.0
)
# tell cmake what to call the executable we just made
add_executable(${EXEC_NAME} ${VALA_C})
# install the binaries we just made
install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin)