I’m working on a C++ project where I need to link against the GLFW library, specifically using the static library.
im using
find_package(glfw3 REQUIRED)
to find the library and
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE glfw)
to link my project with it.
these are the libraries present in my glfw/lib
folder:
.
├── libglfw.3.4.dylib
├── libglfw.3.dylib -> libglfw.3.4.dylib
├── libglfw.dylib -> libglfw.3.dylib
└── libglfw3.a
How can I instruct CMake to prioritize linking against the .a
static library instead of the .dylib
dynamic library?”
I know I can just hardcode the path to the library but it doesn’t sound really portable.
2