From 9e733b172c94d91aa860cfa57cb41b47701a8680 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Wed, 25 Jun 2014 16:24:18 -0400 Subject: [PATCH 01/29] ENH: Clean-up build options In a heirarchial build, it is unnecessary to recursively include the find_package options in subdirectories. --- CompressedSensing/CMakeLists.txt | 32 ----- common/CMakeLists.txt | 2 - fibertractdispersion/CMakeLists.txt | 35 ------ ukf/CMakeLists.txt | 35 ------ vtk2mask/CMakeLists.txt | 34 +----- vtk2mask/Slicer4ExtensionBuild/CMakeLists.txt | 110 ----------------- vtkFilter/CMakeLists.txt | 30 +---- .../Slicer4ExtensionBuild/CMakeLists.txt | 113 ------------------ 8 files changed, 4 insertions(+), 387 deletions(-) delete mode 100644 vtk2mask/Slicer4ExtensionBuild/CMakeLists.txt delete mode 100644 vtkFilter/Slicer4ExtensionBuild/CMakeLists.txt diff --git a/CompressedSensing/CMakeLists.txt b/CompressedSensing/CMakeLists.txt index b1988a5..9b23574 100644 --- a/CompressedSensing/CMakeLists.txt +++ b/CompressedSensing/CMakeLists.txt @@ -1,41 +1,9 @@ -cmake_minimum_required(VERSION 2.8.7) find_package(Boost REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) message("Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}") #----------------------------------------------------------------------------- set(MODULE_NAME CompressedSensing) -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR AND NOT UKFTractography_SuperBuild) - find_package(Slicer REQUIRED) - include(${Slicer_USE_FILE}) -endif() - -if(NOT SlicerExecutionModel_FOUND) -find_package(SlicerExecutionModel REQUIRED) -include(${SlicerExecutionModel_USE_FILE}) -endif() - -if(NOT Teem_FOUND) -find_package(Teem REQUIRED) -include(${Teem_USE_FILE}) -endif() - -if(NOT ITK_FOUND) -find_package(ITK REQUIRED) -include(${ITK_USE_FILE}) -endif() - -if(NOT GenerateCLP_FOUND) -find_package(GenerateCLP REQUIRED) -include(${GenerateCLP_USE_FILE}) -endif() - -if(NOT VTK_FOUND) -find_package(VTK REQUIRED) -include(${VTK_USE_FILE}) -endif() - #----------------------------------------------------------------------------- set(MODULE_INCLUDE_DIRECTORIES ${Teem_INCLUDE_DIRS} diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 3263fac..152ecd3 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -1,7 +1,5 @@ project(UKFCommonLib) -cmake_minimum_required(VERSION 2.8.7) - add_library(UKFCommonLib STATIC dummy.cc) install(TARGETS UKFCommonLib diff --git a/fibertractdispersion/CMakeLists.txt b/fibertractdispersion/CMakeLists.txt index 0111fca..788992b 100644 --- a/fibertractdispersion/CMakeLists.txt +++ b/fibertractdispersion/CMakeLists.txt @@ -1,41 +1,6 @@ - -cmake_minimum_required(VERSION 2.8.7) - - #----------------------------------------------------------------------------- set(MODULE_NAME fibertractdispersion) -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR AND NOT UKFTractography_SuperBuild) - find_package(Slicer REQUIRED) - include(${Slicer_USE_FILE}) -endif() - -if(NOT SlicerExecutionModel_FOUND) -find_package(SlicerExecutionModel REQUIRED) -include(${SlicerExecutionModel_USE_FILE}) -endif() - -if(NOT Teem_FOUND) -find_package(Teem REQUIRED) -include(${Teem_USE_FILE}) -endif() - -if(NOT ITK_FOUND) -find_package(ITK REQUIRED) -include(${ITK_USE_FILE}) -endif() - -if(NOT GenerateCLP_FOUND) -find_package(GenerateCLP REQUIRED) -include(${GenerateCLP_USE_FILE}) -endif() - -if(NOT VTK_FOUND) -find_package(VTK REQUIRED) -include(${VTK_USE_FILE}) -endif() - #----------------------------------------------------------------------------- set(MODULE_INCLUDE_DIRECTORIES ${Teem_INCLUDE_DIRS} diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index 130bfa3..725bb0a 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -1,41 +1,6 @@ -cmake_minimum_required(VERSION 2.8.7) - - #----------------------------------------------------------------------------- set(MODULE_NAME UKFTractography) -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR AND NOT UKFTractography_SuperBuild) - find_package(Slicer REQUIRED) - include(${Slicer_USE_FILE}) -endif() - -if(NOT SlicerExecutionModel_FOUND) -find_package(SlicerExecutionModel REQUIRED) -include(${SlicerExecutionModel_USE_FILE}) -endif() - -if(NOT Teem_FOUND) -message("Teem_DIR:${Teem_DIR}") -find_package(Teem REQUIRED) -include(${Teem_USE_FILE}) -endif() - -if(NOT ITK_FOUND) -find_package(ITK REQUIRED) -include(${ITK_USE_FILE}) -endif() - -if(NOT GenerateCLP_FOUND) -find_package(GenerateCLP REQUIRED) -include(${GenerateCLP_USE_FILE}) -endif() - -if(NOT VTK_FOUND) -find_package(VTK REQUIRED) -include(${VTK_USE_FILE}) -endif() - #----------------------------------------------------------------------------- set(MODULE_INCLUDE_DIRECTORIES ${Teem_INCLUDE_DIRS} diff --git a/vtk2mask/CMakeLists.txt b/vtk2mask/CMakeLists.txt index cfe99ec..697240e 100644 --- a/vtk2mask/CMakeLists.txt +++ b/vtk2mask/CMakeLists.txt @@ -1,32 +1,8 @@ -cmake_minimum_required(VERSION 2.8.7) - -include_directories(${CMAKE_INSTALL_PREFIX}/include) -link_directories(${CMAKE_INSTALL_PREFIX}/lib) - #----------------------------------------------------------------------------- set(MODULE_NAME vtk2mask) -#----------------------------------------------------------------------------- -#set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BUILD_DIR}/bin) -#message("exec output path: ${EXECUTABLE_OUTPUT_PATH}") - -#----------------------------------------------------------------------------- -#if(NOT Slicer_SOURCE_DIR AND NOT UKFTractography_SuperBuild) - #find_package(Slicer REQUIRED) - #include(${Slicer_USE_FILE}) -#endif() - -if (UKFTractography_SuperBuild) - find_package(SlicerExecutionModel REQUIRED) - include(${SlicerExecutionModel_USE_FILE}) - - find_package(ITK REQUIRED) - include(${ITK_USE_FILE}) - - find_package(GenerateCLP REQUIRED) - include(${GenerateCLP_USE_FILE}) -endif() +include_directories(${CMAKE_INSTALL_PREFIX}/include) +link_directories(${CMAKE_INSTALL_PREFIX}/lib) set(MODULE_SRCS vtk2mask.cxx @@ -38,12 +14,6 @@ set(MODULE_TARGET_LIBRARIES UKFCommonLib ) -#GENERATECLP(vtk2mask_SOURCE vtk2mask.xml) - -# Add Executables and Link -#ADD_EXECUTABLE(vtk2mask ${vtk2mask_SOURCE} ) -#TARGET_LINK_LIBRARIES(vtk2mask ${ITK_LIBRARIES}) - SEMMacroBuildCLI( NAME ${MODULE_NAME} TARGET_LIBRARIES ${MODULE_TARGET_LIBRARIES} diff --git a/vtk2mask/Slicer4ExtensionBuild/CMakeLists.txt b/vtk2mask/Slicer4ExtensionBuild/CMakeLists.txt deleted file mode 100644 index d5f8b82..0000000 --- a/vtk2mask/Slicer4ExtensionBuild/CMakeLists.txt +++ /dev/null @@ -1,110 +0,0 @@ -########### vtk2mask ####################################################### -## Author of this file: Christian Baumgartner (baumgach@bwh.harvard.edu) -## Last update 6-Jan-2012 - -#----------------------------------------------------------------------------- -cmake_minimum_required(VERSION 2.8.4) -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details -#----------------------------------------------------------------------------- -if(POLICY CMP0017) - cmake_policy(SET CMP0017 OLD) -endif() - -#----------------------------------------------------------------------------- -# Module name -#----------------------------------------------------------------------------- -set(EXTENSION_NAME "vtk2mask") - -#----------------------------------------------------------------------------- -# Prerequisites -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - find_package(Slicer REQUIRED) - - # Additional C/CXX flags - Should be defined before including Slicer_USE_FILE - set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional ${EXTENSION_NAME} C Flags") - set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional ${EXTENSION_NAME} CXX Flags") - - include(${Slicer_USE_FILE}) - - set(EXTENSION_DEPENDS NA) # Specified as a space separated list or 'NA' if any - set(EXTENSION_LICENSE_FILE ${Slicer_LICENSE_FILE}) - set(EXTENSION_README_FILE ${Slicer_README_FILE}) - - include(SlicerEnableExtensionTesting) -endif() - -# Extension meta information -set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Slicer4:Developers:Projects:QtSlicer/Tutorials/ExtensionWriting") -set(EXTENSION_CATEGORY "Diffusion.Tractography") -set(EXTENSION_CONTRIBUTOR "Yogesh Rathi; Christian Baumgartner; Theother Guys") -set(EXTENSION_MAJOR_VERSION 0) -set(EXTENSION_MINOR_VERSION 1) -set(EXTENSION_PATCH_VERSION 0) -set(EXTENSION_STATUS "Beta") -set(EXTENSION_DESCRIPTION "This extension takes a vtk fiber with scalars attached to it and converts it into a scalar volume") -#set(EXTENSION_ACKNOWLEDGEMENTS "This work was supported by ...") -set(EXTENSION_LICENSE_SHORT_DESCRIPTION ${Slicer_LICENSE_SHORT_DESCRIPTION}) - -set(cli_module_export_directive "Q_SLICER_QTMODULES_LOADABLEEXTENSIONTEMPLATE_EXPORT") - -# Additional includes -set(cli_module_include_directories - ) - -# Source files -set(cli_module_SRCS - Converter.cc - vtkData.cc - ) - -# Additional Target libraries -set(cli_module_target_libraries - ${ITK_LIBRARIES} - ) - -#----------------------------------------------------------------------------- -# Build -#----------------------------------------------------------------------------- -slicerMacroBuildCLI( - NAME ${EXTENSION_NAME} - TARGET_LIBRARIES ${cli_module_target_libraries} - INCLUDE_DIRECTORIES ${cli_module_include_directories} - ADDITIONAL_SRCS ${cli_module_SRCS} - EXECUTABLE_ONLY - ) - -#----------------------------------------------------------------------------- -# Testing -#----------------------------------------------------------------------------- -if(BUILD_TESTING) - #add_subdirectory(Testing) -endif() - -#----------------------------------------------------------------------------- -# Generate extension description file '.s4ext' -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - include(SlicerFunctionGenerateExtensionDescription) - slicerFunctionGenerateExtensionDescription( - EXTENSION_NAME ${EXTENSION_NAME} - EXTENSION_CATEGORY ${EXTENSION_CATEGORY} - EXTENSION_STATUS ${EXTENSION_STATUS} - EXTENSION_HOMEPAGE ${EXTENSION_HOMEPAGE} - EXTENSION_DESCRIPTION ${EXTENSION_DESCRIPTION} - EXTENSION_DEPENDS ${EXTENSION_DEPENDS} - DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR} - SLICER_WC_REVISION ${Slicer_WC_REVISION} - SLICER_WC_ROOT ${Slicer_WC_ROOT} - ) -endif() - -#----------------------------------------------------------------------------- -# Packaging -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - include(${Slicer_EXTENSION_CPACK}) -endif() diff --git a/vtkFilter/CMakeLists.txt b/vtkFilter/CMakeLists.txt index e496987..0ea7998 100644 --- a/vtkFilter/CMakeLists.txt +++ b/vtkFilter/CMakeLists.txt @@ -1,30 +1,8 @@ -cmake_minimum_required(VERSION 2.8.7) - -include_directories(${CMAKE_INSTALL_PREFIX}/include) -link_directories(${CMAKE_INSTALL_PREFIX}/lib) - #----------------------------------------------------------------------------- set(MODULE_NAME vtkFilter) -#set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) - -#----------------------------------------------------------------------------- -#if(NOT Slicer_SOURCE_DIR AND NOT UKFTractography_SuperBuild) - #find_package(Slicer REQUIRED) - #include(${Slicer_USE_FILE}) -#endif() - -#----------------------------------------------------------------------------- -if (UKFTractography_SuperBuild) - find_package(SlicerExecutionModel REQUIRED) - include(${SlicerExecutionModel_USE_FILE}) - - find_package(ITK REQUIRED) - include(${ITK_USE_FILE}) - - find_package(GenerateCLP REQUIRED) - include(${GenerateCLP_USE_FILE}) -endif() +include_directories(${CMAKE_INSTALL_PREFIX}/include) +link_directories(${CMAKE_INSTALL_PREFIX}/lib) set(MODULE_SRCS vtkFilter.cxx @@ -46,7 +24,3 @@ SEMMacroBuildCLI( INCLUDE_DIRECTORIES ${MODULE_INCLUDE_DIRECTORIES} ADDITIONAL_SRCS ${MODULE_SRCS} ) - -# Add Executables and Link -#ADD_EXECUTABLE(vtkFilter ${vtkFilter_SOURCE} ) -#TARGET_LINK_LIBRARIES(vtkFilter ${ITK_LIBRARIES}) diff --git a/vtkFilter/Slicer4ExtensionBuild/CMakeLists.txt b/vtkFilter/Slicer4ExtensionBuild/CMakeLists.txt deleted file mode 100644 index 36cf8a4..0000000 --- a/vtkFilter/Slicer4ExtensionBuild/CMakeLists.txt +++ /dev/null @@ -1,113 +0,0 @@ -########### vtkFilter ####################################################### -## Author of this file: Christian Baumgartner (baumgach@bwh.harvard.edu) -## Last update 6-Jan-2012 - -#----------------------------------------------------------------------------- -cmake_minimum_required(VERSION 2.8.4) -#----------------------------------------------------------------------------- - -#----------------------------------------------------------------------------- -# See http://cmake.org/cmake/help/cmake-2-8-docs.html#section_Policies for details -#----------------------------------------------------------------------------- -if(POLICY CMP0017) - cmake_policy(SET CMP0017 OLD) -endif() - -#----------------------------------------------------------------------------- -# Module name -#----------------------------------------------------------------------------- -set(EXTENSION_NAME "vtkFilter") - -#----------------------------------------------------------------------------- -# Prerequisites -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - find_package(Slicer REQUIRED) - - # Additional C/CXX flags - Should be defined before including Slicer_USE_FILE - set(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional ${EXTENSION_NAME} C Flags") - set(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional ${EXTENSION_NAME} CXX Flags") - - include(${Slicer_USE_FILE}) - - set(EXTENSION_DEPENDS NA) # Specified as a space separated list or 'NA' if any - set(EXTENSION_LICENSE_FILE ${Slicer_LICENSE_FILE}) - set(EXTENSION_README_FILE ${Slicer_README_FILE}) - - include(SlicerEnableExtensionTesting) -endif() - -# Extension meta information -set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Slicer4:Developers:Projects:QtSlicer/Tutorials/ExtensionWriting") -set(EXTENSION_CATEGORY "Diffusion.Tractography") -set(EXTENSION_CONTRIBUTOR "Yogesh Rathi; Christian Baumgartner; Theother Guys") -set(EXTENSION_MAJOR_VERSION 0) -set(EXTENSION_MINOR_VERSION 1) -set(EXTENSION_PATCH_VERSION 0) -set(EXTENSION_STATUS "Beta") -set(EXTENSION_DESCRIPTION "This is a test of an advanced VTK Filter that allows for multiple Labelfiles and ROIs") -#set(EXTENSION_ACKNOWLEDGEMENTS "This work was supported by ...") -set(EXTENSION_LICENSE_SHORT_DESCRIPTION ${Slicer_LICENSE_SHORT_DESCRIPTION}) - -set(cli_module_export_directive "Q_SLICER_QTMODULES_LOADABLEEXTENSIONTEMPLATE_EXPORT") - -# Additional includes -set(cli_module_include_directories - ) - -# Source files -set(cli_module_SRCS - FiberFilter.cc - ExpressionEvaluator.cc - ExpressionParser.cc - Region.cc - vtkReader.cc - vtkWriter.cc - ) -# Additional Target libraries -set(cli_module_target_libraries - ${ITK_LIBRARIES} - ) - -#----------------------------------------------------------------------------- -# Build -#----------------------------------------------------------------------------- -slicerMacroBuildCLI( - NAME ${EXTENSION_NAME} - TARGET_LIBRARIES ${cli_module_target_libraries} - INCLUDE_DIRECTORIES ${cli_module_include_directories} - ADDITIONAL_SRCS ${cli_module_SRCS} - EXECUTABLE_ONLY - ) - -#----------------------------------------------------------------------------- -# Testing -#----------------------------------------------------------------------------- -if(BUILD_TESTING) - #add_subdirectory(Testing) -endif() - -#----------------------------------------------------------------------------- -# Generate extension description file '.s4ext' -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - include(SlicerFunctionGenerateExtensionDescription) - slicerFunctionGenerateExtensionDescription( - EXTENSION_NAME ${EXTENSION_NAME} - EXTENSION_CATEGORY ${EXTENSION_CATEGORY} - EXTENSION_STATUS ${EXTENSION_STATUS} - EXTENSION_HOMEPAGE ${EXTENSION_HOMEPAGE} - EXTENSION_DESCRIPTION ${EXTENSION_DESCRIPTION} - EXTENSION_DEPENDS ${EXTENSION_DEPENDS} - DESTINATION_DIR ${CMAKE_CURRENT_BINARY_DIR} - SLICER_WC_REVISION ${Slicer_WC_REVISION} - SLICER_WC_ROOT ${Slicer_WC_ROOT} - ) -endif() - -#----------------------------------------------------------------------------- -# Packaging -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - include(${Slicer_EXTENSION_CPACK}) -endif() From a7db3c07dc85bf07b7735132a3a7f058d1be92ac Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Wed, 25 Jun 2014 17:08:38 -0400 Subject: [PATCH 02/29] ENH: Make compliant with standard extension layout. --- CMakeLists.txt | 15 +++++++++++++++ UKFTractography.cmake | 16 ---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc115a8..19fd3f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,21 @@ set(PRIMARY_PROJECT_NAME UKFTractography) option(${PRIMARY_PROJECT_NAME}_SUPERBUILD "Build ${PRIMARY_PROJECT_NAME} and the projects it depends on via SuperBuild.cmake." ON) mark_as_advanced(${PRIMARY_PROJECT_NAME}_SUPERBUILD) +#----------------------------------------------------------------------------- +set(EXTENSION_NAME ${PRIMARY_PROJECT_NAME}) +set(EXTENSION_HOMEPAGE "http://www.nitrc.org/plugins/mwiki/index.php/ukftractography:MainPage") +set(EXTENSION_CATEGORY "Diffusion.Tractography") +set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner") +set(EXTENSION_MAJOR_VERSION 1) +set(EXTENSION_MINOR_VERSION 2) +set(EXTENSION_PATCH_VERSION 0) +set(EXTENSION_STATUS "Alpha") +set(EXTENSION_DEPENDS "Eigen") +set(EXTENSION_DESCRIPTION "This module traces fibers in a DWI Volume using the multiple tensor unscented Kalman Filter methology. ") +set(EXTENSION_LICENSE_SHORT_DESCRIPTION "Quadratic Programming Library QuadProg++ has LGPL or GPL") +set(EXTENSION_ICONURL "http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Extensions/Testing/CLIExtensionTemplate/CLIExtensionTemplate.png?revision=19437&view=co") +set(EXTENSION_SCREENSHOTURLS "http://wiki.slicer.org/slicerWiki/images/a/ab/Slicer-r19441-CLIExtensionTemplate-screenshot.png http://wiki.slicer.org/slicerWiki/images/1/1e/Slicer-r19441-CLIExtensionTemplate-screenshot-2.png") + #----------------------------------------------------------------------------- # Superbuild script #----------------------------------------------------------------------------- diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 381c6d4..9b4e57f 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -1,21 +1,5 @@ include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake) -#----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) - set(EXTENSION_NAME UKFTractography) - set(EXTENSION_HOMEPAGE "http://www.nitrc.org/plugins/mwiki/index.php/ukftractography:MainPage") - set(EXTENSION_CATEGORY "Diffusion.Tractography") - set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner") - set(EXTENSION_MAJOR_VERSION 1) - set(EXTENSION_MINOR_VERSION 2) - set(EXTENSION_PATCH_VERSION 0) - set(EXTENSION_STATUS "Alpha") - set(EXTENSION_DEPENDS "Eigen") - set(EXTENSION_DESCRIPTION "This module traces fibers in a DWI Volume using the multiple tensor unscented Kalman Filter methology. ") - set(EXTENSION_LICENSE_SHORT_DESCRIPTION "Quadratic Programming Library QuadProg++ has LGPL or GPL") - set(EXTENSION_ICONURL "http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Extensions/Testing/CLIExtensionTemplate/CLIExtensionTemplate.png?revision=19437&view=co") - set(EXTENSION_SCREENSHOTURLS "http://wiki.slicer.org/slicerWiki/images/a/ab/Slicer-r19441-CLIExtensionTemplate-screenshot.png http://wiki.slicer.org/slicerWiki/images/1/1e/Slicer-r19441-CLIExtensionTemplate-screenshot-2.png") -endif() #----------------------------------------------------------------------------- if(NOT Slicer_SOURCE_DIR) From 78602f2e6b16e034fde4f4be58bb20d2c232537a Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Wed, 25 Jun 2014 17:12:59 -0400 Subject: [PATCH 03/29] ENH: Required to have no variables in the EXTENSION_ variables. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fd3f7..a94f77d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ option(${PRIMARY_PROJECT_NAME}_SUPERBUILD "Build ${PRIMARY_PROJECT_NAME} and the mark_as_advanced(${PRIMARY_PROJECT_NAME}_SUPERBUILD) #----------------------------------------------------------------------------- -set(EXTENSION_NAME ${PRIMARY_PROJECT_NAME}) +set(EXTENSION_NAME UKFTractography) set(EXTENSION_HOMEPAGE "http://www.nitrc.org/plugins/mwiki/index.php/ukftractography:MainPage") set(EXTENSION_CATEGORY "Diffusion.Tractography") set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner") From 28ae406cfdedab6a7e2cd65924ee0239b771f6dc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 26 Jun 2014 22:59:56 -0400 Subject: [PATCH 04/29] COMP: Remove unneeded call to "cmake_policy" Since calling 'cmake_minimum_required' with version X.Y.Z implies that policy associated with version X.Y.Z will be set, this commit removes the redundant call to "cmake_policy". For more details, see [1] [1] http://www.cmake.org/cmake/help/v2.8.9/cmake.html#command:cmake_minimum_required --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a94f77d..ff3f5cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,4 @@ cmake_minimum_required(VERSION 2.8.9) #2.8.9 needed for ExternalProject Simplification -cmake_policy(VERSION 2.8.9) set(PRIMARY_PROJECT_NAME UKFTractography) From 7ddf1d6220945f7c3d962c825f8684beeaa8b1dc Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 26 Jun 2014 23:01:29 -0400 Subject: [PATCH 05/29] COMP: Remove duplicated MacOSX platform checks Since the checks are already done in "Common.cmake" that is included from both "SuperBuild.cmake" and "UKFTractography.cmake", this commit removed the duplicate code. --- SuperBuild.cmake | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/SuperBuild.cmake b/SuperBuild.cmake index 1700624..336d9c3 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -56,22 +56,6 @@ else() endif() #----------------------------------------------------------------------------- -# Platform check -#----------------------------------------------------------------------------- - -set(PLATFORM_CHECK true) - -if(PLATFORM_CHECK) - # See CMake/Modules/Platform/Darwin.cmake) - # 6.x == Mac OSX 10.2 (Jaguar) - # 7.x == Mac OSX 10.3 (Panther) - # 8.x == Mac OSX 10.4 (Tiger) - # 9.x == Mac OSX 10.5 (Leopard) - # 10.x == Mac OSX 10.6 (Snow Leopard) - if (DARWIN_MAJOR_VERSION LESS "9") - message(FATAL_ERROR "Only Mac OSX >= 10.5 are supported !") - endif() -endif() set(EXTERNAL_PROJECT_BUILD_TYPE "Release" CACHE STRING "Default build type for support libraries") From ef99a10f237ea39aa232eac033ee9b611e73573d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 26 Jun 2014 23:03:27 -0400 Subject: [PATCH 06/29] COMP: Remove redundant directory includes in ukf/CMakeLists.txt Since the variable MODULE_INCLUDE_DIRECTORIES is passed to the macro SEMMacroBuildCLI, there are no need to manually include the directories. This commit removes the "redundant" call. --- CompressedSensing/CMakeLists.txt | 2 -- fibertractdispersion/CMakeLists.txt | 3 +-- ukf/CMakeLists.txt | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/CompressedSensing/CMakeLists.txt b/CompressedSensing/CMakeLists.txt index 9b23574..ebefbf1 100644 --- a/CompressedSensing/CMakeLists.txt +++ b/CompressedSensing/CMakeLists.txt @@ -10,8 +10,6 @@ set(MODULE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR} ) -include_directories( ${MODULE_INCLUDE_DIRECTORIES} ) - set(MODULE_SRCS CompressedSensing.cxx SphericalHarmonics.cxx diff --git a/fibertractdispersion/CMakeLists.txt b/fibertractdispersion/CMakeLists.txt index 788992b..8941256 100644 --- a/fibertractdispersion/CMakeLists.txt +++ b/fibertractdispersion/CMakeLists.txt @@ -1,3 +1,4 @@ + #----------------------------------------------------------------------------- set(MODULE_NAME fibertractdispersion) @@ -9,8 +10,6 @@ set(MODULE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../ukf ) -include_directories( ${MODULE_INCLUDE_DIRECTORIES} ) - set(MODULE_SRCS fibertractdispersion.cxx computedispersion.cxx diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index 725bb0a..e1f27e2 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -8,8 +8,6 @@ set(MODULE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/../common ) -include_directories( ${MODULE_INCLUDE_DIRECTORIES} ) - set(MODULE_SRCS BRAINSThreadControl.cxx tractography.cc @@ -44,6 +42,8 @@ SEMMacroBuildCLI( ADDITIONAL_SRCS ${MODULE_SRCS} EXECUTABLE_ONLY ) + +#----------------------------------------------------------------------------- SEMMacroBuildCLI( NAME ConvertVTK TARGET_LIBRARIES ${MODULE_TARGET_LIBRARIES} From f2db291684977afccbf9a12b598dd0507db965b5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 26 Jun 2014 23:09:38 -0400 Subject: [PATCH 07/29] COMP: Remove unused CMakeLists.txt in SuperBuild folder The top-level CMakeLists.cmake, based on the value of the UKFTractography_SUPERBUILD variable, already conditionally includes either UKFTractography.cmake or SuperBuild.cmake. This commit removes the SuperBuild/CMakeLists.txt file that contain code already existing in SuperBuild.cmake. --- SuperBuild/CMakeLists.txt | 129 -------------------------------------- 1 file changed, 129 deletions(-) delete mode 100644 SuperBuild/CMakeLists.txt diff --git a/SuperBuild/CMakeLists.txt b/SuperBuild/CMakeLists.txt deleted file mode 100644 index 3594b9c..0000000 --- a/SuperBuild/CMakeLists.txt +++ /dev/null @@ -1,129 +0,0 @@ -# ---------- Superbuild system for UKFTractography ------------------------------------------------------- -# SuperBuild script for the Unscented Kalman Filter Project. It takes care of all dependancies and -# then invokes the main project -# -------------------------------------------------------------------------------------------------------- -cmake_minimum_required(VERSION 2.8.4) -if(POLICY CMP0017) - cmake_policy(SET CMP0017 OLD) -endif() - -project(UKFTractographySuperBuild) - -include(ExternalProject) - -option(BUILD_SHARED_LIBS "Build with shared libraries." OFF) - -#----------------------------------------------------------------------------- -# Settings and Options -#----------------------------------------------------------------------------- -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to 'Release' as none was specified.") - set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) - # Set the possible values of build type for cmake-gui - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") -endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - -string(TOUPPER CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE} BUILD_C_FLAGS) -string(TOUPPER CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} BUILD_CXX_FLAGS) - - -set(COMMON_CMAKE_ARGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DBUILD_EXAMPLES:BOOL=OFF - -DBUILD_TESTING:BOOL=OFF - -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS} - ) - -#----------------------------------------------------------------------------- -# Get External Dependacies -#----------------------------------------------------------------------------- -ExternalProject_add(ITK - GIT_REPOSITORY git://itk.org/ITK.git - GIT_TAG v4.0b01 - UPDATE_COMMAND "" - INSTALL_COMMAND "" - CMAKE_ARGS - ${COMMON_CMAKE_ARGS} - -DITK_LEGACY_REMOVE:BOOL=ON - -DITK_BUILD_ALL_MODULES:BOOL=ON - -DINSTALL_WRAP_ITK_COMPATIBILITY:BOOL=OFF - ) -set(ITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/ITK-prefix/src/ITK-build) - -ExternalProject_add(VTK - GIT_REPOSITORY git://vtk.org/VTK.git - GIT_TAG "v5.10.0" - UPDATE_COMMAND "" - INSTALL_COMMAND "" - CMAKE_ARGS - ${COMMON_CMAKE_ARGS} - -DVTK_LEGACY_REMOVE:BOOL=OFF - -DVTK_USE_PARALLEL:BOOL=ON - ) -set(VTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/VTK-prefix/src/VTK-build) - -ExternalProject_add(SlicerExecutionModel - GIT_REPOSITORY https://github.com/Slicer/SlicerExecutionModel.git - GIT_TAG "origin/master" - UPDATE_COMMAND "" - INSTALL_COMMAND "" - CMAKE_GENERATOR ${gen} - CMAKE_ARGS ${COMMON_CMAKE_ARGS} - -DITK_DIR:PATH=${ITK_DIR} - DEPENDS ITK - ) -set(SlicerExecutionModel_DIR - ${CMAKE_CURRENT_BINARY_DIR}/SlicerExecutionModel-prefix/src/SlicerExecutionModel-build) -set(GenerateCLP_DIR ${SlicerExecutionModel_DIR}/GenerateCLP) - -# the 'find_package' files are not present in the build directory so you have -# to install teem somewhere for find_package to work -set(TEEM_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/teem-prefix/src/teem-install) -ExternalProject_add(teem - SVN_REPOSITORY "http://svn.code.sf.net/p/teem/code/teem/tags/1.10.0" - UPDATE_COMMAND "" - CMAKE_GENERATOR ${gen} - CMAKE_ARGS - ${COMMON_CMAKE_ARGS} - -DCMAKE_INSTALL_PREFIX:PATH=${TEEM_INSTALL_PREFIX} - -DTeem_USE_LIB_INSTALL_SUBDIR:BOOL=OFF - -DTeem_PTHREAD:BOOL=OFF - -DTeem_BZIP2:BOOL=OFF - -DTeem_ZLIB:BOOL=ON - -DTeem_PNG:BOOL=OFF - ) -set(Teem_DIR ${TEEM_INSTALL_PREFIX}/lib/Teem-1.10.0) -#set(Teem_DIR ${TEEM_INSTALL_PREFIX}/lib/) -#set(teem_INCLUDE_DIR ${TEEM_INSTALL_PREFIX}/include) - -#set(BOOST_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/boost-prefix/src/boost-install) -#ExternalProject_add(boost - #URL http://downloads.sourceforge.net/project/boost/boost/1.41.0/boost_1_41_0.tar.gz - #URL_MD5 ddb04c9b9164a36a91dcf36819666dd9 - #BUILD_IN_SOURCE 1 - #CONFIGURE_COMMAND - #/bootstrap.sh - #--prefix=${BOOST_INSTALL_PREFIX} - #link=static - #runtime-link=static - #BUILD_COMMAND "" # /bjam link=static runtime-link=static - #INSTALL_COMMAND /bjam link=static runtime-link=static install -#) -#set(Boost_INCLUDE_DIRS ${BOOST_INSTALL_PREFIX}/include) -#set(Boost_LIBRARY_DIRS ${BOOST_INSTALL_PREFIX}/lib) - -ExternalProject_add(UKFTractography - SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/.. - CMAKE_ARGS - ${COMMON_CMAKE_ARGS} - -DUKFTractography_SuperBuild::bool=ON - -DSlicer_SOURCE_DIR:BOOL=ON ## THIS is a hack to prevent looking for slicer - -DITK_DIR:PATH=${ITK_DIR} - -DVTK_DIR:PATH=${VTK_DIR} - -DTeem_DIR:PATH=${Teem_DIR} - -DGenerateCLP_DIR:PATH=${GenerateCLP_DIR} - -DSlicerExecutionModel_DIR:PATH=${SlicerExecutionModel_DIR} - -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR} - DEPENDS ITK teem SlicerExecutionModel VTK -) - From c97443578106457a6cbc19923f33441a2ee7f5be Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 26 Jun 2014 23:12:51 -0400 Subject: [PATCH 08/29] COMP: Simplify inclusion of SlicerExecutionModel package Since the project makes use of SEMMacroBuildCLI macro, there is no need to selectively integrate "GenerateCLP" and then manually include the macro. By simply looking up the SlicerExecutionModel package and including the associated *_USE_FILE, all required macro will be available. --- UKFTractography.cmake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 9b4e57f..c283612 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -5,14 +5,12 @@ include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake) if(NOT Slicer_SOURCE_DIR) find_package(Slicer REQUIRED) include(${Slicer_USE_FILE}) -else() - #----------------------------------------------------------------------------- - find_package(SlicerExecutionModel REQUIRED GenerateCLP) - include(${GenerateCLP_USE_FILE}) - include(${SlicerExecutionModel_USE_FILE}) - include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake) endif() +#----------------------------------------------------------------------------- +find_package(SlicerExecutionModel REQUIRED) +include(${SlicerExecutionModel_USE_FILE}) + #----------------------------------------------------------------------------- find_package(VTK REQUIRED) include(${VTK_USE_FILE}) From 10d35ccabc522f2f03b81e797c312a44d8e5b82b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 26 Jun 2014 23:54:55 -0400 Subject: [PATCH 09/29] COMP: Simplify how standalone/superbuild and extension case are differentiated This commits enables the following cases: * By default the extension will be built as a standalone project using superbuild to download the required dependencies. * Slicer extension can simply be built specifying -DUKFTractography_BUILD_SLICER_EXTENSION:BOOL=ON -DSlicer_DIR:PATH=/path/to/Slicer-SuperBuild/Slicer-build -DEigen_DIR:PATH=/path/to/Eigen-build --- CMakeLists.txt | 15 ++++++++++++--- Common.cmake | 10 +++++----- SuperBuild.cmake | 4 +--- UKFTractography.cmake | 19 +++++++++++-------- 4 files changed, 29 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff3f5cb..7a51a47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,6 @@ set(PRIMARY_PROJECT_NAME UKFTractography) # Phase II: Build the ${PRIMARY_PROJECT_NAME}, referencing the support # packages built in Phase I. #----------------------------------------------------------------------------- -option(${PRIMARY_PROJECT_NAME}_SUPERBUILD "Build ${PRIMARY_PROJECT_NAME} and the projects it depends on via SuperBuild.cmake." ON) -mark_as_advanced(${PRIMARY_PROJECT_NAME}_SUPERBUILD) #----------------------------------------------------------------------------- set(EXTENSION_NAME UKFTractography) @@ -36,10 +34,21 @@ set(EXTENSION_LICENSE_SHORT_DESCRIPTION "Quadratic Programming Library QuadProg+ set(EXTENSION_ICONURL "http://viewvc.slicer.org/viewvc.cgi/Slicer4/trunk/Extensions/Testing/CLIExtensionTemplate/CLIExtensionTemplate.png?revision=19437&view=co") set(EXTENSION_SCREENSHOTURLS "http://wiki.slicer.org/slicerWiki/images/a/ab/Slicer-r19441-CLIExtensionTemplate-screenshot.png http://wiki.slicer.org/slicerWiki/images/1/1e/Slicer-r19441-CLIExtensionTemplate-screenshot-2.png") +#----------------------------------------------------------------------------- +if(${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) + set(default_superbuild_value OFF) +else() + set(default_superbuild_value ON) +endif() + +#----------------------------------------------------------------------------- +option(${PRIMARY_PROJECT_NAME}_SUPERBUILD "Build ${PRIMARY_PROJECT_NAME} and the projects it depends on via SuperBuild.cmake." ${default_superbuild_value}) +mark_as_advanced(${PRIMARY_PROJECT_NAME}_SUPERBUILD) + #----------------------------------------------------------------------------- # Superbuild script #----------------------------------------------------------------------------- -if(${PRIMARY_PROJECT_NAME}_SUPERBUILD AND NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) +if(${PRIMARY_PROJECT_NAME}_SUPERBUILD) project(SuperBuild_${PRIMARY_PROJECT_NAME}) # <- NOTE: Project name for pre-requisites is different form main project include("${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild.cmake") return() diff --git a/Common.cmake b/Common.cmake index 76365c6..30ce17a 100644 --- a/Common.cmake +++ b/Common.cmake @@ -10,6 +10,10 @@ enable_language(CXX) include(CMakeDependentOption) include(Artichoke) +#----------------------------------------------------------------------------- +# Build option(s) +#----------------------------------------------------------------------------- + option(${PRIMARY_PROJECT_NAME}_INSTALL_DEVELOPMENT "Install development support include and libraries for external packages." OFF) mark_as_advanced(${PRIMARY_PROJECT_NAME}_INSTALL_DEVELOPMENT) @@ -25,10 +29,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") endif() -#----------------------------------------------------------------------------- -# Build option(s) -#----------------------------------------------------------------------------- - #----------------------------------------------------------------------------- # Update CMake module path #------------------------------------------------------------------------------ @@ -74,7 +74,7 @@ endif() # # if you're building as a Slicer extension, this stuff # overrides the defaults being set up for the Extension. -if(UKFTractography_SUPERBUILD AND NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) +if(UKFTractography_SUPERBUILD) #----------------------------------------------------------------------------- SETIFEMPTY(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) diff --git a/SuperBuild.cmake b/SuperBuild.cmake index 336d9c3..bfd9597 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -56,7 +56,6 @@ else() endif() #----------------------------------------------------------------------------- - set(EXTERNAL_PROJECT_BUILD_TYPE "Release" CACHE STRING "Default build type for support libraries") option(USE_SYSTEM_ITK "Build using an externally defined version of ITK" OFF) @@ -274,7 +273,7 @@ endif() #----------------------------------------------------------------------------- # CTestCustom #----------------------------------------------------------------------------- -if(BUILD_TESTING AND NOT Slicer_BUILD_${PROJECT_NAME}) +if(BUILD_TESTING AND NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) configure_file( CMake/CTestCustom.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake @@ -296,7 +295,6 @@ ExternalProject_Add(${proj} ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS} ${${PROJECT_NAME}_EXTERNAL_PROJECT_ARGS} -D${PRIMARY_PROJECT_NAME}_SUPERBUILD:BOOL=OFF #NOTE: VERY IMPORTANT reprocess top level CMakeList.txt - -DSlicer_SOURCE_DIR:BOOL=ON # dummy declaration for standalone build INSTALL_COMMAND "" ) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index c283612..d919a62 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -1,8 +1,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake) - #----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) +if(${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) find_package(Slicer REQUIRED) include(${Slicer_USE_FILE}) endif() @@ -14,9 +13,10 @@ include(${SlicerExecutionModel_USE_FILE}) #----------------------------------------------------------------------------- find_package(VTK REQUIRED) include(${VTK_USE_FILE}) + #----------------------------------------------------------------------------- find_package(ITK REQUIRED) -if(Slicer_BUILD_${PROJECT_NAME}) +if(${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) set(ITK_NO_IO_FACTORY_REGISTER_MANAGER 1) # Incorporate with Slicer nicely endif() include(${ITK_USE_FILE}) @@ -47,12 +47,15 @@ include_directories(${Eigen_INCLUDE_DIR}) add_subdirectory(common) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common) add_subdirectory(ukf) -add_subdirectory(fibertractdispersion) -add_subdirectory(CompressedSensing) -add_subdirectory(vtk2mask) -add_subdirectory(vtkFilter) +if(NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) + add_subdirectory(fibertractdispersion) + add_subdirectory(CompressedSensing) + add_subdirectory(vtk2mask) + add_subdirectory(vtkFilter) +endif() + #----------------------------------------------------------------------------- -if(NOT Slicer_SOURCE_DIR) +if(${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) include(${Slicer_EXTENSION_CPACK}) endif() From 38f7b08c360ebdfe2754f8dc8a6f2322d741fa91 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 00:25:56 -0400 Subject: [PATCH 10/29] COMP: Consistently find teem library Since the teem library provides a TeemConfig.cmake file if it is either build as part of Superbuild or install on the system, it is sufficient to use the "find_package()" call. This commit fixes a configure error [1] by removing the extra call to "find_library" that ended up finding the teem library installed on the system. More specifically, in the Slicer case, the Teem_DIR was used by the previous call to "find_package(teem)" to find the teem library built by Slicer. Modules ended up referencing a mix of system teem library and Slicer teem library. [1] Configure rrror fixed by this commit: 8<----8<----8<----8<----8<----8<----8<----8<---- Cannot generate a safe linker search path for target ConvertVTK because files in some directories may conflict with libraries in implicit directories: link library [libteem.so] in /usr/lib may be hidden by files in: /home/jchris/Projects/Slicer-2-SuperBuild-Release/teem-build/bin 8<----8<----8<----8<----8<----8<----8<----8<---- --- UKFTractography.cmake | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index d919a62..9bf92e4 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -29,18 +29,10 @@ if(NOT Eigen_INCLUDE_DIR) ${Eigen_DIR}/../Eigen) endif() -if(NOT Teem_FOUND) +#----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) -endif() - -find_library(TEEM_LIB name teem PATHS ${Teem_LIBRARY_DIRS}) -if("${TEEM_LIB}" EQUAL "TEEM_LIB-NOTFOUND") - message(FATAL_ERROR "Can't find Teem library TEEM_LIB") -else() - message("TEEM_LIB=${TEEM_LIB}") -endif() - +set(TEEM_LIB teem) include_directories(${Eigen_INCLUDE_DIR}) #----------------------------------------------------------------------------- From 4348ad5ea53abd96bc0dbb189c1bc1df200488c6 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 00:26:49 -0400 Subject: [PATCH 11/29] STYLE: Use consistent indentation in all CMakeLists.txt --- CompressedSensing/CMakeLists.txt | 17 +- CompressedSensing/Testing/CMakeLists.txt | 2 +- UKFTractography.cmake | 3 +- common/CMakeLists.txt | 2 +- fibertractdispersion/CMakeLists.txt | 18 +- fibertractdispersion/Testing/CMakeLists.txt | 2 +- ukf/CMakeLists.txt | 42 ++-- ukf/Testing/Cxx/CMakeLists.txt | 248 ++++++++++---------- vtk2mask/CMakeLists.txt | 10 +- vtkFilter/CMakeLists.txt | 19 +- 10 files changed, 184 insertions(+), 179 deletions(-) diff --git a/CompressedSensing/CMakeLists.txt b/CompressedSensing/CMakeLists.txt index ebefbf1..7ebd12d 100644 --- a/CompressedSensing/CMakeLists.txt +++ b/CompressedSensing/CMakeLists.txt @@ -1,14 +1,17 @@ + +#----------------------------------------------------------------------------- find_package(Boost REQUIRED) include_directories(${Boost_INCLUDE_DIRS}) message("Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}") + #----------------------------------------------------------------------------- set(MODULE_NAME CompressedSensing) #----------------------------------------------------------------------------- set(MODULE_INCLUDE_DIRECTORIES - ${Teem_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} - ) + ${Teem_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ) set(MODULE_SRCS CompressedSensing.cxx @@ -25,10 +28,10 @@ set(MODULE_SRCS ) set(MODULE_TARGET_LIBRARIES - ${ITK_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${TEEM_LIB} - ${VTK_LIBRARIES} + ${ITK_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${TEEM_LIB} + ${VTK_LIBRARIES} ) #----------------------------------------------------------------------------- diff --git a/CompressedSensing/Testing/CMakeLists.txt b/CompressedSensing/Testing/CMakeLists.txt index 7bbc09f..47e7305 100644 --- a/CompressedSensing/Testing/CMakeLists.txt +++ b/CompressedSensing/Testing/CMakeLists.txt @@ -12,4 +12,4 @@ add_test(NAME fibertractdispersion --writeUnCompressed --inputFiberBundle ${BASELINE}/1T_fiber.vtk --outputFiberBundle ${TESTING_RESULTS_DIRECTORY}/${CLP}_1T_fiber.vtk -) + ) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 9bf92e4..8010217 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -21,6 +21,7 @@ if(${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) endif() include(${ITK_USE_FILE}) +#----------------------------------------------------------------------------- if(NOT Eigen_INCLUDE_DIR) if(NOT Eigen_DIR) message(FATAL_ERROR "Missing Eigen_DIR path, can't find Eigen library includes") @@ -28,13 +29,13 @@ if(NOT Eigen_INCLUDE_DIR) set(Eigen_INCLUDE_DIR ${Eigen_DIR}/../Eigen) endif() +include_directories(${Eigen_INCLUDE_DIR}) #----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) set(TEEM_LIB teem) -include_directories(${Eigen_INCLUDE_DIR}) #----------------------------------------------------------------------------- add_subdirectory(common) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 152ecd3..add160a 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -6,7 +6,7 @@ install(TARGETS UKFCommonLib RUNTIME DESTINATION bin COMPONENT RuntimeLibraries LIBRARY DESTINATION lib COMPONENT RuntimeLibraries ARCHIVE DESTINATION lib COMPONENT Development -) + ) file(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h") file(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/fibertractdispersion/CMakeLists.txt b/fibertractdispersion/CMakeLists.txt index 8941256..9ccb514 100644 --- a/fibertractdispersion/CMakeLists.txt +++ b/fibertractdispersion/CMakeLists.txt @@ -4,11 +4,11 @@ set(MODULE_NAME fibertractdispersion) #----------------------------------------------------------------------------- set(MODULE_INCLUDE_DIRECTORIES - ${Teem_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../common - ${CMAKE_CURRENT_SOURCE_DIR}/../ukf - ) + ${Teem_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../common + ${CMAKE_CURRENT_SOURCE_DIR}/../ukf + ) set(MODULE_SRCS fibertractdispersion.cxx @@ -17,10 +17,10 @@ set(MODULE_SRCS ) set(MODULE_TARGET_LIBRARIES - ${ITK_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${VTK_LIBRARIES} - ${TEEM_LIB} + ${ITK_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${VTK_LIBRARIES} + ${TEEM_LIB} ) #----------------------------------------------------------------------------- diff --git a/fibertractdispersion/Testing/CMakeLists.txt b/fibertractdispersion/Testing/CMakeLists.txt index 7bbc09f..47e7305 100644 --- a/fibertractdispersion/Testing/CMakeLists.txt +++ b/fibertractdispersion/Testing/CMakeLists.txt @@ -12,4 +12,4 @@ add_test(NAME fibertractdispersion --writeUnCompressed --inputFiberBundle ${BASELINE}/1T_fiber.vtk --outputFiberBundle ${TESTING_RESULTS_DIRECTORY}/${CLP}_1T_fiber.vtk -) + ) diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index e1f27e2..fbc3ffc 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -3,31 +3,31 @@ set(MODULE_NAME UKFTractography) #----------------------------------------------------------------------------- set(MODULE_INCLUDE_DIRECTORIES - ${Teem_INCLUDE_DIRS} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../common - ) + ${Teem_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/../common + ) set(MODULE_SRCS - BRAINSThreadControl.cxx - tractography.cc - unscented_kalman_filter.cc - filter_model.cc - seed.cc - ukffiber.cc - NrrdData.cc - vtk_writer.cc - dwi_normalize.cc - utilities.cc - thread.cc - QuadProg++_Eigen.cc - ) + BRAINSThreadControl.cxx + tractography.cc + unscented_kalman_filter.cc + filter_model.cc + seed.cc + ukffiber.cc + NrrdData.cc + vtk_writer.cc + dwi_normalize.cc + utilities.cc + thread.cc + QuadProg++_Eigen.cc + ) set(MODULE_TARGET_LIBRARIES - ${ITK_LIBRARIES} - ${CMAKE_THREAD_LIBS_INIT} - ${TEEM_LIB} - ${VTK_LIBRARIES} + ${ITK_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT} + ${TEEM_LIB} + ${VTK_LIBRARIES} ) #----------------------------------------------------------------------------- diff --git a/ukf/Testing/Cxx/CMakeLists.txt b/ukf/Testing/Cxx/CMakeLists.txt index 256bed9..a02908a 100644 --- a/ukf/Testing/Cxx/CMakeLists.txt +++ b/ukf/Testing/Cxx/CMakeLists.txt @@ -20,7 +20,8 @@ set_target_properties(${CLP}Test PROPERTIES LABELS ${CLP}) # remove output files before running tests macro(RMTestFile CleanupTestName FileToRemove) add_test(NAME ${CleanupTestName} - COMMAND ${CMAKE_COMMAND} -E remove ${FileToRemove}) + COMMAND ${CMAKE_COMMAND} -E remove ${FileToRemove} + ) endmacro() # 1T no free water @@ -30,29 +31,29 @@ set(testname ${CLP}_1T_Test) RMTestFile(${testname}-cleanup ${TESTING_RESULTS_DIRECTORY}/1T_fiber.vtk) add_test(NAME ${testname} - COMMAND ${SEM_LAUNCH_COMMAND} $ - --dwiFile ${INPUT}/single_tensor.nhdr - --maskFile ${INPUT}/mask.nhdr - --tracts ${TESTING_RESULTS_DIRECTORY}/1T_fiber.vtk - --seedsFile ${INPUT}/seed.nhdr - --seedsPerVoxel 1 - --numTensor 1 - --numThreads 1 - --minBranchingAngle 0.0 - --maxBranchingAngle 0.0 - --simpleTensorModel - --recordNMSE - ) + COMMAND ${SEM_LAUNCH_COMMAND} $ + --dwiFile ${INPUT}/single_tensor.nhdr + --maskFile ${INPUT}/mask.nhdr + --tracts ${TESTING_RESULTS_DIRECTORY}/1T_fiber.vtk + --seedsFile ${INPUT}/seed.nhdr + --seedsPerVoxel 1 + --numTensor 1 + --numThreads 1 + --minBranchingAngle 0.0 + --maxBranchingAngle 0.0 + --simpleTensorModel + --recordNMSE + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) set(testname ${CLP}_1T_Test_Compare) add_test(NAME ${testname} - COMMAND ${CLP}Test - ${TESTING_RESULTS_DIRECTORY}/1T_fiber.vtk - ${BASELINE}/1T_fiber.vtk -) + COMMAND ${CLP}Test + ${TESTING_RESULTS_DIRECTORY}/1T_fiber.vtk + ${BASELINE}/1T_fiber.vtk + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_1T_Test) @@ -64,30 +65,30 @@ set(testname ${CLP}_1T_fw_Test) RMTestFile(${testname}-cleanup ${TESTING_RESULTS_DIRECTORY}/1T_fw_fiber.vtk) add_test(NAME ${testname} - COMMAND ${SEM_LAUNCH_COMMAND} $ - --dwiFile ${INPUT}/single_tensor_fw.nhdr - --maskFile ${INPUT}/mask.nhdr - --tracts ${TESTING_RESULTS_DIRECTORY}/1T_fw_fiber.vtk - --seedsFile ${INPUT}/seed.nhdr - --seedsPerVoxel 1 - --numTensor 1 - --numThreads 1 - --minBranchingAngle 0.0 - --maxBranchingAngle 0.0 - --simpleTensorModel - --recordNMSE - --freeWater - --recordFreeWater -) + COMMAND ${SEM_LAUNCH_COMMAND} $ + --dwiFile ${INPUT}/single_tensor_fw.nhdr + --maskFile ${INPUT}/mask.nhdr + --tracts ${TESTING_RESULTS_DIRECTORY}/1T_fw_fiber.vtk + --seedsFile ${INPUT}/seed.nhdr + --seedsPerVoxel 1 + --numTensor 1 + --numThreads 1 + --minBranchingAngle 0.0 + --maxBranchingAngle 0.0 + --simpleTensorModel + --recordNMSE + --freeWater + --recordFreeWater + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) set(testname ${CLP}_1T_fw_Test_Compare) add_test(NAME ${testname} - COMMAND ${CLP}Test - ${TESTING_RESULTS_DIRECTORY}/1T_fw_fiber.vtk - ${BASELINE}/1T_fw_fiber.vtk -) + COMMAND ${CLP}Test + ${TESTING_RESULTS_DIRECTORY}/1T_fw_fiber.vtk + ${BASELINE}/1T_fw_fiber.vtk + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_1T_fw_Test) @@ -116,16 +117,16 @@ add_test(NAME ${testname} --Qm 0.001 --Ql 10 --Rs 0.015 -) + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) set(testname ${CLP}_2T_Test_Compare) add_test(NAME ${testname} - COMMAND ${CLP}Test - ${TESTING_RESULTS_DIRECTORY}/2T_fiber.vtk - ${BASELINE}/2T_fiber.vtk -) + COMMAND ${CLP}Test + ${TESTING_RESULTS_DIRECTORY}/2T_fiber.vtk + ${BASELINE}/2T_fiber.vtk + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_Test) @@ -139,35 +140,35 @@ set(testname ${CLP}_2T_fw_Test) RMTestFile(${testname}-cleanup ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk) add_test(NAME ${testname} - COMMAND ${SEM_LAUNCH_COMMAND} $ - -a - --dwiFile ${INPUT}/two_tensor_fw.nhdr - --maskFile ${INPUT}/mask.nhdr - --tracts ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk - --seedsFile ${INPUT}/seed.nhdr - --seedsPerVoxel 1 - --numTensor 2 - --numThreads 1 - --minBranchingAngle 0.0 - --maxBranchingAngle 0.0 - --simpleTensorModel - --recordNMSE - --freeWater - --recordFreeWater - --minFA 0.1 - --minGA 0.05 - --Qm 0.01 - --Ql 10 - --Rs 0.015 -) + COMMAND ${SEM_LAUNCH_COMMAND} $ + -a + --dwiFile ${INPUT}/two_tensor_fw.nhdr + --maskFile ${INPUT}/mask.nhdr + --tracts ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk + --seedsFile ${INPUT}/seed.nhdr + --seedsPerVoxel 1 + --numTensor 2 + --numThreads 1 + --minBranchingAngle 0.0 + --maxBranchingAngle 0.0 + --simpleTensorModel + --recordNMSE + --freeWater + --recordFreeWater + --minFA 0.1 + --minGA 0.05 + --Qm 0.01 + --Ql 10 + --Rs 0.015 + ) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) set(testname ${CLP}_2T_fw_Test_Compare) add_test(NAME ${testname} - COMMAND ${CLP}Test - ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk - ${BASELINE}/2T_fw_fiber.vtk -) + COMMAND ${CLP}Test + ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk + ${BASELINE}/2T_fw_fiber.vtk + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_Test) @@ -177,34 +178,34 @@ set(testname ${CLP}_2T_fw_TestBinary) RMTestFile(${testname}-cleanup ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk) add_test(NAME ${testname} - COMMAND ${SEM_LAUNCH_COMMAND} $ - --dwiFile ${INPUT}/two_tensor_fw.nhdr - --maskFile ${INPUT}/mask.nhdr - --tracts ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk - --seedsFile ${INPUT}/seed.nhdr - --seedsPerVoxel 1 - --numTensor 2 - --numThreads 1 - --minBranchingAngle 0.0 - --maxBranchingAngle 0.0 - --simpleTensorModel - --recordNMSE - --freeWater - --recordFreeWater - --minFA 0.1 - --minGA 0.05 - --Qm 0.01 - --Ql 10 - --Rs 0.015 -) + COMMAND ${SEM_LAUNCH_COMMAND} $ + --dwiFile ${INPUT}/two_tensor_fw.nhdr + --maskFile ${INPUT}/mask.nhdr + --tracts ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk + --seedsFile ${INPUT}/seed.nhdr + --seedsPerVoxel 1 + --numTensor 2 + --numThreads 1 + --minBranchingAngle 0.0 + --maxBranchingAngle 0.0 + --simpleTensorModel + --recordNMSE + --freeWater + --recordFreeWater + --minFA 0.1 + --minGA 0.05 + --Qm 0.01 + --Ql 10 + --Rs 0.015 + ) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) set(testname ${CLP}_2T_fw_TestBinary_Compare) add_test(NAME ${testname} - COMMAND ${CLP}Test - ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk - ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk -) + COMMAND ${CLP}Test + ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk + ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_Test) @@ -213,34 +214,34 @@ set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_TestBinary) set(testname ${CLP}_2T_fw_TestBinaryVTP) RMTestFile(${testname}-cleanup ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtp) add_test(NAME ${testname} - COMMAND ${SEM_LAUNCH_COMMAND} $ - --dwiFile ${INPUT}/two_tensor_fw.nhdr - --maskFile ${INPUT}/mask.nhdr - --tracts ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtp - --seedsFile ${INPUT}/seed.nhdr - --seedsPerVoxel 1 - --numTensor 2 - --numThreads 1 - --minBranchingAngle 0.0 - --maxBranchingAngle 0.0 - --simpleTensorModel - --recordNMSE - --freeWater - --recordFreeWater - --minFA 0.1 - --minGA 0.05 - --Qm 0.01 - --Ql 10 - --Rs 0.015 -) + COMMAND ${SEM_LAUNCH_COMMAND} $ + --dwiFile ${INPUT}/two_tensor_fw.nhdr + --maskFile ${INPUT}/mask.nhdr + --tracts ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtp + --seedsFile ${INPUT}/seed.nhdr + --seedsPerVoxel 1 + --numTensor 2 + --numThreads 1 + --minBranchingAngle 0.0 + --maxBranchingAngle 0.0 + --simpleTensorModel + --recordNMSE + --freeWater + --recordFreeWater + --minFA 0.1 + --minGA 0.05 + --Qm 0.01 + --Ql 10 + --Rs 0.015 + ) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) set(testname ${CLP}_2T_fw_TestBinaryVTP_Compare) add_test(NAME ${testname} - COMMAND ${CLP}Test - ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk - ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtp -) + COMMAND ${CLP}Test + ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtk + ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber-binary.vtp + ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_TestBinary) @@ -252,7 +253,7 @@ add_test(NAME ${testname} COMMAND ${SEM_LAUNCH_COMMAND} $ -i ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk -o ${TESTING_RESULTS_DIRECTORY}/${testname}.vtk -) + ) # depends on last of chain of 2T_fw_fiber tests; will depend on all of them set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_TestBinaryVTP) @@ -260,8 +261,7 @@ add_test(NAME ${testname}Compare COMMAND ${CLP}Test ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk ${TESTING_RESULTS_DIRECTORY}/${testname}.vtk -) - + ) set_property(TEST ${testname}Compare PROPERTY LABELS ConvertVTK) set_tests_properties(${testname}Compare PROPERTIES DEPENDS ${testname}) @@ -276,7 +276,7 @@ add_test(NAME ${testname} -a -u -i ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk -o ${TESTING_RESULTS_DIRECTORY}/${testname}.vtp -) + ) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) # depends on last of chain of 2T_fw_fiber tests; will depend on all of them @@ -286,7 +286,7 @@ add_test(NAME ${testname}Compare COMMAND ${CLP}Test ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk ${TESTING_RESULTS_DIRECTORY}/${testname}.vtp -) + ) set_property(TEST ${testname}Compare PROPERTY LABELS ConvertVTK) set_tests_properties(${testname}Compare PROPERTIES DEPENDS ${testname}) @@ -301,7 +301,7 @@ add_test(NAME ${testname} COMMAND ${SEM_LAUNCH_COMMAND} $ -i ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk -o ${TESTING_RESULTS_DIRECTORY}/${testname}.vtp -) + ) # depends on last of chain of 2T_fw_fiber tests; will depend on all of them set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_TestBinaryVTP) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) @@ -309,7 +309,7 @@ add_test(NAME ${testname}Compare COMMAND ${CLP}Test ${TESTING_RESULTS_DIRECTORY}/2T_fw_fiber.vtk ${TESTING_RESULTS_DIRECTORY}/${testname}.vtp -) + ) set_property(TEST ${testname}Compare PROPERTY LABELS ConvertVTK) set_tests_properties(${testname}Compare PROPERTIES DEPENDS ${testname}) @@ -327,7 +327,7 @@ add_test(NAME ${testname} -a -i ${TESTING_RESULTS_DIRECTORY}/${XMLBinaryCompressed}.vtp -o ${TESTING_RESULTS_DIRECTORY}/${testname}.vtk -) + ) # depends on last of chain of 2T_fw_fiber tests; will depend on all of them set_tests_properties(${testname} PROPERTIES DEPENDS ${CLP}_2T_fw_TestBinaryVTP) set_tests_properties(${testname} PROPERTIES DEPENDS ${testname}-cleanup) @@ -337,7 +337,7 @@ add_test(NAME ${testname}Compare COMMAND ${CLP}Test ${TESTING_RESULTS_DIRECTORY}/${XMLBinaryCompressed}.vtp ${TESTING_RESULTS_DIRECTORY}/${testname}.vtk -) + ) set_property(TEST ${testname}Compare PROPERTY LABELS ConvertVTK) set_tests_properties(${testname}Compare PROPERTIES DEPENDS ${testname}) diff --git a/vtk2mask/CMakeLists.txt b/vtk2mask/CMakeLists.txt index 697240e..cea8183 100644 --- a/vtk2mask/CMakeLists.txt +++ b/vtk2mask/CMakeLists.txt @@ -5,13 +5,13 @@ include_directories(${CMAKE_INSTALL_PREFIX}/include) link_directories(${CMAKE_INSTALL_PREFIX}/lib) set(MODULE_SRCS - vtk2mask.cxx - Converter.cc - ) + vtk2mask.cxx + Converter.cc + ) set(MODULE_TARGET_LIBRARIES - ${ITK_LIBRARIES} - UKFCommonLib + ${ITK_LIBRARIES} + UKFCommonLib ) SEMMacroBuildCLI( diff --git a/vtkFilter/CMakeLists.txt b/vtkFilter/CMakeLists.txt index 0ea7998..9266868 100644 --- a/vtkFilter/CMakeLists.txt +++ b/vtkFilter/CMakeLists.txt @@ -1,3 +1,4 @@ + #----------------------------------------------------------------------------- set(MODULE_NAME vtkFilter) @@ -5,17 +6,17 @@ include_directories(${CMAKE_INSTALL_PREFIX}/include) link_directories(${CMAKE_INSTALL_PREFIX}/lib) set(MODULE_SRCS - vtkFilter.cxx - vtkWriter.cc - FiberFilter.cc - Region.cc - ExpressionParser.cc - ExpressionEvaluator.cc - ) + vtkFilter.cxx + vtkWriter.cc + FiberFilter.cc + Region.cc + ExpressionParser.cc + ExpressionEvaluator.cc + ) set(MODULE_TARGET_LIBRARIES - ${ITK_LIBRARIES} - UKFCommonLib + ${ITK_LIBRARIES} + UKFCommonLib ) SEMMacroBuildCLI( From d795c7a5e7d7096e4b2afd725217e5fdd8c88791 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 02:14:37 -0400 Subject: [PATCH 12/29] STYLE: Remove unused code from Eigen external project --- SuperBuild/External_Eigen.cmake | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/SuperBuild/External_Eigen.cmake b/SuperBuild/External_Eigen.cmake index d68386a..5ecc439 100644 --- a/SuperBuild/External_Eigen.cmake +++ b/SuperBuild/External_Eigen.cmake @@ -1,18 +1,3 @@ -# Make sure this file is included only once by creating globally unique varibles -# based on the name of this included file. -# get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE) -# if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED) -# return() -# endif() -# set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1) - -## External_${extProjName}.cmake files can be recurisvely included, -## and cmake variables are global, so when including sub projects it -## is important make the extProjName and proj variables -## appear to stay constant in one of these files. -## Store global variables before overwriting (then restore at end of this file.) -superbuild_stack_push(CACHED_extProjName ${extProjName}) -superbuild_stack_push(CACHED_proj ${proj}) # Make sure that the ExtProjName/IntProjName variables are unique globally # even if other External_${ExtProjName}.cmake files are sourced by @@ -21,10 +6,6 @@ set(extProjName Eigen) #The find_package known name set(proj Eigen) #This local name set(${extProjName}_REQUIRED_VERSION "") #If a required version is necessary, then set this, else leave blank -#if(${USE_SYSTEM_${extProjName}}) -# unset(${extProjName}_DIR CACHE) -#endif() - # Sanity checks if(DEFINED ${extProjName}_DIR AND NOT EXISTS ${${extProjName}_DIR}) message(FATAL_ERROR "${extProjName}_DIR variable is defined but corresponds to non-existing directory (${${extProjName}_DIR})") @@ -32,9 +13,6 @@ endif() # Set dependency list set(${proj}_DEPENDENCIES "") -#if(${PROJECT_NAME}_BUILD_DICOM_SUPPORT) -# list(APPEND ${proj}_DEPENDENCIES DCMTK) -#endif() # Include dependent projects if any ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj}_DEPENDENCIES) From 8595414383bf0cb36f2e6e4edeedf3bd25f73e43 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 02:16:21 -0400 Subject: [PATCH 13/29] COMP: Fix build error disabling Eigen Qt dependency On system without Qt development libraries installed in a default system location, Eigen couldn't be built. This commit removed the Qt dependency by disabling the test depending on Qt. --- SuperBuild/External_Eigen.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/SuperBuild/External_Eigen.cmake b/SuperBuild/External_Eigen.cmake index 5ecc439..977449e 100644 --- a/SuperBuild/External_Eigen.cmake +++ b/SuperBuild/External_Eigen.cmake @@ -34,6 +34,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" set(${proj}_CMAKE_OPTIONS -DCMAKE_INSTALL_PREFIX:PATH=${${proj}_INSTALL_DIR} -DEIGEN_BUILD_PKGCONFIG:BOOL=OFF + -DEIGEN_TEST_NOQT:BOOL=ON ) ### --- End Project specific additions From 55666fb3fdb5d4d661e93d904427ca9b69ffbd9c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 02:22:25 -0400 Subject: [PATCH 14/29] COMP: Update teem project to allow use of system teem. This commit update the external project so that it conditionally download and build teem. --- SuperBuild/External_teem.cmake | 160 +++++++++++++++++---------------- 1 file changed, 82 insertions(+), 78 deletions(-) diff --git a/SuperBuild/External_teem.cmake b/SuperBuild/External_teem.cmake index f5afeba..948c325 100644 --- a/SuperBuild/External_teem.cmake +++ b/SuperBuild/External_teem.cmake @@ -20,93 +20,97 @@ if(DEFINED Teem_DIR AND NOT EXISTS ${Teem_DIR}) message(FATAL_ERROR "Teem_DIR variable is defined but corresponds to non-existing directory") endif() -set(EXTERNAL_PROJECT_OPTIONAL_ARGS) +if(NOT DEFINED Teem_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}) + set(EXTERNAL_PROJECT_OPTIONAL_ARGS) -set(CMAKE_PROJECT_INCLUDE_EXTERNAL_PROJECT_ARG) -if(CTEST_USE_LAUNCHERS) - set(CMAKE_PROJECT_INCLUDE_EXTERNAL_PROJECT_ARG - "-DCMAKE_PROJECT_Teem_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake") -endif() + set(CMAKE_PROJECT_INCLUDE_EXTERNAL_PROJECT_ARG) + if(CTEST_USE_LAUNCHERS) + set(CMAKE_PROJECT_INCLUDE_EXTERNAL_PROJECT_ARG + "-DCMAKE_PROJECT_Teem_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake") + endif() -if(${CMAKE_VERSION} VERSION_GREATER "2.8.11.2") - # Following CMake commit 2a7975398, the FindPNG.cmake module - # supports detection of release and debug libraries. Specifying only - # the release variable is enough to ensure the variable PNG_LIBRARY - # is internally set if the project is built either in Debug or Release. - list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS - -DPNG_LIBRARY_RELEASE:FILEPATH=${PNG_LIBRARY} - ) -else() - list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS - -DPNG_LIBRARY:FILEPATH=${PNG_LIBRARY} - ) -endif() + if(${CMAKE_VERSION} VERSION_GREATER "2.8.11.2") + # Following CMake commit 2a7975398, the FindPNG.cmake module + # supports detection of release and debug libraries. Specifying only + # the release variable is enough to ensure the variable PNG_LIBRARY + # is internally set if the project is built either in Debug or Release. + list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS + -DPNG_LIBRARY_RELEASE:FILEPATH=${PNG_LIBRARY} + ) + else() + list(APPEND EXTERNAL_PROJECT_OPTIONAL_ARGS + -DPNG_LIBRARY:FILEPATH=${PNG_LIBRARY} + ) + endif() -set(${proj}_REPOSITORY "${git_protocol}://github.com/BRAINSia/teem.git") -set(${proj}_TAG "bcf5abb8edf862566aabd6b0fb8f8f78155c8d8f") + set(${proj}_REPOSITORY "${git_protocol}://github.com/BRAINSia/teem.git") + set(${proj}_TAG "bcf5abb8edf862566aabd6b0fb8f8f78155c8d8f") -# -# the Teem build makes a TeemConfig.cmake, but it is incorrect, because it assumes -# library files go into /bin or /lib -set(Teem_Ep_Args) -foreach(eparg ${COMMENT_EXTERNAL_PROJECT_ARGS}) - set(skipvar) - foreach(pat ".*CMAKE_LIBRARY_OUTPUT_DIRECTORY.*" - ".*CMAKE_ARCHIVE_OUTPUT_DIRECTORY.*" - ".*CMAKE_RUNTIME_OUTPUT_DIRECTORY.*") - if("${eparg}" MATCHES ${pat}) - list(APPEND skipvar "${eparg}") + # + # the Teem build makes a TeemConfig.cmake, but it is incorrect, because it assumes + # library files go into /bin or /lib + set(Teem_Ep_Args) + foreach(eparg ${COMMENT_EXTERNAL_PROJECT_ARGS}) + set(skipvar) + foreach(pat ".*CMAKE_LIBRARY_OUTPUT_DIRECTORY.*" + ".*CMAKE_ARCHIVE_OUTPUT_DIRECTORY.*" + ".*CMAKE_RUNTIME_OUTPUT_DIRECTORY.*") + if("${eparg}" MATCHES ${pat}) + list(APPEND skipvar "${eparg}") + endif() + endforeach() + if(NOT skipvar) + list(APPEND Teem_Ep_args "${eparg}") endif() endforeach() - if(NOT skipvar) - list(APPEND Teem_Ep_args "${eparg}") - endif() -endforeach() -ExternalProject_Add(${proj} - ${${proj}_EP_ARGS} - GIT_REPOSITORY ${${proj}_REPOSITORY} - GIT_TAG ${${proj}_TAG} - URL_MD5 ${teem_MD5} - DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} - SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/teem - BINARY_DIR teem-build - CMAKE_ARGS -Wno-dev --no-warn-unused-cli - CMAKE_CACHE_ARGS - ${Teem_EP_ARGS} - -DBUILD_TESTING:BOOL=OFF - -DBUILD_SHARED_LIBS:BOOL=OFF - ${CMAKE_PROJECT_INCLUDE_EXTERNAL_PROJECT_ARG} - -DTeem_USE_LIB_INSTALL_SUBDIR:BOOL=ON - -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF - -DVTK_DIR:PATH=${VTK_DIR} - -DTeem_PTHREAD:BOOL=OFF - -DTeem_BZIP2:BOOL=OFF - -DTeem_ZLIB:BOOL=ON - -DTeem_PNG:BOOL=OFF - -DZLIB_ROOT:PATH=${ZLIB_ROOT} - -DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR} - -DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY} - -DTeem_VTK_MANGLE:BOOL=OFF ## NOT NEEDED FOR EXTERNAL ZLIB outside of vtk - -DPNG_PNG_INCLUDE_DIR:PATH=${PNG_INCLUDE_DIR} - -DTeem_PNG_DLLCONF_IPATH:PATH=${VTK_DIR}/Utilities - ${EXTERNAL_PROJECT_OPTIONAL_ARGS} - INSTALL_COMMAND "" - DEPENDS - ${${proj}_DEPENDENCIES} - ) + ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} + GIT_REPOSITORY ${${proj}_REPOSITORY} + GIT_TAG ${${proj}_TAG} + URL_MD5 ${teem_MD5} + DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} + SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/teem + BINARY_DIR teem-build + CMAKE_ARGS -Wno-dev --no-warn-unused-cli + CMAKE_CACHE_ARGS + ${Teem_EP_ARGS} + -DBUILD_TESTING:BOOL=OFF + -DBUILD_SHARED_LIBS:BOOL=OFF + ${CMAKE_PROJECT_INCLUDE_EXTERNAL_PROJECT_ARG} + -DTeem_USE_LIB_INSTALL_SUBDIR:BOOL=ON + -DCMAKE_VERBOSE_MAKEFILE:BOOL=OFF + -DVTK_DIR:PATH=${VTK_DIR} + -DTeem_PTHREAD:BOOL=OFF + -DTeem_BZIP2:BOOL=OFF + -DTeem_ZLIB:BOOL=ON + -DTeem_PNG:BOOL=OFF + -DZLIB_ROOT:PATH=${ZLIB_ROOT} + -DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR} + -DZLIB_LIBRARY:FILEPATH=${ZLIB_LIBRARY} + -DTeem_VTK_MANGLE:BOOL=OFF ## NOT NEEDED FOR EXTERNAL ZLIB outside of vtk + -DPNG_PNG_INCLUDE_DIR:PATH=${PNG_INCLUDE_DIR} + -DTeem_PNG_DLLCONF_IPATH:PATH=${VTK_DIR}/Utilities + ${EXTERNAL_PROJECT_OPTIONAL_ARGS} + INSTALL_COMMAND "" + DEPENDS + ${${proj}_DEPENDENCIES} + ) -# ExternalProject_Add_Step(${proj} fix_AIR_EXISTS -# COMMAND ${CMAKE_COMMAND} -DAIR_FILE=${SOURCE_DOWNLOAD_CACHE}/teem/src/air/air.h -# -P ${CMAKE_CURRENT_LIST_DIR}/TeemPatch.cmake -# COMMAND ${CMAKE_COMMAND} -E make_directory ${SOURCE_DOWNLOAD_CACHE}/teem/include/teem -# COMMAND ${CMAKE_COMMAND} -E copy ${SOURCE_DOWNLOAD_CACHE}/teem/src/bane/bane.h -# ${SOURCE_DOWNLOAD_CACHE}/teem/include/teem/bane.h -# DEPENDEES download -# DEPENDERS configure -# ) + # ExternalProject_Add_Step(${proj} fix_AIR_EXISTS + # COMMAND ${CMAKE_COMMAND} -DAIR_FILE=${SOURCE_DOWNLOAD_CACHE}/teem/src/air/air.h + # -P ${CMAKE_CURRENT_LIST_DIR}/TeemPatch.cmake + # COMMAND ${CMAKE_COMMAND} -E make_directory ${SOURCE_DOWNLOAD_CACHE}/teem/include/teem + # COMMAND ${CMAKE_COMMAND} -E copy ${SOURCE_DOWNLOAD_CACHE}/teem/src/bane/bane.h + # ${SOURCE_DOWNLOAD_CACHE}/teem/include/teem/bane.h + # DEPENDEES download + # DEPENDERS configure + # ) -set(Teem_DIR ${CMAKE_BINARY_DIR}/teem-build) + set(Teem_DIR ${CMAKE_BINARY_DIR}/teem-build) +else() + ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES}) +endif() mark_as_superbuild( VARS Teem_DIR:PATH From 66845d0badfc10bc1aedad9576cc86ce9c010923 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 02:31:54 -0400 Subject: [PATCH 15/29] COMP: Simplify management of output and install directories This commit remove the Slicer specific settings from SlicerExectionModel and ensure the project will be configured with the expected values. Then, it is not needed anymore to overwrite the SlicerExecutionModel_DEFAULT_* variable in the current scope. This has been tested for both a SlicerExtension and a standalone built. In both case the libraries are built where expected. --- Common.cmake | 32 ++++----------- SuperBuild.cmake | 41 +++++++++++-------- .../External_SlicerExecutionModel.cmake | 11 ----- 3 files changed, 33 insertions(+), 51 deletions(-) diff --git a/Common.cmake b/Common.cmake index 30ce17a..6e4e7dd 100644 --- a/Common.cmake +++ b/Common.cmake @@ -71,31 +71,15 @@ if(NOT COMMAND SETIFEMPTY) endmacro() endif() -# -# if you're building as a Slicer extension, this stuff -# overrides the defaults being set up for the Extension. -if(UKFTractography_SUPERBUILD) - - #----------------------------------------------------------------------------- - SETIFEMPTY(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) - SETIFEMPTY(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) - SETIFEMPTY(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) - - #----------------------------------------------------------------------------- - SETIFEMPTY(CMAKE_INSTALL_LIBRARY_DESTINATION lib) - SETIFEMPTY(CMAKE_INSTALL_ARCHIVE_DESTINATION lib) - SETIFEMPTY(CMAKE_INSTALL_RUNTIME_DESTINATION bin) - - set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION ${CMAKE_INSTALL_RUNTIME_DESTINATION}) - set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION ${CMAKE_INSTALL_LIBRARY_DESTINATION}) - set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION ${CMAKE_INSTALL_ARCHIVE_DESTINATION}) -endif() - -# these apparently need to be set to something; -SETIFEMPTY(SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION bin) -SETIFEMPTY(SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION lib) -SETIFEMPTY(SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION lib) +#----------------------------------------------------------------------------- +SETIFEMPTY(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +SETIFEMPTY(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +SETIFEMPTY(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +#----------------------------------------------------------------------------- +SETIFEMPTY(CMAKE_INSTALL_LIBRARY_DESTINATION lib) +SETIFEMPTY(CMAKE_INSTALL_ARCHIVE_DESTINATION lib) +SETIFEMPTY(CMAKE_INSTALL_RUNTIME_DESTINATION bin) #------------------------------------------------------------------------- # Augment compiler flags diff --git a/SuperBuild.cmake b/SuperBuild.cmake index bfd9597..c255b32 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -62,6 +62,31 @@ option(USE_SYSTEM_ITK "Build using an externally defined version of ITK" OFF) option(USE_SYSTEM_SlicerExecutionModel "Build using an externally defined version of SlicerExecutionModel" OFF) option(USE_SYSTEM_VTK "Build using an externally defined version of VTK" OFF) +#------------------------------------------------------------------------------ +set(SlicerExecutionModel_INSTALL_BIN_DIR bin) +set(SlicerExecutionModel_INSTALL_LIB_DIR lib) +set(SlicerExecutionModel_INSTALL_NO_DEVELOPMENT 1) +set(SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY bin) +set(SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY lib) +set(SlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY lib) +set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION bin) +set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION lib) +set(SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION lib) + +mark_as_superbuild( + VARS + SlicerExecutionModel_INSTALL_BIN_DIR:STRING + SlicerExecutionModel_INSTALL_LIB_DIR:STRING + SlicerExecutionModel_INSTALL_NO_DEVELOPMENT + SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY:PATH + SlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY:PATH + SlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY:PATH + SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION:PATH + SlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION:PATH + SlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION:PATH + PROJECTS SlicerExecutionModel + ) + #------------------------------------------------------------------------------ # ${PRIMARY_PROJECT_NAME} dependency list #------------------------------------------------------------------------------ @@ -194,12 +219,6 @@ if(APPLE) -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}) endif() -set(${PRIMARY_PROJECT_NAME}_CLI_RUNTIME_DESTINATION bin) -set(${PRIMARY_PROJECT_NAME}_CLI_LIBRARY_DESTINATION lib) -set(${PRIMARY_PROJECT_NAME}_CLI_ARCHIVE_DESTINATION lib) -set(${PRIMARY_PROJECT_NAME}_CLI_INSTALL_RUNTIME_DESTINATION bin) -set(${PRIMARY_PROJECT_NAME}_CLI_INSTALL_LIBRARY_DESTINATION lib) -set(${PRIMARY_PROJECT_NAME}_CLI_INSTALL_ARCHIVE_DESTINATION lib) #----------------------------------------------------------------------------- # Add external project CMake args #----------------------------------------------------------------------------- @@ -212,16 +231,6 @@ list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS Teem_DIR:PATH Eigen_INCLUDE_DIR:PATH SlicerExecutionModel_DIR:PATH - ${PRIMARY_PROJECT_NAME}_CLI_LIBRARY_OUTPUT_DIRECTORY:PATH - ${PRIMARY_PROJECT_NAME}_CLI_ARCHIVE_OUTPUT_DIRECTORY:PATH - ${PRIMARY_PROJECT_NAME}_CLI_RUNTIME_OUTPUT_DIRECTORY:PATH - ${PRIMARY_PROJECT_NAME}_CLI_INSTALL_LIBRARY_DESTINATION:PATH - ${PRIMARY_PROJECT_NAME}_CLI_INSTALL_ARCHIVE_DESTINATION:PATH - ${PRIMARY_PROJECT_NAME}_CLI_INSTALL_RUNTIME_DESTINATION:PATH - - INSTALL_RUNTIME_DESTINATION:STRING - INSTALL_LIBRARY_DESTINATION:STRING - INSTALL_ARCHIVE_DESTINATION:STRING ) _expand_external_project_vars() diff --git a/SuperBuild/External_SlicerExecutionModel.cmake b/SuperBuild/External_SlicerExecutionModel.cmake index b706679..a9a2c18 100644 --- a/SuperBuild/External_SlicerExecutionModel.cmake +++ b/SuperBuild/External_SlicerExecutionModel.cmake @@ -42,17 +42,6 @@ if(NOT DEFINED SlicerExecutionModel_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM -DBUILD_TESTING:BOOL=OFF -DITK_DIR:PATH=${ITK_DIR} -DDCMTK_DIR:PATH=${DCMTK_DIR} - -DSlicerExecutionModel_LIBRARY_PROPERTIES:STRING=${Slicer_LIBRARY_PROPERTIES} - -DSlicerExecutionModel_INSTALL_BIN_DIR:PATH=${Slicer_INSTALL_LIB_DIR} - -DSlicerExecutionModel_INSTALL_LIB_DIR:PATH=${Slicer_INSTALL_LIB_DIR} - #-DSlicerExecutionModel_INSTALL_SHARE_DIR:PATH=${Slicer_INSTALL_ROOT}share/${SlicerExecutionModel} - -DSlicerExecutionModel_INSTALL_NO_DEVELOPMENT:BOOL=${Slicer_INSTALL_NO_DEVELOPMENT} - -DSlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_BINARY_INNER_SUBDIR}/${Slicer_CLIMODULES_BIN_DIR} - -DSlicerExecutionModel_DEFAULT_CLI_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_BINARY_INNER_SUBDIR}/${Slicer_CLIMODULES_LIB_DIR} - -DSlicerExecutionModel_DEFAULT_CLI_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_BINARY_INNER_SUBDIR}/${Slicer_CLIMODULES_LIB_DIR} - -DSlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION:STRING=${Slicer_INSTALL_CLIMODULES_BIN_DIR} - -DSlicerExecutionModel_DEFAULT_CLI_INSTALL_LIBRARY_DESTINATION:STRING=${Slicer_INSTALL_CLIMODULES_LIB_DIR} - -DSlicerExecutionModel_DEFAULT_CLI_INSTALL_ARCHIVE_DESTINATION:STRING=${Slicer_INSTALL_CLIMODULES_LIB_DIR} ${EXTERNAL_PROJECT_OPTIONAL_ARGS} INSTALL_COMMAND "" DEPENDS From b5eb9b0d4a8249d9672020252c47fd9ee95f2978 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 09:47:26 -0400 Subject: [PATCH 16/29] COMP: Simplify passing of variable to external projects Instead of manually creating list of option to give to each project, this commits removed redundant code and leverage the "mark_as_superbuild" macro. By specifying the ALL_PROJECTS value, we ensure that the option will be passed down to all external projects. By using "ExternalProject_Include_Dependencies", the CMAKE_GENERATOR option will be automatically passed to each project using it. This commit removed the explicit management of this parameter. Finally, since the passing of the _DIR variable is already set by calling "mark_as_superbuild" in each external project, this commit removed the explicit management of these. --- SuperBuild.cmake | 253 ++++++++++------------------- SuperBuild/External_Boost.cmake | 22 +-- SuperBuild/External_Eigen.cmake | 21 +-- SuperBuild/External_JPEG.cmake | 25 +-- SuperBuild/External_OpenJPEG.cmake | 46 ++---- SuperBuild/External_TIFF.cmake | 25 ++- SuperBuild/External_VTK.cmake | 2 +- 7 files changed, 127 insertions(+), 267 deletions(-) diff --git a/SuperBuild.cmake b/SuperBuild.cmake index c255b32..b6a635b 100644 --- a/SuperBuild.cmake +++ b/SuperBuild.cmake @@ -35,14 +35,6 @@ find_package(Git REQUIRED) #----------------------------------------------------------------------------- include(ExternalProject) -# Compute -G arg for configuring external projects with the same CMake generator: -if(CMAKE_EXTRA_GENERATOR) - set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}") -else() - set(gen "${CMAKE_GENERATOR}") -endif() - - # With CMake 2.8.9 or later, the UPDATE_COMMAND is required for updates to occur. # For earlier versions, we nullify the update state to prevent updates and # undesirable rebuild. @@ -92,7 +84,6 @@ mark_as_superbuild( #------------------------------------------------------------------------------ set(ITK_EXTERNAL_NAME ITKv${ITK_VERSION_MAJOR}) - ## for i in SuperBuild/*; do echo $i |sed 's/.*External_\([a-zA-Z]*\).*/\1/g'|fgrep -v cmake|fgrep -v Template; done|sort -u set(${PRIMARY_PROJECT_NAME}_DEPENDENCIES SlicerExecutionModel @@ -103,180 +94,104 @@ set(${PRIMARY_PROJECT_NAME}_DEPENDENCIES Boost ) -#----------------------------------------------------------------------------- -# Define Superbuild global variables -#----------------------------------------------------------------------------- - -# This variable will contain the list of CMake variable specific to each external project -# that should passed to ${CMAKE_PROJECT_NAME}. -# The item of this list should have the following form: : -# where '' is an external project variable and TYPE is either BOOL, STRING, PATH or FILEPATH. -# TODO Variable appended to this list will be automatically exported in ${PRIMARY_PROJECT_NAME}Config.cmake, -# prefix '${PRIMARY_PROJECT_NAME}_' will be prepended if it applies. -set(${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS) - -# The macro '_expand_external_project_vars' can be used to expand the list of . -set(${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS) # List of CMake args to configure ${PROJECT_NAME} -set(${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES) # List of CMake variable names - -# Convenient macro allowing to expand the list of EP_VAR listed in ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS -# The expanded arguments will be appended to the list ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS -# Similarly the name of the EP_VARs will be appended to the list ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES. -macro(_expand_external_project_vars) - set(${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS "") - set(${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES "") - foreach(arg ${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS}) - string(REPLACE ":" ";" varname_and_vartype ${arg}) - set(target_info_list ${target_info_list}) - list(GET varname_and_vartype 0 _varname) - list(GET varname_and_vartype 1 _vartype) - list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS -D${_varname}:${_vartype}=${${_varname}}) - list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES ${_varname}) - endforeach() -endmacro() - #----------------------------------------------------------------------------- # Common external projects CMake variables #----------------------------------------------------------------------------- -list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS - MAKECOMMAND:STRING - CMAKE_SKIP_RPATH:BOOL - CMAKE_BUILD_TYPE:STRING - BUILD_SHARED_LIBS:BOOL - CMAKE_CXX_COMPILER:PATH - CMAKE_CXX_FLAGS:STRING - CMAKE_CXX_FLAGS_DEBUG:STRING - CMAKE_CXX_FLAGS_MINSIZEREL:STRING - CMAKE_CXX_FLAGS_RELEASE:STRING - CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING - CMAKE_C_COMPILER:PATH - CMAKE_C_FLAGS:STRING - CMAKE_C_FLAGS_DEBUG:STRING - CMAKE_C_FLAGS_MINSIZEREL:STRING - CMAKE_C_FLAGS_RELEASE:STRING - CMAKE_C_FLAGS_RELWITHDEBINFO:STRING - CMAKE_EXE_LINKER_FLAGS:STRING - CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING - CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING - CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING - CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING - CMAKE_MODULE_LINKER_FLAGS:STRING - CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING - CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING - CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING - CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING - CMAKE_SHARED_LINKER_FLAGS:STRING - CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING - CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING - CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING - CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING - CMAKE_GENERATOR:STRING - CMAKE_EXTRA_GENERATOR:STRING - CMAKE_INSTALL_PREFIX:PATH - CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH - CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH - CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH - CMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH - CTEST_NEW_FORMAT:BOOL - MEMORYCHECK_COMMAND_OPTIONS:STRING - MEMORYCHECK_COMMAND:PATH - CMAKE_SHARED_LINKER_FLAGS:STRING - CMAKE_EXE_LINKER_FLAGS:STRING - CMAKE_MODULE_LINKER_FLAGS:STRING - SITE:STRING - BUILDNAME:STRING - ${PROJECT_NAME}_BUILD_DICOM_SUPPORT:BOOL - PYTHON_EXECUTABLE:FILEPATH - PYTHON_INCLUDE_DIR:PATH - PYTHON_LIBRARY:FILEPATH - BOOST_ROOT:PATH - BOOST_INCLUDE_DIR:PATH +mark_as_superbuild( + VARS + MAKECOMMAND:STRING + CMAKE_SKIP_RPATH:BOOL + BUILD_SHARED_LIBS:BOOL + CMAKE_CXX_COMPILER:PATH + CMAKE_CXX_FLAGS:STRING + CMAKE_CXX_FLAGS_DEBUG:STRING + CMAKE_CXX_FLAGS_MINSIZEREL:STRING + CMAKE_CXX_FLAGS_RELEASE:STRING + CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING + CMAKE_C_COMPILER:PATH + CMAKE_C_FLAGS:STRING + CMAKE_C_FLAGS_DEBUG:STRING + CMAKE_C_FLAGS_MINSIZEREL:STRING + CMAKE_C_FLAGS_RELEASE:STRING + CMAKE_C_FLAGS_RELWITHDEBINFO:STRING + CMAKE_EXE_LINKER_FLAGS:STRING + CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING + CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING + CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING + CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING + CMAKE_MODULE_LINKER_FLAGS:STRING + CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING + CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING + CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING + CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING + CMAKE_SHARED_LINKER_FLAGS:STRING + CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING + CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING + CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING + CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING + CMAKE_INSTALL_PREFIX:PATH + CMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH + CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH + CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH + CMAKE_BUNDLE_OUTPUT_DIRECTORY:PATH + CTEST_NEW_FORMAT:BOOL + MEMORYCHECK_COMMAND_OPTIONS:STRING + MEMORYCHECK_COMMAND:PATH + CMAKE_SHARED_LINKER_FLAGS:STRING + CMAKE_EXE_LINKER_FLAGS:STRING + CMAKE_MODULE_LINKER_FLAGS:STRING + SITE:STRING + BUILDNAME:STRING + ${PROJECT_NAME}_BUILD_DICOM_SUPPORT:BOOL + PYTHON_EXECUTABLE:FILEPATH + PYTHON_INCLUDE_DIR:PATH + PYTHON_LIBRARY:FILEPATH + BOOST_ROOT:PATH + BOOST_INCLUDE_DIR:PATH + ALL_PROJECTS ) if(${PRIMARY_PROJECT_NAME}_USE_QT) - list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS - ${PRIMARY_PROJECT_NAME}_USE_QT:BOOL - QT_QMAKE_EXECUTABLE:PATH - QT_MOC_EXECUTABLE:PATH - QT_UIC_EXECUTABLE:PATH - ) + mark_as_superbuild(VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_UIC_EXECUTABLE) endif() - -_expand_external_project_vars() -set(COMMON_EXTERNAL_PROJECT_ARGS ${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS}) -set(extProjName ${PRIMARY_PROJECT_NAME}) -set(proj ${PRIMARY_PROJECT_NAME}) -ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${PRIMARY_PROJECT_NAME}_DEPENDENCIES) +mark_as_superbuild(${PRIMARY_PROJECT_NAME}_USE_QT) #----------------------------------------------------------------------------- -# Set CMake OSX variable to pass down the external project +# Set CMake OSX variable to pass down the external projects #----------------------------------------------------------------------------- -set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS) if(APPLE) - list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS - -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}) + mark_as_superbuild( + VARS CMAKE_OSX_ARCHITECTURES:STRING CMAKE_OSX_SYSROOT:PATH CMAKE_OSX_DEPLOYMENT_TARGET:STRING + ALL_PROJECTS + ) endif() +set(extProjName ${PRIMARY_PROJECT_NAME}) +set(proj ${PRIMARY_PROJECT_NAME}) +ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${PRIMARY_PROJECT_NAME}_DEPENDENCIES) + #----------------------------------------------------------------------------- # Add external project CMake args #----------------------------------------------------------------------------- -list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS - BUILD_EXAMPLES:BOOL - BUILD_TESTING:BOOL - ITK_VERSION_MAJOR:STRING - ITK_DIR:PATH - VTK_DIR:PATH - Teem_DIR:PATH - Eigen_INCLUDE_DIR:PATH - SlicerExecutionModel_DIR:PATH - ) -_expand_external_project_vars() +mark_as_superbuild( + VARS + BUILD_EXAMPLES:BOOL + BUILD_TESTING:BOOL + ITK_VERSION_MAJOR:STRING + ) +#----------------------------------------------------------------------------- # # By default we want to build ${PROJECT_NAME} stuff using the CMAKE_BUILD_TYPE of # the top level build, but build the support libraries in Release. -# So make one list of parameters to pass to ${PROJECT_NAME} when we build it and -# another for all the prerequisite libraries +# So make a list of option that will be passed only to all the prerequisite libraries. # -# since we use a macro to build the list of arguments, it's easier to modify the -# list after it's built than try and conditionally change just the build type in the macro. - -set(${PROJECT_NAME}_EXTERNAL_PROJECT_ARGS ${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS}) - set(COMMON_EXTERNAL_PROJECT_ARGS) -foreach(arg ${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS}) - if(arg MATCHES "-DCMAKE_BUILD_TYPE:STRING.*") - set(_arg -DCMAKE_BUILD_TYPE:STRING=${EXTERNAL_PROJECT_BUILD_TYPE}) - else() - set(_arg ${arg}) - endif() - list(APPEND COMMON_EXTERNAL_PROJECT_ARGS ${_arg}) -endforeach() - -#----------------------------------------------------------------------------- -set(verbose FALSE) -#----------------------------------------------------------------------------- -if(verbose) -foreach(x ${COMMON_EXTERNAL_PROJECT_ARGS}) - message("COMMON_EXTERNAL_PROJECT_ARGS: ${x}") -endforeach() - - message("Inner external project args:") - foreach(arg ${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_ARGS}) - message(" ${arg}") - endforeach() -endif() - -string(REPLACE ";" "^" ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES "${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES}") - -if(verbose) - message("Inner external project argnames:") - foreach(argname ${${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARNAMES}) - message(" ${argname}") - endforeach() +if(NOT CMAKE_CONFIGURATION_TYPES) + list(APPEND COMMON_EXTERNAL_PROJECT_ARGS + -DCMAKE_BUILD_TYPE:STRING=${EXTERNAL_PROJECT_BUILD_TYPE} + ) endif() #----------------------------------------------------------------------------- @@ -294,24 +209,24 @@ endif() #------------------------------------------------------------------------------ set(proj ${PRIMARY_PROJECT_NAME}) ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} DEPENDS ${${PRIMARY_PROJECT_NAME}_DEPENDENCIES} DOWNLOAD_COMMAND "" SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} BINARY_DIR ${PRIMARY_PROJECT_NAME}-build - CMAKE_GENERATOR ${gen} CMAKE_ARGS --no-warn-unused-cli # HACK Only expected variables should be passed down. - ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS} - ${${PROJECT_NAME}_EXTERNAL_PROJECT_ARGS} -D${PRIMARY_PROJECT_NAME}_SUPERBUILD:BOOL=OFF #NOTE: VERY IMPORTANT reprocess top level CMakeList.txt INSTALL_COMMAND "" ) -## Force rebuilding of the main subproject every time building from super structure +# This custom external project step forces the build and later +# steps to run whenever a top level build is done... ExternalProject_Add_Step(${proj} forcebuild - COMMAND ${CMAKE_COMMAND} -E remove - ${CMAKE_CURRENT_BUILD_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build - DEPENDEES configure - DEPENDERS build - ALWAYS 1 + COMMAND ${CMAKE_COMMAND} -E remove + ${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build + COMMENT "Forcing build step for '${proj}'" + DEPENDEES build + ALWAYS 1 ) + diff --git a/SuperBuild/External_Boost.cmake b/SuperBuild/External_Boost.cmake index a3d1d10..9ad0179 100644 --- a/SuperBuild/External_Boost.cmake +++ b/SuperBuild/External_Boost.cmake @@ -26,15 +26,6 @@ ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" ) ) #message(STATUS "${__indent}Adding project ${proj}") - # Set CMake OSX variable to pass down the external project - set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS) - if(APPLE) - list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_SYSROOT:STRING=${CMAKE_OSX_SYSROOT} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}) - endif() - ### --- Project specific additions here set(Boost_Install_Dir ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install) set(Boost_Configure_Script ${CMAKE_CURRENT_LIST_DIR}/External_Boost_configureboost.cmake) @@ -50,20 +41,21 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" endif() set(BOOST_SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj}) ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} URL ${${proj}_URL} URL_MD5 ${${proj}_MD5} SOURCE_DIR ${BOOST_SOURCE_DIR} ${cmakeversion_external_update} "${cmakeversion_external_update_value}" CONFIGURE_COMMAND ${CMAKE_COMMAND} - ${CLANG_ARG} - -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj} - -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir} - -P ${Boost_Configure_Script} + ${CLANG_ARG} + -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj} + -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir} + -P ${Boost_Configure_Script} INSTALL_COMMAND "" BUILD_IN_SOURCE 1 BUILD_COMMAND ${CMAKE_COMMAND} - -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/Boost - -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir} -P ${Boost_Build_Script} + -DBUILD_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/Boost + -DBOOST_INSTALL_DIR:PATH=${Boost_Install_Dir} -P ${Boost_Build_Script} ) set(BOOST_ROOT ${BOOST_SOURCE_DIR}) set(BOOST_INCLUDE_DIR ${BOOST_SOURCE_DIR}) diff --git a/SuperBuild/External_Eigen.cmake b/SuperBuild/External_Eigen.cmake index 977449e..eb44026 100644 --- a/SuperBuild/External_Eigen.cmake +++ b/SuperBuild/External_Eigen.cmake @@ -20,15 +20,6 @@ ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" ) ) #message(STATUS "${__indent}Adding project ${proj}") - # Set CMake OSX variable to pass down the external project - set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS) - if(APPLE) - list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_SYSROOT:STRING=${CMAKE_OSX_SYSROOT} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}) - endif() - ### --- Project specific additions here set(${proj}_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-install) set(${proj}_CMAKE_OPTIONS @@ -42,6 +33,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" set(${proj}_GIT_TAG "032b16f4853237fb70f20d9028ee0ad5d543b0b2") #URL https://bitbucket.org/eigen/eigen/get/3.2.0.tar.gz ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} GIT_REPOSITORY ${${proj}_REPOSITORY} GIT_TAG ${${proj}_GIT_TAG} SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj} @@ -52,10 +44,8 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" LOG_INSTALL 0 # Wrap install in script to to ignore log output from dashboards ${cmakeversion_external_update} "${cmakeversion_external_update_value}" INSTALL_DIR ${${proj}_INSTALL_DIR} - CMAKE_GENERATOR ${gen} CMAKE_ARGS -Wno-dev --no-warn-unused-cli CMAKE_CACHE_ARGS - ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS} ${COMMON_EXTERNAL_PROJECT_ARGS} ${${proj}_CMAKE_OPTIONS} ## We really do want to install in order to limit # of include paths INSTALL_COMMAND "" @@ -74,7 +64,10 @@ else() ExternalProject_Add_Empty(${proj} "${${proj}_DEPENDENCIES}") endif() -list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS ${extProjName}_DIR:PATH) +mark_as_superbuild( + VARS + ${extProjName}_DIR:PATH + ${extProjName}_INCLUDE_DIR:PATH + LABELS "FIND_PACKAGE" + ) -superbuild_stack_pop(CACHED_extProjName extProjName) -superbuild_stack_pop(CACHED_proj proj) diff --git a/SuperBuild/External_JPEG.cmake b/SuperBuild/External_JPEG.cmake index fedf060..6e1a4db 100644 --- a/SuperBuild/External_JPEG.cmake +++ b/SuperBuild/External_JPEG.cmake @@ -16,9 +16,6 @@ endif() # Set dependency list set(${proj}_DEPENDENCIES "") -#if(${PROJECT_NAME}_BUILD_DICOM_SUPPORT) -# list(APPEND ${proj}_DEPENDENCIES DCMTK) -#endif() # Include dependent projects if any ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj}_DEPENDENCIES) @@ -26,18 +23,6 @@ ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj if(NOT ( DEFINED "USE_SYSTEM_${proj}" AND "${USE_SYSTEM_${proj}}" ) ) #message(STATUS "${__indent}Adding project ${proj}") - # Set CMake OSX variable to pass down the external project - set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS) - if(APPLE) - list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_SYSROOT:STRING=${CMAKE_OSX_SYSROOT} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}) - endif() - - - - AutoConf_FLAGS(${proj}_CFLAGS C "") AutoConf_FLAGS(${proj}_CXXFLAGS CXX "") @@ -45,6 +30,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${proj}" AND "${USE_SYSTEM_${proj}}" ) ) set(${proj}_REPOSITORY ${git_protocol}://github.com/BRAINSia/JPeg9A.git) set(${proj}_GIT_TAG BRAINSTools_CompilerCleanup) ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} GIT_REPOSITORY ${${proj}_REPOSITORY} GIT_TAG ${${proj}_GIT_TAG} SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj} @@ -54,7 +40,6 @@ if(NOT ( DEFINED "USE_SYSTEM_${proj}" AND "${USE_SYSTEM_${proj}}" ) ) LOG_TEST 0 # Wrap test in script to to ignore log output from dashboards LOG_INSTALL 0 # Wrap install in script to to ignore log output from dashboards ${cmakeversion_external_update} "${cmakeversion_external_update_value}" - CMAKE_GENERATOR ${gen} CONFIGURE_COMMAND /configure --prefix= --enable-shared=No --enable-static=Yes @@ -82,6 +67,8 @@ else() ExternalProject_Add_Empty(${proj} "${${proj}_DEPENDENCIES}") endif() -mark_as_superbuild( VARS ${proj}_DIR:PATH LABELS "FIND_PACKAGE" ) - - +mark_as_superbuild( + VARS + ${proj}_DIR:PATH + LABELS "FIND_PACKAGE" + ) diff --git a/SuperBuild/External_OpenJPEG.cmake b/SuperBuild/External_OpenJPEG.cmake index 4bbdc1d..a905a6c 100644 --- a/SuperBuild/External_OpenJPEG.cmake +++ b/SuperBuild/External_OpenJPEG.cmake @@ -1,18 +1,3 @@ -# Make sure this file is included only once by creating globally unique varibles -# based on the name of this included file. -# get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE) -# if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED) -# return() -# endif() -# set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1) - -## External_${extProjName}.cmake files can be recurisvely included, -## and cmake variables are global, so when including sub projects it -## is important make the extProjName and proj variables -## appear to stay constant in one of these files. -## Store global variables before overwriting (then restore at end of this file.) -superbuild_stack_push(CACHED_extProjName ${extProjName}) -superbuild_stack_push(CACHED_proj ${proj}) # Make sure that the ExtProjName/IntProjName variables are unique globally # even if other External_${ExtProjName}.cmake files are sourced by @@ -21,10 +6,6 @@ set(extProjName OpenJPEG) #The find_package known name set(proj OpenJPEG) #This local name set(${extProjName}_REQUIRED_VERSION "") #If a required version is necessary, then set this, else leave blank -#if(${USE_SYSTEM_${extProjName}}) -# unset(${extProjName}_DIR CACHE) -#endif() - # Sanity checks if(DEFINED ${extProjName}_DIR AND NOT EXISTS ${${extProjName}_DIR}) message(FATAL_ERROR "${extProjName}_DIR variable is defined but corresponds to non-existing directory (${${extProjName}_DIR})") @@ -39,15 +20,6 @@ ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" ) ) #message(STATUS "${__indent}Adding project ${proj}") - # Set CMake OSX variable to pass down the external project - set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS) - if(APPLE) - list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_SYSROOT:STRING=${CMAKE_OSX_SYSROOT} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}) - endif() - ### --- Project specific additions here set(${proj}_CMAKE_OPTIONS -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj}-install @@ -66,6 +38,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" set(${proj}_REPOSITORY "http://openjpeg.googlecode.com/svn/trunk") set(${proj}_SVN_REVISION r2740) #2014-02-01 New Repository. ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} SVN_REPOSITORY ${${proj}_REPOSITORY} SVN_REVISION -r ${${proj}_SVN_REVISION} SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj} @@ -75,14 +48,12 @@ if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" LOG_TEST 0 # Wrap test in script to to ignore log output from dashboards LOG_INSTALL 0 # Wrap install in script to to ignore log output from dashboards ${cmakeversion_external_update} "${cmakeversion_external_update_value}" - CMAKE_GENERATOR ${gen} CMAKE_ARGS -Wno-dev --no-warn-unused-cli CMAKE_CACHE_ARGS - ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS} ${COMMON_EXTERNAL_PROJECT_ARGS} ${${proj}_CMAKE_OPTIONS} DEPENDS - ${${proj}_DEPENDENCIES} + ${${proj}_DEPENDENCIES} ) set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/openjpeg-2.0) set(${extProjName}_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${proj}-install/include/openjpeg-2.0) @@ -99,7 +70,14 @@ else() ExternalProject_Add_Empty(${proj} "${${proj}_DEPENDENCIES}") endif() -list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS ${extProjName}_DIR:PATH) +mark_as_superbuild( + VARS + ${proj}_INCLUDE_DIR:PATH + ${proj}_LIB_DIR:PATH + ${proj}_LIBRARY:FILEPATH + LABELS "FIND_PACKAGE" + ) -superbuild_stack_pop(CACHED_extProjName extProjName) -superbuild_stack_pop(CACHED_proj proj) +ExternalProject_Message(${proj} "${proj}_INCLUDE_DIR:${${proj}_INCLUDE_DIR}") +ExternalProject_Message(${proj} "${proj}_LIB_DIR:${${proj}_LIB_DIR}") +ExternalProject_Message(${proj} "${proj}_LIBRARY:${${proj}_LIBRARY}") diff --git a/SuperBuild/External_TIFF.cmake b/SuperBuild/External_TIFF.cmake index 5c07d73..10c4835 100644 --- a/SuperBuild/External_TIFF.cmake +++ b/SuperBuild/External_TIFF.cmake @@ -1,10 +1,3 @@ -# Make sure this file is included only once by creating globally unique varibles -# based on the name of this included file. -# get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE) -# if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED) -# return() -# endif() -# set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1) include(${CMAKE_CURRENT_LIST_DIR}/EP_Autoconf_Utils.cmake) @@ -31,13 +24,7 @@ ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj if(NOT ( DEFINED "USE_SYSTEM_${proj}" AND "${USE_SYSTEM_${proj}}" ) ) #message(STATUS "${__indent}Adding project ${proj}") - # Set CMake OSX variable to pass down the external project - set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS) if(APPLE) - list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_SYSROOT:STRING=${CMAKE_OSX_SYSROOT} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}) set(APPLE_CFLAGS " -DHAVE_APPLE_OPENGL_FRAMEWORK") endif() @@ -51,6 +38,7 @@ if(NOT ( DEFINED "USE_SYSTEM_${proj}" AND "${USE_SYSTEM_${proj}}" ) ) set(${proj}_GIT_TAG f696451cb05a8f33ec477eadcadd10fae9f58c39) ExternalProject_Add(${proj} + ${${proj}_EP_ARGS} GIT_REPOSITORY ${${proj}_REPOSITORY} GIT_TAG ${${proj}_GIT_TAG} SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj} @@ -61,7 +49,6 @@ if(NOT ( DEFINED "USE_SYSTEM_${proj}" AND "${USE_SYSTEM_${proj}}" ) ) LOG_TEST 0 # Wrap test in script to to ignore log output from dashboards LOG_INSTALL 0 # Wrap install in script to to ignore log output from dashboards ${cmakeversion_external_update} "${cmakeversion_external_update_value}" - CMAKE_GENERATOR ${gen} CONFIGURE_COMMAND /configure --prefix= --enable-shared=No --enable-static=Yes @@ -88,4 +75,12 @@ else() ExternalProject_Add_Empty(${proj} "${${proj}_DEPENDENCIES}") endif() -list(APPEND ${CMAKE_PROJECT_NAME}_SUPERBUILD_EP_VARS ${proj}_DIR:PATH) +mark_as_superbuild( + VARS + ${proj}_INCLUDE_DIR:PATH + ${proj}_LIBRARY:FILEPATH + LABELS "FIND_PACKAGE" + ) + +ExternalProject_Message(${proj} "${proj}_INCLUDE_DIR:${${proj}_INCLUDE_DIR}") +ExternalProject_Message(${proj} "${proj}_LIBRARY:${${proj}_LIBRARY}") diff --git a/SuperBuild/External_VTK.cmake b/SuperBuild/External_VTK.cmake index 93691b9..daf8a56 100644 --- a/SuperBuild/External_VTK.cmake +++ b/SuperBuild/External_VTK.cmake @@ -172,7 +172,7 @@ if((NOT DEFINED VTK_DIR OR NOT DEFINED VTK_SOURCE_DIR) AND NOT ${CMAKE_PROJECT_N ${VTK_PYTHON_ARGS} ${VTK_QT_ARGS} ${VTK_MAC_ARGS} - INSTALL_COMMAND "" + INSTALL_COMMAND "" ) ### --- End Project specific additions set(${proj}_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build) From 0e8268ec284cce52206d0f02faad69cbb1cb824b Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Fri, 27 Jun 2014 13:41:25 -0400 Subject: [PATCH 17/29] COMP: Ensure CMAKE flags are passed down to all external project. Due to Artichoke bug #6 [1], it is required to set the value in the cache so that they can be considered when configuring the external projects. This commit will fix the build error reported below: // ---- /usr/bin/ld: /projects/pnl/home/petersv/testukf/build/lib/libitksys-4.6.a(SystemTools.cxx.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /projects/pnl/home/petersv/testukf/build/lib/libitksys-4.6.a: could not read symbols: Bad value collect2: ld returned 1 exit status // ---- [1] https://github.com/commontk/Artichoke/issues/6 --- Common.cmake | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Common.cmake b/Common.cmake index 6e4e7dd..24bca2a 100644 --- a/Common.cmake +++ b/Common.cmake @@ -92,13 +92,6 @@ if("${CMAKE_CXX_COMPILER}${CMAKE_CXX_COMPILER_ARG1}" MATCHES ".*clang.*") set(CMAKE_COMPILER_IS_CLANGXX ON CACHE BOOL "compiler is CLang") endif() -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITK_REQUIRED_C_FLAGS}") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS}") -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}") -set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}") -set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}") - - #----------------------------------------------------------------------------- # Add needed flag for gnu on linux like enviroments to build static common libs # suitable for linking with shared object libs. @@ -111,3 +104,9 @@ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") endif() endif() +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITK_REQUIRED_C_FLAGS}" CACHE STRING "CMake C Flags" FORCE) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS}" CACHE STRING "CMake CXX Flags" FORCE) +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}" CACHE STRING "CMake Linker Flags" FORCE) +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}" CACHE STRING "CMake shared linker Flags" FORCE) +set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${ITK_REQUIRED_LINK_FLAGS}" CACHE STRING "CMake module linker Flags" FORCE) + From cd27d3345fa68a322f8e9d2dd04f83de39e579c1 Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Wed, 2 Jul 2014 14:40:23 -0400 Subject: [PATCH 18/29] BUG: fixing some bugs in computedispersion.cxx Fixing some bugs in computedispersion.cxx that probably resulted from typos. In addition, I changed the line if(inDiskPlaneCount > 0) to > 10 for speed up. There is no need to perform the computations inside this if statement if inDiskPlaneCount < 10, as the function will return false in this case - see the following if statement. --- fibertractdispersion/computedispersion.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fibertractdispersion/computedispersion.cxx b/fibertractdispersion/computedispersion.cxx index d0178be..af88b03 100644 --- a/fibertractdispersion/computedispersion.cxx +++ b/fibertractdispersion/computedispersion.cxx @@ -385,7 +385,7 @@ bool computeMeanVector(const MatrixType &xCoordinates, double scale, Eigen::Vector3d &meanVector /* out */) { - const double eps(-2.2204e-16); // that's what matlab thinks eps is. + const double eps(2.2204e-16); // that's what matlab thinks eps is. std::vector indexPointsInPlane(xCoordinates.cols(),false); @@ -440,7 +440,7 @@ bool computeMeanVector(const MatrixType &xCoordinates, // this is a rearrangement of the matlab code; // if there are no points in the disk, there's no point // to computing the mean. - if(inDiskPointCount > 0) + if(inDiskPointCount > 10) { // vectorFieldInDisk = vectorFieldInDisk(:,indexPointsInDisk); // use second variable rather than overwrite in place @@ -487,7 +487,7 @@ bool computeMeanVector(const MatrixType &xCoordinates, // if(~any(isnan(meanVector)) && (length(indexPointsInDisk) > 10) ) // n = norm(meanVector); // if(n>0.1) - if(inPlanePointCount > 10 && n > 0.1) + if(inDiskPointCount > 10 && n > 0.1) { meanVector /= n; return true; @@ -650,7 +650,7 @@ computedispersion(fiberbundle &bundle, double scale, double acosDot = acos(dot); if(acosDot < 0.0) { - acosDot -= -1.0; + acosDot *= -1.0; } dispersionDistributionValues(j,i) = acosDot; } @@ -702,7 +702,7 @@ computedispersion(fiberbundle &bundle, double scale, if(outputFilename != "") { std::ofstream outfile(outputFilename.c_str()); - PrintMat(DDFOutput); + PrintMat(DDFOutput, outfile); outfile.close(); } return 0; // success From cf25b457a29921ac5a80810ce7222b2b91e618d9 Mon Sep 17 00:00:00 2001 From: Kent Williams Date: Fri, 11 Jul 2014 13:24:42 -0500 Subject: [PATCH 19/29] COMP: Fix vtk fiber bundle writer COMP: remove obsolete --simpleTensorModel flag from tests COMP: fixed path for teem libraries --- CompressedSensing/CMakeLists.txt | 2 +- UKFTractography.cmake | 6 +++++- fibertractdispersion/CMakeLists.txt | 2 +- fibertractdispersion/fiberbundle.cxx | 6 ++---- ukf/CMakeLists.txt | 4 ++-- ukf/Testing/Cxx/CMakeLists.txt | 6 ------ 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/CompressedSensing/CMakeLists.txt b/CompressedSensing/CMakeLists.txt index 7ebd12d..c4de1ab 100644 --- a/CompressedSensing/CMakeLists.txt +++ b/CompressedSensing/CMakeLists.txt @@ -30,7 +30,7 @@ set(MODULE_SRCS set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${TEEM_LIB} + ${Teem_LIBRARIES} ${VTK_LIBRARIES} ) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 8010217..f5901fe 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -34,7 +34,11 @@ include_directories(${Eigen_INCLUDE_DIR}) #----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) -set(TEEM_LIB teem) +# +# The way Teem gets built locally it puts the library in the +# /lib instead of where teem expects it to be. +# so add the lib in the parent of the current build directory +link_directories(${CMAKE_CURRENT_BINARY_DIR}/../lib) #----------------------------------------------------------------------------- add_subdirectory(common) diff --git a/fibertractdispersion/CMakeLists.txt b/fibertractdispersion/CMakeLists.txt index 9ccb514..d5057f9 100644 --- a/fibertractdispersion/CMakeLists.txt +++ b/fibertractdispersion/CMakeLists.txt @@ -20,7 +20,7 @@ set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${VTK_LIBRARIES} - ${TEEM_LIB} + ${Teem_LIBRARIES} ) #----------------------------------------------------------------------------- diff --git a/fibertractdispersion/fiberbundle.cxx b/fibertractdispersion/fiberbundle.cxx index 55ae1b9..4297597 100644 --- a/fibertractdispersion/fiberbundle.cxx +++ b/fibertractdispersion/fiberbundle.cxx @@ -149,8 +149,7 @@ ::WriteFibers( std::string outputFibersFileName, bool writeAscii, bool writeUnCo { curAtt->InsertNextValue(it->second[j]); } - int idx = pd->AddArray(curAtt); - pd->SetActiveAttribute(idx,vtkDataSetAttributes::SCALARS); + pd->SetScalars(curAtt); } // TODO: do the tensors. for(std::map::const_iterator it = AllTensors.begin(); it != AllTensors.end(); ++it) @@ -170,9 +169,8 @@ ::WriteFibers( std::string outputFibersFileName, bool writeAscii, bool writeUnCo } } curAtt->InsertNextTuple(tmp); - int idx = pd->AddArray(curAtt); - pd->SetActiveAttribute(idx,vtkDataSetAttributes::TENSORS); } + pd->SetTensors(curAtt); } try diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index fbc3ffc..724eb0a 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -26,10 +26,10 @@ set(MODULE_SRCS set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${TEEM_LIB} + ${Teem_LIBRARIES} ${VTK_LIBRARIES} ) - +message("MODULE_TARGET_LIBRARIES:${MODULE_TARGET_LIBRARIES}") #----------------------------------------------------------------------------- enable_testing() add_subdirectory(Testing) diff --git a/ukf/Testing/Cxx/CMakeLists.txt b/ukf/Testing/Cxx/CMakeLists.txt index a02908a..ab5f134 100644 --- a/ukf/Testing/Cxx/CMakeLists.txt +++ b/ukf/Testing/Cxx/CMakeLists.txt @@ -41,7 +41,6 @@ add_test(NAME ${testname} --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 - --simpleTensorModel --recordNMSE ) set_property(TEST ${testname} PROPERTY LABELS ${CLP}) @@ -75,7 +74,6 @@ add_test(NAME ${testname} --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 - --simpleTensorModel --recordNMSE --freeWater --recordFreeWater @@ -110,7 +108,6 @@ add_test(NAME ${testname} --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 - --simpleTensorModel --recordNMSE --minFA 0.10 --minGA 0.05 @@ -151,7 +148,6 @@ add_test(NAME ${testname} --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 - --simpleTensorModel --recordNMSE --freeWater --recordFreeWater @@ -188,7 +184,6 @@ add_test(NAME ${testname} --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 - --simpleTensorModel --recordNMSE --freeWater --recordFreeWater @@ -224,7 +219,6 @@ add_test(NAME ${testname} --numThreads 1 --minBranchingAngle 0.0 --maxBranchingAngle 0.0 - --simpleTensorModel --recordNMSE --freeWater --recordFreeWater From c4d94080f23261bac1358457619fddf87226f93b Mon Sep 17 00:00:00 2001 From: Kent Williams Date: Tue, 15 Jul 2014 10:21:33 -0500 Subject: [PATCH 20/29] BUG: always write out DDF as THE scalar data for a fiber bundleOther scalar-value-per-point data gets written as FieldData. --- fibertractdispersion/Testing/CMakeLists.txt | 2 +- fibertractdispersion/fiberbundle.cxx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fibertractdispersion/Testing/CMakeLists.txt b/fibertractdispersion/Testing/CMakeLists.txt index 47e7305..7700690 100644 --- a/fibertractdispersion/Testing/CMakeLists.txt +++ b/fibertractdispersion/Testing/CMakeLists.txt @@ -9,7 +9,7 @@ set(CLP fibertractdispersion) add_test(NAME fibertractdispersion COMMAND $ --writeAscii - --writeUnCompressed + --writeUncompressed --inputFiberBundle ${BASELINE}/1T_fiber.vtk --outputFiberBundle ${TESTING_RESULTS_DIRECTORY}/${CLP}_1T_fiber.vtk ) diff --git a/fibertractdispersion/fiberbundle.cxx b/fibertractdispersion/fiberbundle.cxx index 4297597..ff82acd 100644 --- a/fibertractdispersion/fiberbundle.cxx +++ b/fibertractdispersion/fiberbundle.cxx @@ -149,7 +149,11 @@ ::WriteFibers( std::string outputFibersFileName, bool writeAscii, bool writeUnCo { curAtt->InsertNextValue(it->second[j]); } - pd->SetScalars(curAtt); + if(it->first == "DDF") + { + pd->SetScalars(curAtt); + } + pd->AddArray(curAtt); } // TODO: do the tensors. for(std::map::const_iterator it = AllTensors.begin(); it != AllTensors.end(); ++it) From b101af874d3430b2674a805e8b27b60e0bfa109a Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Fri, 18 Jul 2014 20:09:30 -0400 Subject: [PATCH 21/29] Changed acknowledgments, contributors and some default settings in the XML Added grant numbers to acknowledgements, added some names to contributors list, and changed some default settings in the UI as suggested by Ron. --- ukf/UKFTractography.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ukf/UKFTractography.xml b/ukf/UKFTractography.xml index 54f2a26..ff94cc1 100644 --- a/ukf/UKFTractography.xml +++ b/ukf/UKFTractography.xml @@ -13,8 +13,8 @@ 1.0 http://www.nitrc.org/plugins/mwiki/index.php/ukftractography:MainPage - Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner, Kent Williams - + Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner, Kent Williams, Hans Johnson, Peter Savadjiev, Carl-Fredrik Westin. + @@ -117,7 +117,7 @@ - + @@ -150,7 +150,7 @@ recordTensors Recording the tensors enables Slicer to color the fiber bundles by FA, orientation, and so on. The fields will be called 'TensorN', where N is the tensor number. - false + true From f1c201fbcca396ebd37a28286d388624e6d3a4dd Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Fri, 25 Jul 2014 12:58:25 -0400 Subject: [PATCH 22/29] Fixing Teem library path for the Slicer Extension Reverting some of the changes to teem library paths made in commit cf25b45, July 11th 2014, which were causing the Slicer Extension build to crash. --- CompressedSensing/CMakeLists.txt | 2 +- UKFTractography.cmake | 6 +----- fibertractdispersion/CMakeLists.txt | 2 +- ukf/CMakeLists.txt | 7 ++++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CompressedSensing/CMakeLists.txt b/CompressedSensing/CMakeLists.txt index c4de1ab..7ebd12d 100644 --- a/CompressedSensing/CMakeLists.txt +++ b/CompressedSensing/CMakeLists.txt @@ -30,7 +30,7 @@ set(MODULE_SRCS set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${Teem_LIBRARIES} + ${TEEM_LIB} ${VTK_LIBRARIES} ) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index f5901fe..8010217 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -34,11 +34,7 @@ include_directories(${Eigen_INCLUDE_DIR}) #----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) -# -# The way Teem gets built locally it puts the library in the -# /lib instead of where teem expects it to be. -# so add the lib in the parent of the current build directory -link_directories(${CMAKE_CURRENT_BINARY_DIR}/../lib) +set(TEEM_LIB teem) #----------------------------------------------------------------------------- add_subdirectory(common) diff --git a/fibertractdispersion/CMakeLists.txt b/fibertractdispersion/CMakeLists.txt index d5057f9..9ccb514 100644 --- a/fibertractdispersion/CMakeLists.txt +++ b/fibertractdispersion/CMakeLists.txt @@ -20,7 +20,7 @@ set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${VTK_LIBRARIES} - ${Teem_LIBRARIES} + ${TEEM_LIB} ) #----------------------------------------------------------------------------- diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index 724eb0a..933f632 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -1,4 +1,5 @@ -#----------------------------------------------------------------------------- +how notes View + set(MODULE_NAME UKFTractography) #----------------------------------------------------------------------------- @@ -26,10 +27,10 @@ set(MODULE_SRCS set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${Teem_LIBRARIES} + ${TEEM_LIB} ${VTK_LIBRARIES} ) -message("MODULE_TARGET_LIBRARIES:${MODULE_TARGET_LIBRARIES}") + #----------------------------------------------------------------------------- enable_testing() add_subdirectory(Testing) From ae47992ef5c998139871e030e32b58d2cb11364b Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Fri, 25 Jul 2014 13:03:29 -0400 Subject: [PATCH 23/29] Fixed a typo in previous commit --- ukf/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index 933f632..fbc3ffc 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -1,5 +1,4 @@ -how notes View - +#----------------------------------------------------------------------------- set(MODULE_NAME UKFTractography) #----------------------------------------------------------------------------- From 88c9d232a006ece384ff22e661bf7d688e48fe10 Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Fri, 25 Jul 2014 13:25:41 -0400 Subject: [PATCH 24/29] Updated list of contributors --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a51a47..1763301 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ set(PRIMARY_PROJECT_NAME UKFTractography) set(EXTENSION_NAME UKFTractography) set(EXTENSION_HOMEPAGE "http://www.nitrc.org/plugins/mwiki/index.php/ukftractography:MainPage") set(EXTENSION_CATEGORY "Diffusion.Tractography") -set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner") +set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner, Ryan Eckbo, Peter Savadjiev, Carl-Fredrik Westin") set(EXTENSION_MAJOR_VERSION 1) set(EXTENSION_MINOR_VERSION 2) set(EXTENSION_PATCH_VERSION 0) From 74766a572ba6da9827b66cea048fe53808cb988e Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Fri, 25 Jul 2014 13:27:09 -0400 Subject: [PATCH 25/29] Updated list of contributors #2 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1763301..bfcc89e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ set(PRIMARY_PROJECT_NAME UKFTractography) set(EXTENSION_NAME UKFTractography) set(EXTENSION_HOMEPAGE "http://www.nitrc.org/plugins/mwiki/index.php/ukftractography:MainPage") set(EXTENSION_CATEGORY "Diffusion.Tractography") -set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner, Ryan Eckbo, Peter Savadjiev, Carl-Fredrik Westin") +set(EXTENSION_CONTRIBUTORS "Yogesh Rathi, Stefan Lienhard, Yinpeng Li, Martin Styner, Ipek Oguz, Yundi Shi, Christian Baumgartner, Ryan Eckbo, Kent Williams, Hans Johnson, Peter Savadjiev, Carl-Fredrik Westin") set(EXTENSION_MAJOR_VERSION 1) set(EXTENSION_MINOR_VERSION 2) set(EXTENSION_PATCH_VERSION 0) From 18d71bb625918e0e9be174a957bd056051fdd765 Mon Sep 17 00:00:00 2001 From: Peter Savadjiev Date: Mon, 28 Jul 2014 15:58:22 -0400 Subject: [PATCH 26/29] One more change to the UKFTractography XML, suggested by Ron --- ukf/UKFTractography.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ukf/UKFTractography.xml b/ukf/UKFTractography.xml index ff94cc1..a0f7473 100644 --- a/ukf/UKFTractography.xml +++ b/ukf/UKFTractography.xml @@ -207,7 +207,7 @@ - + Parameters for tractography. Note: Some values are set runtime. However, if set to a value here, this value will be used. From 63ad71a5f6eee088133ed8641a058259c45dbd07 Mon Sep 17 00:00:00 2001 From: Kent Williams Date: Tue, 12 Aug 2014 09:44:21 -0500 Subject: [PATCH 27/29] COMP: fix linking to teem on linux COMP: Make CompressedSensing and fibertractdisperssion optional The default is not to build either --- CompressedSensing/CMakeLists.txt | 2 +- UKFTractography.cmake | 21 ++++++++++++++++++--- fibertractdispersion/CMakeLists.txt | 2 +- ukf/CMakeLists.txt | 2 +- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/CompressedSensing/CMakeLists.txt b/CompressedSensing/CMakeLists.txt index 7ebd12d..ea49491 100644 --- a/CompressedSensing/CMakeLists.txt +++ b/CompressedSensing/CMakeLists.txt @@ -30,7 +30,7 @@ set(MODULE_SRCS set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${TEEM_LIB} + ${TEEM_LIB} ${ZLIB_LIBRARIES} ${VTK_LIBRARIES} ) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 8010217..9b4e281 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -31,18 +31,33 @@ if(NOT Eigen_INCLUDE_DIR) endif() include_directories(${Eigen_INCLUDE_DIR}) +find_package(ZLIB REQUIRED) + +# #----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) -set(TEEM_LIB teem) +# +# due to forcing all dependcy builds to put outputs into lib and bin at the +# top level build directory, the Teem_LIBRARY_DIRS var is wrong; have to add +# top level build dir here +find_library(TEEM_LIB teem PATHS ${CMAKE_CURRENT_BINARY_DIR}/../lib) +message("TEEM_LIB:${TEEM_LIB}") #----------------------------------------------------------------------------- add_subdirectory(common) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common) add_subdirectory(ukf) + if(NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) - add_subdirectory(fibertractdispersion) - add_subdirectory(CompressedSensing) + option(USE_fibertractdispersion "Build the fibertractdispersion program" OFF) + if(USE_fibertractdispersion) + add_subdirectory(fibertractdispersion) + endif() + option(USE_CompressedSensing "Build the CompressedSensing program" OFF) + if(USE_CompressedSensing) + add_subdirectory(CompressedSensing) + endif() add_subdirectory(vtk2mask) add_subdirectory(vtkFilter) endif() diff --git a/fibertractdispersion/CMakeLists.txt b/fibertractdispersion/CMakeLists.txt index 9ccb514..b465e0c 100644 --- a/fibertractdispersion/CMakeLists.txt +++ b/fibertractdispersion/CMakeLists.txt @@ -20,7 +20,7 @@ set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${VTK_LIBRARIES} - ${TEEM_LIB} + ${TEEM_LIB} ${ZLIB_LIBRARIES} ) #----------------------------------------------------------------------------- diff --git a/ukf/CMakeLists.txt b/ukf/CMakeLists.txt index fbc3ffc..da11937 100644 --- a/ukf/CMakeLists.txt +++ b/ukf/CMakeLists.txt @@ -26,7 +26,7 @@ set(MODULE_SRCS set(MODULE_TARGET_LIBRARIES ${ITK_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} - ${TEEM_LIB} + ${TEEM_LIB} ${ZLIB_LIBRARIES} ${VTK_LIBRARIES} ) From 96adff72875b09b3e3781bd7474829c1f1d68748 Mon Sep 17 00:00:00 2001 From: Kent Williams Date: Tue, 12 Aug 2014 10:47:19 -0500 Subject: [PATCH 28/29] COMP: conditionally search for Teem library The existing code works to build the UKF slicer extension and the new search code might not work when built as a slicer extension, so use the old behavior if the extension is being built. --- UKFTractography.cmake | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 9b4e281..0ced8c2 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -37,12 +37,16 @@ find_package(ZLIB REQUIRED) #----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) -# -# due to forcing all dependcy builds to put outputs into lib and bin at the -# top level build directory, the Teem_LIBRARY_DIRS var is wrong; have to add -# top level build dir here -find_library(TEEM_LIB teem PATHS ${CMAKE_CURRENT_BINARY_DIR}/../lib) -message("TEEM_LIB:${TEEM_LIB}") +if(NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) + set(TEEM_LIB teem) +else() + # + # due to forcing all dependcy builds to put outputs into lib and bin at the + # top level build directory, the Teem_LIBRARY_DIRS var is wrong; have to add + # top level build dir here + find_library(TEEM_LIB teem PATHS ${CMAKE_CURRENT_BINARY_DIR}/../lib) + message("TEEM_LIB:${TEEM_LIB}") +endif() #----------------------------------------------------------------------------- add_subdirectory(common) From b4872976837719a772bf87b0ea18d4f9ae14f691 Mon Sep 17 00:00:00 2001 From: Kent Williams Date: Mon, 18 Aug 2014 13:09:40 -0500 Subject: [PATCH 29/29] BUG: inverted test for Slicer build --- UKFTractography.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UKFTractography.cmake b/UKFTractography.cmake index 0ced8c2..ac39e35 100644 --- a/UKFTractography.cmake +++ b/UKFTractography.cmake @@ -37,7 +37,7 @@ find_package(ZLIB REQUIRED) #----------------------------------------------------------------------------- find_package(Teem REQUIRED) include(${Teem_USE_FILE}) -if(NOT ${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) +if(${PRIMARY_PROJECT_NAME}_BUILD_SLICER_EXTENSION) set(TEEM_LIB teem) else() #