fixed eol

fixed eol

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -1,432 +1,432 @@
-include(GNUInstallDirs)
-
-# install the visual studio runtime:
-if (MSVC)
-  include(InstallRequiredSystemLibraries)
-  INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT Libraries)
-endif()
-
-# etc -------------------------------
-set(ETCDIR "" CACHE path "System configuration directory (defaults to prefix/etc)")
-
-# /etc -------------------------------
-if (ETCDIR STREQUAL "")
-  set(ETCDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/etc/arangodb3")
-  set(ETCDIR_INSTALL "etc/arangodb3")
-else ()
-  set(ETCDIR_NATIVE "${ETCDIR}/arangodb3")
-  set(ETCDIR_INSTALL "${ETCDIR}/arangodb3")
-endif ()
-
-# MS stuff ---------------------------
-if (MSVC)
-  file(TO_NATIVE_PATH "${ETCDIR_INSTALL}" ETCDIR_INSTALL)
-  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_INSTALL}")
-else ()
-  file(TO_NATIVE_PATH "${ETCDIR_NATIVE}" ETCDIR_NATIVE)
-  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_NATIVE}")
-endif ()
-
-add_definitions("-D_SYSCONFDIR_=\"${ETCDIR_ESCAPED}\"")
-
-# /var
-set(VARDIR ""
-  CACHE path
-  "System configuration directory (defaults to prefix/var/arangodb3)"
-)
-
-if (VARDIR STREQUAL "")
-  set(VARDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/var")
-  set(VARDIR_INSTALL "var")
-else ()
-  set(VARDIR_NATIVE "${VARDIR}")
-  set(VARDIR_INSTALL "${VARDIR}")
-endif ()
-
-file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
-
-# database directory
-FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb3")
-
-# apps
-FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb3-apps")
-
-# logs
-FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/arangodb")
-
-# package
-set(TRI_PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/arangodb3")
-
-# resources
-set(TRI_RESOURCEDIR "resources")
-
-# sbinaries
-if (MSVC)
-  set(ARANGODB_INSTALL_SBIN "bin")
-  set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/bin")
-else ()
-  set(ARANGODB_INSTALL_SBIN "sbin")
-  set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
-endif ()
-
-# MS Windows -------------------------------------------------------------------
-if (MSVC)
-  # icon paths
-  file(TO_NATIVE_PATH
-    "${TRI_RESOURCEDIR}/Icons/arangodb.ico"
-    RELATIVE_ARANGO_ICON
-  )
-
-  file(TO_NATIVE_PATH
-    "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.bmp"
-    ARANGO_IMG
-  )
-
-  file(TO_NATIVE_PATH
-    "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.ico"
-    ARANGO_ICON
-  )
-
-  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_IMG "${ARANGO_IMG}")
-  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_ICON "${ARANGO_ICON}")
-  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" RELATIVE_ARANGO_ICON "${RELATIVE_ARANGO_ICON}")
-
-  # versioning
-  set(CMAKE_MODULE_PATH
-    ${CMAKE_MODULE_PATH}
-    ${PROJECT_SOURCE_DIR}/Installation/Windows/version
-  )
-
-  include("${PROJECT_SOURCE_DIR}/Installation/Windows/version/generate_product_version.cmake")
-endif ()
-
-################################################################################
-## INSTALL
-################################################################################
-
-# Global macros ----------------------------------------------------------------
-macro (generate_root_config name)
-  FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb3/${name}.conf.in FileContent)
-  STRING(REPLACE "@PKGDATADIR@" "@ROOTDIR@/share/arangodb3"
-    FileContent "${FileContent}")
-  STRING(REPLACE "@LOCALSTATEDIR@" "@ROOTDIR@/var"
-    FileContent "${FileContent}")
-  STRING(REPLACE "@SBINDIR@" "@ROOTDIR@/bin"
-    FileContent "${FileContent}")
-  STRING(REPLACE "@LIBEXECDIR@/arangodb3" "@ROOTDIR@/bin"
-    FileContent "${FileContent}")
-  STRING(REPLACE "@SYSCONFDIR@" "@ROOTDIR@/etc/arangodb3"
-    FileContent "${FileContent}")
-  if (MSVC)
-    STRING(REPLACE "@PROGRAM_SUFFIX@" ".exe"
-      FileContent "${FileContent}")
-    STRING(REGEX REPLACE "[\r\n]file =" "\n# file ="
-      FileContent "${FileContent}")
-  endif ()
-  FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb3/${name}.conf "${FileContent}")
-endmacro ()
-
-#  generates config file using the configured paths ----------------------------
-macro (generate_path_config name)
-  FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb3/${name}.conf.in FileContent)
-  STRING(REPLACE "@PKGDATADIR@" "${TRI_PKGDATADIR}"
-    FileContent "${FileContent}")
-  STRING(REPLACE "@LOCALSTATEDIR@" "${VARDIR_NATIVE}"
-    FileContent "${FileContent}")
-  FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb3/${name}.conf "${FileContent}")
-endmacro ()
-
-# installs a config file -------------------------------------------------------
-macro (install_config name)
-  if (MSVC OR (DARWIN AND NOT HOMEBREW))
-    generate_root_config(${name})
-  else ()
-    generate_path_config(${name})
-  endif ()
-  install(
-    FILES ${PROJECT_BINARY_DIR}/etc/arangodb3/${name}.conf
-    DESTINATION ${ETCDIR_INSTALL})
-endmacro ()
-
-# installs a readme file converting EOL ----------------------------------------
-macro (install_readme input where output)
-  FILE(READ ${PROJECT_SOURCE_DIR}/${input} FileContent)
-  STRING(REPLACE "\r" "" FileContent "${FileContent}")
-  if (MSVC)
-    STRING(REPLACE "\n" "\r\n" FileContent "${FileContent}")
-  endif ()
-  FILE(WRITE ${PROJECT_BINARY_DIR}/${output} "${FileContent}")
-  install(
-    FILES ${PROJECT_BINARY_DIR}/${output}
-    DESTINATION ${where})
-endmacro ()
-
-# installs a link to an executable ---------------------------------------------
-macro (install_command_alias name where alias)
-  if (MSVC)
-    add_custom_command(
-      TARGET ${name}
-      POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${name}>
-	      ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>/${alias}.exe)
-    install(
-      PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>/${alias}.exe
-      DESTINATION ${where})
-  else ()
-    add_custom_command(
-      TARGET ${name}
-      POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E create_symlink ${name}
-        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias})
-    install(
-      PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}
-      DESTINATION ${where})
-  endif ()
-endmacro ()
-
-# sub directories --------------------------------------------------------------
-
-#if(BUILD_STATIC_EXECUTABLES)
-#  set(CMAKE_EXE_LINKER_FLAGS -static)
-#  set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
-#  set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)       # remove -Wl,-Bdynamic
-#  set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
-#  set(CMAKE_SHARED_LIBRARY_C_FLAGS)         # remove -fPIC
-#  set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
-#  set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)    # remove -rdynamic
-#  set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
-#  # Maybe this works as well, haven't tried yet.
-#  # set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
-#else(BUILD_STATIC_EXECUTABLES)
-#  # Set RPATH to use for installed targets; append linker search path
-#  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LOFAR_LIBDIR}")
-#  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-#endif(BUILD_STATIC_EXECUTABLES)
-
-
-#--------------------------------------------------------------------------------
-#get_cmake_property(_variableNames VARIABLES)
-#foreach (_variableName ${_variableNames})
-#    message(STATUS "${_variableName}=${${_variableName}}")
-#endforeach ()
-#--------------------------------------------------------------------------------
-
-# install ----------------------------------------------------------------------
-install(DIRECTORY ${PROJECT_SOURCE_DIR}/Documentation/man/
-  DESTINATION share/man)
-
-if (MSVC)
-  install_readme(README . README.txt)
-  install_readme(README.md . README.md)
-  install_readme(README.windows . README.windows.txt)
-endif ()
-
-if (MSVC)
-  install_readme(LICENSE . LICENSE.txt)
-  install_readme(LICENSES-OTHER-COMPONENTS.md . LICENSES-OTHER-COMPONENTS.md)
-else ()
-  install_readme(README share/doc/arangodb3 README)
-  install_readme(README.md share/doc/arangodb3 README.md)
-  install_readme(LICENSE share/doc/arangodb3 LICENSE)
-  install_readme(LICENSES-OTHER-COMPONENTS.md share/doc/arangodb3 LICENSES-OTHER-COMPONENTS.md)
-endif ()
-
-# Build package ----------------------------------------------------------------
-if (NOT(MSVC))
-  set(CPACK_SET_DESTDIR ON)
-endif()
-
-find_program(DH_INSTALLINIT dh_installinit)
-find_program(FAKEROOT fakeroot)
-
-if (DH_INSTALLINIT AND FAKEROOT)
-  add_custom_target(prepare_debian)
-  SET(DEBIAN_CONTROL_EXTRA_BASENAMES
-    postinst
-    preinst
-    postrm
-    prerm
-  )
-  SET(DEBIAN_WORK_DIR "${PROJECT_BINARY_DIR}/debian-work")
-  add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E
-    remove_directory "${DEBIAN_WORK_DIR}"
-  )
-  foreach (_DEBIAN_CONTROL_EXTRA_BASENAME ${DEBIAN_CONTROL_EXTRA_BASENAMES})
-    SET(RELATIVE_NAME "debian/${_DEBIAN_CONTROL_EXTRA_BASENAME}")
-    SET(SRCFILE "${PROJECT_SOURCE_DIR}/Installation/${RELATIVE_NAME}")
-    SET(DESTFILE "${DEBIAN_WORK_DIR}/${RELATIVE_NAME}")
-
-    list(APPEND DEBIAN_CONTROL_EXTRA_SRC "${SRCFILE}")
-    list(APPEND DEBIAN_CONTROL_EXTRA_DEST "${DESTFILE}")
-
-    add_custom_command(TARGET prepare_debian POST_BUILD
-                     COMMAND ${CMAKE_COMMAND} -E
-                     copy ${SRCFILE} ${DESTFILE})
-  endforeach()
-
-  add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E
-    copy "${PROJECT_SOURCE_DIR}/Installation/debian/control" "${DEBIAN_WORK_DIR}/debian/control"
-  )
-  add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E
-    copy "${PROJECT_SOURCE_DIR}/Installation/debian/compat" "${DEBIAN_WORK_DIR}/debian/compat"
-  )
-  add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND fakeroot "${DH_INSTALLINIT}" -o 2>/dev/null
-    WORKING_DIRECTORY ${DEBIAN_WORK_DIR}
-  )
-  add_custom_command(TARGET prepare_debian POST_BUILD
-    COMMAND fakeroot dh_installdeb
-    WORKING_DIRECTORY ${DEBIAN_WORK_DIR}
-  )
-endif()
-
-# General
-set(CPACK_PACKAGE_NAME "arangodb3")
-set(CPACK_PACKAGE_VENDOR  "ArangoDB GmbH")
-set(CPACK_PACKAGE_CONTACT "info@arangodb.com")
-set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
-
-set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
-
-set(CPACK_STRIP_FILES "ON")
-set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
-set(CPACK_DEBIAN_PACKAGE_SECTION "database")
-set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "a multi-purpose NoSQL database
- A distributed free and open-source database with a flexible data model for documents,
- graphs, and key-values. Build high performance applications using a convenient
- SQL-like query language or JavaScript extensions.
- .
- Copyright: 2014-2016 by ArangoDB GmbH
- Copyright: 2012-2013 by triAGENS GmbH
- ArangoDB Software
- www.arangodb.com
-")
-SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "arangodb")
-set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
-set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
-set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.arangodb.com/")
-set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postinst;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/preinst;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postrm;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/prerm;")
-set(CPACK_BUNDLE_NAME            "${CPACK_PACKAGE_NAME}")
-configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
-set(CPACK_BUNDLE_PLIST           "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
-set(CPACK_BUNDLE_ICON            "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/icon.icns")
-set(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/arangodb-cli.sh")
-
-# MS installer
-if (MSVC)
-  set(CPACK_PACKAGE_NAME "ArangoDB")
-  set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Templates")
-  set(CPACK_PLUGIN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Plugins")
-  set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL 1)
-  set(BITS 64)
-
-  if (CMAKE_CL_64)
-    SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
-    SET(BITS 64)
-  else ()
-    SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
-    SET(BITS 32)
-  endif ()
-
-  message(STATUS "ARANGO_IMG:  ${ARANGO_IMG}")
-  message(STATUS "ARANGO_ICON: ${ARANGO_ICON}")
-  message(STATUS "RELATIVE_ARANGO_ICON: ${RELATIVE_ARANGO_ICON}")
-
-  install(
-    DIRECTORY "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons"
-    DESTINATION ${TRI_RESOURCEDIR})
-
-  set(CPACK_ARANGODB_NSIS_DEFINES "
-    !define BITS ${BITS}
-    !define TRI_FRIENDLY_SVC_NAME '${ARANGODB_FRIENDLY_STRING}'
-    !define TRI_AARDVARK_URL 'http://127.0.0.1:8529'
-    ")
-
-  set(CPACK_PACKAGE_ICON             ${ARANGO_ICON})
-
-  set(CPACK_NSIS_MODIFY_PATH         ON)
-  set(CPACK_NSIS_MUI_ICON            ${ARANGO_ICON})
-  set(CPACK_NSIS_MUI_UNIICON         ${ARANGO_ICON})
-  set(CPACK_NSIS_INSTALLED_ICON_NAME ${RELATIVE_ARANGO_ICON})
-  set(CPACK_NSIS_DISPLAY_NAME,       ${ARANGODB_DISPLAY_NAME})
-  set(CPACK_NSIS_HELP_LINK           ${ARANGODB_HELP_LINK})
-  set(CPACK_NSIS_URL_INFO_ABOUT      ${ARANGODB_URL_INFO_ABOUT})
-  set(CPACK_NSIS_CONTACT             ${ARANGODB_CONTACT})
-endif ()
-
-configure_file("${CMAKE_SOURCE_DIR}/Installation/cmake/CMakeCPackOptions.cmake.in"
-    "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
-set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake")
-
-if (NOT(MSVC))
-  # components
-  install(
-    FILES ${PROJECT_SOURCE_DIR}/Installation/debian/arangodb.init
-    PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-    DESTINATION ${ETCDIR}/init.d
-    RENAME arangodb3
-    COMPONENT debian-extras
-  )
-endif()
-
-# Custom targets ----------------------------------------------------------------
-
-# love
-add_custom_target (love
-  COMMENT "ArangoDB loves you."
-  COMMAND ""
-  )
-
-
-# Finally: user cpack
-include(CPack)
-
-################################################################################
-### @brief install client-side JavaScript files
-################################################################################
-
-install(
-  DIRECTORY ${PROJECT_SOURCE_DIR}/js/common ${PROJECT_SOURCE_DIR}/js/client
-  DESTINATION share/arangodb3/js
-  FILES_MATCHING PATTERN "*.js"
-  REGEX "^.*/common/test-data$" EXCLUDE
-  REGEX "^.*/common/tests$" EXCLUDE
-  REGEX "^.*/client/tests$" EXCLUDE)
-
-################################################################################
-### @brief install server-side JavaScript files
-################################################################################
-
-install(
-  DIRECTORY ${PROJECT_SOURCE_DIR}/js/actions ${PROJECT_SOURCE_DIR}/js/apps ${PROJECT_SOURCE_DIR}/js/contrib ${PROJECT_SOURCE_DIR}/js/node ${PROJECT_SOURCE_DIR}/js/server
-  DESTINATION share/arangodb3/js
-  REGEX "^.*/server/tests$" EXCLUDE
-  REGEX "^.*/aardvark/APP/node_modules$" EXCLUDE
-)
-
-################################################################################
-### @brief install log directory
-################################################################################
-
-install(
-  DIRECTORY ${PROJECT_BINARY_DIR}/var/log/arangodb
-  DESTINATION ${VARDIR_INSTALL}/log)
-
-################################################################################
-### @brief install database directory
-################################################################################
-
-install(
-  DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb3
-  DESTINATION ${VARDIR_INSTALL}/lib)
-
-################################################################################
-### @brief install apps directory
-################################################################################
-
-install(
-  DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb3-apps
-  DESTINATION ${VARDIR_INSTALL}/lib)
+include(GNUInstallDirs)
+
+# install the visual studio runtime:
+if (MSVC)
+  include(InstallRequiredSystemLibraries)
+  INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT Libraries)
+endif()
+
+# etc -------------------------------
+set(ETCDIR "" CACHE path "System configuration directory (defaults to prefix/etc)")
+
+# /etc -------------------------------
+if (ETCDIR STREQUAL "")
+  set(ETCDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/etc/arangodb3")
+  set(ETCDIR_INSTALL "etc/arangodb3")
+else ()
+  set(ETCDIR_NATIVE "${ETCDIR}/arangodb3")
+  set(ETCDIR_INSTALL "${ETCDIR}/arangodb3")
+endif ()
+
+# MS stuff ---------------------------
+if (MSVC)
+  file(TO_NATIVE_PATH "${ETCDIR_INSTALL}" ETCDIR_INSTALL)
+  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_INSTALL}")
+else ()
+  file(TO_NATIVE_PATH "${ETCDIR_NATIVE}" ETCDIR_NATIVE)
+  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ETCDIR_ESCAPED "${ETCDIR_NATIVE}")
+endif ()
+
+add_definitions("-D_SYSCONFDIR_=\"${ETCDIR_ESCAPED}\"")
+
+# /var
+set(VARDIR ""
+  CACHE path
+  "System configuration directory (defaults to prefix/var/arangodb3)"
+)
+
+if (VARDIR STREQUAL "")
+  set(VARDIR_NATIVE "${CMAKE_INSTALL_PREFIX}/var")
+  set(VARDIR_INSTALL "var")
+else ()
+  set(VARDIR_NATIVE "${VARDIR}")
+  set(VARDIR_INSTALL "${VARDIR}")
+endif ()
+
+file(TO_NATIVE_PATH "${VARDIR_NATIVE}" VARDIR_NATIVE)
+
+# database directory
+FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb3")
+
+# apps
+FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/lib/arangodb3-apps")
+
+# logs
+FILE(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/var/log/arangodb")
+
+# package
+set(TRI_PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/arangodb3")
+
+# resources
+set(TRI_RESOURCEDIR "resources")
+
+# sbinaries
+if (MSVC)
+  set(ARANGODB_INSTALL_SBIN "bin")
+  set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/bin")
+else ()
+  set(ARANGODB_INSTALL_SBIN "sbin")
+  set(TRI_SBINDIR "${CMAKE_INSTALL_PREFIX}/sbin")
+endif ()
+
+# MS Windows -------------------------------------------------------------------
+if (MSVC)
+  # icon paths
+  file(TO_NATIVE_PATH
+    "${TRI_RESOURCEDIR}/Icons/arangodb.ico"
+    RELATIVE_ARANGO_ICON
+  )
+
+  file(TO_NATIVE_PATH
+    "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.bmp"
+    ARANGO_IMG
+  )
+
+  file(TO_NATIVE_PATH
+    "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons/arangodb.ico"
+    ARANGO_ICON
+  )
+
+  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_IMG "${ARANGO_IMG}")
+  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARANGO_ICON "${ARANGO_ICON}")
+  STRING(REGEX REPLACE "\\\\" "\\\\\\\\" RELATIVE_ARANGO_ICON "${RELATIVE_ARANGO_ICON}")
+
+  # versioning
+  set(CMAKE_MODULE_PATH
+    ${CMAKE_MODULE_PATH}
+    ${PROJECT_SOURCE_DIR}/Installation/Windows/version
+  )
+
+  include("${PROJECT_SOURCE_DIR}/Installation/Windows/version/generate_product_version.cmake")
+endif ()
+
+################################################################################
+## INSTALL
+################################################################################
+
+# Global macros ----------------------------------------------------------------
+macro (generate_root_config name)
+  FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb3/${name}.conf.in FileContent)
+  STRING(REPLACE "@PKGDATADIR@" "@ROOTDIR@/share/arangodb3"
+    FileContent "${FileContent}")
+  STRING(REPLACE "@LOCALSTATEDIR@" "@ROOTDIR@/var"
+    FileContent "${FileContent}")
+  STRING(REPLACE "@SBINDIR@" "@ROOTDIR@/bin"
+    FileContent "${FileContent}")
+  STRING(REPLACE "@LIBEXECDIR@/arangodb3" "@ROOTDIR@/bin"
+    FileContent "${FileContent}")
+  STRING(REPLACE "@SYSCONFDIR@" "@ROOTDIR@/etc/arangodb3"
+    FileContent "${FileContent}")
+  if (MSVC)
+    STRING(REPLACE "@PROGRAM_SUFFIX@" ".exe"
+      FileContent "${FileContent}")
+    STRING(REGEX REPLACE "[\r\n]file =" "\n# file ="
+      FileContent "${FileContent}")
+  endif ()
+  FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb3/${name}.conf "${FileContent}")
+endmacro ()
+
+#  generates config file using the configured paths ----------------------------
+macro (generate_path_config name)
+  FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb3/${name}.conf.in FileContent)
+  STRING(REPLACE "@PKGDATADIR@" "${TRI_PKGDATADIR}"
+    FileContent "${FileContent}")
+  STRING(REPLACE "@LOCALSTATEDIR@" "${VARDIR_NATIVE}"
+    FileContent "${FileContent}")
+  FILE(WRITE ${PROJECT_BINARY_DIR}/etc/arangodb3/${name}.conf "${FileContent}")
+endmacro ()
+
+# installs a config file -------------------------------------------------------
+macro (install_config name)
+  if (MSVC OR (DARWIN AND NOT HOMEBREW))
+    generate_root_config(${name})
+  else ()
+    generate_path_config(${name})
+  endif ()
+  install(
+    FILES ${PROJECT_BINARY_DIR}/etc/arangodb3/${name}.conf
+    DESTINATION ${ETCDIR_INSTALL})
+endmacro ()
+
+# installs a readme file converting EOL ----------------------------------------
+macro (install_readme input where output)
+  FILE(READ ${PROJECT_SOURCE_DIR}/${input} FileContent)
+  STRING(REPLACE "\r" "" FileContent "${FileContent}")
+  if (MSVC)
+    STRING(REPLACE "\n" "\r\n" FileContent "${FileContent}")
+  endif ()
+  FILE(WRITE ${PROJECT_BINARY_DIR}/${output} "${FileContent}")
+  install(
+    FILES ${PROJECT_BINARY_DIR}/${output}
+    DESTINATION ${where})
+endmacro ()
+
+# installs a link to an executable ---------------------------------------------
+macro (install_command_alias name where alias)
+  if (MSVC)
+    add_custom_command(
+      TARGET ${name}
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${name}>
+	      ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>/${alias}.exe)
+    install(
+      PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIGURATION>/${alias}.exe
+      DESTINATION ${where})
+  else ()
+    add_custom_command(
+      TARGET ${name}
+      POST_BUILD
+      COMMAND ${CMAKE_COMMAND} -E create_symlink ${name}
+        ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias})
+    install(
+      PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}
+      DESTINATION ${where})
+  endif ()
+endmacro ()
+
+# sub directories --------------------------------------------------------------
+
+#if(BUILD_STATIC_EXECUTABLES)
+#  set(CMAKE_EXE_LINKER_FLAGS -static)
+#  set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
+#  set(CMAKE_EXE_LINK_DYNAMIC_C_FLAGS)       # remove -Wl,-Bdynamic
+#  set(CMAKE_EXE_LINK_DYNAMIC_CXX_FLAGS)
+#  set(CMAKE_SHARED_LIBRARY_C_FLAGS)         # remove -fPIC
+#  set(CMAKE_SHARED_LIBRARY_CXX_FLAGS)
+#  set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS)    # remove -rdynamic
+#  set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
+#  # Maybe this works as well, haven't tried yet.
+#  # set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
+#else(BUILD_STATIC_EXECUTABLES)
+#  # Set RPATH to use for installed targets; append linker search path
+#  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LOFAR_LIBDIR}")
+#  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+#endif(BUILD_STATIC_EXECUTABLES)
+
+
+#--------------------------------------------------------------------------------
+#get_cmake_property(_variableNames VARIABLES)
+#foreach (_variableName ${_variableNames})
+#    message(STATUS "${_variableName}=${${_variableName}}")
+#endforeach ()
+#--------------------------------------------------------------------------------
+
+# install ----------------------------------------------------------------------
+install(DIRECTORY ${PROJECT_SOURCE_DIR}/Documentation/man/
+  DESTINATION share/man)
+
+if (MSVC)
+  install_readme(README . README.txt)
+  install_readme(README.md . README.md)
+  install_readme(README.windows . README.windows.txt)
+endif ()
+
+if (MSVC)
+  install_readme(LICENSE . LICENSE.txt)
+  install_readme(LICENSES-OTHER-COMPONENTS.md . LICENSES-OTHER-COMPONENTS.md)
+else ()
+  install_readme(README share/doc/arangodb3 README)
+  install_readme(README.md share/doc/arangodb3 README.md)
+  install_readme(LICENSE share/doc/arangodb3 LICENSE)
+  install_readme(LICENSES-OTHER-COMPONENTS.md share/doc/arangodb3 LICENSES-OTHER-COMPONENTS.md)
+endif ()
+
+# Build package ----------------------------------------------------------------
+if (NOT(MSVC))
+  set(CPACK_SET_DESTDIR ON)
+endif()
+
+find_program(DH_INSTALLINIT dh_installinit)
+find_program(FAKEROOT fakeroot)
+
+if (DH_INSTALLINIT AND FAKEROOT)
+  add_custom_target(prepare_debian)
+  SET(DEBIAN_CONTROL_EXTRA_BASENAMES
+    postinst
+    preinst
+    postrm
+    prerm
+  )
+  SET(DEBIAN_WORK_DIR "${PROJECT_BINARY_DIR}/debian-work")
+  add_custom_command(TARGET prepare_debian POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E
+    remove_directory "${DEBIAN_WORK_DIR}"
+  )
+  foreach (_DEBIAN_CONTROL_EXTRA_BASENAME ${DEBIAN_CONTROL_EXTRA_BASENAMES})
+    SET(RELATIVE_NAME "debian/${_DEBIAN_CONTROL_EXTRA_BASENAME}")
+    SET(SRCFILE "${PROJECT_SOURCE_DIR}/Installation/${RELATIVE_NAME}")
+    SET(DESTFILE "${DEBIAN_WORK_DIR}/${RELATIVE_NAME}")
+
+    list(APPEND DEBIAN_CONTROL_EXTRA_SRC "${SRCFILE}")
+    list(APPEND DEBIAN_CONTROL_EXTRA_DEST "${DESTFILE}")
+
+    add_custom_command(TARGET prepare_debian POST_BUILD
+                     COMMAND ${CMAKE_COMMAND} -E
+                     copy ${SRCFILE} ${DESTFILE})
+  endforeach()
+
+  add_custom_command(TARGET prepare_debian POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E
+    copy "${PROJECT_SOURCE_DIR}/Installation/debian/control" "${DEBIAN_WORK_DIR}/debian/control"
+  )
+  add_custom_command(TARGET prepare_debian POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E
+    copy "${PROJECT_SOURCE_DIR}/Installation/debian/compat" "${DEBIAN_WORK_DIR}/debian/compat"
+  )
+  add_custom_command(TARGET prepare_debian POST_BUILD
+    COMMAND fakeroot "${DH_INSTALLINIT}" -o 2>/dev/null
+    WORKING_DIRECTORY ${DEBIAN_WORK_DIR}
+  )
+  add_custom_command(TARGET prepare_debian POST_BUILD
+    COMMAND fakeroot dh_installdeb
+    WORKING_DIRECTORY ${DEBIAN_WORK_DIR}
+  )
+endif()
+
+# General
+set(CPACK_PACKAGE_NAME "arangodb3")
+set(CPACK_PACKAGE_VENDOR  "ArangoDB GmbH")
+set(CPACK_PACKAGE_CONTACT "info@arangodb.com")
+set(CPACK_PACKAGE_VERSION "${ARANGODB_VERSION}")
+
+set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
+
+set(CPACK_STRIP_FILES "ON")
+set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
+set(CPACK_DEBIAN_PACKAGE_SECTION "database")
+set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "a multi-purpose NoSQL database
+ A distributed free and open-source database with a flexible data model for documents,
+ graphs, and key-values. Build high performance applications using a convenient
+ SQL-like query language or JavaScript extensions.
+ .
+ Copyright: 2014-2016 by ArangoDB GmbH
+ Copyright: 2012-2013 by triAGENS GmbH
+ ArangoDB Software
+ www.arangodb.com
+")
+SET(CPACK_DEBIAN_PACKAGE_CONFLICTS "arangodb")
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
+set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.arangodb.com/")
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postinst;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/preinst;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postrm;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/prerm;")
+set(CPACK_BUNDLE_NAME            "${CPACK_PACKAGE_NAME}")
+configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
+set(CPACK_BUNDLE_PLIST           "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
+set(CPACK_BUNDLE_ICON            "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/icon.icns")
+set(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/arangodb-cli.sh")
+
+# MS installer
+if (MSVC)
+  set(CPACK_PACKAGE_NAME "ArangoDB")
+  set(CPACK_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Templates")
+  set(CPACK_PLUGIN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Windows/Plugins")
+  set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL 1)
+  set(BITS 64)
+
+  if (CMAKE_CL_64)
+    SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+    SET(BITS 64)
+  else ()
+    SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
+    SET(BITS 32)
+  endif ()
+
+  message(STATUS "ARANGO_IMG:  ${ARANGO_IMG}")
+  message(STATUS "ARANGO_ICON: ${ARANGO_ICON}")
+  message(STATUS "RELATIVE_ARANGO_ICON: ${RELATIVE_ARANGO_ICON}")
+
+  install(
+    DIRECTORY "${PROJECT_SOURCE_DIR}/Installation/Windows/Icons"
+    DESTINATION ${TRI_RESOURCEDIR})
+
+  set(CPACK_ARANGODB_NSIS_DEFINES "
+    !define BITS ${BITS}
+    !define TRI_FRIENDLY_SVC_NAME '${ARANGODB_FRIENDLY_STRING}'
+    !define TRI_AARDVARK_URL 'http://127.0.0.1:8529'
+    ")
+
+  set(CPACK_PACKAGE_ICON             ${ARANGO_ICON})
+
+  set(CPACK_NSIS_MODIFY_PATH         ON)
+  set(CPACK_NSIS_MUI_ICON            ${ARANGO_ICON})
+  set(CPACK_NSIS_MUI_UNIICON         ${ARANGO_ICON})
+  set(CPACK_NSIS_INSTALLED_ICON_NAME ${RELATIVE_ARANGO_ICON})
+  set(CPACK_NSIS_DISPLAY_NAME,       ${ARANGODB_DISPLAY_NAME})
+  set(CPACK_NSIS_HELP_LINK           ${ARANGODB_HELP_LINK})
+  set(CPACK_NSIS_URL_INFO_ABOUT      ${ARANGODB_URL_INFO_ABOUT})
+  set(CPACK_NSIS_CONTACT             ${ARANGODB_CONTACT})
+endif ()
+
+configure_file("${CMAKE_SOURCE_DIR}/Installation/cmake/CMakeCPackOptions.cmake.in"
+    "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
+set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake")
+
+if (NOT(MSVC))
+  # components
+  install(
+    FILES ${PROJECT_SOURCE_DIR}/Installation/debian/arangodb.init
+    PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
+    DESTINATION ${ETCDIR}/init.d
+    RENAME arangodb3
+    COMPONENT debian-extras
+  )
+endif()
+
+# Custom targets ----------------------------------------------------------------
+
+# love
+add_custom_target (love
+  COMMENT "ArangoDB loves you."
+  COMMAND ""
+  )
+
+
+# Finally: user cpack
+include(CPack)
+
+################################################################################
+### @brief install client-side JavaScript files
+################################################################################
+
+install(
+  DIRECTORY ${PROJECT_SOURCE_DIR}/js/common ${PROJECT_SOURCE_DIR}/js/client
+  DESTINATION share/arangodb3/js
+  FILES_MATCHING PATTERN "*.js"
+  REGEX "^.*/common/test-data$" EXCLUDE
+  REGEX "^.*/common/tests$" EXCLUDE
+  REGEX "^.*/client/tests$" EXCLUDE)
+
+################################################################################
+### @brief install server-side JavaScript files
+################################################################################
+
+install(
+  DIRECTORY ${PROJECT_SOURCE_DIR}/js/actions ${PROJECT_SOURCE_DIR}/js/apps ${PROJECT_SOURCE_DIR}/js/contrib ${PROJECT_SOURCE_DIR}/js/node ${PROJECT_SOURCE_DIR}/js/server
+  DESTINATION share/arangodb3/js
+  REGEX "^.*/server/tests$" EXCLUDE
+  REGEX "^.*/aardvark/APP/node_modules$" EXCLUDE
+)
+
+################################################################################
+### @brief install log directory
+################################################################################
+
+install(
+  DIRECTORY ${PROJECT_BINARY_DIR}/var/log/arangodb
+  DESTINATION ${VARDIR_INSTALL}/log)
+
+################################################################################
+### @brief install database directory
+################################################################################
+
+install(
+  DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb3
+  DESTINATION ${VARDIR_INSTALL}/lib)
+
+################################################################################
+### @brief install apps directory
+################################################################################
+
+install(
+  DIRECTORY ${PROJECT_BINARY_DIR}/var/lib/arangodb3-apps
+  DESTINATION ${VARDIR_INSTALL}/lib)


Support Ubuntu 14.04 for Clang 3.8

Support Ubuntu 14.04 for Clang 3.8

--- cmake/clang/download.cmake
+++ cmake/clang/download.cmake
@@ -9,8 +9,8 @@
     set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     if(64_BIT_PLATFORM)
-      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-x86_64-linux-gnu-ubuntu-16.04")
-      set(CLANG_MD5 "ec83729b5d6d6aee8de6f6dc47909760")
+      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-x86_64-linux-gnu-ubuntu-14.04")
+      set(CLANG_MD5 "890274421f4480ce228ed3eab1fd3c73")
       set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
     else()
       message(FATAL_ERROR "No pre-built Clang ${CLANG_VERSION} binaries for 32 bit Linux; this system is not supported")


CMake: allow enabling LTO on macOS

CMake: allow enabling LTO on macOS

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -71,6 +71,9 @@
     include(gcc-toolchain)
     set(lto_compile "-flto")
     set(lto_link "-flto")
+  elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
+    set(lto_compile "-flto=thin -fstrict-vtable-pointers")
+    set(lto_link "-flto=thin")
   endif()

   set(CMAKE_C_FLAGS


Finish determining CMake variables needed to control octave interface build
and install. These results look fine on the one system (Debian stable)
tested so far, but are untested for an actual build since the octave
interface build is not implemented yet.

Use -DENABLE_octave=ON (the default is currently OFF) if you want to test
what CMake octave control variables are set for your particular octave
configuration, but that is all that option does at the current time.

svn path=/trunk/; revision=7056

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -29,28 +29,31 @@
 endif(ENABLE_octave AND NOT BUILD_SHARED_LIBS)

 if(ENABLE_octave)
-#  find_program(OCTAVE octave)
-  find_program(OCTAVE octave2.0)
-  if(NOT OCTAVE)
+  find_program(OCTAVE octave)
+  if(OCTAVE)
+    message(STATUS "OCTAVE = ${OCTAVE}")
+  else(OCTAVE)
     message(STATUS "WARNING: "
     "octave not found. Disabling octave bindings")
     set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
-  endif(NOT OCTAVE)
+  endif(OCTAVE)
 endif(ENABLE_octave)

 if(ENABLE_octave)
   find_program(MKOCTFILE mkoctfile)
-  if(NOT MKOCTFILE)
+  if(MKOCTFILE)
+    message(STATUS "MKOCTFILE = ${MKOCTFILE}")
+  else(MKOCTFILE)
     message(STATUS "WARNING: "
     "mkoctfile not found. Disabling octave bindings")
     set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
-  endif(NOT MKOCTFILE)
+  endif(MKOCTFILE)
 endif(ENABLE_octave)

 if(ENABLE_octave)
   #MATWRAP is the path+filename of the matwrap script.
   set(MATWRAP "${CMAKE_CURRENT_SOURCE_DIR}/bindings/octave/matwrap/matwrap")
-  message(STATUS "Using built-in ${MATWRAP}")
+  message(STATUS "MATWRAP = ${MATWRAP}")

   #OCTAVE_VERSION is the (dotted triplet) octave version.
   execute_process(
@@ -68,13 +71,13 @@
   # PLPLOT_OCTAVE_DIR is the directory for installation of the PLplot_Octave
   # specific m files
   set(PLPLOT_OCTAVE_DIR ${CMAKE_INSTALL_PREFIX}/share/plplot_octave)
+  message(STATUS "PLPLOT_OCTAVE_DIR = ${PLPLOT_OCTAVE_DIR}")

   # OCTAVE_PREFIX is the prefix where octave was installed.
   # N.B. this file method is really clunky, but we are forced to use
   # this method because as far as I know there is no method
   # of invoking octave scripts from the octave command line other than
   # with a file.
-
   file(WRITE ${CMAKE_BINARY_DIR}/octave_command
   "printf(octave_config_info(\"prefix\"));"
   )
@@ -83,23 +86,9 @@
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
   OUTPUT_VARIABLE OCTAVE_PREFIX
   )
-  message(STATUS "OCTAVE_PREFIX = ${OCTAVE_PREFIX}")
+  #message(STATUS "OCTAVE_PREFIX = ${OCTAVE_PREFIX}")

-  #OCTAVE_M_DIR
-  # N.B. I have found that localfcnfiledir works fine for Debian stable
-  # versions of both octave 2.0.x and 2.1.x.  Therefore, unless somebody
-  # complains will keep this simple logic rather than doing more complicated
-  # localfcnfilepath logic for octave 2.0.x that occurs for ABS system.
-  file(WRITE ${CMAKE_BINARY_DIR}/octave_command
-  "printf(octave_config_info(\"localfcnfiledir\"));"
-  )
-  execute_process(
-  COMMAND ${OCTAVE} -q -f octave_command
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-  OUTPUT_VARIABLE OCTAVE_M_DIR
-  )
-  message(STATUS "OCTAVE_M_DIR = ${OCTAVE_M_DIR}")
-
+  # Logic that depends on octave version
   set(OCTAVE_TESTING_MINIMUM_VERSION "2.1.0")
   transform_version(
   NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION
@@ -111,11 +100,88 @@
    LESS
    "${NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION}"
    )
-    # Further processing of OCTAVE_M_DIR required if octave 2.0.x
+    # octave-2.0 logic.
+    #_OCTAVE_M_DIR
+    file(WRITE ${CMAKE_BINARY_DIR}/octave_command
+    "printf(octave_config_info(\"localfcnfilepath\"));"
+    )
+    execute_process(
+    COMMAND ${OCTAVE} -q -f octave_command
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    OUTPUT_VARIABLE __OCTAVE_M_DIR
+    )
+    #message(STATUS "__OCTAVE_M_DIR = ${__OCTAVE_M_DIR}")
+    string(REGEX REPLACE
+    "^.*:([^:][^:]*)//$"
+    "\\1"
+    _OCTAVE_M_DIR
+    ${__OCTAVE_M_DIR}
+    )
+    #message(STATUS "_OCTAVE_M_DIR = ${_OCTAVE_M_DIR}")
+    #OCTAVE_OCT_DIR
+    file(WRITE ${CMAKE_BINARY_DIR}/octave_command
+    "printf(octave_config_info(\"localoctfilepath\"));"
+    )
+    execute_process(
+    COMMAND ${OCTAVE} -q -f octave_command
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    OUTPUT_VARIABLE _OCTAVE_OCT_DIR
+    )
+    #message(STATUS "_OCTAVE_OCT_DIR = ${_OCTAVE_OCT_DIR}")
+    string(REGEX REPLACE
+    "^.*:([^:][^:]*)//$"
+    "\\1"
+    OCTAVE_OCT_DIR
+    ${_OCTAVE_OCT_DIR}
+    )
+    #message(STATUS "OCTAVE_OCT_DIR = ${OCTAVE_OCT_DIR}")
+  else(
+   NUMERICAL_OCTAVE_VERSION
+   LESS
+   "${NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION}"
+   )
+    # octave-2.1 (or higher) logic.
+    #_OCTAVE_M_DIR
+    file(WRITE ${CMAKE_BINARY_DIR}/octave_command
+    "printf(octave_config_info(\"localfcnfiledir\"));"
+    )
+    execute_process(
+    COMMAND ${OCTAVE} -q -f octave_command
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    OUTPUT_VARIABLE _OCTAVE_M_DIR
+    )
+    #OCTAVE_OCT_DIR
+    file(WRITE ${CMAKE_BINARY_DIR}/octave_command
+    "printf(octave_config_info(\"localoctfiledir\"));"
+    )
+    execute_process(
+    COMMAND ${OCTAVE} -q -f octave_command
+    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    OUTPUT_VARIABLE OCTAVE_OCT_DIR
+    )
   endif(
    NUMERICAL_OCTAVE_VERSION
    LESS
    "${NUMERICAL_OCTAVE_TESTING_MINIMUM_VERSION}"
    )
-#  message(FATAL_ERROR "")
+  # Replace the OCTAVE_PREFIX with the PLplot prefix in OCTAVE_M_DIR
+  string(REGEX REPLACE
+  "${OCTAVE_PREFIX}"
+  "${CMAKE_INSTALL_PREFIX}"
+  OCTAVE_M_DIR
+  ${_OCTAVE_M_DIR}
+  )
+  message(STATUS "OCTAVE_M_DIR = ${OCTAVE_M_DIR}")
+
+  # Transform OCTAVE_OCT_DIR if prefixes not the same.
+  if(NOT CMAKE_INSTALL_PREFIX STREQUAL "${OCTAVE_PREFIX}")
+    set(OCTAVE_OCT_DIR ${PLPLOT_OCTAVE_DIR})
+  endif(NOT CMAKE_INSTALL_PREFIX STREQUAL "${OCTAVE_PREFIX}")
+  message(STATUS "OCTAVE_OCT_DIR = ${OCTAVE_OCT_DIR}")
+
+  # Use DEFINE_PL_DOUBLE in bindings/octave/plplot_octave.h.in
+  # (I [AWI] presume this is to simplify the #include's).
+  if(PL_DOUBLE)
+    set(DEFINE_PL_DOUBLE "#define PL_DOUBLE")
+  endif(PL_DOUBLE)
 endif(ENABLE_octave)


makefile

makefile

--- cmake_modules/common.cmake
+++ cmake_modules/common.cmake
@@ -1,6 +1,6 @@
 SET(CMAKE_BUILD_TYPE Release) # | Debug
 SET(CMAKE_VERBOSE_MAKEFILE 1)
-SET(CMAKE_OSX_ARCHITECTURES i386 x86_64)
+SET(CMAKE_OSX_ARCHITECTURES x86_64)

 FIND_PATH(OpenCV_DIR OpenCVConfig.cmake
    "/opt/opencv/share/opencv"


STYLE: clear up unused code

STYLE: clear up unused code

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -51,10 +51,6 @@
   ${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim
   ${OTB_BINARY_DIR}/Utilities/otbossim/include/ossim
   ${OTB_SOURCE_DIR}/Utilities/otbossimplugins
-  #Temporary until the SAR plugins are fully integrated:
-#   ${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim/projection/otb
-#   ${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim/projection
-# Add otbossimplugins/ossim/otb into the include directories path
   ${OTB_SOURCE_DIR}/Utilities/otbossimplugins/ossim
   ${OTB_SOURCE_DIR}/Utilities/dxflib
   ${OTB_SOURCE_DIR}/Utilities/InsightJournal


fixed TBB root detection for recent Intel Parallel Studio versions

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -56,7 +56,7 @@

   FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h
     DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/composerxe/tbb
+    PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/tbb
     NO_DEFAULT_PATH
   )
   FIND_PATH(EMBREE_TBB_ROOT include/tbb/tbb.h)


cmake var XP_INFOFILE for recording info about build system

--- modules/macpro.cmake
+++ modules/macpro.cmake
@@ -272,14 +272,15 @@
       endif()
       set(GIT_REV ${PREFIX}${GIT_DESCRIBE}${PARTIAL}-${COMPILER}-${BUILD_PLATFORM})
       set(STAGE_DIR ${STAGE_DIR}_${GIT_REV})
-      file(WRITE ${STAGE_DIR}/${INSTALL_NAME}_${GIT_REV}.txt "${GIT_REV}\n")
+      set(XP_INFOFILE ${STAGE_DIR}/${INSTALL_NAME}_${GIT_REV}.txt)
+      file(WRITE ${XP_INFOFILE} "${GIT_REV}\n")
       execute_process(COMMAND uname -a
         OUTPUT_VARIABLE sysinfo
         OUTPUT_STRIP_TRAILING_WHITESPACE
         ERROR_VARIABLE unameErr
         )
       if(NOT unameErr)
-        file(APPEND ${STAGE_DIR}/${INSTALL_NAME}_${GIT_REV}.txt "${sysinfo}\n")
+        file(APPEND ${XP_INFOFILE} "${sysinfo}\n")
       endif()
     endif()
   endif()


Update Custom-vs.cmake

Update Custom-vs.cmake

removing options that do not exist anymore

--- msvc/Custom-vs.cmake
+++ msvc/Custom-vs.cmake
@@ -2,12 +2,8 @@
 # GLOBAL

 # Csound build options for MSVC
-set(BUILD_BUCHLA_OPCODES ON)
-set(BUILD_CHUA_OPCODES ON)
-set(BUILD_CSBEATS ON)
-set(BUILD_CSOUND_AC ON)
-set(BUILD_CSOUND_AC_LUA_INTERFACE OFF)
-set(BUILD_CSOUND_AC_PYTHON_INTERFACE ON)
+set(BUILD_BUCHLA_OPCODES ON
+set(BUILD_CSBEATS ON
 set(BUILD_CUDA_OPCODES OFF)
 set(BUILD_CXX_INTERFACE ON)
 set(BUILD_DSSI_OPCODES OFF)
@@ -16,7 +12,6 @@
 set(BUILD_FLUID_OPCODES ON)
 set(BUILD_FRAMEBUFFER_OPCODES ON)
 set(BUILD_HDF5_OPCODES ON)
-set(BUILD_IMAGE_OPCODES ON)
 set(BUILD_INSTALLER ON)
 set(BUILD_JACK_OPCODES OFF)
 set(BUILD_JAVA_INTERFACE ON)
@@ -28,20 +23,15 @@
 set(BUILD_OSC_OPCODES ON)
 set(BUILD_P5GLOVE_OPCODES OFF)
 set(BUILD_PADSYNTH_OPCODES ON)
-set(BUILD_PD_CLASS ON)
 set(BUILD_PLATEREV_OPCODES ON)
-set(BUILD_PYTHON_INTERFACE ON)
-set(BUILD_PYTHON_OPCODES ON)
 set(BUILD_RELEASE ON)
 set(BUILD_SCANSYN_OPCODES ON)
 set(BUILD_SELECT_OPCODE ON)
 set(BUILD_SERIAL_OPCODES ON)
 set(BUILD_STACK_OPCODES ON)
 set(BUILD_STATIC_LIBRARY ON)
-set(BUILD_STK_OPCODES ON)
 set(BUILD_TESTS ON)
 set(BUILD_UTILITIES ON)
-set(BUILD_VIRTUAL_KEYBOARD ON)
 set(BUILD_WEBSOCKET_OPCODE ON)
 set(BUILD_WIIMOTE_OPCODES OFF)
 set(BUILD_WINSOUND ON)
@@ -54,7 +44,6 @@
 set(USE_COMPILER_OPTIMIZATIONS 1)
 set(USE_COREMIDI 0) # N/A
 set(USE_DOUBLE 1)
-set(USE_FLTK 1)
 set(USE_GETTEXT	0)
 set(USE_IPMIDI 1)
 set(USE_JACK 0) # N/A


Removed examples and bindings from code coverage

--- contrib/CodeCoverage.cmake
+++ contrib/CodeCoverage.cmake
@@ -85,7 +85,7 @@
 	# create cobertura output
         ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
                 # Running gcovr
-                COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/thirdparty/' -e '${CMAKE_SOURCE_DIR}/tests/' -e '${CMAKE_SOURCE_DIR}/build/' -o ${_outputname}.xml
+                COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/thirdparty/' -e '${CMAKE_SOURCE_DIR}/tests/' -e '${CMAKE_SOURCE_DIR}/build/' -e '${CMAKE_SOURCE_DIR}/examples/' -e '${CMAKE_SOURCE_DIR}/bindings/' -o ${_outputname}.xml
                 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
                 COMMENT "Running gcovr to produce Cobertura code coverage report. ${_testrunner} ${ARGV3}"
         )


Update Windows lib names for new Boost package

--- indra/cmake/Boost.cmake
+++ indra/cmake/Boost.cmake
@@ -17,8 +17,8 @@
   set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)

   if (WINDOWS)
-    set(BOOST_VERSION 1_52)
     if(MSVC80)
+      set(BOOST_VERSION 1_52)
       set(BOOST_PROGRAM_OPTIONS_LIBRARY
           optimized libboost_program_options-vc80-mt-${BOOST_VERSION}
           debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION})
@@ -37,17 +37,17 @@
     else(MSVC80)
       # MSVC 10.0 config
       set(BOOST_PROGRAM_OPTIONS_LIBRARY
-          optimized libboost_program_options-vc100-mt-${BOOST_VERSION}
-          debug libboost_program_options-vc100-mt-gd-${BOOST_VERSION})
+          optimized libboost_program_options-mt
+          debug libboost_program_options-mt-gd)
       set(BOOST_REGEX_LIBRARY
-          optimized libboost_regex-vc100-mt-${BOOST_VERSION}
-          debug libboost_regex-vc100-mt-gd-${BOOST_VERSION})
+          optimized libboost_regex-mt}
+          debug libboost_regex-mt-gd)
       set(BOOST_SYSTEM_LIBRARY
-          optimized libboost_system-vc100-mt-${BOOST_VERSION}
-          debug libboost_system-vc100-mt-gd-${BOOST_VERSION})
+          optimized libboost_system-mt}
+          debug libboost_system-mt-gd)
       set(BOOST_FILESYSTEM_LIBRARY
-          optimized libboost_filesystem-vc100-mt-${BOOST_VERSION}
-          debug libboost_filesystem-vc100-mt-gd-${BOOST_VERSION})
+          optimized libboost_filesystem-mt}
+          debug libboost_filesystem-mt-gd)
     endif (MSVC80)
   elseif (DARWIN OR LINUX)
     set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)


