Commit 565753e2 authored by Emmanuel Christophe's avatar Emmanuel Christophe

ENH: generation of the config file

parent ff090f87
......@@ -1125,17 +1125,3 @@ ENDIF(WIN32 AND NOT UNIX AND NOT CYGWIN)
INCLUDE(CPack)
ENDIF(OTB_USE_CPACK)
#-----------------------------------------------------------------------------
# Manage OTB Configuration file otb_config.inputs
# SET(otbConfigFile_DEFAULT otb_config.inp)
# #copy the configuration file in the binary directory
# ADD_CUSTOM_COMMAND(
# OUTPUT ${OTB_BINARY_DIR}/${otbConfigFile_DEFAULT}
# COMMAND ${CMAKE_COMMAND} -E copy ${OTB_SOURCE_DIR}/Utilities/otbconfigfile/${otbConfigFile_DEFAULT} ${OTB_BINARY_DIR}/${otbConfigFile_DEFAULT}
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${otbConfigFile_DEFAULT}
# COMMENT "Copy configuration file to OTB_BINARY_DIR"
# )
#
# INSTALL(FILES ${OTB_SOURCE_DIR}/Utilities/otbconfigfile/${otbConfigFile_DEFAULT} DESTINATION ${CMAKE_INSTALL_PREFIX})
\ No newline at end of file
......@@ -26,6 +26,18 @@ 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
......
......@@ -2,23 +2,6 @@ PROJECT(otbconfigfile)
FILE(GLOB otbconfigfilelib_SRCS "ConfigFile.cpp")
FILE(GLOB otbconfigfilelib_HDRS "ConfigFile.h")
FILE(GLOB otbconfigfileCreation_SRCS "generate-config-properties.cpp")
FILE(GLOB otbconfigfile_DEFAULT "otb_config.inp")
ADD_EXECUTABLE(generate-config-properties ${otbconfigfileCreation_SRCS})
ADD_CUSTOM_COMMAND(
OUTPUT ${OTB_BINARY_DIR}/${otbconfigfile_DEFAULT}
COMMAND ${OTB_BINARY_DIR}/bin/generate-config-properties
ARGS "${OTB_BINARY_DIR}/${otbconfigfile_DEFAULT}" "${OTB_LANG}"
DEPENDS generate-config-properties
COMMENT "Generating otb_config.inp" )
SET_SOURCE_FILES_PROPERTIES(
${otbconfigfilelib_SRCS} PROPERTIES
OBJECT_DEPENDS "${OTB_BINARY_DIR}/${otbconfigfile_DEFAULT}"
)
ADD_LIBRARY(otbconfigfile ${otbconfigfilelib_SRCS} )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment