From cefb4373249393e894e27839833a6aff04718ebc Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 18 Feb 2024 23:19:43 +0100 Subject: [PATCH] [libcalamares] Improve CMake bits - use modern CMake commands, target-based - make DLLEXPORT_PRO local to the build of libcalamares - improve locality of includes --- src/libcalamares/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/libcalamares/CMakeLists.txt b/src/libcalamares/CMakeLists.txt index ce05969a8..759536bd9 100644 --- a/src/libcalamares/CMakeLists.txt +++ b/src/libcalamares/CMakeLists.txt @@ -10,9 +10,6 @@ # (non-GUI) jobs. # -add_definitions(-DDLLEXPORT_PRO) -include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CalamaresConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/CalamaresConfig.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CalamaresVersion.h.in ${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersion.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CalamaresVersionX.h.in ${CMAKE_CURRENT_BINARY_DIR}/CalamaresVersionX.h) @@ -98,11 +95,18 @@ set_target_properties( PROPERTIES VERSION ${CALAMARES_VERSION_SHORT} SOVERSION ${CALAMARES_SOVERSION} - INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcalamares ) target_link_libraries(calamares LINK_PUBLIC yamlcpp::yamlcpp ${qtname}::Core ${qtname}::Network) target_link_libraries(calamares LINK_PUBLIC ${kfname}::CoreAddons) +target_compile_definitions(calamares PRIVATE DLLEXPORT_PRO) +target_include_directories(calamares PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(calamares PUBLIC + $ + $ +) +target_include_directories(calamares PUBLIC $) + ### OPTIONAL Automount support (requires dbus) # #