(base) wyr@Beyond-PC:~/cpp_study/cmake_study/2-第2章CMake常用功能/23cmake set变量入门和示例/104test_ver$ cmake -S. -B build
-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - doneVAR1=测试变量VAR1的值
VAR1 in string 测试变量VAR1的值
${VAR1}=测试变量VAR1的值
VAR2=VAR1
VAR2=测试变量VAR1的值
${VAR1}=
-- Configuring done
-- Generating done
-- Build files have been written to: /home/wyr/cpp_study/cmake_study/2-第2章CMake常用功能/23cmake set变量入门和示例/104test_ver/build
(base) wyr@Beyond-PC:~/cpp_study/cmake_study/2-第2章CMake常用功能/23cmake set变量入门和示例/104test_ver$