This is a huge change, and basically breaks everything (as per usual!) First of, this includes stuff like shaders so anything involving those are broken and then fixed. A new BuildAssets cmake file is added to aid in running AssetCompiler, and it seems to work fine on the engine base assets. The File API will eventually be revamped to handle this new way of organizing the files and domains will eventually be gotten rid of all together since I probably will replace it with game directory priorities. As it stands right now, there isn't a way to easily replace say - render_options.cfg with your own game-specific version. Apple builds are probably broken by this commit (since I'm moving around content and shader directories) to be fixed later.
61 lines
1.7 KiB
CMake
61 lines
1.7 KiB
CMake
include(../../cmake/AddPlatformExecutable.cmake)
|
|
|
|
if(ENABLE_METAL)
|
|
find_library(METAL Metal)
|
|
|
|
set(EXTRA_LIBRARIES GFXMetal ${METAL} ${EXTRA_LIBRARIES})
|
|
set(EXTRA_SRC ${CMAKE_CURRENT_SOURCE_DIR}/sdl_metal.mm ${EXTRA_SRC})
|
|
endif()
|
|
|
|
if(ENABLE_VULKAN)
|
|
set(EXTRA_LIBRARIES GFXVulkan ${EXTRA_LIBRARIES})
|
|
set(EXTRA_SRC ${CMAKE_CURRENT_SOURCE_DIR}/sdl_vulkan.cpp ${EXTRA_SRC})
|
|
endif()
|
|
|
|
if(ENABLE_DX12)
|
|
set(EXTRA_LIBRARIES GFXDX12 ${EXTRA_LIBRARIES})
|
|
endif()
|
|
|
|
if(TARGET SDL2::SDL2)
|
|
set(EXTRA_LIBRARIES SDL2::SDL2 ${EXTRA_LIBRARIES})
|
|
endif()
|
|
|
|
if(TARGET SDL2::Main)
|
|
set(EXTRA_LIBRARIES SDL2::Main ${EXTRA_LIBRARIES})
|
|
endif()
|
|
|
|
if(TARGET SDL2::SDL2main)
|
|
set(EXTRA_LIBRARIES SDL2::SDL2main ${EXTRA_LIBRARIES})
|
|
endif()
|
|
|
|
add_platform(
|
|
SRC
|
|
${CMAKE_CURRENT_SOURCE_DIR}/file.cpp
|
|
${EXTRA_SRC}
|
|
MAIN_FILE
|
|
main.cpp.in
|
|
EXECUTABLE_PROPERTIES
|
|
MACOSX_BUNDLE ON
|
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
|
|
LINK_LIBRARIES
|
|
Core
|
|
GFXDummy
|
|
${EXTRA_LIBRARIES}
|
|
)
|
|
|
|
function(add_platform_commands target data_directory skip_data)
|
|
if(NOT skip_data)
|
|
if(ENABLE_MACOS)
|
|
add_custom_target(${target}_copy_assets
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${data_directory} $<TARGET_FILE_DIR:${target}>/../Resources/game
|
|
)
|
|
else()
|
|
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin/game)
|
|
|
|
add_custom_target(${target}_copy_assets
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${data_directory} ${CMAKE_BINARY_DIR}/bin/game
|
|
)
|
|
endif()
|
|
add_dependencies(${target} ${target}_copy_assets)
|
|
endif()
|
|
endfunction()
|