Seems like:<div><br></div><div> if(vtkTestingCore_LOADED)</div><div><br></div><div>should work. (Tested against a build tree of VTK, not sure if the same applies to an install tree...)</div><div><br></div><div>Hopefully one of the modularization gurus chimes in to say if that's the canonical way we're expected to do that. There are other ways to tell, even though BUILD_TESTING itself is not available after a "find_package(VTK)"...</div>
<div><br></div><div><br></div><div>I used the following CMake code to see what variables are available (and there are many, many, many) after a find_package(VTK):</div><div><br></div><div><div>cmake_minimum_required(VERSION 2.8)</div>
<div>project(VTK-cli1)</div><div><br></div><div>function(echo_all_cmake_variables)</div><div> message(STATUS "")</div><div> get_cmake_property(vs VARIABLES)</div><div> foreach(v ${vs})</div><div> message(STATUS "${v}='${${v}}'")</div>
<div> endforeach(v)</div><div> message(STATUS "")</div><div>endfunction()</div><div><br></div><div>message(STATUS "")</div><div>message(STATUS "before find_package(VTK)")</div><div>echo_all_cmake_variables()</div>
<div><br></div><div>find_package(VTK)</div><div><br></div><div>message(STATUS "")</div><div>message(STATUS "after find_package(VTK)")</div><div>echo_all_cmake_variables()</div><div><br></div><div><br></div>
<div>Then I ran CMake, pointing it to a build of VTK, and just searched the output for "Testing":</div><div><br></div><div> cmake -DVTK_DIR="/Users/.../VTK-build" .. > out.txt</div><div><br></div><div>
<br></div><div>HTH,</div><div>David C.</div><div><br></div><br><div class="gmail_quote">On Sun, Jun 10, 2012 at 7:50 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In the vtkwikiexamples repository, we get a compiler error:<br clear="all"><br><div>fatal error: vtkTesting.h: No such file or directory</div>
<div><br></div><div>if VTK was not built with BUILD_TESTING=ON. Is there a way to check the value of this variable in an external project?</div>
<div><br></div><div>Thanks,</div><div><br>David<br>
</div>
<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>