<br>
Update: currently crying uncle ... and switching to
ExternalProject_Add. CMake and the third party libs were simply not
designed for this.<br>
<br>
Question on ExternalProject_Add above:<br>
<br>
<div>ExternalProject_Add(</div>
<div> DOWNLOAD_COMMAND ""</div>
<div> CMAKE_ARGS</div>
<div> -DMYPROJ_UBERBUILD:BOOL=OFF</div>
<div> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}</div>
<div> ...</div>
<div>)</div>
<br>I had in my project:<br>
<br>
SET( THIRD_PARTY_SRC_DIR 3rdParty/Win )<br>
add_subdirectory( ${THIRD_PARTY_SRC_DIR}/vtk-5.4.2 ./vtk-5.4.2 )<br>
<br>
and so I replaced it with:<br>
<br>
ExternalProject_Add(<br>
vtk-5.4.2<br>
DOWNLOAD_COMMAND ""<br>
SOURCE_DIR ${THIRD_PARTY_SRC_DIR}/vtk-5.4.2<br>
# SOURCE_DIR C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\vtk-5.4.2<br>
SOURCE_DIR /source/cpp/lib/3rdParty/Win/vtk-5.4.2<br>
<br>
)<br>
<br>
Where these lines are in a CMakeLists.txt file located at:<br>
<br>
C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\CMakeLists.txt<br>
<br>
but I get the error in Visual Studio:<br>
<br>
2>CMake Error: The source directory
"C:/projects/NIH2009/source/branches/trunk/build/dvip4-Win64/cpp_source/lib/3rdParty/Win/vtk-5.4.2"
does not appear to contain CMakeLists.txt.<br>
<br>
Note the prefixing of C:/projects/NIH2009/source/branches/trunk/build/dvip4-Win64/cpp_source/lib<br>
<br>
vtk is located at C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\vtk-5.4.2<br>
<br>
and project root CMakeLists.txt is at C:\projects\NIH2009\source\branches\trunk<br>
<br>
<br>
<br>
ExternalProject_Add(<br>
vtk-5.4.2<br>
DOWNLOAD_COMMAND ""<br>
SOURCE_DIR /source/cpp/lib/3rdParty/Win/vtk-5.4.2<br>
<br>
)<br>
<br>
and get: <br>
<br>
2>CMake Error: The source directory "/source/cpp/lib/3rdParty/Win/vtk-5.4.2" does not appear to contain CMakeLists.txt.<br>
<br>
so I try:<br>
<br>
SOURCE_DIR /3rdParty/Win/vtk-5.4.2<br>
<br>
2>CMake Error: The source directory "/3rdParty/Win/vtk-5.4.2" does not appear to contain CMakeLists.txt.<br>
<br>
<br>
so I try absolute path:<br>
<br>
<br>
ExternalProject_Add(<br>
vtk-5.4.2<br>
DOWNLOAD_COMMAND ""<br>
SOURCE_DIR C:\projects\NIH2009\source\branches\trunk\source\cpp\lib\3rdParty\Win\vtk-5.4.2<br>
}<br>
<br>
Ahhh the hacking... I am going to find my way out of this forest one day... and onto a desert.<br>
<br>
And now CMake finds the vtk goop. Now the question: Is there a
project relative directory syntax to use here or is ExternalProject not
like add_subdirectory in this regard?<br>
<br>-- <br>Brian J. Davis