Hello,

I am trying to understand how to build a subdirectory project that has its
own CMakeLists.txt file already setup. In this case, I am using the open
source library GLFW to help me with some of my OpenGL applications. Here is
a sample directory structure I am working with.

Root
├── CMakeLists.txt
├── MainProject
├── build
└── glfw-3.3

The folder MainProject is where I will be doing all my own development and
has a src, include, and lib folder associated with it. The glfw-3.3
directory was downloaded from online and has its own CMakeLists.txt file as
mentioned previously. So if I were to build my project from the current
build directory shown here, how should I add the glfw library to it and
also change its target outputs?

Answers online suggest using ExternalProject_Add(), while others say to
simply add_subdirectory() and then change some of the properties. I want to
be able to have a user run the root CMake file and have the targets be
correctly placed (since users might be on different operating systems).
Either way I have not been able to find an explicit example, perhaps my
Googling skills for CMake are lacking, and any help on this would be
appreciated. Thank you for your time.

Best,
mlg
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to