From c4d4fceaa7751fafc74a3e1037ab9f3f7c87f943 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 8 Oct 2020 16:50:37 +0300 Subject: [PATCH] 0031824: Samples - Code is not displayed in Qt OCCT Overview sample after compilation by CMake --- CMakeLists.txt | 35 ++++++++++++++++++++++------------- adm/templates/sample.bat | 2 +- adm/templates/sample.sh | 4 ++-- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0dccd4b7af..a68900ddf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,7 +101,7 @@ if (BUILD_USE_PCH) # Load Cotire tool for accelerating build procedure include(cotire) - # Set Cotire to ignore lxx, pxx, gxx + # Set Cotire to ignore lxx, pxx, gxx set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS "lxx;pxx;gxx" CACHE STRING "Set Cotire to ignore OCCT specific files that can be #included" FORCE) # Set priority for inclusion of system headers in PCH to reduce problems @@ -165,7 +165,7 @@ if (NOT DEFINED CMAKE_INSTALL_PREFIX_PREV) elseif (NOT "${CMAKE_INSTALL_PREFIX_PREV}" STREQUAL "${CMAKE_INSTALL_PREFIX}") # CMAKE_INSTALL_PREFIX has been changed at previous step set (CMAKE_INSTALL_PREFIX_PREV "${CMAKE_INSTALL_PREFIX}" CACHE INTERNAL "" FORCE) - + # INSTALL_DIR is required to be updated set (INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "${INSTALL_DIR_DESCR}" FORCE) endif() @@ -177,10 +177,10 @@ elseif (NOT "${INSTALL_DIR_PREV}" STREQUAL "${INSTALL_DIR}") # INSTALL_DIR has been changed at previous step set (INSTALL_DIR_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) - # sync CMAKE_INSTALL_PREFIX with INSTALL_DIR + # sync CMAKE_INSTALL_PREFIX with INSTALL_DIR set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) - # set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder + # set CMAKE_INSTALL_PREFIX_PREV to avoid the reset of structure of the install folder set (CMAKE_INSTALL_PREFIX_PREV "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) endif() @@ -406,7 +406,7 @@ if (NOT DEFINED BUILD_DOC_Overview) set (DO_ONLY_CHECK_FOR_DOXYGEN ON) OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/doxygen") set (DO_ONLY_CHECK_FOR_DOXYGEN OFF) - + if (CAN_DOXYGEN_BE_USED) message (STATUS "Info. Overview building is turned on") endif() @@ -495,7 +495,7 @@ OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf") if (USE_TCL) message (STATUS "Info: TCL is used by OCCT") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tcl") - + message (STATUS "Info: TK is used by OCCT") OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tk") else() @@ -523,7 +523,7 @@ if (USE_VTK) OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk") else() OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK") - + if (NOT CAN_USE_VTK EQUAL -1) message (STATUS "Info: TKIVtk and TKIVtkDraw toolkits excluded due to VTK usage is disabled") @@ -694,14 +694,14 @@ else() OCCT_CHECK_AND_UNSET ("3RDPARTY_DOT_EXECUTABLE") endif() -# bison +# bison if (BUILD_YACCLEX) OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/bison") else() OCCT_CHECK_AND_UNSET ("3RDPARTY_BISON_EXECUTABLE") endif() -# flex +# flex if (BUILD_YACCLEX) OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/flex") else() @@ -780,7 +780,7 @@ set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${ set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/libd") -if (WIN32) +if (WIN32) set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") @@ -849,11 +849,11 @@ if (INSTALL_SAMPLES) OCCT_INSTALL_FILE_OR_DIR ("samples/java" "${INSTALL_DIR_SAMPLES}") OCCT_INSTALL_FILE_OR_DIR ("samples/ocafsamples" "${INSTALL_DIR_SAMPLES}") OCCT_INSTALL_FILE_OR_DIR ("samples/qt" "${INSTALL_DIR_SAMPLES}") - OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code" "${INSTALL_DIR_SAMPLES}/OCCTOverview") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code" "${INSTALL_DIR_SAMPLES}/OCCTOverview") install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/FuncDemo" RENAME "env.${SCRIPT_EXT}") install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/IESample" RENAME "env.${SCRIPT_EXT}") - install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/OCCTOverview" RENAME "env.${SCRIPT_EXT}") + install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/OCCTOverview" RENAME "env.${SCRIPT_EXT}") install (FILES "${CMAKE_BINARY_DIR}/env.samples.${SCRIPT_EXT}" DESTINATION "${INSTALL_DIR_SAMPLES}/qt/Tutorial" RENAME "env.${SCRIPT_EXT}") endif() @@ -967,6 +967,15 @@ if (BUILD_SAMPLES_QT) OCCT_INSTALL_FILE_OR_DIR ("samples/${RESOURCE}" "${INSTALL_DIR_RESOURCE}/samples") #message("Copy Sample resources: samples/${RESOURCE} into ${INSTALL_DIR_RESOURCE}/samples") endforeach() + + ## Copy sources of OCCTOverview for using in the sample + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/DataExchangeSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/OcafSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/GeometrySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/TopologySamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/TriangulationSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/Viewer2dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") + OCCT_INSTALL_FILE_OR_DIR ("samples/OCCTOverview/code/Viewer3dSamples.cxx" "${INSTALL_DIR_SAMPLES}/OCCTOverview/code") endif() @@ -1184,7 +1193,7 @@ foreach (OCCT_MODULE ${OCCT_MODULES_ENABLED}) install(EXPORT OpenCASCADE${OCCT_MODULE}Targets DESTINATION "${INSTALL_DIR_CMAKE}") endforeach() -# Update generated OpenCASCADETargets-*.cmake files +# Update generated OpenCASCADETargets-*.cmake files # to have correct paths to libraries depending on the configuration OCCT_UPDATE_TARGET_FILE () diff --git a/adm/templates/sample.bat b/adm/templates/sample.bat index 63b79cc876..576984ed8a 100644 --- a/adm/templates/sample.bat +++ b/adm/templates/sample.bat @@ -37,7 +37,7 @@ if not exist "%EXE_PATH%" ( ) rem Set path to location where sample code is installed -set "CSF_OCCTOverviewSampleCodePath=%~dp0samples\OCCTOverview\code" +set "CSF_OCCTOverviewSampleCodePath=%CSF_OCCTSamplesPath%\OCCTOverview\code" "%EXE_PATH%" diff --git a/adm/templates/sample.sh b/adm/templates/sample.sh index 1d6b75055b..5ed26b9418 100644 --- a/adm/templates/sample.sh +++ b/adm/templates/sample.sh @@ -32,7 +32,7 @@ if [ ! -f "$EXE_PATH" ]; then exit 1 fi -export CSF_OCCTOverviewSampleCodePath="${aCurrentPath}/samples/qt/OCCTOverview/code" +export CSF_OCCTOverviewSampleCodePath="${CSF_OCCTSamplesPath}/OCCTOverview/code" cd ${aCurrentPath} -"$EXE_PATH" \ No newline at end of file +"$EXE_PATH"