From dc0ed24f1a05cac6b9fc47ddfeb2531497673c89 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 10 Jun 2020 16:43:34 +0200 Subject: [PATCH] [libcalamaresui] Install libcalamaresui headers - All the headers go to relevant subdirs, but we don't keep libcalamares and libcalamaresui apart. - While here, remove unused variable from libcalamares CMake --- src/libcalamares/CMakeLists.txt | 7 +++++-- src/libcalamaresui/CMakeLists.txt | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index a7b4472d5..0516b5613 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -177,6 +177,9 @@ target_link_libraries( calamares ${OPTIONAL_PUBLIC_LIBRARIES} ) +### Installation +# +# install( TARGETS calamares EXPORT Calamares RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -193,19 +196,19 @@ install( CODE " # Install header files file( GLOB rootHeaders "*.h" ) -file( GLOB utilsHeaders "utils/*.h" ) - install( FILES ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h ${rootHeaders} DESTINATION include/libcalamares ) +# Install each subdir-worth of header files foreach( subdir geoip locale modulesystem network partition utils ) file( GLOB subdir_headers "${subdir}/*.h" ) install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} ) endforeach() + ### TESTING # # diff --git a/src/libcalamaresui/CMakeLists.txt b/src/libcalamaresui/CMakeLists.txt index 9d7b7a85c..773fdf617 100644 --- a/src/libcalamaresui/CMakeLists.txt +++ b/src/libcalamaresui/CMakeLists.txt @@ -83,3 +83,25 @@ endif() if( WITH_QML ) target_link_libraries( calamaresui PUBLIC Qt5::QuickWidgets ) endif() + + +### Installation +# +# +# The library is already installed through calamares_add_library(), +# so we only need to do headers. Unlike the Calamares source tree, +# where libcalamares and libcalamaresui live in different branches, +# we're going to glom it all together in the installed headers location. + +install( + FILES + Branding.h + ViewManager.h + DESTINATION include/libcalamares +) + +# Install each subdir-worth of header files +foreach( subdir modulesystem utils viewpages widgets ) + file( GLOB subdir_headers "${subdir}/*.h" ) + install( FILES ${subdir_headers} DESTINATION include/libcalamares/${subdir} ) +endforeach()