From 22699d96d476f0e73f836292e63f6a646539619b Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 11 Jul 2024 14:16:01 +0200 Subject: [PATCH 1/4] Attempt simpler Install folder configuration without globbing --- mcstas-comps/CMakeLists.txt | 50 +++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/mcstas-comps/CMakeLists.txt b/mcstas-comps/CMakeLists.txt index 85a1e60ee..872bfc8ec 100644 --- a/mcstas-comps/CMakeLists.txt +++ b/mcstas-comps/CMakeLists.txt @@ -54,41 +54,37 @@ if ( ENABLE_NEUTRONICS ) #installing other files related to "neutronics". endif() - -file_globsrc( tmp "share/*" ) -install( FILES ${tmp} DESTINATION "${DEST_DATADIR_CODEFILES}" ) - -set( tmp_complist "misc" "monitors" "obsolete" "optics" "samples" "sources" "union" "sasmodels" ) -if ( NOT EXCLUDE_CONTRIB ) - list( APPEND tmp_complist "contrib" ) -endif() -foreach(name ${tmp_complist}) - file_globsrc( tmp "${name}/*" ) - install( FILES ${tmp} DESTINATION "${DEST_DATADIR_COMPS}/${name}" ) -endforeach() - +# System c-code +install( DIRECTORY "share/" DESTINATION "${DEST_DATADIR_CODEFILES}") + +# docs +install( DIRECTORY "doc/" DESTINATION "${DEST_DATADIR_COMPS}/doc") + +# Editor syntax-highlighting etc +install( DIRECTORY "editors/" DESTINATION "${DEST_DATADIR_EDITORS}" ) + +# System comps +install( DIRECTORY "misc/" DESTINATION "${DEST_DATADIR_COMPS}/misc") +install( DIRECTORY "monitors/" DESTINATION "${DEST_DATADIR_COMPS}/monitors") +install( DIRECTORY "obsolete/" DESTINATION "${DEST_DATADIR_COMPS}/obsolete") +install( DIRECTORY "optics/" DESTINATION "${DEST_DATADIR_COMPS}/optics") +install( DIRECTORY "samples/" DESTINATION "${DEST_DATADIR_COMPS}/samples") +install( DIRECTORY "sources/" DESTINATION "${DEST_DATADIR_COMPS}/sources") +install( DIRECTORY "union/" DESTINATION "${DEST_DATADIR_COMPS}/union") +install( DIRECTORY "sasmodels/" DESTINATION "${DEST_DATADIR_COMPS}/sasmodels") + +# Contrib comps if ( NOT EXCLUDE_CONTRIB ) - foreach(contrib_subdir doc) - file_globsrc( tmp "contrib/${contrib_subdir}/*" ) - install( FILES ${tmp} DESTINATION "${DEST_DATADIR_COMPS}/contrib/${contrib_subdir}" ) - endforeach() + install( DIRECTORY "contrib/" DESTINATION "${DEST_DATADIR_COMPS}/contrib") endif() +# Data files if ( NOT EXCLUDE_DATA ) - # base data dir - file_globsrc( tmp "data/*" ) - install( FILES ${tmp} DESTINATION "${DEST_DATADIR_DATAFILES}" ) - # datadir subfolders - foreach(data_subdir Gas_tables ISIS_tables) - file_globsrc( tmp "data/${data_subdir}/*" ) - install( FILES ${tmp} DESTINATION "${DEST_DATADIR_COMPS}/data/${data_subdir}" ) - endforeach() + install( DIRECTORY "data/" DESTINATION "${DEST_DATADIR_COMPS}/data") endif() install( DIRECTORY "examples/" DESTINATION "${DEST_DATADIR_EXAMPLES}") -file_globsrc( tmp "editors/*" ) -install( FILES ${tmp} DESTINATION "${DEST_DATADIR_EDITORS}" ) # Include mcstas-comp revision tag file configure_file("${CMAKE_CURRENT_SOURCE_DIR}/revision.in" "${WORK}/revision" @ONLY) From b506e64ef4dc89bee026e7f49a4cfa8d000953c8 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 11 Jul 2024 14:18:32 +0200 Subject: [PATCH 2/4] Idem last commit but for McXtrace --- mcxtrace-comps/CMakeLists.txt | 49 +++++++++++++++-------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/mcxtrace-comps/CMakeLists.txt b/mcxtrace-comps/CMakeLists.txt index 1af662769..cbdb0c6da 100644 --- a/mcxtrace-comps/CMakeLists.txt +++ b/mcxtrace-comps/CMakeLists.txt @@ -46,42 +46,35 @@ if ( ENABLE_CIF2HKL ) endif() - -file_globsrc( tmp "share/*" ) -install( FILES ${tmp} DESTINATION "${DEST_DATADIR_CODEFILES}" ) - -set( tmp_complist "misc" "monitors" "obsolete" "optics" "samples" "sources" "union" "sasmodels" "astrox") +# docs +install( DIRECTORY "doc/" DESTINATION "${DEST_DATADIR_COMPS}/doc") + +# Editor syntax-highlighting etc +install( DIRECTORY "editors/" DESTINATION "${DEST_DATADIR_EDITORS}" ) + +# System comps +install( DIRECTORY "misc/" DESTINATION "${DEST_DATADIR_COMPS}/misc") +install( DIRECTORY "monitors/" DESTINATION "${DEST_DATADIR_COMPS}/monitors") +install( DIRECTORY "obsolete/" DESTINATION "${DEST_DATADIR_COMPS}/obsolete") +install( DIRECTORY "optics/" DESTINATION "${DEST_DATADIR_COMPS}/optics") +install( DIRECTORY "samples/" DESTINATION "${DEST_DATADIR_COMPS}/samples") +install( DIRECTORY "sources/" DESTINATION "${DEST_DATADIR_COMPS}/sources") +install( DIRECTORY "union/" DESTINATION "${DEST_DATADIR_COMPS}/union") +install( DIRECTORY "sasmodels/" DESTINATION "${DEST_DATADIR_COMPS}/sasmodels") +install( DIRECTORY "astrox/" DESTINATION "${DEST_DATADIR_COMPS}/astrox") + +# Contrib comps if ( NOT EXCLUDE_CONTRIB ) - list( APPEND tmp_complist "contrib" ) + install( DIRECTORY "contrib/" DESTINATION "${DEST_DATADIR_COMPS}/contrib") endif() -foreach(name ${tmp_complist}) - file_globsrc( tmp "${name}/*" ) - install( FILES ${tmp} DESTINATION "${DEST_DATADIR_COMPS}/${name}" ) -endforeach() - -# contrib subfolders / examplified from McStas -#if ( NOT EXCLUDE_CONTRIB ) -# foreach(contrib_subdir doc) -# file_globsrc( tmp "contrib/${contrib_subdir}/*" ) -# install( FILES ${tmp} DESTINATION "${DEST_DATADIR_COMPS}/contrib/${contrib_subdir}" ) -# endforeach() -#endif() +# Data files if ( NOT EXCLUDE_DATA ) - # base data dir - file_globsrc( tmp "data/*" ) - install( FILES ${tmp} DESTINATION "${DEST_DATADIR_DATAFILES}" ) - # datadir subfolders / examplified from McStas - # foreach(data_subdir Gas_tables ISIS_tables) - # file_globsrc( tmp "data/${data_subdir}/*" ) - # install( FILES ${tmp} DESTINATION "${DEST_DATADIR_COMPS}/data/${data_subdir}" ) - # endforeach() + install( DIRECTORY "data/" DESTINATION "${DEST_DATADIR_COMPS}/data") endif() install( DIRECTORY "examples/" DESTINATION "${DEST_DATADIR_EXAMPLES}") -file_globsrc( tmp "editors/*" ) -install( FILES ${tmp} DESTINATION "${DEST_DATADIR_EDITORS}" ) # Include mcstas-comp revision tag file configure_file("${CMAKE_CURRENT_SOURCE_DIR}/revision.in" "${WORK}/revision" @ONLY) From 7b9c71233cf4c7c285ad9cee2c5d8182f036c686 Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 11 Jul 2024 14:22:23 +0200 Subject: [PATCH 3/4] No doc folder... --- mcstas-comps/CMakeLists.txt | 3 --- mcxtrace-comps/CMakeLists.txt | 4 ---- 2 files changed, 7 deletions(-) diff --git a/mcstas-comps/CMakeLists.txt b/mcstas-comps/CMakeLists.txt index 872bfc8ec..6e26d009e 100644 --- a/mcstas-comps/CMakeLists.txt +++ b/mcstas-comps/CMakeLists.txt @@ -57,9 +57,6 @@ endif() # System c-code install( DIRECTORY "share/" DESTINATION "${DEST_DATADIR_CODEFILES}") -# docs -install( DIRECTORY "doc/" DESTINATION "${DEST_DATADIR_COMPS}/doc") - # Editor syntax-highlighting etc install( DIRECTORY "editors/" DESTINATION "${DEST_DATADIR_EDITORS}" ) diff --git a/mcxtrace-comps/CMakeLists.txt b/mcxtrace-comps/CMakeLists.txt index cbdb0c6da..ea8905a1f 100644 --- a/mcxtrace-comps/CMakeLists.txt +++ b/mcxtrace-comps/CMakeLists.txt @@ -45,10 +45,6 @@ if ( ENABLE_CIF2HKL ) ) endif() - -# docs -install( DIRECTORY "doc/" DESTINATION "${DEST_DATADIR_COMPS}/doc") - # Editor syntax-highlighting etc install( DIRECTORY "editors/" DESTINATION "${DEST_DATADIR_EDITORS}" ) From efa1737f2c437ace7d74a0592c84e1cebeb6878b Mon Sep 17 00:00:00 2001 From: Peter Willendrup Date: Thu, 11 Jul 2024 14:28:53 +0200 Subject: [PATCH 4/4] share was missing on McXtrace side --- mcxtrace-comps/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mcxtrace-comps/CMakeLists.txt b/mcxtrace-comps/CMakeLists.txt index ea8905a1f..134ae3421 100644 --- a/mcxtrace-comps/CMakeLists.txt +++ b/mcxtrace-comps/CMakeLists.txt @@ -45,6 +45,9 @@ if ( ENABLE_CIF2HKL ) ) endif() +# System c-code +install( DIRECTORY "share/" DESTINATION "${DEST_DATADIR_CODEFILES}") + # Editor syntax-highlighting etc install( DIRECTORY "editors/" DESTINATION "${DEST_DATADIR_EDITORS}" )