Commit bbb16b46 authored by Rashad Kanavath's avatar Rashad Kanavath

PKG: update to installer_files (testing stuff in tools/)

parent 5784ed4e
......@@ -143,7 +143,6 @@ include(update_symlinks_script)
# below functions include many install commands which are installing
# files under PKG_STAGE_DIR
include(install_python_bindings)
include(install_include_dirs)
include(install_share_dirs)
......@@ -152,7 +151,7 @@ include(install_cmake_files)
include(install_mvd_files)
include(install_qtdev_files)
include(install_vstudio_files)
include(add_uninstall_script)
include(add_uninstall_otb_script)
include(installer_files)
include(create_package)
......
#!/bin/sh
# Setup test environment
DIRNAME_0=$(dirname "$0")
DIRNAME=$(readlink "$DIRNAME_0/..")
cd "$DIRNAME" || exit
CUR_DIR="$( cd "$( dirname "$0" )/../" && pwd )"
echo "CUR_DIR=$CUR_DIR"
cd "$CUR_DIR" || exit
# define convenient functions
# ps_children( parentPID ) : get PIDs of children processes
......@@ -23,7 +23,7 @@ echo_and_report () {
}
# -------------------------------------------------------------------------
. ./otbenv.profile
. "$CUR_DIR/otbenv.profile"
rm -f selftest_report.log
touch selftest_report.log
......
function(add_uninstall_script)
function(add_uninstall_otb_script)
file(READ "${OTB_BINARY_DIR}/install_manifest.txt" mfile_lines)
string(
REPLACE
......@@ -48,6 +48,6 @@ function(add_uninstall_script)
Files/uninstall_otb${SCRIPT_EXT}
${CMAKE_BINARY_DIR}/install_manifest_otb.txt
${CMAKE_BINARY_DIR}/cmake_uninstall_otb.cmake
DESTINATION ${PKG_STAGE_DIR})
DESTINATION ${PKG_STAGE_DIR}/tools)
endfunction()
macro(create_package)
install(CODE "
message(STATUS \"Creating ${PACKAGE_OUTPUT_FILE}\")
if(WIN32)
......
#thi macro calls add_uninstall_otb_script macro(another file)
macro(installer_files)
#configure README from rst docs
set(RSTDOC_DIR "${PACKAGE_OTB_SRC_DIR}/Documentation/Cookbook/rst")
if(APPLE)
set(README_FILE ${RSTDOC_DIR}/Installation_Macx.txt)
......@@ -10,6 +13,7 @@ macro(installer_files)
configure_file("${README_FILE}" ${CMAKE_BINARY_DIR}/README )
install(FILES ${CMAKE_BINARY_DIR}/README DESTINATION ${PKG_STAGE_DIR} )
#configure pkgsetup for mac and linux
if(LINUX)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Files/linux_pkgsetup.in
......@@ -25,6 +29,7 @@ macro(installer_files)
)
endif()
#start installing script and other stuff related to package
if(UNIX)
install( PROGRAMS
${CMAKE_BINARY_DIR}/pkgsetup
......@@ -35,8 +40,32 @@ macro(installer_files)
)
endif()
# We also need wrapper script to start mapla & monteverdi
#if(NOT HAVE_MVD)
# message(FATAL_ERROR "not have mvd")
#endif()
if(HAVE_MVD)
install(PROGRAMS
Files/mapla${SCRIPT_EXT}
Files/monteverdi${SCRIPT_EXT}
DESTINATION ${PKG_STAGE_DIR}
)
#for mac osx, we have a template.app which is
# later processed in pkgsetup (macx_pkgsetup.in)
if(APPLE)
install(DIRECTORY Files/template.app
DESTINATION "${PKG_STAGE_DIR}")
endif()
endif() #HAVE_MVD
#my_file_ext is required for otbcli and otbgui files which has
# no extension on linux. (hence we cannot use SCRIPT_EXT
#For windows otbenv.bash and otbenv.bat is required.
# Former is for windows shell users and latter is for other
# linux emulator such as bash for windows or mobxterm
set(my_file_ext "")
#For GNU/Linux & Mac OSX, we write them in the *pkgsetup.in
if(WIN32)
set(my_file_ext ".bat")
install( PROGRAMS
......@@ -46,40 +75,33 @@ macro(installer_files)
)
endif()
# We also need wrapper script to start mapla & monteverdi
if(NOT HAVE_MVD)
message(FATAL_ERROR "not have mvd")
endif()
if(HAVE_MVD)
install(PROGRAMS
Files/mapla${SCRIPT_EXT}
Files/monteverdi${SCRIPT_EXT}
DESTINATION "${PKG_STAGE_DIR}"
)
endif()
if(APPLE)
install(DIRECTORY Files/template.app
DESTINATION "${PKG_STAGE_DIR}")
endif()
#these scripts are not auto-installed in PKG_STAGE_DIR
#could this be move them to somewhere else?
install(PROGRAMS
Files/selftester${SCRIPT_EXT}
"${SUPERBUILD_INSTALL_DIR}/bin/otbcli${my_file_ext}"
"${SUPERBUILD_INSTALL_DIR}/bin/otbgui${my_file_ext}"
DESTINATION ${PKG_STAGE_DIR}/bin)
install(PROGRAMS
Files/selftester${SCRIPT_EXT}
DESTINATION ${PKG_STAGE_DIR}/tools)
# only required for linux.
# THIS WILL BE REMOVED ONCE INSTALLATION IS DONE
# USE --noexec option when running .run file to keep this file
# along with other installation files
if(LINUX)
install(PROGRAMS
"${PATCHELF_PROGRAM}"
DESTINATION ${PKG_STAGE_DIR})
endif()
add_uninstall_script()
#add otb_uninstall script
add_uninstall_otb_script()
#add otb_loader
add_executable(otb_loader ${CMAKE_CURRENT_SOURCE_DIR}/Files/otb_loader.cxx)
target_link_libraries(otb_loader ${CMAKE_DL_LIBS})
install(TARGETS otb_loader DESTINATION ${PKG_STAGE_DIR}/bin)
install(TARGETS otb_loader DESTINATION ${PKG_STAGE_DIR}/tools)
add_dependencies(otb_loader PATCHELF)
endmacro()
......@@ -23,7 +23,7 @@ add_test(Tu_install_package
)
add_test(Tu_selftester
COMMAND ${pkg_extracted_dir}/bin/selftester${my_ext}
COMMAND ${pkg_extracted_dir}/tools/selftester${my_ext}
WORKING_DIRECTORY ${pkg_extracted_dir}
)
......
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