From 09ac0f05efabb745dbf9d240f40a610f1de99686 Mon Sep 17 00:00:00 2001 From: Alexey Dokuchaev Date: Tue, 28 May 2024 00:12:26 -0500 Subject: [PATCH] Two small CMakeLists fixes (as discussed) (#1420) * include (GNUInstallDirs) before using ${CMAKE_INSTALL_LIBDIR} While here, trim some needless whitespace. * Do not explicitly set APP_REVISION to an empty string This allows to pass it on the command line when building from GitHub-generated release tarballs which lack any Git metadata. --- CMakeLists.txt | 4 +--- src/librssguard/CMakeLists.txt | 17 ++++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b2319e5..42c521a05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,7 +188,7 @@ if(ENABLE_MEDIAPLAYER_LIBMPV) add_compile_definitions(ENABLE_MEDIAPLAYER_LIBMPV) endif() -if(ENABLE_MEDIAPLAYER_QTMULTIMEDIA OR ENABLE_MEDIAPLAYER_LIBMPV) +if(ENABLE_MEDIAPLAYER_QTMULTIMEDIA OR ENABLE_MEDIAPLAYER_LIBMPV) set(ENABLE_MEDIAPLAYER TRUE) add_compile_definitions(ENABLE_MEDIAPLAYER) else() @@ -245,8 +245,6 @@ if(REVISION_FROM_GIT AND EXISTS "${CMAKE_SOURCE_DIR}/.git") ) message(STATUS "Detected git revision: '${APP_REVISION}'.") -else() - set(APP_REVISION "") endif() if(NOT NO_LITE) diff --git a/src/librssguard/CMakeLists.txt b/src/librssguard/CMakeLists.txt index 1dc6a1ca7..f47a2fa18 100644 --- a/src/librssguard/CMakeLists.txt +++ b/src/librssguard/CMakeLists.txt @@ -371,7 +371,7 @@ set(UI_FILES services/abstract/gui/formfeeddetails.ui ) -if(ENABLE_MEDIAPLAYER) +if(ENABLE_MEDIAPLAYER) list(APPEND SOURCES gui/mediaplayer/playerbackend.cpp gui/mediaplayer/playerbackend.h @@ -498,20 +498,12 @@ add_library(rssguard SHARED ${SOURCES} ${QM_FILES}) if(FORCE_BUNDLE_ICONS) target_compile_definitions(rssguard PRIVATE - FORCE_BUNDLE_ICONS ) message(STATUS "Forcibly bundling icon themes.") endif() -# Add specific definitions. -target_compile_definitions(rssguard - PRIVATE - RSSGUARD_DLLSPEC=Q_DECL_EXPORT - RSSGUARD_LIBDIR="${CMAKE_INSTALL_LIBDIR}" -) - target_include_directories(rssguard PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} @@ -643,6 +635,13 @@ elseif(APPLE) set(HEADERS_FOLDER "Contents/Resources/Include") endif() +# Add specific definitions. +target_compile_definitions(rssguard + PRIVATE + RSSGUARD_DLLSPEC=Q_DECL_EXPORT + RSSGUARD_LIBDIR="${CMAKE_INSTALL_LIBDIR}" +) + # Install public headers. set(HEADERS_ROOT "${PROJECT_SOURCE_DIR}/src/librssguard") file(GLOB_RECURSE HEADER_FILES RELATIVE ${HEADERS_ROOT} "*.h")