SVN_SILENT added comment for 'if(MINGW)' workaround

svn path=/branches/work/kdab-post-4.0/kdepim/; revision=748438

--- kleopatra/ConfigureChecks.cmake
+++ kleopatra/ConfigureChecks.cmake
@@ -47,7 +47,7 @@
   # check if assuan has assuan_fd_t
   set(CMAKE_REQUIRED_LIBRARIES ${_gpg_error_library})
   set(CMAKE_REQUIRED_INCLUDES ${ASSUAN_INCLUDES})
-  if(MINGW)
+  if(MINGW) # TODO: this workaround will be removed as soon as we find better solution
     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN32_INCLUDE_DIR}/mingw)
   elseif(MSVC)
     set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${KDEWIN32_INCLUDE_DIR}/msvc)


Implement MITK_BUILD_OPTIONS feature

Implement MITK_BUILD_OPTIONS feature

--- CMake/MITKDashboardScript.download.cmake
+++ CMake/MITKDashboardScript.download.cmake
@@ -536,6 +536,21 @@

 if(MITK_BUILD_CONFIGURATION)
   list(APPEND options "-D" "MITK_BUILD_CONFIGURATION:STRING=${MITK_BUILD_CONFIGURATION}")
+endif()
+
+if(MITK_BUILD_OPTIONS)
+  get_temp_directory(temp_dir)
+  set(mitk_initial_cache_file "${temp_dir}/MITKInitialCache.cmake")
+  file(WRITE "${mitk_initial_cache_file}" "")
+  foreach(mitk_option ${MITK_BUILD_OPTIONS})
+    if(mitk_option MATCHES "^([^:]+):([^=]+)=(.*)")
+      set(var "${CMAKE_MATCH_1}")
+      set(type "${CMAKE_MATCH_2}")
+      set(value "${CMAKE_MATCH_3}")
+      file(APPEND "${mitk_initial_cache_file}" "set(${var} \"${value}\" CACHE ${type} \"\" FORCE)\n")
+    endif()
+  endforeach()
+  list(APPEND options "-D" "MITK_INITIAL_CACHE_FILE:FILEPATH=${mitk_initial_cache_file}")
 endif()

 foreach(option ${MITK_SUPERBUILD_OPTIONS})


