See the cmake command line help for:<div>--no-warn-unused-cli        = Don&#39;t warn about command line options.</div><div><br></div><div>I would just add &quot;--no-warn-unused-cli&quot; to the ExternalProject_Add calls and require CMake 2.8.4. (There is no ExternalProject_Add in CMake 2.6...)</div>
<div><br><br><div class="gmail_quote">On Sat, Mar 26, 2011 at 9:22 AM, Johnson, Hans J <span dir="ltr">&lt;<a href="mailto:hans-johnson@uiowa.edu">hans-johnson@uiowa.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:Calibri,sans-serif">
<div>David,</div>
<div><br>
</div>
<div>I am trying to remove all warnings from my Cmake build process:  During a &quot;-DCMAKE_<span style="font-style:italic">BUILD_</span>TYPE:STRING=Debug&quot; build I get the following warning:</div>
<div><b>
<pre>CMake Warning: The variable, &#39;CMAKE_CXX_FLAGS_RELEASE&#39;, specified manually, was not used during the generation.</pre>
<pre>I believe that I get an alternate warning when building in Release mode that <span style="font-weight:normal;white-space:normal;font-family:Calibri,sans-serif"><b><pre style="display:inline!important">CMAKE_CXX_FLAGS_DEBUG is specified manually.</pre>
</b></span></pre>
</b></div>
<div>I was reading this thread:</div>
<div><a href="http://www.cmake.org/pipermail/cmake/2011-February/042474.html" target="_blank">http://www.cmake.org/pipermail/cmake/2011-February/042474.html</a></div>
<div><br>
</div>
<div>Here is my situation, and I&#39;d like your advice on how to resolve it:</div>
<div><br>
</div>
<div>
<div>I am using ExternalProject_Add feature of cmake, and I want all external packages to be built with the same compiler options:</div>
<div><br>
</div>
<div>
<div>set(EXTERNAL_PACKAGES  BRAINSMultiModeSegment   BRAINSFit BRAINSDemonWarp BRAINSCut BRAINSResample BRAINSABC BRAINSConstellationDetector  BRAINSMush  BRAINSROIAuto  GTRACT  ${DicomToNrrdConverter} ${DicomSignature} ${BRAINSImageEval}  BRAINSInitilizedControlPoints  )</div>

<div><br>
</div>
<div>foreach(proj ${EXTERNAL_PACKAGES})</div>
<div>  # message(STATUS &quot;Building ExternalProject ${proj}&quot;)</div>
<div>  #  message(STATUS &quot;BRAINSCommonLib_DIR = ${BRAINSCommonLib_DIR}&quot;)</div>
<div>  ExternalProject_Add(${proj}</div>
<div>    DOWNLOAD_COMMAND &quot;&quot;</div>
<div>    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${proj}</div>
<div>    BINARY_DIR ${proj}-build</div>
<div>    #    DEPENDS  BRAINSCommonLib SlicerExecutionModel</div>
<div>    CMAKE_GENERATOR ${gen}</div>
<div>    CMAKE_ARGS</div>
<div>  -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}</div>
<div>  -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}</div>
<div>  -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}</div>
<div>  -DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}</div>
<div>  -DCMAKE_C_FLAGS_DEBUG:STRING=${CMAKE_C_FLAGS_DEBUG}</div>
<div>  -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}</div>
<div>    -DITK_DIR:PATH=${ITK_DIR}</div>
<div>    INSTALL_COMMAND &quot;&quot;</div>
<div>    )</div>
<div>endforeach()</div>
</div>
<div><br>
</div>
<div>=========================================</div>
<div>Is there a way inside the CMakeLists.txt file to avoid these warnings?</div>
<div><br>
</div>
<div>The only solution I can think of is to add a tremendous amount of if/then/else logic to explicitly handle all permutations of options so that only the minimal set of options is sent.  That is going to be a maintenance nightmare.</div>

<div><br>
</div>
<div>This code needs to compile similarly under cmake 2.6.4 and 2.8.4, or I&#39;ll need to again add build logic to our testing scripts.  </div>
<div><br>
</div>
</div>
<div>Thanks,</div>
<div>Hans</div>
<div><br>
</div>
<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>
</div>

</blockquote></div><br></div>