Commit 4bf90069 authored by Rashad Kanavath's avatar Rashad Kanavath

JIRA: 1049. python bindings is .so in osx and linux

parent 19f1561c
......@@ -13,6 +13,7 @@ function(repository_status root_repo_dir result_var1)
execute_process(COMMAND ${GIT_EXECUTABLE} config --get remote.origin.url
WORKING_DIRECTORY ${root_repo_dir}
OUTPUT_VARIABLE git_remote_origin_url
TIMEOUT 120
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
if(git_remote_origin_url)
get_filename_component(dir_name ${git_remote_origin_url} NAME)
......@@ -23,6 +24,7 @@ function(repository_status root_repo_dir result_var1)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H --oneline
WORKING_DIRECTORY ${root_repo_dir}
OUTPUT_VARIABLE last_commit_id
TIMEOUT 120
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
#git symbolic-ref --short -q HEAD does not work on older git version
......@@ -31,6 +33,7 @@ function(repository_status root_repo_dir result_var1)
execute_process(COMMAND ${GIT_EXECUTABLE} symbolic-ref -q HEAD
WORKING_DIRECTORY ${root_repo_dir}
OUTPUT_VARIABLE git_symbolic_ref_output
TIMEOUT 120
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
set(branch_name)
......@@ -47,10 +50,12 @@ function(repository_status root_repo_dir result_var1)
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H
WORKING_DIRECTORY ${root_repo_dir}
OUTPUT_VARIABLE OTB_WC_REVISION
TIMEOUT 120
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
execute_process(COMMAND ${GIT_EXECUTABLE} status -s
WORKING_DIRECTORY ${root_repo_dir}
OUTPUT_VARIABLE OTB_WC_STATUS
TIMEOUT 120
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
message(STATUS "Repository status (${dir_name}) :")
message(STATUS " Repository revision is ${OTB_WC_REVISION}")
......
......@@ -2,14 +2,31 @@ INCLUDE_ONCE_MACRO(JPEG)
SETUP_SUPERBUILD(JPEG)
#CMake build is offically unsupported by JPEG turbo developers.
if(WIN32)
set(JPEG_PATCH_COMMAND ${CMAKE_COMMAND}
-E copy
${CMAKE_SOURCE_DIR}/patches/JPEG/jconfigint.h.in
${JPEG_SB_SRC}/win/)
set(JPEG_CONFIGURE_COMMAND
${SB_CMAKE_COMMAND}
-DENABLE_SHARED=TRUE
-DENABLE_STATIC=FALSE
-DWITH_SIMD=FALSE
-DWITH_TURBOJPEG=FALSE
-DWITH_ARITH_DEC=TRUE
-DWITH_JAVA=FALSE
${SB_CMAKE_CACHE_ARGS}
${JPEG_SB_SRC}
)
else()
set(JPEG_PATCH_COMMAND)
set(JPEG_CONFIGURE_COMMAND "${SB_ENV_CONFIGURE_CMD};LDFLAGS='-Wl,--rpath -Wl,${SB_INSTALL_PREFIX}/lib';${JPEG_SB_SRC}/configure"
--prefix=${SB_INSTALL_PREFIX}
--enable-shared=yes
--enable-static=false
--without-simd
--without-turbojpeg
--with-arith-dec
--without-java
)
endif()
ExternalProject_Add(JPEG
......@@ -20,16 +37,8 @@ ExternalProject_Add(JPEG
BINARY_DIR ${JPEG_SB_BUILD_DIR}
INSTALL_DIR ${SB_INSTALL_PREFIX}
DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
CMAKE_CACHE_ARGS ${SB_CMAKE_CACHE_ARGS}
CMAKE_COMMAND ${SB_CMAKE_COMMAND}
-DENABLE_SHARED=TRUE
-DENABLE_STATIC=FALSE
-DWITH_SIMD=FALSE
-DWITH_TURBOJPEG=FALSE
-DWITH_ARITH_DEC=TRUE
-DWITH_JAVA=FALSE
${JPEG_SB_SRC}
PATCH_COMMAND ${JPEG_PATCH_COMMAND}
CONFIGURE_COMMAND ${JPEG_CONFIGURE_COMMAND}
BUILD_COMMAND
)
SUPERBUILD_PATCH_SOURCE(JPEG)
......
......@@ -80,7 +80,7 @@ EOF
$CAT > $OUT_DIR/otbenv.profile << EOF
#!/bin/sh
PATH=\$PATH:$OUT_DIR/bin
PYTHONPATH=\$PYTHONPATH:$OUT_DIR/lib/python
PYTHONPATH=$OUT_DIR/lib/python:\$PYTHONPATH
GDAL_DATA=$OUT_DIR/share/gdal
GEOTIFF_CSV=$OUT_DIR/share/espg_csv
......@@ -91,6 +91,8 @@ export GEOTIFF_CSV
export PYTHONPATH
EOF
$CHMOD +x $OUT_DIR/otbenv.profile
fi
#echo "Creating symbolic links..."
......
......@@ -12,7 +12,6 @@ CHMOD=`which chmod`
SED=`which sed`
CP=`which cp`
MKDIR=`which mkdir`
WHICH_ENV=`which env`
# find install_name_tool
INSTALL_NAME_TOOL=`which install_name_tool`
......@@ -59,14 +58,14 @@ else
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>STARTUP_FILE</string>
<key>CFBundleIconFile</key>
<string>Monteverdi.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleExecutable</key>
<string>STARTUP_FILE</string>
<key>CFBundleIconFile</key>
<string>Monteverdi.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleLongVersionString</key>
<string>LONG_VERSION</string>
<key>CFBundleShortVersionString</key>
......@@ -76,7 +75,7 @@ else
EOF
$CAT > $OUT_DIR/Mapla.app/Contents/MacOS/Mapla << EOF
#!$WHICH_ENV bash
#!/bin/sh
export LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal
......@@ -87,7 +86,7 @@ EOF
$CHMOD +x $OUT_DIR/Mapla.app/Contents/MacOS/Mapla
$CAT > $OUT_DIR/Monteverdi.app/Contents/MacOS/Monteverdi << EOF
#!$WHICH_ENV bash
#!/bin/sh
export LC_NUMERIC=C
export OTB_APPLICATION_PATH=$OUT_DIR/lib/otb/applications
export GDAL_DATA=$OUT_DIR/share/gdal
......@@ -109,6 +108,22 @@ EOF
$SED -i "" "s,LONG_VERSION,$LONG_VERSION_STRING,g" Monteverdi.app/Contents/Info.plist
$SED -i "" "s,SHORT_VERSION,$SHORT_VERSION_STRING,g" Monteverdi.app/Contents/Info.plist
$CAT > $OUT_DIR/otbenv.profile << EOF
#!/bin/sh
PATH=\$PATH:$OUT_DIR/bin
PYTHONPATH=$OUT_DIR/lib/python:\$PYTHONPATH
GDAL_DATA=$OUT_DIR/share/gdal
GEOTIFF_CSV=$OUT_DIR/share/espg_csv
export LC_NUMERIC=C
export PATH
export GDAL_DATA
export GEOTIFF_CSV
export PYTHONPATH
EOF
$CHMOD +x $OUT_DIR/otbenv.profile
fi
......
......@@ -554,10 +554,12 @@ function(func_prepare_package)
set(EXE_EXT "")
set(SCR_EXT ".sh")
set(LIB_EXT ".so")
set(PYMODULE_EXT ".so")
if(WIN32)
set(EXE_EXT ".exe")
set(LIB_EXT ".dll")
set(SCR_EXT ".bat")
set(PYMODULE_EXT ".pyd")
set(DEST_LIB_DIR bin)
elseif(APPLE)
set(LIB_EXT ".dylib")
......@@ -620,9 +622,8 @@ function(func_prepare_package)
endforeach()
list(APPEND PKG_PEFILES ${OTB_APPS_LIST})
if(EXISTS "${OTB_INSTALL_DIR}/lib/otb/python/_otbApplication${LIB_EXT}")
list(APPEND PKG_PEFILES "${OTB_INSTALL_DIR}/lib/otb/python/_otbApplication${LIB_EXT}")
if(EXISTS "${OTB_INSTALL_DIR}/lib/otb/python/_otbApplication${PYMODULE_EXT}")
list(APPEND PKG_PEFILES "${OTB_INSTALL_DIR}/lib/otb/python/_otbApplication${PYMODULE_EXT}")
install(DIRECTORY ${OTB_INSTALL_DIR}/lib/otb/python DESTINATION ${PKG_STAGE_DIR}/lib)
endif()
......@@ -1038,6 +1039,7 @@ set(APPLE_SYSTEM_DLLS
Carbon.framework
AppKit.framework
Foundation.framework
Python.framework
AGL.framework
OpenGL.framework
libgcc_s.*dylib
......
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