diff --git a/CMakeLists.txt b/CMakeLists.txt index 6349b89ad6..6bc670ec99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,10 +31,27 @@ endif() # the name of the project project (OCCT) +# include occt macros +OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros") + # Solution folder property set_property (GLOBAL PROPERTY USE_FOLDERS ON) +# get current OCCT version +OCC_VERSION (OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT) + +set_property (GLOBAL PROPERTY OCC_VERSION_MAJOR ${OCC_VERSION_MAJOR}) +set_property (GLOBAL PROPERTY OCC_VERSION_MINOR ${OCC_VERSION_MINOR}) +set_property (GLOBAL PROPERTY OCC_VERSION_MAINTENANCE ${OCC_VERSION_MAINTENANCE}) + set (INSTALL_TEST_CASES OFF CACHE BOOL "${INSTALL_TEST_CASES_DESCR}") + +# single-configuration generator +set (SINGLE_GENERATOR OFF) +if (CMAKE_BUILD_TYPE) + set (SINGLE_GENERATOR ON) +endif() + # a single-configuration generator like the Makefile generator defines CMAKE_BUILD_TYPE variable # check this variable and set if it's required if (DEFINED CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE) # single-configuration generator. @@ -50,10 +67,93 @@ endif() # copy samples to install directory set (INSTALL_SAMPLES OFF CACHE BOOL "${INSTALL_SAMPLES_DESCR}") -# install dir of the built project -set (INSTALL_DIR "" CACHE PATH "${INSTALL_DIR_DESCR}" ) -set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE ) +# install dir of the project +if (NOT DEFINED INSTALL_DIR) + set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}") +endif() +if ("${INSTALL_DIR}" STREQUAL "") + get_filename_component (CMAKE_BINARY_DIR_PARENT ${CMAKE_BINARY_DIR} DIRECTORY) + set (INSTALL_DIR "${CMAKE_BINARY_DIR_PARENT}/install" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE) + message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}") +endif() + +# hide CMAKE_INSTALL_PREFIX from a user +set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) + +set (BIN_LETTER "") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set (BIN_LETTER "d") +elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + set (BIN_LETTER "i") +endif() + +# Get all used variables: OS_WITH_BIT, COMPILER +OCCT_MAKE_OS_WITH_BITNESS() +OCCT_MAKE_COMPILER_SHORT_NAME() + +# do not define INSTALL_BIN_DIR for win. +# Leave library structure for win: /win64/vc10/bin(d) +if (NOT DEFINED INSTALL_BIN_DIR) + if (UNIX) + set (INSTALL_BIN_DIR "${INSTALL_DIR}/bin" CACHE PATH "${INSTALL_BIN_DIR_DESCR}") + else() + if (SINGLE_GENERATOR) + set (INSTALL_BIN_DIR "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin${BIN_LETTER}" CACHE PATH "${INSTALL_BIN_DIR_DESCR}") + endif() + endif() +endif() + +# define folder contaning all shell/batch scripts +if (NOT DEFINED INSTALL_SCRIPT_DIR) + if (UNIX) + set (INSTALL_SCRIPT_DIR "${INSTALL_BIN_DIR}/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_SCRIPT_DIR_DESCR}") + else() + set (INSTALL_SCRIPT_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_SCRIPT_DIR_DESCR}") + endif() +endif() + +# place the libraries to /lib folder for unix and leave old structure for windows +if (NOT DEFINED INSTALL_LIB_DIR) + if (UNIX) + set (INSTALL_LIB_DIR "${INSTALL_DIR}/lib" CACHE PATH "${INSTALL_LIB_DIR_DESCR}") + else() + if (SINGLE_GENERATOR) + set (INSTALL_LIB_DIR "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib${BIN_LETTER}" CACHE PATH "${INSTALL_LIB_DIR_DESCR}") + endif() + endif() +endif() + +# OCCT headers: /inc for windows, +# /include/opencascade-7.0.0 for unix +if (NOT DEFINED INSTALL_INCLUDE_DIR) + if (UNIX) + set (INSTALL_INCLUDE_DIR "${INSTALL_DIR}/include/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_INCLUDE_DIR_DESCR}") + else() + set (INSTALL_INCLUDE_DIR "${INSTALL_DIR}/inc" CACHE PATH "${INSTALL_INCLUDE_DIR_DESCR}") + endif() +endif() + +# OCCT resources: /src for windows, +# /share/opencascade-7.0.0/resources for unix +if (NOT DEFINED INSTALL_OCCT_RESOURCE_DIR) + if (UNIX) + set (INSTALL_OCCT_RESOURCE_DIR "${INSTALL_DIR}/share/opencascade-${OCC_VERSION_STRING_EXT}/resoures" CACHE PATH "${INSTALL_OCCT_RESOURCE_DIR_DESCR}") + else() + set (INSTALL_OCCT_RESOURCE_DIR "${INSTALL_DIR}/src" CACHE PATH "${INSTALL_OCCT_RESOURCE_DIR_DESCR}") + endif() +endif() + +# OCCT data +if (NOT DEFINED INSTALL_SHARE_DIR) + if (UNIX) + set (INSTALL_SHARE_DIR "${INSTALL_DIR}/share/opencascade-${OCC_VERSION_STRING_EXT}" CACHE PATH "${INSTALL_SHARE_DIR_DESCR}") + else() + set (INSTALL_SHARE_DIR "${INSTALL_DIR}" CACHE PATH "${INSTALL_SHARE_DIR_DESCR}") + endif() +endif() + +# a directory recognized as a 'patch' for OCCT set (BUILD_PATCH "" CACHE PATH "${BUILD_PATCH_DESCR}") # the list of being built toolkits @@ -68,13 +168,11 @@ endif() if (APPLE) set (USE_GLX OFF CACHE BOOL "${USE_GLX_DESCR}") endif() + if (WIN32) set (USE_D3D OFF CACHE BOOL "${USE_D3D_DESCR}") endif() -# include occt macros -OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_macros") - # include the patched or original list of modules # list _TOOLKITS is created foreach module and contains its toolkits # list will contain all modules @@ -114,7 +212,7 @@ endif() # accumulate all used toolkits list (REMOVE_DUPLICATES BUILD_TOOLKITS) set (RAW_BUILD_TOOLKITS) -foreach(BUILD_TOOLKIT ${BUILD_TOOLKITS}) +foreach (BUILD_TOOLKIT ${BUILD_TOOLKITS}) OCCT_TOOLKIT_FULL_DEP (${BUILD_TOOLKIT} TOOLKIT_FULL_DEPS) list (APPEND RAW_BUILD_TOOLKITS ${BUILD_TOOLKIT} ${TOOLKIT_FULL_DEPS}) endforeach() @@ -293,9 +391,12 @@ if (BUILD_DOC_OcctOverview) endif() if (INSTALL_DOC_OcctOverview) - install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_DIR}/doc") + install (DIRECTORY "${CMAKE_BINARY_DIR}/doc/overview" DESTINATION "${INSTALL_SHARE_DIR}/doc") - OCCT_INSTALL_FILE_OR_DIR ("dox/resources/overview.html" "${INSTALL_DIR}") + # create overview.html only for windows + if (WIN32) + OCCT_INSTALL_FILE_OR_DIR ("dox/resources/overview.html" "${INSTALL_SCRIPT_DIR}") + endif() endif() OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen") @@ -344,10 +445,6 @@ if (3RDPARTY_LIBRARY_DIRS) link_directories (${3RDPARTY_LIBRARY_DIRS}) endif() -# Get all used variables: OS_WITH_BIT, COMPILER -OCCT_MAKE_OS_WITH_BITNESS() -OCCT_MAKE_COMPILER_SHORT_NAME() - # build directories set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") @@ -367,15 +464,6 @@ if (WIN32) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") endif() -if ("${INSTALL_DIR}" STREQUAL "") - get_filename_component (CMAKE_BINARY_DIR_PARENT ${CMAKE_BINARY_DIR} DIRECTORY) - - set (INSTALL_DIR "${CMAKE_BINARY_DIR_PARENT}/install" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE) - set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE ) - - message (STATUS "Info: INSTALL_DIR has been set as ${INSTALL_DIR}") -endif() - string(TIMESTAMP CURRENT_TIME "%H:%M:%S") message (STATUS "\nInfo: \(${CURRENT_TIME}\) Start collecting all OCCT header files into ${CMAKE_BINARY_DIR}/inc ...") @@ -385,15 +473,24 @@ COLLECT_AND_INSTALL_OCCT_HEADER_FILES ("${CMAKE_BINARY_DIR}" "${BUILD_TOOLKITS}" string(TIMESTAMP CURRENT_TIME "%H:%M:%S") message (STATUS "Info: \(${CURRENT_TIME}\) End the collecting") -OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_DIR}") -OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_DIR}/samples") +OCCT_INSTALL_FILE_OR_DIR ("data" "${INSTALL_SHARE_DIR}") +# OCCT samples if (INSTALL_SAMPLES) - OCCT_INSTALL_FILE_OR_DIR ("samples" "${INSTALL_DIR}") + if (WIN32) + OCCT_INSTALL_FILE_OR_DIR ("samples/CSharp" "${INSTALL_SHARE_DIR}/samples") + OCCT_INSTALL_FILE_OR_DIR ("samples/mfc" "${INSTALL_SHARE_DIR}/samples") + endif() + + OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_SHARE_DIR}/samples") + OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_SHARE_DIR}/samples") + OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_SHARE_DIR}/samples") endif() +OCCT_INSTALL_FILE_OR_DIR ("samples/tcl" "${INSTALL_SHARE_DIR}/samples") + if (INSTALL_TEST_CASES) - OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_DIR}") + OCCT_INSTALL_FILE_OR_DIR ("tests" "${INSTALL_SHARE_DIR}") endif() if (WIN32) @@ -402,14 +499,16 @@ else() set (SCRIPT_EXT sh) endif() -# DRAW.BAT or DRAW.SH +# copy draw script to install script folder if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}") - install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) + install (FILES "${BUILD_PATCH}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_SCRIPT_DIR}" + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) else() - install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR}" PERMISSIONS - OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) + install (FILES "${CMAKE_SOURCE_DIR}/adm/templates/draw.${SCRIPT_EXT}" DESTINATION "${INSTALL_SCRIPT_DIR}" + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE) endif() + +# copy draw script to CMake binary folder OCCT_COPY_FILE_OR_DIR ("adm/templates/draw.${SCRIPT_EXT}" "${CMAKE_BINARY_DIR}") set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}") @@ -417,29 +516,29 @@ set (SUB_CUSTOM_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.${SCRIPT_EXT}") if (WIN32) set (ADDITIONAL_CUSTOM_CONTENT "\nif exist \"%~dp0${SUB_CUSTOM_NAME}\" (\n call \"%~dp0${SUB_CUSTOM_NAME}\" %VCVER% %ARCH% %CASDEB% \n)") else() - set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\${COMPILER}\" \"\${WOKSTATION}\${ARCH}\" \"\${CASDEB}\" \nfi") + set (ADDITIONAL_CUSTOM_CONTENT "\nif [ -e \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" ]; then\n source \"\${aScriptPath}/${SUB_CUSTOM_NAME}\" \"\$1\" \"\$2\" \nfi") endif() # change custom.bat/sh -if (EXISTS "${INSTALL_DIR}/custom.${SCRIPT_EXT}") - file (READ "${INSTALL_DIR}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) +if (EXISTS "${INSTALL_BIN_DIR}/custom.${SCRIPT_EXT}") + file (READ "${INSTALL_BIN_DIR}/custom.${SCRIPT_EXT}" CUSTOM_CONTENT) set (CUSTOM_CONTENT "${CUSTOM_CONTENT} ${ADDITIONAL_CUSTOM_CONTENT}") - file (WRITE "${INSTALL_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}") + file (WRITE "${INSTALL_BIN_DIR}/custom.${SCRIPT_EXT}" "${CUSTOM_CONTENT}") else() - OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_DIR}") + OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.${SCRIPT_EXT}.main" "custom.${SCRIPT_EXT}" "custom.${SCRIPT_EXT}" "${INSTALL_SCRIPT_DIR}") endif() # write current custom.bat/sh (for install directory) set (SUB_CUSTOM_BUILD_NAME "custom_${COMPILER}_${COMPILER_BITNESS}.install.${SCRIPT_EXT}") -OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_DIR}") +OCCT_CONFIGURE_AND_INSTALL ("adm/templates/custom.install.${SCRIPT_EXT}.in" "${SUB_CUSTOM_BUILD_NAME}" "${SUB_CUSTOM_NAME}" "${INSTALL_SCRIPT_DIR}") # write current custom.bat/sh (for build directory) OCCT_CONFIGURE ("adm/templates/custom.build.${SCRIPT_EXT}.in" "${SUB_CUSTOM_NAME}") if (BUILD_MODULE_OcctMfcSamples) - OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_DIR}") + OCCT_INSTALL_FILE_OR_DIR ("adm/templates/sample.bat" "${INSTALL_SCRIPT_DIR}") OCCT_COPY_FILE_OR_DIR ("adm/templates/sample.bat" "${CMAKE_BINARY_DIR}") endif() @@ -447,29 +546,31 @@ endif() OCCT_CONFIGURE ("adm/templates/env.build.${SCRIPT_EXT}.in" "env.${SCRIPT_EXT}") # end script for draw in standalone environment -# release version -set (BUILD_LETTER "") -OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.release.${SCRIPT_EXT}") -install (FILES "${CMAKE_BINARY_DIR}/env.install.release.${SCRIPT_EXT}" - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}" - RENAME "env.${SCRIPT_EXT}") +if (UNIX) + OCCT_CONFIGURE ("adm/templates/env.install.sh.in" "env.install.sh") + install (FILES "${CMAKE_BINARY_DIR}/env.install.sh" DESTINATION "${INSTALL_SCRIPT_DIR}" RENAME "env.sh") +else() + # release version + set (CURRENT_BUILD_LETTER "") + OCCT_CONFIGURE ("adm/templates/env.install.bat.in" "env.install.release.bat") + install (FILES "${CMAKE_BINARY_DIR}/env.install.release.bat" + CONFIGURATIONS Release + DESTINATION "${INSTALL_SCRIPT_DIR}" RENAME "env.bat") -# debug version -set (BUILD_LETTER "d") -OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.debug.${SCRIPT_EXT}") -install (FILES "${CMAKE_BINARY_DIR}/env.install.debug.${SCRIPT_EXT}" - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}" - RENAME "env.${SCRIPT_EXT}") + # debug version + set (CURRENT_BUILD_LETTER "d") + OCCT_CONFIGURE ("adm/templates/env.install.bat.in" "env.install.debug.bat") + install (FILES "${CMAKE_BINARY_DIR}/env.install.debug.bat" + CONFIGURATIONS Debug + DESTINATION "${INSTALL_SCRIPT_DIR}" RENAME "env.bat") -# release with debug info version -set (BUILD_LETTER "i") -OCCT_CONFIGURE ("adm/templates/env.install.${SCRIPT_EXT}.in" "env.install.relwithdebinfo.${SCRIPT_EXT}") -install (FILES "${CMAKE_BINARY_DIR}/env.install.relwithdebinfo.${SCRIPT_EXT}" - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}" - RENAME "env.${SCRIPT_EXT}") + # release with debug info version + set (CURRENT_BUILD_LETTER "i") + OCCT_CONFIGURE ("adm/templates/env.install.bat.in" "env.install.relwithdebinfo.bat") + install (FILES "${CMAKE_BINARY_DIR}/env.install.relwithdebinfo.bat" + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_SCRIPT_DIR}" RENAME "env.bat") +endif() # copy DrawAppliInit from OCCT source to build directory if (NOT EXISTS "${CMAKE_BINARY_DIR}/DrawAppliInit") @@ -482,9 +583,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}/src/${RESOURCE_FOLDER}") + OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_OCCT_RESOURCE_DIR}/${RESOURCE_FOLDER}") else() - OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_DIR}/src") + OCCT_INSTALL_FILE_OR_DIR ("src/${RESOURCE}" "${INSTALL_OCCT_RESOURCE_DIR}") endif() endforeach() diff --git a/adm/cmake/3rdparty_macro.cmake b/adm/cmake/3rdparty_macro.cmake index 50eaef3f35..4725b44eb5 100644 --- a/adm/cmake/3rdparty_macro.cmake +++ b/adm/cmake/3rdparty_macro.cmake @@ -191,47 +191,62 @@ macro (THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME LIBRARY_NAME_DEB OCCT_MAKE_COMPILER_SHORT_NAME() if (WIN32) - install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") - install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") - install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") - + if (DEFINED INSTALL_BIN_DIR) + install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" DESTINATION "${INSTALL_BIN_DIR}") + else() + install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + install (FILES "${3RDPARTY_${PRODUCT_NAME}_DLL}" + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() else() get_filename_component(ABS_PATH ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} REALPATH) + if ("${PRODUCT_NAME}" STREQUAL "FREEIMAGE") get_filename_component(FREEIMLIB ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME) - install (FILES "${ABS_PATH}" - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" - RENAME ${FREEIMLIB}.3) - install (FILES "${ABS_PATH}" - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" - RENAME ${FREEIMLIB}.3) - install (FILES "${ABS_PATH}" - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" - RENAME ${FREEIMLIB}.3) + + if (DEFINED INSTALL_LIB_DIR) + install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_LIB_DIR}" RENAME ${FREEIMLIB}.3) + else() + install (FILES "${ABS_PATH}" + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" + RENAME ${FREEIMLIB}.3) + install (FILES "${ABS_PATH}" + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" + RENAME ${FREEIMLIB}.3) + install (FILES "${ABS_PATH}" + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" + RENAME ${FREEIMLIB}.3) + endif() endif() + if("${PRODUCT_NAME}" STREQUAL "GL2PS") get_filename_component(GL2PSLIB ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME) - install (FILES "${ABS_PATH}" - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" - RENAME ${GL2PSLIB}.1) - install (FILES "${ABS_PATH}" - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" - RENAME ${GL2PSLIB}.1) - install (FILES "${ABS_PATH}" - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" - RENAME ${GL2PSLIB}.1) + + if (DEFINED INSTALL_LIB_DIR) + install (FILES "${ABS_PATH}" DESTINATION "${INSTALL_LIB_DIR}" RENAME ${GL2PSLIB}.1) + else() + install (FILES "${ABS_PATH}" + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" + RENAME ${GL2PSLIB}.1) + install (FILES "${ABS_PATH}" + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" + RENAME ${GL2PSLIB}.1) + install (FILES "${ABS_PATH}" + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" + RENAME ${GL2PSLIB}.1) + endif() endif() endif() else() diff --git a/adm/cmake/freetype.cmake b/adm/cmake/freetype.cmake index af81501b07..8adb7395f2 100644 --- a/adm/cmake/freetype.cmake +++ b/adm/cmake/freetype.cmake @@ -289,34 +289,44 @@ endif() # install instructions if (INSTALL_FREETYPE) - OCCT_MAKE_OS_WITH_BITNESS() + if (WIN32) - install (FILES "${3RDPARTY_FREETYPE_DLL}" - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") - install (FILES "${3RDPARTY_FREETYPE_DLL}" - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") - install (FILES "${3RDPARTY_FREETYPE_DLL}" - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + if (DEFINED INSTALL_BIN_DIR) + install (FILES "${3RDPARTY_FREETYPE_DLL}" DESTINATION "${INSTALL_BIN_DIR}") + else() + install (FILES "${3RDPARTY_FREETYPE_DLL}" + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + install (FILES "${3RDPARTY_FREETYPE_DLL}" + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + install (FILES "${3RDPARTY_FREETYPE_DLL}" + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() else() get_filename_component(3RDPARTY_FREETYPE_LIBRARY_ABS ${3RDPARTY_FREETYPE_LIBRARY} REALPATH) get_filename_component(3RDPARTY_FREETYPE_LIBRARY_NAME ${3RDPARTY_FREETYPE_LIBRARY} NAME) - install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" - RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) - install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" - RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) - install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" - RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) + if (DEFINED INSTALL_LIB_DIR) + install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" + DESTINATION "${INSTALL_LIB_DIR}" + RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) + else() + install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" + RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) + install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" + RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) + install (FILES "${3RDPARTY_FREETYPE_LIBRARY_ABS}" + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" + RENAME ${3RDPARTY_FREETYPE_LIBRARY_NAME}.6) + endif() endif() set (USED_3RDPARTY_FREETYPE_DIR "") diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake index 13cd0fd2ef..ea495b592d 100644 --- a/adm/cmake/occt_macros.cmake +++ b/adm/cmake/occt_macros.cmake @@ -274,7 +274,7 @@ macro (COLLECT_AND_INSTALL_OCCT_HEADER_FILES ROOT_TARGET_OCCT_DIR OCCT_BUILD_TOO configure_file ("${TEMPLATE_HEADER_PATH}" "${ROOT_TARGET_OCCT_DIR}/inc/${HEADER_FILE_NAME}" @ONLY) endforeach() - install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/inc") + install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_INCLUDE_DIR}") string(TIMESTAMP CURRENT_TIME "%H:%M:%S") message (STATUS "Info: \(${CURRENT_TIME}\) Checking headers in inc folder...") @@ -457,28 +457,42 @@ function (OCCT_MODULES_AND_TOOLKITS MODULE_LIST) set (${MODULE_LIST} ${${MODULE_LIST}} PARENT_SCOPE) endfunction() -# Returns OCCT version string from file Standard_Version.hxx (if available) -function (OCCT_VERSION OCCT_VERSION_VAR) - set (OCC_VERSION_COMPLETE "7.1.0") - set (OCC_VERSION_DEVELOPMENT "") - - set (OCCT_VERSION_LOCALVAR "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}") +# Returns OCC version string from file Standard_Version.hxx (if available) +function (OCC_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE OCC_VERSION_DEVELOPMENT OCC_VERSION_STRING_EXT) + set (OCC_VERSION_MAJOR 7) + set (OCC_VERSION_MINOR 0) + set (OCC_VERSION_MAINTENANCE 0) + set (OCC_VERSION_DEVELOPMENT dev) + set (OCC_VERSION_COMPLETE "7.0.0") + set (STANDARD_VERSION_FILE "${CMAKE_SOURCE_DIR}/src/Standard/Standard_Version.hxx") + if (BUILD_PATCH AND EXISTS "${BUILD_PATCH}/src/Standard/Standard_Version.hxx") + set (STANDARD_VERSION_FILE "${BUILD_PATCH}/src/Standard/Standard_Version.hxx") + endif() + if (EXISTS "${STANDARD_VERSION_FILE}") - foreach (SOUGHT_VERSION OCC_VERSION_COMPLETE OCC_VERSION_DEVELOPMENT) + foreach (SOUGHT_VERSION OCC_VERSION_MAJOR OCC_VERSION_MINOR OCC_VERSION_MAINTENANCE) + file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*") + string (REGEX REPLACE ".*${SOUGHT_VERSION} .*([^ ]+).*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" ) + endforeach() + + foreach (SOUGHT_VERSION OCC_VERSION_DEVELOPMENT OCC_VERSION_COMPLETE) file (STRINGS "${STANDARD_VERSION_FILE}" ${SOUGHT_VERSION} REGEX "^#define ${SOUGHT_VERSION} .*") string (REGEX REPLACE ".*${SOUGHT_VERSION} .*\"([^ ]+)\".*" "\\1" ${SOUGHT_VERSION} "${${SOUGHT_VERSION}}" ) endforeach() - - if (NOT "${OCC_VERSION_DEVELOPMENT}" STREQUAL "") - set (OCCT_VERSION_LOCALVAR "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}") - else() - set (OCCT_VERSION_LOCALVAR "${OCC_VERSION_COMPLETE}") - endif() endif() - - set (${OCCT_VERSION_VAR} "${OCCT_VERSION_LOCALVAR}" PARENT_SCOPE) + + set (OCC_VERSION_MAJOR "${OCC_VERSION_MAJOR}" PARENT_SCOPE) + set (OCC_VERSION_MINOR "${OCC_VERSION_MINOR}" PARENT_SCOPE) + set (OCC_VERSION_MAINTENANCE "${OCC_VERSION_MAINTENANCE}" PARENT_SCOPE) + set (OCC_VERSION_DEVELOPMENT "${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE) + + if (OCC_VERSION_DEVELOPMENT AND OCC_VERSION_COMPLETE) + set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}.${OCC_VERSION_DEVELOPMENT}" PARENT_SCOPE) + else() + set (OCC_VERSION_STRING_EXT "${OCC_VERSION_COMPLETE}" PARENT_SCOPE) + endif() endfunction() macro (CHECK_PATH_FOR_CONSISTENCY THE_ROOT_PATH_NAME THE_BEING_CHECKED_PATH_NAME THE_VAR_TYPE THE_MESSAGE_OF_BEING_CHECKED_PATH) diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake index 910d7e2d7b..329a9f6a10 100644 --- a/adm/cmake/occt_toolkit.cmake +++ b/adm/cmake/occt_toolkit.cmake @@ -130,37 +130,46 @@ endif() if ("${PROJECT_NAME}" STREQUAL "DRAWEXE") add_executable (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE}) - install (TARGETS ${PROJECT_NAME} - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") - install (TARGETS ${PROJECT_NAME} - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") - install (TARGETS ${PROJECT_NAME} - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + if (DEFINED INSTALL_BIN_DIR) + install (TARGETS ${PROJECT_NAME} DESTINATION "${INSTALL_BIN_DIR}") + else() + install (TARGETS ${PROJECT_NAME} + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + install (TARGETS ${PROJECT_NAME} + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + install (TARGETS ${PROJECT_NAME} + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() else() add_library (${PROJECT_NAME} ${USED_SRCFILES} ${USED_INCFILES} ${USED_RCFILE}) - install (TARGETS ${PROJECT_NAME} - CONFIGURATIONS Release - RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin" - ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" - LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") - install (TARGETS ${PROJECT_NAME} - CONFIGURATIONS RelWithDebInfo - RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini" - ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" - LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") - install (TARGETS ${PROJECT_NAME} - CONFIGURATIONS Debug - RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind" - ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" - LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") - if (MSVC) - install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb + if (DEFINED INSTALL_LIB_DIR) + install (TARGETS ${PROJECT_NAME} DESTINATION "${INSTALL_LIB_DIR}") + else() + install (TARGETS ${PROJECT_NAME} + CONFIGURATIONS Release + RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin" + ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" + LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + install (TARGETS ${PROJECT_NAME} + CONFIGURATIONS RelWithDebInfo + RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini" + ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" + LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") + install (TARGETS ${PROJECT_NAME} CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + RUNTIME DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind" + ARCHIVE DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" + LIBRARY DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") + + if (MSVC) + install (FILES ${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind/${PROJECT_NAME}.pdb + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() endif() endif() @@ -173,10 +182,16 @@ foreach (OCCT_MODULE ${OCCT_MODULES}) endforeach() if (CURRENT_MODULE) - set_property (TARGET ${PROJECT_NAME} PROPERTY FOLDER "Modules/${CURRENT_MODULE}") + set_target_properties (${PROJECT_NAME} PROPERTIES FOLDER "Modules/${CURRENT_MODULE}") endif() -set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}") +get_property (OCC_VERSION_MAJOR GLOBAL PROPERTY OCC_VERSION_MAJOR) +get_property (OCC_VERSION_MINOR GLOBAL PROPERTY OCC_VERSION_MINOR) +get_property (OCC_VERSION_MAINTENANCE GLOBAL PROPERTY OCC_VERSION_MAINTENANCE) + +set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${PRECOMPILED_DEFS}" + SOVERSION "${OCC_VERSION_MAJOR}" + VERSION "${OCC_VERSION_MAJOR}.${OCC_VERSION_MINOR}.${OCC_VERSION_MAINTENANCE}") set (USED_TOOLKITS_BY_CURRENT_PROJECT) set (USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT) diff --git a/adm/cmake/tbb.cmake b/adm/cmake/tbb.cmake index 9794517cc5..7bcde73c69 100644 --- a/adm/cmake/tbb.cmake +++ b/adm/cmake/tbb.cmake @@ -236,30 +236,40 @@ macro (TBB_PRODUCT_SEARCH PRODUCT_NAME) OCCT_MAKE_COMPILER_SHORT_NAME() if (WIN32) - install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") - install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") - install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + if (DEFINED INSTALL_BIN_DIR) + install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} DESTINATION "${INSTALL_BIN_DIR}") + else() + install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + install (FILES ${3RDPARTY_${PRODUCT_NAME}_DLL} + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() else() get_filename_component (PRODUCT_LIBRARY_NAME ${3RDPARTY_${PRODUCT_NAME}_LIBRARY} NAME) - install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" - RENAME ${PRODUCT_LIBRARY_NAME}.2) - install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" - RENAME ${PRODUCT_LIBRARY_NAME}.2) - install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" - RENAME ${PRODUCT_LIBRARY_NAME}.2) + if (DEFINED INSTALL_LIB_DIR) + install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 + DESTINATION "${INSTALL_LIB_DIR}" + RENAME ${PRODUCT_LIBRARY_NAME}.2) + else() + install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib" + RENAME ${PRODUCT_LIBRARY_NAME}.2) + install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi" + RENAME ${PRODUCT_LIBRARY_NAME}.2) + install (FILES ${3RDPARTY_${PRODUCT_NAME}_LIBRARY}.2 + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd" + RENAME ${PRODUCT_LIBRARY_NAME}.2) + endif() endif() endif() mark_as_advanced (3RDPARTY_${PRODUCT_NAME}_LIBRARY 3RDPARTY_${PRODUCT_NAME}_DLL) diff --git a/adm/cmake/tcl.cmake b/adm/cmake/tcl.cmake index f6e9822924..8d9ff9c718 100644 --- a/adm/cmake/tcl.cmake +++ b/adm/cmake/tcl.cmake @@ -203,32 +203,47 @@ if (INSTALL_TCL) # collect and install all dlls from tcl dll dirs file (GLOB TCL_DLLS "${3RDPARTY_TCL_DLL_DIR}/*.dll") - install (FILES ${TCL_DLLS} - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") - install (FILES ${TCL_DLLS} - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") - install (FILES ${TCL_DLLS} - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + + if (DEFINED INSTALL_BIN_DIR) + install (FILES ${TCL_DLLS} DESTINATION "${INSTALL_BIN_DIR}") + else() + install (FILES ${TCL_DLLS} + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + install (FILES ${TCL_DLLS} + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + install (FILES ${TCL_DLLS} + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() else() get_filename_component(3RDPARTY_TCL_LIBRARY_REALPATH ${3RDPARTY_TCL_LIBRARY} REALPATH) - install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") - install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") - install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") + + if (DEFINED INSTALL_LIB_DIR) + install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} DESTINATION "${INSTALL_LIB_DIR}") + else() + install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") + install (FILES ${3RDPARTY_TCL_LIBRARY_REALPATH} + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") + endif() endif() if (TCL_TCLSH_VERSION) # tcl is required to install in lib folder (without) - install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") - install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + if (DEFINED INSTALL_LIB_DIR) + install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_LIB_DIR}") + install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_LIB_DIR}") + else() + install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl8" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + install (DIRECTORY "${3RDPARTY_TCL_LIBRARY_DIR}/tcl${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + endif() else() message (STATUS "\nWarning: tclX.X subdir won't be copyied during the installation process.") message (STATUS "Try seeking tcl within another folder by changing 3RDPARTY_TCL_DIR variable.") diff --git a/adm/cmake/tk.cmake b/adm/cmake/tk.cmake index 3fb67e6af4..d0343dc487 100644 --- a/adm/cmake/tk.cmake +++ b/adm/cmake/tk.cmake @@ -207,31 +207,45 @@ if (INSTALL_TK) # collect and install all dlls from tk dll dirs file (GLOB TK_DLLS "${3RDPARTY_TK_DLL_DIR}/*.dll") - install (FILES ${TK_DLLS} - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") - install (FILES ${TK_DLLS} - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") - install (FILES ${TK_DLLS} - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + + if (DEFINED INSTALL_BIN_DIR) + install (FILES ${TK_DLLS} DESTINATION "${INSTALL_BIN_DIR}") + else() + install (FILES ${TK_DLLS} + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + install (FILES ${TK_DLLS} + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + install (FILES ${TK_DLLS} + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") + endif() else() get_filename_component(3RDPARTY_TK_LIBRARY_REALPATH ${3RDPARTY_TK_LIBRARY} REALPATH) - install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} - CONFIGURATIONS Release - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") - install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} - CONFIGURATIONS RelWithDebInfo - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") - install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} - CONFIGURATIONS Debug - DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") + + if (DEFINED INSTALL_LIB_DIR) + install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} DESTINATION "${INSTALL_LIB_DIR}") + else() + install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} + CONFIGURATIONS Release + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} + CONFIGURATIONS RelWithDebInfo + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libi") + install (FILES ${3RDPARTY_TK_LIBRARY_REALPATH} + CONFIGURATIONS Debug + DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") + endif() endif() if (TCL_TCLSH_VERSION) # tk is required to install in lib folder (without) - install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + if (DEFINED INSTALL_LIB_DIR) + install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_LIB_DIR}") + else() + install (DIRECTORY "${3RDPARTY_TK_LIBRARY_DIR}/tk${TCL_TCLSH_VERSION}" DESTINATION "${INSTALL_DIR}/${OS_WITH_BIT}/${COMPILER}/lib") + endif() else() message (STATUS "\nWarning: tkX.X subdir won't be copyied during the installation process.") message (STATUS "Try seeking tk within another folder by changing 3RDPARTY_TK_DIR variable.") diff --git a/adm/templates/custom.install.sh.in b/adm/templates/custom.install.sh.in index 5c0aa7fa8b..c48a023049 100644 --- a/adm/templates/custom.install.sh.in +++ b/adm/templates/custom.install.sh.in @@ -1,7 +1,7 @@ #!/bin/bash -if [ "$COMPILER" == "@COMPILER@" ]; then - if [ "$ARCH" == "@COMPILER_BITNESS@" ]; then +if [ "$1" == "@COMPILER@" ]; then + if [ "$2" == "@COMPILER_BITNESS@" ]; then export TCL_DIR="@USED_3RDPARTY_TCL_DIR@" export TK_DIR="@USED_3RDPARTY_TK_DIR@" export FREETYPE_DIR="@USED_3RDPARTY_FREETYPE_DIR@" @@ -9,6 +9,32 @@ if [ "$COMPILER" == "@COMPILER@" ]; then export GL2PS_DIR="@USED_3RDPARTY_GL2PS_DIR@" export TBB_DIR="@USED_3RDPARTY_TBB_DIR@" export VTK_DIR="@USED_3RDPARTY_VTK_DIR@" + + export BIN_PATH="@INSTALL_BIN_DIR@" + if [ "$BIN_PATH" != "" ]; then + export PATH="${BIN_PATH}:${PATH}" + fi + + export LIB_PATH="@INSTALL_LIB_DIR@" + if [ "$LIB_PATH" != "" ]; then + if [ "$LD_LIBRARY_PATH" != "" ]; then + export LD_LIBRARY_PATH="${LIB_PATH}:${LD_LIBRARY_PATH}" + else + export LD_LIBRARY_PATH="${LIB_PATH}" + fi + fi + + export OCCT_RESOURCE_PATH="${CASROOT}/src" + if [ "@INSTALL_OCCT_RESOURCE_DIR@" != "" ]; then + export OCCT_RESOURCE_PATH="@INSTALL_OCCT_RESOURCE_DIR@" + fi + + # required for set default testing environment + # and "Samples" window creation in DRAW + export OCCT_SHARE_PATH="${CASROOT}" + if [ "@INSTALL_SHARE_DIR@" != "" ]; then + export OCCT_SHARE_PATH="@INSTALL_SHARE_DIR@" + fi fi fi diff --git a/adm/templates/draw.sh b/adm/templates/draw.sh index 49e54364fa..5dc0f24e62 100755 --- a/adm/templates/draw.sh +++ b/adm/templates/draw.sh @@ -2,7 +2,7 @@ aScriptPath=${BASH_SOURCE%/*}; if [ -d "${aScriptPath}" ]; then cd "$aScriptPath"; fi; aScriptPath="$PWD"; -source "${aScriptPath}/env.sh" "$1" "$2" +source "${aScriptPath}/env.sh" "$1" echo 'Hint: use "pload ALL" command to load standard commands' DRAWEXE diff --git a/adm/templates/env.install.bat.in b/adm/templates/env.install.bat.in index 4cf0332e11..5739c02296 100644 --- a/adm/templates/env.install.bat.in +++ b/adm/templates/env.install.bat.in @@ -5,7 +5,7 @@ set "SCRIPTROOT=%SCRIPTROOT:~0,-1%" set "VCVER=@COMPILER@" set "ARCH=@COMPILER_BITNESS@" -set "CASDEB=@BUILD_LETTER@" +set "CASDEB=@CURRENT_BUILD_LETTER@" if not ["%1"] == [""] set "VCVER=%1" if not ["%2"] == [""] set "ARCH=%2" diff --git a/adm/templates/env.install.sh.in b/adm/templates/env.install.sh.in index 07eb2d2f41..5701f19338 100644 --- a/adm/templates/env.install.sh.in +++ b/adm/templates/env.install.sh.in @@ -35,7 +35,7 @@ fi # ----- Set local settings ----- if [ -e "${aScriptPath}/custom.sh" ]; then - source "${aScriptPath}/custom.sh" "${COMPILER}" "${WOKSTATION}${ARCH}" "${CASDEB}" + source "${aScriptPath}/custom.sh" "${COMPILER}" "${ARCH}" fi THRDPARTY_PATH="" @@ -76,15 +76,10 @@ if [ "$TK_DIR" != "$TCL_DIR" ]; then fi fi -BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}" -LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}" - -export PATH="${CASROOT}/${BIN_PATH}:${PATH}" - if [ "$LD_LIBRARY_PATH" != "" ]; then - export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}" + export LD_LIBRARY_PATH="${THRDPARTY_PATH}:${LD_LIBRARY_PATH}" else - export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}" + export LD_LIBRARY_PATH="${THRDPARTY_PATH}" fi if [ "$WOKSTATION" == "mac" ]; then @@ -99,34 +94,34 @@ fi export CSF_LANGUAGE=us export MMGT_CLEAR=1 export CSF_EXCEPTION_PROMPT=1 -export CSF_SHMessage="${CASROOT}/src/SHMessage" -export CSF_MDTVTexturesDirectory="${CASROOT}/src/Textures" -export CSF_ShadersDirectory="${CASROOT}/src/Shaders" -export CSF_XSMessage="${CASROOT}/src/XSMessage" -export CSF_TObjMessage="${CASROOT}/src/TObj" -export CSF_StandardDefaults="${CASROOT}/src/StdResource" -export CSF_PluginDefaults="${CASROOT}/src/StdResource" -export CSF_XCAFDefaults="${CASROOT}/src/StdResource" -export CSF_TObjDefaults="${CASROOT}/src/StdResource" -export CSF_StandardLiteDefaults="${CASROOT}/src/StdResource" -export CSF_UnitsLexicon="${CASROOT}/src/UnitsAPI/Lexi_Expr.dat" -export CSF_UnitsDefinition="${CASROOT}/src/UnitsAPI/Units.dat" -export CSF_IGESDefaults="${CASROOT}/src/XSTEPResource" -export CSF_STEPDefaults="${CASROOT}/src/XSTEPResource" -export CSF_XmlOcafResource="${CASROOT}/src/XmlOcafResource" -export CSF_MIGRATION_TYPES="${CASROOT}/src/StdResource/MigrationSheet.txt" +export CSF_SHMessage="${OCCT_RESOURCE_PATH}/SHMessage" +export CSF_MDTVTexturesDirectory="${OCCT_RESOURCE_PATH}/Textures" +export CSF_ShadersDirectory="${OCCT_RESOURCE_PATH}/Shaders" +export CSF_XSMessage="${OCCT_RESOURCE_PATH}/XSMessage" +export CSF_TObjMessage="${OCCT_RESOURCE_PATH}/TObj" +export CSF_StandardDefaults="${OCCT_RESOURCE_PATH}/StdResource" +export CSF_PluginDefaults="${OCCT_RESOURCE_PATH}/StdResource" +export CSF_XCAFDefaults="${OCCT_RESOURCE_PATH}/StdResource" +export CSF_TObjDefaults="${OCCT_RESOURCE_PATH}/StdResource" +export CSF_StandardLiteDefaults="${OCCT_RESOURCE_PATH}/StdResource" +export CSF_UnitsLexicon="${OCCT_RESOURCE_PATH}/UnitsAPI/Lexi_Expr.dat" +export CSF_UnitsDefinition="${OCCT_RESOURCE_PATH}/UnitsAPI/Units.dat" +export CSF_IGESDefaults="${OCCT_RESOURCE_PATH}/XSTEPResource" +export CSF_STEPDefaults="${OCCT_RESOURCE_PATH}/XSTEPResource" +export CSF_XmlOcafResource="${OCCT_RESOURCE_PATH}/XmlOcafResource" +export CSF_MIGRATION_TYPES="${OCCT_RESOURCE_PATH}/StdResource/MigrationSheet.txt" # Draw Harness special stuff -if [ -e "${CASROOT}/src/DrawResources" ]; then - export DRAWHOME="${CASROOT}/src/DrawResources" - export CSF_DrawPluginDefaults="${CASROOT}/src/DrawResources" +if [ -e "${OCCT_RESOURCE_PATH}/DrawResources" ]; then + export DRAWHOME="${OCCT_RESOURCE_PATH}/DrawResources" + export CSF_DrawPluginDefaults="${OCCT_RESOURCE_PATH}/DrawResources" - if [ -e "${CASROOT}/src/DrawResources/DrawDefault" ]; then - export DRAWDEFAULT="${CASROOT}/src/DrawResources/DrawDefault" + if [ -e "${OCCT_RESOURCE_PATH}/DrawResources/DrawDefault" ]; then + export DRAWDEFAULT="${OCCT_RESOURCE_PATH}/DrawResources/DrawDefault" fi fi -if [ -e "${CASROOT}/src/DrawResourcesProducts" ]; then - export CSF_DrawPluginProductsDefaults="${CASROOT}/src/DrawResourcesProducts" +if [ -e "${OCCT_RESOURCE_PATH}/DrawResourcesProducts" ]; then + export CSF_DrawPluginProductsDefaults="${OCCT_RESOURCE_PATH}/DrawResourcesProducts" fi diff --git a/dox/CMakeLists.txt b/dox/CMakeLists.txt index a2aa89b739..4e64e34d70 100644 --- a/dox/CMakeLists.txt +++ b/dox/CMakeLists.txt @@ -37,12 +37,10 @@ set (OCCT_CONFIG_FOR_DOXYGEN "${OCCT_GENERATED_DOC_DIR}/occt.cfg") set (3RDPARTY_MATHJAX_RELATIVE_PATH "http://cdn.mathjax.org/mathjax/latest") -OCCT_VERSION (OCCT_SOURCE_VERSION) - configure_file ("${OCCT_OVERVIEW_RESOURCE_DIR}/occt_ug_html.doxyfile" "${OCCT_CONFIG_FOR_DOXYGEN}" COPYONLY) # Add common options for generation of Overview and User Guides -file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_NUMBER = ${OCCT_SOURCE_VERSION}") +file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_NUMBER = ${OCC_VERSION_STRING_EXT}") file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nOUTPUT_DIRECTORY = ${OCCT_GENERATED_OVERVIEW_DIR}/.") file (APPEND ${OCCT_CONFIG_FOR_DOXYGEN} "\nPROJECT_LOGO = ${OCCT_OVERVIEW_DIR}/resources/occ_logo.png") diff --git a/src/DrawResources/DrawDefault b/src/DrawResources/DrawDefault index a70e3ae7cc..47fe8c10f3 100755 --- a/src/DrawResources/DrawDefault +++ b/src/DrawResources/DrawDefault @@ -59,17 +59,34 @@ if { [file isdirectory $dir] } { } # set default testing environment +if {[array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != ""} { + if {[file isdirectory $env(OCCT_SHARE_PATH)/tests]} { + if { ! [info exists env(CSF_TestScriptsPath)] } { + set env(CSF_TestScriptsPath) $env(OCCT_SHARE_PATH)/tests + } else { + set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(OCCT_SHARE_PATH)/tests + } + } + + if {[file isdirectory $env(OCCT_SHARE_PATH)/data]} { + if { ! [info exists env(CSF_TestDataPath)] } { + set env(CSF_TestDataPath) $env(OCCT_SHARE_PATH)/data + } else { + set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(OCCT_SHARE_PATH)/data + } + } +} if { [info exists env(CASROOT)] && [file isdirectory $env(CASROOT)/tests] } { - if { ! [info exists env(CSF_TestScriptsPath)] } { - set env(CSF_TestScriptsPath) $env(CASROOT)/tests - } else { - set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(CASROOT)/tests - } - if { ! [info exists env(CSF_TestDataPath)] } { - set env(CSF_TestDataPath) $env(CASROOT)/data - } else { - set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data - } + if { ! [info exists env(CSF_TestScriptsPath)] } { + set env(CSF_TestScriptsPath) $env(CASROOT)/tests + } else { + set env(CSF_TestScriptsPath) $env(CSF_TestScriptsPath)[_path_separator]$env(CASROOT)/tests + } + if { ! [info exists env(CSF_TestDataPath)] } { + set env(CSF_TestDataPath) $env(CASROOT)/data + } else { + set env(CSF_TestDataPath) $env(CSF_TestDataPath)[_path_separator]$env(CASROOT)/data + } } # load application-defined initialization script, which is expected to diff --git a/src/DrawResources/DrawTK.tcl b/src/DrawResources/DrawTK.tcl index 9e75673125..f205e37777 100644 --- a/src/DrawResources/DrawTK.tcl +++ b/src/DrawResources/DrawTK.tcl @@ -29,7 +29,12 @@ if { [info exists tk_library] } { #fills menu "Load" with submenus proc fillloadmenu {} { - set chan [open [file nativename $::env(CASROOT)/src/DrawResources/DrawPlugin]] + set drawplugpath "$::env(CASROOT)/src/DrawResources/DrawPlugin" + if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/DrawPlugin]} { + set drawplugpath "$::env(OCCT_RESOURCE_PATH)/DrawResources/DrawPlugin" + } + + set chan [open [file nativename $drawplugpath]] while {[gets $chan line] >= 0} { if {[lindex [split $line ""] 0] != "!"} { if {[lindex [split $line ""] 0] == ""} {continue} @@ -230,8 +235,14 @@ proc vsource {} { proc vsamples {} { #create list {{category} {title} {filename}} set alistofthree "" - foreach fname [file nativename [glob -path $::env(CASROOT)/samples/tcl/ *]] { - if {[lindex [split $fname "."] end] != "tcl"} {continue} + + set samplespath "$::env(CASROOT)/samples/tcl/" + if { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != "" && [file exists $::env(OCCT_SHARE_PATH)/samples/tcl/]} { + set samplespath "$::env(OCCT_SHARE_PATH)/samples/tcl/" + } + + foreach fname [glob -path "${samplespath}" *.tcl] { + set chan [open $fname] set istitlefound 0 while {[gets $chan line] >= 0} { @@ -394,7 +405,13 @@ proc about {} { set screenheight [expr {int([winfo screenheight .]*0.5-200)}] set screenwidth [expr {int([winfo screenwidth .]*0.5-200)}] wm geometry .about 400x200+$screenwidth+$screenheight - image create photo occlogo -file $::env(CASROOT)/src/DrawResources/OCC_logo.png -format png + + set logopath "$::env(CASROOT)/src/DrawResources/OCC_logo.png" + if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/OCC_logo.png]} { + set logopath "$::env(OCCT_RESOURCE_PATH)/DrawResources/OCC_logo.png" + } + + image create photo occlogo -file $logopath -format png frame .about.logo -bg red frame .about.links -bg blue frame .about.copyright @@ -445,13 +462,17 @@ proc _launchBrowser {url} { # Else opens a site with this guide ################################################################ proc openuserguide {} { - if [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf] { - _launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf + if { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != "" && [file exists $::env(OCCT_SHARE_PATH)/doc/pdf/user_guides/occt_test_harness.pdf]} { + _launchBrowser $::env(OCCT_SHARE_PATH)/doc/pdf/user_guides/occt_test_harness.pdf + } elseif { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != "" && [file exists $::env(OCCT_SHARE_PATH)/doc/overview/html/occt_user_guides__test_harness.html]} { + _launchBrowser $::env(OCCT_SHARE_PATH)/doc/overview/html/occt_user_guides__test_harness.html + } elseif [file exists $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf] { + _launchBrowser $::env(CASROOT)/doc/pdf/user_guides/occt_test_harness.pdf } elseif [file exists $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html] { - _launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html + _launchBrowser $::env(CASROOT)/doc/overview/html/occt_user_guides__test_harness.html } else { - _launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html} - } + launchBrowser {http://dev.opencascade.org/doc/overview/html/occt_user_guides__test_harness.html} + } } #Search through commands and display the result diff --git a/src/DrawResources/TKTopTest.tcl b/src/DrawResources/TKTopTest.tcl index e005222bf7..43b701e0ec 100644 --- a/src/DrawResources/TKTopTest.tcl +++ b/src/DrawResources/TKTopTest.tcl @@ -12,5 +12,16 @@ # commercial license or contractual agreement. set Draw_GEOMETRY 1 -source $env(CASROOT)/src/DrawResources/CURVES.tcl -source $env(CASROOT)/src/DrawResources/SURFACES.tcl + +if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/CURVES.tcl]} { + source $env(OCCT_RESOURCE_PATH)/DrawResources/CURVES.tcl +} else { + source $env(CASROOT)/src/DrawResources/CURVES.tcl +} + +if {[array names ::env OCCT_RESOURCE_PATH] != "" && "$::env(OCCT_RESOURCE_PATH)" != "" && [file exists $::env(OCCT_RESOURCE_PATH)/DrawResources/SURFACES.tcl]} { + source $env(OCCT_RESOURCE_PATH)/DrawResources/SURFACES.tcl +} else { + source $env(CASROOT)/src/DrawResources/SURFACES.tcl +} + diff --git a/src/DrawResources/TestCommands.tcl b/src/DrawResources/TestCommands.tcl index 5856350a44..5fca3ebacd 100644 --- a/src/DrawResources/TestCommands.tcl +++ b/src/DrawResources/TestCommands.tcl @@ -251,6 +251,11 @@ proc testgrid {args} { set prefix "${branch}_" } set logdir "results/${prefix}[clock format [clock seconds] -format {%Y-%m-%dT%H%M}]" + + if { [array names ::env OCCT_SHARE_PATH] != "" && "$::env(OCCT_SHARE_PATH)" != ""} { + set logdir "$::env(OCCT_SHARE_PATH)/${logdir}" + } + set logdir [file normalize $logdir] } if { [file isdirectory $logdir] && ! $overwrite && ! [catch {glob -directory $logdir *}] } { diff --git a/src/MAT2d/MAT2d_Tool2d.cxx b/src/MAT2d/MAT2d_Tool2d.cxx index 90c287a0b1..f3d8c16801 100644 --- a/src/MAT2d/MAT2d_Tool2d.cxx +++ b/src/MAT2d/MAT2d_Tool2d.cxx @@ -1082,7 +1082,7 @@ void MAT2d_Tool2d::Dump(const Standard_Integer bisector, if(bisector == -1) return; if(bisector > theNumberOfBisectors) return; - Handle(Geom2d_Curve) thebisector = GeomBis(bisector).Value(); + Handle(Geom2d_Curve) thebisector = Handle(Geom2d_Curve)::DownCast(GeomBis(bisector).Value()); MAT2d_DrawCurve(thebisector,3);