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()