diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt index 8ba451e154ff21cad658c0e9ff3686e296d7cee5..0eb91de3a6f2cccb4fd546af8fb89ce8ff0777aa 100644 --- a/SuperBuild/CMakeLists.txt +++ b/SuperBuild/CMakeLists.txt @@ -61,11 +61,12 @@ endif() # Boost Graph Library mark_as_advanced( USE_SYSTEM_BOOST ) -option( USE_SYSTEM_BOOST "Use an installed version of BOOST" ON ) +option( USE_SYSTEM_BOOST "Use an installed version of BOOST" OFF ) if( USE_SYSTEM_BOOST ) find_package( BOOST REQUIRED graph ) else() - message( FATAL_ERROR "BOOST is not yet integrated with the SuperBuild. Install BOOST on your system, set USE_SYSTEM_BOOST to ON and re-run CMake." ) + include( ExternalBoost ) + list( APPEND ELASTIX_DEPENDENCIES BOOST ) endif() # --------------------------------------------------------------------- diff --git a/SuperBuild/ExternalBoost.cmake b/SuperBuild/ExternalBoost.cmake new file mode 100644 index 0000000000000000000000000000000000000000..e1f1286e9995efa98dce2649cc9aa79a41bebdbf --- /dev/null +++ b/SuperBuild/ExternalBoost.cmake @@ -0,0 +1,39 @@ +set( PROJECT BOOST ) + +# Note: It IS important to download different files on different OS's: +# on Unix-like systems, we need the file persmissions (only available in the .tar.gz), +# while on Windows, we need CR/LF line feeds (only available in the .zip) + +set( BOOST_CONFIGURE_COMMAND ) +if( UNIX ) + set( BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz") + set( BOOST_MD5 51528a0e3b33d9e10aaa311d9eb451e3 ) + set( BOOST_CONFIGURE_COMMAND ./bootstrap.sh ) + set( BOOST_BUILD_COMMAND ./b2 ) +else() + if( WIN32 ) + set( BOOST_URL "http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.zip") + set( BOOST_MD5 08d29a2d85db3ebc8c6fdfa3a1f2b83c ) + set( BOOST_CONFIGURE_COMMAND cmd /C bootstrap.bat msvc ) + set( BOOST_BUILD_COMMAND b2.exe ) + endif() +endif() + +set( BOOST_BUILD_DIR "${CMAKE_INSTALL_PREFIX}/${PROJECT}-build/" ) + +ExternalProject_Add( BOOST + BUILD_IN_SOURCE 1 + URL "${BOOST_URL}" + URL_MD5 ${BOOST_MD5} + UPDATE_COMMAND "" + CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND} + --prefix=${BOOST_BUILD_DIR}/lib + BUILD_COMMAND ${BOOST_BUILD_COMMAND} install + --prefix=${BOOST_BUILD_DIR} + --with-graph + --variant=release + --jobs=4 + INSTALL_COMMAND "" +) + +set( BOOST_ROOT ${BOOST_BUILD_DIR} ) diff --git a/SuperBuild/ExternalITK.cmake b/SuperBuild/ExternalITK.cmake index 206e83a60c330e8a067a4dffc9ea3d4f030c0b7f..0ee77affea1569d7f946b128e1a7de2756189959 100644 --- a/SuperBuild/ExternalITK.cmake +++ b/SuperBuild/ExternalITK.cmake @@ -1,13 +1,13 @@ -set( proj ITK ) +set( PROJECT ITK ) set( ITK_REPOSITORY https://github.com/InsightSoftwareConsortium/ITK.git ) set( ITK_TAG "v${ITK_VERSION_STRING}") -ExternalProject_Add( ${proj} +ExternalProject_Add( ${PROJECT} GIT_REPOSITORY ${ITK_REPOSITORY} GIT_TAG ${ITK_TAG} UPDATE_COMMAND "" - SOURCE_DIR ${proj} - BINARY_DIR ${proj}-build + SOURCE_DIR ${PROJECT} + BINARY_DIR ${PROJECT}-build CMAKE_ARGS --no-warn-unused-cli -DBUILD_EXAMPLES:BOOL=OFF @@ -21,4 +21,4 @@ ExternalProject_Add( ${proj} ) ExternalProject_Get_Property( ITK install_dir ) -set( ITK_DIR "${install_dir}/lib/cmake/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}" ) \ No newline at end of file +set( ITK_DIR "${install_dir}/lib/cmake/ITK-${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}" ) diff --git a/Testing/Unit/CMakeLists.txt b/Testing/Unit/CMakeLists.txt index 152463661b386eebef9985f5071fa38a1f427f9e..b7bd9cc7bc039647599557d3b448e1ba7d98b0e2 100644 --- a/Testing/Unit/CMakeLists.txt +++ b/Testing/Unit/CMakeLists.txt @@ -5,6 +5,7 @@ set( ElastixUnitTestFilenames elxExampleUnitTest.cxx + elxBluePrintTest.cxx itkRegistration.cxx )