[CMake] Building ITK with VTK 5.6

Brian Davis bitminer at gmail.com
Fri Jul 30 18:02:47 EDT 2010


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100730/0adbf248/attachment-0001.htm>


More information about the CMake mailing list