Commit f1dfb6a1 authored by Rashad Kanavath's avatar Rashad Kanavath

portable binaries fix patchelf path

parent 4d345a03
......@@ -13,9 +13,6 @@ execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/
#set(${proj}_DEPENDENCIES OTB)
#INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
#message(FATAL_ERROR "PACKAGE_SB_BUILD_DIR=${PACKAGE_SB_BUILD_DIR}")
ExternalProject_Add(${proj}
PREFIX ${proj}
SOURCE_DIR ${PACKAGE-OTB_SB_SRC_DIR}
......@@ -28,9 +25,5 @@ ExternalProject_Add(${proj}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
DEPENDS OTB)
# ExternalProject_Add_Step(${proj} set_rpath
# COMMAND ${PATCHELF_PROGRAM} "--set-rpath" "../lib" ""
# DEPENDEES install)
endif()
......@@ -2,7 +2,7 @@ macro(superbuild_package)
cmake_parse_arguments(PACKAGE "" "OUTDIR;INSTALLDIR" "SEARCHDIRS;PEFILES" ${ARGN} )
find_program(OBJDUMP_PROGRAM "objdump")
set(PATCHELF_PROGRAM "/home/mrashad/build/patchelf-0.8/src/patchelf")
set(PATCHELF_PROGRAM "/home/mrashad/Tools/patchelf-0.8/src/patchelf")
list(APPEND PACKAGE_SEARCHDIRS "${PACKAGE_INSTALLDIR}/bin") #exe
list(APPEND PACKAGE_SEARCHDIRS "${PACKAGE_INSTALLDIR}/lib") #so
......@@ -25,8 +25,7 @@ macro(superbuild_package)
list(LENGTH notfound_dlls nos)
if(${nos} GREATER 0)
STRING(REPLACE ".so;" ".so," notfound ${notfound_dlls})
message(FATAL_ERROR "Following dlls were not found: ${notfound_dlls}
Please consider adding their paths to SEARCHDIRS when calling superbuild_package macro.")
message(FATAL_ERROR "Following dlls were not found: ${notfound_dlls}. Please consider adding their paths to SEARCHDIRS when calling superbuild_package macro.")
endif()
endmacro(superbuild_package)
......@@ -80,10 +79,10 @@ function(process_deps infile)
# DESTINATION ${PACKAGE_OUTDIR}/lib)
add_custom_target(RPATH_${bn}
INSTALL
POST_BUILD
COMMAND ${PATCHELF_PROGRAM} "--set-rpath" "../lib" "${PACKAGE_OUTDIR}/lib/${infile}")
# add_custom_target(RPATH_${bn}
# INSTALL
# POST_BUILD
# COMMAND ${PATCHELF_PROGRAM} "--set-rpath" "../lib" "${PACKAGE_INSTALLDIR}/${PACKAGE_OUTDIR}/bin/${infile}")
#else() #we assume it is executable
# install(FILES "${SEARCHDIR}/${infile}"
......@@ -91,8 +90,9 @@ function(process_deps infile)
file(GLOB sofiles "${SEARCHDIR}/${bn}*")
foreach(sofile ${sofiles})
install(FILES "${sofile}"
DESTINATION ${PACKAGE_OUTDIR}/bin)
install(TARGETS "${sofile}"
DESTINATION ${PACKAGE_OUTDIR}/bin
PERMISSIONS )
endforeach()
#endif()
......
......@@ -160,22 +160,22 @@ include(External_otb)
#check compiler is gnu?
if(UNIX AND NOT APPLE)
include(External_package)
set(ARCHIVE_NAME OTB-5.0.0-Linux64)
file(GLOB PEFILES
${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLaunch*
${CMAKE_INSTALL_PREFIX}/bin/otbTestDriver )
file(WRITE "${CMAKE_BINARY_DIR}/PACKAGE-OTB/src/PACKAGE-OTB/CMakeLists.txt"
"cmake_minimum_required(VERSION 2.6)
include(CMakeParseArguments)
set(CMAKE_INSTALL_PREFIX \"${SB_INSTALL_PREFIX}\")
include(${CMAKE_SOURCE_DIR}/CMake/Package_Macro.cmake)
superbuild_package(
OUTDIR \"${ARCHIVE_NAME}\"
INSTALLDIR \"${SB_INSTALL_PREFIX}\"
PEFILES \"${PEFILES}\"
SEARCHDIRS \"\")")
# include(External_package)
# set(ARCHIVE_NAME OTB-5.0.0-Linux64)
# file(GLOB PEFILES
# ${CMAKE_INSTALL_PREFIX}/bin/otbApplicationLaunch*
# ${CMAKE_INSTALL_PREFIX}/bin/otbTestDriver )
# file(WRITE "${CMAKE_BINARY_DIR}/PACKAGE-OTB/src/PACKAGE-OTB/CMakeLists.txt"
# "cmake_minimum_required(VERSION 2.6)
# include(CMakeParseArguments)
# set(CMAKE_INSTALL_PREFIX \"${SB_INSTALL_PREFIX}\")
# include(${CMAKE_SOURCE_DIR}/CMake/Package_Macro.cmake)
# superbuild_package(
# OUTDIR \"${ARCHIVE_NAME}\"
# INSTALLDIR \"${SB_INSTALL_PREFIX}\"
# PEFILES \"${PEFILES}\"
# SEARCHDIRS \"\")")
endif(UNIX AND NOT APPLE)
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