Skip to content
Snippets Groups Projects
Commit 260a5fce authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Modified CMake code to be 3.10 compliant, because Ubuntu 18 ships 3.10 by default (apt)

parent d27a2f40
No related branches found
No related tags found
1 merge request!2CI: set Ubuntu and macOS pipelines for the new monorepo
......@@ -66,11 +66,27 @@ if(GEOMODEL_BUILD_GEOMODELG4 OR GEOMODEL_BUILD_EXAMPLES_W_GEANT4)
endif()
# A function to get a string with comma-separated package names from a list of packages
# NOTE: We could make use of list(JOIN ...) on CMake >= 3.12,
# but Ubuntu 18 pat package installs 3.10 instead
function(getCSVStringFromList inputList outputString)
message("input: ${inputList}")
set(tempList "")
foreach( item ${inputList})
list(APPEND tempList ${item})
endforeach()
string (REPLACE ";" ", " outStr "${tempList}")
message("string: ${outStr}")
set( ${outputString} ${outStr} PARENT_SCOPE)
endfunction()
# Let the users know which and how many packages they are building
list(LENGTH BUILT_PACKAGES BUILT_PACKAGES_LENGTH)
list(JOIN BUILT_PACKAGES ", " BUILT_PACKAGES_STR)
#
# list(JOIN BUILT_PACKAGES ", " BUILT_PACKAGES_STR) # list(JOIN) needs /CMake 3.12, which is missing on Ubuntu 18 by default
getCSVStringFromList( "${BUILT_PACKAGES}" BUILT_PACKAGES_STR )
#
message(STATUS "${BoldWhite}-----${ColourReset}")
message( STATUS "${BoldGreen}Building the following ${BUILT_PACKAGES_LENGTH} packages: ${BUILT_PACKAGES_STR}${ColourReset}")
message(STATUS "${BoldWhite}-----${ColourReset}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment