/usr/share/modules/init/cmake is in environment-modules 4.1.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | # define modules runtine quarantine configuration
#set(ENV{MODULES_RUN_QUARANTINE} "ENVVARNAME")
# setup quarantine if defined
set(_mlre "")
if(DEFINED ENV{MODULES_RUN_QUARANTINE})
string(REPLACE " " ";" _mlv_list "$ENV{MODULES_RUN_QUARANTINE}")
foreach(_mlv ${_mlv_list})
if(${_mlv} MATCHES "^[A-Za-z_][A-Za-z0-9_]*$")
if(DEFINED ENV{${_mlv}})
set(_mlre "${_mlre}${_mlv}_modquar=$ENV{${_mlv}};")
endif()
set(_mlrv "MODULES_RUNENV_${_mlv}")
set(_mlre "${_mlre}${_mlv}=$ENV{${_mlrv}};")
endif()
endforeach()
if (NOT "${_mlre}" STREQUAL "")
set(_mlre "env;${_mlre}")
endif()
endif()
# define module command and surrounding initial environment (default value
# for MODULESHOME, MODULEPATH, LOADEDMODULES and parse of init/.modulespath)
execute_process(COMMAND mktemp -t moduleinit.cmake.XXXXXXXXXXXX
OUTPUT_VARIABLE tempfile_name
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${_mlre} /usr/bin/tclsh /usr/lib/x86_64-linux-gnu/modulecmd.tcl cmake autoinit
OUTPUT_FILE ${tempfile_name})
if(EXISTS ${tempfile_name})
include(${tempfile_name})
file(REMOVE ${tempfile_name})
endif()
# redefine module command if compat version has been activated
if("$ENV{MODULES_USE_COMPAT_VERSION}" STREQUAL "1")
set(ENV{MODULES_CMD} "/usr/lib/x86_64-linux-gnu/modulecmd-compat")
function(module)
execute_process(COMMAND mktemp -t moduleinit.cmake.XXXXXXXXXXXX
OUTPUT_VARIABLE tempfile_name
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND /usr/lib/x86_64-linux-gnu/modulecmd-compat cmake ${ARGV}
OUTPUT_FILE ${tempfile_name})
if(EXISTS ${tempfile_name})
include(${tempfile_name})
file(REMOVE ${tempfile_name})
endif()
# return value as done on new main version
set(module_result TRUE PARENT_SCOPE)
endfunction(module)
endif()
|