Disabled tests by default.

Disabled tests by default.

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -1,2 +1,2 @@
 option(INT_TREE_DRAW_EXAMPLES "Draws some examples in a subdirectory. run make_drawable.sh before this" OFF)
-option(INT_TREE_ENABLE_TESTS "Enable tests?" ON)+option(INT_TREE_ENABLE_TESTS "Enable tests?" OFF)


r10076/sofa : FIX: on Windows, use the default path : "${SOFA_TOOLS_DIR}/qt4win" if the QTDIR environment variable is not set and if the folder qt4win exists

Former-commit-id: d1790c092253ab1d588a1d6ac85b358075a0e938

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -15,11 +15,10 @@
 set(SOFA-EXTERNAL_EIGEN_PATH "${SOFA_EXTLIBS_DIR}/eigen-3.2.0" CACHE PATH "Path to the eigen header-only library")

 ## qt
-set(QTDIR $ENV{QTDIR})
+set(QTDIR "$ENV{QTDIR}")
 if(WIN32 AND QTDIR STREQUAL "")
-	set(QTDIR "./tools/qt4win")
-endif()
-
+	set(QTDIR "${SOFA_TOOLS_DIR}/qt4win")
+endif()
 if(NOT QTDIR STREQUAL "")
 	if(WIN32)
 		file(TO_CMAKE_PATH "${QTDIR}" QTDIR) # GLOB will fail with pathes containing backslashes.


Tweaks for MACOSX_RPATH

Tweaks for MACOSX_RPATH

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -16,13 +16,12 @@

 INCLUDE(GNUInstallDirs)

-SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
-
 IF (OSPRAY_ZIP_MODE)
   # in tgz / zip let's have relative RPath
   SET(CMAKE_SKIP_INSTALL_RPATH OFF)
   IF (APPLE)
-    SET(CMAKE_INSTALL_RPATH "@executable_path/:@executable_path/../lib")
+    SET(CMAKE_MACOSX_RPATH ON)
+    SET(CMAKE_INSTALL_RPATH "@executable_path/" "@executable_path/../lib")
   ELSE()
     SET(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/../lib")
     # on per target basis:
@@ -30,6 +29,7 @@
     #SET_TARGET_PROPERTIES(libs INSTALL_RPATH "$ORIGIN")
   ENDIF()
 ELSE()
+  SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
   IF (APPLE)
     # use RPath on OSX
     SET(CMAKE_SKIP_INSTALL_RPATH OFF)


Fix static build for dialog plugin

Fix static build for dialog plugin

--- cmake/plugins.cmake
+++ cmake/plugins.cmake
@@ -40,7 +40,8 @@
 # AUTHENTICATION
 REGISTER_PLUGIN("AUTH_NATIVE" "${CC_SOURCE_DIR}/plugins/auth/my_auth.c" "native_password_client_plugin" "STATIC" "" 0)
 REGISTER_PLUGIN("AUTH_OLDPASSWORD" "${CC_SOURCE_DIR}/plugins/auth/old_password.c" "old_password_client_plugin" "STATIC" "" 1)
-REGISTER_PLUGIN("AUTH_DIALOG" "${CC_SOURCE_DIR}/plugins/auth/dialog.c" "auth_dialog_plugin" "DYNAMIC" dialog 1)
+SET(DIALOG_SOURCES ${CC_SOURCE_DIR}/plugins/auth/dialog.c ${CC_SOURCE_DIR}/libmariadb/get_password.c)
+REGISTER_PLUGIN("AUTH_DIALOG" "${DIALOG_SOURCES}" "auth_dialog_plugin" "DYNAMIC" dialog 1)
 REGISTER_PLUGIN("AUTH_CLEARTEXT" "${CC_SOURCE_DIR}/plugins/auth/mariadb_clear_text.c" "auth_cleartext_plugin" "DYNAMIC" "mysql_clear_password" 1)
 IF(WIN32)
     SET(GSSAPI_SOURCES ${CC_SOURCE_DIR}/plugins/auth/auth_gssapi_client.c ${CC_SOURCE_DIR}/plugins/auth/sspi_client.c ${CC_SOURCE_DIR}/plugins/auth/sspi_errmsg.c)


0.3.1

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -1 +1 @@
-set(HUNTER_VERSION "0.3.0")
+set(HUNTER_VERSION "0.3.1")


Reduced target name length in version.cmake

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -10,9 +10,16 @@

   set(GIT_COMMIT_STATE_FILE "${OUTPUT_FILE}.state")

-  string(MAKE_C_IDENTIFIER "${OUTPUT_FILE}" TARGET_NAME)
+  set(TARGET_NAME "${OUTPUT_FILE}")
+
+  if("${OUTPUT_FILE}" MATCHES "${CMAKE_BINARY_DIR}*")
+    string(LENGTH "${CMAKE_BINARY_DIR}" PREFIX_LENGTH)
+    string(SUBSTRING "${OUTPUT_FILE}" ${PREFIX_LENGTH} -1 TARGET_NAME)
+  endif()
+
+  string(MAKE_C_IDENTIFIER "${TARGET_NAME}" TARGET_NAME)
   add_custom_target(
-    "check_git_version_${TARGET_NAME}" ALL
+    "${TARGET_NAME}" ALL
     DEPENDS ${INPUT_FILE}
     BYPRODUCTS ${OUTPUT_FILE} ${GIT_COMMIT_STATE_FILE}
     COMMENT "Checking Orbit's version by calling git describe"


Added coveralls.io support.

Added coveralls.io support.

--- cmake-modules/CodeCoverage.cmake
+++ cmake-modules/CodeCoverage.cmake
@@ -107,13 +107,17 @@

 		# Cleanup lcov
 		${LCOV_PATH} --directory . --zerocounters
-
+
 		# Run tests
 		COMMAND ${_testrunner} ${ARGV3}
-
+
 		# Capturing lcov counters and generating report
 		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'test/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+
+		# Upload to coveralls.io
+		COMMAND cpp-coveralls -b ${CMAKE_CURRENT_BINARY_DIR} -i ${CMAKE_SOURCE_DIR}/dbabstract/mysql  -i ${CMAKE_SOURCE_DIR}/dbabstract/sqlite3 -i ${CMAKE_SOURCE_DIR}/dbabstract/pq -y .coveralls.yml
+
 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
 		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned


Clean-up after gcov.

Clean-up after gcov.

--- cmake-modules/CodeCoverage.cmake
+++ cmake-modules/CodeCoverage.cmake
@@ -117,6 +117,7 @@

 		# Upload to coveralls.io
 		COMMAND cpp-coveralls -b ${CMAKE_CURRENT_BINARY_DIR} -i ${CMAKE_SOURCE_DIR}/dbabstract/mysql  -i ${CMAKE_SOURCE_DIR}/dbabstract/sqlite3 -i ${CMAKE_SOURCE_DIR}/dbabstract/pq -y .coveralls.yml
+		COMMAND find . -name '*.gcov' -exec rm {} +

 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
 		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned


Shortened library lists for MSP

Shortened library lists for MSP

--- cmake/CMakeModules/FindMSP.cmake
+++ cmake/CMakeModules/FindMSP.cmake
@@ -25,134 +25,140 @@
 find_library(MSP_LIBRARY00 NAMES pthread )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY00})

-find_library(MSP_LIBRARY01 NAMES CSM_PCAPI PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY01})
+find_library(MSP_LIBRARY24 NAMES MSPSensorModelService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY24})
+
+find_library(MSP_LIBRARY28 NAMES MSPSourceSelectionService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY28})
+
+find_library(MSP_LIBRARY34 NAMES MSPSupportDataService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY34})
+
+find_library(MSP_LIBRARY09 NAMES MSPCoordinateConversionService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY09})
+
+find_library(MSP_LIBRARY11 NAMES MSPCovarianceService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY11})
+
+find_library(MSP_LIBRARY03 NAMES MSPasdetre PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY03})
+
+find_library(MSP_LIBRARY07 NAMES MSPcoordconverter PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY07})
+
+find_library(MSP_LIBRARY13 NAMES MSPcsisd PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY13})
+
+find_library(MSP_LIBRARY15 NAMES MSPcsm PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY15})
+
+find_library(MSP_LIBRARY17 NAMES MSPcsmutil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY17})
+
+find_library(MSP_LIBRARY23 NAMES MSPdtcc PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY23})
+
+find_library(MSP_LIBRARY31 NAMES MSPlas PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY31})
+
+find_library(MSP_LIBRARY25 NAMES MSPgeometry PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY25})
+
+find_library(MSP_LIBRARY33 NAMES MSPmath PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY33})

 find_library(MSP_LIBRARY02 NAMES MSPnitf PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY02})

-find_library(MSP_LIBRARY03 NAMES MSPasdetre PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY03})
-
 find_library(MSP_LIBRARY04 NAMES MSPntmtre PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY04})

-find_library(MSP_LIBRARY05 NAMES MSPCCSUtils PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY05})
-
-find_library(MSP_LIBRARY06 NAMES MSPOutputMethodService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY06})
-
-find_library(MSP_LIBRARY07 NAMES MSPcoordconverter PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY07})
-
-find_library(MSP_LIBRARY08 NAMES MSPPointExtractionService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY08})
-
-find_library(MSP_LIBRARY09 NAMES MSPCoordinateConversionService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY09})
+find_library(MSP_LIBRARY12 NAMES MSPrage PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY12})

 find_library(MSP_LIBRARY10 NAMES MSPRageServiceUtils PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY10})

-find_library(MSP_LIBRARY11 NAMES MSPCovarianceService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY11})
-
-find_library(MSP_LIBRARY12 NAMES MSPrage PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY12})
-
-find_library(MSP_LIBRARY13 NAMES MSPcsisd PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY13})
-
 find_library(MSP_LIBRARY14 NAMES MSPrageutilities PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY14})
-
-find_library(MSP_LIBRARY15 NAMES MSPcsm PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY15})
-
-find_library(MSP_LIBRARY16 NAMES MSPrsme PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY16})
-
-find_library(MSP_LIBRARY17 NAMES MSPcsmutil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY17})
-
-find_library(MSP_LIBRARY18 NAMES MSPRsmGeneratorService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY18})
-
-find_library(MSP_LIBRARY19 NAMES MSPdei PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY19})
-
-find_library(MSP_LIBRARY20 NAMES MSPrsmg PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY20})
-
-find_library(MSP_LIBRARY21 NAMES MSPDEIUtil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY21})
-
-find_library(MSP_LIBRARY22 NAMES MSPrutil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY22})
-
-find_library(MSP_LIBRARY23 NAMES MSPdtcc PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY23})
-
-find_library(MSP_LIBRARY24 NAMES MSPSensorModelService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY24})
-
-find_library(MSP_LIBRARY25 NAMES MSPgeometry PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY25})
-
-find_library(MSP_LIBRARY26 NAMES MSPSensorSpecificService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY26})
-
-find_library(MSP_LIBRARY27 NAMES MSPImagingGeometryService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY27})
-
-find_library(MSP_LIBRARY28 NAMES MSPSourceSelectionService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY28})
-
-find_library(MSP_LIBRARY29 NAMES MSPjson PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY29})

 find_library(MSP_LIBRARY30 NAMES MSPSScovmodel PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY30})

-find_library(MSP_LIBRARY31 NAMES MSPlas PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY31})
-
 find_library(MSP_LIBRARY32 NAMES MSPSSrutil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY32})
-
-find_library(MSP_LIBRARY33 NAMES MSPmath PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY33})
-
-find_library(MSP_LIBRARY34 NAMES MSPSupportDataService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY34})
-
-find_library(MSP_LIBRARY35 NAMES MSPmens PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY35})
-
-find_library(MSP_LIBRARY36 NAMES MSPTerrainService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY36})
-
-find_library(MSP_LIBRARY37 NAMES MSPMensurationService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY37})

 find_library(MSP_LIBRARY38 NAMES MSPutilities PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
 set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY38})

-find_library(MSP_LIBRARY39 NAMES MSPMensurationSessionRecordService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY39})
-
-find_library(MSP_LIBRARY40 NAMES MSPwriteRsmNitf PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY40})
-
-find_library(MSP_LIBRARY41 NAMES MSPMSPVersionUtils PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY41})
-
-find_library(MSP_LIBRARY42 NAMES MSPmtdCommon PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY42})
+find_library(MSP_LIBRARY01 NAMES CSM_PCAPI PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY01})

-set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARIES})
+
+
+#find_library(MSP_LIBRARY05 NAMES MSPCCSUtils PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY05})
+#
+#find_library(MSP_LIBRARY06 NAMES MSPOutputMethodService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY06})
+#
+#find_library(MSP_LIBRARY08 NAMES MSPPointExtractionService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY08})
+#
+#find_library(MSP_LIBRARY11 NAMES MSPCovarianceService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY11})
+#
+#find_library(MSP_LIBRARY16 NAMES MSPrsme PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY16})
+#
+#find_library(MSP_LIBRARY18 NAMES MSPRsmGeneratorService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY18})
+#
+#find_library(MSP_LIBRARY19 NAMES MSPdei PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY19})
+#
+#find_library(MSP_LIBRARY20 NAMES MSPrsmg PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY20})
+#
+#find_library(MSP_LIBRARY21 NAMES MSPDEIUtil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY21})
+#
+#find_library(MSP_LIBRARY22 NAMES MSPrutil PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY22})
+#
+#find_library(MSP_LIBRARY26 NAMES MSPSensorSpecificService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY26})
+#
+#find_library(MSP_LIBRARY27 NAMES MSPImagingGeometryService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY27})
+#
+#find_library(MSP_LIBRARY29 NAMES MSPjson PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY29})
+#
+#find_library(MSP_LIBRARY35 NAMES MSPmens PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY35})
+#
+#find_library(MSP_LIBRARY36 NAMES MSPTerrainService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY36})
+#
+#find_library(MSP_LIBRARY37 NAMES MSPMensurationService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY37})
+#
+#find_library(MSP_LIBRARY39 NAMES MSPMensurationSessionRecordService PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY39})
+#
+#find_library(MSP_LIBRARY40 NAMES MSPwriteRsmNitf PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY40})
+#
+#find_library(MSP_LIBRARY41 NAMES MSPMSPVersionUtils PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY41})
+#
+#find_library(MSP_LIBRARY42 NAMES MSPmtdCommon PATHS $ENV{MSP_HOME}/lib ${OSSIM_DEPENDENCIES}/lib ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX} )
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARY42})
+
+
+#set (MSP_LIBRARIES ${MSP_LIBRARIES} ${MSP_LIBRARIES})

 #---
 # This function sets MSP_FOUND if variables are valid.


Added missing lock free event queue and LIFO CMake options.

These are used correctly in libprocess, but the options
weren't added, and so didn't show up in the CMake cache.

Review: https://reviews.apache.org/r/63529/

--- cmake/CompilationConfigure.cmake
+++ cmake/CompilationConfigure.cmake
@@ -87,6 +87,16 @@
   "Build libprocess with lock free run queue."
   FALSE)

+option(
+  ENABLE_LOCK_FREE_EVENT_QUEUE
+  "Build libprocess with lock free event queue."
+  FALSE)
+
+option(
+  ENABLE_LAST_IN_FIRST_OUT_FIXED_SIZE_SEMAPHORE
+  "Build libprocess with LIFO fixed size semaphore."
+  FALSE)
+
 option(ENABLE_JAVA
   "Build Java components. Warning: this is SLOW."
   FALSE)


range-v3 port: Updated the CMake configuration to force compilation as C++14 when compiling with Clang/C2.

The Microsoft standard library headers used by default with Clang/C2
require some C++14 features.

--- cmake/modules/FindRange-v3.cmake
+++ cmake/modules/FindRange-v3.cmake
@@ -28,8 +28,18 @@
 unset(RANGE_V3_INCLUDE_DIRS CACHE)

 if(RANGE_V3_INCLUDE_DIRS)
+  if(("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xClang") AND
+     ("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"))
+    # Clang/C2 requires -std=c++14 to parse some of the Microsoft provided
+    # standard library headers.
+    set(RANGE_V3_PROPERTIES
+        CXX_STANDARD 14)
+  else()
+    set(RANGE_V3_PROPERTIES
+        CXX_STANDARD 11)
+  endif()
   set(RANGE_V3_PROPERTIES
-      CXX_STANDARD 11
+      ${RANGE_V3_PROPERTIES}
       CXX_STANDARD_REQUIRED ON
       CXX_EXTENSIONS OFF)
   set_property(GLOBAL PROPERTY RANGE_V3_PROPERTIES ${RANGE_V3_PROPERTIES})


Update FindWiringpi.cmake

Update FindWiringpi.cmake

--- cmake/modules/FindWiringpi.cmake
+++ cmake/modules/FindWiringpi.cmake
@@ -14,7 +14,7 @@
    PATH_SUFFIXES
    )

-FIND_LIBRARY(WIRINGPI_LIBRARIES NAMES wiringPi
+FIND_LIBRARY(WIRINGPI_LIBRARY NAMES wiringPi
    PATHS
    /usr
    /usr/local
@@ -25,12 +25,12 @@
 set(WIRINGPI_INCLUDE_DIRS
   ${WIRINGPI_INCLUDE_DIR}
   )
-if (WIRINGPI_LIBRARIES)
+if (WIRINGPI_LIBRARY)
   set(WIRINGPI_LIBRARIES
     ${WIRINGPI_LIBRARIES}
     ${WIRINGPI_LIBRARY}
     )
-endif (WIRINGPI_LIBRARIES)
+endif (WIRINGPI_LIBRARY)

 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(wiringPi DEFAULT_MSG WIRINGPI_LIBRARIES WIRINGPI_INCLUDE_DIR)


fix static linking of blas/lapack with openblas

--- modules/math_libs.cmake
+++ modules/math_libs.cmake
@@ -496,7 +496,7 @@

 # further adaptation for the static linking
 if (ENABLE_STATIC_LINKING)
-    if (LAPACK_TYPE MATCHES ATLAS OR LAPACK_TYPE MATCHES SYSTEM_NATIVE OR BLAS_TYPE MATCHES ATLAS OR BLAS_TYPE MATCHES SYSTEM_NATIVE)
+    if (LAPACK_TYPE MATCHES ATLAS OR LAPACK_TYPE MATCHES SYSTEM_NATIVE OR LAPACK_TYPE MATCHES OPENBLAS OR BLAS_TYPE MATCHES ATLAS OR BLAS_TYPE MATCHES SYSTEM_NATIVE OR BLAS_TYPE MATCHES OPENBLAS)
         set(MATH_LIBS ${MATH_LIBS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive)
     endif()
     if (LAPACK_TYPE MATCHES MKL OR BLAS_TYPE MATCHES MKL)
@@ -505,5 +505,3 @@
         set(MATH_LIBS ${MATH_LIBS} -ldl -lc)
     endif()
 endif()
-
-


strip trailing wsp

strip trailing wsp

--- Modules/PackageConfiguration/process-package-properties.cmake
+++ Modules/PackageConfiguration/process-package-properties.cmake
@@ -16,10 +16,10 @@

   FOREACH(TARGET_PROPERTY ${TARGET_PROPERTIES})
     STRING(REGEX MATCH "^.+[ ]" PROPERTY_KEY "${TARGET_PROPERTY}")
-    STRING(REGEX REPLACE "[ ]" "" PROPERTY_KEY ${PROPERTY_KEY})
+    STRING(STRIP ${PROPERTY_KEY} PROPERTY_KEY)
     TART_TMP("TARGET_PROPERTY: ${PROPERTY_KEY}")
     STRING(REGEX MATCH "[ ].+$" PROPERTY_VALUE "${TARGET_PROPERTY}")
-    STRING(REGEX REPLACE "[ ]" "" PROPERTY_VALUE ${PROPERTY_VALUE})
+    STRING(STRIP ${PROPERTY_VALUE} PROPERTY_VALUE)
     TART_TMP("TARGET_PROPERTY value: ${PROPERTY_VALUE}")
     SET_TARGET_PROPERTIES(${PACKAGE_TARGET} PROPERTIES "${PROPERTY_KEY}" "${PROPERTY_VALUE}")
   ENDFOREACH()
@@ -35,8 +35,10 @@
     GET_ENTRY_VALUES(${CUSTOM_CONFIG} "${ENTRIES}" "${ENTRY_INDENTS}" SPECIFIC_CONFIG_PROPERTIES HAS_SUBTREE)
     FOREACH(SPECIFIC_CONFIG_PROPERTY ${SPECIFIC_CONFIG_PROPERTIES})
       STRING(REGEX MATCH "^.+[ ]" PROPERTY_KEY "${SPECIFIC_CONFIG_PROPERTY}")
+      STRING(STRIP ${PROPERTY_KEY} PROPERTY_KEY)
       TART_DEBUG("   ${CUSTOM_CONFIG} property: ${PROPERTY_KEY}")
       STRING(REGEX MATCH "[ ].+$" PROPERTY_VALUE "${SPECIFIC_CONFIG_PROPERTY}")
+      STRING(STRIP ${PROPERTY_VALUE} PROPERTY_VALUE)
       TART_DEBUG("   ${CUSTOM_CONFIG} value: ${PROPERTY_VALUE}")
       SET_TARGET_PROPERTIES(${PACKAGE_TARGET} PROPERTIES "${PROPERTY_KEY}" "${PROPERTY_VALUE}")
     ENDFOREACH()
@@ -58,8 +60,10 @@
     GET_ENTRY_VALUES(${TARGET_OS} "${ENTRIES}" "${ENTRY_INDENTS}" TARGET_OS_PROPERTIES HAS_SUBTREE)
     FOREACH(TARGET_OS_PROPERTY ${TARGET_OS_PROPERTIES})
       STRING(REGEX MATCH "^.+[ ]*" PROPERTY_KEY "${TARGET_OS_PROPERTY}")
+      STRING(STRIP ${PROPERTY_KEY} PROPERTY_KEY)
       TART_DEBUG("   ${TARGET_OS} property: ${PROPERTY_KEY}")
       STRING(REGEX MATCH "[ ].+$" PROPERTY_VALUE "${TARGET_OS_PROPERTY}")
+      STRING(STRIP ${PROPERTY_VALUE} PROPERTY_VALUE)
       IF(${PROPERTY_VALUE})
         TART_DEBUG("   ${TARGET_OS} value: ${PROPERTY_VALUE}")
         SET_TARGET_PROPERTIES(${PACKAGE_TARGET} PROPERTIES "${PROPERTY_KEY}" "${PROPERTY_VALUE}")
@@ -83,8 +87,10 @@
     GET_ENTRY_VALUES(${TARGET_ARCH} "${ENTRIES}" "${ENTRY_INDENTS}" TARGET_ARCH_PROPERTIES HAS_SUBTREE)
     FOREACH(TARGET_ARCH_PROPERTY ${TARGET_ARCH_PROPERTIES})
       STRING(REGEX MATCH "^.+[ ]*" PROPERTY_KEY "${TARGET_ARCH_PROPERTY}")
+      STRING(STRIP ${PROPERTY_KEY} PROPERTY_KEY)
       TART_DEBUG("   ${TARGET_ARCH} property: ${PROPERTY_KEY}")
       STRING(REGEX MATCH "[ ].+$" PROPERTY_VALUE "${TARGET_ARCH_PROPERTY}")
+      STRING(STRIP ${PROPERTY_VALUE} PROPERTY_VALUE)
       IF(${PROPERTY_VALUE})
         TART_DEBUG("   ${TARGET_ARCH} value: ${PROPERTY_VALUE}")
         SET_TARGET_PROPERTIES(${PACKAGE_TARGET} PROPERTIES "${PROPERTY_KEY}" "${PROPERTY_VALUE}")


fix other msvc toolsets

fix other msvc toolsets

--- cmake/LTO.cmake
+++ cmake/LTO.cmake
@@ -157,7 +157,7 @@
 			set(LTO_${lang}_SUPPORT TRUE CACHE BOOL "Do we have LTO support ?")
 			set(LTO_COMPILE_FLAGS -flto CACHE STRING "Link Time Optimization compile flags")
 			set(LTO_LINK_FLAGS -flto CACHE STRING "Link Time Optimization link flags")
-        elseif(MSVC)
+        elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
             message(STATUS "Checking for LTO Compatibility - works")
             set(LTO_${lang}_SUPPORT TRUE CACHE BOOL "Do we have LTO support ?")
             set(LTO_COMPILE_FLAGS /GL CACHE STRING "Link Time Optimization compile flags")


Adjust mpi.cmake to compiler vars

Adjust mpi.cmake to compiler vars

--- cmake/mpi.cmake
+++ cmake/mpi.cmake
@@ -23,7 +23,7 @@
     ELSE()
       SET(CMAKE_MPI_MIC_FLAG "")
     ENDIF()
-    IF ((OSPRAY_COMPILER STREQUAL "ICC"))
+    IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
       #  IF (OSPRAY_FORCE_IMPI)
       SET(MPI_CXX_COMPILER "mpiicpc")
       execute_process(


build: silence `-Wassign-enum`

build: silence `-Wassign-enum`

Silence the enum assignment warning from clang.  It is triggered by use
of constants in macros that are not part of an enumeration when the
parameter is of an enumerated type.  This shows up when building for
Windows.  Rather than clutter the codebase with compiler specific macros
to silence the warning, disable it.

Signed-off-by: Daniel A. Steffen <bc823475b60dbcbd7be1bbdfe095b5f1939d5bd2@apple.com>

--- cmake/modules/DispatchCompilerWarnings.cmake
+++ cmake/modules/DispatchCompilerWarnings.cmake
@@ -74,5 +74,6 @@
       add_compile_options(-Wno-int-conversion)
       add_compile_options(-Wno-shorten-64-to-32)
     endif()
+    add_compile_options(-Wno-error=assign-enum)
   endmacro()
 endif()


Updated device side binary

Updated device side binary

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "1f27e8cf4302e2f284b00f5cac6d44adb42bc285")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "9cc2165af5e408f257cfdfc6e7fc0282b34ec4e4")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Update FW: fix StereoDepth crash with missing EEPROM, report error if missing, do not rotate RGB (AUTO orientation) on OAK-D(-Lite) if EEPROM is missing

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "5813806b6f2de7aaa4c211e5d8aa8e98774da8c8")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "2bebad51c15c2e8961899a29b93b93f2409d8464")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Fixed ROOT-7463 - Internal liblzma not found when building ROOT6 on OpenSuse 13.1. Applied patch provided by Florian Uhlig

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -100,6 +100,7 @@
   else()
     if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
       set(LZMA_CFLAGS "-Wno-format-nonliteral")
+      set(LZMA_LDFLAGS "-Qunused-arguments")
     elseif( CMAKE_CXX_COMPILER_ID STREQUAL Intel)
       set(LZMA_CFLAGS "-wd188 -wd181 -wd1292 -wd10006 -wd10156 -wd2259 -wd981 -wd128 -wd3179 -wd2102")
     endif()
@@ -108,7 +109,9 @@
       URL ${CMAKE_SOURCE_DIR}/core/lzma/src/xz-${lzma_version}.tar.gz
       URL_MD5 858405e79590e9b05634c399497f4ba7
       INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --with-pic --disable-shared CFLAGS=${LZMA_CFLAGS}
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --libdir <INSTALL_DIR>/lib
+                        --with-pic --disable-shared --quiet
+                        CFLAGS=${LZMA_CFLAGS} LDFLAGS=${LZMA_LDFLAGS}
       BUILD_IN_SOURCE 1)
     set(LZMA_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lzma${CMAKE_STATIC_LIBRARY_SUFFIX})
     set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)


esptool_py: better display logs when generating binary

Since OUTPUT argument of custom command does not currently support
generator expressions, the project image is only generated as a side
effect. The primary generated file is a timestamp file. Unfortunately as a consequence
the output logs when the
binary is about to be generated is not as helpful anymore.

Set a custom comment that is more descriptive of what is happening,
and provide more feedback as to what has been generated.

--- components/esptool_py/project_include.cmake
+++ components/esptool_py/project_include.cmake
@@ -75,28 +75,33 @@
 #
 # Add 'app.bin' target - generates with elf2image
 #
-add_custom_command(OUTPUT "${build_dir}/.app_hash"
+add_custom_command(OUTPUT "${build_dir}/.bin_timestamp"
     COMMAND ${ESPTOOLPY} elf2image ${ESPTOOLPY_ELF2IMAGE_FLASH_OPTIONS} ${ESPTOOLPY_ELF2IMAGE_OPTIONS}
         -o "${build_dir}/${unsigned_project_binary}" "${elf}"
-    COMMAND ${CMAKE_COMMAND} -E md5sum "${build_dir}/${unsigned_project_binary}" > "${build_dir}/.app_hash"
+    COMMAND ${CMAKE_COMMAND} -E echo "Generated ${build_dir}/${unsigned_project_binary}"
+    COMMAND ${CMAKE_COMMAND} -E md5sum "${build_dir}/${unsigned_project_binary}" > "${build_dir}/.bin_timestamp"
     DEPENDS ${elf}
     VERBATIM
     WORKING_DIRECTORY ${build_dir}
+    COMMENT "Generating binary image from built executable"
     )
-add_custom_target(gen_project_binary DEPENDS "${build_dir}/.app_hash")
+add_custom_target(gen_project_binary DEPENDS "${build_dir}/.bin_timestamp")

 if(NOT BOOTLOADER_BUILD AND
     CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)

     # for locally signed secure boot image, add a signing step to get from unsigned app to signed app
-    add_custom_command(OUTPUT "${build_dir}/.signed_app_hash"
+    add_custom_command(OUTPUT "${build_dir}/.signed_bin_timestamp"
         COMMAND ${ESPSECUREPY} sign_data --keyfile ${secure_boot_signing_key}
             -o "${build_dir}/${PROJECT_BIN}" "${build_dir}/${unsigned_project_binary}"
-        COMMAND ${CMAKE_COMMAND} -E md5sum "${build_dir}/${PROJECT_BIN}" > "${build_dir}/.signed_app_hash"
-        DEPENDS "${build_dir}/.app_hash"
+        COMMAND ${CMAKE_COMMAND} -E echo "Generated signed binary image ${build_dir}/${PROJECT_BIN}"
+                                "from ${build_dir}/${unsigned_project_binary}"
+        COMMAND ${CMAKE_COMMAND} -E md5sum "${build_dir}/${PROJECT_BIN}" > "${build_dir}/.signed_bin_timestamp"
+        DEPENDS "${build_dir}/.bin_timestamp"
         VERBATIM
+        COMMENT "Generating signed binary image"
         )
-    add_custom_target(gen_signed_project_binary DEPENDS "${build_dir}/.signed_app_hash")
+    add_custom_target(gen_signed_project_binary DEPENDS "${build_dir}/.signed_bin_timestamp")
     add_dependencies(gen_project_binary gen_signed_project_binary)
 endif()

@@ -105,6 +110,7 @@
 else()
     add_custom_target(bootloader ALL DEPENDS gen_project_binary)
 endif()
+

 if(NOT BOOTLOADER_BUILD AND
     CONFIG_SECURE_BOOT_ENABLED AND


use checkphasta to compare restart files

--- phSolver/incompressible/test/testing.cmake
+++ phSolver/incompressible/test/testing.cmake
@@ -8,17 +8,28 @@
 add_test(
   NAME incompressible-sync
   COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phastaIC.exe
-  WORKING_DIRECTORY ${CASES}/incompressible
+  WORKING_DIRECTORY ${CDIR}
 )
-add_test(compareIncompressible-sync
-  diff ${CDIR}/restart-dat.4.1.syncio.ref ${CDIR}/4-procs_case/restart-dat.4.1)
+set(cmd
+  ${PHASTA_BINARY_DIR}/bin/checkphasta
+  ${CDIR}/4-procs_case-SyncIO-2/
+  ${CDIR}/4-procs_case-SyncIO-2_ref/
+  2 1e-6)
+add_test(
+  NAME compareIncompressible-sync
+  COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${cmd}
+  WORKING_DIRECTORY ${CDIR}
+)
 add_test(
   NAME incompressibleRestart-sync
   COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phastaIC.exe
-  WORKING_DIRECTORY ${CASES}/incompressible
+  WORKING_DIRECTORY ${CDIR}
 )
-add_test(compareIncompressibleRestart-sync
-  diff ${CDIR}/restart-dat.8.1.syncio.ref ${CDIR}/4-procs_case/restart-dat.8.1)
+add_test(
+  NAME compareIncompressibleRestart-sync
+  COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${cmd}
+  WORKING_DIRECTORY ${CDIR}
+)

 add_test(linkProcsDir-posix
   ln -snf ${CDIR}/4-procs_case-Posix ${CDIR}/4-procs_case)
@@ -27,10 +38,25 @@
 add_test(
   NAME incompressible-posix
   COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phastaIC.exe
-  WORKING_DIRECTORY ${CASES}/incompressible
+  WORKING_DIRECTORY ${CDIR}
+)
+set(cmd
+  ${PHASTA_BINARY_DIR}/bin/checkphasta
+  ${CDIR}/4-procs_case-Posix/
+  ${CDIR}/4-procs_case-Posix_ref/
+  0 1e-6)
+add_test(
+  NAME compareIncompressible-posix
+  COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${cmd}
+  WORKING_DIRECTORY ${CDIR}
 )
 add_test(
   NAME incompressibleRestart-posix
   COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${PHASTA_BINARY_DIR}/bin/phastaIC.exe
-  WORKING_DIRECTORY ${CASES}/incompressible
+  WORKING_DIRECTORY ${CDIR}
 )
+add_test(
+  NAME compareIncompressibleRestart-posix
+  COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4 ${cmd}
+  WORKING_DIRECTORY ${CDIR}
+)


fptu-cmake: fix check support for '%cI' for git < 2.0

--- cmake.fptu/utils.cmake
+++ cmake.fptu/utils.cmake
@@ -60,7 +60,7 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       RESULT_VARIABLE rc)
-    if(rc)
+    if(rc OR "${name}_GIT_TIMESTAMP" STREQUAL "%cI")
       message(FATAL_ERROR "Please install latest version of git ('show --no-patch --format=%cI HEAD' failed)")
     endif()


CMake: fix detection of dependency libraries that need installing.

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -218,13 +218,13 @@
 			SET(DLLPATH "DLLPATH-NOTFOUND" CACHE STRING "" FORCE)
 			FIND_FILE(DLLPATH
 				NAMES  "${LIBNAME}.dll"
-				PATHS "${LIBPATH}"
+				HINTS "${LIBPATH}"
 				PATH_SUFFIXES ../bin ../dlls
 			)
 			IF (NOT DLLPATH)
 				FIND_FILE(DLLPATH
 					NAMES  "${LIBNAME}.pyd"
-					PATHS "${LIBPATH}"
+					HINTS "${LIBPATH}"
 					PATH_SUFFIXES ../bin ../dlls
 				)
 			ENDIF()


WIP cmake LTO support for benchmarks

WIP cmake LTO support for benchmarks

--- cmake/Benchmarks.cmake
+++ cmake/Benchmarks.cmake
@@ -1,3 +1,6 @@
+cmake_minimum_required(VERSION 3.9.4)
+include(CheckIPOSupported)
+check_ipo_supported(RESULT lto_supported OUTPUT lto_error)

 option(GOOGLE_BENCHMARK "Enable google benchmark for unit tests" OFF)

@@ -26,6 +29,15 @@
     set_target_properties(${exec_name} PROPERTIES
       RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/benchmarks")

+    if (CMAKE_BUILD_TYPE STREQUAL "RELEASE" OR CMAKE_BUILD_TYPE STREQUAL "Release")
+      if( lto_supported )
+          message(STATUS "LTO enabled for ${exec_name}")
+          set_property(TARGET ${exec_name} PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
+      else()
+          message(STATUS "LTO not supported (for target ${exec_name}): <${lto_error}>")
+      endif()
+    endif ()
+
     target_link_libraries(${exec_name}
       ${${exec_name}_LIB}
       ${link_libraries}


fatally fails if cyclus not found

fatally fails if cyclus not found

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -115,18 +115,18 @@
   MESSAGE(STATUS ${CYCLUS_AGENT_TEST_LIB_MESSAGE})
   MESSAGE(STATUS ${CYCLUS_GTEST_LIB_MESSAGE})
 ELSE (CYCLUS_CORE_FOUND)
-	SET(CYCLUS_CORE_DIR_MESSAGE
-		"Cyclus was not found. Make sure CYCLUS_CORE_LIBRARY and CYCLUS_CORE_INCLUDE_DIR are set.")
-    IF (NOT cyclus_FIND_QUIETLY)
-	  MESSAGE(STATUS "${CYCLUS_CORE_DIR_MESSAGE}")
-	  MESSAGE(STATUS "CYCLUS_CORE_SHARE_DIR was set to : ${CYCLUS_CORE_SHARE_DIR}")
-	  MESSAGE(STATUS "CYCLUS_CORE_LIBRARY was set to : ${CYCLUS_CORE_LIBRARY}")
-	  MESSAGE(STATUS "CYCLUS_AGENT_TEST_LIBRARY was set to : ${CYCLUS_AGENT_TEST_LIBRARY}")
-	  MESSAGE(STATUS "CYCLUS_GTEST_LIBRARY was set to : ${CYCLUS_GTEST_LIBRARY}")
-      IF (cyclus_FIND_REQUIRED)
-        MESSAGE(FATAL_ERROR "${cyclus_DIR_MESSAGE}")
-      ENDIF (cyclus_FIND_REQUIRED)
-    ENDIF (NOT cyclus_FIND_QUIETLY)
+  SET(CYCLUS_CORE_DIR_MESSAGE
+    "Cyclus was not found. Make sure CYCLUS_CORE_LIBRARY and CYCLUS_CORE_INCLUDE_DIR are set.")
+  IF (NOT Cyclus_FIND_QUIETLY)
+    MESSAGE(STATUS "${CYCLUS_CORE_DIR_MESSAGE}")
+    MESSAGE(STATUS "CYCLUS_CORE_SHARE_DIR was set to : ${CYCLUS_CORE_SHARE_DIR}")
+    MESSAGE(STATUS "CYCLUS_CORE_LIBRARY was set to : ${CYCLUS_CORE_LIBRARY}")
+    MESSAGE(STATUS "CYCLUS_AGENT_TEST_LIBRARY was set to : ${CYCLUS_AGENT_TEST_LIBRARY}")
+    MESSAGE(STATUS "CYCLUS_GTEST_LIBRARY was set to : ${CYCLUS_GTEST_LIBRARY}")
+    IF (Cyclus_FIND_REQUIRED)
+      MESSAGE(FATAL_ERROR "${cyclus_DIR_MESSAGE}")
+    ENDIF (Cyclus_FIND_REQUIRED)
+  ENDIF (NOT Cyclus_FIND_QUIETLY)
 ENDIF (CYCLUS_CORE_FOUND)

 MARK_AS_ADVANCED(


makes FindDCMTK2 work even if DEBUG libraries are not present on windows

--- cmake/FindDCMTK2.cmake
+++ cmake/FindDCMTK2.cmake
@@ -331,9 +331,11 @@

 IF( WIN32 )
   SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} netapi32 )
-  SET (DCMTK_LIBRARIES
-      ${DCMTK_LIBRARIES}
-      ${DCMTK_LIBRARIES_DEBUG})
+  IF ( ${DCMTK_dcmdata_LIBRARY_DEBUG})
+      SET (DCMTK_LIBRARIES
+          ${DCMTK_LIBRARIES}
+          ${DCMTK_LIBRARIES_DEBUG})
+  ENDIF(${DCMTK_dcmdata_LIBRARY_DEBUG})
 ENDIF( WIN32 )

 ENDIF( DCMTK_root_INCLUDE_DIR


better find libigl

better find libigl

--- cmake/FindLIBIGL.cmake
+++ cmake/FindLIBIGL.cmake
@@ -11,6 +11,7 @@
    ${PROJECT_SOURCE_DIR}/../../include
    ${PROJECT_SOURCE_DIR}/../include
    ${PROJECT_SOURCE_DIR}/include
+   ${PROJECT_SOURCE_DIR}/libigl/include
    ${PROJECT_SOURCE_DIR}/../libigl/include
    ${PROJECT_SOURCE_DIR}/../../libigl/include
    $ENV{LIBIGL}/include


Check for PYTHON_LIBRARY only on windows

--- cmake/FindPython.cmake
+++ cmake/FindPython.cmake
@@ -37,15 +37,17 @@

 string(REPLACE "." "" PYTHON_VERSION_WITHOUT_DOTS ${PYTHON_VERSION})

-FIND_LIBRARY(PYTHON_LIBRARY NAMES
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  FIND_LIBRARY(PYTHON_LIBRARY NAMES
         python${PYTHON_VERSION}
         python${PYTHON_VERSION}m
         python${PYTHON_VERSION_WITHOUT_DOTS}
-    PATHS ${PYTHON_LIB_PATH} ${PYTHON_PREFIX_PATH}/lib ${PYTHON_PREFIX_PATH}/libs
-    PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
-    NO_DEFAULT_PATH
-    NO_SYSTEM_ENVIRONMENT_PATH
-    )
+      PATHS ${PYTHON_LIB_PATH} ${PYTHON_PREFIX_PATH}/lib ${PYTHON_PREFIX_PATH}/libs
+      PATH_SUFFIXES ${CMAKE_LIBRARY_ARCHITECTURE}
+      NO_DEFAULT_PATH
+      NO_SYSTEM_ENVIRONMENT_PATH
+  )
+endif()

 execute_process(
 	COMMAND ${PYTHON_BIN} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
@@ -66,7 +68,12 @@
     CACHE STRING "Suffix for python extensions")

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python DEFAULT_MSG PYTHON_LIBRARY PYTHON_INCLUDE_PATH PYTHON_INSTALL_PATH)
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python DEFAULT_MSG PYTHON_LIBRARY PYTHON_INCLUDE_PATH PYTHON_INSTALL_PATH)
+else ()
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python DEFAULT_MSG PYTHON_INCLUDE_PATH PYTHON_INSTALL_PATH)
+endif ()

 # Links a Python extension module.


Add missing VTK components (requried by SMESH)

--- salome_adm/cmake_files/FindSalomeVTK.cmake
+++ salome_adm/cmake_files/FindSalomeVTK.cmake
@@ -35,6 +35,8 @@
   vtkWrappingPython
   vtkIOXML
   vtkFiltersVerdict
+  vtkRenderingLabel
+  vtkInteractionWidgets
 )

 #   Seting the following variable is equivalent to having passed the components


Update CPack variables

Update CPack variables

--- cmake/CPackConfig.cmake
+++ cmake/CPackConfig.cmake
@@ -1,7 +1,13 @@
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Robotics Library is a self-contained C++ library for robot kinematics, visualization, motion planning, and control.")

+if(CMAKE_SIZEOF_VOID_P EQUAL 4)
+	set(ARCHITECTURE "x86")
+else()
+	set(ARCHITECTURE "x64")
+endif()
+
 if(MSVC)
-	if(CMAKE_CXX_COMPILER_VERSION MATCHES "^([0-9]+)\\.([0-9])([0-9]*)\\.([0-9]+)\\.")
+	if(CMAKE_CXX_COMPILER_VERSION MATCHES "^([0-9]+)\\.([0-9])([0-9]*)")
 		if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18)
 			math(EXPR LINKER_VERSION_MAJOR "${CMAKE_MATCH_1} - 5")
 		else()
