For VS/Xcode, group Urho3D files based on physical directory structure.

This commit is contained in:
Yao Wei Tjong 姚伟忠 2020-02-16 13:56:06 +08:00
parent 6277b36939
commit c2b8d25962
No known key found for this signature in database
GPG Key ID: 0296FF46D1EE7308
2 changed files with 5 additions and 16 deletions

View File

@ -156,7 +156,7 @@ if ((RPI AND "${RPI_ABI}" MATCHES NEON) OR (ARM AND (APPLE OR URHO3D_64BIT OR "$
# TODO: remove this logic when the compiler flags are set in each toolchain file, such that the CheckCompilerToolchain can perform the check automatically
set (NEON 1)
endif ()
# For Raspbery Pi, find Broadcom VideoCore IV firmware
# For Raspberry Pi, find Broadcom VideoCore IV firmware
if (RPI)
# TODO: this logic is earmarked to be moved into SDL's CMakeLists.txt when refactoring the library dependency handling
find_package (VideoCore REQUIRED)
@ -989,20 +989,7 @@ macro (define_source_files)
endif ()
# Optionally group the sources based on their physical subdirectories
if (ARG_GROUP)
foreach (CPP_FILE ${CPP_FILES})
get_filename_component (PATH ${CPP_FILE} PATH)
if (PATH)
string (REPLACE / \\ PATH ${PATH})
source_group ("Source Files\\${PATH}" FILES ${CPP_FILE})
endif ()
endforeach ()
foreach (H_FILE ${H_FILES})
get_filename_component (PATH ${H_FILE} PATH)
if (PATH)
string (REPLACE / \\ PATH ${PATH})
source_group ("Header Files\\${PATH}" FILES ${H_FILE})
endif ()
endforeach ()
source_group (TREE ${CMAKE_CURRENT_SOURCE_DIR} PREFIX "Source Files" FILES ${SOURCE_FILES})
endif ()
endmacro ()
@ -1062,7 +1049,7 @@ macro (define_resource_dirs)
set_property (SOURCE ${RESOURCE_PAKS} PROPERTY GENERATED TRUE)
if (WEB)
if (EMSCRIPTEN)
# Set the custom EMCC_OPTION property to peload the generated shared data file
# Set the custom EMCC_OPTION property to preload the generated shared data file
if (EMSCRIPTEN_SHARE_DATA)
set (SHARED_RESOURCE_JS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_PROJECT_NAME}.js)
list (APPEND SOURCE_FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data)

View File

@ -171,6 +171,7 @@ add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/librevision.h
DEPENDS ${URHO3D_DEPS} ${CMAKE_SOURCE_DIR}/CMake/Modules/GetUrhoRevision.cmake
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "") # Suppress the comment as the header file may or may not be re-generated
source_group ("Source Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/librevision.h)
# Use the AutoBinder tool to generate source files for binding script subsystems
if (URHO3D_BINDINGS)
@ -261,6 +262,7 @@ endif ()
generate_export_header (${TARGET_NAME} ${URHO3D_LIB_TYPE} EXPORT_MACRO_NAME URHO3D_API EXPORT_FILE_NAME Urho3D.h.new)
execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h.new ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h)
file (REMOVE ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h.new)
source_group ("Source Files" FILES ${CMAKE_CURRENT_BINARY_DIR}/Urho3D.h)
# Define generated object files
# This is a hack as it relies on internal working of CMake