Reverted visible CMake variables to internal

--- build/macros.cmake
+++ build/macros.cmake
@@ -228,7 +228,7 @@
 	else()
 		detect_option_path(ORK_INSTALL_PREFIX "Path of install directory" "${CMAKE_SOURCE_DIR}/../bin")
 	endif()
-	set(CMAKE_INSTALL_PREFIX "${ORK_INSTALL_PREFIX}")
+	set_as_internal(CMAKE_INSTALL_PREFIX "${ORK_INSTALL_PREFIX}")

 	detect_option(ORK_INSTALL_BIN_SUFFIX "Subdirectory for installation of executables and shared libraries" bin)
 	detect_option(ORK_INSTALL_INC_SUFFIX "Subdirectory for installation of headers" inc)
@@ -547,9 +547,9 @@
 	mark_empty_internal(CMAKE_STATIC_LINKER_FLAGS_RELEASE)
 	mark_empty_internal(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO)

-	set(CMAKE_SKIP_INSTALL_RPATH ON)
-	set(CMAKE_SKIP_RPATH ON)
-	set(CMAKE_VERBOSE_MAKEFILE OFF)
+	set_as_internal(CMAKE_SKIP_INSTALL_RPATH ON)
+	set_as_internal(CMAKE_SKIP_RPATH ON)
+	set_as_internal(CMAKE_VERBOSE_MAKEFILE OFF)

 	set(CMAKE_DEBUG_POSTFIX "d")


