1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-03-30 17:16:22 +03:00

Configuration - Resource structure reorganization #429

Reorganized resources to keep source part in src and real-time scripts in resource folder.
For the installation result no changes, still installed to src for windows.
This commit is contained in:
Pasukhin Dmitry 2025-03-18 22:54:43 +00:00 committed by GitHub
parent 99c7ce57c1
commit df4b931988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
178 changed files with 2413 additions and 1439 deletions

View File

@ -1140,9 +1140,9 @@ foreach(RESOURCE ${RESOURCES})
get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME)
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/${RESOURCE_FOLDER}")
else()
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
endif()
endforeach()

View File

@ -3,8 +3,8 @@
macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
set (RESOURCE_FILES)
set (isResDirectory FALSE)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/src/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource}/FILES" RESOURCE_FILES)
if (IS_DIRECTORY "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}")
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource}/FILES" RESOURCE_FILES)
set (CurrentResource_Directory "${CurrentResource}")
set (isResDirectory TRUE)
else()
@ -27,37 +27,23 @@ macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
string (REPLACE "." "_" CurrentResource_FileName "${CurrentResource_FileName}")
set (HEADER_FILE_NAME "${CurrentResource_Directory}_${CurrentResource_FileName}.pxx")
set (toProcessResFile TRUE)
if (isResDirectory)
list (FIND RESOURCE_FILES "${HEADER_FILE_NAME}" aResIndex)
if ("${aResIndex}" STREQUAL "-1")
set (toProcessResFile FALSE)
endif()
endif()
if (toProcessResFile)
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};")
# Save generated content to header file
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}")
# generate content for header file
set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file resources/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
# read resource file
file (STRINGS "${CMAKE_SOURCE_DIR}/resources/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
string (REPLACE "\"" "\\\"" line "${line}")
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n \"${line}\\n\"")
endforeach()
set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};\n\n")
# Save generated content to header file
set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")
if (EXISTS "${HEADER_FILE}")
file (REMOVE "${HEADER_FILE}")
endif()
configure_file ("${CMAKE_SOURCE_DIR}/adm/templates/header.in" "${HEADER_FILE}" @ONLY NEWLINE_STYLE LF)
endif()
endforeach()
endif()

View File

@ -3,7 +3,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
@ -16,7 +16,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests
@ -29,7 +29,7 @@ PATH=@3RDPARTY_DLL_DIRS_FOR_PATH@;%PATH%
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src
CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource
CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests

View File

@ -35,7 +35,7 @@ if /I "%VCVER%" == "@COMPILER@" (
)
set "CSF_OCCTIncludePath=@CMAKE_BINARY_DIR@/inc"
set "CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/src"
set "CSF_OCCTResourcePath=@CMAKE_SOURCE_DIR@/resource"
set "CSF_OCCTDataPath=@CMAKE_SOURCE_DIR@/data"
set "CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples"
set "CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests"

View File

@ -24,7 +24,7 @@ if [ "$1" == "@BIN_LETTER@" ]; then
export CSF_OCCTBinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@"
export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/src"
export CSF_OCCTResourcePath="@CMAKE_SOURCE_DIR@/resource"
export CSF_OCCTDataPath="@CMAKE_SOURCE_DIR@/data"
export CSF_OCCTSamplesPath="@CMAKE_SOURCE_DIR@/samples"
export CSF_OCCTTestsPath="@CMAKE_SOURCE_DIR@/tests"

View File

@ -1 +1,2 @@
@OCCT_HEADER_FILE_CONTENT@
// clang-format off
@OCCT_HEADER_FILE_CONTENT@// clang-format on

1
resources/BOPAlgo/FILES Normal file
View File

@ -0,0 +1 @@
BOPAlgo.msg

View File

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

Before

Width:  |  Height:  |  Size: 959 B

After

Width:  |  Height:  |  Size: 959 B

View File

Before

Width:  |  Height:  |  Size: 921 B

After

Width:  |  Height:  |  Size: 921 B

View File

Before

Width:  |  Height:  |  Size: 941 B

After

Width:  |  Height:  |  Size: 941 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

2
resources/SHMessage/FILES Executable file
View File

@ -0,0 +1,2 @@
msgfile:::SHAPE.fr
msgfile:::SHAPE.us

27
resources/Shaders/FILES Normal file
View File

@ -0,0 +1,27 @@
srcinc:::Declarations.glsl
srcinc:::DeclarationsImpl.glsl
srcinc:::LightShadow.glsl
srcinc:::PBRCookTorrance.glsl
srcinc:::PBRDirectionalLight.glsl
srcinc:::PBRDistribution.glsl
srcinc:::PBREnvBaking.fs
srcinc:::PBREnvBaking.vs
srcinc:::PBRFresnel.glsl
srcinc:::PBRGeometry.glsl
srcinc:::PBRIllumination.glsl
srcinc:::PBRPointLight.glsl
srcinc:::PBRSpotLight.glsl
srcinc:::PhongShading.fs
srcinc:::PhongShading.vs
srcinc:::PhongDirectionalLight.glsl
srcinc:::PhongPointLight.glsl
srcinc:::PhongSpotLight.glsl
srcinc:::PointLightAttenuation.glsl
srcinc:::Display.fs
srcinc:::RaytraceBase.fs
srcinc:::RaytraceRender.fs
srcinc:::PathtraceBase.fs
srcinc:::RaytraceBase.vs
srcinc:::RaytraceSmooth.fs
srcinc:::TangentSpaceNormal.glsl
srcinc:::SkydomBackground.fs

1
resources/TObj/FILES Executable file
View File

@ -0,0 +1 @@
TObj.msg

31
resources/Textures/FILES Executable file
View File

@ -0,0 +1,31 @@
icon:::1d_elevation.rgb
icon:::2d_alienskin.rgb
icon:::2d_aluminum.rgb
icon:::2d_blue_rock.rgb
icon:::2d_bluewhite_paper.rgb
icon:::2d_brushed.rgb
icon:::2d_bubbles.rgb
icon:::2d_bumps.rgb
icon:::2d_cast.rgb
icon:::2d_chipbd.rgb
icon:::2d_clouds.rgb
icon:::2d_flesh.rgb
icon:::2d_floor.rgb
icon:::2d_galvnisd.rgb
icon:::2d_grass.rgb
icon:::2d_knurl.rgb
icon:::2d_maple.rgb
icon:::2d_marble.rgb
icon:::2d_MatraDatavision.rgb
icon:::2d_mottled.rgb
icon:::2d_rain.rgb
icon:::2d_rock.rgb
icon:::2d_chess.rgba
icon:::env_clouds.rgb
icon:::env_cv.rgb
icon:::env_lines.rgb
icon:::env_medit.rgb
icon:::env_pearl.rgb
icon:::env_road.rgb
icon:::env_sky1.rgb
icon:::env_sky2.rgb

Some files were not shown because too many files have changed in this diff Show More