<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap:break-word; color:rgb(0,0,0); font-size:14px">
<div style="font-family:Calibri,sans-serif">
<div><span class="Apple-style-span" style="font-size:12px; font-family:Consolas,monospace">On 12/12/13 2:13 PM, "Richard Shaw" <</span><span class="Apple-style-span" style="font-size:12px; font-family:Consolas,monospace"><a href="mailto:hobbes1069@gmail.com">hobbes1069@gmail.com</a></span><span class="Apple-style-span" style="font-size:12px; font-family:Consolas,monospace">>
wrote:</span></div>
</div>
<blockquote id="MAC_OUTLOOK_ATTRIBUTION_BLOCKQUOTE" style="font-family:Consolas,monospace; font-size:12px; border-left-color:rgb(181,196,223); border-left-width:5px; border-left-style:solid; padding-top:0px; padding-right:0px; padding-bottom:0px; padding-left:5px; margin-top:0px; margin-right:0px; margin-bottom:0px; margin-left:5px">
<div><br>
</div>
<div>Very interesting but not quite what I'm looking for, in this case the main CMakeLists.txt does actually build a project, I just need it to build wxWidgets first.</div>
</blockquote>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif">Well it's up to you but 'build X and then build Y' is the definition of how using ExternalProject work.</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<div style="font-family:Calibri,sans-serif">What you describe doesn't seem like it would ever work, because the CMake source code is evaluated at Configuration time, not compile time. How is wxWidgets a target? Do you have an ADD_CUSTOM_TARGET command somewhere?
You might have had it accidentally work because of how variables persist between make/configure runs in CMakeCache.txt, but I don't see how it could ever be dependable or predictable.</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<div><font class="Apple-style-span" face="Consolas">if(BOOTSTRAP_WXWIDGETS AND NOT TARGET wxWidgets)</font></div>
<div><font class="Apple-style-span" face="Consolas">message("Build wxWidgets")</font></div>
<div><font class="Apple-style-span" face="Consolas">else()</font></div>
<div><font class="Apple-style-span" face="Consolas">message("Doing normal build")</font></div>
<div><font class="Apple-style-span" face="Consolas">endif()</font></div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
</blockquote>
<div style="font-family:Calibri,sans-serif">The CMake code below would do what you want to do. It builds wxWindows, and then builds your project.
</div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<div><font class="Apple-style-span" face="Consolas">project(TWOSTAGE)</font></div>
<div><font class="Apple-style-span" face="Consolas">include(ExternalProject)</font></div>
<div><font class="Apple-style-span" face="Consolas">if(NOT BUILD_MY_PROJECT) # starts out un-set/false at top level build dir</font></div>
<div><font class="Apple-style-span" face="Consolas"> include(cmake/BuildWxWidgets.cmake)</font></div>
<div><font class="Apple-style-span" face="Consolas"> # your project builds in a subdirectory of the top level build dir</font></div>
<div><font class="Apple-style-span" face="Consolas"> ExternalProject_add(MyActualProject</font></div>
<div><font class="Apple-style-span" face="Consolas"><span class="Apple-tab-span" style="white-space:pre"></span>DOWNLOAD_COMMAND ""</font></div>
<div><font class="Apple-style-span" face="Consolas"> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}</font></div>
<div><font class="Apple-style-span" face="Consolas"> BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/MyActualProject-build</font></div>
<div><font class="Apple-style-span" face="Consolas"> CMAKE_ARGS</font></div>
<div><font class="Apple-style-span" face="Consolas"><span class="Apple-tab-span" style="white-space:pre"></span>-DBUILD_MY_PROJECT:BOOL=TRUE</font></div>
<div><font class="Apple-style-span" face="Consolas"> <all relevant cmake args, including where to find wxWindows libs/include></font></div>
<div><font class="Apple-style-span" face="Consolas"> INSTALL_COMMAND "" # presumably you don't want to install immediately.</font></div>
<div><font class="Apple-style-span" face="Consolas"> )</font></div>
<div><font class="Apple-style-span" face="Consolas">else()</font></div>
<div><font class="Apple-style-span" face="Consolas"> <normal build stuff, depending on WxWidgets></font></div>
<div><font class="Apple-style-span" face="Consolas">endif()</font></div>
<div style="font-family:Calibri,sans-serif"><br>
</div>
</blockquote>
<br>
<br>
<hr>
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any
retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
<hr>
</body>
</html>