Skip to content

Commit

Permalink
Merge pull request #1640 from willend/main
Browse files Browse the repository at this point in the history
Use install( DIRECTORY ... ) rather than globbing the comp files as pr. email discussion with @farhi
  • Loading branch information
willend authored Jul 11, 2024
2 parents a13a2a0 + 646ed7b commit f6d5b26
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 56 deletions.
47 changes: 20 additions & 27 deletions mcstas-comps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,41 +54,34 @@ 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}")

# 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)
Expand Down
50 changes: 21 additions & 29 deletions mcxtrace-comps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,43 +45,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")
# System c-code
install( DIRECTORY "share/" DESTINATION "${DEST_DATADIR_CODEFILES}")

# 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)
Expand Down

0 comments on commit f6d5b26

Please sign in to comment.