I used this solution to solve the problem of “raylib.h” not being found in practice.
IDE: CLion
- brew install pkg-config
- brew install raylib
- Write the contents of the CMakeLists.txt file.
cmake_minimum_required(VERSION 3.26)
project(untitled)
set(CMAKE_CXX_STANDARD 17)
# Look at
find_package(raylib)
add_executable(${PROJECT_NAME}
axe_game.cpp)
# Look at
target_link_libraries(${PROJECT_NAME} raylib)
if (APPLE)
target_link_libraries(${PROJECT_NAME} "-framework IOKit")
target_link_libraries(${PROJECT_NAME} "-framework Cocoa")
target_link_libraries(${PROJECT_NAME} "-framework OpenGL")
endif()