-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
205 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
cmake_minimum_required(VERSION 3.9) | ||
|
||
# Project description | ||
project( | ||
kbbi-gtk | ||
VERSION 1.0.0 | ||
DESCRIPTION "KBBI Offline with GTK3" | ||
) | ||
|
||
# Check required package & libraries | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(GTK3 REQUIRED gtk+-3.0) | ||
pkg_check_modules(WEBKIT2GTK4 REQUIRED webkit2gtk-4.0) | ||
pkg_check_modules(LIBKBBI REQUIRED libkbbi) | ||
|
||
# Set C standard | ||
set(CMAKE_C_STANDARD 99) | ||
|
||
# Targets | ||
add_executable( | ||
${PROJECT_NAME} | ||
src/main.c | ||
src/ui.c | ||
) | ||
|
||
# Properties | ||
set_target_properties( | ||
${PROJECT_NAME} PROPERTIES | ||
VERSION ${PROJECT_VERSION} | ||
) | ||
|
||
# Includes | ||
target_include_directories( | ||
${PROJECT_NAME} | ||
PRIVATE src | ||
) | ||
|
||
# Link required libraries | ||
target_link_libraries( | ||
${PROJECT_NAME} | ||
${GTK3_LIBRARIES} | ||
${WEBKIT2GTK4_LIBRARIES} | ||
${LIBKBBI_LIBRARIES} | ||
) | ||
|
||
# Include library's public header directory | ||
target_include_directories( | ||
${PROJECT_NAME} | ||
PUBLIC ${GTK_INCLUDE_DIRS} | ||
PUBLIC ${WEBKIT2GTK4_INCLUDE_DIRS} | ||
PUBLIC ${LIBKBBI_INCLUDE_DIRS} | ||
) | ||
|
||
# Add library's extra compiler flags | ||
target_compile_options( | ||
${PROJECT_NAME} | ||
PUBLIC ${GTK3_CLFAGS_OTHER} | ||
PUBLIC ${WEBKIT2GTK4_CLFAGS_OTHER} | ||
PUBLIC ${LIBKBBI_CLFAGS_OTHER} | ||
) | ||
|
||
# CMake setup | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
set(CMAKE_C_FLAGS "-Wall -Wextra -fvisibility=hidden") | ||
set(CMAKE_C_FLAGS_DEBUG "-g") | ||
set(CMAKE_C_FLAGS_RELEASE "-O3") | ||
|
||
set(DESKTOP_PATH "share/applications/") | ||
set(DESKTOP_ICON_PATH "share/icons/hicolor/128x128/apps") | ||
set(DESKTOP_NAME "KBBI Offline") | ||
set(DESKTOP_EXEC ${PROJECT_NAME}) | ||
set(DESKTOP_ICON_REF "${CMAKE_INSTALL_PREFIX}/${DESKTOP_ICON_PATH}/${PROJECT_NAME}.png") | ||
|
||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/application.desktop.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.desktop" | ||
@ONLY | ||
) | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/icon.png" | ||
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.png" | ||
COPYONLY | ||
) | ||
|
||
# Install the file | ||
install( | ||
TARGETS ${PROJECT_NAME} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
) | ||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.desktop | ||
DESTINATION ${DESKTOP_PATH} | ||
) | ||
install( | ||
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.png | ||
DESTINATION ${DESKTOP_ICON_PATH} | ||
) | ||
|
||
# Expand uninstall script | ||
configure_file( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/uninstall.cmake.in" | ||
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake" | ||
IMMEDIATE @ONLY | ||
) | ||
|
||
# Add uninstall target | ||
add_custom_target( | ||
uninstall | ||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Version=1.0 | ||
Type=Application | ||
Name=@DESKTOP_NAME@ | ||
Exec=@DESKTOP_EXEC@ | ||
Icon=@DESKTOP_ICON_REF@ | ||
Categories=Utility; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
Submodule libkbbi
deleted from
0c1af3
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.