From 5f930b3a1e6f004d9f06bd50ae243724d7c007b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20Fl=C3=B3rez-Valencia?= Date: Wed, 8 Feb 2017 15:57:22 -0500 Subject: [PATCH] ... --- CMakeLists.txt | 10 +--- cmake/QtTools.cmake | 8 ++- cmake/Restrictions.cmake | 51 ------------------- lib/CMakeLists.txt | 4 +- lib/fpaInstances/CMakeLists.txt | 40 ++++++++------- plugins/CMakeLists.txt | 2 +- plugins/Experiments/InsertNoiseIntoPoints.cxx | 4 +- .../Experiments/SkeletonHausdorffDistance.cxx | 8 +-- plugins/ImageAlgorithms/SkeletonFilter.cxx | 2 +- 9 files changed, 35 insertions(+), 94 deletions(-) delete mode 100644 cmake/Restrictions.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 811b889..4aa9686 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,18 +36,12 @@ SET(prj_SHORT_VERSION "${prj_MAJOR_VERSION}") ## == Functions, packages and options == ## ===================================== -FIND_PACKAGE(cpPlugins QUIET) -IF(cpPlugins_DIR) - OPTION(USE_cpPlugins "Build cpPlugins-based code" ON) -ELSE(cpPlugins_DIR) - OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF) - MARK_AS_ADVANCED(FORCE cpPlugins_DIR) -ENDIF(cpPlugins_DIR) +INCLUDE(cmake/BaseConfig.cmake) +OPTION(USE_cpPlugins "Build cpPlugins-based code" OFF) IF(USE_cpPlugins) FIND_PACKAGE(cpPlugins) MARK_AS_ADVANCED(CLEAR cpPlugins_DIR) ENDIF(USE_cpPlugins) -INCLUDE(cmake/BaseConfig.cmake) INCLUDE(cmake/KitwareTools.cmake) INCLUDE(cmake/QtTools.cmake) INCLUDE(cmake/Functions.cmake) diff --git a/cmake/QtTools.cmake b/cmake/QtTools.cmake index 3ec2889..f4dd0cd 100644 --- a/cmake/QtTools.cmake +++ b/cmake/QtTools.cmake @@ -2,7 +2,7 @@ ## == Find Qt4 and check if it was well configured == ## ================================================== -## IF(BUILD_QT4_COMPONENTS) +IF(BUILD_QT4_COMPONENTS) FIND_PACKAGE(Qt4 REQUIRED) INCLUDE(${QT_USE_FILE}) SET( @@ -20,9 +20,7 @@ QVTKWidget CACHE STRING "Base Qt4-based vtkRenderWindow" ) - # ADD_DEFINITIONS(-DcpPlugins_QT4 -DcpExtensions_QT4) -## ELSE(BUILD_QT4_COMPONENTS) - # ADD_DEFINITIONS(-UcpPlugins_QT4 -UcpExtensions_QT4) -## ENDIF(BUILD_QT4_COMPONENTS) + MARK_AS_ADVANCED(CLEAR cpPlugins_Qt4_VTKWidget) +ENDIF(BUILD_QT4_COMPONENTS) ## eof - $RCSfile$ diff --git a/cmake/Restrictions.cmake b/cmake/Restrictions.cmake deleted file mode 100644 index d177604..0000000 --- a/cmake/Restrictions.cmake +++ /dev/null @@ -1,51 +0,0 @@ -## ======================================================================= -## == Force c++11 language version == -## == NOTE: It seems that by default on Visual Studio Compiler supports == -## == c++11, so it only need to be tested on other OS. == -## ======================================================================= - -IF(NOT MSVC) - INCLUDE(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) - IF(COMPILER_SUPPORTS_CXX11) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - ELSE(COMPILER_SUPPORTS_CXX11) - CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) - IF(COMPILER_SUPPORTS_CXX0X) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - ELSE(COMPILER_SUPPORTS_CXX0X) - MESSAGE( - FATAL_ERROR - "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support." - ) - ENDIF(COMPILER_SUPPORTS_CXX0X) - ENDIF(COMPILER_SUPPORTS_CXX11) -ENDIF(NOT MSVC) - -## =================================================== -## == Prepare header generator to build shared libs == -## =================================================== - -INCLUDE(GenerateExportHeader) - -## ================================================== -## == Do not allow to build inside the source tree == -## ================================================== - -IF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) - MESSAGE(FATAL_ERROR "Building in the source tree is not allowed.") -ENDIF(PROJECT_BINARY_DIR STREQUAL ${PROJECT_SOURCE_DIR}) - -## ================================================= -## == Where to put targets (executables and libs) == -## ================================================= - -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}) -SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}) -MARK_AS_ADVANCED( - CMAKE_BACKWARDS_COMPATIBILITY - EXECUTABLE_OUTPUT_PATH - LIBRARY_OUTPUT_PATH - ) - -## eof - $RCSfile$ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8f3b1ff..5afdc75 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -3,8 +3,6 @@ ## == Build instances for cpPlugins == ## =================================== -IF(USE_cpPlugins) - SUBDIRS(fpaInstances) -ENDIF(USE_cpPlugins) +SUBDIRS(fpaInstances) ## eof - $RCSfile$ diff --git a/lib/fpaInstances/CMakeLists.txt b/lib/fpaInstances/CMakeLists.txt index dc320c7..e170abd 100644 --- a/lib/fpaInstances/CMakeLists.txt +++ b/lib/fpaInstances/CMakeLists.txt @@ -1,24 +1,26 @@ ## =========================== ## == Compile each instance == ## =========================== - -INCLUDE_DIRECTORIES( - ${PROJECT_SOURCE_DIR}/lib - ${PROJECT_BINARY_DIR}/lib - ) -SET(_pfx fpaInstaces) - -cpPlugins_BuildLibrary(${_pfx}DataObjects SHARED ${CMAKE_CURRENT_SOURCE_DIR}/DataObjects.i) -cpPlugins_BuildLibrary(${_pfx}Filters SHARED ${CMAKE_CURRENT_SOURCE_DIR}/Filters.i) - -TARGET_LINK_LIBRARIES(${_pfx}DataObjects ${cpPlugins_AllInstances}) -TARGET_LINK_LIBRARIES(${_pfx}Filters ${_pfx}DataObjects) - -SET( - fpa_AllInstances - ${_pfx}DataObjects - ${_pfx}Filters - CACHE INTERNAL "All valid instances." FORCE - ) +IF(USE_cpPlugins) + INCLUDE_DIRECTORIES( + ${PROJECT_SOURCE_DIR}/lib + ${PROJECT_BINARY_DIR}/lib + ) + SET(_pfx fpaInstaces) + cpPlugins_BuildLibrary( + ${_pfx}DataObjects SHARED ${CMAKE_CURRENT_SOURCE_DIR}/DataObjects.i + ) + cpPlugins_BuildLibrary( + ${_pfx}Filters SHARED ${CMAKE_CURRENT_SOURCE_DIR}/Filters.i + ) + TARGET_LINK_LIBRARIES(${_pfx}DataObjects ${cpPlugins_AllInstances}) + TARGET_LINK_LIBRARIES(${_pfx}Filters ${_pfx}DataObjects) + SET( + fpa_AllInstances + ${_pfx}DataObjects + ${_pfx}Filters + CACHE INTERNAL "All valid instances." FORCE + ) +ENDIF(USE_cpPlugins) ## eof - $RCSfile$ diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 9c2c3db..8950a27 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -39,4 +39,4 @@ IF(USE_cpPlugins) ENDIF(USE_cpPlugins) -## eof - $RCSfile$ \ No newline at end of file +## eof - $RCSfile$ diff --git a/plugins/Experiments/InsertNoiseIntoPoints.cxx b/plugins/Experiments/InsertNoiseIntoPoints.cxx index e21f37b..0b98400 100644 --- a/plugins/Experiments/InsertNoiseIntoPoints.cxx +++ b/plugins/Experiments/InsertNoiseIntoPoints.cxx @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -12,7 +12,7 @@ InsertNoiseIntoPoints( ) : Superclass( ) { typedef cpInstances::DataObjects::Image _TImage; - typedef cpInstances::Mesh _TMesh; + typedef cpInstances::DataObjects::Mesh _TMesh; this->_ConfigureInput< _TMesh >( "Seeds", true, false ); this->_ConfigureInput< _TImage >( "DistanceMap", true, false ); diff --git a/plugins/Experiments/SkeletonHausdorffDistance.cxx b/plugins/Experiments/SkeletonHausdorffDistance.cxx index 8240132..af6fe76 100644 --- a/plugins/Experiments/SkeletonHausdorffDistance.cxx +++ b/plugins/Experiments/SkeletonHausdorffDistance.cxx @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -13,9 +13,9 @@ SkeletonHausdorffDistance( ) : Superclass( ) { this->_ConfigureInput< cpInstances::DataObjects::Image >( "DistanceMap", true, false ); - this->_ConfigureInput< cpInstances::Mesh >( "Seeds", true, false ); - this->_ConfigureInput< cpInstances::Skeleton >( "Skeleton1", true, false ); - this->_ConfigureInput< cpInstances::Skeleton >( "Skeleton2", true, false ); + this->_ConfigureInput< cpInstances::DataObjects::Mesh >( "Seeds", true, false ); + this->_ConfigureInput< cpInstances::DataObjects::Skeleton >( "Skeleton1", true, false ); + this->_ConfigureInput< cpInstances::DataObjects::Skeleton >( "Skeleton2", true, false ); } // ------------------------------------------------------------------------- diff --git a/plugins/ImageAlgorithms/SkeletonFilter.cxx b/plugins/ImageAlgorithms/SkeletonFilter.cxx index 106dab2..8d434c7 100644 --- a/plugins/ImageAlgorithms/SkeletonFilter.cxx +++ b/plugins/ImageAlgorithms/SkeletonFilter.cxx @@ -12,7 +12,7 @@ SkeletonFilter( ) : Superclass( ) { typedef cpInstances::DataObjects::Image _TImage; - typedef cpInstances::Skeleton _TSkeleton; + typedef cpInstances::DataObjects::Skeleton _TSkeleton; typedef cpPlugins::Pipeline::DataObject _TData; this->_ConfigureInput< _TImage >( "Input", true, false ); -- 2.47.1