I would recommend using EXTERNALPROJECT_ADD. http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:ExternalProject. Though I am not building in ITK as of yet I am using VTKEdge which depends on VTK
--snip vtkedge_config.cmake -- macro( vtkedge_config ) set( VTK_EDGE_PACKAGE VTKEdge-5-4-0 ) unpack( ${PLATFORM_DIR}/VTKEdge/ VTKEdge-5-4-0.zip ${THIRD_PARTY_PACKAGE_DIR} ) include_directories( ${INSTALL_PREFIX}/include/VTKEdge ) ExternalProject_Add( ${VTK_EDGE_PACKAGE} DOWNLOAD_COMMAND "" SOURCE_DIR ${TOP}/source/cpp/lib/3rdParty/Win/${VTK_EDGE_PACKAGE} BINARY_DIR ${BUILD_DIR}/ouput/bin/${VTK_EDGE_PACKAGE} INSTALL_DIR ${INSTALL_PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${INSTALL_PREFIX} -DINSTALL_PREFIX=${INSTALL_PREFIX} ${VTK_DEFINES} ) endmacro() --end snip-- In my top level CMakeLists.txt file I call as follows --snip CMakelists.txt -- ... ... include( vtkedge_config.cmake ) ... ... ... compiler_config() cuda_config() boost_config() #dcmtk_config() vtk_config() vtkedge_config() matlab_config() ... ... ... --end snip-- It is only boost, and only by patching, that I can get to play nice using add_subdirectory. I would be interested to hear your trials and tribulations with add_subdirectory and third party source.
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake