Port to KF5, step 1: CMakeLists
This commit is contained in:
parent
6533b64a22
commit
2d8d230170
3 changed files with 58 additions and 40 deletions
|
@ -1,29 +1,41 @@
|
|||
project(danbooru_client)
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
|
||||
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
|
||||
|
||||
set(danbooru_client_VERSION_MAJOR 0)
|
||||
set(danbooru_client_VERSION_MINOR 1)
|
||||
set(danbooru_client_VERSION_MINOR 2)
|
||||
|
||||
find_package(KDE4 REQUIRED)
|
||||
find_package(QJSON)
|
||||
find_package (ECM REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
|
||||
|
||||
include (KDE4Defaults)
|
||||
include (FeatureSummary)
|
||||
set(REQUIRED_QT_VERSION "5.3.0")
|
||||
set(KF5_VERSION "5.3.0")
|
||||
|
||||
set_package_properties(KDE4 PROPERTIES DESCRIPTION "The KDE libraries"
|
||||
URL "http://www.kde.org" TYPE REQUIRED
|
||||
PURPOSE "Required to build Danbooru Client")
|
||||
set_package_properties(QJSON PROPERTIES DESCRIPTION "The QJSON library"
|
||||
URL "http://qjson.sourceforge.net" TYPE REQUIRED
|
||||
PURPOSE "Required to build Danbooru Client")
|
||||
# Qt dependencies
|
||||
|
||||
find_package(Qt5 ${REQUIRED_QT_VERSION} NO_MODULE REQUIRED
|
||||
Core
|
||||
Widgets)
|
||||
|
||||
include_directories( ${KDE4_INCLUDES} ${QT_INCLUDES} )
|
||||
# KF5 dependencies
|
||||
|
||||
find_package(KF5 ${KF5_VERSION} REQUIRED
|
||||
IconThemes # Handling of icons
|
||||
CoreAddons # Caches
|
||||
TextWidgets #
|
||||
XmlGui # User interface
|
||||
ConfigWidgets # Handling of configuration
|
||||
KIOCore # Jobs
|
||||
KDELibs4Support # Transitional
|
||||
)
|
||||
|
||||
include(ECMInstallIcons)
|
||||
include(KDEInstallDirs)
|
||||
include(KDECompilerSettings)
|
||||
include(KDECMakeSettings)
|
||||
include(FeatureSummary)
|
||||
|
||||
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
add_definitions(-DQT_USE_QSTRINGBUILDER)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
#add_subdirectory( doc )
|
||||
add_subdirectory( src )
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(danbooru_client_SRCS danbooruconnectwidget.cpp
|
||||
set(danbooru_client_SRCS
|
||||
danbooruconnectwidget.cpp
|
||||
model/danboorupostdelegate.cpp
|
||||
model/danboorupostmodel.cpp
|
||||
danbooruclientview.cpp
|
||||
|
@ -8,29 +10,34 @@ set(danbooru_client_SRCS danbooruconnectwidget.cpp
|
|||
testpostdata.cpp
|
||||
)
|
||||
|
||||
#kde4_add_ui_files(danbooru_client_SRCS danbooru_clientview_base.ui prefs_base.ui)
|
||||
#kde4_add_kcfg_files(danbooru_client_SRCS settings.kcfgc )
|
||||
#ki18n_wrap_ui(danbooru_client_SRCS danbooru_clientview_base.ui prefs_base.ui)
|
||||
#kconfig_add_kcfg_files(danbooru_client_SRCS settings.kcfgc )
|
||||
|
||||
add_subdirectory(libdanbooru)
|
||||
|
||||
include_directories(
|
||||
${QT_INCLUDES}
|
||||
${KDE_INCLUDES}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libdanbooru
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/model
|
||||
)
|
||||
|
||||
kde4_add_ui_files(danbooru_client_SRCS
|
||||
testwidget.ui
|
||||
ui/danbooruclientview.ui
|
||||
ui/danbooruconnectwidget.ui)
|
||||
|
||||
kde4_add_executable(danbooru_client
|
||||
${danbooru_client_SRCS}
|
||||
target_link_libraries(danbooru_client PUBLIC
|
||||
Qt5::Widgets
|
||||
Qt5::Core
|
||||
Qt5::Quick
|
||||
KF5::CoreAddons
|
||||
KF5::IconThemes
|
||||
KF5::I18n
|
||||
KF5::TextWidgets
|
||||
KF5::XmlGui
|
||||
KF5::ConfigWidgets
|
||||
KF5::KIOCore
|
||||
danbooru
|
||||
)
|
||||
|
||||
target_link_libraries(danbooru_client ${KDE4_KDEUI_LIBS} ${QJSON_LIBRARIES} danbooru)
|
||||
|
||||
ki18n_wrap_ui(danbooru_client_SRCS
|
||||
testwidget.ui
|
||||
ui/danbooruclientview.ui
|
||||
ui/danbooruconnectwidget.ui)
|
||||
|
||||
add_executable(danbooru_client
|
||||
${danbooru_client_SRCS}
|
||||
)
|
||||
|
||||
install(TARGETS danbooru_client ${INSTALL_TARGETS_DEFAULT_ARGS} )
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
project(libdanbooru)
|
||||
include (KDE4Defaults)
|
||||
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set (libdanbooru_VERSION_MAJOR 0)
|
||||
set (libdanbooru_VERSION_MINOR 0)
|
||||
|
@ -14,12 +15,10 @@ set (libdanbooru_SRCS
|
|||
utils.cpp)
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
|
||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ )
|
||||
add_library(danbooru STATIC ${libdanbooru_SRCS})
|
||||
|
||||
kde4_add_library(danbooru STATIC ${libdanbooru_SRCS})
|
||||
|
||||
target_link_libraries(danbooru ${KDE4_KIO_LIBS})
|
||||
target_link_libraries(danbooru PUBLIC
|
||||
KF5::KIOCore)
|
||||
|
||||
install(TARGETS danbooru ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue