2019-11-23 20:27:39 +08:00
|
|
|
|
|
|
|
|
2020-09-04 17:19:51 +08:00
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
cmake_policy(SET CMP0079 NEW)
|
|
|
|
endif()
|
|
|
|
|
2022-08-11 15:41:10 +08:00
|
|
|
function(setup_ax_extension_config target_name)
|
2023-10-26 21:30:31 +08:00
|
|
|
set(options DNTLINK opt_DNTLINK)
|
|
|
|
set(options LINK_SCOPE opt_LINK_SCOPE)
|
|
|
|
cmake_parse_arguments(opt "" "${options}" ""
|
2020-10-17 16:32:16 +08:00
|
|
|
"" ${ARGN} )
|
|
|
|
|
2023-10-26 21:30:31 +08:00
|
|
|
target_link_libraries(${target_name} ${opt_LINK_SCOPE} ${_AX_CORE_LIB})
|
2020-10-17 16:32:16 +08:00
|
|
|
|
|
|
|
if(BUILD_SHARED_LIBS)
|
2024-02-20 05:37:12 +08:00
|
|
|
target_compile_definitions(${target_name} PRIVATE AX_EX_DLLEXPORT INTERFACE AX_EX_DLLIMPORT)
|
2020-10-17 16:32:16 +08:00
|
|
|
endif()
|
|
|
|
|
2020-08-03 20:31:47 +08:00
|
|
|
set_target_properties(${target_name}
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
|
2021-04-22 22:01:47 +08:00
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
2020-08-03 20:31:47 +08:00
|
|
|
FOLDER "Extensions"
|
|
|
|
)
|
|
|
|
|
2023-09-26 00:11:33 +08:00
|
|
|
if (WINRT)
|
|
|
|
set_property(TARGET ${target_name} PROPERTY VS_PROJECT_IMPORT ${CMAKE_BINARY_DIR}/packages/Microsoft.Windows.CppWinRT/build/native/Microsoft.Windows.CppWinRT.props)
|
|
|
|
endif()
|
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
if(NOT opt_DNTLINK)
|
2022-05-13 21:06:17 +08:00
|
|
|
set(_AX_EXTENSION_LIBS "${target_name};${_AX_EXTENSION_LIBS}" CACHE INTERNAL "extensions for auto link to target application")
|
2020-10-17 16:32:16 +08:00
|
|
|
endif()
|
2023-10-26 21:30:31 +08:00
|
|
|
|
2020-10-17 16:32:16 +08:00
|
|
|
if(XCODE OR VS)
|
2022-08-11 15:41:10 +08:00
|
|
|
ax_mark_code_files("${target_name}")
|
2020-10-17 16:32:16 +08:00
|
|
|
endif()
|
|
|
|
|
2020-08-03 20:31:47 +08:00
|
|
|
endfunction()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_GUI)
|
2020-10-18 12:31:45 +08:00
|
|
|
add_subdirectory(GUI)
|
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_ASSETMANAGER)
|
2020-08-03 20:31:47 +08:00
|
|
|
add_subdirectory(assets-manager)
|
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_PARTICLE3D)
|
2020-08-03 20:31:47 +08:00
|
|
|
add_subdirectory(Particle3D)
|
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_PHYSICS_NODE)
|
2020-08-03 20:31:47 +08:00
|
|
|
add_subdirectory(physics-nodes)
|
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_SPINE)
|
2020-08-03 20:31:47 +08:00
|
|
|
add_subdirectory(spine)
|
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_DRAGONBONES)
|
2020-10-18 00:27:23 +08:00
|
|
|
add_subdirectory(DragonBones)
|
2020-08-03 20:31:47 +08:00
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_FAIRYGUI)
|
2020-08-04 12:31:33 +08:00
|
|
|
add_subdirectory(fairygui)
|
2020-10-17 16:32:16 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
target_link_libraries(fairygui spine)
|
|
|
|
else()
|
2024-03-07 08:47:00 +08:00
|
|
|
target_include_directories(fairygui
|
2024-02-03 10:08:22 +08:00
|
|
|
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/spine/runtime/include
|
|
|
|
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/spine/src
|
|
|
|
)
|
2020-10-17 16:32:16 +08:00
|
|
|
endif()
|
2020-08-04 12:31:33 +08:00
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_IMGUI)
|
2022-02-25 19:03:09 +08:00
|
|
|
add_subdirectory(ImGui)
|
2023-09-12 01:06:28 +08:00
|
|
|
option(AX_ENABLE_EXT_INSPECTOR "Enable extension Inspector" ON)
|
|
|
|
if(AX_ENABLE_EXT_INSPECTOR)
|
|
|
|
add_subdirectory(Inspector)
|
2024-02-03 10:08:22 +08:00
|
|
|
target_include_directories(Inspector PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ImGui/src/ImGui)
|
2023-09-12 01:06:28 +08:00
|
|
|
endif()
|
2023-09-26 01:33:06 +08:00
|
|
|
if (AX_ENABLE_EXT_SDFGEN)
|
|
|
|
add_subdirectory(SDFGen)
|
2024-02-03 10:08:22 +08:00
|
|
|
target_include_directories(SDFGen PUBLIC ${CMAKE_CURRENT_LIST_DIR}/ImGui/src/ImGui)
|
2023-09-26 01:33:06 +08:00
|
|
|
endif()
|
2020-09-04 17:19:51 +08:00
|
|
|
endif()
|
|
|
|
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_COCOSTUDIO)
|
2020-10-21 10:12:00 +08:00
|
|
|
add_subdirectory(cocostudio)
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_SPINE)
|
2023-10-11 00:32:04 +08:00
|
|
|
target_compile_definitions(cocostudio PRIVATE AX_ENABLE_EXT_SPINE=1)
|
2020-10-17 16:32:16 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2020-10-21 10:12:00 +08:00
|
|
|
target_link_libraries(cocostudio spine particle3d)
|
2020-10-17 16:32:16 +08:00
|
|
|
else()
|
2024-03-07 08:47:00 +08:00
|
|
|
target_include_directories(cocostudio
|
2024-02-03 10:08:22 +08:00
|
|
|
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/spine/runtime/include
|
|
|
|
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/spine/src
|
|
|
|
PUBLIC ${CMAKE_CURRENT_LIST_DIR}/Particle3D/src
|
|
|
|
)
|
2020-10-17 16:32:16 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2022-02-17 17:11:17 +08:00
|
|
|
if(AX_ENABLE_EXT_DRAGONBONES)
|
2023-10-11 00:32:04 +08:00
|
|
|
target_compile_definitions(cocostudio PRIVATE AX_ENABLE_EXT_DRAGONBONES=1)
|
2020-10-17 16:32:16 +08:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2020-10-21 10:12:00 +08:00
|
|
|
target_link_libraries(cocostudio DragonBones)
|
2024-02-03 10:08:22 +08:00
|
|
|
else()
|
|
|
|
target_include_directories(cocostudio PUBLIC ${CMAKE_CURRENT_LIST_DIR}/DragonBones/src)
|
2020-10-17 16:32:16 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-06-24 16:23:26 +08:00
|
|
|
if(AX_ENABLE_EXT_LIVE2D)
|
|
|
|
add_subdirectory(Live2D)
|
|
|
|
endif()
|
|
|
|
|
2022-10-30 23:00:33 +08:00
|
|
|
if (AX_ENABLE_EXT_EFFEKSEER)
|
|
|
|
add_subdirectory(Effekseer)
|
|
|
|
endif()
|
|
|
|
|
2022-02-17 21:31:39 +08:00
|
|
|
if(AX_ENABLE_EXT_LUA)
|
2020-10-17 16:32:16 +08:00
|
|
|
add_subdirectory(scripting/lua-bindings)
|
|
|
|
endif()
|
|
|
|
|
2023-10-19 15:30:39 +08:00
|
|
|
if(AX_ENABLE_EXT_JSONDEFAULT)
|
|
|
|
add_subdirectory(JSONDefault)
|
|
|
|
endif()
|
|
|
|
|
2024-01-05 02:07:13 +08:00
|
|
|
if(AX_ENABLE_EXT_DRAWNODEEX)
|
|
|
|
add_subdirectory(DrawNodeEx)
|
|
|
|
endif()
|
|
|
|
|
2022-10-01 16:24:52 +08:00
|
|
|
message(STATUS "Enabled ${_AX_CORE_LIB} extensions:${_AX_EXTENSION_LIBS}")
|