@@ -9,21 +15,36 @@
 		endif()
 		set(PLATFORM_TOOLSET_MAJOR ${LINKER_VERSION_MAJOR})
 		set(PLATFORM_TOOLSET_MINOR ${CMAKE_MATCH_2})
-		set(LINKER_VERSION "${LINKER_VERSION_MAJOR}.${CMAKE_MATCH_2}${CMAKE_MATCH_3}.${CMAKE_MATCH_4}")
-	endif()
-	if(CMAKE_SIZEOF_VOID_P EQUAL 4)
-		set(ARCHITECTURE "x86")
+		set(COMPILER_VERSION "${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}")
+	endif()
+	set(COMPILER_ID ${CMAKE_CXX_COMPILER_ID})
+	set(CPACK_PACKAGE_FILE_NAME "rl-${PROJECT_VERSION}-${COMPILER_ID}-${COMPILER_VERSION}-${ARCHITECTURE}")
+else()
+	if(CMAKE_CXX_COMPILER_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
+		set(COMPILER_VERSION_MAJOR ${CMAKE_MATCH_1})
+		set(COMPILER_VERSION_MINOR ${CMAKE_MATCH_2})
+		set(COMPILER_VERSION_PATCH ${CMAKE_MATCH_3})
+		set(COMPILER_VERSION "${COMPILER_VERSION_MAJOR}.${COMPILER_VERSION_MINOR}.${COMPILER_VERSION_PATCH}")
 	else()
-		set(ARCHITECTURE "x64")
-	endif()
-	set(CPACK_PACKAGE_FILE_NAME "rl-${PROJECT_VERSION}-msvc-${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}-${ARCHITECTURE}")
-	set(CPACK_PACKAGE_INSTALL_DIRECTORY "Robotics Library\\\\${PROJECT_VERSION}\\\\MSVC\\\\${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR}\\\\${ARCHITECTURE}")
-	set(CPACK_PACKAGE_NAME "Robotics Library ${PROJECT_VERSION} - MSVC ${PLATFORM_TOOLSET_MAJOR}.${PLATFORM_TOOLSET_MINOR} (${ARCHITECTURE})")
+		set(COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
+	endif()
+	if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+		set(COMPILER_ID "GCC")
+	else()
+		set(COMPILER_ID ${CMAKE_CXX_COMPILER_ID})
+	endif()
+	set(CPACK_PACKAGE_FILE_NAME "rl-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${COMPILER_ID}-${COMPILER_VERSION}-${ARCHITECTURE}")
+endif()
+
+string(TOLOWER ${CPACK_PACKAGE_FILE_NAME} CPACK_PACKAGE_FILE_NAME)
+
+if(WIN32)
+	set(CPACK_PACKAGE_INSTALL_DIRECTORY "Robotics Library\\\\${PROJECT_VERSION}\\\\${COMPILER_ID}\\\\${COMPILER_VERSION}\\\\${ARCHITECTURE}")
 else()
-	set(CPACK_PACKAGE_FILE_NAME "rl-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}")
 	set(CPACK_PACKAGE_INSTALL_DIRECTORY "rl-${PROJECT_VERSION}")
-	set(CPACK_PACKAGE_NAME "Robotics Library ${PROJECT_VERSION}")
-endif()
+endif()
+
+set(CPACK_PACKAGE_NAME "Robotics Library ${PROJECT_VERSION} - ${COMPILER_ID} ${COMPILER_VERSION} (${ARCHITECTURE})")

 set(CPACK_COMPONENT_DEMOS_DEPENDS examples)
 set(CPACK_COMPONENT_DEMOS_DESCRIPTION "Demo programs for the Robotics Library.")


Don't search default path when JsonCpp_DIR is provided

If a JsonCpp is present in a default path on the computer,
find_package(JsonCpp) was selecting this one instead of the path
pointed by JsonCpp_DIR.

--- cmake/FindJsonCpp.cmake
+++ cmake/FindJsonCpp.cmake
@@ -32,14 +32,17 @@
     ${JsonCpp_DIR}/lib/MinSizeRel
     ${JsonCpp_DIR}/lib/RelWithDebInfo
     ${JsonCpp_DIR}/lib/Debug )
+  set( _jsoncpp_options NO_DEFAULT_PATH )
 endif( JsonCpp_DIR )

 find_path( JsonCpp_INCLUDE_DIR NAMES json/json.h
   HINTS ${_jsoncpp_include_dir}
-  PATH_SUFFIXES jsoncpp )
+  PATH_SUFFIXES jsoncpp
+  ${_jsoncpp_options} )

 find_library( JsonCpp_LIBRARY NAMES jsoncpp libjsoncpp
-  HINTS ${_jsoncpp_library} )
+  HINTS ${_jsoncpp_library}
+  ${_jsoncpp_options} )

 set( JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR} )
 set( JsonCpp_LIBRARIES ${JsonCpp_LIBRARY} )


Add YAMLCPP_ROOT to search paths for yaml cpp

--- cmake/FindYamlCpp.cmake
+++ cmake/FindYamlCpp.cmake
@@ -30,6 +30,7 @@
   NAMES yaml-cpp/yaml.h
   PATH_SUFFIXES include
   PATHS
+    ${YAMLCPP_ROOT}
     ${PROJECT_SOURCE_DIR}/ext/
     ~/Library/Frameworks/yaml-cpp/include/
     /Library/Frameworks/yaml-cpp/include/
@@ -45,6 +46,7 @@
   NAMES ${YAMLCPP_STATIC} yaml-cpp libyaml-cppmd.lib
   PATH_SUFFIXES lib64 lib Release RelWithDebInfo
   PATHS
+    ${YAMLCPP_ROOT}
     ${PROJECT_SOURCE_DIR}/ext
     ~/Library/Frameworks
     /Library/Frameworks
@@ -60,6 +62,7 @@
   NAMES ${YAMLCPP_STATIC_DEBUG} yaml-cpp-dbg libyaml-cppmdd.lib
   PATH_SUFFIXES lib64 lib Debug
   PATHS
+    ${YAMLCPP_ROOT}
     ${PROJECT_SOURCE_DIR}/ext
     ~/Library/Frameworks
     /Library/Frameworks


Fix the lib/exe/dll copying to target dir properly.

--- cmake/ModuleSetup.cmake
+++ cmake/ModuleSetup.cmake
@@ -18,9 +18,10 @@
 # ARGV1 is directive to output, and ARGV2 is where to
 macro (init_target NAME)

-    # Define target name and output directory
+    # Define target name and output directory.
+    # Skip ARGV1 that is the keyword OUTPUT.
     set (TARGET_NAME ${NAME})
-    set (${TARGET_NAME}_OUTPUT ${ARGV1})
+    set (TARGET_OUTPUT ${ARGV2})

     message ("** " ${TARGET_NAME})

@@ -42,8 +43,8 @@
     link_directories (${PROJECT_BINARY_DIR}/lib)

     # set TARGET_DIR
-    if (NOT "${TARGET_NAME_OUTPUT}" STREQUAL "")
-        set (TARGET_DIR ${PROJECT_BINARY_DIR}/bin/${ARGV2})
+    if (NOT "${TARGET_OUTPUT}" STREQUAL "")
+        set (TARGET_DIR ${PROJECT_BINARY_DIR}/bin/${TARGET_OUTPUT})
         if (MSVC)
             # export symbols, copy needs to be added via copy_target
             add_definitions (-DMODULE_EXPORTS)
@@ -132,7 +133,6 @@
     endif (MSVC)

     set_target_properties (${TARGET_NAME} PROPERTIES DEBUG_POSTFIX d)
-

 endmacro (build_executable)


don't forget to install necessary extra CMake files

--- cmake/ectoInstall.cmake
+++ cmake/ectoInstall.cmake
@@ -26,6 +26,11 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 #### install stuff #####
+#CMake files
+install(FILES doc.cmake ectoMacros.cmake git.cmake
+        DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/cmake/
+)
+
 #regular headers
 install(DIRECTORY ${ecto_SOURCE_DIR}/include/ecto/
         DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}


fixed compile warnings under windows

fixed compile warnings under windows

--- common/cmake/msvc.cmake
+++ common/cmake/msvc.cmake
@@ -31,8 +31,10 @@
 SET(FLAGS_AVX512KNL "")

 SET(COMMON_CXX_FLAGS "/EHsc /MP /GR")
-SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11074 ")  # remark #11074: Inlining inhibited by limit max-size
-SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11075 ")  # remark #11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
+IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
+  SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11074 ")  # remark #11074: Inlining inhibited by limit max-size
+  SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11075 ")  # remark #11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo
+ENDIF()

 SET(CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
 SET(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}        ${COMMON_CXX_FLAGS} /Ox /fp:fast /Oi /Gy /Qinline-max-total-size- /Qinline-factor=200 ")
@@ -40,10 +42,11 @@

 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG")

-SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /Qdiag-disable:11082 ")  # warning #11082: locally defined symbol XXX imported
+IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /Qdiag-disable:11082 ")  # warning #11082: locally defined symbol XXX imported
+ENDIF()
 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /IGNORE:4217")  # locally defined symbol XXX imported in function YYY (happens as the ISPC API layer uses exported library functions)
 SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /IGNORE:4049")  # warning LNK4049: locally defined symbol _rtcOccluded1M imported
-SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /IGNORE:4044")  # warning LNK4044: unrecognized option '/Qdiag-disable:11082'; ignored
 SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG")

 # optionally use static runtime library


BUG: Mantis-1449: update tag for FFSforGMM

--- Modules/Remote/otbFFSforGMM.remote.cmake
+++ Modules/Remote/otbFFSforGMM.remote.cmake
@@ -25,5 +25,5 @@
 https://github.com/Laadr/otbFFSforGMM
 "
   GIT_REPOSITORY https://github.com/Laadr/otbFFSforGMM.git
-  GIT_TAG 20f3938ffa585a3ec6e735c48e8d5e6ec77fe80a
+  GIT_TAG 1164391d09b9987f7f7ea6718347c772e31a396a
   )


ENH:Updated CGM to use Git

ENH:Updated CGM to use Git

--- meshkit/versions.cmake
+++ meshkit/versions.cmake
@@ -49,8 +49,8 @@
   )

 add_revision(cgm
-  SVN_REPOSITORY https://svn.mcs.anl.gov/repos/ITAPS/cgm/tags/13.1.1
-  SVN_TRUST_CERT 1
+  GIT_REPOSITORY "https://bitbucket.org/fathomteam/cgm.git"
+  GIT_TAG 13.1.1
   )

 add_revision(lasso


cmake: check more precisely if webui was disabled intentionally

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -20,7 +20,7 @@
 function(ROOT_APPLY_OPTIONS)
   foreach(opt ${root_build_options})
      option(${opt} "${${opt}_description}" ${${opt}_defvalue})
-  endforeach()
+  endforeach()
 endfunction()

 #---------------------------------------------------------------------------------------------------
@@ -273,7 +273,7 @@

 #---Options depending of CMake Generator-------------------------------------------------------
 if( CMAKE_GENERATOR STREQUAL Ninja)
-   set(fortran_defvalue OFF)
+   set(fortran_defvalue OFF)
 endif()

 #---Apply minimal or gminimal------------------------------------------------------------------
@@ -293,7 +293,7 @@
   set(webui_defvalue OFF)
 endif()

-if("${webui}" STREQUAL "OFF")
+if (NOT webui AND NOT "${webui}" STREQUAL "")
    set(webui_disabled ON)
 endif()

@@ -311,7 +311,7 @@
    endif()
    if(NOT webui AND NOT webui_disabled)
       set(webui ON CACHE BOOL "(webui build automatically when root7 is enabled)" FORCE)
-   endif()
+   endif()
 endif()

 #---check if webui can be build-------------------------------


Add builtin_xxhash options to RootBuildOptions.cmake

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -87,6 +87,7 @@
 ROOT_BUILD_OPTION(builtin_vdt OFF "Build the VDT package internally")
 ROOT_BUILD_OPTION(builtin_veccore OFF "Build VecCore internally")
 ROOT_BUILD_OPTION(builtin_xrootd OFF "Build the XROOTD internally (downloading tarfile from the Web)")
+ROOT_BUILD_OPTION(builtin_xxhash OFF "Build included xxHash library")
 ROOT_BUILD_OPTION(builtin_zlib OFF "Build included libz, or use system libz")
 ROOT_BUILD_OPTION(castor ON "CASTOR support, requires libshift from CASTOR >= 1.5.2")
 if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
@@ -259,6 +260,7 @@
   set(builtin_vc_defvalue ON)
   set(builtin_vdt_defvalue ON)
   set(builtin_veccore_defvalue ON)
+  set(builtin_xxhash_defvalue ON)
 endif()

 #---Vc supports only x86_64 architecture-------------------------------------------------------


switch ncurses url

switch ncurses url

--- cmake/projects/ncursesw/hunter.cmake
+++ cmake/projects/ncursesw/hunter.cmake
@@ -16,7 +16,7 @@
     VERSION
     6.1
     URL
-    "ftp://ftp.invisible-island.net/ncurses/ncurses-6.1.tar.gz"
+    "https://ftp.gnu.org/gnu/ncurses/ncurses-6.1.tar.gz"
     SHA1
     57acf6bc24cacd651d82541929f726f4def780cc
 )


