Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main Repositories
otb
Commits
e4c28c81
Commit
e4c28c81
authored
6 years ago
by
Antoine Regimbeau
Browse files
Options
Downloads
Patches
Plain Diff
ENH: change qt4 to 5 in translation macro
parent
14b544a4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!3
Qt4to5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMake/i18n_qt5.cmake
+121
-0
121 additions, 0 deletions
CMake/i18n_qt5.cmake
with
121 additions
and
0 deletions
CMake/i18n_qt5.cmake
0 → 100644
+
121
−
0
View file @
e4c28c81
#
# 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_qt5_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_qt5_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_qt5_i18n_include_path DIRECTORY
)
set
(
OTB_I18N_INCLUDE_PATH
${
OTB_I18N_INCLUDE_PATH
}
${
DIRECTORY
}
CACHE INTERNAL
""
)
endmacro
()
#
#
macro
(
add_to_qt5_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_qt5_i18n_sources
)
add_to_qt5_i18n_files
(
OTB_QT_I18N_SOURCE_FILES
${
ARGN
}
)
endmacro
()
#
# Add source files to Qt I18n translation build.
macro
(
add_to_qt5_i18n_forms
)
add_to_qt5_i18n_files
(
OTB_QT_I18N_FORM_FILES
${
ARGN
}
)
endmacro
()
#
#
macro
(
generate_qt5_project FILENAME
)
message
(
STATUS
"Generating Qt5 '
${
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
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment