1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +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) get_filename_component(RESOURCE_FOLDER ${RESOURCE} DIRECTORY)
if(NOT "${RESOURCE_FOLDER}" STREQUAL "") if(NOT "${RESOURCE_FOLDER}" STREQUAL "")
get_filename_component(RESOURCE_FOLDER ${RESOURCE_FOLDER} NAME) 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() else()
OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR_RESOURCE}") OCCT_INSTALL_FILE_OR_DIR ("resources/${RESOURCE}" "${INSTALL_DIR_RESOURCE}")
endif() endif()
endforeach() endforeach()

View File

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

View File

@ -3,7 +3,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@ <LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ 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_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests 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@'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@ <LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ 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_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests 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@'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|@X_COMPILER_BITNESS@'">
<LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@ <LocalDebuggerEnvironment>CASROOT=@CMAKE_SOURCE_DIR@
CSF_FPE=@BUILD_ENABLE_FPE_SIGNAL_HANDLER@ 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_OCCTDataPath=@CMAKE_SOURCE_DIR@/data
CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples
CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests 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_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_OCCTDataPath=@CMAKE_SOURCE_DIR@/data"
set "CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples" set "CSF_OCCTSamplesPath=@CMAKE_SOURCE_DIR@/samples"
set "CSF_OCCTTestsPath=@CMAKE_SOURCE_DIR@/tests" 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_OCCTBinPath="@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@" export CSF_OCCTLibPath="@CMAKE_ARCHIVE_OUTPUT_DIRECTORY@"
export CSF_OCCTIncludePath="@CMAKE_BINARY_DIR@/@INSTALL_DIR_INCLUDE@" 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_OCCTDataPath="@CMAKE_SOURCE_DIR@/data"
export CSF_OCCTSamplesPath="@CMAKE_SOURCE_DIR@/samples" export CSF_OCCTSamplesPath="@CMAKE_SOURCE_DIR@/samples"
export CSF_OCCTTestsPath="@CMAKE_SOURCE_DIR@/tests" 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