aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--Kconfig8
-rw-r--r--cmake/VendorConfig.cmake7
-rw-r--r--doc/CMakeLists.txt12
-rw-r--r--linux/.config2
-rw-r--r--linux/makepkg/PKGBUILD13
-rw-r--r--src/CMakeLists.txt7
7 files changed, 34 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cfb121d..622fb21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,8 @@ add_subdirectory(plugins/ConfigurationEditor)
add_subdirectory(src)
+add_subdirectory(doc)
+
if(CONFIG_TESTS)
enable_testing()
find_package(Qt5 COMPONENTS Test REQUIRED)
diff --git a/Kconfig b/Kconfig
index 67265fc..c1efa47 100644
--- a/Kconfig
+++ b/Kconfig
@@ -14,6 +14,14 @@ menu "Install paths"
string "Plugins"
default "lib64/plugins"
+ config INSTALL_APPDIR
+ string "Application .desktop file"
+ default "usr/share/applications"
+
+ config INSTALL_ICONDIR
+ string "Icons"
+ default "usr/share/icons"
+
endmenu
comment "Application Settings"
diff --git a/cmake/VendorConfig.cmake b/cmake/VendorConfig.cmake
index c4f3ce9..b424378 100644
--- a/cmake/VendorConfig.cmake
+++ b/cmake/VendorConfig.cmake
@@ -5,10 +5,9 @@ string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME)
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/${SYSTEM_NAME}/.config")
message(FATAL_ERROR "No vendor config for ${SYSTEM_NAME}: ${PROJECT_SOURCE_DIR}/${SYSTEM_NAME}/.config is missing")
endif()
+# there is a .config in ${PROJECT_SOURCE_DIR}/${SYSTEM_NAME}/.config
-# the .config has been found
-add_custom_target(config_header
- BYPRODUCTS "${PROJECT_BINARY_DIR}/include/config.h"
+add_custom_command(OUTPUT "${PROJECT_BINARY_DIR}/include/config.h"
COMMAND ${CMAKE_COMMAND} -E env "srctree=${PROJECT_SOURCE_DIR}"
${PYTHON_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tools/Kconfiglib/genconfig.py" "--header-path=${PROJECT_BINARY_DIR}/include/config.h" "${PROJECT_SOURCE_DIR}/src/Kconfig"
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/${SYSTEM_NAME}")
@@ -26,6 +25,8 @@ config("POI_EXE" "src/Kconfig")
config("INSTALL_BINDIR" "Kconfig")
config("INSTALL_LIBDIR" "Kconfig")
config("INSTALL_PLUGINDIR" "Kconfig")
+config("INSTALL_APPDIR" "Kconfig")
+config("INSTALL_ICONDIR" "Kconfig")
# QTBUG defines
execute_process(
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 0000000..c1a5bf2
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,12 @@
+if(UNIX)
+
+add_custom_target(manpage
+ BYPRODUCTS "${PROJECT_BINARY_DIR}/doc/smolbote.7.gz"
+ COMMAND "asciidoctor" "--backend=manpage" "--out-file=${PROJECT_BINARY_DIR}/doc/smolbote.7" "${PROJECT_SOURCE_DIR}/doc/smolbote.7.asciidoc"
+ COMMAND "gzip" "--force" "${PROJECT_BINARY_DIR}/doc/smolbote.7"
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/doc
+)
+
+install(FILES "${PROJECT_BINARY_DIR}/doc/smolbote.7.gz" DESTINATION man/man7 CONFIGURATIONS Release OPTIONAL)
+
+endif(UNIX)
diff --git a/linux/.config b/linux/.config
index e04f44a..8eeef64 100644
--- a/linux/.config
+++ b/linux/.config
@@ -10,6 +10,8 @@
CONFIG_INSTALL_BINDIR="bin"
CONFIG_INSTALL_LIBDIR="lib64/smolbote"
CONFIG_INSTALL_PLUGINDIR="lib64/smolbote/plugins"
+CONFIG_INSTALL_APPDIR="share/applications"
+CONFIG_INSTALL_ICONDIR="share/icons"
#
# Application Settings
diff --git a/linux/makepkg/PKGBUILD b/linux/makepkg/PKGBUILD
index c327b47..005f46a 100644
--- a/linux/makepkg/PKGBUILD
+++ b/linux/makepkg/PKGBUILD
@@ -66,22 +66,11 @@ build() {
# Build
make
+ make manpage
}
package() {
# Install
DESTDIR="$pkgdir" make install
-
- msg2 "Installing icon and .desktop"
- install -Dm644 $srcdir/smolbote/data/poi.svg $pkgdir/usr/share/icons/hicolor/scalable/apps/poi.svg
- install -Dm644 $srcdir/smolbote/linux/poi.desktop $pkgdir/usr/share/applications/poi.desktop
-
- msg2 "Installing firejail profile"
- install -Dm644 $srcdir/smolbote/data/poi.profile $pkgdir/usr/local/lib/smolbote/poi.profile
-
- msg2 "Installing manpage"
- asciidoctor --backend=manpage $srcdir/smolbote/doc/smolbote.7.asciidoc
- gzip $srcdir/smolbote/doc/smolbote.7
- install -Dm644 $srcdir/smolbote/doc/smolbote.7.gz $pkgdir/usr/local/man/man7/smolbote.7.gz
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fbb71aa..4ae7448 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -72,8 +72,6 @@ else()
add_executable(${CONFIG_POI_EXE} ${srclist})
endif()
-add_dependencies(${CONFIG_POI_EXE} config_header)
-
target_include_directories(${CONFIG_POI_EXE}
PRIVATE ${Boost_INCLUDE_DIRS}
PRIVATE ${PROJECT_SOURCE_DIR}/include
@@ -110,3 +108,8 @@ target_compile_definitions(${CONFIG_POI_EXE}
)
install(TARGETS ${CONFIG_POI_EXE} RUNTIME DESTINATION ${CONFIG_INSTALL_BINDIR} CONFIGURATIONS Release)
+if(UNIX)
+install(FILES ${PROJECT_SOURCE_DIR}/data/poi.svg DESTINATION ${CONFIG_INSTALL_ICONDIR}/hicolor/scalable/apps/poi.svg CONFIGURATIONS Release)
+install(FILES ${PROJECT_SOURCE_DIR}/linux/poi.desktop DESTINATION ${CONFIG_INSTALL_APPDIR}/poi.desktop CONFIGURATIONS Release)
+install(FILES ${PROJECT_SOURCE_DIR}/data/poi.profile DESTINATION ${CONFIG_INSTALL_LIBDIR}/poi.profile CONFIGURATIONS Release)
+endif(UNIX)