<div dir="ltr">Hello, <div><br></div><div>I am having some difficulty trying to add an external project, in this particular case the VTK (Visualization Toolkit) project, to my own project using the <b>ExternalProject_Add </b>command. My goal is to download the project from the git repository to a <b>third_party_folder</b> in my repo and then link my executables against its targets. </div><div><br></div><div>My directory structure is as follows</div><div><ul><li>CMakeLists.txt</li><li>src_folder</li><ul><li>CMakeLists.txt</li><li>main.cpp</li></ul><li>third_party_folder</li><ul><li>CMakeLists.txt</li></ul><li>cmake_folder</li><ul><li>External-VTK.cmake</li></ul></ul><div><br></div></div><div>## CMakeLists.txt</div><div>cmake_minimum_version(VERSION 3.1)</div><div>project(MyProj)</div><div>list(APPEND CMAKE_MODULE_PATH </div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>"${CMAKE_CURRENT_SOURCE_DIR}/cmake_folder")</div></blockquote><div>include(ExternalProject)</div><div>add_subdirectory(src_folder)</div><div>add_subdirectory(third_party_folder)</div><div><br></div><div>## third_party_folder/CMakeLists.txt</div><div>include(External-VTK)</div><div><br></div><div>## cmake_folder/External-VTK.cmake</div><div>ExternalProject_Add(VTK</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>GIT_REPOSITORY <a href="https://github.com/Kitware/VTK.git">https://github.com/Kitware/VTK.git</a></div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>GIT_TAG                 master</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>SOURCE_DIR        "${CMAKE_CURRENT_SOURCE_DIR}/VTK"</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>BINARY_DIR          "${CMAKE_CURRENT_BINARY_DIR}/VTK")</div></blockquote><div><br></div><div>## src_folder/CMakeLists.txt</div><div>add_executable(CylinderExample main.cpp)</div><div>target_link_libraries(CylinderExample PRIVATE ${VTK_LIBRARIES})</div><div>vtk_module_autoinit(<br>    TARGETS CylinderExample<br>    MODULES ${VTK_LIBRARIES})<br></div><div><br></div><div>This still does not seem to be doing what I want, so I was wondering if anyone could offer some advice. I am unsure of how to get the outputted targets from an external project. Thank you.</div><div><br></div><div>Nick</div><div><br></div><div><br></div><div><br></div><div><br></div></div>