You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libqtxdg-packaging/qtxdg/CMakeLists.txt

147 lines
3.5 KiB

set(QTX_LIBRARIES Qt5::Widgets Qt5::Xml Qt5::DBus)
include_directories(
"${Qt5Gui_PRIVATE_INCLUDE_DIRS}"
)
set(libqtxdg_PUBLIC_H_FILES
xdgaction.h
xdgdesktopfile.h
xdgdirs.h
xdgicon.h
xdgmenu.h
xdgmenuwidget.h
xmlhelper.h
xdgautostart.h
xdgmacros.h
xdgmimetype.h
)
set(libqtxdg_PUBLIC_CLASSES
XdgAction
XdgDesktopFile
XdgDirs
XdgIcon
XdgMenu
XdgMenuWidget
XmlHelper
XdgAutoStart
XdgMimeType
)
set(libqtxdg_PRIVATE_H_FILES
xdgmenuapplinkprocessor.h
xdgmenulayoutprocessor.h
xdgmenu_p.h
xdgmenureader.h
xdgmenurules.h
xdgdesktopfile_p.h
)
set(libqtxdg_CPP_FILES
xdgaction.cpp
xdgdesktopfile.cpp
xdgdirs.cpp
xdgicon.cpp
xdgmenuapplinkprocessor.cpp
xdgmenu.cpp
xdgmenulayoutprocessor.cpp
xdgmenureader.cpp
xdgmenurules.cpp
xdgmenuwidget.cpp
xmlhelper.cpp
xdgautostart.cpp
xdgmimetype.cpp
)
set(libqtxdg_MOCS
xdgaction.h
xdgmenuapplinkprocessor.h
xdgmenu.h
xdgmenu_p.h
xdgmenureader.h
xdgmenurules.h
xdgmenuwidget.h
)
QT5_WRAP_CPP(libqtxdg_CXX_FILES ${libqtxdg_MOCS})
add_library(${QTXDGX_LIBRARY_NAME} SHARED
${libqtxdg_PUBLIC_H_FILES}
${libqtxdg_PRIVATE_H_FILES}
${libqtxdg_PRIVATE_H_FILES}
${libqtxdg_CPP_FILES}
${libqtxdg_CXX_FILES}
)
target_link_libraries(${QTXDGX_LIBRARY_NAME}
PUBLIC
${QTX_LIBRARIES}
${QTXDGX_ICONLOADER_LIBRARY_NAME}
)
set_target_properties(${QTXDGX_LIBRARY_NAME} PROPERTIES
VERSION ${QTXDG_VERSION_STRING}
SOVERSION ${QTXDG_MAJOR_VERSION}
)
target_compile_definitions(${QTXDGX_LIBRARY_NAME}
PRIVATE "QTXDG_COMPILATION=\"1\""
PRIVATE "QTXDG_VERSION=\"${QTXDG_VERSION_STRING}\""
)
target_include_directories(${QTXDGX_LIBRARY_NAME}
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${QTXDGX_FILE_NAME}>"
INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
# include directories and targets for the in tree build
target_include_directories(${QTXDGX_LIBRARY_NAME}
INTERFACE "$<BUILD_INTERFACE:${QTXDGX_INTREE_INCLUDEDIR}/${QTXDGX_FILE_NAME}>"
INTERFACE "$<BUILD_INTERFACE:${QTXDGX_INTREE_INCLUDEDIR}>"
)
export(TARGETS ${QTXDGX_LIBRARY_NAME} APPEND FILE "${CMAKE_BINARY_DIR}/${QTXDGX_FILE_NAME}-targets.cmake")
# end of in tree build stuff
# create the portble headers
create_portable_headers(libqtxdg_PORTABLE_HEADERS
HEADER_NAMES ${libqtxdg_PUBLIC_CLASSES}
OUTPUT_DIR "${QTXDGX_INTREE_INCLUDEDIR}/${QTXDGX_FILE_NAME}"
)
# Copy public headers (in tree building)
foreach(h ${libqtxdg_PUBLIC_H_FILES})
get_filename_component(bh ${h} NAME)
configure_file(${h} "${QTXDGX_INTREE_INCLUDEDIR}/${QTXDGX_FILE_NAME}/${bh}" COPYONLY)
endforeach()
# Copy private headers (in tree building)
foreach(h ${libqtxdg_PRIVATE_INSTALLABLE_H_FILES})
get_filename_component(bh ${h} NAME)
configure_file(${h} "${QTXDGX_INTREE_INCLUDEDIR}/${QTXDGX_FILE_NAME}/${QTXDG_VERSION_STRING}/private/qtxdg/${bh}" COPYONLY)
endforeach()
install(TARGETS
${QTXDGX_LIBRARY_NAME} DESTINATION "${CMAKE_INSTALL_LIBDIR}"
EXPORT "${QTXDGX_FILE_NAME}-targets"
COMPONENT Runtime
)
install(FILES
${libqtxdg_PUBLIC_H_FILES}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${QTXDGX_FILE_NAME}"
COMPONENT Devel
)
install(FILES
${libqtxdg_PRIVATE_INSTALLABLE_H_FILES}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${QTXDGX_FILE_NAME}/${QTXDG_VERSION_STRING}/private/qtxdg"
COMPONENT Devel
)
install(FILES
${libqtxdg_PORTABLE_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${QTXDGX_FILE_NAME}"
COMPONENT Devel
)