<div class="gmail_quote">On Mon, Aug 31, 2009 at 8:02 PM, j s <span dir="ltr"><<a href="mailto:j.s4403@gmail.com">j.s4403@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am doing cross-platform compilation. I don't want everything to recompile on all platforms. That is a risk with having a configuration header file. If I remember correctly, cmake would ignore conditional include guards when doing dependency scanning. Therefore:<br>
#ifdef WIN32<br>#include "config.hh"<br>#endif<br><br>would trigger a compilation on all platforms if config.hh changed.<br><br>I want everything to recompile on Windows, but not on my linux builds.<br></blockquote>
<div><br>I think when he meant a config file he meant one created by CMake dynamically (which would only affect one build anyways).<br><br>In other words:<br><br><a href="http://config.h.in">config.h.in</a>:<br>#cmakedefine FOO<br>
<br>CMakeLists.txt:<br>set(FOO true)<br>configure_file(${CMAKE_CURRENT_SOURCE_DIR}/<a href="http://config.h.in">config.h.in</a><br> ${CMAKE_CURRENT_BINARY_DIR}/config.h)<br>include_directories(${CMAKE_CURRENT_BINARY_DIR})<br>
<br>config.h now includes "#define FOO 1"<br><br><br>Of course if all you need is the "unborkify MSVC so it supports math.h" define then it's probably not worth it. :)<br><br></div></div><br>-- <br>
Philip Lowman<br>