1. De menos profundo a más profundo, el primer CMakeLists.txt
Árbol de archivos
root@DYF:/mnt/g/src/C++/C-plus-study/ObjectOriented_chapter9/Constructor_1002# tree
.
├── CMakeLists.txt
├── Person.h
└── main.cpp
Escriba el CMakeLists.txt más simple
# specify cmake minimum version
cmake_minimum_required(VERSION 2.6)
# specify source file dir
aux_source_directory(. DIR_SRCS)
# specify header file dir
include_directories(.)
# specify executable file
add_executable(main ${
DIR_SRCS})
llevado a cabo:
cmake .
make
./main