Split off candidate-4.0.0

Split off candidate-4.0.0

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -3,7 +3,7 @@
 ###
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 4 )
-set ( HPCC_MINOR 0 )
+set ( HPCC_MINOR 1 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 1 )


Nagios Monitoring 6.4.0-rc1 Release Candidate 1

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -3,8 +3,8 @@
 ###
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 6 )
-set ( HPCC_MINOR 3 )
+set ( HPCC_MINOR 4 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "trunk" )
-set ( HPCC_SEQUENCE 0 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 1 )
 ###


Split off 7.10.10

Split off 7.10.10

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 10 )
-set ( HPCC_POINT 9 )
+set ( HPCC_POINT 11 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 8.4.40

Split off 8.4.40

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 39 )
+set ( HPCC_POINT 41 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Target tag_push should be done after tag

--- Modules/ManageSourceVersionControl.cmake
+++ Modules/ManageSourceVersionControl.cmake
@@ -45,7 +45,9 @@
 	    )

 	ADD_CUSTOM_TARGET(tag_push
+	    COMMAND git push
 	    COMMAND git push --tags
+	    DEPENDS "${MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}"
 	    COMMENT "Push to git"
 	    )


Adapt files.cmake of SegmentationTestDriver.

Variable EXECUTABLE is no longer supported.

--- Modules/Segmentation/Testing/files.cmake
+++ Modules/Segmentation/Testing/files.cmake
@@ -33,7 +33,6 @@
                              NAME SegmentationTestDriver
                              DEPENDS "Segmentation"
                              VERSION "0.1.0"
-                             EXECUTABLE
                             )

 set(TEST_CPP_FILES ${testdriver_init_file})


update parallelproj version tag to v0.7

update parallelproj version tag to v0.7

--- version_config.cmake
+++ version_config.cmake
@@ -149,7 +149,7 @@

 ## parallelproj
 set(DEFAULT_parallelproj_URL https://github.com/gschramm/parallelproj )
-set(DEFAULT_parallelproj_TAG v0.6)
+set(DEFAULT_parallelproj_TAG v0.7)

 ## SIRF-Contribs
 set(DEFAULT_SIRF-Contribs_URL https://github.com/SyneRBI/SIRF-Contribs )


Fix ccache refernece.

Fix ccache refernece.

--- cmake/ccache.cmake
+++ cmake/ccache.cmake
@@ -1,9 +1,9 @@
 # Use ccache if found ccache program

-find_program(CCACHE_FOUND ccache)
+find_program(CCACHE_PATH ccache)

-if(CCACHE_FOUND)
+if(CCACHE_PATH)
     message(STATUS "Ccache is founded, use ccache to speed up compile.")
-    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
-    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
-endif(CCACHE_FOUND)+    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE_PATH})
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE_PATH})
+endif(CCACHE_PATH)