Use non-empty stub for resoures object to silence ranlib.

--- cmake/usFunctionEmbedResources.cmake
+++ cmake/usFunctionEmbedResources.cmake
@@ -130,8 +130,7 @@
     if(APPLE)
       add_custom_command(
         OUTPUT ${_source_output}
-        COMMAND ${CMAKE_COMMAND} -E touch stub.cpp
-        COMMAND ${CMAKE_CXX_COMPILER} -c stub.cpp -o stub.o
+        COMMAND ${CMAKE_CXX_COMPILER} -c ${US_CMAKE_RESOURCE_DEPENDENCIES_CPP} -o stub.o
         COMMAND ${CMAKE_LINKER} -r -sectcreate __TEXT us_resources ${_zip_archive_name} stub.o -o ${_source_output}
         DEPENDS ${_zip_archive}
         WORKING_DIRECTORY ${_zip_archive_path}


PKG: finally automatic generation of windows XDK with cmake

--- SuperBuild/Packaging/PackageHelper.cmake
+++ SuperBuild/Packaging/PackageHelper.cmake
@@ -1,4 +1,4 @@
-macro(super_package)
+macro(macro_super_package)
   cmake_parse_arguments(PKG  "" "STAGE_DIR" "SEARCHDIRS" ${ARGN} )

   if(${PKG_STAGE_DIR} STREQUAL "")
@@ -6,7 +6,7 @@
   endif()

   set(loader_program_PATHS)
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
+  if(WIN32)
       set(loader_program_names      "${MXE_ARCH}-w64-mingw32.shared-objdump")
       set(loader_program_PATHS      "${MXE_MXEROOT}/usr/bin")
       set(LOADER_PROGRAM_ARGS       "-p")
@@ -33,8 +33,7 @@
   include(GetPrerequisites)

   set(PKG_SEARCHDIRS)
-
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
+  if(WIN32)
     file(GLOB MXE_GCC_LIB_DIR "${DEPENDENCIES_INSTALL_DIR}/bin/gcc*")
     list(APPEND PKG_SEARCHDIRS ${MXE_GCC_LIB_DIR})
     list(APPEND PKG_SEARCHDIRS "${DEPENDENCIES_INSTALL_DIR}/qt/bin") #Qt
@@ -57,20 +56,51 @@
   list(APPEND  EXE_SEARCHDIRS ${MONTEVERDI_INSTALL_DIR}/bin)
   list(APPEND  EXE_SEARCHDIRS ${DEPENDENCIES_INSTALL_DIR}/bin)

-  empty_package_staging_directory()
+  macro_empty_package_staging_directory()

   set(PKG_PEFILES)
-  if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
+  if(NOT WIN32)
     file(WRITE ${CMAKE_BINARY_DIR}/make_symlinks "#!/bin/sh\n")
     #NOTE: VAR_IN_PKGSETUP_CONFIGURE is copied to linux_pkgsetup.in during configure_file
     set(VAR_IN_PKGSETUP_CONFIGURE)
     set(PKG_SO_FILES)
-  endif() # if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
-
-  configure_package()
-
-  if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
-    ############# install client configure script ################
+  endif() # if(NOT WIN32)
+
+  func_prepare_package()
+
+  func_prepare_install_list(
+    "${CMAKE_BINARY_DIR}/install_to_bin"
+    ${PKG_GENERATE_XDK}
+    bin_install_list
+    )
+
+  func_prepare_install_list(
+    "${CMAKE_BINARY_DIR}/install_to_lib"
+    ${PKG_GENERATE_XDK}
+    lib_install_list
+    )
+
+  foreach(installable_item_in_bin ${bin_install_list})
+    if(WIN32)
+      #only install .exe files with install(PROGRAMS ..
+      if("${installable_item_in_bin}" MATCHES "\\.exe$")
+        install(PROGRAMS "${installable_item_in_bin}" DESTINATION ${PKG_STAGE_DIR}/bin)
+      else()
+        install(FILES "${installable_item_in_bin}" DESTINATION ${PKG_STAGE_DIR}/bin)
+      endif()
+    else()
+      #install all executable with install(PROGRAMS on unix like
+      install(PROGRAMS "${installable_item_in_bin}" DESTINATION ${PKG_STAGE_DIR}/bin)
+    endif()
+  endforeach()
+
+  #install lib files into lib as install(FILES ..
+  foreach(installable_item_in_lib ${lib_install_list})
+    install(FILES "${installable_item_in_bin}" DESTINATION ${PKG_STAGE_DIR}/lib)
+  endforeach()
+
+  ############# install package configure script ################
+  if(UNIX AND NOT WIN32)
     set(PKGSETUP_IN_FILENAME linux_pkgsetup.in)
     if(APPLE)
       set(PKGSETUP_IN_FILENAME macx_pkgsetup.in)
@@ -78,175 +108,146 @@
     configure_file(${PACKAGE_SUPPORT_FILES_DIR}/${PKGSETUP_IN_FILENAME}
       ${CMAKE_BINARY_DIR}/pkgsetup @ONLY)

-    install(FILES
+    install(PROGRAMS
       ${CMAKE_BINARY_DIR}/pkgsetup
       ${CMAKE_BINARY_DIR}/make_symlinks
-      DESTINATION ${PKG_STAGE_DIR}
-      PERMISSIONS
-      OWNER_READ OWNER_WRITE OWNER_EXECUTE
-      GROUP_READ GROUP_EXECUTE
-      WORLD_READ WORLD_EXECUTE)
-
-    if(UNIX)
-      if(NOT APPLE)
-        ####################### install patchelf #####################
-        install(FILES ${CMAKE_INSTALL_PREFIX}/tools/patchelf
-          DESTINATION ${PKG_STAGE_DIR}/tools
-          PERMISSIONS
-          OWNER_EXECUTE OWNER_WRITE OWNER_READ
-          GROUP_EXECUTE GROUP_READ)
-      endif()
-    endif()
-  endif() # if(NOT WIN32 AND NOT CMAKE_CROSSCOMPILING)
+      DESTINATION ${PKG_STAGE_DIR})
+
+    ########### install patchelf( linux only) ##################
+    if(NOT APPLE)
+      install(PROGRAMS ${CMAKE_INSTALL_PREFIX}/tools/patchelf
+        DESTINATION ${PKG_STAGE_DIR}/tools)
+    endif()
+  endif() # if(UNIX)

   if(PKG_GENERATE_XDK)
-    install_xdk_files()
-  endif()
-
-endmacro(super_package)
-
-function(install_xdk_files)
-  install(DIRECTORY ${DEPENDENCIES_INSTALL_DIR}/share
-    DESTINATION ${PKG_STAGE_DIR})
-
-  install(DIRECTORY ${DEPENDENCIES_INSTALL_DIR}/include
-    DESTINATION ${PKG_STAGE_DIR}
-    PATTERN "include/OTB*" EXCLUDE )
-
-  install(DIRECTORY ${DEPENDENCIES_INSTALL_DIR}/lib/cmake
-    DESTINATION ${PKG_STAGE_DIR}/lib/
-    PATTERN "lib/cmake/OTB*" EXCLUDE)
-endfunction()
-
-
-set(WINDOWS_SYSTEM_DLLS
-  msvc.*dll
-  user32.dll
-  gdi32.dll
-  shell32.dll
-  kernel32.dll
-  ws2_32.dll
-  wldap32.dll
-  ole32.dll
-  comdlg32.dll
-  shfolder.dll
-  secur32.dll
-  wsock32.dll
-  advapi32.dll
-  crypt32.dll
-  imm32.dll
-  oleaut32.dll
-  winmm.dll
-  opengl32.dll
-  glu32.dll
-  winspool.drv)
-
-set(LINUX_SYSTEM_DLLS
-  libm.so
-  libc.so
-  libstdc*
-  libgcc_s.so
-  librt.so
-  libdl.so
-  libpthread.so
-  libidn.so
-  libgomp.so*
-  ld-linux-x86-64.so*
-  libX11.so*
-  libXext.so*
-  libXau.so*
-  libXdmcp.so*
-  libXxf86vm.so*
-  libdrm.so.2
-  libGL.so*
-  libGLU.so*
-  )
-
-# libgcc_s.*dylib and other *.framework are dragged by QT
-set(APPLE_SYSTEM_DLLS
-  libSystem.*dylib
-  libiconv.*dylib
-  libc\\+\\+.*dylib
-  libstdc.*dylib
-  libobjc.*dylib
-  ApplicationServices.framework
-  CoreFoundation.framework
-  CoreServices.framework
-  Security.framework
-  Carbon.framework
-  AppKit.framework
-  Foundation.framework
-  AGL.framework
-  OpenGL.framework
-  libgcc_s.*dylib
-  )
-
-if(WIN32 OR CMAKE_CROSSCOMPILING)
-  set(SYSTEM_DLLS "${WINDOWS_SYSTEM_DLLS}")
-else() #case for unixes
-  if(APPLE)
-    set(SYSTEM_DLLS "${APPLE_SYSTEM_DLLS}")
-  else()
-    set(SYSTEM_DLLS "${LINUX_SYSTEM_DLLS}")
-  endif()
-endif(WIN32 OR CMAKE_CROSSCOMPILING)
-
-macro(is_system_dll matched value)
-  set(${matched})
-  string(TOLOWER ${value} value_)
-  foreach (pattern ${SYSTEM_DLLS})
-    string(TOLOWER ${pattern} pattern_)
-    if("${value_}" MATCHES "${pattern_}")
-      set(${matched} TRUE)
-    endif()
-  endforeach()
-endmacro()
-
-macro(list_contains var value)
-  set(${var})
-  foreach(value2 ${ARGN})
-    if(${value} STREQUAL ${value2})
-      set(${var} TRUE)
-    endif()
-  endforeach(value2)
-endmacro()
-
-# Get the translation files coming with Qt, and install them in the bundle
-# They are loaded by Monteverdi.
-function(get_qt_translation_files RESULT)
-    # These files are the "qt_<localename>.qm" files
-    # They are located in QT_TRANSLATIONS_DIR, which comes from FindQt4
-    file(GLOB translation_files ${QT_TRANSLATIONS_DIR}/qt_*)
-
-    # We need to remove the "qt_help_<localename>.qm" files from this list
-    foreach(translation_item ${translation_files})
-      if(${translation_item} MATCHES "qt_help")
-        list(REMOVE_ITEM translation_files ${translation_item})
+    func_install_xdk_files()
+  endif()
+
+endmacro(macro_super_package)
+
+function(func_install_xdk_files)
+
+  #The list of REQ_SHARE_DIR is made up from <mxe-target-dir>/share/
+  #It may vary in future. I prefer not to glob on the share dir and
+  #end up distributing man, info etc.. which ar irrelvant for windows
+  foreach(REQ_SHARE_DIR
+      aclocal
+      Armadillo
+      applications
+      cmake
+      dbus-1
+      fontconfig
+      libgta
+      locale
+      xml
+      applications
+      cmake
+      icons
+      OpenCV
+      pixmaps
+      pkgconfig
+      )
+    if(EXISTS "${DEPENDENCIES_INSTALL_DIR}/share/${REQ_SHARE_DIR}")
+      func_install_without_message("${DEPENDENCIES_INSTALL_DIR}/share/${REQ_SHARE_DIR}" "share")
+    endif()
+  endforeach()
+
+  file(GLOB LIB_CMAKE_DIRS "${DEPENDENCIES_INSTALL_DIR}/lib/cmake/*")
+  foreach(LIB_CMAKE_DIR ${LIB_CMAKE_DIRS})
+    get_filename_component(LIB_CMAKE_DIR_name_we ${LIB_CMAKE_DIR} NAME_WE)
+    if(NOT "${LIB_CMAKE_DIR_name_we}" MATCHES "OTB")
+      func_install_without_message("${LIB_CMAKE_DIR}" "lib/cmake")
+    endif()
+  endforeach()
+
+  # #install ${DEPENDENCIES_INSTALL_DIR}/include silently
+  func_install_without_message("${DEPENDENCIES_INSTALL_DIR}/include" "" "(may take a while)..")
+
+  if(WIN32)
+    #only affects windows due to regex on dll
+    file(GLOB LIB_FILES "${DEPENDENCIES_INSTALL_DIR}/lib/*dll.*")
+    install(FILES ${LIB_FILES}    DESTINATION ${PKG_STAGE_DIR}/lib )
+
+    file(GLOB ITK_EXTRA_DLL_FILES_1 "${DEPENDENCIES_INSTALL_DIR}/bin/libITK*.dll")
+    install(FILES ${ITK_EXTRA_DLL_FILES_1} DESTINATION ${PKG_STAGE_DIR}/bin)
+
+    file(GLOB ITK_EXTRA_DLL_FILES_2 "${DEPENDENCIES_INSTALL_DIR}/bin/libitk*.dll")
+    install(FILES ${ITK_EXTRA_DLL_FILES_2} DESTINATION ${PKG_STAGE_DIR}/bin)
+
+    file(GLOB OPENCV_EXTRA_DLL_FILES "${DEPENDENCIES_INSTALL_DIR}/bin/libopencv*.dll")
+    install(FILES ${OPENCV_EXTRA_DLL_FILES} DESTINATION ${PKG_STAGE_DIR}/bin)
+
+    file(GLOB OPENCV_EXTRA_A_FILES "${DEPENDENCIES_INSTALL_DIR}/lib/libopencv*.a")
+    install(FILES ${OPENCV_EXTRA_A_FILES} DESTINATION ${PKG_STAGE_DIR}/lib)
+
+    #opencv cmake config files in two directories.
+    # ${PKG_STAGE_DIR}/lib and ${PKG_STAGE_DIR}
+    file(GLOB OPENCV_CONFIG_FILES_1 "${DEPENDENCIES_INSTALL_DIR}/lib/OpenCV*.cmake")
+    install(FILES ${OPENCV_CONFIG_FILES_1} DESTINATION ${PKG_STAGE_DIR}/lib)
+
+    file(GLOB OPENCV_CONFIG_FILES_2 "${DEPENDENCIES_INSTALL_DIR}/OpenCV*.cmake")
+    install(FILES ${OPENCV_CONFIG_FILES_2} DESTINATION ${PKG_STAGE_DIR})
+
+    #mxe install qt in a seperate directory under install prefix. So..
+    foreach(REQ_DIR
+        lib
+        mkspecs
+        include
+        imports
+        plugins
+        translations
+        )
+      if(EXISTS "${DEPENDENCIES_INSTALL_DIR}/qt/${REQ_DIR}")
+        func_install_without_message("${DEPENDENCIES_INSTALL_DIR}/qt/${REQ_DIR}" "")
       endif()
     endforeach()

-    set(${RESULT} ${translation_files} PARENT_SCOPE)
+    #qt/bin is a special case here.
+    file(GLOB QT_EXTRA_DLL_FILES "${DEPENDENCIES_INSTALL_DIR}/qt/bin/*.dll")
+    install(FILES ${QT_EXTRA_DLL_FILES} DESTINATION ${PKG_STAGE_DIR}/bin)
+
+    file(GLOB QT_EXECUTABLES "${DEPENDENCIES_INSTALL_DIR}/qt/bin/*.exe")
+    install(FILES ${QT_EXECUTABLES} DESTINATION ${PKG_STAGE_DIR}/bin)
+
+    file(GLOB QT_EXTRA_EXECUTABLES "${Monteverdi_BINARY_DIR}/PACKAGE-TOOLS/src/PACKAGE-TOOLS/*.exe")
+    install(FILES ${QT_EXTRA_EXECUTABLES} DESTINATION ${PKG_STAGE_DIR}/bin)
+
+  endif(WIN32)
+
+endfunction() #func_install_xdk_files
+
+function(func_install_without_message src_dir dst_dir_suffix)
+  set (extra_func_args ${ARGN})
+  list(LENGTH extra_func_args num_extra_args)
+  if (${num_extra_args} GREATER 0)
+    list(GET extra_func_args 0 optional_msg)
+  endif()
+
+  if( "${dst_dir_suffix}" STREQUAL "")
+    set(dst_dir "${PKG_STAGE_DIR}")
+  else()
+    set(dst_dir "${PKG_STAGE_DIR}/${dst_dir_suffix}")
+  endif()
+
+  get_filename_component(src_dir_name ${src_dir} NAME)
+  set(install_msg "message(STATUS \"Installing: ${CMAKE_INSTALL_PREFIX}/${dst_dir}/${src_dir_name} ${optional_msg}\")")
+  install(CODE "${install_msg}" )
+  install(
+    DIRECTORY   ${src_dir}
+    DESTINATION ${dst_dir}
+    MESSAGE_NEVER )
 endfunction()

-function(install_common include_mvd)
-
-  #a convenient cmake var for storing <prefix>
-#  set(PKG_STAGE_DIR "${stage_dir}")
+function(func_install_support_files include_mvd)

   #a convenient cmake var for storing <prefix>/bin
   set(PKG_STAGE_BIN_DIR "${PKG_STAGE_DIR}/bin")

-  #root folder where otb applications are installed
-  set(PKG_OTBLIBS_DIR "${PKG_STAGE_DIR}/lib/otb")
-
   #<prefix>/share for gdal data files
   set(PKG_SHARE_DEST_DIR ${PKG_STAGE_DIR}/share)

   set(PKG_SHARE_SOURCE_DIR ${DEPENDENCIES_INSTALL_DIR}/share)
-
-  if(NOT OTB_APPS_LIST)
-    message(FATAL_ERROR "you must set 'OTB_APPS_LIST' before calling this method")
-  endif()

   # Just check if required variables are defined.
   foreach(req
@@ -264,13 +265,73 @@
   endforeach(req)

   # one for debugging..
-  # install(CODE "message(\"CMake/PackageHelper.cmake:install_common(${outdir})\n${vars}\n\")")
-
-  set(PKG_OTB_SHARE_SOURCE_DIR "${PKG_SHARE_SOURCE_DIR}")
+  # install(CODE "message(\"CMake/PackageHelper.cmake:install_supoport_files(${outdir})\n${vars}\n\")")
+  if(NOT PKG_GENERATE_XDK)
+    func_install_otb_support_files()
+
+    if(include_mvd)
+      func_install_monteverdi_support_files()
+    endif(include_mvd)
+
+  endif() #NOT PKG_GENERATE_XDK
+
+  ####################### install GDAL data ############################
+  set(GDAL_DATA ${PKG_SHARE_SOURCE_DIR}/gdal)
+  if(NOT EXISTS "${GDAL_DATA}/epsg.wkt")
+    message(FATAL_ERROR "Cannot generate package without GDAL_DATA : ${GDAL_DATA} ${DEPENDENCIES_INSTALL_DIR}")
+  endif()
+
+  install(DIRECTORY ${GDAL_DATA} DESTINATION ${PKG_SHARE_DEST_DIR})
+
+  ####################### install GeoTIFF data ########################
+  install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/epsg_csv DESTINATION ${PKG_SHARE_DEST_DIR})
+
+  ####################### install OSSIM data ##########################
+  install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/ossim DESTINATION ${PKG_SHARE_DEST_DIR})
+
+  ####################### install proj share ##########################
+  if(EXISTS ${PKG_SHARE_SOURCE_DIR}/proj)
+    install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/proj DESTINATION ${PKG_SHARE_DEST_DIR})
+  endif()
+
+  ####################### Install copyrights ##########################
+  if(WIN32)
+    #do install license for windows package
+  else()
+    install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/copyright DESTINATION ${PKG_SHARE_DEST_DIR})
+    install(FILES ${PKG_SHARE_SOURCE_DIR}/copyright/LICENSE DESTINATION ${PKG_STAGE_DIR})
+  endif()
+
+endfunction()
+
+function(func_install_otb_support_files)
+  foreach(req
+      PKG_STAGE_DIR
+      OTB_INSTALL_DIR
+      MONTEVERDI_INSTALL_DIR
+      DEPENDENCIES_INSTALL_DIR
+      OTB_APPLICATIONS_DIR
+      )
+    if(NOT DEFINED ${req})
+      message(FATAL_ERROR "you must set ${req} before calling this method")
+    endif()
+    set(vars "${vars}  ${req}=[${${req}}]\n")
+  endforeach(req)
+
+  #a convenient cmake var for storing <prefix>/bin
+  set(PKG_STAGE_BIN_DIR "${PKG_STAGE_DIR}/bin")
+
+  #root folder where otb applications are installed
+  set(PKG_OTBLIBS_DIR "${PKG_STAGE_DIR}/lib/otb")
+
+  #<prefix>/share for gdal data files
+  set(PKG_SHARE_DEST_DIR ${PKG_STAGE_DIR}/share)
+
+  set(PKG_SHARE_SOURCE_DIR ${DEPENDENCIES_INSTALL_DIR}/share)

   #For Unixes we make them in the *pkgsetup.in
   ##################### install environment source ##########################
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
+  if(WIN32)
     foreach(ENV_SOURCE_FILE
         "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd"
         "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile")
@@ -278,9 +339,17 @@
         install(FILES ${ENV_SOURCE_FILE} DESTINATION ${PKG_STAGE_DIR})
       endif()
     endforeach()
-    #MONTEVERDI_INSTALL_DIR/share has otb/i18N directory
-    set(PKG_OTB_SHARE_SOURCE_DIR "${MONTEVERDI_INSTALL_DIR}/share")
-  endif()
+
+    #we need startup files for mapla monteverdi in the root directory
+    #For Unixes, we make them inside pkgsetup script!
+    foreach(exe_file mapla monteverdi)
+      install(
+        PROGRAMS ${PACKAGE_SUPPORT_FILES_DIR}/${exe_file}.bat
+        DESTINATION "${PKG_STAGE_DIR}"
+        )
+    endforeach()
+  endif()
+
   ####################### install cli and gui scripts ###########################
   file(GLOB PKG_APP_SCRIPTS
     ${OTB_INSTALL_DIR}/bin/otbcli*
@@ -294,59 +363,22 @@
   ##################### install cli and gui scripts #######################
   install(PROGRAMS ${PKG_APP_SCRIPTS}  DESTINATION ${PKG_STAGE_BIN_DIR})

-  if(include_mvd)
-    install_monteverdi_files()
-    if(NOT EXISTS "${PKG_OTB_SHARE_SOURCE_DIR}/otb/i18n")
-      message(FATAL_ERROR "error ${PKG_OTB_SHARE_SOURCE_DIR}/otb not exists")
-    endif()
-  endif()
-
-  ####################### install GDAL data ############################
-  set(GDAL_DATA ${PKG_SHARE_SOURCE_DIR}/gdal)
-  if(NOT EXISTS "${GDAL_DATA}/epsg.wkt")
-    message(FATAL_ERROR "Cannot generate package without GDAL_DATA : ${GDAL_DATA} ${DEPENDENCIES_INSTALL_DIR}")
-  endif()
-
-  install(DIRECTORY ${GDAL_DATA} DESTINATION ${PKG_SHARE_DEST_DIR})
-
-  ####################### install GeoTIFF data ########################
-  install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/epsg_csv DESTINATION ${PKG_SHARE_DEST_DIR})
-
-  ####################### install OSSIM data ##########################
-  install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/ossim DESTINATION ${PKG_SHARE_DEST_DIR})
-
-  ####################### install otb share ###########################
-  install(DIRECTORY ${PKG_OTB_SHARE_SOURCE_DIR}/otb DESTINATION ${PKG_SHARE_DEST_DIR})
-
-  ####################### install proj share ##########################
-  if(EXISTS ${PKG_SHARE_SOURCE_DIR}/proj)
-    install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/proj DESTINATION ${PKG_SHARE_DEST_DIR})
-  endif()
-
   ####################### Install otb applications ####################
   install(DIRECTORY "${OTB_APPLICATIONS_DIR}"  DESTINATION ${PKG_OTBLIBS_DIR})

-  ####################### Install copyrights ##########################
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
-    #do install license for windows package
-  else()
-    install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/copyright DESTINATION ${PKG_SHARE_DEST_DIR})
-    install(FILES ${PKG_SHARE_SOURCE_DIR}/copyright/LICENSE DESTINATION ${PKG_STAGE_DIR})
-  endif()
-
 endfunction()

-function(install_monteverdi_files)
+function(func_install_monteverdi_support_files)

   #name/ext of qt's sqlite plugin. Varies with platform/OS
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
+  if(WIN32)
     set(PKG_QTSQLITE_FILENAME "qsqlite4.dll")
   elseif(APPLE)
     set(PKG_QTSQLITE_FILENAME "libqsqlite.dylib")
-  elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND NOT CMAKE_CROSSCOMPILING)
+  elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     set(PKG_QTSQLITE_FILENAME "libqsqlite.so")
   else()
-    message(FATAL_ERROR "install_monteverdi_files: Unknown OS/Platform")
+    message(FATAL_ERROR "func_install_monteverdi_support_files: Unknown OS/Platform")
   endif()

   #root folder where qt plugins are installed
@@ -384,7 +416,7 @@
       DESTINATION ${PKG_STAGE_DIR})
   endif()

-  if(WIN32 OR CMAKE_CROSSCOMPILING)
+  if(WIN32)
     ####################### install mingw qt.conf ##########################
     if(EXISTS ${PACKAGE_SUPPORT_FILES_DIR}/qt.conf)
       install(FILES ${PACKAGE_SUPPORT_FILES_DIR}/qt.conf
@@ -408,39 +440,51 @@
   foreach(APP_TS_FILE ${APP_TS_FILES})
     get_filename_component(APP_TS_FILENAME ${APP_TS_FILE} NAME_WE)
     install(FILES ${Monteverdi_BINARY_DIR}/i18n/${APP_TS_FILENAME}.qm
-      DESTINATION ${PKG_OTB_I18N_DIR})
-  endforeach()
+      DESTINATION ${PKG_OTB_I18N_DIR}
+      )
+  endforeach()
+
+  #set(PKG_OTB_ccSHARE_SOURCE_DIR "${MONTEVERDI_INSTALL_DIR}")
+  # if(WIN32)
+  #   set(PKG_OTB_ccSHARE_SOURCE_DIR "${MONTEVERDI_INSTALL_DIR}/share")
+  # endif()
+  if(NOT EXISTS "${MONTEVERDI_INSTALL_DIR}/share/otb/i18n")
+    message(FATAL_ERROR "error ${MONTEVERDI_INSTALL_DIR}/share/otb/i18n not exists")
+  endif()
+  ####################### install otb share ###########################
+  install(DIRECTORY ${MONTEVERDI_INSTALL_DIR}/share/otb DESTINATION ${PKG_SHARE_DEST_DIR})

 endfunction()

-macro(empty_package_staging_directory)
+macro(macro_empty_package_staging_directory)
   message(STATUS "Empty package staging directory: ${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
   execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_INSTALL_PREFIX}/${PKG_STAGE_DIR}")
-endmacro()
+endmacro() #macro_empty_package_staging_directory

 #NOTE:
 # VAR_IN_PKGSETUP_CONFIGURE cmake variable is set below.
 # This is important and useful running configure_file()
 # over *pkgsetup.in

-function(configure_package)
-
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
+function(func_prepare_package)
+
+  set(DEST_LIB_DIR lib)
+  set(DEST_BIN_DIR bin)
+  set(DEST_APP_DIR lib/otb/applications)
+  set(EXE_EXT "")
+  set(SCR_EXT ".sh")
+  set(LIB_EXT "*so")
+  if(WIN32)
     set(EXE_EXT ".exe")
     set(LIB_EXT "*dll")
     set(SCR_EXT ".bat")
