1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

Configuration, CMake - Flexible project root (#641)

- Replaces all `CMAKE_SOURCE_DIR` references with `OCCT_ROOT_DIR` across CMake files
- Updates build templates to use the new root directory variable
- Modifies environment variable configurations to use the flexible root path
This commit is contained in:
Pasukhin Dmitry
2025-07-24 09:49:19 +01:00
committed by GitHub
parent 134afb1b7a
commit f41a5a91e4
15 changed files with 132 additions and 132 deletions

View File

@@ -79,8 +79,8 @@ macro (FIND_AND_WRAP_TS_FILE RESOURCE_FILE_NAME TARGET_FOLDER QM_FILES)
endmacro()
macro (FIND_AND_INSTALL_QT_RESOURCES OCCT_PACKAGE RESOURCE_FILES)
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" TS_FILES REGEX ".+[.]ts")
file (STRINGS "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" QRC_FILES REGEX ".+[.]qrc")
file (STRINGS "${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" TS_FILES REGEX ".+[.]ts")
file (STRINGS "${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/FILES" QRC_FILES REGEX ".+[.]qrc")
string (FIND "${OCCT_PACKAGE}" "/" _index)
if (_index GREATER -1)
@@ -92,7 +92,7 @@ macro (FIND_AND_INSTALL_QT_RESOURCES OCCT_PACKAGE RESOURCE_FILES)
#message("QRC files are: ${QRC_FILES} in ${OCCT_PACKAGE}")
foreach (QRC_FILE ${QRC_FILES})
set (QRC_FILE_RELATIVE "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${QRC_FILE}")
set (QRC_FILE_RELATIVE "${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${QRC_FILE}")
if (EXISTS ${QRC_FILE_RELATIVE})
FIND_AND_WRAP_RESOURCE_FILE(${QRC_FILE_RELATIVE} RCC_FILES)
list (APPEND ${RESOURCE_FILES} "${RCC_FILES}")
@@ -101,7 +101,7 @@ macro (FIND_AND_INSTALL_QT_RESOURCES OCCT_PACKAGE RESOURCE_FILES)
#message("TS files are: ${TS_FILES} in ${OCCT_PACKAGE}")
foreach (TS_FILE ${TS_FILES})
set (TS_FILE_RELATIVE "${CMAKE_SOURCE_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${TS_FILE}")
set (TS_FILE_RELATIVE "${OCCT_ROOT_DIR}/${RELATIVE_SOURCES_DIR}/${OCCT_PACKAGE}/${TS_FILE}")
FIND_AND_WRAP_TS_FILE(${TS_FILE_RELATIVE} "${TARGET_FOLDER}/${CURRENT_MODULE}" QM_FILES)
if (EXISTS ${TS_FILE_RELATIVE})
list (APPEND ${RESOURCE_FILES} "${TS_FILE_RELATIVE}")