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
Sébastien Peillet
otb
Commits
3e88297d
Commit
3e88297d
authored
8 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: use linux line endings
parent
06766699
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SuperBuild/Packaging/CMakeLists.txt
+192
-189
192 additions, 189 deletions
SuperBuild/Packaging/CMakeLists.txt
with
192 additions
and
189 deletions
SuperBuild/Packaging/CMakeLists.txt
+
192
−
189
View file @
3e88297d
# cpack has a built-in target called 'package'. In our case we create two standalone installers with
# cpack has a built-in target called 'package'. In our case we create two standalone installers with
# and uses a custom target named packages.
# and uses a custom target named packages.
# stop generation of msvc packages for windows. 04-apr-2016. point OTB.
# stop generation of msvc packages for windows. 04-apr-2016. point OTB.
##### check if standalone project ######
##### check if standalone project ######
set
(
OUT_OF_SOURCE_BUILD FALSE
)
set
(
OUT_OF_SOURCE_BUILD FALSE
)
if
(
NOT PROJECT_NAME
)
if
(
NOT PROJECT_NAME
)
cmake_minimum_required
(
VERSION 2.6
)
cmake_minimum_required
(
VERSION 2.6
)
include
(
CMakeParseArguments
)
include
(
CMakeParseArguments
)
project
(
OTBPackaging
)
project
(
OTBPackaging
)
option
(
GENERATE_PACKAGE
"Generate OTB package"
ON
)
option
(
GENERATE_PACKAGE
"Generate OTB package"
ON
)
option
(
GENERATE_XDK
"Generate XDK for OTB development"
OFF
)
option
(
GENERATE_XDK
"Generate XDK for OTB development"
OFF
)
set
(
OUT_OF_SOURCE_BUILD TRUE
)
set
(
OUT_OF_SOURCE_BUILD TRUE
)
if
(
BUILD_TESTING
)
if
(
BUILD_TESTING
)
include
(
CTest
)
include
(
CTest
)
endif
()
endif
()
if
(
NOT PACKAGE_OTB_SRC_DIR
)
if
(
NOT PACKAGE_OTB_SRC_DIR
)
get_filename_component
(
PACKAGE_OTB_SRC_DIR
${
OTBPackaging_SOURCE_DIR
}
PATH
)
get_filename_component
(
PACKAGE_OTB_SRC_DIR
${
OTBPackaging_SOURCE_DIR
}
PATH
)
get_filename_component
(
PACKAGE_OTB_SRC_DIR
${
PACKAGE_OTB_SRC_DIR
}
PATH
)
get_filename_component
(
PACKAGE_OTB_SRC_DIR
${
PACKAGE_OTB_SRC_DIR
}
PATH
)
endif
()
endif
()
option
(
OTB_WRAP_PYTHON
"enable python wrapping"
ON
)
option
(
OTB_WRAP_PYTHON
"enable python wrapping"
ON
)
if
(
OTB_WRAP_PYTHON AND NOT PYTHON_EXECUTABLE
)
if
(
OTB_WRAP_PYTHON AND NOT PYTHON_EXECUTABLE
)
find_package
(
PythonInterp REQUIRED
)
find_package
(
PythonInterp REQUIRED
)
mark_as_advanced
(
PYTHON_INCLUDE_DIR
)
mark_as_advanced
(
PYTHON_INCLUDE_DIR
)
mark_as_advanced
(
PYTHON_LIBRARY
)
mark_as_advanced
(
PYTHON_LIBRARY
)
endif
()
endif
()
if
(
OTB_MINGW
)
if
(
OTB_MINGW
)
set
(
OTB_BINARY_DIR
""
CACHE PATH
"OTB binary directory"
)
set
(
OTB_BINARY_DIR
""
CACHE PATH
"OTB binary directory"
)
set
(
OTB_INSTALL_DIR
""
CACHE PATH
"OTB install directory"
)
set
(
OTB_INSTALL_DIR
""
CACHE PATH
"OTB install directory"
)
else
()
else
()
set
(
SUPERBUILD_BINARY_DIR
""
CACHE PATH
"path to superbuild binary directory"
)
set
(
SUPERBUILD_BINARY_DIR
""
CACHE PATH
"path to superbuild binary directory"
)
set
(
SUPERBUILD_INSTALL_DIR
""
CACHE PATH
"path to superbuild install directory"
)
set
(
SUPERBUILD_INSTALL_DIR
""
CACHE PATH
"path to superbuild install directory"
)
set
(
DOWNLOAD_LOCATION
""
CACHE PATH
"path to superbuild download archives"
)
set
(
DOWNLOAD_LOCATION
""
CACHE PATH
"path to superbuild download archives"
)
endif
()
endif
()
else
()
#if(NOT PROJECT_NAME)
else
()
#if(NOT PROJECT_NAME)
# SUPERBUILD_BINARY_DIR is only set in Packaging/CMakeLists.txt and not available
# SUPERBUILD_BINARY_DIR is only set in Packaging/CMakeLists.txt and not available
# in the parent scope like others. So we need to set it as CMAKE_BINARY_DIR
# in the parent scope like others. So we need to set it as CMAKE_BINARY_DIR
# if doing packages from source tree.
# if doing packages from source tree.
set
(
SUPERBUILD_BINARY_DIR
${
CMAKE_BINARY_DIR
}
)
set
(
SUPERBUILD_BINARY_DIR
${
CMAKE_BINARY_DIR
}
)
set
(
SUPERBUILD_INSTALL_DIR
${
SB_INSTALL_PREFIX
}
)
set
(
SUPERBUILD_INSTALL_DIR
${
SB_INSTALL_PREFIX
}
)
set
(
OTB_INSTALL_DIR
${
CMAKE_INSTALL_PREFIX
}
)
set
(
OTB_INSTALL_DIR
${
CMAKE_INSTALL_PREFIX
}
)
if
(
NOT PACKAGE_OTB_SRC_DIR
)
if
(
NOT PACKAGE_OTB_SRC_DIR
)
get_filename_component
(
PACKAGE_OTB_SRC_DIR
${
OTB-SuperBuild_SOURCE_DIR
}
PATH
)
get_filename_component
(
PACKAGE_OTB_SRC_DIR
${
OTB-SuperBuild_SOURCE_DIR
}
PATH
)
endif
()
endif
()
endif
()
endif
()
if
(
NOT GENERATE_PACKAGE AND NOT GENERATE_XDK
)
if
(
NOT GENERATE_PACKAGE AND NOT GENERATE_XDK
)
#well. we don't have any businees here. Let's move on..
#well. we don't have any businees here. Let's move on..
return
()
return
()
endif
()
endif
()
set
(
LINUX FALSE
)
set
(
LINUX FALSE
)
set
(
OTB_MINGW FALSE
)
set
(
OTB_MINGW FALSE
)
if
(
WIN32 AND NOT MSVC
)
if
(
WIN32 AND NOT MSVC
)
set
(
OTB_MINGW TRUE
)
set
(
OTB_MINGW TRUE
)
else
()
else
()
if
(
"
${
CMAKE_SYSTEM_NAME
}
"
MATCHES
"Linux"
)
if
(
"
${
CMAKE_SYSTEM_NAME
}
"
MATCHES
"Linux"
)
set
(
LINUX TRUE
)
set
(
LINUX TRUE
)
endif
()
endif
()
endif
()
endif
()
set
(
SUPERBUILD_SOURCE_DIR
${
PACKAGE_OTB_SRC_DIR
}
/SuperBuild
)
find_program
(
FILE_COMMAND
"file"
)
mark_as_advanced
(
FILE_COMMAND
)
include
(
${
SUPERBUILD_SOURCE_DIR
}
/CMake/SuperBuild_Macro.cmake
)
include
(
${
PACKAGE_OTB_SRC_DIR
}
/CMake/OTBCheckTargetSystemArch.cmake
)
set
(
SUPERBUILD_SOURCE_DIR
${
PACKAGE_OTB_SRC_DIR
}
/SuperBuild
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/CreateCMakeProjects.cmake
)
include
(
${
SUPERBUILD_SOURCE_DIR
}
/CMake/SuperBuild_Macro.cmake
)
if
(
WIN32
)
include
(
${
PACKAGE_OTB_SRC_DIR
}
/CMake/OTBCheckTargetSystemArch.cmake
)
set
(
ZIP_EXE_NAMES 7z 7za
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/CreateCMakeProjects.cmake
)
find_program
(
ZIP_EXECUTABLE NAMES
${
ZIP_EXE_NAMES
}
)
if
(
NOT ZIP_EXECUTABLE
)
if
(
WIN32
)
message
(
FATAL_ERROR
"Cannot find 7z executable. searched names
${
ZIP_EXE_NAMES
}
. Please add it to your path"
)
set
(
ZIP_EXE_NAMES 7z 7za
)
endif
()
find_program
(
ZIP_EXECUTABLE NAMES
${
ZIP_EXE_NAMES
}
)
endif
()
if
(
NOT ZIP_EXECUTABLE
)
message
(
FATAL_ERROR
"Cannot find 7z executable. searched names
${
ZIP_EXE_NAMES
}
. Please add it to your path"
)
if
(
OTB_MINGW
)
endif
()
set
(
required_vars
endif
()
OTB_BINARY_DIR
OTB_INSTALL_DIR
if
(
OTB_MINGW
)
MXE_TARGET_DIR
set
(
required_vars
)
OTB_BINARY_DIR
else
()
OTB_INSTALL_DIR
set
(
required_vars
MXE_TARGET_DIR
SUPERBUILD_BINARY_DIR
)
SUPERBUILD_INSTALL_DIR
else
()
SUPERBUILD_SOURCE_DIR
set
(
required_vars
)
SUPERBUILD_BINARY_DIR
endif
()
SUPERBUILD_INSTALL_DIR
SUPERBUILD_SOURCE_DIR
foreach
(
req
)
${
required_vars
}
endif
()
PACKAGE_OTB_SRC_DIR
OTB_TARGET_SYSTEM_ARCH
foreach
(
req
OTB_TARGET_SYSTEM_ARCH_IS_X64
${
required_vars
}
)
PACKAGE_OTB_SRC_DIR
if
(
NOT DEFINED
${
req
}
OR
"
${${
req
}}
"
STREQUAL
""
)
OTB_TARGET_SYSTEM_ARCH
message
(
FATAL_ERROR
"you must set
${
req
}
"
)
OTB_TARGET_SYSTEM_ARCH_IS_X64
endif
()
)
set
(
vars
"
${
vars
}
${
req
}
=[
${${
req
}}
]
\n
"
)
if
(
NOT DEFINED
${
req
}
OR
"
${${
req
}}
"
STREQUAL
""
)
endforeach
(
req
)
message
(
FATAL_ERROR
"you must set
${
req
}
"
)
endif
()
message
(
"
\n
${
vars
}
\n
"
)
set
(
vars
"
${
vars
}
${
req
}
=[
${${
req
}}
]
\n
"
)
endforeach
(
req
)
set
(
PKG_DEBUG OFF
)
message
(
"
\n
${
vars
}
\n
"
)
set
(
EXTRA_CACHE_CONFIG
)
set
(
PKG_DEBUG OFF
)
set
(
CMAKE_INSTALL_PREFIX
"
${
SUPERBUILD_INSTALL_DIR
}
"
)
set
(
EXTRA_CACHE_CONFIG
)
set
(
PACKAGE_LONG_NAME OrfeoToolBox
)
set
(
CMAKE_INSTALL_PREFIX
"
${
SUPERBUILD_INSTALL_DIR
}
"
)
# Make up part of output package file
set
(
PACKAGE_NAME OTB
)
set
(
PACKAGE_LONG_NAME OrfeoToolBox
)
if
(
APPLE
)
set
(
PACKAGE_PLATFORM_NAME
"Darwin"
)
# Make up part of output package file
elseif
(
WIN32
)
set
(
PACKAGE_NAME OTB
)
set
(
PACKAGE_PLATFORM_NAME
"win"
)
if
(
APPLE
)
elseif
(
LINUX
)
set
(
PACKAGE_PLATFORM_NAME
"Darwin"
)
set
(
PACKAGE_PLATFORM_NAME
"Linux"
)
elseif
(
WIN32
)
endif
()
set
(
PACKAGE_PLATFORM_NAME
"win"
)
elseif
(
LINUX
)
set
(
PACKAGE_ARCH
"32"
)
set
(
PACKAGE_PLATFORM_NAME
"Linux"
)
if
(
OTB_TARGET_SYSTEM_ARCH_IS_X64
)
endif
()
set
(
PACKAGE_ARCH
"64"
)
endif
()
set
(
PACKAGE_ARCH
"32"
)
if
(
OTB_TARGET_SYSTEM_ARCH_IS_X64
)
if
(
OTB_MINGW
)
set
(
PACKAGE_ARCH
"64"
)
get_filename_component
(
MXE_MXEROOT
${
MXE_TARGET_DIR
}
PATH
)
endif
()
get_filename_component
(
MXE_MXEROOT
${
MXE_MXEROOT
}
PATH
)
set
(
EXTRA_CACHE_CONFIG
if
(
OTB_MINGW
)
"set(CMAKE_CROSSCOMPILING TRUE)
get_filename_component
(
MXE_MXEROOT
${
MXE_TARGET_DIR
}
PATH
)
set(WIN32 TRUE)
get_filename_component
(
MXE_MXEROOT
${
MXE_MXEROOT
}
PATH
)
set(MINGW TRUE)
set
(
EXTRA_CACHE_CONFIG
set(MXE_MXEROOT
\"
${
MXE_MXEROOT
}
\"
)"
"set(CMAKE_CROSSCOMPILING TRUE)
)
set(WIN32 TRUE)
set
(
CMAKE_INSTALL_PREFIX
"
${
OTB_INSTALL_DIR
}
"
)
set(MINGW TRUE)
endif
()
set(MXE_MXEROOT
\"
${
MXE_MXEROOT
}
\"
)"
)
# get itk version from External_itk.cmake if not on mingw
set
(
CMAKE_INSTALL_PREFIX
"
${
OTB_INSTALL_DIR
}
"
)
# because mxe has different version
endif
()
if
(
NOT OTB_MINGW
)
get_version
(
# get itk version from External_itk.cmake if not on mingw
INPUT_FILE
"
${
SUPERBUILD_SOURCE_DIR
}
/CMake/External_itk.cmake"
# because mxe has different version
MATCH_STRINGS
"SB_ITK_VERSION_MAJOR"
"SB_ITK_VERSION_MINOR"
if
(
NOT OTB_MINGW
)
PREFIX PKG
get_version
(
)
INPUT_FILE
"
${
SUPERBUILD_SOURCE_DIR
}
/CMake/External_itk.cmake"
endif
()
MATCH_STRINGS
"SB_ITK_VERSION_MAJOR"
"SB_ITK_VERSION_MINOR"
PREFIX PKG
set
(
PKG_ITK_SB_VERSION
"
${
PKG_SB_ITK_VERSION_MAJOR
}
.
${
PKG_SB_ITK_VERSION_MINOR
}
"
)
)
endif
()
#get version of OTB from source_dir/CMakeLists.txt
get_version
(
set
(
PKG_ITK_SB_VERSION
"
${
PKG_SB_ITK_VERSION_MAJOR
}
.
${
PKG_SB_ITK_VERSION_MINOR
}
"
)
INPUT_FILE
"
${
PACKAGE_OTB_SRC_DIR
}
/CMakeLists.txt"
MATCH_STRINGS
"OTB_VERSION_MAJOR"
"OTB_VERSION_MINOR"
"OTB_VERSION_PATCH"
#get version of OTB from source_dir/CMakeLists.txt
PREFIX PKG
get_version
(
)
INPUT_FILE
"
${
PACKAGE_OTB_SRC_DIR
}
/CMakeLists.txt"
MATCH_STRINGS
"OTB_VERSION_MAJOR"
"OTB_VERSION_MINOR"
"OTB_VERSION_PATCH"
set
(
PKG_OTB_VERSION_STRING
PREFIX PKG
${
PKG_OTB_VERSION_MAJOR
}
.
${
PKG_OTB_VERSION_MINOR
}
.
${
PKG_OTB_VERSION_PATCH
}
)
)
if
(
OTB_MINGW
)
set
(
PKG_OTB_VERSION_STRING
set
(
OTB_BINARY_DIR
"
${
OTB_BINARY_DIR
}
"
)
${
PKG_OTB_VERSION_MAJOR
}
.
${
PKG_OTB_VERSION_MINOR
}
.
${
PKG_OTB_VERSION_PATCH
}
)
set
(
OTB_INSTALL_DIR
"
${
OTB_INSTALL_DIR
}
"
)
set
(
DEPENDENCIES_INSTALL_DIR
"
${
MXE_MXEROOT
}
/usr/
${
OTB_TARGET_SYSTEM_ARCH
}
-w64-mingw32.shared"
)
if
(
OTB_MINGW
)
set
(
QT_PLUGINS_DIR
"
${
DEPENDENCIES_INSTALL_DIR
}
/qt/plugins"
)
set
(
OTB_BINARY_DIR
"
${
OTB_BINARY_DIR
}
"
)
set
(
QT_TRANSLATIONS_DIR
"
${
DEPENDENCIES_INSTALL_DIR
}
/qt/translations"
)
set
(
OTB_INSTALL_DIR
"
${
OTB_INSTALL_DIR
}
"
)
else
()
#unixes
set
(
DEPENDENCIES_INSTALL_DIR
"
${
MXE_MXEROOT
}
/usr/
${
OTB_TARGET_SYSTEM_ARCH
}
-w64-mingw32.shared"
)
set
(
OTB_BINARY_DIR
"
${
SUPERBUILD_BINARY_DIR
}
/OTB/build"
)
set
(
QT_PLUGINS_DIR
"
${
DEPENDENCIES_INSTALL_DIR
}
/qt/plugins"
)
set
(
OTB_INSTALL_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
"
)
set
(
QT_TRANSLATIONS_DIR
"
${
DEPENDENCIES_INSTALL_DIR
}
/qt/translations"
)
set
(
DEPENDENCIES_INSTALL_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
"
)
else
()
#unixes
set
(
QT_PLUGINS_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
/plugins"
)
set
(
OTB_BINARY_DIR
"
${
SUPERBUILD_BINARY_DIR
}
/OTB/build"
)
set
(
QT_TRANSLATIONS_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
/translations"
)
set
(
OTB_INSTALL_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
"
)
endif
()
set
(
DEPENDENCIES_INSTALL_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
"
)
set
(
QT_PLUGINS_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
/plugins"
)
macro_setup_cmake_project
(
OTB
)
set
(
QT_TRANSLATIONS_DIR
"
${
SUPERBUILD_INSTALL_DIR
}
/translations"
)
if
(
GENERATE_XDK
)
endif
()
macro_setup_cmake_project
(
XDK
)
endif
()
macro_setup_cmake_project
(
OTB
)
if
(
GENERATE_XDK
)
macro_setup_cmake_project
(
XDK
)
endif
()
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