From 0b7a346ebd763a659d5a118c9fea0ae9048d05c5 Mon Sep 17 00:00:00 2001
From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Date: Tue, 13 Oct 2009 10:29:04 +0800
Subject: [PATCH] ENH: much better location for the config file generation

---
 CMakeLists.txt             | 13 +++++++++++++
 Code/Common/CMakeLists.txt | 12 ------------
 2 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8842ddafd3..18dba8ca0f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1125,3 +1125,16 @@ ENDIF(WIN32 AND NOT UNIX AND NOT CYGWIN)
 INCLUDE(CPack)
 
 ENDIF(OTB_USE_CPACK)
+
+
+FILE(GLOB otbconfigfileCreation_SRCS "${OTB_SOURCE_DIR}/CMake/generate-config-properties.cpp")
+SET(otbconfigfile_DEFAULT "${OTB_BINARY_DIR}/otb_config.inp")
+
+ADD_EXECUTABLE(generate-config-properties ${otbconfigfileCreation_SRCS})
+
+ADD_CUSTOM_COMMAND(
+          TARGET generate-config-properties
+          POST_BUILD
+          COMMAND generate-config-properties
+          ARGS "${otbconfigfile_DEFAULT}" "${OTB_LANG}"
+          COMMENT "Generating otb_config.inp" )
diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt
index d3a7a13c0b..56010dbaa8 100644
--- a/Code/Common/CMakeLists.txt
+++ b/Code/Common/CMakeLists.txt
@@ -26,18 +26,6 @@ IF(OTB_LIBRARY_PROPERTIES)
   SET_TARGET_PROPERTIES(OTBCommon PROPERTIES ${OTB_LIBRARY_PROPERTIES})
 ENDIF(OTB_LIBRARY_PROPERTIES)
 
-FILE(GLOB otbconfigfileCreation_SRCS "${OTB_SOURCE_DIR}/CMake/generate-config-properties.cpp")
-SET(otbconfigfile_DEFAULT "${OTB_BINARY_DIR}/otb_config.inp")
-
-ADD_EXECUTABLE(generate-config-properties ${otbconfigfileCreation_SRCS})
-
-ADD_CUSTOM_COMMAND(
-          TARGET OTBCommon
-          POST_BUILD
-          COMMAND generate-config-properties
-          ARGS "${otbconfigfile_DEFAULT}" "${OTB_LANG}"
-          COMMENT "Generating otb_config.inp" )
-
 IF(NOT OTB_INSTALL_NO_LIBRARIES)
   INSTALL(TARGETS OTBCommon
     RUNTIME DESTINATION ${OTB_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries
-- 
GitLab