-  else() #(WIN32 OR CMAKE_CROSSCOMPILING)
-    if(UNIX)
-      set(EXE_EXT "")
-      set(SCR_EXT ".sh")
-      set(LIB_EXT "*so")
-      #Q: why apple changed this one?
-      #A: To break compatibility with others and make money!
-      if(APPLE)
-        set(LIB_EXT "*dylib")
-      endif() #APPLE
-    endif() #UNIX
-  endif() #(WIN32 OR CMAKE_CROSSCOMPILING)
+    set(DEST_LIB_DIR bin)
+  elseif(APPLE)
+    set(LIB_EXT "*dylib")
+  endif()
+
+  file(WRITE ${CMAKE_BINARY_DIR}/install_to_bin "")
+  file(WRITE ${CMAKE_BINARY_DIR}/install_to_lib "")

   #This must exist in any OTB Installation minimal or full
   set(VAR_IN_PKGSETUP_CONFIGURE "bin/otbApplicationLauncherCommandLine")
@@ -453,6 +497,16 @@
   list(APPEND EXE_FILES "otbApplicationLauncherQt")
   list(APPEND EXE_FILES "iceViewer")
   list(APPEND EXE_FILES "otbTestDriver")
+
+  #Q: why we need itkTestDriver?.
+  #A: Because we need to get all dlls from ITK via itkTestDriver linkage.
+  # itkvnl and itkvnl_algo are referenced in its lib/cmake/ITK-4.8/ITKTargets.cmake
+  # But OTB didn't use them and hence not counted. However an erro has been observed when
+  # using XDK on windows that the file is missing or damaged
+  if(PKG_GENERATE_XDK)
+    list(APPEND EXE_FILES "itkTestDriver")
+  endif()
+
   list(APPEND EXE_FILES "monteverdi")
   list(APPEND EXE_FILES "mapla")

@@ -477,21 +531,10 @@
     endif()
   endforeach()

-  #For Unixes we write the startup script in the *pkgsetup.in
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
-    install(
-      PROGRAMS "${PACKAGE_SUPPORT_FILES_DIR}/monteverdi.bat"
-      DESTINATION "${PKG_STAGE_DIR}"
-      )
-    install(
-      PROGRAMS "${PACKAGE_SUPPORT_FILES_DIR}/mapla.bat"
-      DESTINATION "${PKG_STAGE_DIR}"
-      )
-  endif(WIN32 OR CMAKE_CROSSCOMPILING)
-
   file(GLOB OTB_APPS_LIST ${OTB_APPLICATIONS_DIR}/otbapp_${LIB_EXT}) # /lib/otb

   #see the first comment about VAR_IN_PKGSETUP_CONFIGURE
+  #NOTE: this is not used in windows yet..
   foreach(OTB_APP_SO ${OTB_APPS_LIST})
     get_filename_component(OTB_APP_SO_NAME ${OTB_APP_SO} NAME)
     set(VAR_IN_PKGSETUP_CONFIGURE "${VAR_IN_PKGSETUP_CONFIGURE} lib/otb/applications/${OTB_APP_SO_NAME}")
@@ -504,17 +547,19 @@

   list(APPEND PKG_PEFILES ${OTB_APPS_LIST})

-  install_common(${include_mvd})
+  func_install_support_files(${include_mvd})

   execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/temp_so_names_dir")
   execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/temp_so_names_dir")

   set(alldlls)
   set(notfound_dlls)
+  #message(STATUS "Processing start")
   foreach(infile ${PKG_PEFILES})
     get_filename_component(bn ${infile} NAME)
-    process_deps(${bn})
-  endforeach()
+    func_process_deps(${bn})
+  endforeach()
+  #message(STATUS "Processing done")

   list(LENGTH notfound_dlls nos)
   if(${nos} GREATER 0)
@@ -534,11 +579,123 @@

   set(VAR_IN_PKGSETUP_CONFIGURE "${VAR_IN_PKGSETUP_CONFIGURE}" PARENT_SCOPE)

+endfunction() #func_prepare_package
+
+function(func_process_deps infile)
+
+  if(APPLE)
+    if( "${infile}" MATCHES "@rpath")
+      string(REGEX REPLACE "@rpath." "" infile "${infile}")
+    endif()
+  endif()
+  if(WIN32)
+    string(TOLOWER "${infile}" infile_lower )
+  endif()
+  get_filename_component(bn ${infile} NAME)
+
+  list_contains(contains "${bn}" "${alldlls}")
+  if(NOT contains)
+    set(DLL_FOUND FALSE)
+
+    foreach(SEARCHDIR ${PKG_SEARCHDIRS})
+      if(NOT DLL_FOUND)
+        if(WIN32)
+          if(NOT EXISTS ${SEARCHDIR}/${infile} )
+            if(EXISTS ${SEARCHDIR}/${infile_lower} )
+              set(infile ${infile_lower})
+            endif()
+          endif()
+        endif()
+        if(EXISTS ${SEARCHDIR}/${infile})
+          set(DLL_FOUND TRUE)
+          message(STATUS "Processing ${SEARCHDIR}/${infile}")
+          is_file_executable("${SEARCHDIR}/${infile}" is_executable)
+          if(is_executable)
+            #install(PROGRAMS "${SEARCHDIR}/${infile}" DESTINATION ${PKG_STAGE_DIR}/bin)
+            file(APPEND ${CMAKE_BINARY_DIR}/install_to_${DEST_BIN_DIR} "${SEARCHDIR}/${infile}\n")
+          else(is_executable)
+            get_filename_component(bn_we ${infile} NAME_WE)
+            file(GLOB sofiles "${SEARCHDIR}/${bn_we}*")
+            foreach(sofile ${sofiles})
+              get_filename_component(sofile_ext ${sofile} EXT)
+              set(is_valid TRUE)
+              if ("${sofile_ext}" MATCHES ".la"
+                  OR "${sofile_ext}" MATCHES ".prl"
+                  OR "${sofile_ext}" MATCHES ".a")
+                set(is_valid FALSE)
+              endif()
+              if(is_valid)
+                get_filename_component(basename_of_sofile ${sofile} NAME)
+                func_is_file_a_symbolic_link("${sofile}" is_symlink linked_to_file)
+                if(is_symlink)
+                  # NOTE: $OUT_DIR is set actually in pkgsetup.in. So don't try
+                  # any pre-mature optimization on that variable names
+                  file(APPEND
+                    ${CMAKE_BINARY_DIR}/make_symlinks
+                    "ln -sf $OUT_DIR/lib/${linked_to_file} $OUT_DIR/lib/${basename_of_sofile}\n"
+                    )
+                  #message("${sofile} is a symlink to ${linked_to_file}")
+                else() # is_symlink
+                  if(NOT "${basename_of_sofile}" MATCHES "otbapp_")
+                    file(APPEND ${CMAKE_BINARY_DIR}/install_to_${DEST_LIB_DIR} "${sofile}\n")
+                    #just install the so file to <staging-dir>/lib
+                    #install(FILES "${sofile}" DESTINATION ${PKG_STAGE_DIR}/lib MESSAGE_NEVER)
+                    # Finally touch a file in temp directory for globbing later
+                    # message("touching ${basename_of_sofile}")
+                    execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/temp_so_names_dir/${basename_of_sofile}")
+                  endif() #if(.. MATCHES "otbapp_")
+                endif() #is_symlink
+              endif() #is_valid
+            endforeach()
+          endif(is_executable)
+          execute_process(
+            COMMAND ${LOADER_PROGRAM} ${LOADER_PROGRAM_ARGS} "${SEARCHDIR}/${infile}"
+            RESULT_VARIABLE loader_rv
+            OUTPUT_VARIABLE loader_ov
+            ERROR_VARIABLE loader_ev
+            )
+          if(loader_rv)
+            message(FATAL_ERROR "loader_ev=${loader_ev}\n PACKAGE-OTB: result_variable is '${loader_rv}'")
+          endif()
+
+          if(WIN32)
+            string(REGEX MATCHALL "DLL.Name..[A-Za-z(0-9\\.0-9)+_\\-]*" loader_ov "${loader_ov}")
+            string(REGEX REPLACE "DLL.Name.." "" needed_dlls "${loader_ov}")
+          else()  #case for unixes
+            if(APPLE)
+              string(REGEX REPLACE "[^\n]+cmd LC_LOAD_DYLIB\n[^\n]+\n[^\n]+name ([^\n]+).\\(offset[^\n]+\n" "rpath \\1\n" loader_ov "${loader_ov}")
+              string(REGEX MATCHALL "rpath [^\n]+" loader_ov "${loader_ov}")
+              string(REGEX REPLACE "rpath " "" needed_dlls "${loader_ov}")
+            else(APPLE)
+              string(REGEX MATCHALL "NEEDED\\ *[A-Za-z(0-9\\.0-9)+_\\-]*" loader_ov "${loader_ov}")
+              string(REGEX REPLACE "NEEDED" "" needed_dlls "${loader_ov}")
+            endif(APPLE)
+          endif()
+
+          foreach(needed_dll ${needed_dlls})
+            string(STRIP ${needed_dll} needed_dll)
+            func_process_deps(${needed_dll})
+          endforeach()
+        endif()
+      endif(NOT DLL_FOUND)
+    endforeach()
+
+    if(NOT DLL_FOUND)
+      is_system_dll(iss "${infile}")
+      if(NOT iss)
+        set(notfound_dlls "${notfound_dlls};${infile}")
+      endif()
+    else(NOT DLL_FOUND)
+      set( alldlls "${alldlls};${bn}" PARENT_SCOPE )
+    endif(NOT DLL_FOUND)
+    set(notfound_dlls "${notfound_dlls}" PARENT_SCOPE )
+  endif()
+
 endfunction()

 # The below function is modified from GetPrerequisities.cmake
 # which is distributed with CMake.
-function(is_file_a_symbolic_link file result_var1 result_var2)
+function(func_is_file_a_symbolic_link file result_var1 result_var2)
   #
   # A file is not executable until proven otherwise:
   #
@@ -629,127 +786,144 @@
 endfunction()

-
-function(process_deps infile)
-
+#function to prepare list of install files to bin and lib directory
+#input_file is written by func_process_deps() macro
+#with_xdk is flag to indicate wheather we are build xdk or not.
+#Its value is same as PKG_GENERATE_XDK
+# install_list_variable -output variable that store the final list
+# This list is looped and all install() command are created there.
+function(func_prepare_install_list input_file with_xdk install_list_variable )
+  #message("-- input_file = '${input_file}'")
+  set(install_to_ITEMS)
+  file(STRINGS "${input_file}" install_to_ITEMS)
+  foreach(install_to_ITEM ${install_to_ITEMS})
+    get_filename_component(install_to_ITEM_BASENAME ${install_to_ITEM} NAME_WE)
+    #MUST remove otb applications. Installed in other macro later
+    if ("${install_to_ITEM_BASENAME}" MATCHES "otbapp_*")
+      list(REMOVE_ITEM install_to_ITEMS "${install_to_ITEM}")
+    endif()
+
+    if(with_xdk)
+      if ("${install_to_ITEM_BASENAME}"
+          MATCHES
+          "libOTB|libotb|otbApp|otbTest|libMonteverdi|monteverdi|mapla|iceViewer"
+          )
+        list(REMOVE_ITEM install_to_ITEMS "${install_to_ITEM}")
+      endif()
+    endif() #with_xdk
+  endforeach()
+
+  set(${install_list_variable} "${install_to_ITEMS}" PARENT_SCOPE)
+
+endfunction() # func_prepare_install_list
+
+
+set(WINDOWS_SYSTEM_DLLS
+  msvc.*dll
+  user32.dll
+  gdi32.dll
+  shell32.dll
+  kernel32.dll
+  ws2_32.dll
+  wldap32.dll
+  ole32.dll
+  comdlg32.dll
+  shfolder.dll
+  secur32.dll
+  wsock32.dll
+  advapi32.dll
+  crypt32.dll
+  imm32.dll
+  oleaut32.dll
+  winmm.dll
+  opengl32.dll
+  glu32.dll
+  rpcrt4.dll
+  winspool.drv)
+
+set(LINUX_SYSTEM_DLLS
+  libm.so
+  libc.so
+  libstdc*
+  libgcc_s.so
+  librt.so
+  libdl.so
+  libpthread.so
+  libidn.so
+  libgomp.so*
+  ld-linux-x86-64.so*
+  libX11.so*
+  libXext.so*
+  libXau.so*
+  libXdmcp.so*
+  libXxf86vm.so*
+  libdrm.so.2
+  libGL.so*
+  libGLU.so*
+  )
+
+# libgcc_s.*dylib and other *.framework are dragged by QT
+set(APPLE_SYSTEM_DLLS
+  libSystem.*dylib
+  libiconv.*dylib
+  libc\\+\\+.*dylib
+  libstdc.*dylib
+  libobjc.*dylib
+  ApplicationServices.framework
+  CoreFoundation.framework
+  CoreServices.framework
+  Security.framework
+  Carbon.framework
+  AppKit.framework
+  Foundation.framework
+  AGL.framework
+  OpenGL.framework
+  libgcc_s.*dylib
+  )
+
+if(WIN32)
+  set(SYSTEM_DLLS "${WINDOWS_SYSTEM_DLLS}")
+else() #case for unixes
   if(APPLE)
