cmake -P install.cmake -DHELLO=“hello”
#install.cmake
echo "result: ${CMAKE_SYSTEM_NAME}"
echo "result: ${HELLO}"
#output
result:
result:
cmake -P install.cmake -DHELLO=“hello”
#install.cmake
echo "result: ${CMAKE_SYSTEM_NAME}"
echo "result: ${HELLO}"
#output
result:
result:
Variable definitions (-D
options) must be specified before the -P
option.
I think variables describing the system are not available in script mode.
what is the command line?
-P <file> = Process script mode.
As specified in the documentation:
Run a Script
cmake [-D <var>=<value>]... -P <cmake-script-file>