Added OpenGL to our list of required Qt modules.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -68,6 +68,7 @@
         Help
         ${MAC_EXTRAS}
         Network
+        OpenGL
         PrintSupport
         Svg
         UiTools


wrong install path

wrong install path

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -178,7 +178,7 @@
   endif ()
     set(LASZIP_INCLUDE_INSTALL_ROOT "include/")
     set(LASZIP_INCLUDE_INSTALL_DIR
-        "${LASZIP_INCLUDE_INSTALL_ROOT}/${PROJECT_NAME_LOWER}/")
+        "${LASZIP_INCLUDE_INSTALL_ROOT}")
     set(LASZIP_DOC_INCLUDE_DIR
         "share/doc/${PROJECT_NAME_LOWER}-${LASZIP_VERSION_MAJOR}.${LASZIP_VERSION_MINOR}")
     set(LASZIP_BIN_INSTALL_DIR "bin")


erthink-cmake: one more fix fetch_version macro.

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -169,32 +169,19 @@
   list(GET ${name}_VERSION_LIST 2 "${name}_VERSION_RELEASE")
   list(GET ${name}_VERSION_LIST 3 "${name}_VERSION_REVISION")

-  if(parent_scope)
-    set(${name}_VERSION_MAJOR ${${name}_VERSION_MAJOR} PARENT_SCOPE)
-    set(${name}_VERSION_MINOR ${${name}_VERSION_MINOR} PARENT_SCOPE)
-    set(${name}_VERSION_RELEASE ${${name}_VERSION_RELEASE} PARENT_SCOPE)
-    set(${name}_VERSION_REVISION ${${name}_VERSION_REVISION} PARENT_SCOPE)
-    set(${name}_VERSION ${${name}_VERSION} PARENT_SCOPE)
+  if(${parent_scope})
+    set(${name}_VERSION_MAJOR "${${name}_VERSION_MAJOR}" PARENT_SCOPE)
+    set(${name}_VERSION_MINOR "${${name}_VERSION_MINOR}" PARENT_SCOPE)
+    set(${name}_VERSION_RELEASE "${${name}_VERSION_RELEASE}" PARENT_SCOPE)
+    set(${name}_VERSION_REVISION "${${name}_VERSION_REVISION}" PARENT_SCOPE)
+    set(${name}_VERSION "${${name}_VERSION}" PARENT_SCOPE)

-    set(${name}_GIT_DESCRIBE ${${name}_GIT_DESCRIBE} PARENT_SCOPE)
-    set(${name}_GIT_TIMESTAMP ${${name}_GIT_TIMESTAMP} PARENT_SCOPE)
-    set(${name}_GIT_TREE ${${name}_GIT_TREE} PARENT_SCOPE)
-    set(${name}_GIT_COMMIT ${${name}_GIT_COMMIT} PARENT_SCOPE)
-    set(${name}_GIT_REVISION ${${name}_GIT_REVISION} PARENT_SCOPE)
-    set(${name}_GIT_VERSION ${${name}_GIT_VERSION} PARENT_SCOPE)
-  else()
-    set(${name}_VERSION_MAJOR ${${name}_VERSION_MAJOR})
-    set(${name}_VERSION_MINOR ${${name}_VERSION_MINOR})
-    set(${name}_VERSION_RELEASE ${${name}_VERSION_RELEASE})
-    set(${name}_VERSION_REVISION ${${name}_VERSION_REVISION})
-    set(${name}_VERSION ${${name}_VERSION})
-
-    set(${name}_GIT_DESCRIBE ${${name}_GIT_DESCRIBE})
-    set(${name}_GIT_TIMESTAMP ${${name}_GIT_TIMESTAMP})
-    set(${name}_GIT_TREE ${${name}_GIT_TREE})
-    set(${name}_GIT_COMMIT ${${name}_GIT_COMMIT})
-    set(${name}_GIT_REVISION ${${name}_GIT_REVISION})
-    set(${name}_GIT_VERSION ${${name}_GIT_VERSION})
+    set(${name}_GIT_DESCRIBE "${${name}_GIT_DESCRIBE}" PARENT_SCOPE)
+    set(${name}_GIT_TIMESTAMP "${${name}_GIT_TIMESTAMP}" PARENT_SCOPE)
+    set(${name}_GIT_TREE "${${name}_GIT_TREE}" PARENT_SCOPE)
+    set(${name}_GIT_COMMIT "${${name}_GIT_COMMIT}" PARENT_SCOPE)
+    set(${name}_GIT_REVISION "${${name}_GIT_REVISION}" PARENT_SCOPE)
+    set(${name}_GIT_VERSION "${${name}_GIT_VERSION}" PARENT_SCOPE)
   endif()
 endmacro(fetch_version)


PythonPackage adds stuff to environment variables

This is not propagated to the outside world, and not necessarily propagated to children processes of
cmake.

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -87,6 +87,10 @@
 include(Utility)
 add_to_envvar(PKG_CONFIG_PATH "${EXTERNAL_ROOT}/lib/pkgconfig" PREPEND OS UNIX)
 add_to_envvar(PKG_CONFIG_PATH "${EXTERNAL_ROOT}/lib64/pkgconfig" PREPEND OS UNIX)
+add_to_envvar(LD_LIBRARY_PATH "${EXTERNAL_ROOT}/lib" PREPEND OS UNIX)
+add_to_envvar(LD_LIBRARY_PATH "${EXTERNAL_ROOT}/lib64" PREPEND OS UNIX)
+add_to_envvar(DYLD_LIBRARY_PATH "${EXTERNAL_ROOT}/lib" PREPEND OS APPLE)
+add_to_envvar(DYLD_LIBRARY_PATH "${EXTERNAL_ROOT}/lib64" PREPEND OS APPLE)

 # Adds a target for all external projects, so they can be made prior to others.
 if(NOT TARGET lookup_dependencies)


modules: updated FindOpenAL.cmake.

modules: updated FindOpenAL.cmake.

--- modules/FindOpenAL.cmake
+++ modules/FindOpenAL.cmake
@@ -46,7 +46,10 @@
 # doesn't print loud messages when it's not found, since that's okay. If the
 # OpenAL target already exists, it means we're using it through a CMake
 # subproject -- don't attempt to find the package in that case.
-if(NOT TARGET OpenAL)
+#
+# In case of Emscripten we don't want any of this -- the library name and
+# includes are implicit.
+if(NOT CORRADE_TARGET_EMSCRIPTEN AND NOT TARGET OpenAL)
     find_package(OpenAL CONFIG QUIET)
 endif()


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -100,10 +100,8 @@
     # if we could extract them, compare with the requested version number
     if (SFML_VERSION_MAJOR)
         # transform version numbers to an integer
-		message(STATUS ${SFML_VERSION_MAJOR})
-		message(STATUS ${SFML_VERSION_MINOR})
-		math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100")
-		message(STATUS ${SFML_VERSION})
+		math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100" )
+
         # compare them
         if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
             set(SFML_VERSION_OK FALSE)


fun3d ugrid conversion test

fun3d ugrid conversion test

--- test/testing.cmake
+++ test/testing.cmake
@@ -62,6 +62,13 @@
 add_test(integrate integrate)
 add_test(qr_test qr)
 add_test(base64 base64)
