[CMake] ExternalProject, target_link_libraries(), and Multi-configuration Builds.

michael lowell roberts zoarre at gmail.com
Fri Oct 7 23:33:58 EDT 2011


Hi all,

I'm attempting to use the ExternalProject module to compile and link against
a library and I've run into a problem that I'm not certain how to address.
I'm using CMake 2.8.6 and Visual Studio 10 Express.

The external project, in my case, is a CMake-compiled project and CMake
predictably builds a matching configuration in the external project.

The target_link_libraries() command, however, only allows for two
configurations, at most, mapped to labels "debug" and "optimized."

This allows for only two of the four default build configurations to
complete successfully.

For example, in my build scripts, I have told target_link_libraries() to map
"debug" configurations to the Debug version of library and optimized
configurations map to the "RelWithDebInfo" build of the library. Therefore,
if I build the "Release" configuration, I get linker errors because the
external project was also built with the "Release" configuration but I need
to link against "RelWithDebInfo."

It seems to be that no matter how the target_link_library() mappings are set
up, only half of the default configurations will build properly because of
the dualism that target_link_libraries() uses.

How do I get all four default build configurations working?

Regards,
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111007/02632872/attachment.htm>


More information about the CMake mailing list