How can I do it in a good practice. This is the repo structure:
~/workspace$ tree -L 3
.
├── my_program
│ ├── src
│ │ ├── module1
│ │ ├── module2
│ │ ├── CMakeLists.txt
│ │ └── ...
├── needed_library
│ ├── src
│ │ ├── module3
│ │ ├── module4
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── ...
For needed_library
, I learned from the README that I can build it manually by:
mkdir build
cd build
cmake ../src
make
make install
And needed library and headers will be installed.
How can I integrate this process into my own program's CMakelists.txt? And link the desired library and header to my program?