<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi all,<br><br>John wrote:<br>> You really should not be using the same binary folder for all these<br>>
different configurations. Use 1 binary folder tree for each build. Or<br>>
in the case of a multi-configuration generator like visual studio you<br>>
use 1 binary folder per architecture. Also separate compiler versions<br>>
in separate build trees since they build incompatible binaries.<br><br>That's exactly what I want to do! Sorry that this was not clear from my original message.<br><br>Given that I am a newbie, I may be missing on some things that are obvious to other people. I promise I have made enough attempts to read through the all documentation available and have performed enough Google searches.<br><br>Assuming that the procedure for running cmake would be something like:<br><br>0. Say I begin in the project root folder that has the top-level CMakeLists.txt file.<br>1. cd ./make/msvc9/x64/release/ # switch to config specific folder<br>2. cmake -G "generator-for-a-given-config" ../../../../<br><br>Now I would like the top-level CMakeLists.txt file to figure out the following:<br><br>1. Link to the correct pre-compiled version of UnitTest++ based on the configuration.<br>2. Find the correct compilers and build tools (MSVC is easily handled but MinGW-W64 is not since it has separate tool-chains for x86 and x64 while CMake has only one generator for MinGW (not counting Code::Blocks and Eclipse ones))<br>3. Place the output files in one-per-configuration folder, which are separate from the tree where cmake cache and the makefiles reside. For example, something like, ./bin/msvc9/x64/release/ instead of ./make/msvc9/x64/release/<br><br>Thanks,<br><br>Alok<br><br>> Date: Fri, 7 May 2010 12:32:18 -0400<br>> Subject: Re: [CMake] Newbie: Building multiple configurations (x86/x64,         MSVC/MinGW-W64, etc.)<br>> From: drescherjm@gmail.com<br>> To: alokgovil@hotmail.com<br>> CC: cmake@cmake.org<br>> <br>> On Fri, May 7, 2010 at 11:53 AM, Alok Govil <alokgovil@hotmail.com> wrote:<br>> > Hi all,<br>> ><br>> > I am trying to use CMake to build my code under multiple configurations:<br>> ><br>> > 1. x86 and x64<br>> > 2. MSVC various versions and MinGW-W64 mainly<br>> > 3. Debug and release (optional)<br>> ><br>> > In each case I would like to link the code with a corresponding pre-compiled<br>> > version of UnitTest++.<br>> > (There is always an option to include UnitTest++ as a target into the<br>> > project, but I do not see the<br>> > point in building UnitTest++ on each run and for each project where<br>> > UnitTest++ is used. Please let<br>> > me know if the direction I am taking here is not correct.)<br>> ><br>> > The case for MinGW-W64 seems to be more involved since they have two<br>> > separate toolchains for<br>> > x86 and x64. How would I even write CMakeLists.txt for these two such that<br>> > correct paths to x86<br>> > and x64 bin folders is recognized?<br>> ><br>> > Another thing I would like to do is to specify folders where the output<br>> > binaries are created using<br>> > EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH. This would again be based<br>> > on the<br>> > configuration used (MinGW-64 vs. MSVC, and x86 vs. x64)<br>> ><br>> > I have looked into the following, but have not been able to figure it all<br>> > out as yet:<br>> ><br>> > From: http://www.elpauer.org/stuff/learning_cmake.pdf<br>> ><br>> > TARGET_LINK_LIBRARIES(wakeup RELEASE ${wakeup_SRCS})<br>> > TARGET_LINK_LIBRARIES(wakeupd DEBUG ${wakeup_SRCS})<br>> ><br>> > Notes:<br>> > - This allows specifying different libraries for debug and release, but<br>> > there does not seem to<br>> > be an option to use the same method to specify different libraries for<br>> > x86 vs. x64.<br>> ><br>> > From: http://www.cmake.org/pipermail/cmake/2009-June/030072.html<br>> ><br>> > # check 64 bit<br>> > if( CMAKE_SIZEOF_VOID_P EQUALS 4 )<br>> > set( HAVE_64_BIT 0 )<br>> > else()<br>> > set( HAVE_64_BIT 1 )<br>> > endif()<br>> ><br>> > Thanks,<br>> ><br>> <br>> You really should not be using the same binary folder for all these<br>> different configurations. Use 1 binary folder tree for each build. Or<br>> in the case of a multi-configuration generator like visual studio you<br>> use 1 binary folder per architecture. Also separate compiler versions<br>> in separate build trees since they build incompatible binaries.<br>> <br>> John<br>                                            <br /><hr />Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1' target='_new'>Learn more.</a></body>
</html>