I am trying to understand how to compile and link another CMake project into my project without modifying the previous projects CMake configuration. In this case I want to build and compile the library glfw found here https://www.glfw.org/ with my own OpenGL project. How do I do this?
So I have looked into how to build multiple CMake projects from sources like CMake one build directory for multiple projects, and try to link them however everything I read recommends that I alter the CMake file for the project I am trying to build and then link.
Here is an example directory structure that I am using.
.
├── CMakeLists.txt
├── Proj1
│ ├── include
│ ├── lib
│ └── src
│ └── CMakeLists.txt
└── glfw-3.3
├── CMake
├── CMakeLists.txt
├── LICENSE.md
├── README.md
├── cmake_uninstall.cmake.in
├── deps
├── docs
├── examples
├── include
├── src
└── tests
Here Proj1
is where I want to be building my OpenGL application. I have the directory Proj1/lib
for any library files that I do not need to compile before hand. However, I have to compile the glfw library before using it. So should I just compile the glfw library in isolation then bring in the lib files and include files into my own project? Or is there a way to compile the glfw library and then link it in with my own CMake?