mirror of
https://github.com/barkeser2002/flower.git
synced 2026-09-25 17:16:14 +03:00
82 lines
2.1 KiB
CMake
82 lines
2.1 KiB
CMake
MACRO(SOURCE_GROUP_BY_FOLDER target)
|
|
SET(SOURCE_GROUP_DELIMITER "/")
|
|
SET(last_dir "")
|
|
SET(files "")
|
|
FOREACH(file ${${target}_SRC} ${${target}_HEADERS})
|
|
file(RELATIVE_PATH relative_file "${PROJECT_SOURCE_DIR}/source/" ${file})
|
|
GET_FILENAME_COMPONENT(dir "${relative_file}" PATH)
|
|
IF (NOT "${dir}" STREQUAL "${last_dir}")
|
|
IF (files)
|
|
SOURCE_GROUP("${last_dir}" FILES ${files})
|
|
ENDIF (files)
|
|
SET(files "")
|
|
ENDIF (NOT "${dir}" STREQUAL "${last_dir}")
|
|
SET(files ${files} ${file})
|
|
SET(last_dir "${dir}")
|
|
ENDFOREACH(file)
|
|
IF (files)
|
|
SOURCE_GROUP("${last_dir}" FILES ${files})
|
|
ENDIF (files)
|
|
ENDMACRO(SOURCE_GROUP_BY_FOLDER)
|
|
|
|
file(GLOB_RECURSE flower_SRC CONFIGURE_DEPENDS "*.h" "*.cpp")
|
|
|
|
add_executable(flower ${flower_SRC} "${CMAKE_CURRENT_SOURCE_DIR}/icon.rc")
|
|
|
|
SOURCE_GROUP_BY_FOLDER(flower)
|
|
|
|
target_include_directories(flower PRIVATE
|
|
${CEREAL_DIR}
|
|
${PROJECT_SOURCE_DIR}/dependency
|
|
${PROJECT_SOURCE_DIR}/dependency/assimp/include
|
|
${PROJECT_SOURCE_DIR}/dependency/openal/include
|
|
${BULLET_PHYSICS_SOURCE_DIR}/src
|
|
)
|
|
|
|
target_precompile_headers(flower PRIVATE
|
|
"engine/asset/asset.h"
|
|
"engine/imgui/ui.h"
|
|
"engine/renderer/renderer.h"
|
|
"engine/rhi/rhi.h"
|
|
"engine/scene/scene.h"
|
|
"engine/util/util.h"
|
|
"editor/editor.h")
|
|
|
|
|
|
|
|
if(MSVC)
|
|
target_compile_options(flower PUBLIC "/ZI")
|
|
target_link_options(flower PUBLIC "/INCREMENTAL")
|
|
endif()
|
|
|
|
add_definitions(${BULLET_DEFINITIONS})
|
|
|
|
target_link_libraries(flower PUBLIC
|
|
OpenAL
|
|
Vulkan::Vulkan
|
|
assimp
|
|
VulkanMemoryAllocator
|
|
EnTT::EnTT
|
|
utf8cpp
|
|
nativefiledialog
|
|
spdlog::spdlog
|
|
stduuid
|
|
nlohmann_json
|
|
inipp::inipp
|
|
glfw
|
|
utf8cpp
|
|
EnTT::EnTT
|
|
lz4_static
|
|
ffx_fsr2_api_x64
|
|
ffx_fsr2_api_vk_x64
|
|
tinyexr
|
|
BulletDynamics BulletCollision LinearMath
|
|
)
|
|
|
|
set_target_properties(flower PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/install")
|
|
|
|
if (MSVC)
|
|
target_compile_options(flower PRIVATE /bigobj)
|
|
else ()
|
|
target_compile_options(flower PRIVATE -Wa,-mbig-obj)
|
|
endif () |