<div dir="ltr">The approach suggested by Ansis looks interesting. Instead of using "install(FILES ...), you could use CPACK_INSTALL_CMAKE_PROJECTS [1][2]. For an example, see [3] and [4]<div><br></div><div>[1] <a href="http://www.cmake.org/cmake/help/v2.8.8/cpack.html#variable:CPACK_INSTALL_CMAKE_PROJECTS">http://www.cmake.org/cmake/help/v2.8.8/cpack.html#variable:CPACK_INSTALL_CMAKE_PROJECTS</a></div>
<div>[2] <a href="http://www.cmake.org/Wiki/CMake:CPackConfiguration">http://www.cmake.org/Wiki/CMake:CPackConfiguration</a></div><div>[3] <a href="https://github.com/Slicer/Slicer/blob/master/CMake/SlicerCPack.cmake#L17-36">https://github.com/Slicer/Slicer/blob/master/CMake/SlicerCPack.cmake#L17-36</a></div>
<div>[4] <a href="https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockInstallCMakeProjects.cmake">https://github.com/Slicer/Slicer/blob/master/CMake/SlicerBlockInstallCMakeProjects.cmake</a></div><div><br></div>
<div><br><div><br></div><div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">if(${CMAKE_BUILD_TYPE STREQUAL DebugAndRelease)<br></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
include(ExternalProject)</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> ExternalProject_Add(MEDEBUG</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> CMAKE_FLAGS -DCMAKE_BUILD_TYPE Debug)</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> ExternalProject_Add(MERELEASE</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> CMAKE_FLAGS -DCMAKE_BUILD_TYPE Release)</div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> </div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> set(<span style="font-family:arial;font-size:small">CPACK_INSTALL_CMAKE_PROJECTS .... ) # <------------------------</span></div>
<div><span style="font-family:arial;font-size:small"> </span></div>
<div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> #etc, etc.</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"> return()</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
endif()</div></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px"><br></div></div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">Hth</div><div style="font-family:arial,sans-serif;font-size:12.800000190734863px">
Jc</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 7, 2013 at 1:41 PM, Yngve Inntjore Levinsen <span dir="ltr"><<a href="mailto:yngve.levinsen@gmail.com" target="_blank">yngve.levinsen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I think you are fighting the tool in any case, because you are
asking to build multiple configurations in one build folder (?).
Normally you would create one build folder per configuration.. Which
I guess is what you are doing today.<br>
<br>
Instead of specifying the compile flags manually you can instead use
the variables ${CMAKE_C_FLAGS_RELEASE} and ${CMAKE_C_FLAGS_DEBUG},<br>
and you could set it so it only builds the second target based on an
option:<br>
<br>
option(BUILD_BOTH_LIBVERSIONS "Build both debug and optimized
library" OFF)<br>
<br>
if(BUILD_BOTH_LIBVERSIONS)<br>
add_library(...)<br>
set_target_properties(...)<br>
set_target_properties(...)<br>
install(...)<br>
endif()<br>
<br>
Cheers,<br>
Yngve<div><div class="h5"><br>
<br>
<div>On 02/07/2013 07:26 PM, Patrick
Johnmeyer wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">On Thu, Feb 7, 2013 at 3:12 AM, Yngve Inntjore
Levinsen <span dir="ltr"><<a href="mailto:yngve.levinsen@gmail.com" target="_blank">yngve.levinsen@gmail.com</a>></span>
wrote:</div>
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Did you try to create
two targets and add per-target compile flags?<br>
<br>
</div>
</blockquote>
<div><br>
</div>
<div><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">What
you suggest is replacing configurations with targets. That
may be</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">possible,
but runs counter to how CMake natively works. I feel like
I</span><br style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">
<span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">would
be fighting the tool to do it this way.</span></div>
<div><br>
</div>
</div>
</div>
</blockquote>
<br>
</div></div></div>
<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br>+1 919 869 8849<br>
</div>