Browse Source

Teach cmake config to find kpmcore include dir.

tags/v2.0.0
Andrius Štikonas 3 years ago
parent
commit
0bde7012cd
2 changed files with 3 additions and 0 deletions
  1. 2
    0
      CMakeLists.txt
  2. 1
    0
      KPMcoreConfig.cmake.in

+ 2
- 0
CMakeLists.txt View File

@@ -82,11 +82,13 @@ include_directories(${Qt5Core_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS} ${BLKID_INCLUDE
82 82
 add_subdirectory(src)
83 83
 
84 84
 # create a Config.cmake and a ConfigVersion.cmake file and install them
85
+set(INCLUDE_INSTALL_DIR "include/kpmcore/")
85 86
 set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KPMcore")
86 87
 
87 88
 ecm_configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/KPMcoreConfig.cmake.in"
88 89
                               "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake"
89 90
                               INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
91
+                              PATH_VARS INCLUDE_INSTALL_DIR
90 92
                               )
91 93
 
92 94
 install(FILES  "${CMAKE_CURRENT_BINARY_DIR}/KPMcoreConfig.cmake"

+ 1
- 0
KPMcoreConfig.cmake.in View File

@@ -1,3 +1,4 @@
1 1
 @PACKAGE_INIT@
2 2
 
3
+set_and_check(KPMCORE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
3 4
 include("${CMAKE_CURRENT_LIST_DIR}/KPMcoreTargets.cmake")

Loading…
Cancel
Save