+
+set(MDIR ${MESHES}/fun3d)
+add_test(from_ugrid
+  from_ugrid
+  "${MDIR}/inviscid_egg.b8.ugrid"
+  "${MDIR}/inviscid_egg.smb")
+
 set(MDIR ${MESHES}/pipe)
 add_test(verify_serial
   verify


remove trailing spaces

remove trailing spaces

--- src/osvr/Macros.cmake
+++ src/osvr/Macros.cmake
@@ -3,9 +3,9 @@
 set(OSVR_BUILDTREE_TARGETS "" CACHE INTERNAL "" FORCE)

 # Get a path to this file
-get_filename_component(_MACROS_DIR
+get_filename_component(_MACROS_DIR
     "${CMAKE_CURRENT_LIST_FILE}" PATH)
-
+
 macro(osvr_append_target _targetlist _target)
     list(APPEND OSVR_${_targetlist}_TARGETS "${_target}")
     set(OSVR_${_targetlist}_TARGETS "${OSVR_${_targetlist}_TARGETS}" CACHE INTERNAL "" FORCE)
@@ -39,7 +39,7 @@

     set_target_properties(${LIBNAME_FULL} PROPERTIES
         FOLDER "${LIB_FOLDER}")
-
+
     configure_file("${_MACROS_DIR}/exportheader.cmake.in"
         Export.h
         @ONLY NEWLINE_STYLE LF)


Don't show status message in 'FindGLM' if 'QUIET' option is set.

The 'QUIET' option of 'find_package' sets the 'GLM_FIND_QUIETLY' option.
This patch makes FindGLM suppress output when this is the case.

--- util/FindGLM.cmake
+++ util/FindGLM.cmake
@@ -59,5 +59,7 @@
 IF(GLM_FOUND)
     SET(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}")

-    MESSAGE(STATUS "GLM_INCLUDE_DIR = ${GLM_INCLUDE_DIR}")
+    IF(NOT GLM_FIND_QUIETLY)
+        MESSAGE(STATUS "GLM_INCLUDE_DIR = ${GLM_INCLUDE_DIR}")
+    ENDIF(NOT GLM_FIND_QUIETLY)
 ENDIF(GLM_FOUND)


[Config] Added FindBoost.cmake, to make it consistent across all platforms


make geotranz_2.4.2.orig.tar.gz available

see issue https://github.com/smanders/externpro/issues/192

--- projects/geotranz.cmake
+++ projects/geotranz.cmake
@@ -18,7 +18,7 @@
   GIT_REF v${VER} # create patch from this tag to 'git checkout'
   PATCH ${PATCH_DIR}/geotranz.patch
   DIFF ${REPO}/compare/
-  DLURL http://geotranz.sourcearchive.com/downloads/${VER}/geotranz_${VER}.orig.tar.gz
+  DLURL https://github.com/smanders/externpro/releases/download/18.04.1/geotranz_${VER}.orig.tar.gz
   DLMD5 1d370d5b0daed2a541a9aa14bd3172a8
   DLMD5_01 48cffaef0651db24c43b8afaee7fbeaf DLDIR_01 ${DLDIR} DLURL_01 ${DLCSV}/README
   DLMD5_02 8e3cb60e597f9bd36d0639406a4cf40a DLDIR_02 ${DLDIR} DLURL_02 ${DLCSV}/compd_cs.csv


[UPD] Add new paths to look for default installation of BTK under Windows.

--- CMake/FindBTK.cmake
+++ CMake/FindBTK.cmake
@@ -49,7 +49,9 @@
     /usr/lib/share

     # Look in standard Windows install locations.
-    "C:\\Program Files\\BTK-debug\\share\\btk-0.1\\CMake"
+    "C:\\Program Files\\BTK\\share\\btk-0.3\\CMake"
+    "C:\\Program Files\\BTK\\share\\btk-0.2\\CMake"
+    "C:\\Program Files\\BTK\\share\\btk-0.1\\CMake"
     "C:\\Program Files (x86)\\BTK"

     # Read from the CMakeSetup registry entries.  It is likely that


cmake: Fix compilation for OCTEONTx

cmake: Fix compilation for OCTEONTx

Change-Id: I7b7183b4603076e5afac096545d820091ee7c495
Signed-off-by: Nitin Saxena <b3d676976800af91d0623208c859384b3d57b696@cavium.com>

--- src/cmake/cpu.cmake
+++ src/cmake/cpu.cmake
@@ -30,12 +30,12 @@
       set(CPU_PART ${value})
      endif()
   endforeach()
-  # Implementer 0x0a1 - Cavium
-  #  Part 0x0a1 - ThunderX
-  if (${CPU_IMPLEMENTER} STREQUAL "0x43" AND ${CPU_PART} STREQUAL "0x0a1")
+  # Implementer 0x43 - Cavium
+  #  Part 0x0af - ThunderX2 is 64B, rest all are 128B
+  if (${CPU_IMPLEMENTER} STREQUAL "0x43" AND ${CPU_PART} STREQUAL "0x0af")
+    set(VPP_LOG2_CACHE_LINE_SIZE 6)
+  else()
     set(VPP_LOG2_CACHE_LINE_SIZE 7)
-  else()
-    set(VPP_LOG2_CACHE_LINE_SIZE 6)
   endif()
   math(EXPR VPP_CACHE_LINE_SIZE "1 << ${VPP_LOG2_CACHE_LINE_SIZE}")
   message(STATUS "ARM AArch64 CPU implementer ${CPU_IMPLEMENTER} part ${CPU_PART} cacheline size ${VPP_CACHE_LINE_SIZE}")


workaround for netgen to use latest netgen/master

--- cMake/FindNETGEN.cmake
+++ cMake/FindNETGEN.cmake
@@ -107,13 +107,19 @@
     file(STRINGS ${NETGEN_DIR_include}/mydefs.hpp NETGEN_VERSION
         REGEX "#define PACKAGE_VERSION.*"
     )
-    string(REGEX MATCHALL "[0-9]+" NETGEN_VERSION ${NETGEN_VERSION})
-    list(LENGTH NETGEN_VERSION NETGEN_VERSION_COUNT)
-    list(GET NETGEN_VERSION 0 NETGEN_VERSION_MAJOR)
-    if(NETGEN_VERSION_COUNT GREATER 1)
-        list(GET NETGEN_VERSION 1 NETGEN_VERSION_MINOR)
-    else()
-        set(NETGEN_VERSION_MINOR 0)
+    if (NETGEN_VERSION)
+	string(REGEX MATCHALL "[0-9]+" NETGEN_VERSION ${NETGEN_VERSION})
+	list(LENGTH NETGEN_VERSION NETGEN_VERSION_COUNT)
+	list(GET NETGEN_VERSION 0 NETGEN_VERSION_MAJOR)
+	if(NETGEN_VERSION_COUNT GREATER 1)
+	    list(GET NETGEN_VERSION 1 NETGEN_VERSION_MINOR)
+	else()
+	    set(NETGEN_VERSION_MINOR 0)
+	endif()
+    else()  # workaround for netgen 6.2 and newer. currently there is no easy way to detect the version
+	    # better use "find_package(netgen CONFIG REQUIRED)"
+	set(NETGEN_VERSION_MAJOR 6)
+	set(NETGEN_VERSION_MINOR 2)
     endif()
 ENDIF()


Rename "append_list_in_cache" CMake macro into "_append_list_in_cache"

Prepending an underscore implicitly mean that the macro is not part
of the API exposed by the "Extensions" module.

--- cmake/Extensions.cmake
+++ cmake/Extensions.cmake
@@ -36,14 +36,6 @@
 # These options convert the extension_name to upper case first and remove any
 # leading underscores.  So add_python_extension(_foo ...) will create the
 # options ENABLE_FOO and BUILTIN_FOO.
-
-macro(append_list_in_cache L)
-  if(ARGN)
-    list(APPEND ${L} ${ARGN})
-    list(REMOVE_DUPLICATES ${L})
-    set(${L} "${${L}}" CACHE INTERNAL "" FORCE)
-  endif()
-endmacro()

 function(add_python_extension name)
     set(options BUILTIN)
@@ -115,11 +107,11 @@

     if(BUILTIN_${upper_name})
         # This will be compiled into libpython instead of as a separate library
-        append_list_in_cache(builtin_extensions ${name})
-        append_list_in_cache(builtin_source ${absolute_sources})
-        append_list_in_cache(builtin_link_libraries ${ADD_PYTHON_EXTENSION_LIBRARIES})
-        append_list_in_cache(builtin_includedirs ${ADD_PYTHON_EXTENSION_INCLUDEDIRS})
-        append_list_in_cache(builtin_definitions ${ADD_PYTHON_EXTENSION_DEFINITIONS})
+        _append_list_in_cache(builtin_extensions ${name})
+        _append_list_in_cache(builtin_source ${absolute_sources})
+        _append_list_in_cache(builtin_link_libraries ${ADD_PYTHON_EXTENSION_LIBRARIES})
+        _append_list_in_cache(builtin_includedirs ${ADD_PYTHON_EXTENSION_INCLUDEDIRS})
+        _append_list_in_cache(builtin_definitions ${ADD_PYTHON_EXTENSION_DEFINITIONS})
     elseif(WIN32 AND NOT BUILD_SHARED)
         # Extensions cannot be built against a static libpython on windows
     else(BUILTIN_${upper_name})
@@ -180,3 +172,11 @@
         message(STATUS "")
     endif(extensions_disabled)
 endfunction(show_extension_summary)
+
+macro(_append_list_in_cache L)
+  if(ARGN)
+    list(APPEND ${L} ${ARGN})
+    list(REMOVE_DUPLICATES ${L})
+    set(${L} "${${L}}" CACHE INTERNAL "" FORCE)
+  endif()
+endmacro()


Sync FindEigen3.cmake with the version from Eigen3 repo

Taken from https://gitlab.com/libeigen/eigen/-/blob/6fb3e5f1767855bc1a8aa3c868bc7fbf0eeb67ef/cmake/FindEigen3.cmake .

As all the platforms that we support now install properly formed `Eigen3Config.cmake`, in any case this file will be removed in the next feature release of iDynTree. However, this fix make sure that iDynTree 1.0.* does not create problems with dependencies that require the Eigen3::Eigen target to be defined, see for example https://github.com/robotology/osqp-eigen/issues/61 .

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -10,8 +10,12 @@
 #  EIGEN3_INCLUDE_DIR - the eigen include directory
 #  EIGEN3_VERSION - eigen version
 #
+# and the following imported target:
+#
+#  Eigen3::Eigen - The header-only Eigen library
+#
 # This module reads hints about search locations from
-# the following enviroment variables:
+# the following environment variables:
 #
 # EIGEN3_ROOT
 # EIGEN3_ROOT_DIR
@@ -24,16 +28,16 @@
 if(NOT Eigen3_FIND_VERSION)
   if(NOT Eigen3_FIND_VERSION_MAJOR)
     set(Eigen3_FIND_VERSION_MAJOR 2)
-  endif(NOT Eigen3_FIND_VERSION_MAJOR)
+  endif()
   if(NOT Eigen3_FIND_VERSION_MINOR)
     set(Eigen3_FIND_VERSION_MINOR 91)
-  endif(NOT Eigen3_FIND_VERSION_MINOR)
+  endif()
   if(NOT Eigen3_FIND_VERSION_PATCH)
     set(Eigen3_FIND_VERSION_PATCH 0)
-  endif(NOT Eigen3_FIND_VERSION_PATCH)
+  endif()

   set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
-endif(NOT Eigen3_FIND_VERSION)
+endif()

 macro(_eigen3_check_version)
   file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
@@ -48,42 +52,56 @@
   set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
   if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
     set(EIGEN3_VERSION_OK FALSE)
-  else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+  else()
     set(EIGEN3_VERSION_OK TRUE)
-  endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
+  endif()

   if(NOT EIGEN3_VERSION_OK)

     message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
                    "but at least version ${Eigen3_FIND_VERSION} is required")
-  endif(NOT EIGEN3_VERSION_OK)
-endmacro(_eigen3_check_version)
+  endif()
+endmacro()

 if (EIGEN3_INCLUDE_DIR)

   # in cache already
   _eigen3_check_version()
   set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
+  set(Eigen3_FOUND ${EIGEN3_VERSION_OK})

-else (EIGEN3_INCLUDE_DIR)
+else ()
+
+  # search first if an Eigen3Config.cmake is available in the system,
+  # if successful this would set EIGEN3_INCLUDE_DIR and the rest of
+  # the script will work as usual
+  find_package(Eigen3 ${Eigen3_FIND_VERSION} NO_MODULE QUIET)

-  find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
-      HINTS
-      ENV EIGEN3_ROOT
-      ENV EIGEN3_ROOT_DIR
-      PATHS
-      ${CMAKE_INSTALL_PREFIX}/include
-      ${KDE4_INCLUDE_DIR}
-      PATH_SUFFIXES eigen3 eigen
-    )
+  if(NOT EIGEN3_INCLUDE_DIR)
+    find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
+        HINTS
+        ENV EIGEN3_ROOT
+        ENV EIGEN3_ROOT_DIR
+        PATHS
+        ${CMAKE_INSTALL_PREFIX}/include
+        ${KDE4_INCLUDE_DIR}
+        PATH_SUFFIXES eigen3 eigen
+      )
+  endif()

   if(EIGEN3_INCLUDE_DIR)
     _eigen3_check_version()
-  endif(EIGEN3_INCLUDE_DIR)
+  endif()
+
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)

   mark_as_advanced(EIGEN3_INCLUDE_DIR)

-endif(EIGEN3_INCLUDE_DIR)
+endif()

-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
+if(EIGEN3_FOUND AND NOT TARGET Eigen3::Eigen)
+  add_library(Eigen3::Eigen INTERFACE IMPORTED)
+  set_target_properties(Eigen3::Eigen PROPERTIES
+    INTERFACE_INCLUDE_DIRECTORIES "${EIGEN3_INCLUDE_DIR}")
+endif()


CMake: Findsodium: Add back old SODIUM_ROOT_DIR variable

--- cmake/Findsodium.cmake
+++ cmake/Findsodium.cmake
@@ -59,13 +59,13 @@
     endif()

     find_path(sodium_INCLUDE_DIR sodium.h
-        HINTS ${${XPREFIX}_INCLUDE_DIRS}
+        HINTS ${SODIUM_ROOT_DIR}/include ${${XPREFIX}_INCLUDE_DIRS}
     )
     find_library(sodium_LIBRARY_DEBUG NAMES ${${XPREFIX}_LIBRARIES} sodium
-        HINTS ${${XPREFIX}_LIBRARY_DIRS}
+        HINTS ${SODIUM_ROOT_DIR}/lib ${${XPREFIX}_LIBRARY_DIRS}
     )
     find_library(sodium_LIBRARY_RELEASE NAMES ${${XPREFIX}_LIBRARIES} sodium
-        HINTS ${${XPREFIX}_LIBRARY_DIRS}
+        HINTS ${SODIUM_ROOT_DIR}/lib ${${XPREFIX}_LIBRARY_DIRS}
     )

@@ -76,7 +76,7 @@
     mark_as_advanced(sodium_DIR)

     find_path(sodium_INCLUDE_DIR sodium.h
-        HINTS ${sodium_DIR}
+        HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
         PATH_SUFFIXES include
     )

@@ -122,21 +122,21 @@
         string(REPLACE "$$CONFIG$$" "Release" _RELEASE_PATH_SUFFIX "${_PLATFORM_PATH}")

         find_library(sodium_LIBRARY_DEBUG libsodium.lib
-            HINTS ${sodium_DIR}
+            HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
             PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX}
         )
         find_library(sodium_LIBRARY_RELEASE libsodium.lib
-            HINTS ${sodium_DIR}
+            HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
             PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX}
         )
         if (NOT sodium_USE_STATIC_LIBS)
             set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
             find_library(sodium_DLL_DEBUG libsodium
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES ${_DEBUG_PATH_SUFFIX}
             )
             find_library(sodium_DLL_RELEASE libsodium
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES ${_RELEASE_PATH_SUFFIX}
             )
         endif()
@@ -144,20 +144,20 @@
     elseif(_GCC_COMPATIBLE)
         if (sodium_USE_STATIC_LIBS)
             find_library(sodium_LIBRARY_DEBUG libsodium.a
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES lib
             )
             find_library(sodium_LIBRARY_RELEASE libsodium.a
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES lib
             )
         else()
             find_library(sodium_LIBRARY_DEBUG libsodium.dll.a
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES lib
             )
             find_library(sodium_LIBRARY_RELEASE libsodium.dll.a
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES lib
             )

@@ -167,11 +167,11 @@
                 "${sodium_DIR}/bin/libsodium*.dll"
             )
             find_library(sodium_DLL_DEBUG ${_DLL} libsodium
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES bin
             )
             find_library(sodium_DLL_RELEASE ${_DLL} libsodium
-                HINTS ${sodium_DIR}
+                HINTS ${SODIUM_ROOT_DIR} ${sodium_DIR}
                 PATH_SUFFIXES bin
             )
         endif()


Use target_link_options() instead of target_link_libraries() for sanitizer options

--- cmake/Sanitizers.cmake
+++ cmake/Sanitizers.cmake
@@ -59,7 +59,7 @@
        STREQUAL
        "")
       target_compile_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
-      target_link_libraries(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
+      target_link_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS})
     endif()
   endif()


Refactoring tbag_config__set_library_prefix() cmake method.

--- cmake/TbagConfig.cmake
+++ cmake/TbagConfig.cmake
@@ -93,10 +93,17 @@
 #///
 #/// @param __value [in] value name.
 macro (tbag_config__set_library_prefix __value)
-    if (DEFINED THIRD_PREFIX)
+    set (${__value} "/usr/local") # DEFAULT SETTING.
+    tbag_utils__get_args_size (__library_prefix_arg_length ${ARGN})
+    if (${__library_prefix_arg_length} GREATER 0)
+        foreach (__library_prefix_cursor ${ARGN})
+            if (IS_DIRECTORY "${__library_prefix_cursor}")
+                set (${__value} "${__library_prefix_cursor}")
+                break ()
+            endif ()
+        endforeach ()
+    elseif (DEFINED THIRD_PREFIX)
         set (${__value} "${THIRD_PREFIX}")
-    else ()
-        set (${__value} "/usr/local")
     endif ()
     set (${__value} "${${__value}}" CACHE PATH "Library prefix directory.")
 endmacro ()


revert check_reqs.cmake

revert check_reqs.cmake

--- cmake/check_reqs.cmake
+++ cmake/check_reqs.cmake
@@ -2,7 +2,7 @@

 get_property(nacl_required GLOBAL PROPERTY NACL_REQUIRED)
 if(${nacl_required})
-  if("${NACL_LIBRARIES}" STREQUAL "" AND "${NACL_LDFLAGS_OTHER}" STREQUAL "")
+  if("${NACL_LIBRARIES}" STREQUAL "")
     if(ENABLE_LIBSODIUM)
       message(FATAL_ERROR "libsodium is not available, but a selected module needs it")
     else(ENABLE_LIBSODIUM)


joedbc.cmake works in Windows (cygwin + msvc)

