File: 0005-install-example-sources.patch

package info (click to toggle)
sol2 3.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 23,096 kB
  • sloc: cpp: 43,816; ansic: 1,018; python: 356; sh: 288; makefile: 202
file content (30 lines) | stat: -rw-r--r-- 1,205 bytes parent folder | download
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
Description: Install example source files under sol2-dev
Forwarded: not-needed
Author: syzygial <syzygial.123@gmail.com>
Last-Update: 2025-07-16
---
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 0ff8a11..181179b 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -59,9 +59,6 @@ function(sol2_add_example_properties target-name)
 	if (SOL2_TESTS_EXAMPLES)
 		add_test(NAME ${target-name} COMMAND ${target-name})
 	endif()
-	if(SOL2_ENABLE_INSTALL)
-		install(TARGETS ${target-name} RUNTIME DESTINATION bin)
-	endif()
 endfunction()
 
 if (SOL2_DYNAMIC_LOADING_EXAMPLES OR SOL2_DYNAMIC_LOADING_EXAMPLES_SINGLE)
@@ -85,6 +82,10 @@ add_subdirectory(customization)
 
 file(GLOB sol2.examples.sources source/*.cpp source/tutorials/*.cpp source/tutorials/quick_n_dirty/*.cpp source/docs/*.cpp)
 
+if(SOL2_ENABLE_INSTALL)
+	install(FILES ${sol2.examples.sources} DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/sol2-dev/examples")
+endif()
+
 function (MAKE_EXAMPLE example_source_file example_prefix target_sol)
 	get_filename_component(example_name ${example_source_file} NAME_WE)
 	file(RELATIVE_PATH example_source_file_relative ${CMAKE_SOURCE_DIR} ${example_source_file})