gravity/CMakeLists.txt

29 lines
1.0 KiB
CMake
Raw Permalink Normal View History

2023-10-10 21:33:10 +00:00
cmake_minimum_required(VERSION 3.25)
2023-10-22 12:11:36 +00:00
project(gravity C)
2023-10-10 21:33:10 +00:00
set(SOURCE_FILES gravity.c math.c object.c)
set(HEADER_FILES )
2023-10-15 18:38:47 +00:00
add_executable(${PROJECT_NAME} ${HEADER_FILES} ${SOURCE_FILES})
# dependencies
add_custom_target(assets ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory
${PROJECT_SOURCE_DIR}/assets
${PROJECT_BINARY_DIR}/assets
COMMENT "Copying assets to build folder")
2023-10-22 12:11:36 +00:00
add_dependencies(gravity assets)
2023-10-10 21:33:10 +00:00
# We need a CMAKE_DIR with some code to find external dependencies
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
2023-10-14 16:24:51 +00:00
find_package(PkgConfig REQUIRED)
2023-10-10 21:33:10 +00:00
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(GLEW REQUIRED)
find_package(assimp REQUIRED)
2023-10-14 16:24:51 +00:00
find_package(cglm REQUIRED)
2023-10-10 21:33:10 +00:00
2023-10-14 16:24:51 +00:00
include_directories(${PROJECT_NAME} ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${ASSIMP_INCLUDE_DIRS} ${CGLM_INCLUDE_DIRS})
2023-10-22 12:11:36 +00:00
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${GLEW_LIBRARIES} ${ASSIMP_LIBRARIES} ${CGLM_LIBRARIES} m)