--- compcmake/joedbc.cmake
+++ compcmake/joedbc.cmake
@@ -1,7 +1,12 @@
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ set(JOEDB_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../../../../repos/joedb/compcmake/out/build/x64-Release)
+else()
+ set(JOEDB_HINTS ${CMAKE_CURRENT_SOURCE_DIR}/../../../../repos/joedb/compcmake/gcc_release)
+endif()
+
 find_program(JOEDBC joedbc
  HINTS
-  ~/repos/joedb/compcmake/gcc_release
-  ~/repos/joedb/compcmake/out/build/x64-Release
+  ${JOEDB_HINTS}
   ../../../../../usr/local/bin
   ../../../../../../usr/local/bin
   ../../../../../../../usr/local/bin
@@ -9,8 +14,7 @@

 find_library(JOEDB_LIB joedb
  HINTS
-  ~/repos/joedb/compcmake/gcc_release
-  ~/repos/joedb/compcmake/out/build/x64-Release
+  ${JOEDB_HINTS}
   ../../../../../usr/local/lib
   ../../../../../../usr/local/lib
   ../../../../../../../usr/local/lib


joedbc.cmake: target_uses_joedb function + HINT to repos first

--- compcmake/joedbc.cmake
+++ compcmake/joedbc.cmake
@@ -1,10 +1,23 @@
 find_program(JOEDBC joedbc
  HINTS
+  ~/repos/joedb/compcmake/gcc_release
+  ~/repos/joedb/compcmake/out/build/x64-Release
   ../../../../../usr/local/bin
   ../../../../../../usr/local/bin
   ../../../../../../../usr/local/bin
 )
-message("== joedbc: ${JOEDBC}")
+
+find_library(JOEDB_LIB joedb
+ HINTS
+  ~/repos/joedb/compcmake/gcc_release
+  ~/repos/joedb/compcmake/out/build/x64-Release
+  ../../../../../usr/local/lib
+  ../../../../../../usr/local/lib
+  ../../../../../../../usr/local/lib
+)
+
+message("== JOEDBC = ${JOEDBC}")
+message("== JOEDB_LIB = ${JOEDB_LIB}")

 add_custom_target(all_joedbc)

@@ -34,3 +47,10 @@
  endif()
  add_dependencies(all_joedbc compile_${namespace}_with_joedbc)
 endfunction(joedbc_build)
+
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+function(target_uses_joedb)
+#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ add_dependencies(${ARGV0} all_joedbc)
+ target_link_libraries(${ARGV0} ${JOEDB_LIB})
+endfunction(target_uses_joedb)


build

build

--- modules/HdrHistogram.cmake
+++ modules/HdrHistogram.cmake
@@ -2,6 +2,7 @@

   # Module library
   file(GLOB SOURCE_FILES "HdrHistogram/src/*.c")
+  list(FILTER SOURCE_FILES EXCLUDE REGEX ".*/hdr_histogram_log_no_op.c")
   if(MSVC)
     # C4057: 'operator' : 'identifier1' indirection to slightly different base types from 'identifier2'
     # C4146: unary minus operator applied to unsigned type, result still unsigned


vigra.cmake: comment.

vigra.cmake: comment.

--- vigra.cmake
+++ vigra.cmake
@@ -83,7 +83,7 @@
         -DFFTW3_LIBRARY=${BUILDEM_DIR}/lib/libfftw3.${BUILDEM_PLATFORM_DYLIB_EXTENSION}
         -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -pthread"
         -DCMAKE_CXX_LINK_FLAGS="${CMAKE_CXX_LINK_FLAGS} -pthread"
-        -DCMAKE_CXX_FLAGS_RELEASE="${CMAKE_CXX_FLAGS_RELEASE}"
+        -DCMAKE_CXX_FLAGS_RELEASE="${CMAKE_CXX_FLAGS_RELEASE}" # On the Janelia cluster, use -DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" (not -O3)
         -DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}"
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)
     TEST_COMMAND        ${BUILDEM_ENV_STRING} $(MAKE) check


fix phonon_export for methodtest under mingw

svn path=/trunk/KDE/kdelibs/phonon/; revision=672230

--- phonon_export.h.cmake
+++ phonon_export.h.cmake
@@ -25,27 +25,35 @@
 #cmakedefine __KDE_HAVE_GCC_VISIBILITY
 #endif

-#ifdef __KDE_HAVE_GCC_VISIBILITY
-
-# define PHONON_NO_EXPORT __attribute__ ((visibility("hidden")))
-# define PHONON_EXPORT __attribute__ ((visibility("default")))
-
-#elif defined(_WIN32) || defined(_WIN64)
-
+#ifdef PHONON_EXPORT
+  /* We are building a test case */
 # define PHONON_NO_EXPORT
-# if defined(MAKE_PHONON_LIB)
-   /* We are building this library */
-#  define PHONON_EXPORT __declspec(dllexport)
-# else
-   /* We are using this library */
-#  define PHONON_EXPORT __declspec(dllimport)
-# endif

 #else
+  /* We are not building a test case */

-# define PHONON_NO_EXPORT
-# define PHONON_EXPORT
+# ifdef __KDE_HAVE_GCC_VISIBILITY

+#  define PHONON_NO_EXPORT __attribute__ ((visibility("hidden")))
+#  define PHONON_EXPORT __attribute__ ((visibility("default")))
+
+# elif defined(_WIN32) || defined(_WIN64)
+
+#  define PHONON_NO_EXPORT
+#  if defined(MAKE_PHONON_LIB)
+    /* We are building this library */
+#   define PHONON_EXPORT __declspec(dllexport)
+#  else
+    /* We are using this library */
+#   define PHONON_EXPORT __declspec(dllimport)
+#  endif
+
+# else
+
+#  define PHONON_NO_EXPORT
+#  define PHONON_EXPORT
+
+# endif
 #endif

 #ifndef PHONON_EXPORT_DEPRECATED


Use canonical cmake way of setting PIC/PIE

--- Common.cmake
+++ Common.cmake
@@ -153,14 +153,6 @@
   endif()
 endif()

-#-----------------------------------------------------------------------------
-# Add needed flag for gnu on linux like enviroments to build static common libs
-# suitable for linking with shared object libs.
-if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-  if(NOT "${CMAKE_CXX_FLAGS}" MATCHES "-fPIC")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
-  endif()
-  if(NOT "${CMAKE_C_FLAGS}" MATCHES "-fPIC")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
-  endif()
+if(NOT CMAKE_POSITION_INDEPENDENT_CODE)
+  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
 endif()


ilastik-gui.cmake: Updated launch script and added a test step.  Also, removed vtk dependency since we aren't building vtk yet and vtk is an optional dependency for ilastik.

--- ilastik-gui.cmake
+++ ilastik-gui.cmake
@@ -19,14 +19,14 @@
 include (qt4)
 include (pyqt4)
 include (qimage2ndarray)
-include (vtk)
+#include (vtk)

 set (ilastik-gui_NAME ilastik-gui-HEAD)

-# Add a few dependencies to headless ilastik build
+# Add a few dependencies to GUI ilastik build
 add_custom_target (${ilastik-gui_NAME} ALL
-    DEPENDS     ${ilastik_NAME} ${qt4_NAME} ${pyqt4_NAME} {qimage2ndarray_NAME}
-                ${vtk_NAME}
+    DEPENDS     ${ilastik_NAME} ${qt4_NAME} ${pyqt4_NAME} ${qimage2ndarray_NAME}
+                #${vtk_NAME}
     COMMENT     "Building ilastik gui and all dependencies...")

@@ -37,12 +37,14 @@
         --exe
         ${TEMPLATE_DIR}/setenv_ilastik_gui.template
         ${FLYEM_BUILD_DIR}/bin/setenv_ilastik_gui.sh
+        ${FLYEM_LD_LIBRARY_VAR}
         ${FLYEM_BUILD_DIR}
         ${ilastik_SRC_DIR}
+        ${PYTHON_PREFIX}
     COMMENT     "Added ilastik gui environment script to bin directory"
 )

-# Add headless launch and test scripts
+# Add gui launch and test scripts
 ExternalProject_add_step(${ilastik_NAME}  install_gui_launch
     DEPENDEES   install_gui_env_script
     COMMAND     ${TEMPLATE_EXE}
@@ -65,5 +67,12 @@
     COMMENT     "Added ilastik gui test command to bin directory"
 )

+# Run the gui test script
+ExternalProject_add_step(${ilastik_NAME}  test_ilastik_gui
+    DEPENDEES   install_gui_test
+    COMMAND     ${FLYEM_ENV_STRING} ${FLYEM_BUILD_DIR}/bin/ilastik_gui_test
+    COMMENT     "Ran ilastik gui test"
+)
+
 endif (NOT ilastik-gui_NAME)


set of c++ compiler added to find petsc

set of c++ compiler added to find petsc

--- util/cmake/load_petsc.cmake
+++ util/cmake/load_petsc.cmake
@@ -15,15 +15,14 @@
 		find_package(PETSc)

 		include_directories(${PETSC_INCLUDES})
+
+		set(CMAKE_CXX_COMPILER "${PETSC_DIR}/${PETSC_ARCH}/bin/mpicxx")
 	endif()

 	# append to flags definitions
 	set(FLAGS_DEF "-USE_PETSC ${FLAGS_DEF}")
 	set(FLAGS_DEF_D "-DUSE_PETSC ${FLAGS_DEF_D}")
 	set(LIBRARIES_DEF ${PETSC_LIBRARIES} ${LIBRARIES_DEF})
-#	set(LIBRARIES_DEF ${PETSC_LIBRARIES} ${LIBRARIES_DEF})
-
-	set(CMAKE_CXX_COMPILER "${PETSC_DIR}/${PETSC_ARCH}/bin/mpicxx")

 endif()


[axl] release 5.5.6

[axl] release 5.5.6

[graco] release 1.2.1
[jancy] release 1.7.1

--- version.cmake
+++ version.cmake
@@ -2,7 +2,7 @@

 set (AXL_VERSION_MAJOR     5)
 set (AXL_VERSION_MINOR     5)
-set (AXL_VERSION_REVISION  5)
+set (AXL_VERSION_REVISION  6)
 set (AXL_VERSION_TAG)

 set (AXL_VERSION_FILE_SUFFIX "${AXL_VERSION_MAJOR}.${AXL_VERSION_MINOR}.${AXL_VERSION_REVISION}")


Nagios Monitoring 8.4.0-rc1 Release Candidate 1

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -4,8 +4,8 @@
 set ( HPCC_NAME "Nagios Monitoring" )
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
-set ( HPCC_MINOR 3 )
+set ( HPCC_MINOR 4 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "trunk" )
-set ( HPCC_SEQUENCE 0 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 1 )
 ###


Working towards dynamic boost libs on Windows

--- Common.cmake
+++ Common.cmake
@@ -65,9 +65,6 @@
 endif()

 # Boost settings
-if(MSVC)
-  option(Boost_USE_STATIC_LIBS "Use boost static libs" ON)
-endif()
 if(BOOST_ROOT)
   set(Boost_NO_SYSTEM_PATHS TRUE)
 endif()


Use install-time variable for consistency.

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -55,7 +55,7 @@

       set(_bundle_dest_dir \"${_bundle_dest_dir}\")
       if(_bundle_dest_dir)
-        set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}/plugins\")
+        set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/\${_bundle_dest_dir}/plugins\")
       else()
         set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/bin/plugins\")
       endif()


Make cmake append libs dwarf and elf

Make cmake append libs dwarf and elf

Without this they are not correctly included in BACKWARD_LIBRARIES even
when they are found.

--- BackwardConfig.cmake
+++ BackwardConfig.cmake
@@ -133,7 +133,7 @@
 	endif()

 	if (STACK_DETAILS_DWARF)
-		LIST(APPEND BACKWARD_LIBRARIES dwarf elf)
+		LIST(APPEND _BACKWARD_LIBRARIES dwarf elf)
 	endif()
 endif()


COMP: use two different names for proper status message

--- CMake/FindFFTW.cmake
+++ CMake/FindFFTW.cmake
@@ -49,7 +49,7 @@
     # handle the QUIETLY and REQUIRED arguments and set FFTWD_FOUND to TRUE if
     # all listed variables are TRUE
     INCLUDE(FindPackageHandleStandardArgs)
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW DEFAULT_MSG FFTWD_LIB FFTW_INCLUDE_PATH)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTWD DEFAULT_MSG FFTWD_LIB FFTW_INCLUDE_PATH)

     IF(FFTWD_LIB)
       SET(FFTWD_FOUND 1)
@@ -69,7 +69,7 @@
     # handle the QUIETLY and REQUIRED arguments and set FFTWD_FOUND to TRUE if
     # all listed variables are TRUE
     INCLUDE(FindPackageHandleStandardArgs)
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTW DEFAULT_MSG FFTWF_LIB FFTW_INCLUDE_PATH)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFTWF DEFAULT_MSG FFTWF_LIB FFTW_INCLUDE_PATH)

     IF(FFTWF_LIB)
       SET(FFTWF_FOUND 1)


fix for findzip.cmake

fix for findzip.cmake

--- CMake/FindZZIP.cmake
+++ CMake/FindZZIP.cmake
@@ -8,15 +8,9 @@
 find_library(ZZIP_LIB_DBG NAMES zzipd libzzipd zzip_d libzzip_d PATH_SUFFIXES dynamic)
 mark_as_advanced(ZZIP_H_PATH ZZIP_LIB ZZIP_LIB_DBG)

-if (WIN32 OR APPLE)
-    find_library(ZZIP_LIB_STATIC NAMES zzip libzzip zzip libzzip PATH_SUFFIXES static)
-    find_library(ZZIP_LIB_STATIC_DBG NAMES zzipd libzzipd zzip_d libzzip_d PATH_SUFFIXES static)
-    set( ZZIP_DEFINITIONS_STATIC "ZZIP_LIB" CACHE STRING "preprocessor definitions" )
-    mark_as_advanced(ZZIP_DEFINITIONS_STATIC ZZIP_LIB_STATIC ZZIP_LIB_STATIC_DBG)
+if (ZZIP_H_PATH AND ZZIP_LIB)
+  set(ZZIP_FOUND TRUE)
 endif()
-
-cegui_find_package_handle_standard_args(ZZIP ZZIP_LIB ZZIP_H_PATH)
-

 # set up output vars
 if (ZZIP_FOUND)
@@ -25,13 +19,8 @@
     if (ZZIP_LIB_DBG)
         set (ZZIP_LIBRARIES_DBG ${ZZIP_LIB_DBG})
     endif()
-    if (ZZIP_LIB_STATIC)
-        set (ZZIP_LIBRARIES_STATIC ${ZZIP_LIB_STATIC})
-    endif()
-    if (ZZIP_LIB_STATIC_DBG)
-        set (ZZIP_LIBRARIES_STATIC_DBG ${ZZIP_LIB_STATIC_DBG})
-    endif()
 else()
+  unset
     set (ZZIP_INCLUDE_DIR)
     set (ZZIP_LIBRARIES)
     set (ZZIP_LIBRARIES_DBG)


Updating ITK Superbuild version to just before 4.10.1 release

Change-Id: I58abf85d4f64ba0f9d804ae390d666ed09c32563

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -40,7 +40,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 8565bd9b4bc4446b05554e11ccb27bda1d6db647 ) # just after 4.10.0 release
+set(ITK_TAG_COMMAND GIT_TAG 0ab6b7b7dbcca3b91a4a4c3a57975d297046ef61 ) # just before 4.10.1 release

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


