On 13 June 2011 02:53, Michael Hertling <[email protected]> wrote: > > AFAIK, there's no other approach to take account of single- and multi- > config generators at the same time for this purpose, but perhaps, you > could design the loop a bit smarter: > > FOREACH(i IN LISTS CMAKE_CONFIGURATION_TYPES ITEMS ${CMAKE_BUILD_TYPE}) > STRING(TOUPPER ${i} j) > IF(NOT j MATCHES "RELEASENOOUTFILES") > SET_PROPERTY(...) > ENDIF() > ENDFOREACH() >
I wasn't aware of that syntax of the foreach command - that does tidy it up a bit. > and rely on the assumption that > > (1) the FLAGS are mentioned after the COMPILE_DEFINITIONS, and > (2) the last -D/-U argument in the command line will take effect. > > At least, GCC guarantees that (2) holds, but I have not found any > explicit assertion in the documentation that CMake guarantees (1), > though it seems to work in this way. > I'm not overly keen on that solution. BTW, is an "inverted" logic an option, i.e. a preprocessor definition > NO_GEN_OUTFILES enabled for the RELEASENOOUTFILES configuration only? > This would be much easier and fit that configuration's intent better. > The default is to generate outfiles and the code is littered with blocks like this: #ifdef GEN_OUTFILES ... #endif Changing them to #ifndef NO_GEN_OUTFILES would work but the double negative makes the code less readable. I'll stick with what I already have for the moment, but add your modification to the foreach loop. Thanks, -- Glenn
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
