comparison CMakeLists.txt @ 47:f60144ebce23

Fix build for mac
author Dennis C. M. <dennis@denniscm.com>
date Sun, 03 Mar 2024 16:05:07 +0000
parents dae463bbf5ca
children
comparison
equal deleted inserted replaced
46:701dc4e9f2f6 47:f60144ebce23
1 cmake_minimum_required(VERSION 3.22) 1 cmake_minimum_required(VERSION 3.22)
2 project(algo_animator) 2 project(algo_animator)
3 3
4 set(FREETYPE_DIR /usr/local/include/freetype2) 4 # Set the path to the FreeType library
5 set(FREETYPE_DIR /usr/local/Cellar/freetype/2.13.2)
5 6
6 include_directories(${FREETYPE_DIR}) 7 # Find OpenGL package
8 find_package(OpenGL REQUIRED)
7 9
10 # Include directories for headers
11 include_directories(${FREETYPE_DIR}/include/freetype2)
12
13 # Link directories for libraries
14 link_directories(${FREETYPE_DIR}/lib)
15
16 # Add your source files
8 add_executable(algo_animator 17 add_executable(algo_animator
9 src/main.c 18 src/main.c
10 src/algorithms.c 19 src/algorithms.c
11 src/algorithms.h 20 src/algorithms.h
12 src/utils.c 21 src/utils.c
13 src/utils.h 22 src/utils.h
14 ) 23 )
15 24
25 # Link libraries
16 target_link_libraries(algo_animator 26 target_link_libraries(algo_animator
17 glut 27 ${OPENGL_LIBRARIES}
18 GL 28 "-framework OpenGL"
19 GLU 29 "-framework GLUT"
20 m 30 "-framework Cocoa"
21 freetype 31 freetype
22 ) 32 )
23 33
24 file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/fonts DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/build) 34 # Copy the 'fonts' directory to the build directory
35 file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/fonts DESTINATION out/)