Thanks, Eric.<br><br>The FM is not as easy to understand as the FMs of autotools :)<br>I prefer TexInfo format manuals. It's much readable than man pages but I find no TexInfo manuals in CMake's package :(<br><br><div>
<span class="gmail_quote">On 5/15/07, <b class="gmail_sendername">Eric Noulard</b> <<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2007/5/15, Clark J. Wang <<a href="mailto:dearvoid@gmail.com">dearvoid@gmail.com</a>>:<br>> I have a C source file `foo.c' and I want to produce 2 executables like<br>> this:<br>><br>> $ gcc -DFLAG_1 -o foo_1
foo.c<br>> $ gcc -DFLAG_2 -o foo_2 foo.c<br>><br>> How should I write the CMake rules?<br><br>RTFM :))</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
May be you can try<br>ADD_EXECUTABLE(foo_1 foo.c)<br>SET_TARGET_PROPERTIES(foo_1<br> PROPERTIES COMPILE_FLAGS "-DFLAG_1")<br><br>ADD_EXECUTABLE(foo_2 foo.c)<br>SET_TARGET_PROPERTIES(foo_2
<br> PROPERTIES COMPILE_FLAGS "-DFLAG_2")<br><br><br>--<br>Erk<br></blockquote></div><br>