endif(cpPlugins_BUILD)
+## == Installation commands
+include(cmake/cpPlgInstallCommands.cmake)
+
## == CMake scripts
subdirs(cmake)
+## == Uninstall target
+configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY
+ )
+add_custom_target(
+ uninstall
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+
## eof - $RCSfile$
## == List bash applications
set(_pfx cpPlugins_bash_)
set(_apps
+ ConvertImage
CreateWin32Installer
)
${_pfx}${_a}
INSTALL
SOURCE ${_a}.cxx
+ LINKS ${ITK_LIBRARIES}
)
endforeach(_a)
--- /dev/null
+/* =========================================================================
+ * @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+ * =========================================================================
+ */
+#include <itkImage.h>
+#include <itkImageFileReader.h>
+#include <itkImageFileWriter.h>
+
+// -------------------------------------------------------------------------
+const unsigned int Dim = 2;
+typedef unsigned char TPixel;
+typedef itk::Image< TPixel, Dim > TImage;
+
+// -------------------------------------------------------------------------
+int main( int argc, char* argv[] )
+{
+ if( argc < 3 )
+ {
+ std::cerr << "Usage: " << argv[ 0 ] << " input output" << std::endl;
+ return( 1 );
+
+ } // fi
+
+ typedef itk::ImageFileReader< TImage > TReader;
+ TReader::Pointer reader = TReader::New( );
+ reader->SetFileName( argv[ 1 ] );
+
+ typedef itk::ImageFileWriter< TImage > TWriter;
+ TWriter::Pointer writer = TWriter::New( );
+ writer->SetInput( reader->GetOutput( ) );
+ writer->SetFileName( argv[ 2 ] );
+ try
+ {
+ writer->Update( );
+ }
+ catch( std::exception& err )
+ {
+ std::cerr << "Error caught: " << err.what( ) << std::endl;
+ return( 1 );
+
+ } // fi
+ return( 0 );
+}
+
+// eof - $RCSfile$
## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
## =========================================================================
-include(cpPlgInstallCommands.cmake)
-
-#INSTALL: cpPlgDefinitions.cmake
-#INSTALL: cpPlgFunctions.cmake
-#INSTALL: cpPlgInstallCommands.cmake
+set(
+ _scripts
+ cpPlgDefinitions.cmake
+ cpPlgFunctions.cmake
+ cpPlgInstallCommands.cmake
+ )
+foreach(_s ${_scripts})
+ install(
+ FILES "${_s}"
+ DESTINATION "lib/cmake/${PROJECT_NAME}"
+ )
+endforeach(_s)
## eof - $RCSfile$
-
"${version_config}" COMPATIBILITY SameMajorVersion
)
configure_package_config_file(
- "${PROJECT_NAME}Config.cmake.in"
+ "cmake/${PROJECT_NAME}Config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${config_install_dir}"
)
+install(
+ FILES "${project_config}"
+ DESTINATION "${config_install_dir}"
+ )
if(${PROJECT_NAME}_BUILD)
install(
EXPORT "${targets_export_name}"
DESTINATION "${config_install_dir}"
)
endif(${PROJECT_NAME}_BUILD)
-install(
- FILES "${project_config}"
- DESTINATION "${config_install_dir}"
- )
## eof - $RCSfile$
## == Some general configuration
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/cpPlgDefinitions.cmake)
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/cpPlgFunctions.cmake)
-
+set(
+ cpPlugins_INSTALL_FILE
+ @CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/cpPlgInstallCommands.cmake
+ )
## == Automatically generated commands
@PACKAGE_INIT@
-include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
-check_required_components("@PROJECT_NAME@")
+## == Include targets file
+set(_targets "${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
+if(EXISTS "${_targets}")
+ include("${_targets}")
+ check_required_components("@PROJECT_NAME@")
+endif(EXISTS "${_targets}")
## ======================================
## == Needed packages and dependencies ==
--- /dev/null
+## =========================================================================
+## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
+## =========================================================================
+
+if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+foreach(file ${files})
+ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
+ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+ exec_program(
+ "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
+ OUTPUT_VARIABLE rm_out
+ RETURN_VALUE rm_retval
+ )
+ if(NOT "${rm_retval}" STREQUAL 0)
+ message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
+ endif(NOT "${rm_retval}" STREQUAL 0)
+ else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
+ endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
+
+## eof - $RCSfile$
## @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
## =========================================================================
-option(BUILD_ivq "Build ITK/VTK/Qt extensions." OFF)
-if(BUILD_ivq)
+option(cpPlugins_BUILD_ivq "Build ITK/VTK/Qt extensions." OFF)
+if(cpPlugins_BUILD_ivq)
## -- Set directories
set(_dirs . ITK)
LINKS ${ITK_LIBRARIES} ${VTK_LIBRARIES}
)
-endif(BUILD_ivq)
+endif(cpPlugins_BUILD_ivq)
## eof - $RCSfile$