Commit ce8772fa authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use more cmake target code

parent 5ac1f04f
......@@ -4,7 +4,8 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-itinerary.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-itinerary.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/itinerary_version_detailed.h.in ${CMAKE_CURRENT_BINARY_DIR}/itinerary_version_detailed.h)
set(itinerary_srcs
add_library(itinerary STATIC)
target_sources(itinerary PRIVATE
applicationcontroller.cpp
documentmanager.cpp
favoritelocationmodel.cpp
......@@ -37,14 +38,14 @@ set(itinerary_srcs
transfermanager.cpp
util.cpp
)
ecm_qt_declare_logging_category(itinerary_srcs
ecm_qt_declare_logging_category(itinerary
HEADER logging.h
IDENTIFIER Log
CATEGORY_NAME org.kde.itinerary
DESCRIPTION "KDE Itinerary app"
EXPORT ITINERARY
)
add_library(itinerary STATIC ${itinerary_srcs})
target_link_libraries(itinerary PUBLIC
itinerary-weather
SolidExtras
......@@ -69,7 +70,8 @@ else ()
set(qml_srcs qml.qrc)
endif()
set(itinerary_app_srcs
add_executable(itinerary-app ${itinerary_app_srcs})
target_sources(itinerary-app PRIVATE
main.cpp
countrymodel.cpp
developmentmodecontroller.cpp
......@@ -81,9 +83,7 @@ set(itinerary_app_srcs
tickettokenmodel.cpp
weatherforecastmodel.cpp
${qml_srcs}
)
add_executable(itinerary-app ${itinerary_app_srcs})
)
target_include_directories(itinerary-app PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(itinerary-app PRIVATE
itinerary
......
# SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
# SPDX-License-Identifier: BSD-3-Clause
set(kandroidextras_srcs
add_library(KAndroidExtras STATIC)
target_sources(KAndroidExtras PRIVATE
android/activity.cpp
android/android_headers.cpp
android/contentresolver.cpp
......@@ -16,10 +18,9 @@ set(kandroidextras_srcs
)
if (NOT ANDROID)
list (APPEND kandroidextras_srcs fake/mock_impl.cpp)
target_sources(KAndroidExtras PRIVATE fake/mock_impl.cpp)
endif()
add_library(KAndroidExtras STATIC ${kandroidextras_srcs})
generate_export_header(KAndroidExtras BASE_NAME KAndroidExtras)
target_link_libraries(KAndroidExtras PUBLIC Qt5::Core)
......
......@@ -6,12 +6,12 @@ if (TARGET KF5::Holidays)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-weather.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-weather.h)
set(weather_srcs
add_library(itinerary-weather STATIC)
target_sources(itinerary-weather PRIVATE
weatherforecast.cpp
weatherforecastmanager.cpp
)
add_library(itinerary-weather STATIC ${weather_srcs})
target_link_libraries(itinerary-weather
PUBLIC
Qt5::Core
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment