Hey guys,
I’ll show an example CMakeLists.txt using the C++ lib fmt so you’ll have an idea what it is I’m trying to do.
cmake_minimum_required(VERSION 3.13)
project(MyProj)
add_subdirectory(lib/fmt)
set(CMAKE_CXX_STANDARD 17)
set(COMMON_LIBRARIES
fmt::fmt)
target_link_libraries(libProj PRIVATE ${COMMON_LIBRARIES})
Basically, fmt defines an alias and adding it to target_link_libraries gives cmake all the information it needs to setup the include directories and the -l flags.
I did a look through the GLFW CMakeLists.txt file and didn’t see any aliases and couldn’t find any examples.
What’s the recommended way of integrating GLFW into an existing cmake project? Ideally I’d like to be able to just git clone … into a lib/ directory under my project root and then add it to cmake and voila.
Any advice/recommendations?