Newer
Older
# Explicitly add INCREMENTAL linking option to command lines.
# http://www.cmake.org/pipermail/cmake/2010-February/035174.html
set( MSVC_INCREMENTAL_DEFAULT ON )
# ---------------------------------------------------------------------
project( Elastix )
# Place libraries and executables in the bin directory
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/bin"
)
# Include SuperElastix CMake scripts
Kasper Marstal
committed
set( CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC" )
include( elxWinConfig.cmake )
endif()
# ---------------------------------------------------------------------
# ITK
find_package( ITK REQUIRED )
include( ${ITK_USE_FILE} )
include( "${CMAKE_CURRENT_SOURCE_DIR}/CMake/elxITKRequiredModules.cmake" )
# ---------------------------------------------------------------------
# Boost Graph Library
find_package( Boost REQUIRED graph )
include_directories( ${Boost_INCLUDE_DIRS} )
# ---------------------------------------------------------------------
# Build Elastix
# For now we just enable all modules
include( "${CMAKE_CURRENT_SOURCE_DIR}/CMake/elxModules.cmake" )
elxmodule_enable( elxModuleCore )
# ---------------------------------------------------------------------
# Testing
# Testing requires CMake version 2.8.11 to download test data
if( CMAKE_VERSION VERSION_LESS 2.8.11 )
set( ELASTIX_BUILD_TESTING_DEFAULT OFF )
message( STATUS "ELASTIX_BUILD_TESTING is set to OFF because CMake version is less than 2.8.11" )
else()
set( ELASTIX BUILD_TESTING_DEFAULT ON )
option( ELASTIX_BUILD_TESTING "Enable building tests." ${ELASTIX_BUILD_TESTING_DEFAULT} )
if( ${ELASTIX_BUILD_TESTING} )
add_subdirectory( Testing )
# ---------------------------------------------------------------------
mark_as_advanced( ELASTIX_BUILD_DOXYGEN )
option( ELASTIX_BUILD_DOXYGEN "Enable building Doxygen documentation." OFF )
mark_as_advanced( ELASTIX_BUILD_READTHEDOCS )
option( ELASTIX_BUILD_READTHEDOCS "Enable building readthedocs.org documentation." OFF )