| Server IP : 112.74.42.100 / Your IP : 216.73.216.142 Web Server : nginx/1.20.2 System : Linux iZwz96lx4pjqiy84w4hni7Z 5.10.134-17.3.al8.x86_64 #1 SMP Thu Oct 31 14:29:57 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/cmake/Modules/ |
Upload File : |
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
CPackIFWConfigureFile
---------------------
.. versionadded:: 3.8
The module defines :command:`configure_file` similar command to
configure file templates prepared in QtIFW/SDK/Creator style.
Commands
^^^^^^^^
The module defines the following commands:
.. command:: cpack_ifw_configure_file
Copy a file to another location and modify its contents.
::
cpack_ifw_configure_file(<input> <output>)
Copies an ``<input>`` file to an ``<output>`` file and substitutes variable
values referenced as ``%{VAR}`` or ``%VAR%`` in the input file content.
Each variable reference will be replaced with the current value of the
variable, or the empty string if the variable is not defined.
#]=======================================================================]
# NOTE: This file used to himself packaging via CPack IFW generator and
# should be compatible with minimal CMake version defined in
# ../CMakeLists.txt file.
if(NOT DEFINED CPackIFWConfigureFile_CMake_INCLUDED)
set(CPackIFWConfigureFile_CMake_INCLUDED 1)
macro(cpack_ifw_configure_file INPUT OUTPUT)
file(READ "${INPUT}" _tmp)
foreach(_tmp_regex "%{([^%}]+)}" "%([^%]+)%")
string(REGEX MATCHALL "${_tmp_regex}" _tmp_vars "${_tmp}")
while(_tmp_vars)
foreach(_tmp_var ${_tmp_vars})
string(REGEX REPLACE "${_tmp_regex}" "\\1"
_tmp_var_name "${_tmp_var}")
if(DEFINED ${_tmp_var_name})
set(_tmp_var_value "${${_tmp_var_name}}")
elseif(NOT "$ENV{${_tmp_var_name}}" STREQUAL "")
set(_tmp_var_value "$ENV{${_tmp_var_name}}")
else()
set(_tmp_var_value "")
endif()
string(REPLACE "${_tmp_var}" "${_tmp_var_value}" _tmp "${_tmp}")
endforeach()
string(REGEX MATCHALL "${_tmp_regex}" _tmp_vars "${_tmp}")
endwhile()
endforeach()
if(IS_ABSOLUTE "${OUTPUT}")
file(WRITE "${OUTPUT}" "${_tmp}")
else()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}" "${_tmp}")
endif()
endmacro()
endif() # NOT DEFINED CPackIFWConfigureFile_CMake_INCLUDED