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)
 | 
					project(danbooru_client)
 | 
				
			||||||
 | 
					cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
 | 
				
			||||||
cmake_minimum_required(VERSION 2.8.6 FATAL_ERROR)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
set(danbooru_client_VERSION_MAJOR 0)
 | 
					set(danbooru_client_VERSION_MAJOR 0)
 | 
				
			||||||
set(danbooru_client_VERSION_MINOR 1)
 | 
					set(danbooru_client_VERSION_MINOR 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
find_package(KDE4 REQUIRED)
 | 
					find_package (ECM REQUIRED NO_MODULE)
 | 
				
			||||||
find_package(QJSON)
 | 
					set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include (KDE4Defaults)
 | 
					set(REQUIRED_QT_VERSION "5.3.0")
 | 
				
			||||||
include (FeatureSummary)
 | 
					set(KF5_VERSION "5.3.0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set_package_properties(KDE4 PROPERTIES DESCRIPTION "The KDE libraries"
 | 
					# Qt dependencies
 | 
				
			||||||
                       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")
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
 | 
				
			||||||
 | 
					set(CMAKE_INCLUDE_CURRENT_DIR ON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#add_subdirectory( doc )
 | 
					#add_subdirectory( doc )
 | 
				
			||||||
add_subdirectory( src )
 | 
					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/danboorupostdelegate.cpp
 | 
				
			||||||
    model/danboorupostmodel.cpp
 | 
					    model/danboorupostmodel.cpp
 | 
				
			||||||
    danbooruclientview.cpp
 | 
					    danbooruclientview.cpp
 | 
				
			||||||
| 
						 | 
					@ -8,29 +10,34 @@ set(danbooru_client_SRCS danbooruconnectwidget.cpp
 | 
				
			||||||
    testpostdata.cpp
 | 
					    testpostdata.cpp
 | 
				
			||||||
 )
 | 
					 )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#kde4_add_ui_files(danbooru_client_SRCS danbooru_clientview_base.ui prefs_base.ui)
 | 
					#ki18n_wrap_ui(danbooru_client_SRCS danbooru_clientview_base.ui prefs_base.ui)
 | 
				
			||||||
#kde4_add_kcfg_files(danbooru_client_SRCS settings.kcfgc )
 | 
					#kconfig_add_kcfg_files(danbooru_client_SRCS settings.kcfgc )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
add_subdirectory(libdanbooru)
 | 
					add_subdirectory(libdanbooru)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include_directories(
 | 
					target_link_libraries(danbooru_client PUBLIC
 | 
				
			||||||
    ${QT_INCLUDES}
 | 
					                      Qt5::Widgets
 | 
				
			||||||
    ${KDE_INCLUDES}
 | 
					                      Qt5::Core
 | 
				
			||||||
    ${CMAKE_CURRENT_BINARY_DIR}/libdanbooru
 | 
					                      Qt5::Quick
 | 
				
			||||||
    ${CMAKE_CURRENT_SOURCE_DIR}/model
 | 
					                      KF5::CoreAddons
 | 
				
			||||||
)
 | 
					                      KF5::IconThemes
 | 
				
			||||||
 | 
					                      KF5::I18n
 | 
				
			||||||
kde4_add_ui_files(danbooru_client_SRCS
 | 
					                      KF5::TextWidgets
 | 
				
			||||||
                  testwidget.ui
 | 
					                      KF5::XmlGui
 | 
				
			||||||
                  ui/danbooruclientview.ui
 | 
					                      KF5::ConfigWidgets
 | 
				
			||||||
                  ui/danbooruconnectwidget.ui)
 | 
					                      KF5::KIOCore
 | 
				
			||||||
 | 
					                      danbooru
 | 
				
			||||||
kde4_add_executable(danbooru_client
 | 
					 | 
				
			||||||
                    ${danbooru_client_SRCS}
 | 
					 | 
				
			||||||
                    )
 | 
					                    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
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} )
 | 
					install(TARGETS danbooru_client ${INSTALL_TARGETS_DEFAULT_ARGS} )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,5 +1,6 @@
 | 
				
			||||||
project(libdanbooru)
 | 
					project(libdanbooru)
 | 
				
			||||||
include (KDE4Defaults)
 | 
					
 | 
				
			||||||
 | 
					set(CMAKE_INCLUDE_CURRENT_DIR ON)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
set (libdanbooru_VERSION_MAJOR 0)
 | 
					set (libdanbooru_VERSION_MAJOR 0)
 | 
				
			||||||
set (libdanbooru_VERSION_MINOR 0)
 | 
					set (libdanbooru_VERSION_MINOR 0)
 | 
				
			||||||
| 
						 | 
					@ -14,12 +15,10 @@ set (libdanbooru_SRCS
 | 
				
			||||||
     utils.cpp)
 | 
					     utils.cpp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
 | 
					configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h @ONLY)
 | 
				
			||||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR}/
 | 
					add_library(danbooru STATIC ${libdanbooru_SRCS})
 | 
				
			||||||
                     ${CMAKE_CURRENT_SOURCE_DIR}/ )
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
kde4_add_library(danbooru STATIC ${libdanbooru_SRCS})
 | 
					target_link_libraries(danbooru PUBLIC
 | 
				
			||||||
 | 
					                      KF5::KIOCore)
 | 
				
			||||||
target_link_libraries(danbooru ${KDE4_KIO_LIBS})
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
install(TARGETS danbooru ${INSTALL_TARGETS_DEFAULT_ARGS})
 | 
					install(TARGETS danbooru ${INSTALL_TARGETS_DEFAULT_ARGS})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue