]> Creatis software - cpPlugins.git/commitdiff
Installation and configuration scripts added
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 9 Dec 2014 09:44:49 +0000 (10:44 +0100)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Tue, 9 Dec 2014 09:44:49 +0000 (10:44 +0100)
19 files changed:
CMakeLists.txt
README
cmake/CMakeLists.txt [new file with mode: 0644]
cmake/cpPluginsConfig.cmake.in [new file with mode: 0644]
lib/cpPlugins/Interface/CMakeLists.txt
lib/cpPlugins/Interface/DataObject.h
lib/cpPlugins/Interface/Image.h
lib/cpPlugins/Interface/Interface.h
lib/cpPlugins/Interface/Object.h
lib/cpPlugins/Interface/ProcessObject.h
lib/cpPlugins/Interface/SinkObject.h
lib/cpPlugins/Interface/SourceObject.h
lib/cpPlugins/Plugins/CMakeLists.txt
lib/cpPlugins/Plugins/ImageReader.cxx
lib/cpPlugins/Plugins/ImageReader.h
lib/cpPlugins/Plugins/ImageWriter.cxx
lib/cpPlugins/Plugins/ImageWriter.h
lib/cpPlugins/Plugins/Instances_itkImage.cxx [new file with mode: 0644]
lib/third_party/Pluma/CMakeLists.txt

index d21e1bfca0450ad11fc37df33cefccf5506a51cd..921b89f3020545050f27c5cf18613fc97a13bb2e 100644 (file)
@@ -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 6e3c8155472946ac2ba1c53ef398360ea327d406..667addaeefcd49d6b04e5fe2e7706f6eb16e647a 100644 (file)
--- 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 (file)
index 0000000..cbe3858
--- /dev/null
@@ -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 (file)
index 0000000..bb9819a
--- /dev/null
@@ -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$
index 8daa76187f004bd534242d6f0cbb34b7d4c1e396..e51b0ef7c3ccebe4cdd2187f6a7817a823c03d89 100644 (file)
@@ -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
index 9a8901e0c54e8c7f030fc5c2f4a41fd791ec83ed..c08365463e5e9a8abf736a85a4df4f90bf1da078 100644 (file)
@@ -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:
index 360da0168821d1543cfb65767a24e2983ea53678..cbdc219f7590e296f375204abbaffc360e35b323 100644 (file)
@@ -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:
index 1db73b95dd54af33348eb3999668ba51f2711946..1bade44fa75acfabc223413089b195f0bdd5e297 100644 (file)
@@ -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;
index d64ece2221e262b20342c6bd165cbdb57f48b552..d4436f68db36a6619947081124fd61275e120a21 100644 (file)
@@ -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( );
index 362cd762461234eeefcd53ae2e8300dda9db9829..aa7dea35fbf39d724e74ea8d066b27593f0518c4 100644 (file)
@@ -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:
index 38801df80196fd0f465bb083b63767281af7dded..7caf70ea38218921bfdef94fe0344d9120a1f385 100644 (file)
@@ -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:
index 89a5a6b4af6f10942ecfca272b112498e1303327..22914b9904bbe7237d13c4aaa67f409608e11611 100644 (file)
@@ -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:
index 4ac902a6f086d2022b8b645f4f332771262bf8f2..372b1504dbb12cfb3f07cc48392fff9958a773ea 100644 (file)
@@ -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
index feca19b52bb063cb79c3f5a23164b41d40e39385..b232268917881a0a99c36e52aa2f45f5e9d64112 100644 (file)
@@ -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>
 
 // -------------------------------------------------------------------------
index 4ecdfab820c488fd63d9252f1516c3f33fabeaa7..f20d29cf170a917f07ecfa63e8d8154f32db0f4d 100644 (file)
@@ -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:
index e4af224e204ec0cb1c6a236a67a48e127f0d9a1f..d33825418a7d24c9c1041586c0c84d6d536de24a 100644 (file)
@@ -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>
 
 // -------------------------------------------------------------------------
index 78f00efc0985c3da4772dcff57e99acc12dd9328..c2fc0639ddf0c5ce0f1f90f89d679f5be0ff6a49 100644 (file)
@@ -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 (file)
index 0000000..5aad235
--- /dev/null
@@ -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$
index 9f936e126502f605f2b17a451aca8a602152b9d8..c1a1261948167d1c40d0456e4b3933de3b112e3f 100644 (file)
@@ -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