Refactor CMake build scripts

1. Use FeatureSummary module to show configuration results.

2. Invert option()/find_package() relationship: instead of
calling find_package(... REQUIRED) when option is set, rely on optional
find package call and PackageName_FOUND variable.

3. Refactor handling options that result in simple preprocessor defines
(actually copy the snippet from libtorrent) so that everything is done
in a single function call.

4. Populate target properties in order to get rid of
include_directories() calls.
This commit is contained in:
Eugene Shalygin
2018-06-05 03:03:38 +02:00
parent 658702dcbb
commit fa770871e9
20 changed files with 313 additions and 353 deletions

View File

@@ -1,11 +1,8 @@
set(QBT_QTNOTIFY_SOURCES
add_library(qbt_qtnotify STATIC
notifications.cpp
)
set(QBT_QTNOTIFY_HEADERS
notifications.h
)
add_library(qbt_qtnotify STATIC ${QBT_QTNOTIFY_SOURCES} ${QBT_QTNOTIFY_HEADERS})
set_target_properties(qbt_qtnotify PROPERTIES AUTOUIC False AUTORCC False)
target_link_qt_components(qbt_qtnotify DBus)
target_link_libraries(qbt_qtnotify PUBLIC Qt5::DBus)
target_include_directories(qbt_qtnotify PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})