From bc95d8a4767decaed65a75fd11a1776904231918 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Sat, 2 Jul 2011 22:02:02 +0200
Subject: [PATCH] ENH: handle install (missing Python support)

---
 Code/Core/CMakeLists.txt                           |  8 ++++++++
 Code/Wrappers/ApplicationLauncherQt/CMakeLists.txt |  6 ++++++
 Code/Wrappers/QtWidget/CMakeLists.txt              |  9 +++++++++
 Code/Wrappers/SWIG/CMakeLists.txt                  | 10 ++++++++++
 4 files changed, 33 insertions(+)

diff --git a/Code/Core/CMakeLists.txt b/Code/Core/CMakeLists.txt
index 7264f2f73c..c5fb6fcf3d 100644
--- a/Code/Core/CMakeLists.txt
+++ b/Code/Core/CMakeLists.txt
@@ -2,3 +2,11 @@ file(GLOB srcs "*.cxx")
 
 add_library(OTBWrapperCore ${srcs})
 target_link_libraries(OTBWrapperCore OTBCommon OTBIO)
+install(TARGETS OTBWrapperCore
+        RUNTIME DESTINATION bin
+        LIBRARY DESTINATION lib
+        ARCHIVE DESTINATION lib/static)
+
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include/otbapp
+        FILES_MATCHING PATTERN "*.h")
+ 
\ No newline at end of file
diff --git a/Code/Wrappers/ApplicationLauncherQt/CMakeLists.txt b/Code/Wrappers/ApplicationLauncherQt/CMakeLists.txt
index 9f3beb6b99..7a5a4a1b18 100644
--- a/Code/Wrappers/ApplicationLauncherQt/CMakeLists.txt
+++ b/Code/Wrappers/ApplicationLauncherQt/CMakeLists.txt
@@ -10,3 +10,9 @@ target_link_libraries(otbApplicationLauncherQt
                        OTBWrapperQtWidget
                        OTBWrapperCore
                        ${QT_LIBRARIES})
+
+install(TARGETS otbApplicationLauncherQt
+        RUNTIME DESTINATION bin
+        LIBRARY DESTINATION lib
+        ARCHIVE DESTINATION lib/static)
+                       
\ No newline at end of file
diff --git a/Code/Wrappers/QtWidget/CMakeLists.txt b/Code/Wrappers/QtWidget/CMakeLists.txt
index d791b16052..88c208291d 100644
--- a/Code/Wrappers/QtWidget/CMakeLists.txt
+++ b/Code/Wrappers/QtWidget/CMakeLists.txt
@@ -20,3 +20,12 @@ QT4_WRAP_CPP(WrappersQtWidget_MOC_SRC ${WrappersQtWidget_MOC_HDR})
 
 add_library(OTBWrapperQtWidget ${srcs} ${WrappersQtWidget_MOC_SRC})
 target_link_libraries(OTBWrapperQtWidget OTBCommon OTBIO OTBWrapperCore ${QT_LIBRARIES})
+
+install(TARGETS OTBWrapperQtWidget
+        RUNTIME DESTINATION bin
+        LIBRARY DESTINATION lib
+        ARCHIVE DESTINATION lib/static)
+ 
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include/otbapp
+        FILES_MATCHING PATTERN "*.h")
+ 
\ No newline at end of file
diff --git a/Code/Wrappers/SWIG/CMakeLists.txt b/Code/Wrappers/SWIG/CMakeLists.txt
index e1d75a4021..f93cd9043a 100644
--- a/Code/Wrappers/SWIG/CMakeLists.txt
+++ b/Code/Wrappers/SWIG/CMakeLists.txt
@@ -140,6 +140,11 @@ if ( WRAP_LUA )
   if ( UNIX )
     target_link_libraries ( otbApplicationLua curses )
   endif()
+  
+  install(TARGETS otbApplicationLua
+          RUNTIME DESTINATION bin
+          LIBRARY DESTINATION lib
+          ARCHIVE DESTINATION lib/static)
 
 endif()
 
@@ -161,5 +166,10 @@ if ( WRAP_RUBY )
   SWIG_link_libraries ( otbApplication ${RUBY_LIBRARY} OTBWrapperCore)
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/otbApplicationRUBY_wrap.cxx COMPILE_FLAGS "-w")
 
+  install(TARGETS otbapplication
+          RUNTIME DESTINATION bin
+          LIBRARY DESTINATION lib
+          ARCHIVE DESTINATION lib/static)
+
 endif()
 
-- 
GitLab