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

Michael Hertling mhertling at online.de
Sat Oct 8 06:40:21 EDT 2011


On 10/08/2011 05:33 AM, michael lowell roberts wrote:
> 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

Could you boil down this issue to a minimal but self-contained
exemplary project and post it here for further investigation?

Regards,

Michael


More information about the CMake mailing list