.....

In the simple case, I just tested with 2.4.8 and 2.6.0 this works fine:

add_executable(bar foo.c)
target_link_libraries(bar foo)

foo.lib is linked for both vs IDE and makefiles.

Let's go back to the macro LINK_INTERNAL. I think the issue was trying to get around a bug in 2.4.7. That should all be fixed in 2.4.8.

So, I think you don't need the macro at all for 2.4.8 and greater.

It should just be:

target_link_libraries(osgDB osg OpenThreads)

Are all the input libraries to LINK_INTERNAL things that CMake is building?

Hi Bill, I think the LINK_INTERNAL macros is being used only for internal libs.

The current cmake build is the result of several layers of mods though, so some care has to be taken.

something that could complicate thinghs that you could not be aware of is the use of "non standard" hack for placing libs and dll in bib and lib instead of bin/Debug or bin/Release
as you can see from the lines like

               IF(NOT MSVC_IDE)
SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../bin/${OSG_PLUGINS}/") ELSE(NOT MSVC_IDE) SET_TARGET_PROPERTIES(${TARGET_TARGETNAME} PROPERTIES PREFIX "../../bin/${OSG_PLUGINS}/" IMPORT_PREFIX "../")
               ENDIF(NOT MSVC_IDE)

Could this hack fool the automatic linkage inference of CMake in 2.4.8 or 2.4.6 ?

I' m not a cmake guru, just helped in the past to assemble the build by infering from other code and the available CMake doc....

The main reason to use Macros was to inserta a level of abstraction hiding platform dependent CMake code as well as possible workaround for CMake problems: "LINK_INTERNAL" should behave exactly as "target_link_libraries" , over time the implementation has become more complicated as some workaround has been implemented.
The CMakeLists remained mostly unchanged though.

I could try a windows ide build test making LINK_INTERNAL call straight target_link_libraries and see waht happens but can not test other windows build platforms.

Thanks for the help

Luigi



_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to