mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00
generic: build system cleanups
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
a7b93fa3b2
commit
dfc0b3b9bc
5 changed files with 167 additions and 151 deletions
|
@ -22,23 +22,23 @@
|
|||
#
|
||||
# ============================================================
|
||||
|
||||
PROJECT(libkexiv2)
|
||||
project(libkexiv2)
|
||||
|
||||
ADD_DEFINITIONS(
|
||||
add_definitions(
|
||||
${QT_QTDBUS_DEFINITIONS}
|
||||
-DKDE_DEFAULT_DEBUG_AREA=51003
|
||||
)
|
||||
INCLUDE_DIRECTORIES(
|
||||
|
||||
include_directories(
|
||||
${QDBUS_INCLUDE_DIRS}
|
||||
${CMAKE_SOURCE_DIR}
|
||||
${CMAKE_BINARY_DIR}
|
||||
${KDE4_INCLUDES}
|
||||
${KDE4_KDECORE_INCLUDES}
|
||||
${KDE4_KDEUI_INCLUDES}
|
||||
)
|
||||
|
||||
FIND_PACKAGE(Exiv2 REQUIRED VERSION "0.21")
|
||||
SET_PACKAGE_PROPERTIES(Exiv2 PROPERTIES
|
||||
find_package(Exiv2 REQUIRED VERSION "0.21")
|
||||
set_package_properties(Exiv2 PROPERTIES
|
||||
DESCRIPTION "Image metadata library and tools"
|
||||
URL "http://www.exiv2.org"
|
||||
PURPOSE "Required to build libkexiv2"
|
||||
|
@ -47,23 +47,24 @@ SET_PACKAGE_PROPERTIES(Exiv2 PROPERTIES
|
|||
# =======================================================
|
||||
# Set env. variables accordinly.
|
||||
|
||||
SET(KEXIV2_LIB_VERSION_STRING "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}")
|
||||
SET(KEXIV2_LIB_VERSION_ID "0x0${KDE_VERSION_MAJOR}0${KDE_VERSION_MINOR}0${KDE_VERSION_RELEASE}")
|
||||
SET(KEXIV2_LIB_SO_VERSION_STRING "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}")
|
||||
set(KEXIV2_LIB_VERSION_STRING "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}")
|
||||
set(KEXIV2_LIB_VERSION_ID "0x0${KDE_VERSION_MAJOR}0${KDE_VERSION_MINOR}0${KDE_VERSION_RELEASE}")
|
||||
set(KEXIV2_LIB_SO_VERSION_STRING "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KDE_VERSION_RELEASE}")
|
||||
|
||||
# =======================================================
|
||||
|
||||
ADD_SUBDIRECTORY(libkexiv2)
|
||||
add_subdirectory(libkexiv2)
|
||||
|
||||
if(ENABLE_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
CONFIGURE_FILE(
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libkexiv2.pc.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libkexiv2.pc
|
||||
)
|
||||
INSTALL(
|
||||
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/libkexiv2.pc
|
||||
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
|
||||
)
|
||||
|
|
|
@ -22,18 +22,21 @@
|
|||
#
|
||||
# ============================================================
|
||||
|
||||
INCLUDE_DIRECTORIES(${EXIV2_INCLUDE_DIR})
|
||||
include_directories(${EXIV2_INCLUDE_DIR})
|
||||
|
||||
ADD_DEFINITIONS(${EXIV2_DEFINITIONS})
|
||||
ADD_DEFINITIONS(${KDE4_ENABLE_EXCEPTIONS})
|
||||
add_definitions(${EXIV2_DEFINITIONS} ${KDE4_ENABLE_EXCEPTIONS})
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h)
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/version.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/version.h
|
||||
)
|
||||
|
||||
# This was used to enable catching of exceptions thrown by libexiv2.
|
||||
# We use now #pragma GCC visibility push(default) around the headers
|
||||
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
|
||||
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=default")
|
||||
|
||||
SET(kexiv2_LIB_SRCS kexiv2.cpp
|
||||
set(kexiv2_LIB_SRCS
|
||||
kexiv2.cpp
|
||||
kexiv2_p.cpp
|
||||
kexiv2image.cpp
|
||||
kexiv2comments.cpp
|
||||
|
@ -47,19 +50,37 @@ SET(kexiv2_LIB_SRCS kexiv2.cpp
|
|||
countryselector.cpp
|
||||
subjectwidget.cpp
|
||||
rotationmatrix.cpp
|
||||
)
|
||||
)
|
||||
|
||||
ADD_LIBRARY(kexiv2 SHARED ${kexiv2_LIB_SRCS})
|
||||
add_library(kexiv2 SHARED ${kexiv2_LIB_SRCS})
|
||||
|
||||
TARGET_LINK_LIBRARIES(kexiv2 ${KDE4_KDEUI_LIBS} ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY}
|
||||
${QT_QTXML_LIBRARY} ${EXIV2_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(kexiv2 PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
|
||||
target_link_libraries(kexiv2
|
||||
${KDE4_KDEUI_LIBS}
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${QT_QTXML_LIBRARY}
|
||||
${EXIV2_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS kexiv2 EXPORT kdelibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
set_target_properties(kexiv2 PROPERTIES
|
||||
VERSION ${GENERIC_LIB_VERSION}
|
||||
SOVERSION ${GENERIC_LIB_SOVERSION}
|
||||
)
|
||||
|
||||
INSTALL(FILES topicset.iptc-subjectcode.xml DESTINATION ${DATA_INSTALL_DIR}/libkexiv2/data)
|
||||
install(
|
||||
TARGETS kexiv2
|
||||
EXPORT kdelibsLibraryTargets
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
INSTALL(FILES
|
||||
install(
|
||||
FILES
|
||||
topicset.iptc-subjectcode.xml
|
||||
DESTINATION ${DATA_INSTALL_DIR}/libkexiv2/data
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
kexiv2.h
|
||||
kexiv2data.h
|
||||
kexiv2previews.h
|
||||
|
|
|
@ -14,7 +14,8 @@ set(kfile_LIB_SRCS
|
|||
kdiroperator.cpp
|
||||
kdiroperatordetailview.cpp
|
||||
kdirselectdialog.cpp
|
||||
kdirsortfilterproxymodel.cpp # used in combination with kio/kio/kdirmodel.cpp
|
||||
# used in combination with kio/kio/kdirmodel.cpp
|
||||
kdirsortfilterproxymodel.cpp
|
||||
kfilebookmarkhandler.cpp
|
||||
kfilefiltercombo.cpp
|
||||
kfiletreeview.cpp
|
||||
|
@ -38,6 +39,7 @@ set(kfile_LIB_SRCS
|
|||
)
|
||||
|
||||
add_library(kfile ${LIBRARY_TYPE} ${kfile_LIB_SRCS})
|
||||
|
||||
target_link_libraries(kfile PRIVATE
|
||||
${KDE4_KIO_LIBS}
|
||||
${ZLIB_LIBRARY}
|
||||
|
@ -49,16 +51,26 @@ if(X11_Xrender_FOUND)
|
|||
target_link_libraries(kfile PRIVATE ${X11_Xrender_LIB})
|
||||
endif(X11_Xrender_FOUND)
|
||||
|
||||
target_link_libraries(kfile PUBLIC kio kdeui kdecore ${QT_QTGUI_LIBRARY})
|
||||
target_link_libraries(kfile PUBLIC
|
||||
kio
|
||||
kdeui
|
||||
kdecore
|
||||
${QT_QTGUI_LIBRARY}
|
||||
)
|
||||
|
||||
set_target_properties(kfile PROPERTIES
|
||||
VERSION ${GENERIC_LIB_VERSION}
|
||||
SOVERSION ${GENERIC_LIB_SOVERSION}
|
||||
)
|
||||
|
||||
install(TARGETS kfile EXPORT kdelibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
install(
|
||||
TARGETS kfile
|
||||
EXPORT kdelibsLibraryTargets
|
||||
${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
)
|
||||
|
||||
install( FILES
|
||||
install(
|
||||
FILES
|
||||
kdiroperator.h
|
||||
kdirselectdialog.h
|
||||
kdirsortfilterproxymodel.h
|
||||
|
@ -78,11 +90,19 @@ install( FILES
|
|||
|
||||
############ module used by KFileDialog ##########
|
||||
|
||||
set(kfilemodule_SRCS kfilemodule.cpp)
|
||||
kde4_add_plugin(kfilemodule kfilemodule.cpp)
|
||||
|
||||
kde4_add_plugin(kfilemodule ${kfilemodule_SRCS})
|
||||
target_link_libraries(kfilemodule
|
||||
${KDE4_KFILE_LIBS}
|
||||
${KDE4_KIO_LIBS}
|
||||
)
|
||||
|
||||
target_link_libraries(kfilemodule ${KDE4_KFILE_LIBS} ${KDE4_KIO_LIBS})
|
||||
install(
|
||||
TARGETS kfilemodule
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(TARGETS kfilemodule DESTINATION ${PLUGIN_INSTALL_DIR})
|
||||
install(FILES kfilemodule.desktop DESTINATION ${SERVICES_INSTALL_DIR})
|
||||
install(
|
||||
FILES kfilemodule.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
project(kimgio)
|
||||
|
||||
macro_optional_find_package(Jasper)
|
||||
|
@ -22,100 +21,34 @@ set_package_properties(WebP PROPERTIES
|
|||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
include_directories( ${KDE4_KDEUI_INCLUDES} )
|
||||
include_directories(${KDE4_KDEUI_INCLUDES})
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
|
||||
|
||||
##################################
|
||||
|
||||
if(JASPER_FOUND)
|
||||
include_directories(${JASPER_INCLUDE_DIR})
|
||||
kde4_add_plugin(kimg_jp2 jp2.cpp)
|
||||
target_link_libraries(kimg_jp2
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
${JASPER_LIBRARIES}
|
||||
)
|
||||
|
||||
include_directories( ${JASPER_INCLUDE_DIR} )
|
||||
set(kimg_jp2_LIB_SRCS jp2.cpp)
|
||||
kde4_add_plugin(kimg_jp2 ${kimg_jp2_LIB_SRCS})
|
||||
target_link_libraries(kimg_jp2 ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY} ${JASPER_LIBRARIES} )
|
||||
|
||||
install(TARGETS kimg_jp2 DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
install( FILES jp2.desktop DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/ )
|
||||
|
||||
install(
|
||||
TARGETS kimg_jp2
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats
|
||||
)
|
||||
install(
|
||||
FILES
|
||||
jp2.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins
|
||||
)
|
||||
endif(JASPER_FOUND)
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_eps_LIB_SRCS eps.cpp)
|
||||
kde4_add_plugin(kimg_eps ${kimg_eps_LIB_SRCS})
|
||||
target_link_libraries(kimg_eps ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_eps DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_pcx_LIB_SRCS pcx.cpp)
|
||||
kde4_add_plugin(kimg_pcx ${kimg_pcx_LIB_SRCS})
|
||||
target_link_libraries(kimg_pcx ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_pcx DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_tga_LIB_SRCS tga.cpp)
|
||||
kde4_add_plugin(kimg_tga ${kimg_tga_LIB_SRCS})
|
||||
target_link_libraries(kimg_tga ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_tga DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_ras_LIB_SRCS ras.cpp)
|
||||
kde4_add_plugin(kimg_ras ${kimg_ras_LIB_SRCS})
|
||||
target_link_libraries(kimg_ras ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_ras DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_rgb_LIB_SRCS rgb.cpp)
|
||||
kde4_add_plugin(kimg_rgb ${kimg_rgb_LIB_SRCS})
|
||||
target_link_libraries(kimg_rgb ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_rgb DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_xcf_LIB_SRCS xcf.cpp)
|
||||
kde4_add_plugin(kimg_xcf ${kimg_xcf_LIB_SRCS})
|
||||
target_link_libraries(kimg_xcf ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_xcf DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_dds_LIB_SRCS dds.cpp)
|
||||
kde4_add_plugin(kimg_dds ${kimg_dds_LIB_SRCS})
|
||||
target_link_libraries(kimg_dds ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_dds DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_psd_LIB_SRCS psd.cpp)
|
||||
kde4_add_plugin(kimg_psd ${kimg_psd_LIB_SRCS})
|
||||
target_link_libraries(kimg_psd ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_psd DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_xview_LIB_SRCS xview.cpp)
|
||||
kde4_add_plugin(kimg_xview ${kimg_xview_LIB_SRCS})
|
||||
target_link_libraries(kimg_xview ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_xview DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
if(OPENEXR_FOUND)
|
||||
include_directories( ${CMAKE_SOURCE_DIR}/kio ${OPENEXR_INCLUDE_DIR})
|
||||
add_definitions(${OPENEXR_DEFINITIONS})
|
||||
|
@ -129,14 +62,6 @@ endif(OPENEXR_FOUND)
|
|||
|
||||
##################################
|
||||
|
||||
set(kimg_pic_LIB_SRCS pic_read.cpp pic_write.cpp pic_io_plugin.cpp pic_io_handler.cpp)
|
||||
kde4_add_plugin(kimg_pic ${kimg_pic_LIB_SRCS})
|
||||
target_link_libraries(kimg_pic ${KDE4_KDECORE_LIBS} ${QT_QTGUI_LIBRARY})
|
||||
|
||||
install(TARGETS kimg_pic DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats/ )
|
||||
|
||||
##################################
|
||||
|
||||
if(WEBP_FOUND)
|
||||
include_directories( ${WEBP_INCLUDES} )
|
||||
kde4_add_plugin(kimg_webp webp.cpp)
|
||||
|
@ -147,7 +72,53 @@ if(WEBP_FOUND)
|
|||
|
||||
install(FILES webp.xml DESTINATION ${XDG_MIME_INSTALL_DIR})
|
||||
update_xdg_mimetypes(${XDG_MIME_INSTALL_DIR})
|
||||
endif()
|
||||
endif(WEBP_FOUND)
|
||||
|
||||
##################################
|
||||
|
||||
set(imgioplugins
|
||||
eps
|
||||
pcx
|
||||
tga
|
||||
ras
|
||||
rgb
|
||||
xcf
|
||||
dds
|
||||
psd
|
||||
xview
|
||||
)
|
||||
|
||||
foreach(plugin ${imgioplugins})
|
||||
kde4_add_plugin(kimg_${plugin} ${plugin}.cpp)
|
||||
target_link_libraries(kimg_${plugin}
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
)
|
||||
install(
|
||||
TARGETS kimg_${plugin}
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats
|
||||
)
|
||||
endforeach()
|
||||
|
||||
##################################
|
||||
|
||||
set(kimg_pic_LIB_SRCS
|
||||
pic_read.cpp
|
||||
pic_write.cpp
|
||||
pic_io_plugin.cpp
|
||||
pic_io_handler.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin(kimg_pic ${kimg_pic_LIB_SRCS})
|
||||
target_link_libraries(kimg_pic
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${QT_QTGUI_LIBRARY}
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS kimg_pic
|
||||
DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/imageformats
|
||||
)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
|
@ -179,12 +150,12 @@ install(
|
|||
pic.desktop
|
||||
svg+xml.desktop
|
||||
svg+xml-compressed.desktop
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins/
|
||||
DESTINATION ${SERVICES_INSTALL_DIR}/qimageioplugins
|
||||
)
|
||||
|
||||
install(
|
||||
FILES qimageio_plugin.desktop
|
||||
DESTINATION ${SERVICETYPES_INSTALL_DIR}/
|
||||
DESTINATION ${SERVICETYPES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@ include_directories(${KDE4_KPARTS_INCLUDES})
|
|||
|
||||
########### Configuring (mainly for proctitle) ###########
|
||||
|
||||
include (CheckFunctionExists)
|
||||
include (CheckIncludeFiles)
|
||||
include (CheckVariableExists)
|
||||
include(CheckFunctionExists)
|
||||
include(CheckIncludeFiles)
|
||||
include(CheckVariableExists)
|
||||
check_variable_exists(__progname HAVE___PROGNAME)
|
||||
check_variable_exists(__progname_full HAVE___PROGNAME_FULL)
|
||||
check_include_files(sys/pstat.h HAVE_SYS_PSTAT_H)
|
||||
|
@ -21,11 +21,10 @@ check_function_exists(setproctitle HAVE_SETPROCTITLE)
|
|||
|
||||
|
||||
# used by 4 executables in this file
|
||||
set(KINIT_SOCKET_LIBRARY)
|
||||
if(HAVE_SOCKET_LIBRARY)
|
||||
set(KINIT_SOCKET_LIBRARY socket)
|
||||
else(HAVE_SOCKET_LIBRARY)
|
||||
set(KINIT_SOCKET_LIBRARY)
|
||||
endif(HAVE_SOCKET_LIBRARY)
|
||||
endif()
|
||||
|
||||
|
||||
########### kdeinit4 ###############
|
||||
|
@ -124,4 +123,8 @@ install(
|
|||
)
|
||||
|
||||
########### config-kdeinit.h ############
|
||||
configure_file(config-kdeinit.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdeinit.h)
|
||||
|
||||
configure_file(
|
||||
config-kdeinit.h.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/config-kdeinit.h
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue