Commit a723de2f authored by Andreas Sturmlechner's avatar Andreas Sturmlechner
Browse files

Drop use of DETECT_LIBKIPI macro and move relevant part to CMakeLists.txt

parent 76dca8e8
......@@ -122,161 +122,156 @@ endif()
# Dependencies detection required by all plugins
DETECT_LIBKIPI(${KIPI_MIN_VERSION})
find_package(KF5Kipi ${KIPI_MIN_VERSION} REQUIRED)
if(KF5Kipi_FOUND)
get_target_property(KF5Kipi_INCLUDE_DIRS KF5::Kipi INTERFACE_INCLUDE_DIRECTORIES)
# -- Optional dependencies detection required by some plugins -------------------------------------
# Detect libkipi so version used to compile kipi tool to identify if plugin can be loaded in memory by libkipi.
# This will be used to populate plugin desktop files.
DETECT_LIBMEDIAWIKI(5.0.0) # For Mediawiki.
DETECT_LIBKVKONTAKTE(4.70.0) # For VKontakte.
foreach(var ${KF5Kipi_INCLUDE_DIRS})
if(EXISTS "${var}/libkipi_config.h")
set(KF5KipiConfig_FOUND "${var}/libkipi_config.h")
message(STATUS "Libkipi config header: ${KF5KipiConfig_FOUND}")
break()
endif()
endforeach()
# ==================================================================================================
# Log messages
if(KF5KipiConfig_FOUND)
file(READ ${KF5KipiConfig_FOUND} KIPI_CONFIG_H_CONTENT)
message(STATUS "")
message(STATUS "----------------------------------------------------------------------------------")
message(STATUS " ${PROJECT_NAME} ${KIPIPLUGINS_VERSION_STRING} dependencies results")
message(STATUS "")
string(REGEX REPLACE
".*static +const +int +kipi_binary_version += ([^ ;]+).*"
"\\1"
KIPI_LIB_SO_CUR_VERSION_FOUND
"${KIPI_CONFIG_H_CONTENT}"
)
# Require shared libraries results.
set(KIPI_LIB_SO_CUR_VERSION ${KIPI_LIB_SO_CUR_VERSION_FOUND} CACHE STRING "libkipi so version")
else()
message(FATAL_ERROR "Could not find libkipi SO version")
set(KF5Kipi_FOUND FALSE)
endif()
PRINT_LIBRARY_STATUS("libqt" "http://www.qtsoftware.com" "(version >= ${QT_MIN_VERSION})" Qt5_FOUND)
PRINT_LIBRARY_STATUS("libkde" "http://www.kde.org" "(version >= ${KF5_MIN_VERSION})" KF5_FOUND)
PRINT_LIBRARY_STATUS("libkipi" "https://projects.kde.org/projects/kde/kdegraphics/libs/libkipi" "(version >= ${KIPI_MIN_VERSION}))" KF5Kipi_FOUND)
message(STATUS "libkipi includes : ${KF5Kipi_INCLUDE_DIRS}")
message(STATUS "libkipi SO version : ${KIPI_LIB_SO_CUR_VERSION}")
# Optional shared libraries results.
# -- Optional dependencies detection required by some plugins -------------------------------------
PRINT_OPTIONAL_LIBRARY_STATUS("libkio" "https://projects.kde.org/projects/frameworks/kio" "(version >= ${KF5_MIN_VERSION})" "Kipi-plugins will be compiled without libkio support." KF5KIO_FOUND)
PRINT_OPTIONAL_LIBRARY_STATUS("libkarchive" "https://projects.kde.org/projects/frameworks/karchive" "(version >= ${KF5_MIN_VERSION})" "Kipi-plugins will be compiled without libkarchive support." KF5Archive_FOUND)
PRINT_OPTIONAL_LIBRARY_STATUS("libmediawiki" "https://projects.kde.org/projects/extragear/libs/libmediawiki" "(version >= ${KF5_MIN_VERSION})" "Kipi-plugins will be compiled without libmediawiki support." KF5MediaWiki_FOUND)
PRINT_OPTIONAL_LIBRARY_STATUS("libkvkontakte" "https://projects.kde.org/projects/extragear/libs/libkvkontakte" "(version >= 4.70.0)" "Kipi-plugins will be compiled without libkvkontakte support." KF5Vkontakte_FOUND)
DETECT_LIBMEDIAWIKI(5.0.0) # For Mediawiki.
DETECT_LIBKVKONTAKTE(4.70.0) # For VKontakte.
# Optional plugins results ----------------------------------------------------------------------------
# ==================================================================================================
# Log messages
message(STATUS "")
message(STATUS "")
message(STATUS "----------------------------------------------------------------------------------")
message(STATUS " ${PROJECT_NAME} ${KIPIPLUGINS_VERSION_STRING} dependencies results")
message(STATUS "")
if(Qt5_FOUND AND KF5_FOUND AND KF5Kipi_FOUND)
set(KIPI_COMPILE_MESSAGE "kipi-plugins will be compiled")
FILL_WITH_DOTS(KIPI_COMPILE_MESSAGE)
message(STATUS " ${KIPI_COMPILE_MESSAGE} YES")
set(KIPIPLUGINS_CAN_BE_COMPILED true)
else()
message(FATAL_ERROR " kipi-plugins will not be compiled! Look README file for more details about dependencies...")
set(KIPIPLUGINS_CAN_BE_COMPILED false)
endif()
# Require shared libraries results.
PRINT_COMPONENT_COMPILE_STATUS("Legacy plugins" ENABLE_LEGACY)
PRINT_COMPONENT_COMPILE_STATUS("VKontakte" KF5Vkontakte_FOUND)
PRINT_COMPONENT_COMPILE_STATUS("Mediawiki" KF5MediaWiki_FOUND)
PRINT_COMPONENT_COMPILE_STATUS("FlashExport" KF5Archive_FOUND)
# ==================================================================================================
if(KIPIPLUGINS_CAN_BE_COMPILED)
# ==================================================================================================
# Create git version header
# We only do this IF we are in a .git dir
find_file(GIT_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.git)
if(NOT GIT_MARKER)
set (GIT_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
endif()
# Add a custom command to drive the git script whenever the git entries
# file changes.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/gitscript.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/gitscript.cmake"
@ONLY)
# Add a custom target to drive the custom command.
add_custom_target(kipiplugins-gitversion
ALL COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/gitscript.cmake")
# ==================================================================================================
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins
${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/dialogs
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/widgets
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/tools
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/o2/src
${KF5Kipi_INCLUDE_DIRS}
)
# To prevent warnings from M$ compiler
if(WIN32 AND MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_ATL_SECURE_NO_WARNINGS)
add_definitions(-D_AFX_SECURE_NO_WARNINGS)
endif()
# Remove pedantic GCC flag which generate a lots of warnings on the console with qCDebug()
while(CMAKE_CXX_FLAGS MATCHES "-pedantic")
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endwhile()
# Remove Wdate-time GCC flag which generate a lots of compile warnings
while(CMAKE_CXX_FLAGS MATCHES "-Wdate-time")
string(REPLACE "-Wdate-time" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endwhile()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_subdirectory(common)
add_subdirectory(flickr)
add_subdirectory(dropbox)
add_subdirectory(facebook)
add_subdirectory(imgur)
add_subdirectory(piwigo)
add_subdirectory(rajce)
add_subdirectory(smug)
add_subdirectory(imageshack)
add_subdirectory(yandexfotki)
add_subdirectory(googleservices)
if(ENABLE_LEGACY)
add_subdirectory(printimages)
add_subdirectory(kmlexport)
add_subdirectory(sendimages)
add_subdirectory(jalbum)
if(KF5Archive_FOUND)
add_subdirectory(flashexport)
endif()
endif()
if(KF5Vkontakte_FOUND)
add_subdirectory(vkontakte)
endif()
if(KF5MediaWiki_FOUND)
add_subdirectory(mediawiki)
endif()
if(KF5KIO_FOUND AND KF5KIOWidgets_FOUND)
add_subdirectory(remotestorage) # kioimportwindow.cpp, kioexportwindow.cpp
endif()
PRINT_LIBRARY_STATUS("libqt" "http://www.qtsoftware.com" "(version >= ${QT_MIN_VERSION})" Qt5_FOUND)
PRINT_LIBRARY_STATUS("libkde" "http://www.kde.org" "(version >= ${KF5_MIN_VERSION})" KF5_FOUND)
PRINT_LIBRARY_STATUS("libkipi" "https://projects.kde.org/projects/kde/kdegraphics/libs/libkipi" "(version >= ${KIPI_MIN_VERSION}))" KF5Kipi_FOUND)
endif()
# Optional shared libraries results.
else()
PRINT_OPTIONAL_LIBRARY_STATUS("libkio" "https://projects.kde.org/projects/frameworks/kio" "(version >= ${KF5_MIN_VERSION})" "Kipi-plugins will be compiled without libkio support." KF5KIO_FOUND)
PRINT_OPTIONAL_LIBRARY_STATUS("libkarchive" "https://projects.kde.org/projects/frameworks/karchive" "(version >= ${KF5_MIN_VERSION})" "Kipi-plugins will be compiled without libkarchive support." KF5Archive_FOUND)
PRINT_OPTIONAL_LIBRARY_STATUS("libmediawiki" "https://projects.kde.org/projects/extragear/libs/libmediawiki" "(version >= ${KF5_MIN_VERSION})" "Kipi-plugins will be compiled without libmediawiki support." KF5MediaWiki_FOUND)
PRINT_OPTIONAL_LIBRARY_STATUS("libkvkontakte" "https://projects.kde.org/projects/extragear/libs/libkvkontakte" "(version >= 4.70.0)" "Kipi-plugins will be compiled without libkvkontakte support." KF5Vkontakte_FOUND)
message(STATUS "")
message(STATUS "----------------------------------------------------------------------------------")
message(STATUS " ${PROJECT_NAME} ${KIPIPLUGINS_VERSION_STRING} will not be compiled")
# Optional plugins results ----------------------------------------------------------------------------
PRINT_OPTIONAL_LIBRARY_STATUS("libkipi"
"https://cgit.kde.org/libkipi.git"
"(version >= ${KIPI_MIN_VERSION}))"
"Kipi Plugins needs this library to be compiled."
KF5Kipi_FOUND
)
PRINT_COMPONENT_COMPILE_STATUS("Legacy plugins" ENABLE_LEGACY)
PRINT_COMPONENT_COMPILE_STATUS("VKontakte" KF5Vkontakte_FOUND)
PRINT_COMPONENT_COMPILE_STATUS("Mediawiki" KF5MediaWiki_FOUND)
PRINT_COMPONENT_COMPILE_STATUS("FlashExport" KF5Archive_FOUND)
# ==================================================================================================
# Create git version header
# We only do this IF we are in a .git dir
find_file(GIT_MARKER entries PATHS ${CMAKE_SOURCE_DIR}/.git)
message(STATUS "")
if(NOT GIT_MARKER)
set (GIT_MARKER ${CMAKE_SOURCE_DIR}/CMakeLists.txt) # Dummy file
endif()
# Add a custom command to drive the git script whenever the git entries
# file changes.
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/gitscript.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/gitscript.cmake"
@ONLY)
# Add a custom target to drive the custom command.
add_custom_target(kipiplugins-gitversion
ALL COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/gitscript.cmake")
# ==================================================================================================
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins
${CMAKE_CURRENT_BINARY_DIR}/common/libkipiplugins
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/dialogs
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/widgets
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/tools
${CMAKE_CURRENT_SOURCE_DIR}/common/libkipiplugins/o2/src
${KF5Kipi_INCLUDE_DIRS}
)
# To prevent warnings from M$ compiler
if(WIN32 AND MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_ATL_SECURE_NO_WARNINGS)
add_definitions(-D_AFX_SECURE_NO_WARNINGS)
endif()
# Remove pedantic GCC flag which generate a lots of warnings on the console with qCDebug()
while(CMAKE_CXX_FLAGS MATCHES "-pedantic")
string(REPLACE "-pedantic" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endwhile()
# Remove Wdate-time GCC flag which generate a lots of compile warnings
while(CMAKE_CXX_FLAGS MATCHES "-Wdate-time")
string(REPLACE "-Wdate-time" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
endwhile()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_subdirectory(common)
add_subdirectory(flickr)
add_subdirectory(dropbox)
add_subdirectory(facebook)
add_subdirectory(imgur)
add_subdirectory(piwigo)
add_subdirectory(rajce)
add_subdirectory(smug)
add_subdirectory(imageshack)
add_subdirectory(yandexfotki)
add_subdirectory(googleservices)
if(ENABLE_LEGACY)
add_subdirectory(printimages)
add_subdirectory(kmlexport)
add_subdirectory(sendimages)
add_subdirectory(jalbum)
if(KF5Archive_FOUND)
add_subdirectory(flashexport)
endif()
endif()
if(KF5Vkontakte_FOUND)
add_subdirectory(vkontakte)
endif()
if(KF5MediaWiki_FOUND)
add_subdirectory(mediawiki)
endif()
if(KF5KIO_FOUND AND KF5KIOWidgets_FOUND)
add_subdirectory(remotestorage) # kioimportwindow.cpp, kioexportwindow.cpp
endif()
Markdown is supported
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