-    if( "${infile}" MATCHES "@rpath")
-      string(REGEX REPLACE "@rpath." "" infile "${infile}")
-    endif()
-  endif()
-  if(WIN32 OR CMAKE_CROSSCOMPILING)
-    string(TOLOWER "${infile}" infile_lower )
-  endif()
-  get_filename_component(bn ${infile} NAME)
-
-  list_contains(contains "${bn}" "${alldlls}")
-  if(NOT contains)
-    set(DLL_FOUND FALSE)
-
-    foreach(SEARCHDIR ${PKG_SEARCHDIRS})
-      if(NOT DLL_FOUND)
-        if(WIN32 OR CMAKE_CROSSCOMPILING)
-          if(NOT EXISTS ${SEARCHDIR}/${infile} )
-            if(EXISTS ${SEARCHDIR}/${infile_lower} )
-              set(infile ${infile_lower})
-            endif()
-          endif()
-        endif()
-        if(EXISTS ${SEARCHDIR}/${infile})
-          set(DLL_FOUND TRUE)
-          message(STATUS "Processing ${SEARCHDIR}/${infile}")
-          is_file_executable("${SEARCHDIR}/${infile}" is_executable)
-          if(is_executable)
-              install(PROGRAMS "${SEARCHDIR}/${infile}"
-                DESTINATION ${PKG_STAGE_DIR}/bin)
-          else(is_executable)
-            get_filename_component(bn_we ${infile} NAME_WE)
-            file(GLOB sofiles "${SEARCHDIR}/${bn_we}*")
-            foreach(sofile ${sofiles})
-              get_filename_component(sofile_ext ${sofile} EXT)
-              set(is_valid TRUE)
-              if ("${sofile_ext}" MATCHES ".la"
-                  OR "${sofile_ext}" MATCHES ".prl"
-                  OR "${sofile_ext}" MATCHES ".a")
-                set(is_valid FALSE)
-              endif()
-
-              if(is_valid)
-                get_filename_component(basename_of_sofile ${sofile} NAME)
-                is_file_a_symbolic_link("${sofile}" is_symlink linked_to_file)
-                if(is_symlink)
-                  # NOTE: $OUT_DIR is set actually in pkgsetup.in. So don't try
-                  # any pre-mature optimization on that variable names
-                  file(APPEND
-                    ${CMAKE_BINARY_DIR}/make_symlinks
-                    "ln -sf $OUT_DIR/lib/${linked_to_file} $OUT_DIR/lib/${basename_of_sofile}\n"
-                    )
-                  #message("${sofile} is a symlink to ${linked_to_file}")
-                else() # is_symlink
-                  if("${basename_of_sofile}" MATCHES "otbapp_")
-                    if(NOT PKG_GENERATE_XDK)
-                      install(FILES "${sofile}" DESTINATION ${PKG_STAGE_DIR}/lib/otb/applications)
-                    endif()
-                  else() #if(.. MATCHES "otbapp_")
-                    #if we are making xdk. skill all those starting with libotb case insensitively
-                    if(PKG_GENERATE_XDK)
-                      string(TOLOWER "${basename_of_sofile}" sofile_lower )
-                      if(NOT "${sofile_lower}" MATCHES "libotb")
-                        install(FILES "${sofile}" DESTINATION ${PKG_STAGE_DIR}/lib)
-                      endif()
-                    else() #PKG_GENERATE_XDK
-                      #just install the so file to <staging-dir>/lib
-                      install(FILES "${sofile}" DESTINATION ${PKG_STAGE_DIR}/lib)
-                    endif() #PKG_GENERATE_XDK
-
-                    # Finally touch a file in temp directory for globbing later
-                    # message("touching ${basename_of_sofile}")
-                    execute_process(COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_BINARY_DIR}/temp_so_names_dir/${basename_of_sofile}")
-                  endif() #if(.. MATCHES "otbapp_")
-                endif() #is_symlink
-              endif() #is_valid
-            endforeach()
-          endif(is_executable)
-          execute_process(
-            COMMAND ${LOADER_PROGRAM} ${LOADER_PROGRAM_ARGS} "${SEARCHDIR}/${infile}"
-            RESULT_VARIABLE loader_rv
-            OUTPUT_VARIABLE loader_ov
-            ERROR_VARIABLE loader_ev
-            )
-          if(loader_rv)
-            message(FATAL_ERROR "loader_ev=${loader_ev}\n PACKAGE-OTB: result_variable is '${loader_rv}'")
-          endif()
-
-          if(WIN32 OR CMAKE_CROSSCOMPILING)
-            string(REGEX MATCHALL "DLL.Name..[A-Za-z(0-9\\.0-9)+_\\-]*" loader_ov "${loader_ov}")
-            string(REGEX REPLACE "DLL.Name.." "" needed_dlls "${loader_ov}")
-          else()  #case for unixes
-            if(APPLE)
-              string(REGEX REPLACE "[^\n]+cmd LC_LOAD_DYLIB\n[^\n]+\n[^\n]+name ([^\n]+).\\(offset[^\n]+\n" "rpath \\1\n" loader_ov "${loader_ov}")
-              string(REGEX MATCHALL "rpath [^\n]+" loader_ov "${loader_ov}")
-              string(REGEX REPLACE "rpath " "" needed_dlls "${loader_ov}")
-            else(APPLE)
-              string(REGEX MATCHALL "NEEDED\\ *[A-Za-z(0-9\\.0-9)+_\\-]*" loader_ov "${loader_ov}")
-              string(REGEX REPLACE "NEEDED" "" needed_dlls "${loader_ov}")
-            endif(APPLE)
-          endif()
-
-          foreach(needed_dll ${needed_dlls})
-            string(STRIP ${needed_dll} needed_dll)
-            process_deps(${needed_dll})
-          endforeach()
-        endif()
-      endif(NOT DLL_FOUND)
+    set(SYSTEM_DLLS "${APPLE_SYSTEM_DLLS}")
+  else()
+    set(SYSTEM_DLLS "${LINUX_SYSTEM_DLLS}")
+  endif()
+endif(WIN32)
+
+macro(is_system_dll matched value)
+  set(${matched})
+  string(TOLOWER ${value} value_)
+  foreach (pattern ${SYSTEM_DLLS})
+    string(TOLOWER ${pattern} pattern_)
+    if("${value_}" MATCHES "${pattern_}")
+      set(${matched} TRUE)
+    endif()
+  endforeach()
+endmacro()
+
+macro(list_contains var value)
+  set(${var})
+  foreach(value2 ${ARGN})
+    if(${value} STREQUAL ${value2})
+      set(${var} TRUE)
+    endif()
+  endforeach(value2)
+endmacro()
+
+# Get the translation files coming with Qt, and install them in the bundle
+# They are loaded by Monteverdi.
+function(get_qt_translation_files RESULT)
+    # These files are the "qt_<localename>.qm" files
+    # They are located in QT_TRANSLATIONS_DIR, which comes from FindQt4
+    file(GLOB translation_files ${QT_TRANSLATIONS_DIR}/qt_*)
+
+    # We need to remove the "qt_help_<localename>.qm" files from this list
+    foreach(translation_item ${translation_files})
+      if(${translation_item} MATCHES "qt_help")
+        list(REMOVE_ITEM translation_files ${translation_item})
+      endif()
     endforeach()

-    if(NOT DLL_FOUND)
-      is_system_dll(iss "${infile}")
-      if(NOT iss)
-        set(notfound_dlls "${notfound_dlls};${infile}")
-      endif()
-    else(NOT DLL_FOUND)
-      set( alldlls "${alldlls};${bn}" PARENT_SCOPE )
-    endif(NOT DLL_FOUND)
-    set(notfound_dlls "${notfound_dlls}" PARENT_SCOPE )
-  endif()
+    set(${RESULT} ${translation_files} PARENT_SCOPE)
 endfunction()


Cloned libpng to UniStuttgart for better availability; added missing dependency for libpng

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -102,8 +102,9 @@
     endif()
     ExternalProject_Get_Property(zlib_ext INSTALL_DIR)
     add_external_project(libpng_ext
-      GIT_REPOSITORY https://git.code.sf.net/p/libpng/code
+      GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/libpng.git
       GIT_TAG "v1.6.34"
+      DEPENDS zlib_ext
       BUILD_BYPRODUCTS "<INSTALL_DIR>/${LIBPNG_DEBUG}" "<INSTALL_DIR>/${LIBPNG_RELEASE}"
       CMAKE_ARGS
         -DPNG_SHARED=OFF


dont add -mt to static version - debhelper/pbuilder will fail otherwise

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -300,7 +300,7 @@
 SET(LIBS ${PYTHONLIBS})

 IF(BOOST_LINK_STATIC)
-	SET(LIBS ${LIBS} /usr/lib/libboost_filesystem-mt.a /usr/lib/libboost_signals-mt.a /usr/lib/libboost_system-mt.a)
+	SET(LIBS ${LIBS} /usr/lib/libboost_filesystem.a /usr/lib/libboost_signals.a /usr/lib/libboost_system.a)
 ELSE(BOOST_LINK_STATIC)
 	SET(LIBS ${LIBS} boost_filesystem-mt boost_signals-mt)
 ENDIF(BOOST_LINK_STATIC)


BUG: mantis-1336

BUG: mantis-1336

--- SuperBuild/Packaging/InstallSupportFiles.cmake
+++ SuperBuild/Packaging/InstallSupportFiles.cmake
@@ -227,14 +227,18 @@
   set(PKG_SHARE_SOURCE_DIR ${DEPENDENCIES_INSTALL_DIR}/share)

   #For Unixes we make them in the *pkgsetup.in
-  ##################### install environment source ##########################
+  ##################### install environment setup file ##########################
   if(WIN32)
-    foreach(ENV_SOURCE_FILE
-        "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd"
-        "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile")
-      if(EXISTS ${ENV_SOURCE_FILE})
-        install(FILES ${ENV_SOURCE_FILE} DESTINATION ${PKG_STAGE_DIR})
-      endif()
+    install(
+      FILES ${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd
+      DESTINATION ${PKG_STAGE_DIR}
+      )
+
+    install(
+      FILES ${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile
+      DESTINATION ${PKG_STAGE_DIR}
+      RENAME otbenv.sh)
+    )
     endforeach()

     #we need startup files for mapla monteverdi in the root directory


[CMake] [darwin] [builtins] Match clang_darwin.mk's compiler flags when building builtin libraries

On Darwin we have a very restrictive set of flags used when building the builtins. This change makes CMake match autoconf.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@248523 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -187,6 +187,18 @@
 # Generates builtin libraries for all operating systems specified in ARGN. Each
 # OS library is constructed by lipo-ing together single-architecture libraries.
 macro(darwin_add_builtin_libraries)
+  if(CMAKE_CONFIGURATION_TYPES)
+    foreach(type ${CMAKE_CONFIGURATION_TYPES})
+      set(CMAKE_C_FLAGS_${type} -O3)
+      set(CMAKE_CXX_FLAGS_${type} -O3)
+    endforeach()
+  else()
+    set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} -O3)
+  endif()
+
+  set(CMAKE_C_FLAGS "-fPIC -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer")
+  set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS})
+  set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS})
   foreach (os ${ARGN})
     list_union(DARWIN_BUILTIN_ARCHS DARWIN_${os}_ARCHS BUILTIN_SUPPORTED_ARCH)
     foreach (arch ${DARWIN_BUILTIN_ARCHS})
@@ -195,7 +207,7 @@
                               OS ${os}
                               ARCH ${arch}
                               SOURCES ${${arch}_SOURCES}
-                              CFLAGS "-std=c99" -arch ${arch} -mkernel -Wno-pedantic
+                              CFLAGS -arch ${arch} -mkernel
                               DEFS KERNEL_USE
                               PARENT_TARGET builtins)

@@ -220,7 +232,7 @@
                               OS ${os}
                               ARCH ${arch}
                               SOURCES ${${arch}_SOURCES}
-                              CFLAGS "-std=c99" -arch ${arch}
+                              CFLAGS -arch ${arch}
                               PARENT_TARGET builtins)
     endforeach()


Remove RESET as argument

Remove RESET as argument

--- cmake/Modules/SafeCheckSymbolExists.cmake
+++ cmake/Modules/SafeCheckSymbolExists.cmake
@@ -20,11 +20,13 @@
 			CMAKE_C_FLAGS
 			${CMAKE_C_FLAGS})

+	cmake_push_check_state ()
 	get_directory_property (DEFS COMPILE_DEFINITIONS)
 	prepend (DEFS "-D" ${DEFS})
 	list (APPEND CMAKE_REQUIRED_DEFINITIONS
 		     ${DEFS})

+	cmake_pop_check_state ()
 	check_symbol_exists ("${SYMBOL}" "${FILES}" "${VARIABLE}")

 	set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS_OLD})


[cmake] remove unnecessary lib

[cmake] remove unnecessary lib

--- cmake/modules/DuneMultiscaleMacros.cmake
+++ cmake/modules/DuneMultiscaleMacros.cmake
@@ -25,7 +25,7 @@
 	set(COMMON_LIBS ${COMMON_LIBS} fftw3_mpi ${FFTW_LIBRARIES})
 endif(FFTW_FOUND)

-set( MULTISCALE_LIBS multiscale_common multiscale_cgfem multiscale_msfem multiscale_problem multiscale_common ${DUNE_DEFAULT_LIBS} ${COMMON_LIBS} ${DUNE_UMFPACK_LIBRARIES} ${TBB_LIBRARIES})
+set( MULTISCALE_LIBS multiscale_common multiscale_cgfem multiscale_msfem multiscale_problem multiscale_common ${DUNE_DEFAULT_LIBS} ${COMMON_LIBS} ${DUNE_UMFPACK_LIBRARIES} )

 set(GRIDDIM 3 CACHE STRING "")
 set(USE_ISTL_BACKEND 1 CACHE BOOLEAN "use dune-istl as the la-backend. Disable to use Eigen3 instead.")


BUG: fix OpenThreads internal Find module

--- CMake/FindOpenThreads.cmake
+++ CMake/FindOpenThreads.cmake
@@ -121,6 +121,6 @@
     set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
 endif()

-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG
     OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)


Fixed for recent changes in homebrew on Mac

--- CMakeModules/FindGLUI.cmake
+++ CMakeModules/FindGLUI.cmake
@@ -2,7 +2,7 @@
 # Requires OpenGL and GLUT - searches for them using find_package
 # Once done, this will define
 #
-#	GLUI_INCLUDE_DIR, where to find GL/glui.h (or GLUI/glui.h on mac)
+#	GLUI_INCLUDE_DIR, where to find GL/glui.h
 #	GLUI_LIBRARY, the libraries to link against
 #	GLUI_FOUND, If false, do not try to use GLUI.
 #
@@ -79,7 +79,7 @@

 		if(APPLE)
 			find_path(GLUI_INCLUDE_DIR
-				GLUI/glui.h
+				GL/glui.h
 				HINTS
 				${OPENGL_INCLUDE_DIR}
 				DOC


Remove superfulous line

Remove superfulous line

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -305,7 +305,7 @@
   add_dependencies("${NAME}-lv2" lv2_ttl_generator)

   add_custom_command(TARGET "${NAME}-lv2" POST_BUILD
-    COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR}
+    COMMAND
     "$<TARGET_FILE:lv2_ttl_generator>"
     "$<TARGET_FILE:${NAME}-lv2>"
     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.lv2"