Commit 7046a5e5 authored by Antoine Regimbeau's avatar Antoine Regimbeau

SuperBuild: change macro name and disable qt4 in ossim

parent 17e1fd7e
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Reset Qt I18N source files cache variable.
macro( reset_qt4_i18n_sources )
set( OTB_QT_I18N_INCLUDE_PATH "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_HEADER_FILES "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_SOURCE_FILES "" CACHE INTERNAL "" FORCE )
set( OTB_QT_I18N_FORM_FILES "" CACHE INTERNAL "" FORCE )
endmacro()
# string( REPLACE ".cxx" ".h" OTB_QT_I18N_HEADER_FILES OTB_QT_I18N_SOURCE_FILES )
# string( REPLACE ".cxx" ".ui" OTB_QT_I18N_HEADER_FILES OTB_QT_I18N_SOURCE_FILES )
#
# Func
function( add_to_qt4_i18n_files RESULT )
foreach( F ${ARGN} )
#message( "${F}" )
get_filename_component( ABS_FILE ${F} ABSOLUTE )
set(${RESULT} ${${RESULT}} ${ABS_FILE} CACHE INTERNAL "")
endforeach()
endfunction()
#
#
macro( add_to_qt4_i18n_include_path DIRECTORY )
set(OTB_I18N_INCLUDE_PATH ${OTB_I18N_INCLUDE_PATH} ${DIRECTORY} CACHE INTERNAL "")
endmacro()
#
#
macro( add_to_qt4_i18n_headers INCLUDE_DIR )
get_filename_component( ABS_INCLUDE_DIR ${INCLUDE_DIR} ABSOLUTE )
set(OTB_QT_I18N_INCLUDE_PATH ${OTB_QT_I18N_INCLUDE_PATH} ${ABS_INCLUDE_DIR} CACHE INTERNAL "")
foreach( F ${ARGN} )
string( REPLACE ".cxx" ".h" HEADER ${F} )
set( ABS_HEADER "${ABS_INCLUDE_DIR}/${HEADER}" )
if(EXISTS ${ABS_HEADER})
set(OTB_QT_I18N_HEADER_FILES ${OTB_QT_I18N_HEADER_FILES} ${ABS_HEADER} CACHE INTERNAL "")
endif()
endforeach()
endmacro()
#
# Add source files to Qt I18n translation build.
macro( add_to_qt4_i18n_sources )
add_to_qt4_i18n_files( OTB_QT_I18N_SOURCE_FILES ${ARGN} )
endmacro()
#
# Add source files to Qt I18n translation build.
macro( add_to_qt4_i18n_forms )
add_to_qt4_i18n_files( OTB_QT_I18N_FORM_FILES ${ARGN} )
endmacro()
#
#
macro( generate_qt4_project FILENAME )
message( STATUS "Generating Qt4 '${FILENAME}' project file for I18N." )
unset(_OTB_QT_I18N_INCLUDE_PATH_PRO)
unset(_OTB_QT_I18N_HEADER_PRO)
unset(_OTB_QT_I18N_SOURCE_PRO)
unset(_OTB_QT_I18N_FORM_PRO)
foreach(_path ${OTB_QT_I18N_INCLUDE_PATH})
set(_OTB_QT_I18N_INCLUDE_PATH_PRO
"${_OTB_QT_I18N_INCLUDE_PATH_PRO} \"${_path}\"")
endforeach()
foreach(_file ${OTB_QT_I18N_HEADER_FILES})
set(_OTB_QT_I18N_HEADER_PRO
"${_OTB_QT_I18N_HEADER_PRO} \"${_file}\"")
endforeach()
foreach(_file ${OTB_QT_I18N_SOURCE_FILES})
set(_OTB_QT_I18N_SOURCE_PRO
"${_OTB_QT_I18N_SOURCE_PRO} \"${_file}\"")
endforeach()
foreach(_file ${OTB_QT_I18N_FORM_FILES})
set(_OTB_QT_I18N_FORM_PRO
"${_OTB_QT_I18N_FORM_PRO} \"${_file}\"")
endforeach()
file( WRITE
${FILENAME}
"# OTB autogenerated .pro file needed to generate Qt I18N translations
INCLUDEPATH = ${_OTB_QT_I18N_INCLUDE_PATH_PRO}
HEADERS = ${_OTB_QT_I18N_HEADER_PRO}
SOURCES = ${_OTB_QT_I18N_SOURCE_PRO}
FORMS = ${_OTB_QT_I18N_FORM_PRO}
"
)
endmacro()
......@@ -24,5 +24,3 @@ find_package(Qt5Widgets)
find_package(Qt5OpenGL)
find_package(Qt5LinguistTools)
mark_as_advanced( QT_QMAKE_EXECUTABLE )
#include( ${QT_USE_FILE} )
......@@ -62,6 +62,7 @@ ExternalProject_Add(OSSIM
-DBUILD_OSSIM_TESTS:BOOL=OFF
-DBUILD_OSSIM_TEST_APPS:BOOL=OFF
-DBUILD_OSSIM_FRAMEWORKS:BOOL=OFF
-DBUILD_BUILD_OSSIMQT4:BOOL=OFF
-DINSTALL_ARCHIVE_DIR:STRING=lib
-DINSTALL_LIBRARY_DIR:STRING=lib
${OSSIM_SB_CONFIG}
......
......@@ -19,7 +19,7 @@
#
#############################################################################
# Qt4 translations.
# Qt translations.
#----------------------------------------------------------------------------
# Locale human-readable translation files.
set( OTB_TS_TRANSLATIONS
......@@ -37,7 +37,7 @@ option( OTB_I18N_MERGE_TS
)
#----------------------------------------------------------------------------
if( OTBQt4_ENABLED )
if( OTBQt_ENABLED )
# Generate commands to build Qt translations according to option.
if( OTB_I18N_MERGE_TS )
message(
......@@ -49,7 +49,7 @@ if( OTBQt4_ENABLED )
set( OTB_QT_I18N_PRO "${CMAKE_CURRENT_BINARY_DIR}/i18n.pro" )
generate_qt4_project( ${OTB_QT_I18N_PRO} )
generate_qt_project( ${OTB_QT_I18N_PRO} )
foreach(_ts_name ${OTB_TS_TRANSLATIONS})
get_filename_component(_abs_ts ${_ts_name} ABSOLUTE)
......
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