File tree Expand file tree Collapse file tree 2 files changed +34
-6
lines changed
Expand file tree Collapse file tree 2 files changed +34
-6
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,8 @@ set(CPACK_PACKAGE_VENDOR "The University of California Marching Band Computer Co
5757set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "CalChart, the tool to chart shows for the Cal Band." )
5858set (CPACK_ARCHIVE_COMPONENT_INSTALL ON )
5959set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR} /LICENSE" )
60+ ## Ensure all packaging components are available to CPack on all platforms
61+ ## so that docs and resources are included in created packages (e.g. macOS DragNDrop DMG).
6062if (MSVC )
6163 set (CPACK_COMPONENTS_ALL applications Docs Resources)
6264else ()
Original file line number Diff line number Diff line change 33# CalChart docs
44file (
55 GLOB CalChartDocs
6- "${PROJECT_SOURCE_DIR} /docs/source/ *"
6+ "${PROJECT_SOURCE_DIR} /docs/*"
77)
88
9+ # Split CalChartDocs into plain files and directories so we can install them
10+ # appropriately (install FILES cannot be given directories).
11+ set (CalChartDocFiles)
12+ set (CalChartDocDirs)
13+ foreach (_doc ${CalChartDocs} )
14+ if (IS_DIRECTORY ${_doc} )
15+ list (APPEND CalChartDocDirs ${_doc} )
16+ else ()
17+ list (APPEND CalChartDocFiles ${_doc} )
18+ endif ()
19+ endforeach ()
20+
921file (
1022 GLOB CalChartResources
1123 "${PROJECT_SOURCE_DIR} /resources/common/*"
@@ -209,11 +221,25 @@ endif ()
209221
210222# we add some targets for docs and images so we can pack them for windows
211223# see http://yanivresearch.info/software/CPackWindowsTutorial/CPackForWindows.html
212- install (
213- FILES ${CalChartDocs}
214- DESTINATION docs
215- COMPONENT Docs
216- )
224+ ## Install top-level doc files and the docs/source directory (if present)
225+ if (CalChartDocFiles)
226+ install (
227+ FILES
228+ ${CalChartDocFiles}
229+ DESTINATION docs
230+ COMPONENT Docs
231+ )
232+ endif ()
233+
234+ # Install any subdirectories found under docs/ (e.g. docs/source)
235+ foreach (_docdir ${CalChartDocDirs} )
236+ get_filename_component (_basename ${_docdir} NAME )
237+ install (
238+ DIRECTORY "${_docdir} /"
239+ DESTINATION docs/${_basename}
240+ COMPONENT Docs
241+ )
242+ endforeach ()
217243
218244install (
219245 FILES ${CalChartResources}
You can’t perform that action at this time.
0 commit comments