From 53a97fc89e996c200ec363185ff2207610c7d00c Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 1 Apr 2021 03:12:40 +0200 Subject: [PATCH] Make sure it's findable --- CMakeLists.txt | 12 ++++++++++-- LayerShellQtConfig.cmake.in | 6 ++++++ src/CMakeLists.txt | 25 ++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 LayerShellQtConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index bc2e804..33bcfa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,7 +36,7 @@ set_package_properties(Wayland PROPERTIES # adjusting CMAKE_C_FLAGS to get wayland protocols to compile set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu90") -ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX LAYERSHELL_QT +ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX LAYERSHELLQT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/layershellqt_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/LayerShellQtConfigVersion.cmake" SOVERSION 5) @@ -49,7 +49,15 @@ set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/LayerShellQt) install(EXPORT LayerShellQtTargets NAMESPACE LayerShellQt:: DESTINATION ${CMAKECONFIG_INSTALL_DIR} - FILE LayerShellQtTargets.cmake ) + FILE LayerShellQtTargets.cmake) + +configure_package_config_file(LayerShellQtConfig.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/LayerShellQtConfig.cmake" + INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LayerShellQtConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/LayerShellQtConfigVersion.cmake + DESTINATION ${CMAKECONFIG_INSTALL_DIR}) ecm_qt_declare_logging_category(ksld_SRCS HEADER diff --git a/LayerShellQtConfig.cmake.in b/LayerShellQtConfig.cmake.in new file mode 100644 index 0000000..410b1a7 --- /dev/null +++ b/LayerShellQtConfig.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(Qt5Gui "@QT_MIN_VERSION@") + +include("${CMAKE_CURRENT_LIST_DIR}/LayerShellQtTargets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 969c0e9..67055c2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,14 +5,27 @@ ecm_add_qtwayland_client_protocol(LAYER_SHELL_SOURCES PROTOCOL wlr-layer-shell-u add_library(layer-shell SHARED qwaylandlayershellintegrationplugin.cpp) target_link_libraries(layer-shell LayerShellQtInterface Qt5::WaylandClient Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate) -target_include_directories(layer-shell PRIVATE "$/LayerShellQt") add_library(LayerShellQtInterface SHARED qwaylandlayersurface.cpp interfaces/window.cpp interfaces/shell.cpp qwaylandlayershellintegration.cpp qwaylandlayershell.cpp ${LAYER_SHELL_SOURCES}) target_link_libraries(LayerShellQtInterface PRIVATE Qt5::Gui Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate Wayland::Client) -target_include_directories(LayerShellQtInterface PUBLIC "$/LayerShellQt" - INTERFACE "$" +target_include_directories(LayerShellQtInterface PUBLIC "$" + INTERFACE "$" ) +set_target_properties(LayerShellQtInterface PROPERTIES VERSION ${LAYERSHELLQT_VERSION_STRING} + SOVERSION ${LAYERSHELLQT_SOVERSION} + EXPORT_NAME Interface +) + +ecm_generate_headers(LayerShellQt_HEADERS + HEADER_NAMES + Shell + Window + RELATIVE interfaces/ + REQUIRED_HEADERS LayerShellQt_HEADERS +) + + generate_export_header(LayerShellQtInterface BASE_NAME LayerShellQtInterface EXPORT_MACRO_NAME LAYERSHELLQT_EXPORT @@ -23,3 +36,9 @@ install(TARGETS layer-shell LIBRARY DESTINATION ${QT_PLUGIN_INSTALL_DIR}/wayland-shell-integration) install(TARGETS LayerShellQtInterface EXPORT LayerShellQtTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) + +install(FILES + ${LayerShellQt_HEADERS} + ${CMAKE_CURRENT_BINARY_DIR}/LayerShellQt/layershellqt_export.h + DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/LayerShellQt COMPONENT Devel +)