From the shallower to the deeper the first CMakeLists.txt

1. From the shallower to the deeper the first CMakeLists.txt

File tree

root@DYF:/mnt/g/src/C++/C-plus-study/ObjectOriented_chapter9/Constructor_1002# tree
.
├── CMakeLists.txt
├── Person.h
└── main.cpp

Write the simplest CMakeLists.txt

# 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})

carried out:

cmake .
make
./main

reference

Guess you like

Origin blog.csdn.net/weixin_40437821/article/details/113152549