calamity-cobra-2/CMakeLists.txt

60 lines
2.1 KiB
CMake
Raw Normal View History

2023-08-11 05:51:06 +00:00
cmake_minimum_required(VERSION 3.10)
project(cc2 C)
set_target_properties(PROPERTIES LINKER_LANGUAGE C)
include_directories(include)
include_directories(${PROJECT_SOURCE_DIR}/src)
file(GLOB src
"${PROJECT_SOURCE_DIR}/src/*.c"
"${PROJECT_SOURCE_DIR}/src/engine/*.c"
"${PROJECT_SOURCE_DIR}/src/game/*.c"
"${PROJECT_SOURCE_DIR}/src/game/ecs/*.c"
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/*.c"
2023-08-16 13:19:53 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/action/*.c"
2023-08-17 22:04:29 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/animation/*.c"
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/behavior/*.c"
2023-08-16 13:19:53 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/control/*.c"
2023-08-17 22:04:29 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/entity/*.c"
2023-08-18 06:13:13 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/hud/*.c"
2023-08-16 13:19:53 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/component/stat/*.c"
2023-08-14 07:58:13 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/entity/*.c"
2023-08-15 22:04:43 +00:00
"${PROJECT_SOURCE_DIR}/src/game/ecs/entity/play/*.c"
"${PROJECT_SOURCE_DIR}/src/game/ecs/entity/play/enemy*.c"
"${PROJECT_SOURCE_DIR}/src/game/input/*.c"
2023-08-14 07:58:13 +00:00
"${PROJECT_SOURCE_DIR}/src/game/render/*.c"
2023-08-15 22:04:43 +00:00
"${PROJECT_SOURCE_DIR}/src/game/resource/*.c"
2023-08-14 07:58:13 +00:00
"${PROJECT_SOURCE_DIR}/src/game/state/*.c"
"${PROJECT_SOURCE_DIR}/src/game/state/play/*.c"
2023-08-11 05:51:06 +00:00
)
add_executable(cc2 ${src})
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)
2023-08-11 05:51:06 +00:00
find_package(GLEW REQUIRED)
2023-08-25 14:21:59 +00:00
set (CMAKE_C_FLAGS "-O2 -Wno-unused-variable -Wno-unused-parameter -Wall -Wextra -pedantic")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG -g")
else()
set(CMAKE_BUILD_TYPE "Release")
endif()
if (WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mwindows")
target_link_libraries(${PROJECT_NAME} mingw32 m SDL2 SDL2_image SDL2_mixer SDL2_ttf opengl32 GLEW)
elseif(UNIX)
target_link_libraries(${PROJECT_NAME} m SDL2 SDL2_image SDL2_mixer SDL2_ttf GL GLEW)
endif()
2023-08-11 05:51:06 +00:00
message("System: ${CMAKE_SYSTEM_NAME}")
message("Project: ${PROJECT_NAME}")
message("Build: ${CMAKE_BUILD_TYPE}")
message("Flags: ${CMAKE_C_FLAGS}")