aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/tobias-loew-flags/add-install-configuration.patch
blob: 02e67101374ee04add4590e4f4cedcba9a838887 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 78d96ff..3215aca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,39 @@ endif()
 ##################################################
 add_library(boost_flags INTERFACE)
 #target_include_directories(boost_flags PUBLIC ${Boost_INCLUDE_DIRS}) 
-target_include_directories(boost_flags INTERFACE ${CMAKE_SOURCE_DIR}/include)
+target_include_directories(boost_flags
+                           INTERFACE
+                            $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
+                            $<INSTALL_INTERFACE:include>
+                           )
+set_target_properties(boost_flags PROPERTIES
+  EXPORT_NAME flags
+)
+include(CMakePackageConfigHelpers)
+
+configure_package_config_file(
+  cmake/unofficial-tobias-loew-flags-config.cmake.in
+  "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-tobias-loew-flags-config.cmake"
+  INSTALL_DESTINATION share/unofficial-tobias-loew-flags/
+  NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+
+# Install.
+install(TARGETS boost_flags EXPORT unofficial-tobias-loew-flags)
+
+install(
+  EXPORT unofficial-tobias-loew-flags
+  NAMESPACE unofficial::tobias-loew-flags::
+  FILE unofficial-tobias-loew-flags-targets.cmake
+  DESTINATION share/unofficial-tobias-loew-flags/)
+
+install(DIRECTORY include/boost DESTINATION include)
+
+install(
+  FILES
+  "${CMAKE_CURRENT_BINARY_DIR}/cmake/unofficial-tobias-loew-flags-config.cmake"
+  DESTINATION share/unofficial-tobias-loew-flags)
+
+if(0)
 if (Boost_FOUND)
    target_include_directories(boost_flags INTERFACE ${Boost_INCLUDE_DIRS})
 endif()
@@ -79,4 +111,5 @@ endif()
 # Subdirectories
 ##################################################
 add_subdirectory(test)
+endif()
 # add_subdirectory(example)
diff --git a/cmake/unofficial-tobias-loew-flags-config.cmake.in b/cmake/unofficial-tobias-loew-flags-config.cmake.in
new file mode 100644
index 0000000..9a784e1
--- /dev/null
+++ b/cmake/unofficial-tobias-loew-flags-config.cmake.in
@@ -0,0 +1,5 @@
+
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/unofficial-tobias-loew-flags-targets.cmake")
+