Skip to content

Commit

Permalink
Two small CMakeLists fixes (as discussed) (#1420)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
danfe authored May 28, 2024
1 parent b6f2f41 commit 09ac0f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
4 changes: 1 addition & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
17 changes: 8 additions & 9 deletions src/librssguard/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 09ac0f0

Please sign in to comment.