Commit 73d5d9ef authored by jcfr's avatar jcfr

STYLE: Move CMake commands to match new conventions

The next step in removing end-of-lines is to run through all the
CMakeLists.txt files and clean them up.

This also changes all the key words to lower
case. The primary reason for changing key words is that all documentation for
CMakeLists.txt now shows the key words as lower case. Even the printed
“Mastering CMake v5” uses lower case. I’ve come across this several
times in my class where students stumble over the fact that the
documentation about Cmake does not match the implementation in ITK.

I have a script (a wrapper around a vim macro) written that can make
these substituions reliably (Tested on the BRAINS tree, the Slicer3
tree, and the ITK tree without causing any errors).  More complete
documentation can be found in
ITK/Utilities/Maintenance/HowToCreateTheCMakeCaseConversion.txt

git-svn-id: http://svn.slicer.org/Slicer4/trunk@17191 3bd1e089-480b-0410-8dfb-8563597acbee
parent c0c69265
# BRAINSCommonLib could be installed anywhere, so set all paths based on where
# this file was found (which should be the lib/BRAINSCommonLib directory of the
# BRAINSCommonLib could be installed anywhere, so set all paths based on where
# this file was found (which should be the lib/BRAINSCommonLib directory of the
# installation)
get_filename_component(BRAINSCommonLib_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
......
......@@ -6,10 +6,10 @@ cmake_minimum_required(VERSION 2.8)
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
if(POLICY CMP0016)
CMAKE_POLICY(SET CMP0016 NEW)
cmake_policy(SET CMP0016 NEW)
endif()
if(POLICY CMP0017)
CMAKE_POLICY(SET CMP0017 OLD)
cmake_policy(SET CMP0017 OLD)
endif()
enable_testing()
......@@ -82,25 +82,25 @@ if (Slicer_SOURCE_DIR)
else (Slicer_SOURCE_DIR)
INSTALL(TARGETS BRAINSCommonLib
install(TARGETS BRAINSCommonLib
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/BRAINSCommonLib
ARCHIVE DESTINATION lib/BRAINSCommonLib
)
IF(NOT BRAINSCommonLibProject_INSTALL_NO_DEVELOPMENT)
FILE(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
FILE(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
INSTALL(FILES ${__files1} ${__files2} ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLib.h
if(NOT BRAINSCommonLibProject_INSTALL_NO_DEVELOPMENT)
file(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
file(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
install(FILES ${__files1} ${__files2} ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLib.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/BRAINSCommonLib
COMPONENT Development)
ENDIF(NOT BRAINSCommonLibProject_INSTALL_NO_DEVELOPMENT)
endif(NOT BRAINSCommonLibProject_INSTALL_NO_DEVELOPMENT)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/BRAINSCommonLibInstallConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLibInstallConfig.cmake
@ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLibInstallConfig.cmake
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/BRAINSCommonLibInstallConfig.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/BRAINSCommonLib
COMPONENT Development
RENAME BRAINSCommonLibConfig.cmake)
......@@ -108,11 +108,11 @@ else (Slicer_SOURCE_DIR)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/UseBRAINSCommonLib.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/UseBRAINSCommonLib.cmake @ONLY)
# INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/UseBRAINSCommonLib.cmake.in
# install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/UseBRAINSCommonLib.cmake.in
# DESTINATION lib/BRAINSCommonLib
# COMPONENT Development
# RENAME UseBRAINSCommonLib.cmake)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/UseBRAINSCommonLib.cmake
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/UseBRAINSCommonLib.cmake
DESTINATION lib/BRAINSCommonLib
COMPONENT Development)
......@@ -120,7 +120,7 @@ endif (Slicer_SOURCE_DIR)
##HACK NEED BETTER TESTS add_directory( TestLargestForegroundFilledMaskImageFilter )
##HACK NEED BETTER TESTS add_directory( Test_FindCenterOfBrainFilter )
IF(BUILD_TESTING)
if(BUILD_TESTING)
add_subdirectory(TestSuite)
ENDIF()
endif()
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
## enable_testing()
## include(CTest)
set(CTEST_PROJECT_NAME "BRAINSCommonLib")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
......
# Generate the BRAINSCommonLibConfig.cmake file in the build tree and configure
# Generate the BRAINSCommonLibConfig.cmake file in the build tree and configure
# one the installation tree.
# Settings specific to build trees
......
......@@ -6,37 +6,37 @@
# In practice, this is only a problem if programs other than BRAINSFit actually
# add FindCenterOfBrainFilter as a subdirectory, rather than just using it for the
# include files.
#
#
# But if a build fails because someone added it to a non-brainsfit application, I
# hope they look at this file and read this comment, and CUT THAT BUSINESS RIGHT OUT.
# Unless this is a subdirectory of BRAINSFit, there's NO USE adding it as a subdirectory
# in the CMakeLists.txt. It will just end in tears.
#
INCLUDE_DIRECTORIES(${BRAINSFit_SOURCE_DIR}/BRAINSFit_Common)
INCLUDE_DIRECTORIES(${BRAINSFit_SOURCE_DIR}/LargestForegroundFilledMaskImageFilter)
INCLUDE_DIRECTORIES(${BRAINSFit_SOURCE_DIR}/FindCenterOfBrainFilter)
include_directories(${BRAINSFit_SOURCE_DIR}/BRAINSFit_Common)
include_directories(${BRAINSFit_SOURCE_DIR}/LargestForegroundFilledMaskImageFilter)
include_directories(${BRAINSFit_SOURCE_DIR}/FindCenterOfBrainFilter)
ENABLE_TESTING()
enable_testing()
include(Dart)
SET(FindCenterOfBrain_SRC
set(FindCenterOfBrain_SRC
FindCenterOfBrainCLP.cxx)
generateclp(FindCenterOfBrain_SRC FindCenterOfBrain.xml)
ADD_EXECUTABLE(FindCenterOfBrain ${FindCenterOfBrain_SRC})
TARGET_LINK_LIBRARIES(FindCenterOfBrain
add_executable(FindCenterOfBrain ${FindCenterOfBrain_SRC})
target_link_libraries(FindCenterOfBrain
${ITK_LIBRARIES}
)
IF(NOT BRAINS_BUILD)
ADD_EXECUTABLE(ImageCompare ImageCompare.cxx)
TARGET_LINK_LIBRARIES(ImageCompare ${ITK_LIBRARIES} )
ENDIF(NOT BRAINS_BUILD)
if(NOT BRAINS_BUILD)
add_executable(ImageCompare ImageCompare.cxx)
target_link_libraries(ImageCompare ${ITK_LIBRARIES} )
endif(NOT BRAINS_BUILD)
set(FINDCENTER_PROG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/FindCenterOfBrain)
ADD_TEST(RudimentaryFindCenterOfBrainTest tclsh ${CMAKE_CURRENT_SOURCE_DIR}}/TestData/FindCenterOfBrainFilter/Test/TestFCOB.tcl
add_test(RudimentaryFindCenterOfBrainTest tclsh ${CMAKE_CURRENT_SOURCE_DIR}}/TestData/FindCenterOfBrainFilter/Test/TestFCOB.tcl
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
${BRAINSFit_SOURCE_DIR}/TestData
${BRAINSFit_BINARY_DIR}/Testing
......
......@@ -6,10 +6,10 @@ cmake_minimum_required(VERSION 2.8)
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
if(POLICY CMP0016)
CMAKE_POLICY(SET CMP0016 NEW)
cmake_policy(SET CMP0016 NEW)
endif()
if(POLICY CMP0017)
CMAKE_POLICY(SET CMP0017 OLD)
cmake_policy(SET CMP0017 OLD)
endif()
enable_testing()
......@@ -104,9 +104,9 @@ set(${CLP}_PRIMARY_SOURCE VBRAINSDemonWarpPrimary.cxx)
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} VBRAINSDemonWarpPrimary.xml "${${CLP}_SOURCE}" "${${CLP}_PRIMARY_SOURCE}" "VBRAINSDemonWarpPrimary" "BRAINSDemonWarpCommonLib")
### Add the Testing Subdirectory.
IF(BUILD_TESTING)
if(BUILD_TESTING)
add_subdirectory(TestSuite)
ENDIF()
endif()
if(NOT Slicer3_SOURCE_DIR)
add_subdirectory(Example)
endif(NOT Slicer3_SOURCE_DIR)
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
## enable_testing()
## include(Dart)
set(CTEST_PROJECT_NAME "BRAINSDemonWarp")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
......
......@@ -33,7 +33,7 @@ add_executable( SimpleDiffeomorphicRegistrationCLP ${SimpleDiffeomorphicRegistra
target_link_libraries(SimpleDiffeomorphicRegistrationCLP BRAINSDemonWarpLIB)
add_test(
NAME ValidateLIB
NAME ValidateLIB
COMMAND ${Slicer_LAUNCH_COMMAND} $<TARGET_FILE:SimpleDiffeomorphicRegistrationCLP>
${BRAINSDemonWarp_SOURCE_DIR}/TestingBRAINSDemonWarp/ANON0006_20_T1_dbg_splayed.nii.gz
${BRAINSDemonWarp_SOURCE_DIR}/TestingBRAINSDemonWarp/ANON0006_20_T1_sag_twisted.nii.gz
......
# This file is configured at cmake time, and loaded at cpack time.
# To pass variables to cpack from cmake, they must be configured
# in this file.
# in this file.
if(CPACK_GENERATOR MATCHES "NSIS")
# set the install/unistall icon used for the installer itself
# There is a bug in NSI that does not handle full unix paths properly.
SET(CPACK_NSIS_MUI_ICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
SET(CPACK_NSIS_MUI_UNIICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
# There is a bug in NSI that does not handle full unix paths properly.
set(CPACK_NSIS_MUI_ICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
set(CPACK_NSIS_MUI_UNIICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
# set the package header icon for MUI
SET(CPACK_PACKAGE_ICON "@BRAINSFit_SOURCE_DIR@/BRAINSLogo.bmp")
set(CPACK_PACKAGE_ICON "@BRAINSFit_SOURCE_DIR@/BRAINSLogo.bmp")
# tell cpack to create links to the doc files
SET(CPACK_NSIS_MENU_LINKS
set(CPACK_NSIS_MENU_LINKS
"http://www.nitrc.org" "Neuroinformatics Tools and Resources Clearinghouse"
)
# Use the icond from cmake-gui for add-remove programs
# SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
# set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
SET(CPACK_NSIS_DISPLAY_NAME "CMake @BRAINSFit_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@ a cross-platform, open-source build system")
SET(CPACK_NSIS_PACKAGE_NAME "CMake @BRAINSFit_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@")
SET(CPACK_NSIS_HELP_LINK "http://www.nitrc.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.nitrc.com")
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
SET(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_DISPLAY_NAME "CMake @BRAINSFit_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@ a cross-platform, open-source build system")
set(CPACK_NSIS_PACKAGE_NAME "CMake @BRAINSFit_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@")
set(CPACK_NSIS_HELP_LINK "http://www.nitrc.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.nitrc.com")
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
set(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS")
# include the cpack options for qt dialog if they exisit
# they might not if qt was not enabled for the build
INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
if(CPACK_GENERATOR MATCHES "CygwinSource")
# when packaging source make sure the .build directory is not included
SET(CPACK_SOURCE_IGNORE_FILES
set(CPACK_SOURCE_IGNORE_FILES
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
endif(CPACK_GENERATOR MATCHES "CygwinSource")
......
......@@ -6,10 +6,10 @@ cmake_minimum_required(VERSION 2.8)
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
if(POLICY CMP0016)
CMAKE_POLICY(SET CMP0016 NEW)
cmake_policy(SET CMP0016 NEW)
endif()
if(POLICY CMP0017)
CMAKE_POLICY(SET CMP0017 OLD)
cmake_policy(SET CMP0017 OLD)
endif()
enable_testing()
......@@ -63,11 +63,11 @@ set(${CLP}_PRIMARY_SOURCE ${BRAINSFit_SOURCE_DIR}/BRAINSFitPrimary.cxx)
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSFitPrimary.xml "${${CLP}_SOURCE}" "${${CLP}_PRIMARY_SOURCE}" "BRAINSFitPrimary" "")
target_link_libraries( ${CLP} BRAINSCommonLib ${ITK_LIBRARIES} ${OPTIONAL_DEBUG_LINK_LIBRARIES})
INSTALL(TARGETS BRAINSFit DESTINATION ${Slicer_INSTALL_BIN_DIR})
install(TARGETS BRAINSFit DESTINATION ${Slicer_INSTALL_BIN_DIR})
IF(BUILD_TESTING)
if(BUILD_TESTING)
add_subdirectory(TestSuite)
ENDIF()
endif()
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "BRAINSFit Image Registration")
......
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
## enable_testing()
## include(Dart)
site_name(SITE)
set(CTEST_PROJECT_NAME "BRAINSFit")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
......
# This file is configured at cmake time, and loaded at cpack time.
# To pass variables to cpack from cmake, they must be configured
# in this file.
# in this file.
if(CPACK_GENERATOR MATCHES "NSIS")
# set the install/unistall icon used for the installer itself
# There is a bug in NSI that does not handle full unix paths properly.
SET(CPACK_NSIS_MUI_ICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
SET(CPACK_NSIS_MUI_UNIICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
# There is a bug in NSI that does not handle full unix paths properly.
set(CPACK_NSIS_MUI_ICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
set(CPACK_NSIS_MUI_UNIICON "@BRAINS_CMAKE_HELPER_DIR@/BRAINSLogo.ico")
# set the package header icon for MUI
SET(CPACK_PACKAGE_ICON "@BRAINSFitIGT_SOURCE_DIR@/BRAINSLogo.bmp")
set(CPACK_PACKAGE_ICON "@BRAINSFitIGT_SOURCE_DIR@/BRAINSLogo.bmp")
# tell cpack to create links to the doc files
SET(CPACK_NSIS_MENU_LINKS
set(CPACK_NSIS_MENU_LINKS
"http://www.nitrc.org" "Neuroinformatics Tools and Resources Clearinghouse"
)
# Use the icond from cmake-gui for add-remove programs
# SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
# set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
SET(CPACK_NSIS_DISPLAY_NAME "CMake @BRAINSFitIGT_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@ a cross-platform, open-source build system")
SET(CPACK_NSIS_PACKAGE_NAME "CMake @BRAINSFitIGT_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@")
SET(CPACK_NSIS_HELP_LINK "http://www.nitrc.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.nitrc.com")
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
SET(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_DISPLAY_NAME "CMake @BRAINSFitIGT_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@ a cross-platform, open-source build system")
set(CPACK_NSIS_PACKAGE_NAME "CMake @BRAINSFitIGT_VERSION_MAJOR@.@BRAINSFit_VERSION_MINOR@")
set(CPACK_NSIS_HELP_LINK "http://www.nitrc.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.nitrc.com")
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
set(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS")
# include the cpack options for qt dialog if they exisit
# they might not if qt was not enabled for the build
INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
if(CPACK_GENERATOR MATCHES "CygwinSource")
# when packaging source make sure the .build directory is not included
SET(CPACK_SOURCE_IGNORE_FILES
set(CPACK_SOURCE_IGNORE_FILES
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
endif(CPACK_GENERATOR MATCHES "CygwinSource")
......
......@@ -46,12 +46,12 @@ set(${CLP}_SOURCE BRAINSFitIGT.cxx ${BRAINSFitIGT_SOURCE_DIR}/BRAINSFitIGTPrima
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSFitIGTPrimary.xml "${${CLP}_SOURCE}" "")
target_link_libraries( ${CLP} BRAINSCommonLib ITKIO ITKAlgorithms ${OPTIONAL_DEBUG_LINK_LIBRARIES})
INSTALL(TARGETS BRAINSFitIGT DESTINATION bin)
install(TARGETS BRAINSFitIGT DESTINATION bin)
# not yet
#IF(BUILD_TESTING)
#if(BUILD_TESTING)
# add_subdirectory(TestSuite)
#ENDIF()
#endif()
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "BRAINSFitIGT Image Registration")
......
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
## enable_testing()
## include(Dart)
site_name(SITE)
set(CTEST_PROJECT_NAME "BRAINSFitIGT")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
......
......@@ -6,10 +6,10 @@ cmake_minimum_required(VERSION 2.8)
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
if(POLICY CMP0016)
CMAKE_POLICY(SET CMP0016 NEW)
cmake_policy(SET CMP0016 NEW)
endif()
if(POLICY CMP0017)
CMAKE_POLICY(SET CMP0017 OLD)
cmake_policy(SET CMP0017 OLD)
endif()
enable_testing()
......@@ -60,6 +60,6 @@ set(${CLP}_PRIMARY_SOURCE BRAINSROIAuto.cxx)
CONFIGUREBRAINSORSLICERPROPERTIES(${CLP} BRAINSROIAuto.xml "${${CLP}_SOURCE}" "${${CLP}_PRIMARY_SOURCE}" "main" "")
target_link_libraries( ${CLP} BRAINSCommonLib ${ITK_LIBRARIES} ${OPTIONAL_DEBUG_LINK_LIBRARIES})
IF(BUILD_TESTING)
if(BUILD_TESTING)
add_subdirectory(TestSuite)
ENDIF()
endif()
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
## enable_testing()
## include(CTest)
set(CTEST_PROJECT_NAME "BRAINSROIAuto")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
......
......@@ -16,9 +16,9 @@ include(${BRAINS_CMAKE_HELPER_DIR}/MIDAS.cmake)
set(MIDAS_KEY_DIR "${PROJECT_SOURCE_DIR}/../BRAINSCommonLib/TestData")
#add_test(
# NAME BRATestImage
# NAME BRATestImage
# COMMAND ${Slicer_LAUNCH_COMMAND} $<TARGET_FILE:BRATestImage>
# ${BRAINSROIAuto_BINARY_DIR}/sphere.nii.gz
# ${BRAINSROIAuto_BINARY_DIR}/sphere.nii.gz
# ${BRAINSROIAuto_BINARY_DIR}/GeneratedMaskSphere.nii.gz
# )
......@@ -27,7 +27,7 @@ midas_add_test(
COMMAND ${Slicer_LAUNCH_COMMAND} $<TARGET_FILE:BRAINSROIAuto>
--inputVolume MIDAS{test.nii.gz.md5}
--outputROIMaskVolume ${TESTING_BINARY_DIR}/BRAINSROIAutoTest_GenerateBrainMask.nii.gz
--ROIAutoDilateSize 10
--ROIAutoDilateSize 10
--outputVolumePixelType uchar
)
set_tests_properties ( BRAINSROIAutoTest_GenerateBrainMask PROPERTIES DEPENDS BRATestImage)
......
......@@ -6,10 +6,10 @@ cmake_minimum_required(VERSION 2.8)
# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details
#-----------------------------------------------------------------------------
if(POLICY CMP0016)
CMAKE_POLICY(SET CMP0016 NEW)
cmake_policy(SET CMP0016 NEW)
endif()
if(POLICY CMP0017)
CMAKE_POLICY(SET CMP0017 OLD)
cmake_policy(SET CMP0017 OLD)
endif()
enable_testing()
......@@ -74,6 +74,6 @@ if(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
endif(BRAINS_BUILD) ## ONLY BUILD FOR BACKWARDS COMPATIBILITY IN BRAINS ENVIRONMENT
### Add the Testing Subdirectory.
IF(BUILD_TESTING)
if(BUILD_TESTING)
add_subdirectory(TestSuite)
ENDIF()
endif()
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
## enable_testing()
## include(CTest)
site_name(SITE)
set(CTEST_PROJECT_NAME "BRAINSResample")
set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
......
......@@ -18,15 +18,15 @@ macro(BRAINSGENERATEMODULESCRIPT progname)
get_target_property(BGCbin_dir ${progname} RUNTIME_OUTPUT_DIRECTORY)
set(BGCbin_name ${progname})
IF(APPLE)
SET(OS_VARNAME_FOR_LIBRARY_PATH "DYLD_LIBRARY_PATH")
ELSE(APPLE)
SET(OS_VARNAME_FOR_LIBRARY_PATH "LD_LIBRARY_PATH")
ENDIF(APPLE)
if(APPLE)
set(OS_VARNAME_FOR_LIBRARY_PATH "DYLD_LIBRARY_PATH")
else(APPLE)
set(OS_VARNAME_FOR_LIBRARY_PATH "LD_LIBRARY_PATH")
endif(APPLE)
CONFIGURE_FILE(${BRAINS_CMAKE_HELPER_DIR}/Module_Dummy.in ${BGCbin_dir}/Modules/${progname} )
configure_file(${BRAINS_CMAKE_HELPER_DIR}/Module_Dummy.in ${BGCbin_dir}/Modules/${progname} )
# FILE(WRITE ${BGCbin_dir}/Modules/${progname}
# file(WRITE ${BGCbin_dir}/Modules/${progname}
# "#!/usr/bin/tclsh
# catch {set script [info script]}
# catch {set script [file normalize \$script]}
......@@ -101,7 +101,7 @@ if(NOT CONFIGUREBRAINSORSLICERPROPERTIES)
else()
GENERATECLP(CLP_SOURCES ${PROGCLI} )
endif()
add_executable( ${PROGNAME} ${CLP_SOURCES} ${PROGCLI_HEADER})
if(WIN32)
......@@ -127,10 +127,10 @@ if(NOT CONFIGUREBRAINSORSLICERPROPERTIES)
slicer3_install_plugins(${TARGETS})
else (Slicer_SOURCE_DIR)
### If building outside of Slicer3, then only build the command line executable.
IF(BRAINS_BUILD)
if(BRAINS_BUILD)
BRAINSGENERATEMODULESCRIPT(${PROGNAME})
ENDIF(BRAINS_BUILD)
INSTALL(TARGETS ${PROGNAME}
endif(BRAINS_BUILD)
install(TARGETS ${PROGNAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
......@@ -174,10 +174,10 @@ macro(CONFIGUREBRAINSORSLICERLIBRARY LIBNAME LIBCLI LIBSOURCES EXTRA_LIBS)
slicer3_install_plugins(${TARGETS})
else (Slicer_SOURCE_DIR)
### If building outside of Slicer3, then only build the command line executable.
IF(BRAINS_BUILD)
if(BRAINS_BUILD)
BRAINSGENERATEMODULESCRIPT(${LIBNAME})
ENDIF(BRAINS_BUILD)
INSTALL(TARGETS ${LIBNAME}
endif(BRAINS_BUILD)
install(TARGETS ${LIBNAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
......
......@@ -17,8 +17,8 @@ endmacro()
## empty until ITK is brought into here as an ExternalProject
macro(PACKAGE_NEEDS_ITK LOCAL_CMAKE_BUILD_OPTIONS gen)
set(packageToCheck ITK)
OPTION(OPT_USE_SYSTEM_${packageToCheck} "Use the system's ${packageToCheck} library." OFF)
# MARK_AS_ADVANCED(OPT_USE_SYSTEM_${packageToCheck})
option(OPT_USE_SYSTEM_${packageToCheck} "Use the system's ${packageToCheck} library." OFF)
# mark_as_advanced(OPT_USE_SYSTEM_${packageToCheck})
if(OPT_USE_SYSTEM_ITK)
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
......@@ -61,8 +61,8 @@ endmacro()
#
macro(PACKAGE_NEEDS_VTKWITHQT LOCAL_CMAKE_BUILD_OPTIONS gen)
set(packageToCheck VTK)
OPTION(OPT_USE_SYSTEM_${packageToCheck} "Use the system's ${packageToCheck} library." OFF)
# MARK_AS_ADVANCED(OPT_USE_SYSTEM_${packageToCheck})
option(OPT_USE_SYSTEM_${packageToCheck} "Use the system's ${packageToCheck} library." OFF)
# mark_as_advanced(OPT_USE_SYSTEM_${packageToCheck})
if(OPT_USE_SYSTEM_VTK)
find_package(VTK 5.6 REQUIRED)
include(${VTK_USE_FILE})
......@@ -126,7 +126,7 @@ macro(PACKAGE_NEEDS_VTKWITHQT LOCAL_CMAKE_BUILD_OPTIONS gen)
set(VTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build)
set(VTK_DEPEND ${proj})
MESSAGE(STATUS "Setting VTK_DIR to -DVTK_DIR:PATH=${VTK_DIR}")
message(STATUS "Setting VTK_DIR to -DVTK_DIR:PATH=${VTK_DIR}")
set(VTK_CMAKE
-DVTK_DIR:PATH=${VTK_DIR}
${QT_ARGS}
......@@ -136,8 +136,8 @@ endmacro()