From: Leonardo Florez-Valencia <florez-l@javeriana.edu.co>
Date: Tue, 9 Dec 2014 09:44:49 +0000 (+0100)
Subject: Installation and configuration scripts added
X-Git-Tag: v0.1~448
X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c29448936abc15d110205b2da435035131398a87;p=cpPlugins.git

Installation and configuration scripts added
---

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d21e1bf..921b89f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,9 +21,9 @@ ENDIF(
 ## ================
 
 PROJECT(cpPlugins)
-SET(cpPlugins_MAJOR_VERSION   "1")
+SET(cpPlugins_MAJOR_VERSION   "0")
 SET(cpPlugins_MINOR_VERSION   "0")
-SET(cpPlugins_RELEASE_VERSION "0")
+SET(cpPlugins_RELEASE_VERSION "1")
 SET(cpPlugins_VERSION "${cpPlugins_MAJOR_VERSION}.${cpPlugins_MINOR_VERSION}.${cpPlugins_RELEASE_VERSION}")
 
 ## ===========
@@ -36,6 +36,8 @@ OPTION(BUILD_EXAMPLES "Build examples" OFF)
 ## = Packages =
 ## ============
 
+INCLUDE(GenerateExportHeader)
+
 FIND_PACKAGE(ITK REQUIRED)
 INCLUDE(${ITK_USE_FILE})
 
@@ -69,6 +71,8 @@ MARK_AS_ADVANCED(
 INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/lib
   ${PROJECT_SOURCE_DIR}/lib/third_party
+  ${PROJECT_BINARY_DIR}/lib
+  ${PROJECT_BINARY_DIR}/lib/third_party
   )
 
 ## ===========================
@@ -76,6 +80,7 @@ INCLUDE_DIRECTORIES(
 ## ===========================
 
 SUBDIRS(
+  cmake
   lib
   appli
   )
diff --git a/README b/README
index 6e3c815..667adda 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
              sources and sinks)
 
 @version
-  1.0.0 (2014-12-31)
+  0.0.1 (2014-12-31)
 
 @authors
   Maciej ORKISZ (maciej.orkisz@creatis.insa-lyon.fr)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
new file mode 100644
index 0000000..cbe3858
--- /dev/null
+++ b/cmake/CMakeLists.txt
@@ -0,0 +1,7 @@
+CONFIGURE_FILE(
+  cpPluginsConfig.cmake.in
+  ${PROJECT_BINARY_DIR}/cpPluginsConfig.cmake
+  @ONLY
+  )
+
+## eof - $RCSfile$
diff --git a/cmake/cpPluginsConfig.cmake.in b/cmake/cpPluginsConfig.cmake.in
new file mode 100644
index 0000000..bb9819a
--- /dev/null
+++ b/cmake/cpPluginsConfig.cmake.in
@@ -0,0 +1,55 @@
+FIND_PATH(
+  cpPlugins_INCLUDE_DIR1
+  cpPlugins/Interface/Interface.h
+  PATHS
+  /usr/include
+  /usr/local/include
+  @PROJECT_SOURCE_DIR@/lib
+  @PROJECT_BINARY_DIR@/lib
+  @CMAKE_INSTALL_PREFIX@/include
+  )
+
+FIND_PATH(
+  cpPlugins_INCLUDE_DIR2
+  cpPlugins/Interface/cpPlugins_Export.h
+  PATHS
+  /usr/include
+  /usr/local/include
+  @PROJECT_SOURCE_DIR@/lib
+  @PROJECT_BINARY_DIR@/lib
+  @CMAKE_INSTALL_PREFIX@/include
+  )
+
+FIND_PATH(
+  cpPlugins_INCLUDE_DIR3
+  Pluma/Pluma.hpp
+  PATHS
+  /usr/include
+  /usr/local/include
+  @PROJECT_SOURCE_DIR@/lib/third_party
+  @PROJECT_BINARY_DIR@/lib/third_party
+  @CMAKE_INSTALL_PREFIX@/include
+  )
+
+INCLUDE_DIRECTORIES(
+  ${cpPlugins_INCLUDE_DIR1}
+  ${cpPlugins_INCLUDE_DIR2}
+  ${cpPlugins_INCLUDE_DIR2}
+  )
+
+FIND_LIBRARY(
+  cpPlugins_Interface_LIBRARY_NAME
+  cpPlugins_Interface
+  PATHS
+  /usr/lib
+  /usr/local/lib
+  @PROJECT_BINARY_DIR@
+  @CMAKE_INSTALL_PREFIX@/lib
+  )
+
+SET(
+  cpPlugins_Interface_LIBRARIES
+  ${cpPlugins_Interface_LIBRARY_NAME}
+  )
+
+## eof - $RCSfile$
diff --git a/lib/cpPlugins/Interface/CMakeLists.txt b/lib/cpPlugins/Interface/CMakeLists.txt
index 8daa761..e51b0ef 100644
--- a/lib/cpPlugins/Interface/CMakeLists.txt
+++ b/lib/cpPlugins/Interface/CMakeLists.txt
@@ -22,6 +22,13 @@ ADD_LIBRARY(
   ${LIB_SOURCES_CPP}
   ${LIB_SOURCES_CXX}
   )
+GENERATE_EXPORT_HEADER(
+  ${LIBRARY_NAME}
+  BASE_NAME ${LIBRARY_NAME}
+  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/Interface/${LIBRARY_NAME}_Export.h
+  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+  )
 TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
   cpPlugins_Pluma
diff --git a/lib/cpPlugins/Interface/DataObject.h b/lib/cpPlugins/Interface/DataObject.h
index 9a8901e..c083654 100644
--- a/lib/cpPlugins/Interface/DataObject.h
+++ b/lib/cpPlugins/Interface/DataObject.h
@@ -4,6 +4,7 @@
 #include <map>
 #include <string>
 #include <itkDataObject.h>
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/Object.h>
 
 namespace cpPlugins
@@ -14,7 +15,7 @@ namespace cpPlugins
 
     /**
      */
-    class DataObject
+    class cpPlugins_Interface_EXPORT DataObject
       : public Object
     {
     public:
diff --git a/lib/cpPlugins/Interface/Image.h b/lib/cpPlugins/Interface/Image.h
index 360da01..cbdc219 100644
--- a/lib/cpPlugins/Interface/Image.h
+++ b/lib/cpPlugins/Interface/Image.h
@@ -4,6 +4,7 @@
 #include <map>
 #include <string>
 #include <itkProcessObject.h>
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/DataObject.h>
 
 namespace cpPlugins
@@ -12,7 +13,7 @@ namespace cpPlugins
   {
     /**
      */
-    class Image
+    class cpPlugins_Interface_EXPORT Image
       : public DataObject
     {
     public:
diff --git a/lib/cpPlugins/Interface/Interface.h b/lib/cpPlugins/Interface/Interface.h
index 1db73b9..1bade44 100644
--- a/lib/cpPlugins/Interface/Interface.h
+++ b/lib/cpPlugins/Interface/Interface.h
@@ -6,6 +6,7 @@
 #include <vector>
 #include <Pluma/Pluma.hpp>
 
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/Object.h>
 
 namespace cpPlugins
@@ -14,7 +15,7 @@ namespace cpPlugins
   {
     /**
      */
-    class Interface
+    class cpPlugins_Interface_EXPORT Interface
     {
     public:
       typedef std::vector< ObjectProvider* >        TProviders;
diff --git a/lib/cpPlugins/Interface/Object.h b/lib/cpPlugins/Interface/Object.h
index d64ece2..d4436f6 100644
--- a/lib/cpPlugins/Interface/Object.h
+++ b/lib/cpPlugins/Interface/Object.h
@@ -3,6 +3,7 @@
 
 #include <string>
 #include <Pluma/Pluma.hpp>
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 
 namespace cpPlugins
 {
@@ -10,7 +11,7 @@ namespace cpPlugins
   {
     /**
      */
-    class Object
+    class cpPlugins_Interface_EXPORT Object
     {
     public:
       Object( );
diff --git a/lib/cpPlugins/Interface/ProcessObject.h b/lib/cpPlugins/Interface/ProcessObject.h
index 362cd76..aa7dea3 100644
--- a/lib/cpPlugins/Interface/ProcessObject.h
+++ b/lib/cpPlugins/Interface/ProcessObject.h
@@ -4,6 +4,7 @@
 #include <map>
 #include <string>
 #include <itkDataObject.h>
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/Object.h>
 
 namespace cpPlugins
@@ -14,7 +15,7 @@ namespace cpPlugins
 
     /**
      */
-    class ProcessObject
+    class cpPlugins_Interface_EXPORT ProcessObject
       : public Object
     {
     public:
diff --git a/lib/cpPlugins/Interface/SinkObject.h b/lib/cpPlugins/Interface/SinkObject.h
index 38801df..7caf70e 100644
--- a/lib/cpPlugins/Interface/SinkObject.h
+++ b/lib/cpPlugins/Interface/SinkObject.h
@@ -1,6 +1,7 @@
 #ifndef __CPPLUGINS__INTERFACE__SINKOBJECT__H__
 #define __CPPLUGINS__INTERFACE__SINKOBJECT__H__
 
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/ProcessObject.h>
 
 namespace cpPlugins
@@ -9,7 +10,7 @@ namespace cpPlugins
   {
     /**
      */
-    class SinkObject
+    class cpPlugins_Interface_EXPORT SinkObject
       : public ProcessObject
     {
     public:
diff --git a/lib/cpPlugins/Interface/SourceObject.h b/lib/cpPlugins/Interface/SourceObject.h
index 89a5a6b..22914b9 100644
--- a/lib/cpPlugins/Interface/SourceObject.h
+++ b/lib/cpPlugins/Interface/SourceObject.h
@@ -1,6 +1,7 @@
 #ifndef __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__
 #define __CPPLUGINS__INTERFACE__SOURCEOBJECT__H__
 
+#include <cpPlugins/Interface/cpPlugins_Interface_Export.h>
 #include <cpPlugins/Interface/ProcessObject.h>
 
 namespace cpPlugins
@@ -9,7 +10,7 @@ namespace cpPlugins
   {
     /**
      */
-    class SourceObject
+    class cpPlugins_Interface_EXPORT SourceObject
       : public ProcessObject
     {
     public:
diff --git a/lib/cpPlugins/Plugins/CMakeLists.txt b/lib/cpPlugins/Plugins/CMakeLists.txt
index 4ac902a..372b150 100644
--- a/lib/cpPlugins/Plugins/CMakeLists.txt
+++ b/lib/cpPlugins/Plugins/CMakeLists.txt
@@ -22,6 +22,13 @@ ADD_LIBRARY(
   ${LIB_SOURCES_CPP}
   ${LIB_SOURCES_CXX}
   )
+GENERATE_EXPORT_HEADER(
+  ${LIBRARY_NAME}
+  BASE_NAME ${LIBRARY_NAME}
+  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/cpPlugins/Plugins/${LIBRARY_NAME}_Export.h
+  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+  )
 TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
   cpPlugins_Interface
diff --git a/lib/cpPlugins/Plugins/ImageReader.cxx b/lib/cpPlugins/Plugins/ImageReader.cxx
index feca19b..b232268 100644
--- a/lib/cpPlugins/Plugins/ImageReader.cxx
+++ b/lib/cpPlugins/Plugins/ImageReader.cxx
@@ -1,8 +1,9 @@
 #include <cpPlugins/Plugins/ImageReader.h>
 
-// TODO: interesting... #define ITK_MANUAL_INSTANTIATION
-#include <itkImage.h>
 #include <itkImageFileReader.h>
+
+#define ITK_MANUAL_INSTANTIATION
+#include <itkImage.h>
 #include <itkRGBPixel.h>
 
 // -------------------------------------------------------------------------
diff --git a/lib/cpPlugins/Plugins/ImageReader.h b/lib/cpPlugins/Plugins/ImageReader.h
index 4ecdfab..f20d29c 100644
--- a/lib/cpPlugins/Plugins/ImageReader.h
+++ b/lib/cpPlugins/Plugins/ImageReader.h
@@ -1,6 +1,7 @@
 #ifndef __CPPLUGINS__PLUGINS__IMAGEREADER__H__
 #define __CPPLUGINS__PLUGINS__IMAGEREADER__H__
 
+#include <cpPlugins/Plugins/cpPlugins_Export.h>
 #include <cpPlugins/Interface/SourceObject.h>
 #include <itkProcessObject.h>
 
@@ -10,7 +11,7 @@ namespace cpPlugins
   {
     /**
      */
-    class ImageReader
+    class cpPlugins_EXPORT ImageReader
       : public cpPlugins::Interface::SourceObject
     {
     public:
diff --git a/lib/cpPlugins/Plugins/ImageWriter.cxx b/lib/cpPlugins/Plugins/ImageWriter.cxx
index e4af224..d338254 100644
--- a/lib/cpPlugins/Plugins/ImageWriter.cxx
+++ b/lib/cpPlugins/Plugins/ImageWriter.cxx
@@ -1,8 +1,9 @@
 #include <cpPlugins/Plugins/ImageWriter.h>
 
-// TODO: interesting... #define ITK_MANUAL_INSTANTIATION
-#include <itkImage.h>
 #include <itkImageFileWriter.h>
+
+#define ITK_MANUAL_INSTANTIATION
+#include <itkImage.h>
 #include <itkRGBPixel.h>
 
 // -------------------------------------------------------------------------
diff --git a/lib/cpPlugins/Plugins/ImageWriter.h b/lib/cpPlugins/Plugins/ImageWriter.h
index 78f00ef..c2fc063 100644
--- a/lib/cpPlugins/Plugins/ImageWriter.h
+++ b/lib/cpPlugins/Plugins/ImageWriter.h
@@ -1,6 +1,7 @@
 #ifndef __CPPLUGINS__PLUGINS__IMAGEWRITER__H__
 #define __CPPLUGINS__PLUGINS__IMAGEWRITER__H__
 
+#include <cpPlugins/Plugins/cpPlugins_Export.h>
 #include <cpPlugins/Interface/SinkObject.h>
 #include <itkProcessObject.h>
 
@@ -10,7 +11,7 @@ namespace cpPlugins
   {
     /**
      */
-    class ImageWriter
+    class cpPlugins_EXPORT ImageWriter
       : public cpPlugins::Interface::SinkObject
     {
     public:
diff --git a/lib/cpPlugins/Plugins/Instances_itkImage.cxx b/lib/cpPlugins/Plugins/Instances_itkImage.cxx
new file mode 100644
index 0000000..5aad235
--- /dev/null
+++ b/lib/cpPlugins/Plugins/Instances_itkImage.cxx
@@ -0,0 +1,90 @@
+#include <itkImage.h>
+#include <itkRGBPixel.h>
+
+// Explicit instantiations of most common itk-based image types
+
+template class itk::Image< char, 1 >;
+template class itk::Image< short, 1 >;
+template class itk::Image< int, 1 >;
+template class itk::Image< long, 1 >;
+template class itk::Image< unsigned char, 1 >;
+template class itk::Image< unsigned short, 1 >;
+template class itk::Image< unsigned int, 1 >;
+template class itk::Image< unsigned long, 1 >;
+template class itk::Image< float, 1 >;
+template class itk::Image< double, 1 >;
+template class itk::Image< itk::RGBPixel< char >, 1 >;
+template class itk::Image< itk::RGBPixel< short >, 1 >;
+template class itk::Image< itk::RGBPixel< int >, 1 >;
+template class itk::Image< itk::RGBPixel< long >, 1 >;
+template class itk::Image< itk::RGBPixel< unsigned char >, 1 >;
+template class itk::Image< itk::RGBPixel< unsigned short >, 1 >;
+template class itk::Image< itk::RGBPixel< unsigned int >, 1 >;
+template class itk::Image< itk::RGBPixel< unsigned long >, 1 >;
+template class itk::Image< itk::RGBPixel< float >, 1 >;
+template class itk::Image< itk::RGBPixel< double >, 1 >;
+
+template class itk::Image< char, 2 >;
+template class itk::Image< short, 2 >;
+template class itk::Image< int, 2 >;
+template class itk::Image< long, 2 >;
+template class itk::Image< unsigned char, 2 >;
+template class itk::Image< unsigned short, 2 >;
+template class itk::Image< unsigned int, 2 >;
+template class itk::Image< unsigned long, 2 >;
+template class itk::Image< float, 2 >;
+template class itk::Image< double, 2 >;
+template class itk::Image< itk::RGBPixel< char >, 2 >;
+template class itk::Image< itk::RGBPixel< short >, 2 >;
+template class itk::Image< itk::RGBPixel< int >, 2 >;
+template class itk::Image< itk::RGBPixel< long >, 2 >;
+template class itk::Image< itk::RGBPixel< unsigned char >, 2 >;
+template class itk::Image< itk::RGBPixel< unsigned short >, 2 >;
+template class itk::Image< itk::RGBPixel< unsigned int >, 2 >;
+template class itk::Image< itk::RGBPixel< unsigned long >, 2 >;
+template class itk::Image< itk::RGBPixel< float >, 2 >;
+template class itk::Image< itk::RGBPixel< double >, 2 >;
+
+template class itk::Image< char, 3 >;
+template class itk::Image< short, 3 >;
+template class itk::Image< int, 3 >;
+template class itk::Image< long, 3 >;
+template class itk::Image< unsigned char, 3 >;
+template class itk::Image< unsigned short, 3 >;
+template class itk::Image< unsigned int, 3 >;
+template class itk::Image< unsigned long, 3 >;
+template class itk::Image< float, 3 >;
+template class itk::Image< double, 3 >;
+template class itk::Image< itk::RGBPixel< char >, 3 >;
+template class itk::Image< itk::RGBPixel< short >, 3 >;
+template class itk::Image< itk::RGBPixel< int >, 3 >;
+template class itk::Image< itk::RGBPixel< long >, 3 >;
+template class itk::Image< itk::RGBPixel< unsigned char >, 3 >;
+template class itk::Image< itk::RGBPixel< unsigned short >, 3 >;
+template class itk::Image< itk::RGBPixel< unsigned int >, 3 >;
+template class itk::Image< itk::RGBPixel< unsigned long >, 3 >;
+template class itk::Image< itk::RGBPixel< float >, 3 >;
+template class itk::Image< itk::RGBPixel< double >, 3 >;
+
+template class itk::Image< char, 4 >;
+template class itk::Image< short, 4 >;
+template class itk::Image< int, 4 >;
+template class itk::Image< long, 4 >;
+template class itk::Image< unsigned char, 4 >;
+template class itk::Image< unsigned short, 4 >;
+template class itk::Image< unsigned int, 4 >;
+template class itk::Image< unsigned long, 4 >;
+template class itk::Image< float, 4 >;
+template class itk::Image< double, 4 >;
+template class itk::Image< itk::RGBPixel< char >, 4 >;
+template class itk::Image< itk::RGBPixel< short >, 4 >;
+template class itk::Image< itk::RGBPixel< int >, 4 >;
+template class itk::Image< itk::RGBPixel< long >, 4 >;
+template class itk::Image< itk::RGBPixel< unsigned char >, 4 >;
+template class itk::Image< itk::RGBPixel< unsigned short >, 4 >;
+template class itk::Image< itk::RGBPixel< unsigned int >, 4 >;
+template class itk::Image< itk::RGBPixel< unsigned long >, 4 >;
+template class itk::Image< itk::RGBPixel< float >, 4 >;
+template class itk::Image< itk::RGBPixel< double >, 4 >;
+
+// eof - $RCSfile$
diff --git a/lib/third_party/Pluma/CMakeLists.txt b/lib/third_party/Pluma/CMakeLists.txt
index 9f936e1..c1a1261 100644
--- a/lib/third_party/Pluma/CMakeLists.txt
+++ b/lib/third_party/Pluma/CMakeLists.txt
@@ -22,6 +22,13 @@ ADD_LIBRARY(
   ${LIB_SOURCES_CPP}
   ${LIB_SOURCES_CXX}
   )
+GENERATE_EXPORT_HEADER(
+  ${LIBRARY_NAME}
+  BASE_NAME ${LIBRARY_NAME}
+  EXPORT_MACRO_NAME ${LIBRARY_NAME}_EXPORT
+  EXPORT_FILE_NAME ${PROJECT_BINARY_DIR}/lib/third_party/Pluma/${LIBRARY_NAME}_Export.h
+  STATIC_DEFINE ${LIBRARY_NAME}_BUILT_AS_STATIC
+  )
 TARGET_LINK_LIBRARIES(
   ${LIBRARY_NAME}
   dl