# Linking libraries installed with homebrew

**URL:** https://discourse.cmake.org/t/linking-libraries-installed-with-homebrew/10930
**Category:** Development
**Tags:** gen:makefiles
**Created:** [June 2, 2024, 7:13am UTC](https://discourse.cmake.org/t/linking-libraries-installed-with-homebrew/10930 "2024-06-02T07:13:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jhshssuh](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/j/e274bd/32.png) [@jhshssuh](https://discourse.cmake.org/u/jhshssuh)
#### Post date: [June 2, 2024, 7:13am UTC](https://discourse.cmake.org/t/linking-libraries-installed-with-homebrew/10930/1 "2024-06-02T07:13:19Z")

</div>

cmake\_minimum\_required(VERSION 3.5)

set(CXX\_STANDARD 20)  
set(CXX\_STANDARD\_REQUIRED true)

project(3dmod VERSION 1.0.0  
DESCRIPTION “First OpenGL”  
LANGUAGES CXX)

CMAKE\_PREFIX\_PATH(/usr/local/opt)

find\_package(glfw3 CONFIG REQUIRED)  
find\_package(glm CONFIG REQUIRED)  
find\_package(glad CONFIG REQUIRED)  
find\_package(assimp CONFIG REQUIRED)  
find\_package(imgui CONFIG REQUIRED)  
find\_package(freetype CONFIG REQUIRED)

add\_executable(${PROJECT\_NAME} main.cpp glad.c)

#target\_link\_libraries(${PROJECT\_NAME} PUBLIC glfw3::glfw3)  
#target\_link\_libraries(${PROJECT\_NAME} PUBLIC glm::glm)  
#target\_link\_libraries(${PROJECT\_NAME} PUBLIC glad::glad)  
#target\_link\_libraries(${PROJECT\_NAME} PUBLIC assimp::assimp)  
#target\_link\_libraries(${PROJECT\_NAME} PUBLIC imgui::imgui)  
#target\_link\_libraries(${PROJECT\_NAME} PUBLIC freetype::freetype)

include\_directories(/usr/local/include)  
link\_directories(/usr/local/lib)

How do I make this .txt file btetter. Im working with OpenGL on mac

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 10, 2024, 1:52pm UTC](https://discourse.cmake.org/t/linking-libraries-installed-with-homebrew/10930/2 "2024-06-10T13:52:07Z")

</div>

It’s not clear what your question is. Is something not working. It looks like the `target_link_libraries` calls should be uncommented and the last two lines removed to me.
