<div class="gmail_quote">On Sat, Oct 8, 2011 at 6:40 AM, Michael Hertling <span dir="ltr"><<a href="mailto:mhertling@online.de">mhertling@online.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On 10/08/2011 05:33 AM, michael lowell roberts wrote:<br>
> Hi all,<br>
><br>
> I'm attempting to use the ExternalProject module to compile and link against<br>
> a library and I've run into a problem that I'm not certain how to address.<br>
> I'm using CMake 2.8.6 and Visual Studio 10 Express.<br>
><br>
> The external project, in my case, is a CMake-compiled project and CMake<br>
> predictably builds a matching configuration in the external project.<br>
><br>
> The target_link_libraries() command, however, only allows for two<br>
> configurations, at most, mapped to labels "debug" and "optimized."<br>
><br>
> This allows for only two of the four default build configurations to<br>
> complete successfully.<br>
><br>
> For example, in my build scripts, I have told target_link_libraries() to map<br>
> "debug" configurations to the Debug version of library and optimized<br>
> configurations map to the "RelWithDebInfo" build of the library. Therefore,<br>
> if I build the "Release" configuration, I get linker errors because the<br>
> external project was also built with the "Release" configuration but I need<br>
> to link against "RelWithDebInfo."<br>
><br>
> It seems to be that no matter how the target_link_library() mappings are set<br>
> up, only half of the default configurations will build properly because of<br>
> the dualism that target_link_libraries() uses.<br>
><br>
> How do I get all four default build configurations working?<br>
><br>
> Regards,<br>
> Mike<br>
<br>
</div></div>Could you boil down this issue to a minimal but self-contained<br>
exemplary project and post it here for further investigation?<br></blockquote><div><br></div><div>Certainly.</div><div><br></div><div>I've attached a sample project that downloads and compiles the trio library, which can be found at the following site:</div>
<div><br></div><div><a href="http://daniel.haxx.se/projects/trio/">http://daniel.haxx.se/projects/trio/</a></div><div><br></div><div>It then attempts to link the library into a trivial executable that simply prints a message to the screen.</div>
<div><br></div><div>The build exhibits the problem I mentioned. Debug builds complete successfully. Release builds do not.</div><div><br></div><div>Additionally, the IDE appears incapable of determining when the build is up-to-date. Try to debug the executable to reproduce this problem. I'm inclined to believe that this is due to something I've done wrong and any help with this problem would also be appreciated.</div>
<div><br></div><div>Lastly, I'm certain that there are other problems I have not identified yet. If you could point out anything else that is obviously problematic, I would be grateful. Perhaps I am over-complicating the code, for example.</div>
<div><br></div><div>Thanks,</div><div>Mike</div><div><br></div></div>