Commit ca706897 authored by Rashad Kanavath's avatar Rashad Kanavath

Merge remote-tracking branch 'origin/update_pkg' into develop

parents 90838c9d 1d2cf3d4
......@@ -28,54 +28,33 @@
#
# Try to find GLEW library and include path.
# Once done this will define
#rewritten for OTB by Rashad Kanavath
#
# GLEW_FOUND
# GLEW_INCLUDE_PATH
# GLEW_LIBRARY
#
IF (WIN32)
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
$ENV{PROGRAMFILES}/GLEW/include
${GLEW_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")
find_path(
GLEW_INCLUDE_DIR GL/glew.h
DOC "The directory where GL/glew.h resides"
)
FIND_LIBRARY( GLEW_LIBRARY
NAMES glew GLEW glew32 glew32s
PATHS
$ENV{PROGRAMFILES}/GLEW/lib
${GLEW_ROOT_DIR}/lib
${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
DOC "The GLEW library")
ELSE (WIN32)
FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
/usr/include
/usr/local/include
/sw/include
/opt/local/include
${GLEW_ROOT_DIR}/include
DOC "The directory where GL/glew.h resides")
if(WIN32)
set(GLEW_LIB_NAMES glew GLEW glew32 glew32s)
else()
set(GLEW_LIB_NAMES libGLEW GLEW)
endif()
# Prefer the static library.
FIND_LIBRARY( GLEW_LIBRARY
NAMES libGLEW.so GLEW
PATHS
/usr/lib64
/usr/lib
/usr/local/lib64
/usr/local/lib
/sw/lib
/opt/local/lib
${GLEW_ROOT_DIR}/lib
DOC "The GLEW library")
ENDIF (WIN32)
FIND_LIBRARY( GLEW_LIBRARY
NAMES ${GLEW_LIB_NAMES}
DOC "The GLEW library")
SET(GLEW_FOUND "NO")
IF (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
SET(GLEW_LIBRARIES ${GLEW_LIBRARY})
SET(GLEW_FOUND "YES")
ENDIF ()
set(GLEW_FOUND FALSE)
if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
set(GLEW_LIBRARIES ${GLEW_LIBRARY})
set(GLEW_FOUND TRUE)
endif()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLEW
......
......@@ -80,4 +80,4 @@ ENDIF()
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLFW
REQUIRED_VARS GLFW_LIBRARY GLFW_INCLUDE_DIR
VERSION_VAR GLFW_VERSION_STRING)
\ No newline at end of file
VERSION_VAR GLFW_VERSION_STRING)
......@@ -31,55 +31,35 @@ if( LIBKML_INCLUDE_DIR )
set( LibKML_FIND_QUIETLY TRUE )
endif()
find_path( LIBKML_INCLUDE_DIR kml/dom.h )
find_path( LIBKML_INCLUDE_DIR kml/dom.h )
find_library( LIBKML_BASE_LIBRARY NAMES kmlbase )
find_library( LIBKML_DOM_LIBRARY NAMES kmldom )
find_library( LIBKML_ENGINE_LIBRARY NAMES kmlengine )
find_library( LIBKML_BASE_LIBRARY
NAMES kmlbase )
# TODO : add HINTS derived from path of LIBKML_BASE_LIBRARY
find_library( LIBKML_CONVENIENCE_LIBRARY
NAMES kmlconvenience )
find_library( LIBKML_DOM_LIBRARY
NAMES kmldom )
find_library( LIBKML_ENGINE_LIBRARY
NAMES kmlengine )
find_library( LIBKML_REGIONATOR_LIBRARY
NAMES kmlregionator )
find_library( LIBKML_XSD_LIBRARY
NAMES kmlxsd )
find_library( LIBKML_MINIZIP_LIBRARY
NAMES minizip )
mark_as_advanced( LIBKML_INCLUDE_DIR
LIBKML_BASE_LIBRARY
LIBKML_CONVENIENCE_LIBRARY
LIBKML_DOM_LIBRARY
LIBKML_ENGINE_LIBRARY
LIBKML_REGIONATOR_LIBRARY
LIBKML_XSD_LIBRARY
LIBKML_MINIZIP_LIBRARY )
mark_as_advanced(
LIBKML_INCLUDE_DIR
LIBKML_BASE_LIBRARY
LIBKML_DOM_LIBRARY
LIBKML_ENGINE_LIBRARY
)
# handle the QUIETLY and REQUIRED arguments and set LIBKML_FOUND to TRUE if
# all listed variables are TRUE
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( LibKML DEFAULT_MSG
LIBKML_BASE_LIBRARY
LIBKML_CONVENIENCE_LIBRARY
LIBKML_DOM_LIBRARY
LIBKML_ENGINE_LIBRARY
LIBKML_REGIONATOR_LIBRARY
LIBKML_XSD_LIBRARY
LIBKML_MINIZIP_LIBRARY
LIBKML_INCLUDE_DIR
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
LibKML
DEFAULT_MSG
LIBKML_INCLUDE_DIR
LIBKML_BASE_LIBRARY
LIBKML_DOM_LIBRARY
LIBKML_ENGINE_LIBRARY
)
if(LIBKML_FOUND)
set(LIBKML_INCLUDE_DIRS ${LIBKML_INCLUDE_DIR})
set(LIBKML_LIBRARIES ${LIBKML_BASE_LIBRARY}
${LIBKML_CONVENIENCE_LIBRARY}
${LIBKML_DOM_LIBRARY}
${LIBKML_ENGINE_LIBRARY}
${LIBKML_REGIONATOR_LIBRARY}
${LIBKML_XSD_LIBRARY}
${LIBKML_MINIZIP_LIBRARY})
set(LIBKML_LIBRARIES
${LIBKML_BASE_LIBRARY}
${LIBKML_DOM_LIBRARY}
${LIBKML_ENGINE_LIBRARY}
)
endif()
......@@ -14,7 +14,7 @@
# LIBSVM_MINOR_VERSION - minor version
# LIBSVM_PATCH_VERSION - patch version
# LIBSVM_VERSION_STRING - version (ex. 2.9.0)
# LIBSVM_ROOT_DIR - root dir (ex. /usr/local)
# LIBSVM_ROOT_DIR - libsvm install directory
#=============================================================================
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
......
......@@ -58,23 +58,9 @@
# standard install paths.
# Explicit -DVAR=value arguments should still be able to override everything.
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
# enough environment variables?
$ENV{OPENTHREADS_INCLUDE_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_INCLUDE_DIR}
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
PATHS
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt
/usr/freeware
PATH_SUFFIXES include
find_path(
OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
PATH_SUFFIXES include
)
mark_as_advanced(OPENTHREADS_INCLUDE_DIR)
......@@ -95,41 +81,12 @@ endif()
find_library(OPENTHREADS_LIBRARY
NAMES OpenThreads OpenThreadsWin32
HINTS
$ENV{OPENTHREADS_LIBRARY_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_LIBRARY_DIR}
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(OPENTHREADS_LIBRARY)
find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
$ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
$ENV{OPENTHREADS_LIBRARY_DIR}
$ENV{OPENTHREADS_DIR}
$ENV{OSG_LIBRARY_DIR}
$ENV{OSG_DIR}
$ENV{OSGDIR}
$ENV{OpenThreads_ROOT}
$ENV{OSG_ROOT}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
PATH_SUFFIXES lib64 lib
)
mark_as_advanced(OPENTHREADS_LIBRARY_DEBUG)
......
......@@ -31,7 +31,7 @@
# QWT_MINOR_VERSION - minor version
# QWT_PATCH_VERSION - patch version
# QWT_VERSION_STRING - version (ex. 5.2.1)
# QWT_ROOT_DIR - root dir (ex. /usr/local)
# QWT_ROOT_DIR - root dir
#=============================================================================
# Copyright 2010-2013, Julien Schueller
......
......@@ -55,12 +55,9 @@ find_library( SHARK_LIBRARY
mark_as_advanced( SHARK_INCLUDE_DIR SHARK_LIBRARY )
find_package( Boost 1.48.0 REQUIRED QUIET COMPONENTS
system date_time filesystem
program_options serialization thread
unit_test_framework
)
find_package( Boost 1.48.0 REQUIRED QUIET
COMPONENTS serialization
)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Please make sure Boost 1.48.0 is installed on your system")
endif()
......@@ -107,33 +104,11 @@ string(REGEX MATCH
"#define.SHARK_USE_OPENMP"
SHARK_USE_OPENMP_matched "${SHARK_H_CONTENTS}")
#this variable is added in cache but not used now
# you can use it to see if shark installation has openMP
# later if needed in other places..
set(SHARK_USE_OPENMP FALSE CACHE BOOL "shark is built with OpenMP")
if(SHARK_USE_OPENMP_matched)
set(SHARK_USE_OPENMP TRUE CACHE BOOL "shark is built with OpenMP" FORCE)
endif()
#This is quick fix/hack/commit that will get back all failing tests on
# The good fix must to fix all those failing tests. They are crashing
# due to openmp issues which only popup with this fix
if(NOT WIN32)
if(SHARK_USE_OPENMP)
message(STATUS "Shark is built with OpenMP: SHARK_USE_OPENMP = TRUE")
find_package(OpenMP REQUIRED QUIET)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else()
message(FATAL_ERROR "Your shark libraries are compiled with it OpenMP")
set(SHARK_FOUND FALSE)
if(NOT OTB_USE_OPENMP)
message(WARNING "Shark library is built with OpenMP and you have OTB_USE_OPENMP set to OFF.")
endif()
else()
message(STATUS "Shark is built without OpenMP: SHARK_USE_OPENMP = FALSE")
endif()
endif(NOT WIN32)
INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Shark
......
function(check_sse_features sse_flags )
include(CheckCXXSourceRuns)
include(CheckCXXCompilerFlag)
set(${sse_flags} "0" PARENT_SCOPE)
# For apple assume sse2 is on for all intel builds, check for 64 and 32 bit versions
if(APPLE)
message(STATUS "For apple assume sse2 is on for all intel builds")
return()
endif()
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
set(CMAKE_REQUIRED_FLAGS "-msse2")
check_cxx_source_runs("
#include <emmintrin.h>
int main()
{
__m128d a, b;
double vals[2] = {0};
a = _mm_loadu_pd(vals);
b = _mm_add_pd(a,a);
_mm_storeu_pd(vals,b);
return 0;
}" HAVE_SSE2_FLAGS)
if(HAVE_SSE2_FLAGS)
set(${sse_flags} "-msse2 -mfpmath=sse" PARENT_SCOPE)
return()
endif()
set(CMAKE_REQUIRED_FLAGS "-msse")
check_cxx_source_runs("
#include <xmmintrin.h>
int main()
{
__m128 a, b;
float vals[4] = {0};
a = _mm_loadu_ps(vals);
b = a;
b = _mm_add_ps(a,b);
_mm_storeu_ps(vals,b);
return 0;
}" HAVE_SSE_FLAGS)
if(HAVE_SSE_FLAGS)
set(${sse_flags} "-msse -mfpmath=sse" PARENT_SCOPE)
return()
endif()
elseif(MSVC)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
return()
endif()
check_cxx_source_runs("
#include <emmintrin.h>
int main()
{
__m128d a, b;
double vals[2] = {0};
a = _mm_loadu_pd(vals);
b = _mm_add_pd(a,a);
_mm_storeu_pd(vals,b);
return 0;
}" HAVE_SSE_FLAGS)
if(HAVE_SSE_FLAGS)
message(STATUS "Performing Test HAVE_SSE_FLAGS - Success")
set(${sse_flags} "/arch:SSE2 /fp:fast -D__SSE__ -D__SSE2__" PARENT_SCOPE)
return()
else()
message(STATUS "Performing Test HAVE_SSE_FLAGS - Failed")
return()
endif()
endif()
endfunction() #check_sse_features
......@@ -26,6 +26,11 @@
# to load OTB's settings for an external project.
@OTB_CONFIG_CODE@
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#RK: TODO: add sse2, see4, see4.1, openmp flags
# The C and C++ flags added by OTB to the cmake-configured flags.
set(OTB_REQUIRED_C_FLAGS "@OTB_REQUIRED_C_FLAGS@")
set(OTB_REQUIRED_CXX_FLAGS "@OTB_REQUIRED_CXX_FLAGS@")
......@@ -39,12 +44,24 @@ set(OTB_VERSION_PATCH "@OTB_VERSION_PATCH@")
# OTB's CMake directory with modules OTB uses.
set(OTB_CMAKE_DIR "@OTB_CONFIG_CMAKE_DIR@")
# OTB uses OPENMP
set(OTB_USE_OPENMP "@OTB_USE_OPENMP@")
# OTB uses SSE optim
set(OTB_USE_SSE_FLAGS "@OTB_USE_SSE_FLAGS@")
# use Find*.cmake files included in OTB package for external dependencies. (OpenCV, GDAL etc..)
set(CMAKE_MODULE_PATH ${OTB_CMAKE_DIR} ${CMAKE_MODULE_PATH})
# The location of the UseOTB.cmake file.
set(OTB_USE_FILE "@OTB_USE_FILE@")
# Whether OTB was built with shared libraries.
set(OTB_BUILD_SHARED "@BUILD_SHARED_LIBS@")
# Default value for WINDOWS_EXPORT_ALL_SYMBOLS target property
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS "@OTB_CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS@")
# List of available OTB modules.
set(OTB_MODULES_ENABLED "@OTB_CONFIG_MODULES_ENABLED@")
......
......@@ -235,35 +235,11 @@ macro(check_compiler_platform_flags)
("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.8" AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.9") ))
set(OTB_REQUIRED_CXX_FLAGS "${OTB_REQUIRED_CXX_FLAGS} -Wno-array-bounds")
endif()
endif()
if(APPLE)
option(OTB_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
mark_as_advanced(OTB_USE_64BITS_APPLE_TRUNCATION_WARNING)
execute_process(COMMAND "${CMAKE_C_COMPILER}" --version
OUTPUT_VARIABLE _version ERROR_VARIABLE _version)
# -fopenmp breaks compiling the HDF5 library in shared library mode
# on the OS X platform -- at least with gcc 4.2 from Xcode.
set(compile_flag_lists CMAKE_C_FLAGS CMAKE_CXX_FLAGS
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO)
foreach(listname ${compile_flag_lists})
if("${${listname}}" MATCHES ".*-fopenmp.*")
string(REPLACE "-fopenmp" "" tmpFlags "${${listname}}")
set(${listname} "${tmpFlags}")
message("-fopenmp causes incorrect compliation of HDF, removing from ${listname}")
endif()
endforeach()
endif()
# gcc must have -msse2 option to enable sse2 support
if(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING)
set(OTB_REQUIRED_CXX_FLAGS "${OTB_REQUIRED_CXX_FLAGS} -msse2")
endif()
if(APPLE)
option(OTB_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
mark_as_advanced(OTB_USE_64BITS_APPLE_TRUNCATION_WARNING)
endif()
#-----------------------------------------------------------------------------
......@@ -296,6 +272,36 @@ macro(check_compiler_platform_flags)
set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} -mthreads")
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} -Wl,--no-undefined")
endif()
# check for OpenMP
if(OTB_USE_OPENMP)
message(STATUS "OpenMP support requested with OTB_USE_OPENMP=${OTB_USE_OPENMP}")
find_package(OpenMP QUIET)
endif()
if(OPENMP_FOUND)
message(STATUS "Adding '${OpenMP_CXX_FLAGS}' to OTB_REQUIRED_CXX_FLAGS ")
set(OTB_REQUIRED_CXX_FLAGS "${OTB_REQUIRED_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
if(OpenMP_EXE_LINKER_FLAGS)
set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
endif()
set(OTB_SSE_FLAGS)
if(OTB_USE_SSE_FLAGS)
message(STATUS "SIMD extensions requested with OTB_USE_SSE_FLAGS=${OTB_USE_SSE_FLAGS}")
include(OTBCheckSSEFeatures)
check_sse_features(OTB_SSE_FLAGS)
if(OTB_SSE_FLAGS)
message(STATUS "Adding '${OTB_SSE_FLAGS}' to OTB_REQUIRED_CXX_FLAGS")
set(OTB_REQUIRED_CXX_FLAGS "${OTB_REQUIRED_CXX_FLAGS} ${OTB_SSE_FLAGS}")
endif()
endif()
#-----------------------------------------------------------------------------
# The frename-registers option does not work due to a bug in the gnu compiler.
......@@ -303,6 +309,7 @@ macro(check_compiler_platform_flags)
# will be produced. This is first documented in the gcc4 man page.
if(CMAKE_COMPILER_IS_GNUCXX)
set(ALL_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} ${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
#TODO: list(REMOVE_DUPLICATES ALL_FLAGS)
separate_arguments(ALL_FLAGS)
foreach(COMP_OPTION ${ALL_FLAGS})
if("${COMP_OPTION}" STREQUAL "-frename-registers")
......
......@@ -21,8 +21,8 @@ if exist %CURRENT_SCRIPT_DIR%..\@OTB_INSTALL_APP_DIR_NATIVE@ (
)
::set GDAL_DATA, EPSG_CSV and update PATH
if exist %CURRENT_SCRIPT_DIR%\..\otbenv.cmd (
call %CURRENT_SCRIPT_DIR%\..\otbenv.cmd
if exist %CURRENT_SCRIPT_DIR%\..\otbenv.bat (
call %CURRENT_SCRIPT_DIR%\..\otbenv.bat
)
set LC_NUMERIC=C
......
......@@ -16,15 +16,6 @@ else
OTB_CLI_LAUNCHER=otbApplicationLauncherCommandLine
fi
# works for install tree
if [ -d "$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@" ]
then
OTB_APPLICATION_PATH=$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@:$OTB_APPLICATION_PATH
fi
# export it to make it available to otbApplicationLauncherCommandLine environment
export OTB_APPLICATION_PATH
# avoid numerical issues caused by locale
export LC_NUMERIC=C
......@@ -32,6 +23,13 @@ export LC_NUMERIC=C
# Note that OTB_APPLICATION_PATH is reset here.
if [ -f "$CURRENT_SCRIPT_DIR/../otbenv.profile" ]; then
. "$CURRENT_SCRIPT_DIR/../otbenv.profile"
else
# works for install tree
if [ -d "$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@" ]; then
OTB_APPLICATION_PATH=$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@:$OTB_APPLICATION_PATH
fi
# export it to make it available to otbApplicationLauncherCommandLine environment
export OTB_APPLICATION_PATH
fi
# start the application
......
......@@ -22,6 +22,11 @@ if exist %CURRENT_SCRIPT_DIR%../@OTB_INSTALL_APP_DIR@ (
set LC_NUMERIC=C
::set GDAL_DATA, EPSG_CSV and update PATH
if exist %CURRENT_SCRIPT_DIR%\..\otbenv.bat (
call %CURRENT_SCRIPT_DIR%\..\otbenv.bat
)
:: start the application
%OTB_GUI_LAUNCHER% %*
endlocal
......@@ -16,21 +16,19 @@ else
OTB_GUI_LAUNCHER=otbApplicationLauncherQt
fi
# use the default install tree path for applications
if [ -d "$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@" ]
then
OTB_APPLICATION_PATH=$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@:$OTB_APPLICATION_PATH
fi
# export it to make it available to otbApplicationLauncherCommandLine environment
export OTB_APPLICATION_PATH
# avoid numerical issues caused by locale
export LC_NUMERIC=C
# Export GDAL_DATA, EPSG_CSV
if [ -f "$CURRENT_SCRIPT_DIR/../otbenv.profile" ]; then
. "$CURRENT_SCRIPT_DIR/../otbenv.profile"
else
# use the default install tree path for applications
if [ -d "$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@" ]; then
OTB_APPLICATION_PATH=$CURRENT_SCRIPT_DIR/../@OTB_INSTALL_APP_DIR@:$OTB_APPLICATION_PATH
fi
# export it to make it available to otbApplicationLauncherCommandLine environment
export OTB_APPLICATION_PATH
fi
# start the application
......
......@@ -213,6 +213,8 @@ endif()
option(OTB_USE_DEPRECATED "Turn on the use and test of deprecated classes" OFF)
mark_as_advanced(OTB_USE_DEPRECATED)
option(OTB_USE_OPENMP "Add openmp compiler and linker flags" OFF)
option(OTB_USE_SSE_FLAGS "Enable SIMD optimizations (hardware dependant)." ON)
#-----------------------------------------------------------------------------
# SHOW_ALL_MSG_DEBUG option
option(OTB_SHOW_ALL_MSG_DEBUG "Show all debug messages (very verbose)" OFF)
......@@ -504,6 +506,8 @@ foreach(otb_option
OTB_WRAP_PYTHON
OTB_WRAP_JAVA
OTB_DATA_ROOT
OTB_USE_OPENMP
OTB_USE_SSE_FLAGS
)
get_white_spaces("${otb_option}" spaces)
message("${otb_option} ${spaces} = ${${otb_option}}")
......
......@@ -31,3 +31,7 @@
#cmakedefine OTB_SHOW_ALL_MSG_DEBUG
#cmakedefine OTB_USE_GDAL_20
#cmakedefine OTB_USE_OPENMP
#cmakedefine OTB_USE_SSE_FLAGS
......@@ -32,6 +32,38 @@ set(OTBTestKernelTests
add_executable(otbTestKernelTestDriver ${OTBTestKernelTests})
target_link_libraries(otbTestKernelTestDriver ${OTBTestKernel-Test_LIBRARIES})
# So the story here is that -Wl,-no-needed is a default linker flag on only on Ubuntu
# (debian or archlinux does not use this). This will exclude a lot of libraries from linking into
# executable.
# #ITK_LIBRARIES in a superbuild now contains the following libraries.
# "itkdouble-conversion itksys itkvcl itknetlib itkv3p_netlib itkvnl itkvnl_algo
# ITKVNLInstantiation ITKCommon itkNetlibSlatec ITKStatistics ITKTransform ITKLabelMap
# ITKMesh ITKMetaIO ITKSpatialObjects ITKPath ITKQuadEdgeMesh ITKIOImageBase ITKOptimizers
# ITKPolynomials ITKBiasCorrection ITKFFT ITKKLMRegionGrowing ITKOptimizersv4 ITKWatersheds"
# OTBITK module will find all of these components in Modules/ThirdParty/ITK/otb-module-init.cmake
# But due to default -Wl,-as-needed flag many of them are ignored.
# see the documentation of GNU ld -as-needed for details on this behaviour.
# Our problem is that we need these ignored ones in the some header-only modules.
# Eg: Modules/Core/LabelMap
# This module depends on ITKLabelMap but does not link with it as it doesn't create any module (lib, exe)
# All it use is a couple of headers from ITKLabelMap. So removing that dependency is out of question.
# At this point, possible solution are follows:
# 1. use -Wl,-as-no-needed to CMAKE_LINKER FLAGS and be done with it. (all executable contains many used libs)
# 2. glob all libITK*, libitk* in the package script. (ugly and I don't agree)
# 3. make a dummy executable and link that with all of OTB libs and use -Wl,-no-as-needed in that
# 4. pick one of the random test executable and only add -Wl,-no-as-needed to it. (still a hack)
# ..
# ...
# RK: I finally decided to go with 4th option.
# Take an existing test executable otbTestKernelTestDriver and force -Wl,-no-as-needed.
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set_target_properties(otbTestKernelTestDriver PROPERTIES LINK_FLAGS "-Wl,-no-as-needed")
endif()
otb_module_target_label(otbTestKernelTestDriver)
otb_add_test(NAME tsTvCompareAscii2 COMMAND otbTestKernelTestDriver
--compare-ascii ${NOTOL}
......
......@@ -27,7 +27,5 @@ set(OTBOpenCV_LIBRARIES "${OPENCV_LIBRARIES}")
set(OTBOpenCV_INCLUDE_DIRS
${OTBOpenCV_BINARY_DIR}/src
)
set(OTBOpenCV_EXPORT_CODE_BUILD "find_package(OpenCV REQUIRED)")
set(OTBOpenCV_EXPORT_CODE_INSTALL ${OTBOpenCV_EXPORT_CODE_BUILD})
otb_module_impl()
......@@ -23,5 +23,12 @@ set(OTBOpenGL_THIRD_PARTY 1)
set(OTBOpenGL_SYSTEM_INCLUDE_DIRS ${OPENGL_INCLUDE_DIR})
set(OTBOpenGL_LIBRARIES ${OPENGL_LIBRARIES})
set(OTBOpenGL_EXPORT_CODE_INSTALL "
set(OTBOpenGL_LIBRARIES)
set(OTBOpenGL_INCLUDE_DIRS)
find_package(OpenGL REQUIRED)
set(OTBOpenGL_LIBRARIES \${OPENGL_LIBRARIES})
set(OTBOpenGL_SYSTEM_INCLUDE_DIRS \${OPENGL_INCLUDE_DIR})
")
otb_module_impl()
......@@ -18,7 +18,7 @@
# limitations under the License.
#
find_package( Qt4 REQUIRED QtCore QtGui QtOpenGL QtXml )
find_package( Qt4 REQUIRED QtCore QtGui QtOpenGL) # QtXml )
mark_as_advanced( QT_QMAKE_EXECUTABLE )
set( QT_USE_QTXML 1 )
#set( QT_USE_QTXML 1 )
include( ${QT_USE_FILE} )
......@@ -53,8 +53,6 @@ if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
set(OTB_DISABLE_FAST_FUNCTIONS_VALUE 1)
endif()
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g")
add_definitions(" -Wall -fPIC ")
# check for x86-64 system
check_cxx_source_runs("
......@@ -70,120 +68,30 @@ if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
return 0;
}"
IS_X86_64)
if( IS_X86_64 )
add_definitions("-D__x86_64__")
endif()
else()
set(IS_X86_64 0)
endif()
if(OTB_DISABLE_FAST_FUNCTIONS_VALUE)
add_definitions(-DOTB_DISABLE_FAST_FUNCTIONS)
endif()
include(CheckIncludeFile)
include(CheckLibraryExists)
include(CheckCXXSourceRuns)