View Issue Details

IDProjectCategoryView StatusLast Update
0022216Open CASCADEOCCT:WOKpublic2011-07-12 14:33
ReporterabvAssigned Toimv  
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Fixed in Version6.5.0 
Summary0022216: Revise way to specify necessary libraries on Windows / MS VC++ compiler
DescriptionAs a continuation of OCCTR 22193, I propose to revise a way how dependency on
specific external libraries is defined, on Windows first of all, so as to make
it easily configurable.

If some OCCT package requires to be linked with some specific library (e.g.
TKService now requires FreeImage), the standard way of doing this in WOK is to
put EXTERNLIB file where relevant WOK symbol(s) are recorded. These symbols are
defined (usually in CSF.eld) in platform-specific way, and used in providing
appropriate options to the linker. This is Ok for WOK, since in any workbench
the user can redefine these symbols and relevant compiler macros in CSF.edl if
necessary.

When MS VC++ projects are generated, currently the libraries that are defined
in the current WOK environment get referred by all relevant projects. This
makes it difficult to configure this after projects generation. For instance,
compile-time dependency on FreeImage library can now be switched off easily by
defining macro (the same as introduced for TBB in OCCTR 22193), but linker
dependency is hardcoded to the project.

To avoid this, I propose the following:

- In all code that required linking to specific libraries, use MSVC++-specific
pragma statements to declare this dependency.

For instance, in Image_PixMap.cxx, we can put (inside #ifdef HAVE_FREEIMAGE
clause):

   #ifdef _MSC_VER
   #pragma comment (FreeImage.lib)
   #endif

- In project generator exclude the code that embeds references to EXTERNLIB
libraries to VC++ project files

The effect will be that dependency on the library for linker will be
synchronized with actual use of it in the code when activated by HAVE_* macro.
Thus such macros can be used simply to manipulate this dependency, without
additional efforts.

Note that paths to all third-party libraries will still need to be defined,
which is not a problem.

On Linux, it is desirable to reach similar level of flexibility by providing
corresponding options to configure, line --no-freeimage
TagsNo tags attached.
Test case number

Attached Files

  • OCC22216.zip (11,188 bytes)
  • OCC22216_1.zip (11,205 bytes)

Relationships

related to 0022218 closedapl Open CASCADE Make use of GL2PS library optional 

Activities

2011-02-15 20:21

 

OCC22216.zip (11,188 bytes)

2011-02-16 12:22

 

OCC22216_1.zip (11,205 bytes)

Issue History

Date Modified Username Field Change
2011-01-29 13:52 abv OtherBugsDependingOnThis => 22193
2011-01-29 13:54 abv BugsThisDependsOn => 22218
2011-02-11 12:00 bugmaster Assigned To bugmaster => imv
2011-02-11 12:00 bugmaster Status new => assigned
2011-02-15 20:21 imv Status assigned => resolved
2011-02-17 16:03 bugmaster Status resolved => verified