67 lines
1.9 KiB
CMake
67 lines
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(CreateEngine VERSION 1.0 LANGUAGES C CXX)
|
|
|
|
# --- Standards ---
|
|
set(CMAKE_C_STANDARD 99)
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
# --- Compiler flags ---
|
|
if(MSVC)
|
|
add_compile_definitions(GLM_ENABLE_EXPERIMENTAL WIN32_LEAN_AND_MEAN NOMINMAX)
|
|
add_compile_options(/W4 /Zi)
|
|
else()
|
|
add_compile_definitions(GLM_ENABLE_EXPERIMENTAL WIN32_LEAN_AND_MEAN NOMINMAX)
|
|
add_compile_options(-Wall -g -O2 -static -static-libstdc++ -static-libgcc)
|
|
endif()
|
|
|
|
# --- Gather source files ---
|
|
file(GLOB_RECURSE SOURCE_FILES
|
|
${CMAKE_SOURCE_DIR}/src/src/*.cpp
|
|
${CMAKE_SOURCE_DIR}/src/src/*.c
|
|
${CMAKE_SOURCE_DIR}/src/vendor/*.cpp
|
|
${CMAKE_SOURCE_DIR}/src/vendor/*.c
|
|
${CMAKE_SOURCE_DIR}/src/include/lua/*.c
|
|
)
|
|
|
|
# --- Define target ---
|
|
add_executable(${PROJECT_NAME} ${SOURCE_FILES}
|
|
src/src/core/utils/PrimitiveGenerator.cpp
|
|
src/src/core/utils/PrimitiveGenerator.h)
|
|
|
|
# --- Include directories for this target ---
|
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
${CMAKE_SOURCE_DIR}/src/include
|
|
${CMAKE_SOURCE_DIR}/src/include/lua
|
|
${CMAKE_SOURCE_DIR}/src/vendor
|
|
${CMAKE_SOURCE_DIR}/src/vendor/imgui
|
|
${CMAKE_SOURCE_DIR}/src/vendor/imguizmo
|
|
${CMAKE_SOURCE_DIR}/src/vendor/box2d
|
|
${CMAKE_SOURCE_DIR}/src/vendor/box2d/include
|
|
${CMAKE_SOURCE_DIR}/src/vendor/xxhash
|
|
${CMAKE_SOURCE_DIR}/src/vendor/miniaudio
|
|
)
|
|
|
|
# --- Link libraries ---
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
|
glfw3
|
|
glew32
|
|
opengl32
|
|
gdi32
|
|
comdlg32
|
|
ole32
|
|
shell32
|
|
uuid
|
|
yaml-cpp
|
|
ssl
|
|
crypto
|
|
dbghelp
|
|
z
|
|
freetype
|
|
)
|
|
|
|
# --- Output directory ---
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/src/build"
|
|
)
|