68 lines
1.5 KiB
CMake
68 lines
1.5 KiB
CMake
cmake_minimum_required(VERSION 3.20)
|
|
|
|
project(colysis
|
|
LANGUAGES CXX
|
|
VERSION 0.0.1
|
|
)
|
|
|
|
# Set C/C++ standards
|
|
set(CMAKE_C_STANDARD 11)
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
set(CMAKE_C_EXTENSIONS OFF)
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
# Set compiler flags
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Generate compile commands (useful for IDEs)
|
|
set(USE_FOLDERS ON) # Organize targets into folders (for IDEs)
|
|
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) # Build static libraries by default
|
|
|
|
|
|
include(cmake/CPM.cmake)
|
|
|
|
# sfml
|
|
CPMAddPackage(
|
|
NAME sfml
|
|
GITHUB_REPOSITORY SFML/SFML
|
|
GIT_TAG 3.0.0
|
|
)
|
|
|
|
# # flecs
|
|
# CPMAddPackage(
|
|
# NAME flecs
|
|
# GITHUB_REPOSITORY SanderMertens/flecs
|
|
# GIT_TAG v4.0.4
|
|
# )
|
|
|
|
|
|
include(cmake/utils.cmake)
|
|
|
|
# Get files in src/ and add them to the executable
|
|
|
|
find_files(colysis_src src cpp hpp cxx hxx c h)
|
|
add_executable(colysis
|
|
${colysis_src}
|
|
)
|
|
|
|
target_link_libraries(colysis
|
|
SFML::Audio
|
|
SFML::Graphics
|
|
SFML::Window
|
|
SFML::System
|
|
)
|
|
|
|
target_compile_definitions(colysis PUBLIC "$<$<CONFIG:DEBUG>:_DEBUG>")
|
|
|
|
target_include_directories(colysis PUBLIC include
|
|
#${ALYSON_INCLUDE_DIR}
|
|
)
|
|
|
|
# put the assets folder path as a C preprocessor define
|
|
set(ASSETS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/assets/")
|
|
target_compile_definitions(colysis PRIVATE ASSETS_PATH="${ASSETS_PATH}")
|
|
message(STATUS "Assets path : ${ASSETS_PATH}")
|
|
|
|
|
|
# put_targets_into_folder(FOLDER "vendor/flecs" TARGETS flecs::flecs flecs::flecs_static)
|