[osg-users] CMake config for OpenVRML plugin - debug vs release libs

Luigi Calori l.calori at cineca.it
Sun Sep 9 00:27:44 PDT 2007


Hello Sebastian

Sorry I am on a really slow connection now, so just hints, I can not test:

if you define
SET(ANTRL_LIBRARY antlr.lib)
SET(ANTRL_LIBRARY_DEBUG antlrd.lib)
SET(REGEX_LIBRARY regex.lib)
SET(REGEX_LIBRARY_DEBUG regexd.lib)
SET(TARGET_LIBRARIES_VARS OPENVRML_LIBRARY ANTRL_LIBRARY REGEX_LIBRARY)
SET(TARGET_ADDED_LIBRARIES Ws2_32.lib)

It should work (not tested)

The idea is that TARGET_ADDED_LIBRARIES is interpreted by SETUP_PLUGIN 
macro as a list of undifferentiated external lib libraries to link to
TARGET_LIBRARIES_VARS is interpreted as a list of variable names, the 
simple name is intended to hold the library to iln in optimizemed mode, 
the var with _DEBUG appended holds the lib name to use in debug mode.

Hope it helps

Luigi

Jean-Sébastien Guay wrote:

>Hello,
>
>I suspect this is a question for either Luigi Calori or Eric Wing...
>
>I am trying to correct the CMakeLists.txt in the src/osgPlugins/vrml  
>directory, which I had hacked together without really knowing what I  
>was doing. I have something that's basically better (as in, it doesn't  
>produce errors when Configuring in CMake) but I still have a small  
>problem.
>
>In addition to the openvrml.lib library (which is openvrmld.lib for  
>debug) which I specify using OPENVRML_LIBRARY and  
>OPENVRML_LIBRARY_DEBUG, the OpenVRML plugin also requires to link to  
>two other libs which are compiled from the OpenVRML source code:  
>antlr.lib and regex.lib (antlrd.lib and regexd.lib) as well as the  
>standard Windows Ws2_32.lib library (which has no debug version as far  
>as I know). Right now, I specify those like this, in the plugin's  
>CMakeLists.txt:
>
>     SET(TARGET_EXTERNAL_LIBRARIES antlr regex Ws2_32)
>
>What I need is to be able to specify antlrd.lib and regexd.lib for  
>debug builds, and I don't know the CMake way of doing this. I tried:
>
>     SET(TARGET_EXTERNAL_LIBRARIES_DEBUG antlrd regexd Ws2_32)
>
>but that doesn't seem to work (the generated project still has the  
>non-debug libs in its linker settings).
>
>Is there a way of doing this? How? Thanks,
>
>J-S
>  
>




More information about the osg-users mailing list