File: 010-install-docs-in-suitable-locations

package info (click to toggle)
toulbar2 1.0.0+dfsg3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 93,116 kB
  • sloc: cpp: 49,041; awk: 936; perl: 585; sh: 348; csh: 200; ansic: 93; xml: 72; makefile: 47
file content (72 lines) | stat: -rw-r--r-- 4,063 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
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
63
64
65
66
67
68
69
70
71
72
Description:  Places documentation  at the right location
Author: Thomas Schiex <Thomas.Schiex@inra.fr>
Last-Update: 2018-08-07
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,8 +9,6 @@
 set (My_cmake_script "${CMAKE_CURRENT_SOURCE_DIR}/cmake-script") # location of cmake script needed 
 set (My_Source src)	# source location 
 set (doc_destination "share/doc")   		#path of doc installation 
-set (My_validation "validation")		#validation test location
-set (My_benchmark "benchmarks")
 set (My_misc_source misc/src/)
 list(APPEND CMAKE_MODULE_PATH "${My_cmake_script}/Modules")
 
@@ -101,12 +99,12 @@
 SET(FOPT "test-opt.cmake" CACHE string "filename containing local options used for validation")
 SET(Default_test_option CACHE STRING "Define toulbar2 option used in command line for testing: cf toulbar2 command line")
 SET(Default_test_timeout 300 CACHE INTEGER "default test timeout")
-SET(Default_validation_dir "validation" CACHE string "default location of benchmark file")
-SET(Default_cover_dir "cover" CACHE string "default location of cover test file ")
+SET(Default_validation_dir "validation" CACHE string "default location of validation files")
+SET(Default_cover_dir "cover" CACHE string "default location of cover test files")
 SET(Default_regexp "end." CACHE string "default regex searched in test output")
 
-SET(Default_BenchDir "benchmarks" CACHE string "default location of benchmark file")
-SET(Default_BenchFormat "wcsp" CACHE string "default format extension for benchmark file search") 
+SET(Default_BenchDir "benchmarks" CACHE string "default location of benchmark files")
+SET(Default_BenchFormat "wcsp" CACHE string "default format extension for benchmark files search")
 SET(Default_bench_timeout 30 CACHE INTEGER "default timeout used for benchmarking ")
 SET(Default_bench_option "TOULBAR2_OPTION" CACHE STRING " option used in command line for benchmarking.")
 SET(Default_bench_regexp "test ok" CACHE string "default regex searched in bench output")
@@ -297,9 +295,9 @@
 
 IF(TOULBAR2)
   add_executable(toulbar2${EXE} ${source_files})
-  ADD_CUSTOM_TARGET(gen_version ALL /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/cmake-script/genVersionFile.sh)
-  SET_SOURCE_FILES_PROPERTIES(ToulbarVersion.hpp PROPERTIES GENERATED 1)
-  ADD_DEPENDENCIES(toulbar2${EXE} gen_version)
+#  ADD_CUSTOM_TARGET(gen_version ALL /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/cmake-script/genVersionFile.sh)
+#  SET_SOURCE_FILES_PROPERTIES(ToulbarVersion.hpp PROPERTIES GENERATED 1)
+#  ADD_DEPENDENCIES(toulbar2${EXE} gen_version)
   IF(MPI)
     TARGET_LINK_LIBRARIES(toulbar2${EXE} ${all_depends} ${MPI_LIBRARIES})
     IF(MPI_COMPILE_FLAGS)
@@ -442,13 +440,25 @@
 ##########################################
 # doc install
 ##########################################
-install(DIRECTORY ${My_doc} DESTINATION ${doc_destination}/${Toulbar_NAME} PATTERN ".svn" EXCLUDE)
+file(GLOB pdf_doc_files "doc/*.pdf*")
+file(GLOB txt_doc_files "doc/*.txt*")
+file(GLOB html_doc_files "doc/*.html*")
+
+install(FILES ${pdf_doc_files} DESTINATION ${doc_destination}/${Toulbar_NAME}-doc)
+install(FILES ${txt_doc_files} DESTINATION ${doc_destination}/${Toulbar_NAME}-doc)
+install(FILES ${html_doc_files} DESTINATION ${doc_destination}/${Toulbar_NAME}-doc)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/toulbar2.1 DESTINATION share/man/man1)
 
 ##########################################
 # examples installation
 ##########################################
-install(DIRECTORY ${My_validation} DESTINATION ${doc_destination}/${Toulbar_NAME}/ PATTERN ".svn" EXCLUDE)
+add_custom_target(create_validation_tar ALL COMMAND
+  ${CMAKE_COMMAND} -E tar "cfvJ" "validation.txz" "${CMAKE_CURRENT_SOURCE_DIR}/${Default_validation_dir}")
+add_custom_target(create_cover_tar ALL COMMAND
+  ${CMAKE_COMMAND} -E tar "cfvJ" "cover.txz" "${CMAKE_CURRENT_SOURCE_DIR}/${Default_cover_dir}")
+
+install(FILES ${PROJECT_BINARY_DIR}/validation.txz ${PROJECT_BINARY_DIR}/cover.txz DESTINATION ${doc_destination}/${Toulbar_NAME}-doc/examples/)
+
 
 ##########################################
 #  PACKAGING