Skip to content

Commit

Permalink
COMP: Simplyfy the build process
Browse files Browse the repository at this point in the history
A macro was added to simplyfy the ANTS
build mechanism that was replicated
many times.  This makes it easier for adding
the next phase of test suite.
  • Loading branch information
hjmjohnson committed Jan 18, 2013
1 parent 0cc684f commit 4db4a43
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 772 deletions.
61 changes: 54 additions & 7 deletions ANTS.cmake
Original file line number Diff line number Diff line change
@@ -1,19 +1,66 @@
enable_testing()

include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)

configure_file(${CMAKE_CURRENT_LIST_DIR}/CTestCustom.cmake
${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake COPYONLY)

set(BUILDSCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/BuildScripts)
set(CMAKE_MODULE_PATH
${BUILDSCRIPTS_DIR}
${${PROJECT_NAME}_SOURCE_DIR}/CMake
${${PROJECT_NAME}_BINARY_DIR}/CMake
${CMAKE_MODULE_PATH}
)

set (CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)

# Set up ITK
find_package(ITK 4 REQUIRED)
include(${ITK_USE_FILE})

# Set up VTK
option(USE_VTK "Use VTK Libraries" OFF)
if(USE_VTK)
find_package(VTK)
if(VTK_FOUND)
include(${VTK_USE_FILE})
else(VTK_FOUND)
message("Cannot build some programs without VTK. Please set VTK_DIR if you need these programs.")
endif(VTK_FOUND)
endif(USE_VTK)

# With MS compilers on Win64, we need the /bigobj switch, else generated
# code results in objects with number of sections exceeding object file
# format.
# see http://msdn.microsoft.com/en-us/library/ms173499.aspx
if(CMAKE_CL_64 OR MSVC)
add_definitions(/bigobj)
endif()

option(USE_FFTWD "Use double precision fftw if found" OFF)
option(USE_FFTWF "Use single precision fftw if found" OFF)
option(USE_SYSTEM_FFTW "Use an installed version of fftw" OFF)
if (USE_FFTWD OR USE_FFTWF)
if(USE_SYSTEM_FFTW)
find_package( FFTW )
link_directories(${FFTW_LIBDIR})
else(USE_SYSTEM_FFTW)
link_directories(${ITK_DIR}/fftw/lib)
include_directories(${ITK_DIR}/fftw/include)
endif(USE_SYSTEM_FFTW)
endif(USE_FFTWD OR USE_FFTWF)

#-----------------------------------------------------------------------------
include(CTest)
enable_testing()

cmake_minimum_required(VERSION 2.8.2)
# set(CMAKE_BUILD_TYPE "Release")
set(ANTS_TEST_BIN_DIR ${CMAKE_BINARY_DIR}/Examples)

add_subdirectory(Examples)

configure_file(${CMAKE_CURRENT_LIST_DIR}/CTestCustom.cmake
${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake COPYONLY)
###
# Perform testing
###
include(CTest)
enable_testing()

###
# Perform testing
Expand Down
Loading

0 comments on commit 4db4a43

Please sign in to comment.