# - Environment # To manage the environment # SET(myindent "${myindent}\t") message(STATUS "${myindent}# \"Environment\" included!") if(__Environment_INCLUDED) return() endif() set(__Environment_INCLUDED TRUE) #------------------------------------------------------------------------------- # icedust_env( [...repeat...]) # # Declare environment variables to be modified. # Note: this is just a wrapper around set_property, the actual logic is in # icedust_project() and icedust_generate_env_conf(). #------------------------------------------------------------------------------- function(icedust_env) message(STATUS "${myindent}==>function(icedust_env)") SET(myindent "${myindent}\t") message(STATUS "${myindent} package_dir = ${package_dir}") #message(STATUS "${myindent} icedust_env(): ARGN -> ${ARGN}") # ensure that the variables in the value are not expanded when passing the arguments #string(REPLACE "\$" "\\\$" _argn "${ARGN}") #message(STATUS "${myindent} _argn -> ${_argn}") set_property(DIRECTORY ${package_dir}/cmake APPEND PROPERTY ENVIRONMENT "${ARGN}") string(REGEX REPLACE "(\t*)\t" "\\1" myindent "${myindent}") message(STATUS "${myindent}<==function(icedust_env)") endfunction() #------------------------------------------------------------------------------- # icedust_build_env( [...repeat...]) # # Same as icedust_env(), but the environment is set only for building. #------------------------------------------------------------------------------- function(icedust_build_env) message(STATUS "${myindent}==>function(icedust_build_env)") SET(myindent "${myindent}\t") message(STATUS "${myindent} package_dir = ${package_dir}") #message(STATUS "${myindent} icedust_build_env(): ARGN -> ${ARGN}") # ensure that the variables in the value are not expanded when passing the arguments #string(REPLACE "\$" "\\\$" _argn "${ARGN}") #message(STATUS "${myindent} _argn -> ${_argn}") set_property(DIRECTORY ${package_dir}/cmake APPEND PROPERTY BUILD_ENVIRONMENT "${ARGN}") string(REGEX REPLACE "(\t*)\t" "\\1" myindent "${myindent}") message(STATUS "${myindent}<==function(icedust_build_env)") endfunction() string(REGEX REPLACE "(\t*)\t" "\\1" myindent "${myindent}")