File tree Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change @@ -118,24 +118,11 @@ target_include_directories(mlx42 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
118
118
# Dependencies
119
119
# -----------------------------------------------------------------------------
120
120
121
- # TODO: Check if GLFW is installed, if not clone, build and install it.
122
- # Run post build to install the glfw lib on the system.
123
-
124
- # What we really want is for this to be so automated that even the laziest
125
- # person can just clone the repo, run the build script and it will just work.
126
-
127
- # Ideally we want to pass in an option to build it in such a way that sysadmins
128
- # can just install it on their system instead of having the user install it.
129
- # E.g: For 42 Clusters and such.
130
-
131
- # You can uncomment this line to download and build glfw for you.
132
- # However the linking to the lib might be a bit akward but you can just move
133
- # the static lib out of deps directory. Keep in mind that you need comment out the
134
- # find_package function below.
135
-
136
- # include(${CMAKE_DIR}/LinkGLFW.cmake)
137
- # LinkGLFW(mlx42)
138
-
139
- find_package (glfw3 REQUIRED )
121
+ find_package (glfw3 )
122
+ if (NOT glfw3_FOUND )
123
+ message ("-- Please wait, fetching GLFW ..." )
124
+ include (${CMAKE_DIR} /LinkGLFW.cmake )
125
+ LinkGLFW (mlx42 )
126
+ endif ()
140
127
find_package (OpenGL REQUIRED )
141
128
target_link_libraries (mlx42 OpenGL::GL glfw )
Original file line number Diff line number Diff line change @@ -180,8 +180,9 @@ Of course its up to you to make sure that the code you write is portable. Things
180
180
181
181
``` bash
182
182
➜ ~ git clone https://github.com/codam-coding-college/MLX42.git
183
+ ➜ ~ cd MLX42
183
184
➜ ~ cmake -B build
184
- ➜ ~ cmake --build build
185
+ ➜ ~ cmake --build build -j4
185
186
```
186
187
187
188
The output library file is called ` libmlx42.a ` .
You can’t perform that action at this time.
0 commit comments