mgh@mgh-OptiPlex-5050:~/桌面/cmake_test/test2/build$ cmake ..-- The C compiler identification is GNU 5.4.0-- The CXX compiler identification is GNU 5.4.0-- Check for working C compiler: /usr/bin/cc-- Check for working C compiler: /usr/bin/cc -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Detecting C compile features-- Detecting C compile features - done-- Check for working CXX compiler: /usr/bin/c++-- Check for working CXX compiler: /usr/bin/c++ -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done-- Detecting CXX compile features-- Detecting CXX compile features - done-- Configuring done-- Generating done-- Build files have been written to: /home/mgh/桌面/cmake_test/test2/buildmgh@mgh-OptiPlex-5050:~/桌面/cmake_test/test2/build$ makeScanning dependencies of target hello[ 50%] Building C object CMakeFiles/hello.dir/test1.c.o[100%] Linking C executable hello[100%] Built target hellomgh@mgh-OptiPlex-5050:~/桌面/cmake_test/test2/build$ ./helloHello World.
mgh@mgh-OptiPlex-5050:~/桌面/cmake_test/test/build$ cmake ..-- The C compiler identification is GNU 5.4.0-- The CXX compiler identification is GNU 5.4.0-- Check for working C compiler: /usr/bin/cc-- Check for working C compiler: /usr/bin/cc -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Detecting C compile features-- Detecting C compile features - done-- Check for working CXX compiler: /usr/bin/c++-- Check for working CXX compiler: /usr/bin/c++ -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done-- Detecting CXX compile features-- Detecting CXX compile features - done-- Configuring done-- Generating done-- Build files have been written to: /home/mgh/桌面/cmake_test/test/buildmgh@mgh-OptiPlex-5050:~/桌面/cmake_test/test/build$ makeScanning dependencies of target printFunc[ 25%] Building C object print/CMakeFiles/printFunc.dir/print.c.o[ 50%] Linking C static library libprintFunc.a[ 50%] Built target printFuncScanning dependencies of target hello[ 75%] Building C object CMakeFiles/hello.dir/test.c.o[100%] Linking C executable hello[100%] Built target hellomgh@mgh-OptiPlex-5050:~/桌面/cmake_test/test/build$ ./helloHello World.