Hi,

I resumed working on setting up the header install policy discussed a few 
weeks ago since some of the changes are going to be simpler to do before the 
split.

First task is: use ${CMAKE_INSTALL_PREFIX}/include/KF5 as the base header 
install dir instead of ${CMAKE_INSTALL_PREFIX}/include. My first approach was 
to patch ecm so that INCLUDE_INSTALL_DIR was set to 
${CMAKE_INSTALL_PREFIX}/include/KF5 instead of ${CMAKE_INSTALL_PREFIX}/include 
. Filed a RR doing just that ( http://git.reviewboard.kde.org/r/114336/ ), but 
it was pointed out to me that this would impact everything using ecm, not only 
frameworks. Therefore I think the correct fix is to change 
${INCLUDE_INSTALL_DIR} in frameworks themselves.

I experimented with that and it boils down to doing something like attached 
patch, for all frameworks. I don't mind doing the work, but I want to be sure 
this is what we want before I start. Opinions?

Aurélien
diff --git a/template/CMakeLists.txt b/template/CMakeLists.txt
index 6da9d52..4189c35 100644
--- a/template/CMakeLists.txt
+++ b/template/CMakeLists.txt
@@ -21,6 +21,7 @@ ecm_setup_version(
   VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/foobar_version.h"
   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/FooBarConfigVersion.cmake"
 )
+set(INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}/KF5)
 
 # Dependencies
 set(REQUIRED_QT_VERSION "5.2.0")
diff --git a/template/src/CMakeLists.txt b/template/src/CMakeLists.txt
index ec1127a..93d32b3 100644
--- a/template/src/CMakeLists.txt
+++ b/template/src/CMakeLists.txt
@@ -14,6 +14,12 @@ target_link_libraries(FooBar
   #  Other private libs
 )
 
+if(IS_ABSOLUTE "${INCLUDE_INSTALL_DIR}")
+  target_include_directories(FooBar INTERFACE "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}>")
+else()
+  target_include_directories(FooBar INTERFACE "$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}>")
+endif()
+
 set_target_properties(FooBar
   PROPERTIES VERSION ${FOOBAR_VERSION_STRING}
   SOVERSION ${FOOBAR_SOVERSION}
_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel

Reply via email to