enh: Alternative basis_find_package versions as VERSION argument [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -231,13 +231,13 @@
   # tokenize dependency specification
   basis_tokenize_dependency ("${PACKAGE}" PKG _BFP_VERSIONS _BFP_COMPONENTS)
   list (GET _BFP_ARGN_UNPARSED_ARGUMENTS 0 _BFP_VERSION)
-  if (_BFP_VERSION MATCHES "^[0-9]+(\\.[0-9]+)*$")
+  if (_BFP_VERSION MATCHES "^[0-9]+(\\.[0-9]+)*(\\|[0-9]+(\\.[0-9]+)*)*$")
     if (_BFP_VERSIONS)
       message (FATAL_ERROR "Cannot use both version specification as part of "
                            "package name and explicit version argument.")
     endif ()
     list (REMOVE_AT _BFP_ARGN_UNPARSED_ARGUMENTS 0)
-    set (_BFP_VERSIONS "${_BFP_VERSION}")
+    string(REPLACE "|" ";" _BFP_VERSIONS ${_BFP_VERSION})
   endif ()
   list (LENGTH _BFP_VERSIONS _BFP_VERSIONS_COUNT)
   if (_BFP_ARGN_MODULE AND _BFP_VERSIONS GREATER 1)


fix: Add INSTALL_<LANG>_SITE_DIR to script module paths [Basis]

Add INSTALL_<LANG>_SITE_DIR to script module paths when BASIS_INSTALL_SITE_PACKAGES=OFF.

--- CMake/Basis/TargetTools.cmake
+++ CMake/Basis/TargetTools.cmake
@@ -2878,6 +2878,13 @@
   endif ()
   if (BINARY_${LANGUAGE}_LIBRARY_DIR)
     list (INSERT BUILD_LINK_DEPENDS 0 "${BINARY_${LANGUAGE}_LIBRARY_DIR}")
+  endif ()
+  if (INSTALL_${LANGUAGE}_SITE_DIR AND NOT BASIS_INSTALL_SITE_PACKAGES)
+    if (IS_ABSOLUTE "${INSTALL_${LANGUAGE}_SITE_DIR}")
+      list (INSERT INSTALL_LINK_DEPENDS 0 "${INSTALL_${LANGUAGE}_SITE_DIR}")
+    else ()
+      list (INSERT INSTALL_LINK_DEPENDS 0 "relative ${CMAKE_INSTALL_PREFIX}/${INSTALL_${LANGUAGE}_SITE_DIR}")
+    endif ()
   endif ()
   if (INSTALL_${LANGUAGE}_LIBRARY_DIR)
     list (INSERT INSTALL_LINK_DEPENDS 0 "relative ${CMAKE_INSTALL_PREFIX}/${INSTALL_${LANGUAGE}_LIBRARY_DIR}")


Clone head of master branch

Clone head of master branch

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,13 +13,13 @@

 if(BUILD_TESTING)

-  set(revision_tag da5dd4ff) # first 8 characters of hash-tag
+# set(revision_tag da5dd4ff) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}
     SOURCE_DIR ${proj}
     GIT_REPOSITORY https://phabricator.mitk.org/source/mitkdata.git
-    GIT_TAG ${revision_tag}
+#   GIT_TAG ${revision_tag}
 #   URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/mitk-data_${revision_tag}.tar.gz
 #   UPDATE_COMMAND ""
     CONFIGURE_COMMAND ""


Remove OpenCV module related message.

Remove OpenCV module related message.

--- cmake/TbagFindPackage/FindTbagOpenCV.cmake
+++ cmake/TbagFindPackage/FindTbagOpenCV.cmake
@@ -20,7 +20,7 @@
     if (IS_DIRECTORY "/usr/local/share/OpenCV")
         set (__tbag_opencv_module_dir "/usr/local/share/OpenCV")
     else ()
-        message (WARNING "Not found OpenCV Modules directory: ${__tbag_opencv_module_dir}")
+        #message (WARNING "Not found OpenCV Modules directory: ${__tbag_opencv_module_dir}")
     endif ()
 endif ()


Remooved NVCONTROL option

Remooved NVCONTROL option


PKG: update dependency chain  for PACKAGE-TOOLS

--- SuperBuild/CMake/External_pkgtools.cmake
+++ SuperBuild/CMake/External_pkgtools.cmake
@@ -45,7 +45,6 @@
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
   INSTALL_COMMAND ""
-  DEPENDS PATCHELF
   )

 if(APPLE)
@@ -65,6 +64,7 @@
   TMP_DIR             "${PATCHELF_TMP_DIR}"
   CONFIGURE_COMMAND "./configure" "--prefix" "${PATCHELF_INSTALL_DIR}"
   INSTALL_COMMAND ""
+  DEPENDS MAKESELF
   )

-add_custom_target(PACKAGE-TOOLS DEPENDS MAKESELF)
+add_custom_target(PACKAGE-TOOLS DEPENDS PATCHELF)


PKG: skip gtk libs in xdk build

PKG: skip gtk libs in xdk build

--- SuperBuild/Packaging/PackageHelper.cmake
+++ SuperBuild/Packaging/PackageHelper.cmake
@@ -474,6 +474,11 @@
 	)
       set(SKIP_INSTALL TRUE)
     endif()
+
+    if(is_gtk_lib)
+      set(SKIP_INSTALL TRUE)
+    endif()
+
   endif()

   if(NOT SKIP_INSTALL)


Fix file_write_once function and make it process-safe.

--- src/inserts/functions.cmake
+++ src/inserts/functions.cmake
@@ -131,8 +131,11 @@
 ########################################

 function(file_write_once f c)
-    if (NOT EXISTS ${f})
-        file(WRITE ${f} "${c}")
+    # multiple instances safe
+    set(once ${f}.cppan.once)
+    if (NOT EXISTS ${once})
+        file_write_safe(${f} "${c}")
+        file(WRITE ${once} "")
     endif()
 endfunction(file_write_once)


Fixed for the case where only some modules are downloaded using 'modname' option.

--- modules/DownloadModules.cmake
+++ modules/DownloadModules.cmake
@@ -75,7 +75,7 @@
     endif (allmodules)

     # Download
-    if (_getmod)
+    if ("${_getmod}" EQUAL 1)
       message ("Downloading module '${_modname}'...")
       # We try three times, to account for network weirdnesses
       foreach (i 1 2 3)
@@ -121,12 +121,12 @@
 	endif ("${_status}" EQUAL 0)

       endforeach (i)
-    endif (_getmod)

     # Ensure we successfully downloaded something good
     if (NOT EXISTS "${outdir}/${_modname}/CMakeLists.txt")
       message (FATAL_ERROR "Failed to download '${_modname}' after 3 attempts, giving up.")
     endif (NOT EXISTS "${outdir}/${_modname}/CMakeLists.txt")

+    endif ("${_getmod}" EQUAL 1)
   endif (modline)
 endforeach (modline)


Added rapidjson, pbjson.hpp, bin2ascii.h and any protobuf created files to the coverage ignore list.

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -55,7 +55,7 @@

         # Capture coverage data.
         COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --compat-libtool --directory . --capture --output-file ${_outputname}.info
-        COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' 'tools/*' '3rdParty/*' 'protobuf/*' --output-file ${_outputname}.info.cleaned
+        COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' 'tools/*' '3rdParty/*' 'protobuf/*' '*.pb.*' 'rapidjson/*' 'pbjson.hpp' 'bin2ascii.h' --output-file ${_outputname}.info.cleaned

         # Generating the report.
         COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned


force cmake options of flatbuffers. change cudnn.cmake include path to absolute path.

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -37,14 +37,14 @@
   list(APPEND mlfe_library_dependencies flatbuffers)
 else()
   message(STATUS "[Can not find flatbuffers. Using third party dir.]")
-  set(FLATBUFFERS_CODE_COVERAGE OFF)
-  set(FLATBUFFERS_BUILD_TESTS OFF)
-  set(FLATBUFFERS_INSTALL OFF)
-  set(FLATBUFFERS_BUILD_FLATLIB ON)
-  set(FLATBUFFERS_BUILD_FLATC ON)
-  set(FLATBUFFERS_BUILD_FLATHASH OFF)
-  set(FLATBUFFERS_BUILD_GRPCTEST OFF)
-  set(FLATBUFFERS_BUILD_SHAREDLIB OFF)
+  set(FLATBUFFERS_CODE_COVERAGE OFF CACHE BOOL "FLATBUFFERS_CODE_COVERAGE" FORCE)
+  set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "FLATBUFFERS_BUILD_TESTS" FORCE)
+  set(FLATBUFFERS_INSTALL OFF CACHE BOOL "FLATBUFFERS_INSTALL" FORCE)
+  set(FLATBUFFERS_BUILD_FLATLIB ON CACHE BOOL "FLATBUFFERS_BUILD_FLATLIB" FORCE)
+  set(FLATBUFFERS_BUILD_FLATC ON CACHE BOOL "FLATBUFFERS_BUILD_FLATC" FORCE)
+  set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "FLATBUFFERS_BUILD_FLATHASH" FORCE)
+  set(FLATBUFFERS_BUILD_GRPCTEST OFF CACHE BOOL "FLATBUFFERS_BUILD_GRPCTEST" FORCE)
+  set(FLATBUFFERS_BUILD_SHAREDLIB OFF CACHE BOOL "FLATBUFFERS_BUILD_SHAREDLIB" FORCE)
   add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/flatbuffers)
   list(APPEND mlfe_include_dirs ${PROJECT_SOURCE_DIR}/third_party/flatbuffers/include)
   list(APPEND mlfe_library_dependencies flatbuffers)
@@ -54,7 +54,7 @@
   find_package(OpenCV REQUIRED)
 endif()

-include(cmake/cudnn.cmake)
+include(${PROJECT_SOURCE_DIR}/cmake/cudnn.cmake)

 if(USE_CUDA)
     find_package(CUDA REQUIRED)


Attempt to fix #1580 - building OpenCV with ffmpeg not in LD_LIBRARY_PATH

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -285,12 +285,21 @@

   #resolve dependencies
   __ocv_flatten_module_dependencies()
+
+  #order modules by dependencies
+  set(OPENCV_MODULES_BUILD_ "")
+  foreach(m ${OPENCV_MODULES_BUILD})
+    list(APPEND OPENCV_MODULES_BUILD_ ${OPENCV_MODULE_${m}_DEPS} ${m})
+  endforeach()
+  ocv_list_unique(OPENCV_MODULES_BUILD_)

   #create modules
   set(OPENCV_INITIAL_PASS OFF)
-  foreach(m ${OPENCV_MODULES_BUILD})
-    string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
-    add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
+  foreach(m ${OPENCV_MODULES_BUILD_})
+    if(m MATCHES "^opencv_")
+      string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
+      add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}")
+    endif()
   endforeach()
   unset(__shortname)
 endmacro()


determine test category (Public vs Extra) based on module location

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -764,8 +764,16 @@
       if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH)
         add_test(NAME ${the_target} COMMAND ${the_target} --perf_min_samples=1 --perf_force_samples=1 --perf_verify_sanity)

+        get_filename_component(cur_modules_loc "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
+        get_filename_component(default_modules_loc "${CMAKE_SOURCE_DIR}/modules" ABSOLUTE)
+        if("${cur_modules_loc}" STREQUAL "${default_modules_loc}")
+          set(test_category "Public")
+        else()
+          set(test_category "Extra")
+        endif()
+
         set_tests_properties(${the_target} PROPERTIES
-          LABELS "Sanity"
+          LABELS "${test_category};Sanity"
           ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
       endif()

@@ -825,8 +833,16 @@
       if(CMAKE_VERSION VERSION_GREATER "2.8" AND OPENCV_TEST_DATA_PATH AND NOT "${the_target}" MATCHES "opencv_test_viz")
         add_test(NAME ${the_target} COMMAND ${the_target})

+        get_filename_component(cur_modules_loc "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE)
+        get_filename_component(default_modules_loc "${CMAKE_SOURCE_DIR}/modules" ABSOLUTE)
+        if("${cur_modules_loc}" STREQUAL "${default_modules_loc}")
+          set(test_category "Public")
+        else()
+          set(test_category "Extra")
+        endif()
+
         set_tests_properties(${the_target} PROPERTIES
-          LABELS "Accuracy"
+          LABELS "${test_category};Accuracy"
           ENVIRONMENT "OPENCV_TEST_DATA_PATH=${OPENCV_TEST_DATA_PATH}")
       endif()


[numerics] fix missing include (showed up on Jessie)

--- cmake/SiconosTools.cmake
+++ cmake/SiconosTools.cmake
@@ -1,6 +1,8 @@
 #
 # Some convenience macros
 #
+
+include(CMakeParseArguments)

 # -- Basic list manipulation --
 # Get first element of list var


Update SDL2_ttf to version 2.0.15 Add more md5sum checksums into getsdl2_tff Update freetype in it to version 2.9.1 because it depends on that version now.

--- cmake/get-sdl2_ttf.cmake
+++ cmake/get-sdl2_ttf.cmake
@@ -5,7 +5,7 @@

 include(ExternalProject)

-set(SDL2_TTF_VERSION "2.0.14")
+set(SDL2_TTF_VERSION "2.0.15")

 # For win32 it's faster to download the pre-compiled development binaries.
 if (WIN32)
@@ -18,7 +18,7 @@
       PREFIX ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
       URL https://libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${SDL2_TTF_VERSION}-mingw.tar.gz
-      URL_MD5 1
+      URL_MD5 9d537c47736ba8112ee63cc94871ff06
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       INSTALL_COMMAND
@@ -36,7 +36,7 @@
       PREFIX ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
       URL https://libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${SDL2_TTF_VERSION}-VC.zip
-      URL_MD5 304d4aa67fec7a5a8c3c47c4639b91e2
+      URL_MD5 26f762c8d9b011505529f1f73fc45f88
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
       INSTALL_COMMAND
@@ -51,8 +51,8 @@
   ExternalProject_Add(
     freetype2
     PREFIX ${DEPENDENCY_EXTRACT_DIR}
-    URL http://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.gz
-    URL_MD5 1
+    URL http://download.savannah.gnu.org/releases/freetype/freetype-2.9.1.tar.gz
+    URL_MD5 3adb0e35d3c100c456357345ccfa8056
     DOWNLOAD_DIR ${DOWNLOAD_DIR}
     CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${DEPENDENCY_INSTALL_DIR}
   )
@@ -63,7 +63,7 @@
     PREFIX ${DEPENDENCY_EXTRACT_DIR}
     DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
     URL https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${SDL2_TTF_VERSION}.tar.gz
-    URL_MD5 1
+    URL_MD5 04fe06ff7623d7bdcb704e82f5f88391
     CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=${DEPENDENCY_INSTALL_DIR} --with-freetype-prefix=${DEPENDENCY_INSTALL_DIR}
   )