Skip to content

Commit

Permalink
use glfw os package on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
arozx committed Feb 25, 2025
1 parent 56b8999 commit d65e392
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ if (NOT OPENGL_FOUND)
endif()

# WINDOW SPECIFIC
set(GLFW_DIR ${CMAKE_SOURCE_DIR}/external/glfw)
set(GLFW_INCLUDE_DIR ${GLFW_DIR}/include)
set(GLFW_LIBRARY ${GLFW_DIR}/lib-vc2022/glfw3.lib)
if(WIN32)
set(GLFW_DIR ${CMAKE_SOURCE_DIR}/external/glfw)
set(GLFW_INCLUDE_DIR ${GLFW_DIR}/include)
set(GLFW_LIBRARY ${GLFW_DIR}/lib-vc2022/glfw3.lib)

include_directories(${GLFW_INCLUDE_DIR})
link_directories(${GLFW_DIR}/lib-vc2022)
include_directories(${GLFW_INCLUDE_DIR})
link_directories(${GLFW_DIR}/lib-vc2022)
else()
find_package(glfw3 REQUIRED)
if(NOT glfw3_FOUND)
message(FATAL_ERROR "GLFW not found. Please install libglfw3 and libglfw3-dev packages.")
endif()
endif()

# Add GLAD
add_library(glad STATIC
Expand Down Expand Up @@ -129,11 +136,10 @@ if(NOT WIN32)
endif()

target_link_libraries(voxel-engine PUBLIC
${GLFW_LIBRARY}
$<IF:$<BOOL:${WIN32}>,${GLFW_LIBRARY},glfw>
OpenGL::GL
glad
${LUA_LIBRARIES}
${GLFW_DEPENDENCIES}
)

# Create sandbox executable
Expand Down

0 comments on commit d65e392

Please sign in to comment.