Skip to content
Snippets Groups Projects
Commit 23d1cb08 authored by Rashad Kanavath's avatar Rashad Kanavath
Browse files

PKG: move parsing configureMonteverdi.h

parent 2579e137
No related branches found
No related tags found
No related merge requests found
......@@ -21,28 +21,6 @@ macro(macro_setup_cmake_project pkg)
set(PKG_GENERATE_XDK OFF)
endif()
set(ConfigureMonteverdi_H ${OTB_BINARY_DIR}/Modules/Visualization/MonteverdiCore/ConfigureMonteverdi.h)
if(NOT EXISTS ${ConfigureMonteverdi_H})
message(FATAL_ERROR "${ConfigureMonteverdi_H} does not exists. Cannot continue")
endif()
file(STRINGS "${ConfigureMonteverdi_H}" ConfigureMonteverdi_H_CONTENTS REGEX "^#define.Monteverdi_INSTALL_DATA_DIR")
string(REGEX REPLACE
"^#define.Monteverdi_INSTALL_DATA_DIR" ""
ConfigureMonteverdi_H_CONTENTS
${ConfigureMonteverdi_H_CONTENTS} )
if(NOT ConfigureMonteverdi_H_CONTENTS)
message(FATAL_ERROR "parse error in ${ConfigureMonteverdi_H}. Cannot continue")
endif()
string(REGEX REPLACE "\"" "" PKG_OTB_INSTALL_DATA_DIR "${ConfigureMonteverdi_H_CONTENTS}")
if(NOT PKG_OTB_INSTALL_DATA_DIR)
message(FATAL_ERROR "parse error in ${ConfigureMonteverdi_H_CONTENTS}. Cannot continue")
endif()
string(STRIP "${PKG_OTB_INSTALL_DATA_DIR}" PKG_OTB_INSTALL_DATA_DIR)
#set archive name inside loop
file(WRITE "${PACKAGE_PROJECT_DIR}/src/CMakeLists.txt"
......@@ -53,7 +31,6 @@ macro(macro_setup_cmake_project pkg)
set(PACKAGE_OTB_SRC_DIR \"${PACKAGE_OTB_SRC_DIR}\")
set(OTB_BINARY_DIR \"${OTB_BINARY_DIR}\")
set(OTB_INSTALL_DIR \"${OTB_INSTALL_DIR}\")
set(OTB_INSTALL_DATA_DIR \"${PKG_OTB_INSTALL_DATA_DIR}\")
set(QT_PLUGINS_DIR \"${QT_PLUGINS_DIR}\")
set(QT_TRANSLATIONS_DIR \"${QT_TRANSLATIONS_DIR}\")
set(DEPENDENCIES_INSTALL_DIR \"${DEPENDENCIES_INSTALL_DIR}\")
......
......@@ -514,10 +514,39 @@ function(func_install_monteverdi_support_files)
#<prefix>/share for otb i18n directory. This is different from qt's i18N directory
#which is <prefix>/share/qt4/translations.
#set(PKG_xxOTB_Ixxx18N_DIR "${PKG_STAGE_DIR}/${OTB_INSTALL_DATA_DIR}/i18n")
#set(PKG_xxOTB_Ixxx18N_DIR "${PKG_STAGE_DIR}/${PKG_OTB_INSTALL_DATA_DIR}/i18n")
# we find this value by parsing ConfigureMonteverdi.h
set(ConfigureMonteverdi_H "${OTB_BINARY_DIR}/Modules/Visualization/MonteverdiCore/ConfigureMonteverdi.h")
if(NOT EXISTS "${ConfigureMonteverdi_H}")
message(FATAL_ERROR "${ConfigureMonteverdi_H} does not exists. Cannot continue")
endif()
file(
STRINGS "${ConfigureMonteverdi_H}"
ConfigureMonteverdi_H_CONTENTS
REGEX "^#define.Monteverdi_INSTALL_DATA_DIR")
string(REGEX REPLACE
"^#define.Monteverdi_INSTALL_DATA_DIR" ""
ConfigureMonteverdi_H_CONTENTS
${ConfigureMonteverdi_H_CONTENTS} )
if(NOT ConfigureMonteverdi_H_CONTENTS)
message(FATAL_ERROR "Parse error in ${ConfigureMonteverdi_H}. Cannot continue")
endif()
string(
REGEX REPLACE "\"" ""
PKG_OTB_INSTALL_DATA_DIR
"${ConfigureMonteverdi_H_CONTENTS}")
set(PKG_OTB_TRANSLATIONS_DIRNAME "${OTB_INSTALL_DATA_DIR}/i18n")
if(NOT PKG_OTB_INSTALL_DATA_DIR)
message(FATAL_ERROR "parse error in ${ConfigureMonteverdi_H_CONTENTS}. Cannot continue")
endif()
string(STRIP "${PKG_OTB_INSTALL_DATA_DIR}" PKG_OTB_INSTALL_DATA_DIR)
set(PKG_OTB_TRANSLATIONS_DIRNAME "${PKG_OTB_INSTALL_DATA_DIR}/i18n")
# Just check if required variables are defined.
foreach(req
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment