Make building a .desktop file optional.
This commit is contained in:
parent
47106d85c8
commit
226170b547
|
@ -19,6 +19,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
# Project build options.
|
# Project build options.
|
||||||
option(WITH_MAN "Compile and install manpage." YES)
|
option(WITH_MAN "Compile and install manpage." YES)
|
||||||
|
option(WITH_DESKTOP "Build and install a .desktop file." NO)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
@ -37,10 +38,12 @@ endif()
|
||||||
install(FILES watchwords.json
|
install(FILES watchwords.json
|
||||||
DESTINATION "${CMAKE_INSTALL_DATADIR}/mastorss")
|
DESTINATION "${CMAKE_INSTALL_DATADIR}/mastorss")
|
||||||
|
|
||||||
|
if(WITH_DESKTOP)
|
||||||
# Needed for AppImage.
|
# Needed for AppImage.
|
||||||
configure_file("de.tastytea.${PROJECT_NAME}.desktop.in"
|
configure_file("de.tastytea.${PROJECT_NAME}.desktop.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/de.tastytea.${PROJECT_NAME}.desktop" @ONLY)
|
"${CMAKE_CURRENT_BINARY_DIR}/de.tastytea.${PROJECT_NAME}.desktop" @ONLY)
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/de.tastytea.${PROJECT_NAME}.desktop"
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/de.tastytea.${PROJECT_NAME}.desktop"
|
||||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||||
|
endif()
|
||||||
|
|
||||||
# include(cmake/packages.cmake)
|
# include(cmake/packages.cmake)
|
||||||
|
|
|
@ -55,6 +55,10 @@ cmake ..
|
||||||
cmake --build .
|
cmake --build .
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
.CMake options:
|
||||||
|
* `-DWITH_MAN=NO` to not compile the manpage (default is `YES`).
|
||||||
|
* `-DWITH_DESKTOP=YES` to build the .desktop file (default is `NO`).
|
||||||
|
|
||||||
Install with `make install`.
|
Install with `make install`.
|
||||||
|
|
||||||
== Usage
|
== Usage
|
||||||
|
|
Loading…
Reference in New Issue
Block a user