View Issue Details

IDProjectCategoryView StatusLast Update
0032035CommunityOCCT:Configurationpublic2023-08-07 15:53
Reporterefferre79 Assigned Tobugmaster  
PrioritynormalSeveritymajor 
Status closedResolutionfixed 
PlatformLinuxOSGentoo 
Product Version7.4.0 
Target VersionUnscheduled 
Summary0032035: Configuration - bug in OpenCASCADEConfig.cmake when using INSTALL_DIR_CMAKE
Descriptionwhen using INSTALL_DIR_CMAKE during the configuration phase, it's possible to change the installation location of cmake files

OpenCASCADEConfig.cmake defines opencascade installation root (variable) OpenCASCADE_INSTALL_PREFIX starting from the path of cmake file itself by assuming the cmake file is installed below the same path of the include and lib files. This is true only in the case INSTALL_DIR_CMAKE is not defined externally

the result is that find_package(OpenCASCADE) sets wrong OpenCASCADE_*_DIR variables in 3rd part cmake files trying to look for opencascade

The same applies for latest 7.5.0.
Steps To Reproduceconfigure opencascade by using
$ cmake -DINSTALL_DIR_CMAKE=/usr/lib64/cmake 
TagsNo tags attached.
Test case number

Relationships

related to 0032046 assigneddpasukhi Configuration - CMake Installs .lib files to libd instead of lib on Windows 

Activities

bugmaster

2021-01-11 14:45

administrator   ~0098068

Hi,

INSTALL_DIR_... variables set location of folders cmake, doc, samples, etc relative INSTALL_DIR variable.
If you really need to redefine INSTALL_DIR_CMAKE externally use relative paths.

efferre79

2021-01-12 15:23

reporter   ~0098094

I am working under Linux

The cmake files are found on typical locations as indicated in https://cmake.org/cmake/help/latest/command/find_package.html so it's better to install below /usr/lib${LIB_SUFFIX}/cmake/opencascade-${VERSION}.

I am trying to create an installation where there are many parallel versions of opencascade available, the simplest way is to install everything under a separate directory but the cmake files which should be installed as explained above (in the past the root path was something like /usr/lib64/opencascade-7.4.0/ros). Alternatively by using -DINSTALL_DIR_WITH_VERSION=ON it's possible to install in the default destination (e.g. below /usr) but there are some files which are not versioned, e.g. some binaries

/usr/bin/custom.sh
/usr/bin/custom_gcc_64.sh
/usr/bin/draw.sh
/usr/bin/env.sh
/usr/bin/sample.sh

kgv

2021-01-12 15:36

developer   ~0098095

Last edited: 2021-01-12 15:47

Just to comment *.sh scripts. Files like
> /usr/bin/custom.sh
> /usr/bin/custom_gcc_64.sh
> /usr/bin/draw.sh
> /usr/bin/env.sh

are hacks to pre-configure environment to libraries and resources within development environment.
E.g., when OCCT is not actually installed system-wide but placed somewhere within $HOME directory.
This is a common way for developing OCCT-based application relying not on OCCT packages provided by Linux distributive.

When installing DRAWEXE system-wide, starting executable directly should not require any $LD_LIBRARY_PATH hacks and application should be able to find resource files in their default locations (hence global variables like $CSF_OCCTResourcePath/$CSF_DrawPluginDefaults should not be necessary as well).

searchResources() function in src/Draw/Draw.cxx defines resource look up by Draw Harness - at first it tries to find resources within "/share/opencascade-7.6.0.dev/" folder with fully qualified version and then fallbacks to shorter options:
 ("/share/opencascade-" OCC_VERSION_STRING_EXT "/") + theResName,
 ("/share/opencascade-" OCC_VERSION_COMPLETE "/") + theResName,
 ("/share/opencascade-" OCC_VERSION_STRING "/") + theResName,
 ("/share/opencascade/") + theResName,
 ("/share/occt-" OCC_VERSION_STRING_EXT "/") + theResName,
 ("/share/occt-" OCC_VERSION_COMPLETE "/") + theResName,
 ("/share/occt-" OCC_VERSION_STRING "/") + theResName,
 ("/share/occt/") + theResName,


Apart from Draw Harness plugins and Tcl scripts, there is no much global resource files in OCCT nowadays necessary for using OCCT in other applications (most resources are embedded into .so and plugin interface for loading OCAF documents has been superseded by direct linking and registering drivers).

dpasukhi

2023-08-02 02:02

administrator   ~0113832

Dear @bugmaster
please close the issue

Issue History

Date Modified Username Field Change
2020-12-31 20:32 efferre79 New Issue
2020-12-31 20:32 efferre79 Assigned To => bugmaster
2021-01-01 14:31 kgv Target Version => 7.6.0
2021-01-01 14:31 kgv Summary bug in OpenCASCADEConfig.cmake when using INSTALL_DIR_CMAKE => Configuration - bug in OpenCASCADEConfig.cmake when using INSTALL_DIR_CMAKE
2021-01-01 14:31 kgv Steps to Reproduce Updated
2021-01-11 14:45 bugmaster Note Added: 0098068
2021-01-11 14:45 bugmaster Assigned To bugmaster => efferre79
2021-01-11 14:45 bugmaster Status new => assigned
2021-01-11 15:20 bugmaster Status assigned => feedback
2021-01-12 15:23 efferre79 Note Added: 0098094
2021-01-12 15:36 kgv Note Added: 0098095
2021-01-12 15:37 kgv Note Edited: 0098095
2021-01-12 15:38 kgv Note Edited: 0098095
2021-01-12 15:39 kgv Note Edited: 0098095
2021-01-12 15:39 kgv Note Edited: 0098095
2021-01-12 15:43 kgv Note Edited: 0098095
2021-01-12 15:43 kgv Note Edited: 0098095
2021-01-12 15:44 kgv Note Edited: 0098095
2021-01-12 15:44 kgv Relationship added related to 0032046
2021-01-12 15:45 kgv Note Edited: 0098095
2021-01-12 15:45 kgv Description Updated
2021-01-12 15:45 kgv Additional Information Updated
2021-01-12 15:47 kgv Note Edited: 0098095
2021-11-01 18:14 szy Target Version 7.6.0 => 7.7.0
2022-10-24 10:39 szy Target Version 7.7.0 => 7.8.0
2023-08-02 02:02 dpasukhi Assigned To efferre79 => bugmaster
2023-08-02 02:02 dpasukhi Note Added: 0113832
2023-08-02 02:02 dpasukhi Target Version 7.8.0 => Unscheduled
2023-08-07 15:53 vglukhik Status feedback => closed
2023-08-07 15:53 vglukhik Resolution open => fixed