set colors to "" on WIN32

set colors to "" on WIN32

--- modules/custom_color_messages.cmake
+++ modules/custom_color_messages.cmake
@@ -3,7 +3,7 @@
 # Colorize CMake output.
 # Code was found on StackOverflow: http://stackoverflow.com/a/19578320
 #
-# Usage within CMake code
+# Usage within CMake code:
 #   message("This is normal")
 #   message("${Red}This is Red${ColourReset}")
 #   message("${Green}This is Green${ColourReset}")
@@ -19,23 +19,42 @@
 #   message("${BoldMagenta}This is BoldMagenta${ColourReset}")
 #   message("${BoldCyan}This is BoldCyan${ColourReset}")
 #   message("${BoldWhite}This is BoldWhite\n\n${ColourReset}")
+#
+# Has no effect on WIN32.

-if(NOT WIN32)
-  string(ASCII 27 Esc)
-  set(ColourReset "${Esc}[m")
-  set(ColourBold  "${Esc}[1m")
-  set(Red         "${Esc}[31m")
-  set(Green       "${Esc}[32m")
-  set(Yellow      "${Esc}[33m")
-  set(Blue        "${Esc}[34m")
-  set(Magenta     "${Esc}[35m")
-  set(Cyan        "${Esc}[36m")
-  set(White       "${Esc}[37m")
-  set(BoldRed     "${Esc}[1;31m")
-  set(BoldGreen   "${Esc}[1;32m")
-  set(BoldYellow  "${Esc}[1;33m")
-  set(BoldBlue    "${Esc}[1;34m")
-  set(BoldMagenta "${Esc}[1;35m")
-  set(BoldCyan    "${Esc}[1;36m")
-  set(BoldWhite   "${Esc}[1;37m")
+if(WIN32)
+    set(ColourReset "")
+    set(ColourBold  "")
+    set(Red         "")
+    set(Green       "")
+    set(Yellow      "")
+    set(Blue        "")
+    set(Magenta     "")
+    set(Cyan        "")
+    set(White       "")
+    set(BoldRed     "")
+    set(BoldGreen   "")
+    set(BoldYellow  "")
+    set(BoldBlue    "")
+    set(BoldMagenta "")
+    set(BoldCyan    "")
+    set(BoldWhite   "")
+else()
+    string(ASCII 27 Esc)
+    set(ColourReset "${Esc}[m")
+    set(ColourBold  "${Esc}[1m")
+    set(Red         "${Esc}[31m")
+    set(Green       "${Esc}[32m")
+    set(Yellow      "${Esc}[33m")
+    set(Blue        "${Esc}[34m")
+    set(Magenta     "${Esc}[35m")
+    set(Cyan        "${Esc}[36m")
+    set(White       "${Esc}[37m")
+    set(BoldRed     "${Esc}[1;31m")
+    set(BoldGreen   "${Esc}[1;32m")
+    set(BoldYellow  "${Esc}[1;33m")
+    set(BoldBlue    "${Esc}[1;34m")
+    set(BoldMagenta "${Esc}[1;35m")
+    set(BoldCyan    "${Esc}[1;36m")
+    set(BoldWhite   "${Esc}[1;37m")
 endif()


- enable package config support for finding Soprano

svn path=/trunk/kdesupport/akonadi/; revision=957493

--- cmake/modules/FindSoprano.cmake
+++ cmake/modules/FindSoprano.cmake
@@ -39,11 +39,19 @@
 #else(SOPRANO_INCLUDE_DIR AND SOPRANO_LIBRARIES AND SOPRANO_INDEX_LIBRARIES AND SOPRANO_SERVER_LIBRARIES)
   include(FindLibraryWithDebug)

+  # have packageconfig set variables to find Soprano:
+  # package config dirs are used as secondary search paths after install_dir
+  find_package(PkgConfig)
+  if (PKG_CONFIG_FOUND)
+    pkg_check_modules(Soprano_PKGCONF soprano)
+  endif()
+
   find_path(SOPRANO_INCLUDE_DIR
     NAMES
     soprano/soprano.h
     PATHS
     ${INCLUDE_INSTALL_DIR}
+    ${Soprano_PKGCONF_INCLUDE_DIRS}
     )

   find_library_with_debug(SOPRANO_INDEX_LIBRARIES
@@ -52,6 +60,7 @@
     sopranoindex
     PATHS
     ${LIB_INSTALL_DIR}
+    ${Soprano_PKGCONF_LIBRARY_DIRS}
     )

   find_library_with_debug(SOPRANO_CLIENT_LIBRARIES
@@ -60,6 +69,7 @@
     sopranoclient
     PATHS
     ${LIB_INSTALL_DIR}
+    ${Soprano_PKGCONF_LIBRARY_DIRS}
     )

   find_library_with_debug(SOPRANO_LIBRARIES
@@ -67,6 +77,7 @@
     NAMES soprano
     PATHS
     ${LIB_INSTALL_DIR}
+    ${Soprano_PKGCONF_LIBRARY_DIRS}
   )

   find_library_with_debug(SOPRANO_SERVER_LIBRARIES
@@ -75,6 +86,7 @@
     sopranoserver
     PATHS
     ${LIB_INSTALL_DIR}
+    ${Soprano_PKGCONF_LIBRARY_DIRS}
     )

   # check for all the libs as required to make sure that we do not try to compile with an old version


Allow the usage of C files in external modules. Approved: Chris Hillery

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -213,7 +213,7 @@
         SET (_src_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_src_dir}")
       ENDIF (NOT IS_ABSOLUTE "${_src_dir}")
       FILE(GLOB_RECURSE _srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-        "${_src_dir}/*.cpp")
+        "${_src_dir}/*.cpp" "${_src_dir}/*.c")
       LIST (APPEND SRC_FILES ${_srcs})
     ENDFOREACH (_src_dir)


fixed typo in workaround around Eigen lib and gcc 4.7+

--- cmakemodules/script_eigen.cmake
+++ cmakemodules/script_eigen.cmake
@@ -14,15 +14,15 @@
 	PKG_CHECK_MODULES(PKG_EIGEN3 eigen3)	# Find eigen3 with pkg-config:
 	IF(PKG_EIGEN3_FOUND)
 		# Special case: There's a problem with GCC 4.7+ and Eigen before ~May 2012, so
-		#  if we have GCC>=4.7 and Eigen<4.1.0, switch to our embedded version which is
+		#  if we have GCC>=4.7 and Eigen<3.1.0, switch to our embedded version which is
 		#  already fixed to cope with this.
 		# (See: http://forum.kde.org/viewtopic.php?f=74&t=99314 )
-		IF ("${PKG_EIGEN3_VERSION}" VERSION_LESS 4.1.0 AND NOT "${CMAKE_MRPT_GCC_VERSION}" VERSION_LESS "47")
+		IF ("${PKG_EIGEN3_VERSION}" VERSION_LESS 3.1.0 AND NOT "${CMAKE_MRPT_GCC_VERSION}" VERSION_LESS "47")
 			# Remain using embedded version.
-		ELSE("${PKG_EIGEN3_VERSION}" VERSION_LESS 4.1.0 AND NOT "${CMAKE_MRPT_GCC_VERSION}" VERSION_LESS "47")
+		ELSE("${PKG_EIGEN3_VERSION}" VERSION_LESS 3.1.0 AND NOT "${CMAKE_MRPT_GCC_VERSION}" VERSION_LESS "47")
 			# Use system version:
 			SET(DEFAULT_EIGEN_USE_EMBEDDED_VERSION OFF)
-		ENDIF("${PKG_EIGEN3_VERSION}" VERSION_LESS 4.1.0 AND NOT "${CMAKE_MRPT_GCC_VERSION}" VERSION_LESS "47")
+		ENDIF("${PKG_EIGEN3_VERSION}" VERSION_LESS 3.1.0 AND NOT "${CMAKE_MRPT_GCC_VERSION}" VERSION_LESS "47")
 	ENDIF(PKG_EIGEN3_FOUND)
 ENDIF(PKG_CONFIG_FOUND)


Added support to overwrite the generator type. Eigen'fied the new variables.

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -27,6 +27,13 @@
 #  - EIGEN_WORK_DIR: directory used to download the source files and make the builds
 #      default: folder which contains this script
 #  - EIGEN_CMAKE_ARGS: additional arguments passed to cmake
+#  - EIGEN_GENERATOR_TYPE: allows to overwrite the generator type
+#      default: nmake (windows
+#      See http://www.cmake.org/cmake/help/cmake2.6docs.html#section_Generators for a complete
+#      list of supported generators.
+#  - EIGEN_NO_UPDATE: allows to submit dash boards from local repositories
+#      This might be interesting in case you want to submit dashboards
+#      including local changes.
 #  - CTEST_SOURCE_DIRECTORY: path to eigen's src (use a new and empty folder, not the one you are working on)
 #      default: <EIGEN_WORK_DIR>/src
 #  - CTEST_BINARY_DIRECTORY: build directory
@@ -132,11 +139,11 @@

 ## mandatory variables (the default should be ok in most cases):

-if(NOT IGNORE_CVS)
+if(NOT EIGEN_NO_UPDATE)
   SET (CTEST_CVS_COMMAND "hg")
   SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} clone http://bitbucket.org/eigen/eigen2 \"${CTEST_SOURCE_DIRECTORY}\"")
   SET(CTEST_BACKUP_AND_RESTORE TRUE) # the backup is CVS related ...
-endif(NOT IGNORE_CVS)
+endif(NOT EIGEN_NO_UPDATE)

 # which ctest command to use for running the dashboard
 SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}")
@@ -158,15 +165,24 @@
 # any quotes inside of this string if you use it
 if(WIN32 AND NOT UNIX)
   #message(SEND_ERROR "win32")
-  set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=nmake")
-  SET (CTEST_INITIAL_CACHE "
-    MAKECOMMAND:STRING=nmake -i
-    CMAKE_MAKE_PROGRAM:FILEPATH=nmake
-    CMAKE_GENERATOR:INTERNAL=NMake Makefiles
-    CMAKE_BUILD_TYPE:STRING=Release
-    BUILDNAME:STRING=${EIGEN_BUILD_STRING}
-    SITE:STRING=${EIGEN_SITE}
-  ")
+  if(EIGEN_GENERATOR_TYPE)
+    set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"${EIGEN_GENERATOR_TYPE}\"")
+    SET (CTEST_INITIAL_CACHE "
+      CMAKE_BUILD_TYPE:STRING=Release
+      BUILDNAME:STRING=${EIGEN_BUILD_STRING}
+      SITE:STRING=${EIGEN_SITE}
+    ")
+  else(EIGEN_GENERATOR_TYPE)
+    set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=nmake")
+    SET (CTEST_INITIAL_CACHE "
+      MAKECOMMAND:STRING=nmake -i
+      CMAKE_MAKE_PROGRAM:FILEPATH=nmake
+      CMAKE_GENERATOR:INTERNAL=NMake Makefiles
+      CMAKE_BUILD_TYPE:STRING=Release
+      BUILDNAME:STRING=${EIGEN_BUILD_STRING}
+      SITE:STRING=${EIGEN_SITE}
+    ")
+  endif(EIGEN_GENERATOR_TYPE)
 else(WIN32 AND NOT UNIX)
   SET (CTEST_INITIAL_CACHE "
     BUILDNAME:STRING=${EIGEN_BUILD_STRING}


FIX: Fix problem with color scale editor

--- Superbuild/versions.cmake
+++ Superbuild/versions.cmake
@@ -28,7 +28,7 @@

 add_revision(paraview
   GIT_REPOSITORY git://github.com/gcasey/ParaView.git
-  GIT_TAG c566c02a167577530a47f5ccb7a66fd236b4eb8a)
+  GIT_TAG a6322f5950f9d059314cfc4f03bd863de7f9db7d)

 add_revision(veloview
     SOURCE_DIR ${CMAKE_SOURCE_DIR}/..


Use discovered python executable (#2598)

On Fedora, Python must be run using version specific binaries, python2 or python3. Since we go to the trouble of finding python for the main library, we might as well use the discovered binary name and path.

--- src/cmake/oiio_macros.cmake
+++ src/cmake/oiio_macros.cmake
@@ -197,7 +197,7 @@
                 set (_testname "${_testname}-broken")
             endif ()

-            set (_runtest python "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
+            set (_runtest ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
             if (MSVC_IDE)
                 set (_runtest ${_runtest} --devenv-config $<CONFIGURATION>
                                           --solution-path "${CMAKE_BINARY_DIR}" )
@@ -215,7 +215,7 @@
             if (_testname MATCHES "texture")
                 set (_testname ${_testname}.batch)
                 set (_testdir ${_testdir}.batch)
-                set (_runtest python "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
+                set (_runtest ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/testsuite/runtest.py" ${_testdir})
                 if (MSVC_IDE)
                     set (_runtest ${_runtest} --devenv-config $<CONFIGURATION>
                                           --solution-path "${CMAKE_BINARY_DIR}" )


Use newly released HeidiSQL 7.0 in the MSI installer

--- win/packaging/heidisql.cmake
+++ win/packaging/heidisql.cmake
@@ -1,4 +1,4 @@
-SET(HEIDISQL_BASE_NAME "HeidiSQL_6.0_Portable")
+SET(HEIDISQL_BASE_NAME "HeidiSQL_7.0_Portable")
 SET(HEIDISQL_ZIP "${HEIDISQL_BASE_NAME}.zip")
 SET(HEIDISQL_URL "http://heidisql.googlecode.com/files/${HEIDISQL_ZIP}")
 SET(HEIDISQL_DOWNLOAD_DIR ${THIRD_PARTY_DOWNLOAD_LOCATION}/${HEIDISQL_BASE_NAME})


Add description of ADD_XC7_BOARD

Add description of ADD_XC7_BOARD

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- xc7/make/device_define.cmake
+++ xc7/make/device_define.cmake
@@ -4,6 +4,29 @@
 )

 function(ADD_XC7_BOARD)
+  # ~~~
+  # ADD_XC7_BOARD(
+  #   BOARD <board>
+  #   DEVICE <device>
+  #   PACKAGE <package>
+  #   PART <part>
+  #   PROG_TOOL <prog_tool>
+  #   [PROG_CMD <command to use PROG_TOOL>
+  #   )
+  # ~~~
+  #
+  # Defines a target board for a xc7 project.  The listed DEVICE must
+  # have been defined using ADD_XC7_DEVICE_DEFINE.  Currently PACKAGE should
+  # always be set to test.
+  #
+  # PART must be defined as the packaging of device.  This is used to defined
+  # the package pin names and bitstream .yaml file to use.  To see available
+  # parts, browse to third_party/prjxray-db/<arch>/*.yaml.
+  #
+  # PROG_TOOL should be an executable that will program a bitstream to the
+  # specified board. PROG_CMD is an optional command string.  If PROG_CMD is not
+  # provided, PROG_CMD will simply be ${PROG_TOOL}.
+  #
   set(options)
   set(oneValueArgs BOARD DEVICE PACKAGE PROG_TOOL PROG_CMD PART)
   set(multiValueArgs)


enh: Add NAME_VAR and UID_VAR options to mirtk_add_library [CMake]

--- CMake/Modules/mirtkAddLibrary.cmake
+++ CMake/Modules/mirtkAddLibrary.cmake
@@ -31,7 +31,7 @@
   if (NOT COMMAND cmake_parse_arguments)
     include("${CMAKE_ROOT}/Modules/CMakeParseArguments.cmake")
   endif ()
-  cmake_parse_arguments(TARGET "AUTO_REGISTER" "" "HEADERS;SOURCES;DEPENDS" ${ARGN})
+  cmake_parse_arguments(TARGET "AUTO_REGISTER" "NAME_VAR;UID_VAR" "HEADERS;SOURCES;DEPENDS" ${ARGN})
   if (TARGET_UNPARSED_ARGUMENTS)
     message(FATAL_ERROR "mirtk_add_library called with unrecognized arguments: ${TARGET_UNPARSED_ARGUMENTS}!")
   endif ()
@@ -52,6 +52,12 @@
   set(OUTPUT_NAME "${PROJECT_PACKAGE_NAME}${PROJECT_NAME}")
   basis_add_library(${target_name} ${TARGET_SOURCES} ${headers})
   basis_get_target_uid(target_uid ${target_name})
+  if (TARGET_NAME_VAR)
+    set(${TARGET_NAME_VAR} ${target_name} PARENT_SCOPE)
+  endif ()
+  if (TARGET_UID_VAR)
+    set(${TARGET_UID_VAR} ${target_uid} PARENT_SCOPE)
+  endif ()
   set_target_properties(
     ${target_uid} PROPERTIES
       VERSION             "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"


cmake: fix ffmpeg 5.1 detection (#3516)

cmake: fix ffmpeg 5.1 detection (#3516)

--- src/cmake/modules/FindFFmpeg.cmake
+++ src/cmake/modules/FindFFmpeg.cmake
@@ -59,7 +59,11 @@
 endif ()

 if (FFMPEG_INCLUDES)
-  file(STRINGS "${FFMPEG_INCLUDES}/libavcodec/version.h" TMP
+  set (_libavcodec_version_major_h "${FFMPEG_INCLUDES}/libavcodec/version_major.h")
+  if (NOT EXISTS "${_libavcodec_version_major_h}")
+    set (_libavcodec_version_major_h "${FFMPEG_INCLUDES}/libavcodec/version.h")
+  endif()
+  file(STRINGS "${_libavcodec_version_major_h}" TMP
        REGEX "^#define LIBAVCODEC_VERSION_MAJOR .*$")
   string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MAJOR "${TMP}")
   file(STRINGS "${FFMPEG_INCLUDES}/libavcodec/version.h" TMP
@@ -69,7 +73,9 @@
        REGEX "^#define LIBAVCODEC_VERSION_MICRO .*$")
   string (REGEX MATCHALL "[0-9]+[.0-9]+" LIBAVCODEC_VERSION_MICRO "${TMP}")
   set (LIBAVCODEC_VERSION "${LIBAVCODEC_VERSION_MAJOR}.${LIBAVCODEC_VERSION_MINOR}.${LIBAVCODEC_VERSION_MICRO}")
-  if (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 59.18.100)
+  if (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 59.37.100)
+      set (FFMPEG_VERSION 5.1)
+  elseif (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 59.18.100)
       set (FFMPEG_VERSION 5.0)
   elseif (LIBAVCODEC_VERSION VERSION_GREATER_EQUAL 58.134.100)
       set (FFMPEG_VERSION 4.4)


fix protobuf use script

fix protobuf use script

https://github.com/smanders/externpro/issues/356

--- projects/use/usexp-protobuf-config.cmake
+++ projects/use/usexp-protobuf-config.cmake
@@ -13,5 +13,5 @@
 get_target_property(PROTOBUF_INCLUDE_DIR ${nsPrefix}libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
 set(reqVars ${PRJ}_VER ${PRJ}_INCLUDE_DIR ${PRJ}_LIBRARIES ${PRJ}_PROTOC_EXECUTABLE)
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})
+find_package_handle_standard_args(@NAME@ REQUIRED_VARS ${reqVars})
 mark_as_advanced(${reqVars})


don't include generated files in source tar balls

--- CMakeModules/CPackSettings.cmake
+++ CMakeModules/CPackSettings.cmake
@@ -22,7 +22,12 @@
     "mkwebdocs.sh"
     "/html/"
     "/bindings/"
-    "TODO")
+    "TODO"
+    "exposed_decl.pypp.txt"
+    "ompl.pc$"
+    "installPyPlusPlus.bat$"
+    "installPyPlusPlus.sh$"
+    "config.h$")
 set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
 set(CPACK_GENERATOR "TGZ")


Still build even if CPACK_GENERATOR is undefined

Without the quotes around `${CPACK_GENERATOR}`, Windows CMake, generating
for VS2013, would exit with an error because the `STREQUAL` only had one arg.

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -122,9 +122,9 @@
     FOREACH(LINKLIB ${TARGET_ADDED_LIBRARIES})
       SET(TO_INSERT TRUE)
       FOREACH (value ${TARGET_COMMON_LIBRARIES})
-            IF (${value} STREQUAL ${LINKLIB})
+            IF ("${value}" STREQUAL "${LINKLIB}")
                   SET(TO_INSERT FALSE)
-            ENDIF (${value} STREQUAL ${LINKLIB})
+            ENDIF ("${value}" STREQUAL "${LINKLIB}")
         ENDFOREACH (value ${TARGET_COMMON_LIBRARIES})
       IF(TO_INSERT)
           LIST(APPEND TARGET_LIBRARIES ${LINKLIB})
@@ -269,7 +269,7 @@

       # add cpack config variables for plugin with own package
       IF(BUILD_OSG_PACKAGES)
-        IF(${CPACK_GENERATOR} STREQUAL "DEB")
+        IF("${CPACK_GENERATOR}" STREQUAL "DEB")
             STRING(TOUPPER ${PACKAGE_COMPONENT} UPPER_PACKAGE_COMPONENT)
             SET(CPACK_${UPPER_PACKAGE_COMPONENT}_DEPENDENCIES
                 "libopenscenegraph"


check MSVC_VERSION in xpCheckInstall()

check MSVC_VERSION in xpCheckInstall()

https://github.com/smanders/externpro/issues/326

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1248,6 +1248,17 @@
         )
     endif()
   endif()
+  if(DEFINED MSVC_VERSION)
+    set(msvcString "^MSVC_VERSION[ \t]+(.*)")
+    file(STRINGS ${infoFile} MSVC_VER REGEX "${msvcString}")
+    string(REGEX REPLACE "${msvcString}" "\\1" xpMsvcVer ${MSVC_VER})
+    if(NOT MSVC_VERSION EQUAL xpMsvcVer)
+      message(AUTHOR_WARNING "MSVC_VERSION mismatch: "
+        "${cmakeProjectName} built on \"${xpMsvcVer}\", "
+        "building ${PROJECT_NAME} on \"${MSVC_VERSION}\"."
+        )
+    endif()
+  endif()
 endfunction()

 function(xpFindPkg)


new iris version (much better QP performance)

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -104,7 +104,7 @@
 set(gurobi_depends)

 set(iris_url ssh://git@github.com/rdeits/iris-distro.git)
-set(iris_revision 452162e3a03f520d35bad158a722dcb7b6668d83)
+set(iris_revision 839f4ec762438a1dde96bb71f5b72e89e60c190f)
 set(iris_depends)

 set(mosek_url ssh://git@github.com/rdeits/mosek.git)


turn off /EHa

turn off /EHa

Summary:
The /EHa flag tells MSVC to catch asynchronous (structured) exceptions
in `catch(...)` blocks. This is generally a bad idea, because
structured exceptions include page faults, stack overflow, division by
zero, and illegal instructions, at which point attempting to run
further arbitrary C++ code will have wonky effects in the best
case. It would probably also clobber any state required to debug the
original failure.

Reviewed By: Orvid

Differential Revision: D16390933

fbshipit-source-id: 2997daaf350680dc9d0c7da3cabab8749e8ecb82

--- CMake/FollyCompilerMSVC.cmake
+++ CMake/FollyCompilerMSVC.cmake
@@ -80,7 +80,7 @@
   # The general options passed:
   target_compile_options(${THETARGET}
     PUBLIC
-      /EHa # Enable both SEH and C++ Exceptions.
+      /EHs # Don't catch structured exceptions with catch (...)
       /GF # There are bugs with constexpr StringPiece when string pooling is disabled.
       /Zc:referenceBinding # Disallow temporaries from binding to non-const lvalue references.
       /Zc:rvalueCast # Enforce the standard rules for explicit type conversion.


Update mitk data

Update mitk data

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

 if(BUILD_TESTING)

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

   ExternalProject_Add(${proj}


We have solid evidence that the Fortran language support infrastructure for
CMake can temporarily modify CMAKE_SOURCE_DIR on MinGW (and possibly other
platforms although not Linux).  To work around this issue,
change all occurrences of CMAKE_SOURCE_DIR to CMAKE_HOME_DIRECTORY in
hopes that this variable will not be messed with by the Fortran
language support infrastructure.

This change works on Linux.  Needs testing on MinGW and other Windows
platforms.

svn path=/trunk/; revision=10881

--- cmake/modules/language_support/cmake-2.6/CMakeFortranInformation.cmake
+++ cmake/modules/language_support/cmake-2.6/CMakeFortranInformation.cmake
@@ -10,19 +10,19 @@
 ENDIF(CMAKE_COMPILER_IS_GNUG77)
 IF(CMAKE_Fortran_COMPILER_ID)
   # FIXME: PLplot specific path here that will be different for other projects.
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake OR EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake)
+  IF(EXISTS ${CMAKE_HOME_DIRECTORY}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake OR EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake)
     SET(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER_ID}-Fortran)
-  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake OR EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake)
+  ENDIF(EXISTS ${CMAKE_HOME_DIRECTORY}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake OR EXISTS ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran.cmake)
 ENDIF(CMAKE_Fortran_COMPILER_ID)
-IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
+IF(EXISTS ${CMAKE_HOME_DIRECTORY}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
   # Use this file if it exists.
   SET(CMAKE_SYSTEM_AND_Fortran_COMPILER_INFO_FILE
-  ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
-ELSE(EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
+  ${CMAKE_HOME_DIRECTORY}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
+ELSE(EXISTS ${CMAKE_HOME_DIRECTORY}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
   # This one apparently doesn't have to actually exist, see OPTIONAL below.
   SET(CMAKE_SYSTEM_AND_Fortran_COMPILER_INFO_FILE
   ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
-ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
+ENDIF(EXISTS ${CMAKE_HOME_DIRECTORY}/cmake/modules/language-support/cmake-2.6/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
 INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)

 # This should be included before the _INIT variables are


modules: updated FindMagnum.cmake.

modules: updated FindMagnum.cmake.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -11,8 +11,8 @@
 #
 #  Magnum_FOUND                 - Whether the base library was found
 #  MAGNUM_DEPLOY_PREFIX         - Prefix where to put final application
-#   executables, defaults to empty string. If a relative path is used, it's
-#   relative to :variable:`CMAKE_INSTALL_PREFIX`.
+#   executables, defaults to ``.``. If a relative path is used, it's relative
+#   to :variable:`CMAKE_INSTALL_PREFIX`.
 #  MAGNUM_PLUGINS_DEBUG_DIR     - Base directory with dynamic plugins for
 #   debug builds, defaults to magnum-d/ subdirectory of dir where Magnum
 #   library was found
@@ -794,7 +794,7 @@
 endif()

 # Installation and deploy dirs
-set(MAGNUM_DEPLOY_PREFIX ""
+set(MAGNUM_DEPLOY_PREFIX "."
     CACHE STRING "Prefix where to put final application executables")

 include(${CORRADE_LIB_SUFFIX_MODULE})


- detect libsedml on linux

- detect libsedml on linux

--- cmake-set-dependencies.cmake
+++ cmake-set-dependencies.cmake
@@ -165,6 +165,15 @@
 set (LIBSBML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libsbml-static.a CACHE FILEPATH "libSBML library" FORCE)
 endif()

+# libsedml
+if (NOT EXISTS ${LIBSEDML_INCLUDE_DIR})
+set (LIBSEDML_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "SEDML include directory" FORCE)
+endif()
+if (NOT EXISTS ${LIBSEDML_LIBRARY})
+set (LIBSEDML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libsedml-static.a CACHE FILEPATH "libSEDML library" FORCE)
+endif()
+
+
 # raptor
 if (NOT EXISTS ${RAPTOR_INCLUDE_DIR})
 set (RAPTOR_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "raptor include directory" FORCE)


ASAN: move asan flag into the front

ASAN: move asan flag into the front

ASAN needs to be linked before other things otherwis it produces the
following error message: `ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.`

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -101,10 +101,10 @@
 endif ()

 if (ENABLE_ASAN)
-	set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize=address -fno-omit-frame-pointer")
+	set (EXTRA_FLAGS "-fsanitize=address -fno-omit-frame-pointer ${EXTRA_FLAGS}")
 	set (ASAN_LIBRARY "-lasan") #this is needed for GIR to put asan in front
 	if (CMAKE_COMPILER_IS_GNUCXX)
-		set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
+		set (CMAKE_SHARED_LINKER_FLAGS "-fsanitize=address ${CMAKE_SHARED_LINKER_FLAGS}")
 		# this is needed because of wrong pthread detection https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69443
 		find_package(Threads)
 		set (THREAD_LIBS_AS_NEEDED "${COMMON_FLAGS} -Wl,--as-needed ${CMAKE_THREAD_LIBS_INIT}")


CMake: removed useless per-distro packaging

CPACK_DEBIAN_PACKAGE_DEPENDS was identical anyway
fixes #219

--- cmake/ElektraPackaging.cmake
+++ cmake/ElektraPackaging.cmake
@@ -61,6 +61,7 @@
 		set (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
 		set (CPACK_DEBIAN_PACKAGE_SECTION "libs")
 		set (CPACK_DEBIAN_PACKAGE_RECOMMENDS "")
+		set (CPACK_DEBIAN_PACKAGE_DEPENDS " ") # no dependencies without any PLUGINS

 		# We need to alter the architecture names as per distro rules
 		if ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "i[3-6]86")
@@ -69,22 +70,6 @@
 		if ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
 			set (CPACK_PACKAGE_ARCHITECTURE amd64)
 		endif ("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
-
-		# Set the dependencies based on the distro version
-		# thus only one package is build you must list here *any* depending libraries,
-		# even if they are only used in one module
-		if ("${LSB_DISTRIB}" MATCHES "Debian5.*")
-			set (CPACK_DEBIAN_PACKAGE_DEPENDS " ")
-		endif ("${LSB_DISTRIB}" MATCHES "Debian5.*")
-		if ("${LSB_DISTRIB}" MATCHES "Debian6.*")
-			set (CPACK_DEBIAN_PACKAGE_DEPENDS " ")
-		endif ("${LSB_DISTRIB}" MATCHES "Debian6.*")
-		if ("${LSB_DISTRIB}" MATCHES "Debian7.*")
-			set (CPACK_DEBIAN_PACKAGE_DEPENDS " ") # if build with no plugins
-		endif ("${LSB_DISTRIB}" MATCHES "Debian7.*")
-		if (NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
-			message ("WARNING: ${LSB_DISTRIB} not supported yet.\nPlease set deps in cmake/ElektraPackaging.cmake before packaging.")
-		endif (NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
 	endif ("${LSB_DISTRIB}" MATCHES "Ubuntu|Debian")
 	set (CPACK_SYSTEM_NAME "${LSB_DISTRIB}-${CPACK_PACKAGE_ARCHITECTURE}")
 	message (STATUS "Detected ${CPACK_SYSTEM_NAME}. Use make package to build packages (${CPACK_GENERATOR}).")


[LLDB][MIPS] Check if libatomic needs to be specified explicitly

Patch by Nitesh Jain.

Summary : The problem appears while linking liblldb.so. The class Address contain atomic variable m_offset. The loading and storing of variable is access via atomic_load_8 and atomic_store_8 functions. Some target fail to implicitly link libatomic, which cause undefine reference to atomic_store_8/atomic_load_8. This patch uses http://reviews.llvm.org/D20896 to check if libatomic need to be explicitly link.

Reviewed by labath.
Differential: D20464

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@274121 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -157,6 +157,11 @@
     endif()
   endif()
 endif()
+
+if (NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB )
+    list(APPEND LLDB_SYSTEM_LIBS atomic)
+endif()
+
 # On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
 if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   list(APPEND LLDB_SYSTEM_LIBS execinfo)


Update FindGLEW.cmake :
* add support for static glew under Windows
* set GLEW_FOUND to FALSE or TRUE
* replace GLEW_ROOT_PATH env. variable with GLEW_ROOT

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@5645 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindGLEW.cmake
+++ cmake/Modules/FindGLEW.cmake
@@ -26,13 +26,13 @@
   ELSE(CYGWIN)

     FIND_PATH( GLEW_INCLUDE_DIR GL/glew.h
-      $ENV{GLEW_ROOT_PATH}/include
+      $ENV{GLEW_ROOT}/include
     )

     FIND_LIBRARY( GLEW_GLEW_LIBRARY
-      NAMES glew glew32
+      NAMES glew glew32 glew32s
       PATHS
-      $ENV{GLEW_ROOT_PATH}/lib
+      $ENV{GLEW_ROOT}/lib
       ${OPENGL_LIBRARY_DIR}
     )

@@ -69,7 +69,7 @@

 ENDIF (WIN32)

-SET( GLEW_FOUND "NO" )
+SET( GLEW_FOUND FALSE )
 IF(GLEW_INCLUDE_DIR)
   IF(GLEW_GLEW_LIBRARY)
     # Is -lXi and -lXmu required on all platforms that have it?
@@ -78,7 +78,7 @@
       ${GLEW_GLEW_LIBRARY}
       ${GLEW_cocoa_LIBRARY}
     )
-    SET( GLEW_FOUND "YES" )
+    SET( GLEW_FOUND TRUE )

 #The following deprecated settings are for backwards compatibility with CMake1.4
     SET (GLEW_LIBRARY ${GLEW_LIBRARIES})
@@ -91,6 +91,9 @@
   IF(NOT GLEW_FIND_QUIETLY)
     MESSAGE(STATUS "Found Glew: ${GLEW_LIBRARIES}")
   ENDIF(NOT GLEW_FIND_QUIETLY)
+  IF(GLEW_GLEW_LIBRARY MATCHES glew32s)
+    ADD_DEFINITIONS(-DGLEW_STATIC)
+  ENDIF(GLEW_GLEW_LIBRARY MATCHES glew32s)
 ELSE(GLEW_FOUND)
   IF(GLEW_FIND_REQUIRED)
     MESSAGE(FATAL_ERROR "Could not find Glew")


improve message visibility

improve message visibility


build: attempt to install the import libraries

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -2015,10 +2015,19 @@
             WORLD_READ)
       endif()

-      swift_install_in_component("${SWIFTLIB_INSTALL_IN_COMPONENT}"
-          FILES "${UNIVERSAL_LIBRARY_NAME}"
-          DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}"
+      if(sdk STREQUAL WINDOWS AND CMAKE_SYSTEM_NAME STREQUAL Windows)
+        swift_install_in_component("${SWIFTLIB_INSTALL_IN_COMPONENT}"
+          TARGETS ${name}-windows-${SWIFT_PRIMARY_VARIANT_ARCH}
+          RUNTIME DESTINATION "bin"
+          LIBRARY DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}"
+          ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}"
           PERMISSIONS ${file_permissions})
+      else()
+        swift_install_in_component("${SWIFTLIB_INSTALL_IN_COMPONENT}"
+            FILES "${UNIVERSAL_LIBRARY_NAME}"
+            DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}"
+            PERMISSIONS ${file_permissions})
+      endif()
       if(sdk STREQUAL WINDOWS)
         foreach(arch ${SWIFT_SDK_WINDOWS_ARCHITECTURES})
           if(TARGET ${name}-windows-${arch}_IMPLIB)


CPackDeb.cmake: update to use opkg-buld

CPackDeb.cmake: update to use opkg-buld

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- cmake/modules/CPackDeb.cmake
+++ cmake/modules/CPackDeb.cmake
@@ -177,9 +177,9 @@
 #endif(NOT CPACK_SECTION)

 # Package for opkg
-FIND_PROGRAM(OPKG_CMD ipkg-build)
+FIND_PROGRAM(OPKG_CMD opkg-build)
 if( ${OPKG_CMD} STREQUAL "OPKG_CMD-NOTFOUND" )
-  message("CPack: ipkg-build not found. Skipping packaging")
+  message("CPack: opkg-build not found. Skipping packaging")
 else( ${OPKG_CMD} STREQUAL "OPKG_CMD-NOTFOUND" )
   SET(CPACK_OPKG_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
   FILE(MAKE_DIRECTORY ${CPACK_OPKG_ROOTDIR}/CONTROL)


Rpc emit/dispatch functions

Rpc emit/dispatch functions

--- cmake/scripts/protoRpc.cmake
+++ cmake/scripts/protoRpc.cmake
@@ -66,7 +66,7 @@
     file(APPEND "${FILE}" "  ${FUN_ARG};\n")
   endforeach()
   file(APPEND "${FILE}" "}\n")
-  list(APPEND MSG_TYPES "${IF}_${FUN}_Req")
+  list(APPEND MSG_TYPES_REQ "${IF}_${FUN}_Req")

   if(RPC_D_${IF}_${FUN}_OUT_FB)
     file(APPEND "${FILE}" "table ${IF}_${FUN}_Rep {\n")
@@ -74,7 +74,7 @@
       file(APPEND "${FILE}" "  ${FUN_ARG};\n")
     endforeach()
     file(APPEND "${FILE}" "}\n\n")
-    list(APPEND MSG_TYPES "${IF}_${FUN}_Rep")
+    list(APPEND MSG_TYPES_REP "${IF}_${FUN}_Rep")
   else()
     file(APPEND "${FILE}" "\n")
   endif()
@@ -92,7 +92,8 @@
 file(APPEND "${RPC_FBS_OUT}" "  message:string;\n")
 file(APPEND "${RPC_FBS_OUT}" "}\n\n")

-set(MSG_TYPES "RpcError")
+set(MSG_TYPES_REQ)
+set(MSG_TYPES_REP "RpcError")

 # Loop on interfaces
 foreach(IF ${RPC_IF_LIST})
@@ -103,12 +104,18 @@
   endforeach()
 endforeach()

-string(REPLACE ";" ", " UNION_LIST "${MSG_TYPES}")
+string(REPLACE ";" ", " UNION_LIST_REQ "${MSG_TYPES_REQ}")
+string(REPLACE ";" ", " UNION_LIST_REP "${MSG_TYPES_REP}")
 file(APPEND "${RPC_FBS_OUT}" "// Final message\n")
-file(APPEND "${RPC_FBS_OUT}" "union RpcMessageU {\n  ${UNION_LIST}\n}\n")
-file(APPEND "${RPC_FBS_OUT}" "table RpcMessage {\n")
+file(APPEND "${RPC_FBS_OUT}" "union RpcRequestU {\n  ${UNION_LIST_REQ}\n}\n")
+file(APPEND "${RPC_FBS_OUT}" "table RpcRequest {\n")
 file(APPEND "${RPC_FBS_OUT}" "  id:uint32;\n")
-file(APPEND "${RPC_FBS_OUT}" "  data:RpcMessageU;\n")
+file(APPEND "${RPC_FBS_OUT}" "  data:RpcRequestU;\n")
+file(APPEND "${RPC_FBS_OUT}" "}\n\n")
+file(APPEND "${RPC_FBS_OUT}" "union RpcReplyU {\n  ${UNION_LIST_REP}\n}\n")
+file(APPEND "${RPC_FBS_OUT}" "table RpcReply {\n")
+file(APPEND "${RPC_FBS_OUT}" "  id:uint32;\n")
+file(APPEND "${RPC_FBS_OUT}" "  data:RpcReplyU;\n")
 file(APPEND "${RPC_FBS_OUT}" "}\n\n")

 #
@@ -126,12 +133,12 @@
 macro(write_fun_dispatcher FILE IF FUN)
   file(APPEND "${FILE}" "  template<typename If = ${IF}<Base, true> >\n")
   file(APPEND "${FILE}" "  inline typename std::enable_if<!impl::ContainsIf<If, Interfaces<Base, true>...>::value, bool>::type\n")
-  file(APPEND "${FILE}" "    dispatch_${IF}_${FUN}(const RpcMessage & message) { return false; }\n")
+  file(APPEND "${FILE}" "    dispatch_${IF}_${FUN}(const RpcRequest & request) { return false; }\n")
   file(APPEND "${FILE}" "  template<typename If = ${IF}<Base, true> >\n")
   file(APPEND "${FILE}" "  inline typename std::enable_if<impl::ContainsIf<If, Interfaces<Base, true>...>::value, bool>::type\n")
-  file(APPEND "${FILE}" "    dispatch_${IF}_${FUN}(const RpcMessage & message)\n")
+  file(APPEND "${FILE}" "    dispatch_${IF}_${FUN}(const RpcRequest & request)\n")
   file(APPEND "${FILE}" "  {\n")
-  file(APPEND "${FILE}" "    static_cast<${IF}<Base, true>*>(this)->${FUN}(message.data_as_${IF}_${FUN}_Req());\n")
+  file(APPEND "${FILE}" "    static_cast<${IF}<Base, true>*>(this)->${FUN}(request.data_as_${IF}_${FUN}_Req());\n")
   file(APPEND "${FILE}" "    return true;\n")
   file(APPEND "${FILE}" "  }\n")
 endmacro()
@@ -149,7 +156,8 @@
   file(APPEND "${FILE}" "    flatbuffers::FlatBufferBuilder builder;\n")
   file(APPEND "${FILE}" "    flatbuffers::Offset<T> data = args_builder(builder);\n")
   file(APPEND "${FILE}" "    uint32_t rpc_id = 0;\n")
-  file(APPEND "${FILE}" "    auto rpc_msg = CreateRpcMessage(builder, rpc_id, RpcMessageUTraits<T>::enum_value, data.Union());\n")
+  file(APPEND "${FILE}" "    auto rpc_req = CreateRpcRequest(builder, rpc_id, RpcRequestUTraits<T>::enum_value, data.Union());\n")
+  file(APPEND "${FILE}" "    emit_rpc_request(builder, rpc_req);\n")
   file(APPEND "${FILE}" "  }\n")
 endmacro()

@@ -183,6 +191,8 @@
   file(APPEND "${RPC_HEADER_OUT}" "};\n\n")
   file(APPEND "${RPC_HEADER_OUT}" "template<class Base>\n")
   file(APPEND "${RPC_HEADER_OUT}" "class ${IF}<Base, false> // ${IF}Sender\n{\n")
+  file(APPEND "${RPC_HEADER_OUT}" "private:\n")
+  file(APPEND "${RPC_HEADER_OUT}" "  virtual void emit_rpc_request(flatbuffers::FlatBufferBuilder & builder, flatbuffers::Offset<RpcRequest> request) = 0;\n")
   file(APPEND "${RPC_HEADER_OUT}" "public:\n")

   # Loop on functions
@@ -196,16 +206,16 @@
 file(APPEND "${RPC_HEADER_OUT}" "template<class Base, template<class, bool> class... Interfaces>\n")
 file(APPEND "${RPC_HEADER_OUT}" "class RpcReceiver : public Interfaces<Base, true>...\n{\n")
 file(APPEND "${RPC_HEADER_OUT}" "protected:\n")
-file(APPEND "${RPC_HEADER_OUT}" "  inline bool dispatch_rpc_request(const RpcMessage & message)\n")
+file(APPEND "${RPC_HEADER_OUT}" "  virtual void emit_rpc_reply(flatbuffers::FlatBufferBuilder & builder, flatbuffers::Offset<RpcReply> reply) = 0;\n")
+file(APPEND "${RPC_HEADER_OUT}" "  inline bool dispatch_rpc_request(const RpcRequest & request)\n")
 file(APPEND "${RPC_HEADER_OUT}" "  {\n")
-file(APPEND "${RPC_HEADER_OUT}" "    switch (message.data_type())\n")
+file(APPEND "${RPC_HEADER_OUT}" "    switch (request.data_type())\n")
 file(APPEND "${RPC_HEADER_OUT}" "    {\n")
 # Loop on interfaces
 foreach(IF ${RPC_IF_LIST})
   # Loop on functions
   foreach(FUN ${RPC_D_${IF}_FUNCTIONS})
-    file(APPEND "${RPC_HEADER_OUT}" "    case RpcMessageU_${IF}_${FUN}_Req:\n")
-    file(APPEND "${RPC_HEADER_OUT}" "      return dispatch_${IF}_${FUN}(message);\n")
+    file(APPEND "${RPC_HEADER_OUT}" "    case RpcMessageU_${IF}_${FUN}_Req: return dispatch_${IF}_${FUN}(request);\n")
   endforeach(FUN)
 endforeach()
 file(APPEND "${RPC_HEADER_OUT}" "    default: return false;\n")
@@ -223,7 +233,10 @@

 file(APPEND "${RPC_HEADER_OUT}" "template<class Base, template<class, bool> class... Interfaces>\n")
 file(APPEND "${RPC_HEADER_OUT}" "class RpcSender : public Interfaces<Base, false>...\n{\n")
-file(APPEND "${RPC_HEADER_OUT}" "public:\n")
+file(APPEND "${RPC_HEADER_OUT}" "protected:\n")
+file(APPEND "${RPC_HEADER_OUT}" "  inline bool dispatch_rpc_reply(const RpcReply & reply)\n")
+file(APPEND "${RPC_HEADER_OUT}" "  {\n")
+file(APPEND "${RPC_HEADER_OUT}" "  }\n")
 file(APPEND "${RPC_HEADER_OUT}" "};\n\n")

 file(APPEND "${RPC_HEADER_OUT}" "} // namespace ${RPC_NAMESPACE}\n")


Suppressed some warnings

Suppressed some warnings

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -242,7 +242,7 @@
      set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
      set(CMAKE_CXX_FLAGS_DEBUG "-Og -g")

-     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wold-style-cast -Wnon-virtual-dtor")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-unused-parameter -Wno-unused-variable -Woverloaded-virtual -Wold-style-cast -Wnon-virtual-dtor -Wimplicit-fallthrough -Wunused-but-set-variable -Wsign-compare")

      # MinGW fixes
      if (MINGW AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)


Warning message (VTK not found) has been moved to CMake

--- Examples/Build/vtkMy/vtkMy.cmake
+++ Examples/Build/vtkMy/vtkMy.cmake
@@ -20,14 +20,9 @@
 INCLUDE (${CMAKE_ROOT}/Modules/FindVTK.cmake)

 IF (USE_VTK_FILE)
-
   INCLUDE (${USE_VTK_FILE})
-
 ELSE (USE_VTK_FILE)
-
-  MESSAGE("Warning. This project is supposed to work with VTK, which might be found on your system as different flavours: installed VTK, or (multiple) built VTK. Please, make sure that the VTK_INSTALL_PATH or VTK_BINARY_PATH setting reflect which VTK you are planning to use, then set one of the USE_INSTALLED_VTK or USE_BUILT_VTK to ON.")
   SET (VTKMY_CAN_BUILD 0)
-
 ENDIF (USE_VTK_FILE)

 #


LIBRARY_DIRS and DEFINITIONS aren't always set

--- opensplice_cmake_module/cmake/Modules/FindOpenSplice.cmake
+++ opensplice_cmake_module/cmake/Modules/FindOpenSplice.cmake
@@ -117,7 +117,5 @@
   REQUIRED_VARS
     OpenSplice_INCLUDE_DIRS
     OpenSplice_LIBRARIES
-    OpenSplice_LIBRARY_DIRS
-    OpenSplice_DEFINITIONS
     OpenSplice_IDLPP
 )


cortex-m55: Workaround armasm options bug

We use armclang with `-masm=auto` to auto-select which assembler to use
based on the syntax of the file. Cortex-M55 isn't supported by armasm,
but we don't yet have GCC-syntax asm files for ARM compiler
(https://github.com/ARM-software/CMSIS_5/blob/1dd090bd1c6d196da96241420a40090bf09c0b13/CMSIS/RTOS2/RTX/Source/ARM/irq_armv8mml.s).

    $ armclang --target=arm-arm-none-eabi -mcpu=cortex-m55 -mfpu=none -masm=auto -c cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_ARM/TARGET_M33/irq_armv8mml.S
    armclang: error: armasm does not support CPU 'cortex-m55'

In the mean time, we can build C and C++ files using the
`-mcpu=cortex-m55` option, and for armasm, cancel out that choice of CPU
with a known-supported CPU type, Cortex-R7, and provide the legacy
assembler-specific option `-Wa,armasm,--cpu=cortex-m55`.

After these changes, this works:

    $ armclang --target=arm-arm-none-eabi -mcpu=cortex-m55 -mcpu=cortex-r7 -Wa,--cpu=cortex-m55 -mfpu=none -masm=auto -c cmsis/CMSIS_5/CMSIS/RTOS2/RTX/Source/TOOLCHAIN_ARM/TARGET_M33/irq_armv8mml.S

--- tools/cmake/cores/Cortex-M55.cmake
+++ tools/cmake/cores/Cortex-M55.cmake
@@ -17,6 +17,14 @@
     )
 endif()

+# We'd like to use just "-mcpu=cortex-m55" in common_options, but due to a bug
+# in armclang passing options to armasm, we use the following flags as a
+# workaround to select M55.
+list(APPEND asm_compile_options
+    -mcpu=cortex-r7
+    -Wa,--cpu=cortex-m55
+)
+
 function(mbed_set_cpu_core_definitions target)
     target_compile_definitions(${target}
         INTERFACE


common.cmake update

common.cmake update

--- common.cmake
+++ common.cmake
@@ -1,6 +1,12 @@
+# Copyright (c) 2017 Egor Tensin <Egor.Tensin@gmail.com>
 # It's a CMake code snippet I use in all of my CMake projects.
 # It makes targets link the runtime statically by default + strips debug
 # symbols in release builds.
+# The latest version can be found at
+# https://gist.github.com/egor-tensin/cmake-common.
+# Distributed under the MIT License.
+
+# Version: 2017-05-19T13:51:22+00:00

 get_directory_property(parent_directory PARENT_DIRECTORY)
 set(is_root_project $<NOT:parent_directory>)


BUG: fixing compilation dependecies of external wcslib

--- SuperBuild/External_wcslib.cmake
+++ SuperBuild/External_wcslib.cmake
@@ -32,7 +32,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/punzo/wcslib"
-    GIT_TAG "b03e39cfb94ee6efb0c6337e31c1c7ca713f9c50"
+    GIT_TAG "b7c2801bb6e22bfb30bd8a73d3ceed8421c65e69"
     SOURCE_DIR ${${proj}_SOURCE_DIR}
     BINARY_DIR ${${proj}_BINARY_DIR}
     CMAKE_CACHE_ARGS
@@ -42,7 +42,8 @@
       -DCMAKE_C_FLAGS:STRING=${ep_common_c_flags}
       -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
       -DBUILD_TESTING:BOOL=OFF
-      -DCFITSIO_LIBRARY:PATH=${CFITSIO_LIBRARY_DIR}
+      -DCFITSIO_LIBRARY_DIR:PATH=${CFITSIO_LIBRARY_DIR}
+      -DCFITSIO_INCLUDE_DIR:PATH=${CFITSIO_INCLUDE_DIR}
       -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_THIRDPARTY_BIN_DIR}
       -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_BINARY_DIR}/${Slicer_THIRDPARTY_LIB_DIR}
       -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}


Fix another CMake warning

Fix another CMake warning

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -451,7 +451,7 @@
 		#set_target_properties(${name}-exe PROPERTIES OUTPUT_NAME ${name})
 	endif()

-	if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+	if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
 		if (USE_PCH)
 			add_precompiled_header(${name} prec.h FORCEINCLUDE SOURCE_CXX prec.cpp)
 		endif ()


Fix dependencies in `add_sapi_library`

Fix dependencies in `add_sapi_library`

PiperOrigin-RevId: 350307675
Change-Id: Ib3a085ad214690083fcf23a791f194c37223da11

--- cmake/SapiBuildDefs.cmake
+++ cmake/SapiBuildDefs.cmake
@@ -190,12 +190,15 @@
     "${_sapi_gen_header}"
     ${_sapi_SOURCES}
   )
-  target_link_libraries("${_sapi_NAME}" PRIVATE
+  target_link_libraries("${_sapi_NAME}" PUBLIC
+    absl::status
+    absl::statusor
     sapi::sapi
+    sapi::status
     sapi::vars
   )
   if(NOT _sapi_NOEMBED)
-    target_link_libraries("${_sapi_NAME}" PRIVATE
+    target_link_libraries("${_sapi_NAME}" PUBLIC
       "${_sapi_embed}"
     )
   endif()


cmake: Improve mpg123 handling

cmake: Improve mpg123 handling

mpg123 has official imported target name.

--- cmake/SndFileChecks.cmake
+++ cmake/SndFileChecks.cmake
@@ -58,7 +58,7 @@

 find_package (Lame)
 find_package (Mpg123 1.25.10)
-if (LAME_FOUND AND MPG123_FOUND)
+if (LAME_FOUND AND (TARGET MPG123::libmpg123))
 	set (HAVE_MPEG_LIBS 1)
 else ()
 	set (HAVE_MPEG_LIBS 0)


Added support for automatic ThirdParty build of VTK.

--- cmake/ThirdPartyVTK.cmake
+++ cmake/ThirdPartyVTK.cmake
@@ -1,11 +1,35 @@
-SET(NEKTAR_USE_VTK    OFF CACHE BOOL
+SET(THIRDPARTY_BUILD_VTK OFF CACHE BOOL
+    "Build VTK library from ThirdParty")
+
+SET(NEKTAR_USE_VTK       OFF CACHE BOOL
     "Use VTK library for utilities.")

 IF( NEKTAR_USE_VTK )
-    INCLUDE (FindVTK)
-    IF (NOT VTK_FOUND)
-        MESSAGE(FATAL_ERROR "VTK not found")
-    ENDIF (NOT VTK_FOUND)
+    IF( THIRDPARTY_BUILD_VTK )
+        INCLUDE( ExternalProject )
+
+        # The cmake package has been modified due to a bug in the CMake files
+        # which causes it to produce an error when the path includes a '+'.
+        # Obviously this is inconvenient for us.
+        EXTERNALPROJECT_ADD(
+            vtk-5.10.1
+            PREFIX ${TPSRC}
+            URL ${TPURL}/vtk-5.10.1-nek.tar.bz2
+            URL_MD5 "f4e2c6b848d3873d44479baa9e7e4d35"
+            DOWNLOAD_DIR ${TPSRC}
+            CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release ${TPSRC}/src/vtk-5.10.1
+        )
+        SET(VTK_DIR ${TPSRC}/dist/lib/vtk-5.10)
+        SET(VTK_FOUND 1)
+        SET(VTK_USE_FILE ${VTK_DIR}/UseVTK.cmake)
+        INCLUDE (${VTK_DIR}/VTKConfig.cmake)
+    ELSE()
+        INCLUDE (FindVTK)
+        IF (NOT VTK_FOUND)
+            MESSAGE(FATAL_ERROR "VTK not found")
+        ENDIF (NOT VTK_FOUND)
+    ENDIF()
+
     INCLUDE (${VTK_USE_FILE})
     MARK_AS_ADVANCED(VTK_DIR)
     ADD_DEFINITIONS(-DNEKTAR_USING_VTK)


Correctly invert return codes to establish truth/falsity of OCAML_HAS_CAIRO
and OCAML_HAS_GTK.

svn path=/trunk/; revision=10506

--- cmake/modules/ocaml.cmake
+++ cmake/modules/ocaml.cmake
@@ -164,9 +164,17 @@
         COMMAND ${OCAMLFIND} c -package cairo -linkpkg test_cairo.ml -o test_cairo
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
         RESULT_VARIABLE OCAML_HAS_CAIRO
+	OUTPUT_QUIET
+	ERROR_QUIET
         )
-      # Invert the test result.  What CMake takes as true is meant to be false.
-      set(OCAML_HAS_CAIRO NOT OCAML_HAS_CAIRO)
+      # zero return code indicates no errors.  Thus, OCAML_HAS_CAIRO must have
+      # truth inverted.
+      if(OCAML_HAS_CAIRO)
+	set(OCAML_HAS_CAIRO OFF)
+      else(OCAML_HAS_CAIRO)
+	set(OCAML_HAS_CAIRO ON)
+      endif(OCAML_HAS_CAIRO)
+
       if(OCAML_HAS_CAIRO)
         message(STATUS "Cairo OCaml library found")
       else(OCAML_HAS_CAIRO)
@@ -183,9 +191,17 @@
         COMMAND ${OCAMLFIND} c -package cairo.lablgtk2 -linkpkg test_gtk.ml -o test_gtk
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
         RESULT_VARIABLE OCAML_HAS_GTK
+	OUTPUT_QUIET
+	ERROR_QUIET
         )
-      # Invert the test result.  What CMake takes as true is meant to be false.
-      set(OCAML_HAS_GTK NOT OCAML_HAS_GTK)
+      # zero return code indicates no errors.  Thus, OCAML_HAS_CAIRO must have
+      # truth inverted.
+      if(OCAML_HAS_GTK)
+	set(OCAML_HAS_GTK OFF)
+      else(OCAML_HAS_GTK)
+	set(OCAML_HAS_GTK ON)
+      endif(OCAML_HAS_GTK)
+
       if(OCAML_HAS_GTK)
         message(STATUS "lablgtk2 OCaml library found")
       else(OCAML_HAS_GTK)
@@ -195,5 +211,7 @@
   else(OCAMLFIND)
     message(STATUS "WARNING:"
       "ocamlfind not available.  Disabling Plcairo module and lablgtk support")
+    set(OCAML_HAS_CAIRO OFF)
+    set(OCAML_HAS_GTK OFF)
   endif(OCAMLFIND)
 endif(ENABLE_ocaml)


Changed copy of libuuid.so to libuuid.so.1

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -225,7 +225,7 @@
         libssl.so
         libstacktrace.so
         libtcmalloc.so
-        libuuid.so
+        libuuid.so.1
         libz.so
         libssl.so.0.9.7
        )


a couple of stage directory markings are now optional

--- modules/macpro.cmake
+++ modules/macpro.cmake
@@ -250,18 +250,24 @@
       OUTPUT_STRIP_TRAILING_WHITESPACE
       )
     if(GIT_DESCRIBE)
-      # add prefix if git repo is dirty
-      execute_process(COMMAND ${GIT_EXECUTABLE} status --porcelain
-        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-        OUTPUT_VARIABLE dirty
-        )
-      if(dirty AND UNIX)
-        set(PREFIX "$ENV{USER}-dirtyrepo-")
-      elseif(dirty AND WIN32)
-        set(PREFIX "$ENV{USERNAME}-dirtyrepo-")
+      option(XP_DIRTYREPO "mark stage directory with dirtyrepo" ON)
+      mark_as_advanced(XP_DIRTYREPO)
+      if(XP_DIRTYREPO)
+        # add prefix if git repo is dirty
+        execute_process(COMMAND ${GIT_EXECUTABLE} status --porcelain
+          WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+          OUTPUT_VARIABLE dirty
+          )
+        if(dirty AND UNIX)
+          set(PREFIX "$ENV{USER}-dirtyrepo-")
+        elseif(dirty AND WIN32)
+          set(PREFIX "$ENV{USERNAME}-dirtyrepo-")
+        endif()
       endif()
       xpGetCompilerPrefix(COMPILER)
-      if(NOT XP_DEFAULT)
+      option(XP_MARKPARTIAL "mark stage directory with partial indicator" ON)
+      mark_as_advanced(XP_MARKPARTIAL)
+      if(XP_MARKPARTIAL AND NOT XP_DEFAULT)
         set(PARTIAL "-p")
       endif()
       set(GIT_REV ${PREFIX}${GIT_DESCRIBE}${PARTIAL}-${COMPILER}-${BUILD_PLATFORM})


Convert retreived path to CMake path for use. (#244)

Convert retreived path to CMake path for use.

--- launch_testing_ament_cmake/cmake/add_launch_test.cmake
+++ launch_testing_ament_cmake/cmake/add_launch_test.cmake
@@ -102,6 +102,9 @@
 # :param ARGS: Launch arguments to pass to the launch test
 # :type ARGS: string
 function(add_launch_test filename)
+  # Convert filename to CMake path before calling macro to
+  # avoid problems with backslashes in the filename string.
+  file(TO_CMAKE_PATH "${filename}" filename)
   parse_launch_test_arguments(_launch_test ${filename} ${ARGN})

   set(cmd


Since keywords are being parsed as strings, CMP0054 needs to be set for CMake 3.1 and newer.

--- CPM.cmake
+++ CPM.cmake
@@ -208,7 +208,11 @@
 #
 # TODO: Consolidate the definitions, includes, and target_lib map lists.
 # TODO: Add ability to patch source directories after we download them.
-#
+
+if(CMAKE_VERSION VERSION_EQUAL 3.1 OR CMAKE_VERSION VERSION_GREATER 3.1)
+  cmake_policy(SET CMP0054 NEW)
+endif()
+
 #-------------------------------------------------------------------------------
 # Pre-compute a regex to match documented keywords for each command.
 #-------------------------------------------------------------------------------


Package numpy on Windows.

Package numpy on Windows.

--- projects/win32/tomviz.bundle.cmake
+++ projects/win32/tomviz.bundle.cmake
@@ -59,6 +59,15 @@
         COMPONENT ${AppName}
         PATTERN "*.lib" EXCLUDE)

+# install all extra Python modules/packages.
+if (numpy_ENABLED)
+  # on Windows, all Python packages simply go under bin/Lib/site-packages"
+  install(DIRECTORY "${install_location}/lib/site-packages/"
+    DESTINATION "bin/Lib/site-packages"
+    USE_SOURCE_PERMISSIONS
+    COMPONENT ${AppName})
+endif()
+
 #------------------------------------------------------------------------------
 set (CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_LIST_DIR}/InstallerIcon.ico")


COMP: update wcslib tag

COMP: update wcslib tag

--- SuperBuild/External_wcslib.cmake
+++ SuperBuild/External_wcslib.cmake
@@ -33,7 +33,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/Punzo/wcslib"
-    GIT_TAG "5d2c0f05a4ef669d28a87305dd44bb9f3f1bc073"
+    GIT_TAG "e6e4570a42197a5ca1b494b0cd1f3175b114ac3e"
     SOURCE_DIR ${${proj}_SOURCE_DIR}
     BINARY_DIR ${${proj}_BINARY_DIR}
     CMAKE_CACHE_ARGS


Improved portability of bzip2

Improved portability of bzip2

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -896,6 +896,10 @@

 ################################################################################
 # bzip2.
+set(BZIP2_MAKEFILE Makefile)
+if (BUILD_SHARED_LIBS)
+  set(BZIP2_MAKEFILE Makefile-libbz2_so)
+endif ()
 add_external_project(
   ${BZIP2_TARGET}
   PREFIX ${BZIP2_PREFIX}
@@ -908,8 +912,12 @@
       tar --strip-components 1 -xvf
           ${BZIP2_PREFIX}/download/bzip2-1.0.6.tar.gz
   CONFIGURE_COMMAND ${NOP}
-  BUILD_COMMAND make
-  INSTALL_COMMAND make install PREFIX=${BZIP2_PREFIX}
+  BUILD_COMMAND make -f ${BZIP2_MAKEFILE} bzip2 bzip2recover
+      CC=${CMAKE_C_COMPILER}
+      CXX=${CMAKE_CXX_COMPILER} CFLAGS=${CMAKE_C_FLAGS_WITH_ARCHS}
+      CXXFLAGS=${CMAKE_CXX_FLAGS_WITH_ARCHS}
+      LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
+  INSTALL_COMMAND make -f ${BZIP2_MAKEFILE} install PREFIX=${BZIP2_PREFIX}
   BUILD_IN_SOURCE 1)

 ################################################################################


Add dl to libraries for linux

Add dl to libraries for linux

--- duktape.cmake
+++ duktape.cmake
@@ -8,6 +8,6 @@

 if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
   target_link_libraries(duktape
-    m
+    m dl
   )
 endif()


修正不标准的c++标准设置方式

修正不标准的c++标准设置方式

--- Template/CompilerOption.cmake
+++ Template/CompilerOption.cmake
@@ -1,93 +1,98 @@
-# 默认配置选项
+# 默认配置选项
 #####################################################################

-if (NOT DEFINED ALL_FLAGS_IN_ONE_COMMON)
+if (CMAKE_CONFIGURATION_TYPES)
+	message(STATUS "Available Build Type: ${CMAKE_CONFIGURATION_TYPES}")
+else()
+	message(STATUS "Available Build Type: Unknown")
+endif()

-    if (CMAKE_CONFIGURATION_TYPES)
-        message(STATUS "Available Build Type: ${CMAKE_CONFIGURATION_TYPES}")
-    else()
-        message(STATUS "Available Build Type: Unknown")
+if(NOT CMAKE_BUILD_TYPE)
+	set(CMAKE_BUILD_TYPE "Debug")
+	#set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+endif()
+
+# 设置公共编译选项
+set(ALL_FLAGS_IN_ONE_COMMON "")
+set(C_FLAGS_IN_ONE_COMMON "")
+set(CXX_FLAGS_IN_ONE_COMMON "")
+
+# 编译器选项 (仅做了GCC、VC和Clang兼容)
+if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+    add_definitions(-Wall -Werror)
+
+    # gcc 4.9 编译输出颜色支持
+    if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.9.0" )
+            add_definitions(-fdiagnostics-color=auto)
+    endif()
+    # 检测GCC版本大于等于4.8时，默认-Wno-unused-local-typedefs (普片用于type_traits，故而关闭该警告)
+    if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.8.0" )
+            add_definitions(-Wno-unused-local-typedefs)
+            message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} Found, -Wno-unused-local-typedefs added.")
+    endif()
+
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "5.0.0" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 14)
+        message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++14.")
+    elseif ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.7.0" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 11)
+        message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++11.")
+    elseif( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.4.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.4.0" )
+        set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=c++0x")
+        message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c++0x.")
     endif()

-    if(NOT CMAKE_BUILD_TYPE)
-        set(CMAKE_BUILD_TYPE "Debug")
-        #set(CMAKE_BUILD_TYPE "RelWithDebInfo")
+elseif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    add_definitions(-Wall -Werror -fPIC)
+    # 苹果系统会误判，不过问题不大，反正也是用最高的标准
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.4" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "3.4" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 14)
+        message(STATUS "Clang Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++14.")
+    elseif ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "3.3" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "3.3" )
+        set(CMAKE_C_STANDARD 11)
+        set(CMAKE_CXX_STANDARD 11)
+        message(STATUS "Clang Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++11.")
     endif()
+endif()

-    # 设置公共编译选项
-    set(ALL_FLAGS_IN_ONE_COMMON "")
-    set(C_FLAGS_IN_ONE_COMMON "")
-    set(CXX_FLAGS_IN_ONE_COMMON "")
-
-    # 编译器选项 (仅做了GCC、VC和Clang兼容)
-    if( ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
-        add_definitions(-Wall -Werror -D_FILE_OFFSET_BITS=64)
-        if(UNIX AND NOT CYGWIN)
-            add_definitions(-fPIC)
-        endif()
-
-        # gcc 4.9 编译输出颜色支持
-        if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.9.0" )
-            add_definitions(-fdiagnostics-color=auto)
-        endif()
-        # 检测GCC版本大于等于4.8时，默认-Wno-unused-local-typedefs (普片用于type_traits，故而关闭该警告)
-        if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.8.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.8.0" )
-            add_definitions(-Wno-unused-local-typedefs)
-            message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} Found, -Wno-unused-local-typedefs added.")
-        endif()
-        if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.7.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.7.0" )
-            set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=gnu++11 -Wno-literal-suffix")
-            set(C_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=gnu11")
-            message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=gnu11/gnu++11.")
-        elseif( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.4.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.4.0" )
-            set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=gnu++0x")
-            message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=gnu++0x.")
-        endif()
-
-    elseif( ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-        add_definitions(-Wall -Werror -D_FILE_OFFSET_BITS=64)
-        if(UNIX AND NOT CYGWIN)
-            add_definitions(-fPIC)
-        endif()
-
-        set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=c++11")
-        message(STATUS "CLang Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c++11.")
-    endif()
-
-    # 配置公共编译选项
-    if ( NOT MSVC )
+# 配置公共编译选项
+if ( NOT MSVC )
         set(ALL_FLAGS_IN_ONE_DEBUG "-ggdb -O0 ${ALL_FLAGS_IN_ONE_COMMON}")
         set(ALL_FLAGS_IN_ONE_RELEASE "${ALL_FLAGS_IN_ONE_COMMON}")
         set(ALL_FLAGS_IN_ONE_RELWITHDEBINFO "-ggdb ${ALL_FLAGS_IN_ONE_COMMON}")
         set(ALL_FLAGS_IN_ONE_MINSIZEREL "${ALL_FLAGS_IN_ONE_COMMON}")
-    else()
+else()
         set(ALL_FLAGS_IN_ONE_DEBUG "/Od /MDd ${ALL_FLAGS_IN_ONE_COMMON}")
         set(ALL_FLAGS_IN_ONE_RELEASE "/O2 /MD ${ALL_FLAGS_IN_ONE_COMMON} /D NDEBUG")
         set(ALL_FLAGS_IN_ONE_RELWITHDEBINFO "/O2 /MDd ${ALL_FLAGS_IN_ONE_COMMON}")
         set(ALL_FLAGS_IN_ONE_MINSIZEREL "/Ox /MD ${ALL_FLAGS_IN_ONE_COMMON} /D NDEBUG")
-    endif()

-    # 设置实际的编译选项
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${CXX_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${CXX_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${CXX_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${CXX_FLAGS_IN_ONE_COMMON}")
+        #add_definitions(/D SEED_WITH_BOOST_HPP /D SEED_ENABLE_BOOST_FOREACH /D SEED_ENABLE_BOOST_STATIC_ASSERT)
+endif()

-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${C_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${C_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${C_FLAGS_IN_ONE_COMMON}")
-    set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${C_FLAGS_IN_ONE_COMMON}")
+# 设置实际的编译选项
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${CXX_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${CXX_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${CXX_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${CXX_FLAGS_IN_ONE_COMMON}")

-    # 库文件的附加参数 -fPIC, 多线程附加参数 -pthread
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${ALL_FLAGS_IN_ONE_DEBUG} ${C_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${ALL_FLAGS_IN_ONE_RELEASE} ${C_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${ALL_FLAGS_IN_ONE_RELWITHDEBINFO} ${C_FLAGS_IN_ONE_COMMON}")
+set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${ALL_FLAGS_IN_ONE_MINSIZEREL} ${C_FLAGS_IN_ONE_COMMON}")

-    # 功能函数
-    macro(add_compiler_define)
-        foreach(def ${ARGV})
-            if ( NOT MSVC )
-                add_definitions(-D${def})
-            else()
-                add_definitions("/D ${def}")
-            endif()
-        endforeach()
-    endmacro(add_compiler_define)
-endif()+# 库文件的附加参数 -fPIC, 多线程附加参数 -pthread -D_POSIX_MT_
+
+# 功能函数
+macro(add_compiler_define)
+	foreach(def ${ARGV})
+    	if ( NOT MSVC )
+            add_definitions(-D${def})
+        else()
+            add_definitions("/D ${def}")
+        endif()
+	endforeach()
+endmacro(add_compiler_define)


OGRE_SAMPLES_LIST should have been updated in ogre_config_sample_lib, not ogre_config_sample_exe

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -290,12 +290,6 @@
   endif (CMAKE_COMPILER_IS_GNUCXX)
   ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)

-  # Add sample to the list of link targets
-  # Global property so that we can build this up across entire sample tree
-  # since vars are local to containing scope of directories / functions
-  get_property(OGRE_SAMPLES_LIST GLOBAL PROPERTY "OGRE_SAMPLES_LIST")
-  set_property (GLOBAL PROPERTY "OGRE_SAMPLES_LIST" ${OGRE_SAMPLES_LIST} ${SAMPLENAME})
-
 endfunction(ogre_config_sample_common)

 function(ogre_config_sample_exe SAMPLENAME)
@@ -326,6 +320,13 @@
 		  CONFIGURATIONS RelWithDebInfo
 		  )
   endif ()
+
+  # Add sample to the list of link targets
+  # Global property so that we can build this up across entire sample tree
+  # since vars are local to containing scope of directories / functions
+  get_property(OGRE_SAMPLES_LIST GLOBAL PROPERTY "OGRE_SAMPLES_LIST")
+  set_property (GLOBAL PROPERTY "OGRE_SAMPLES_LIST" ${OGRE_SAMPLES_LIST} ${SAMPLENAME})
+
 endfunction(ogre_config_sample_lib)


use -nodefaultlibs for clients

use -nodefaultlibs for clients

SVN-Revision: 82

--- make/DynamoRIOUse.cmake
+++ make/DynamoRIOUse.cmake
@@ -91,7 +91,7 @@

 if (UNIX)
   # avoid SElinux text relocation security violations by explicitly requesting PIC
-  set(CLIENT_LINK_FLAGS "-fPIC -shared -nostartfiles")
+  set(CLIENT_LINK_FLAGS "-fPIC -shared -nostartfiles -nodefaultlibs -lgcc")
 else (UNIX)
   set(CLIENT_LINK_FLAGS "/nodefaultlib /noentry")
 endif (UNIX)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2011)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 06)
+SET(KWSYS_DATE_STAMP_MONTH 07)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   30)
+SET(KWSYS_DATE_STAMP_DAY   01)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   12)
+SET(KWSYS_DATE_STAMP_DAY   13)


Make `echo' a function.

Make `echo' a function.

	* build-aux/cmake/modules/Tools.cmake: When printing PATH on windows
	CMake report some parsing problem due to backslash in the PATH
	variable. However this does not happen with `message' or if `echo' is
	a function. Maybe this should be reported to the CMake team.

--- build-aux/cmake/modules/Tools.cmake
+++ build-aux/cmake/modules/Tools.cmake
@@ -19,9 +19,9 @@
   endfunction(PRINT_CMAKE_VARS)

   # Shorthand for message(STATUS "blabla")
-  macro(ECHO)
+  function(ECHO)
     message(STATUS ${ARGV})
-  endmacro(ECHO)
+  endfunction(ECHO)

   # Find the hostname of machine running cmake.
   # outvar: the name of the variable where to store the result.


Remove extra newline character on g++ -dumpversion output

--- blocks/boost/install/utils.cmake
+++ blocks/boost/install/utils.cmake
@@ -4,6 +4,8 @@
 		string (REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1" version_string ${version_string_full})
 	elseif(CMAKE_COMPILER_IS_GNUCXX)
 		EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE version_string)
+		string (REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])" "\\1.\\2.\\3" version_string ${version_string})
+    string(STRIP ${version_string} version_string) #Remove extra newline character
 	endif()

 	set(${_ret} ${version_string} PARENT_SCOPE)


change RelWithDebInfo to be multithreaded compile on windows instead of using minimal rebuild.

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -46,7 +46,7 @@
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
       CACHE STRING "C++ compiler debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
-      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /Ob0 /Gm -D_SECURE_STL=0"
+      "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /Ob0 /MP -D_SECURE_STL=0"
       CACHE STRING "C++ compiler release-with-debug options" FORCE)
   set(CMAKE_CXX_FLAGS_RELEASE
       "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 /Oi /Ot /GF /Gy /arch:SSE2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"


fix finding serial hdf5

fix finding serial hdf5

--- src/cmake/FindHDF5.cmake
+++ src/cmake/FindHDF5.cmake
@@ -10,7 +10,7 @@
 #   HDF5_INCLUDE_DIRS_CACHED
 #   HDF5_LIBRARIES_CACHED

-if(NOT "${HDF5_ROOT}" STREQUAL "${OLD_HDF5_ROOT}")
+if(NOT "${OLD_HDF5_ROOT}" OR NOT "${HDF5_ROOT}" STREQUAL "${OLD_HDF5_ROOT}")
     message(STATUS "Detecting HDF5: redetecing with new HDF5_ROOT=${HDF5_ROOT} (OLD_HDF5_ROOT=${OLD_HDF5_ROOT}).")
     unset(HDF5_INCLUDE_DIRS_CACHED CACHE)
     unset(HDF5_LIBRARIES_CACHED CACHE)
@@ -23,7 +23,7 @@

 # find headers
 find_path(HDF5_INCLUDE_DIRS_CACHED H5pubconf.h PATHS ${HDF5_ROOT}/include NO_DEFAULT_PATH)
-find_path(HDF5_INCLUDE_DIRS_CACHED H5pubconf.h)
+find_path(HDF5_INCLUDE_DIRS_CACHED H5pubconf.h PATH_SUFFIXES hdf5 hdf5/serial)
 if(HDF5_INCLUDE_DIRS_CACHED)
     execute_process(
         COMMAND grep H5_VERSION ${HDF5_INCLUDE_DIRS_CACHED}/H5pubconf.h
@@ -36,7 +36,7 @@

 # find library
 find_library(HDF5_LIBRARIES_CACHED hdf5 PATHS ${HDF5_ROOT}/lib ${HDF5_ROOT}/lib64 NO_DEFAULT_PATH)
-find_library(HDF5_LIBRARIES_CACHED hdf5)
+find_library(HDF5_LIBRARIES_CACHED hdf5 PATH_SUFFIXES hdf5 hdf5/serial)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(HDF5


Escape $ENV{DESTDIR} everywhere in ament_python_install_package() (#324)

Follow up after f80071e2216e766f7bf1b0792493a5f6523e9226

Signed-off-by: Michel Hidalgo <2c7f9fd20fbeb41ce8894ec4653d66fa7f3b6e1a@ekumenlabs.com>

--- ament_cmake_python/cmake/ament_python_install_package.cmake
+++ ament_cmake_python/cmake/ament_python_install_package.cmake
@@ -141,7 +141,7 @@
   install(CODE
     "set(extra_install_args ${extra_install_args})
      set(install_dir \"${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_DIR}\")
-     if(DEFINED ENV{DESTDIR} AND NOT \"$ENV{DESTDIR}\" STREQUAL \"\")
+     if(DEFINED ENV{DESTDIR} AND NOT \"\$ENV{DESTDIR}\" STREQUAL \"\")
        list(APPEND extra_install_args --root \$ENV{DESTDIR})
        file(TO_CMAKE_PATH \"\$ENV{DESTDIR}/\${install_dir}\" install_dir)
      endif()


cmake: 'git' may not be present on the system

--- src/bootstrap/cmake/settings.cmake
+++ src/bootstrap/cmake/settings.cmake
@@ -23,6 +23,7 @@
 	if (NOT "$ENV{TRAVIS_TAG}" STREQUAL "")
 		# do not append a metadata when compiled from a tag
 	else()
+		set(GIT_COMMIT_HASH "")
 		if(NOT "$ENV{TRAVIS_COMMIT_RANGE}" STREQUAL "")
 			string(REPLACE "..." ";" GIT_COMMIT_HASH "$ENV{TRAVIS_COMMIT_RANGE}")
 			list(GET GIT_COMMIT_HASH 0 __start)
@@ -33,16 +34,21 @@
 		elseif(NOT "$ENV{TRAVIS_COMMIT}" STREQUAL "")
 			string(SUBSTRING "$ENV{TRAVIS_COMMIT}" 0 7 GIT_COMMIT_HASH)
 		else()
-			execute_process(COMMAND git log -1 --format=%h
-				WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_COMMIT_HASH
-				OUTPUT_STRIP_TRAILING_WHITESPACE)
+			find_program(bin_git NAMES "git")
+			if (bin_git)
+				execute_process(COMMAND "${bin_git}" log -1 --format=%h
+					WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_COMMIT_HASH
+					OUTPUT_STRIP_TRAILING_WHITESPACE)
+			endif()
 		endif()

-		if (NOT "$ENV{TRAVIS_PULL_REQUEST}" STREQUAL "" AND NOT "$ENV{TRAVIS_PULL_REQUEST}" STREQUAL "false")
-			set(GIT_COMMIT_HASH "github-$ENV{TRAVIS_PULL_REQUEST}-${GIT_COMMIT_HASH}")
+		if (NOT "${GIT_COMMIT_HASH}" STREQUAL "")
+			if (NOT "$ENV{TRAVIS_PULL_REQUEST}" STREQUAL "" AND NOT "$ENV{TRAVIS_PULL_REQUEST}" STREQUAL "false")
+				set(GIT_COMMIT_HASH "github-$ENV{TRAVIS_PULL_REQUEST}-${GIT_COMMIT_HASH}")
+			endif()
+
+			set(nany_version_metadata "${GIT_COMMIT_HASH}" CACHE STRING "" FORCE)
 		endif()
-
-		set(nany_version_metadata "${GIT_COMMIT_HASH}" CACHE STRING "" FORCE)
 	endif()
 endif()


Fix Windows cmake build by excluding newly broken test. Change: 142778020

--- tensorflow/contrib/cmake/tf_tests.cmake
+++ tensorflow/contrib/cmake/tf_tests.cmake
@@ -162,6 +162,7 @@
       "${tensorflow_source_dir}/tensorflow/python/training/saver_large_variable_test.py"  # Overflow error.
       "${tensorflow_source_dir}/tensorflow/python/training/supervisor_test.py"  # Flaky I/O error on rename.
       "${tensorflow_source_dir}/tensorflow/python/training/sync_replicas_optimizer_test.py"  # Needs portpicker.
+      "${tensorflow_source_dir}/tensorflow/python/kernel_tests/array_ops_test.py"  # depends on python/framework/test_ops
     )
   endif()
   list(REMOVE_ITEM tf_test_src_py ${tf_test_src_py_exclude})


ENH: Better support for MacOSX/uuid lib

ENH: Better support for MacOSX/uuid lib

--- Utilities/gdcm/CMake/FindUUID.cmake
+++ Utilities/gdcm/CMake/FindUUID.cmake
@@ -12,8 +12,20 @@
 /usr/include
 )

+# On MacOSX we have:
+# $ nm -g /usr/lib/libSystem.dylib | grep uuid_generate
+# 000b3aeb T _uuid_generate
+# 0003e67e T _uuid_generate_random
+# 000b37a1 T _uuid_generate_time
+IF(APPLE)
+  SET(UUID_LIBRARY_VAR System)
+ELSE(APPLE)
+  # Linux type:
+  SET(UUID_LIBRARY_VAR uuid)
+ENDIF(APPLE)
+
 FIND_LIBRARY(UUID_LIBRARY
-  NAMES uuid
+  NAMES ${UUID_LIBRARY_VAR}
   PATHS /lib /usr/lib /usr/local/lib
   )


Doxygen: Changed the warning description to indicate you can unload the project in visual studio instead of disabling it in cmake

--- tools/doxygen/doxygen.cmake
+++ tools/doxygen/doxygen.cmake
@@ -32,9 +32,10 @@
     if(${IVW_DOXYGEN_PROJECT})
         ivw_message(STATUS
             "In Visual Studio the doxygen project will rerun every time you run\n"
-            "\"ALL_BUILD\" even if it is up to date. Hence, you propbably only\n"
-            "want to enable \"IVW_DOXYGEN_PROJECT\" once to generate the\n"
-            "documentation and then then disable it.")
+            "\"ALL_BUILD\" even if it is up to date. Hence, you propbably want\n"
+            "to disable generation of doxygen on each build this can be done\n"
+            "by right clicking on the doc folder in the \"Solution Explorer\" and\n"
+            "select \"Unload Project\".")
     endif()
 else()
     option(IVW_DOXYGEN_PROJECT "Create Inviwo doxygen files" ON)


Fixing references to cmake test files in large file tests.

--- misc/cmake/gmxTestLargeFiles.cmake
+++ misc/cmake/gmxTestLargeFiles.cmake
@@ -6,7 +6,7 @@
 #  This macro will also set defines necessary enable large file support, for instance
 #  _LARGE_FILES
 #  _LARGEFILE_SOURCE
-#  _FILE_OFFSET_BITS 64
+#  _FILE_OFFSET_BITS 64
 #  HAVE_FSEEKO
 #
 #  However, it is YOUR job to make sure these defines are set in a cmakedefine so they
@@ -14,7 +14,7 @@

 MACRO(GMX_TEST_LARGE_FILES VARIABLE)
   IF(NOT DEFINED ${VARIABLE})
-
+
     # On most platforms it is probably overkill to first test the flags for 64-bit off_t,
     # and then separately fseeko. However, in the future we might have 128-bit filesystems
     # (ZFS), so it might be dangerous to indiscriminately set e.g. _FILE_OFFSET_BITS=64.
@@ -22,71 +22,71 @@
     MESSAGE(STATUS "Checking for 64-bit off_t")

     # First check without any special flags
-    TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}"
-      "${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c")
+    TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}"
+      "${CMAKE_MODULE_PATH}/TestFileOffsetBits.c")
     if(FILE64_OK)
-      MESSAGE(STATUS "Checking for 64-bit off_t - present")
+      MESSAGE(STATUS "Checking for 64-bit off_t - present")
     endif(FILE64_OK)
-
-    if(NOT FILE64_OK)
+
+    if(NOT FILE64_OK)
       # Test with _FILE_OFFSET_BITS=64
       TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}"
-        "${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+        "${CMAKE_MODULE_PATH}/TestFileOffsetBits.c"
         COMPILE_DEFINITIONS "-D_FILE_OFFSET_BITS=64" )
       if(FILE64_OK)
-	MESSAGE(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
+        MESSAGE(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64")
         set(_FILE_OFFSET_BITS 64)
       endif(FILE64_OK)
-    endif(NOT FILE64_OK)
+    endif(NOT FILE64_OK)

     if(NOT FILE64_OK)
       # Test with _LARGE_FILES
       TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}"
-        "${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+        "${CMAKE_MODULE_PATH}/TestFileOffsetBits.c"
         COMPILE_DEFINITIONS "-D_LARGE_FILES" )
       if(FILE64_OK)
         MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES")
         set(_LARGE_FILES 1)
       endif(FILE64_OK)
     endif(NOT FILE64_OK)
-
+
     if(NOT FILE64_OK)
       # Test with _LARGEFILE_SOURCE
       TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}"
-        "${PROJECT_SOURCE_DIR}/cmake/TestFileOffsetBits.c"
+        "${CMAKE_MODULE_PATH}/TestFileOffsetBits.c"
         COMPILE_DEFINITIONS "-D_LARGEFILE_SOURCE" )
       if(FILE64_OK)
         MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE")
-      	set(_LARGEFILE_SOURCE 1)
+        set(_LARGEFILE_SOURCE 1)
       endif(FILE64_OK)
     endif(NOT FILE64_OK)
-
+
     if(NOT FILE64_OK)
       # now check for Windows stuff
       TRY_COMPILE(FILE64_OK "${PROJECT_BINARY_DIR}"
-        "${PROJECT_SOURCE_DIR}/cmake/TestWindowsFSeek.c")
+        "${CMAKE_MODULE_PATH}/TestWindowsFSeek.c")
       if(FILE64_OK)
         MESSAGE(STATUS "Checking for 64-bit off_t - present with _fseeki64")
         set(HAVE__FSEEKI64 1)
       endif(FILE64_OK)
     endif(NOT FILE64_OK)
-
+
     if(NOT FILE64_OK)
       MESSAGE(STATUS "Checking for 64-bit off_t - not present")
     else(NOT FILE64_OK)

       # Set the flags we might have determined to be required above
-      configure_file("${PROJECT_SOURCE_DIR}/cmake/TestLargeFiles.c.cmakein"
+      configure_file("${CMAKE_MODULE_PATH}/TestLargeFiles.c.cmakein"
                      "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")

-      MESSAGE(STATUS "Checking for fseeko/ftello")
+      MESSAGE(STATUS "Checking for fseeko/ftello")
       # Test if ftello/fseeko are	available
       TRY_COMPILE(FSEEKO_COMPILE_OK "${PROJECT_BINARY_DIR}"
         "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c")
       if(FSEEKO_COMPILE_OK)
         MESSAGE(STATUS "Checking for fseeko/ftello - present")
       endif(FSEEKO_COMPILE_OK)
-
+
       if(NOT FSEEKO_COMPILE_OK)
         # glibc 2.2 neds _LARGEFILE_SOURCE for fseeko (but not 64-bit off_t...)
         TRY_COMPILE(FSEEKO_COMPILE_OK "${PROJECT_BINARY_DIR}"
@@ -97,7 +97,7 @@
           set(_LARGEFILE_SOURCE 1)
         endif(FSEEKO_COMPILE_OK)
       endif(NOT FSEEKO_COMPILE_OK)
-
+
     endif(NOT FILE64_OK)

     if(FSEEKO_COMPILE_OK)
@@ -105,16 +105,13 @@
       set(HAVE_FSEEKO 1)
     else(FSEEKO_COMPILE_OK)
       if (HAVE__FSEEKI64)
-	SET(${VARIABLE} 1 CACHE INTERNAL "Result of test for large file support" FORCE)
-	SET(HAVE__FSEEKI64 1 CACHE INTERNAL "Windows 64-bit fseek" FORCE)
+        SET(${VARIABLE} 1 CACHE INTERNAL "Result of test for large file support" FORCE)
+        SET(HAVE__FSEEKI64 1 CACHE INTERNAL "Windows 64-bit fseek" FORCE)
       else (HAVE__FSEEKI64)
         MESSAGE(STATUS "Checking for fseeko/ftello - not found")
         SET(${VARIABLE} 0 CACHE INTERNAL "Result of test for large file support" FORCE)
       endif (HAVE__FSEEKI64)
     endif(FSEEKO_COMPILE_OK)
-
+
   ENDIF(NOT DEFINED ${VARIABLE})
 ENDMACRO(GMX_TEST_LARGE_FILES VARIABLE)
-
-
-


set dir for continuous build

set dir for continuous build

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3493 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/test/openVibeTests.cmake
+++ trunk/test/openVibeTests.cmake
@@ -56,7 +56,7 @@
 ENDIF(${CTEST_SCRIPT_ARG} MATCHES Continuous)

 IF(${MODEL} MATCHES Continuous)
-	set(OV-ROOT-DIR              "con.ov")
+	set(OV-ROOT-DIR              "${CMAKE_CURRENT_SOURCE_DIR}/con.ov")
 	file(MAKE_DIRECTORY ${OV-ROOT-DIR})
 ELSE(${MODEL} MATCHES Continuous)
 	# create a temporary directory with very short name to host build


Added MSP_HOME search path

Added MSP_HOME search path

--- cmake/CMakeModules/FindCsmApi.cmake
+++ cmake/CMakeModules/FindCsmApi.cmake
@@ -9,13 +9,15 @@
 SET(CMAKE_FIND_FRAMEWORK "LAST")
 FIND_PATH(CSMAPI_INCLUDE_DIRS csm/csm.h
         PATHS
+        $ENV{MSP_HOME}/include/common
         ${OSSIM_DEPENDENCIES}/include
 		${OSSIM_INSTALL_PREFIX}/include
 )

-set(CSMAPI_NAMES ${CSMAPI_NAMES} csmapi )
+set(CSMAPI_NAMES ${CSMAPI_NAMES} MSPcsm csmapi )
 find_library(CSMAPI_LIBRARY NAMES ${CSMAPI_NAMES}
    PATHS
+      $ENV{MSP_HOME}/lib
       ${OSSIM_INSTALL_PREFIX}/lib${LIBSUFFIX}
       ${OSSIM_DEPENDENCIES}/lib
       ${OSSIM_INSTALL_PREFIX}


MSVC 2010 has an /arch:AVX flag which we make use of if needed

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -253,21 +253,26 @@
    else()
       list(APPEND _disable_vector_unit_list "fma4")
    endif()
-   if(CMAKE_C_COMPILER MATCHES "cl(.exe)?$") # MSVC
-      # MSVC on 32 bit can select only /arch:SSE2
-      # MSVC on 64 bit cannot select anything
-      if(NOT CMAKE_CL_64)
+   if(MSVC)
+      # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
+      # MSVC on 64 bit cannot select anything (should have changed with MSVC 2010)
+      _my_find(_enable_vector_unit_list "avx" _avx)
+      set(_avx_flag FALSE)
+      if(_avx)
+         AddCompilerFlag("/arch:AVX" _avx_flag)
+      endif()
+      if(NOT _avx_flag)
          _my_find(_enable_vector_unit_list "sse2" _found)
-	 if(_found)
+         if(_found)
             AddCompilerFlag("/arch:SSE2")
-	 endif()
-      endif(NOT CMAKE_CL_64)
+         endif()
+      endif()
       foreach(_flag ${_enable_vector_unit_list})
          string(TOUPPER "${_flag}" _flag)
          string(REPLACE "." "_" _flag "__${_flag}__")
          add_definitions("-D${_flag}")
       endforeach(_flag)
-   elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC
+   elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC (on Linux)
       _my_find(_available_vector_units_list "avx"    _found)
       if(_found)
          AddCompilerFlag("-xAVX")
@@ -306,7 +311,7 @@
             endif(_found)
          endif(_found)
       endif(_found)
-   else(CMAKE_C_COMPILER MATCHES "cl(.exe)?$")
+   else() # not MSVC and not ICC => GCC, Clang, Open64
       foreach(_flag ${_march_flag_list})
          AddCompilerFlag("-march=${_flag}" _good)
          if(_good)
@@ -332,5 +337,5 @@
             endif(NOT GCC_4_5_2)
          endif(GCC_4_5_0)
       endif(CMAKE_COMPILER_IS_GNUCXX)
-   endif(CMAKE_C_COMPILER MATCHES "cl(.exe)?$")
+   endif()
 endmacro(OptimizeForArchitecture)


Speedup CPU detection on mac

Speedup CPU detection on mac

The multiple `/usr/sbin/sysctl` calls seem to be extremely slow on 10.13.2. This improves the situation by a factor 4 by doing only one call and then splitting out the output into their proper place.

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -70,10 +70,13 @@
       string(REGEX REPLACE ".*model[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_model "${_cpuinfo}")
       string(REGEX REPLACE ".*flags[ \t]*:[ \t]+([^\n]+).*" "\\1" _cpu_flags "${_cpuinfo}")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor" OUTPUT_VARIABLE _vendor_id)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.model"  OUTPUT_VARIABLE _cpu_model)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.family" OUTPUT_VARIABLE _cpu_family)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE _cpu_flags)
+      exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features" OUTPUT_VARIABLE _sysctl_output_string)
+      string(REPLACE "\n" ";" _sysctl_output ${_sysctl_output_string})
+      list(GET _sysctl_output 0 _vendor_id)
+      list(GET _sysctl_output 1 _cpu_model)
+      list(GET _sysctl_output 2 _cpu_family)
+      list(GET _sysctl_output 3 _cpu_flags)
+
       string(TOLOWER "${_cpu_flags}" _cpu_flags)
       string(REPLACE "." "_" _cpu_flags "${_cpu_flags}")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")


qi_use_lib: hack for qt5

qi_use_lib: hack for qt5

the if(TARGET ...) solution does not work
in some corner cases

Change-Id: I60b51cb4f81e37c1d981e656f883eef2f7e21628

--- cmake/qibuild/internal/uselib.cmake
+++ cmake/qibuild/internal/uselib.cmake
@@ -190,13 +190,10 @@
     endif()

     if (DEFINED ${_U_PKG}_LIBRARIES)
-      list(LENGTH ${_U_PKG}_LIBRARIES _length)
-      if(${_length} EQUAL 1)
-        if(TARGET ${${_U_PKG}_LIBRARIES})
-        # this is an imported target, we need to call find_package()
-        # before using target_link_libraries()
-          find_package(${_U_PKG})
-        endif()
+      # hack for qt5:
+      string(REGEX MATCH "^QT5_.*" _match ${_U_PKG})
+      if(NOT "${_match}" STREQUAL "")
+        find_package(${_U_PKG})
       endif()
       target_link_libraries("${name}" ${${_U_PKG}_LIBRARIES})
     elseif (DEFINED ${_U_PKG}_LIBRARY)


Make ilmbase compile on a clean machine as well, by adding stdlib to the LDFLAGS

--- ilmbase.cmake
+++ ilmbase.cmake
@@ -39,7 +39,7 @@
     PATCH_COMMAND       ${ilmbase_PATCH_COMMAND}
     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${ilmbase_SRC_DIR}/configure
         --prefix=${BUILDEM_DIR}
-        "LDFLAGS=${BUILDEM_LDFLAGS}"
+        "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
         "LIBS=-Wc,${BUILDEM_ADDITIONAL_CXX_FLAGS}"
         "CXXFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)
@@ -48,4 +48,4 @@

 set_target_properties(${ilmbase_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)

-endif (NOT ilmbase_NAME)+endif (NOT ilmbase_NAME)


cmake/FindWaylandProtocols: fix wayland protocol path generation for cross compile

--- cmake/FindWaylandProtocols.cmake
+++ cmake/FindWaylandProtocols.cmake
@@ -6,8 +6,9 @@

 if(NOT WIN32)
     find_package(PkgConfig)
-    pkg_check_modules(PKG_WAYLAND_PROTOCOLS QUIET wayland-protocols)
-    set(WAYLAND_PROTOCOLS_PATH ${PKG_WAYLAND_PROTOCOLS_PREFIX}/share/wayland-protocols)
+    pkg_check_modules(WAYLAND_PROTOCOLS_PATH REQUIRED wayland-protocols)
+    execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir wayland-protocols
+       OUTPUT_VARIABLE WAYLAND_PROTOCOLS_PATH OUTPUT_STRIP_TRAILING_WHITESPACE)
     find_package_handle_standard_args(WAYLAND DEFAULT_MSG WAYLAND_PROTOCOLS_PATH)
     mark_as_advanced(WAYLAND_PROTOCOLS_PATH)
 endif()


Added a search path to find OpenBLAS for convenience (homebrew install)

--- cmake/Modules/FindOpenBLAS.cmake
+++ cmake/Modules/FindOpenBLAS.cmake
@@ -7,6 +7,7 @@
   /usr/local/include
   /usr/local/include/openblas
   /usr/local/include/openblas-base
+  /usr/local/opt/openblas/include
   /opt/OpenBLAS/include
   $ENV{OpenBLAS_HOME}
   $ENV{OpenBLAS_HOME}/include
@@ -21,6 +22,7 @@
         /usr/lib64
         /usr/local/lib
         /usr/local/lib64
+        /usr/local/opt/openblas/lib
         /opt/OpenBLAS/lib
         $ENV{OpenBLAS}cd
         $ENV{OpenBLAS}/lib


cmake: fix full build

cmake: fix full build

use target_link_elektra which handles all cases already

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -90,13 +90,8 @@
 			endif ()
 		endif (INSTALL_TESTING)

-		if (BUILD_SHARED)
-			if (ARG_LINK_ELEKTRA)
-				target_link_libraries (${testexename} elektra-kdb elektra-plugin ${ARG_LINK_ELEKTRA})
-			else()
-				target_link_libraries (${testexename} elektra-kdb elektra-plugin)
-			endif ()
-		endif ()
+		target_link_elektra(${testexename} elektra-kdb elektra-plugin ${ARG_LINK_ELEKTRA})
+
 		target_link_libraries (${testexename} ${ARG_LINK_LIBRARIES})
 		set_target_properties (${testexename} PROPERTIES
 				COMPILE_DEFINITIONS "HAVE_KDBCONFIG_H;ELEKTRA_PLUGIN_TEST;${ARG_COMPILE_DEFINITIONS}")


cmake: Also export DBUS_GLIB_LOWLEVEL_INCLUDE_DIR so one can include <dbus/dbus-glib-lowlevel.h>.

--- cmake/modules/FindDBusGLib.cmake
+++ cmake/modules/FindDBusGLib.cmake
@@ -35,6 +35,13 @@
           ${PC_DBUS_GLIB_INCLUDE_DIRS}
 )

+find_path(DBUS_GLIB_LOWLEVEL_INCLUDE_DIR
+          NAMES dbus/dbus-arch-deps.h
+          HINTS
+          ${PC_DBUS_GLIB_INCLUDEDIR}
+          ${PC_DBUS_GLIB_INCLUDE_DIRS}
+)
+
 # HACK! Workaround appending "/dbus-1.0" to the HINTS above not working for some reason.
 set (DBUS_GLIB_INCLUDE_DIR
      "${DBUS_GLIB_INCLUDE_DIR}/dbus-1.0"


Minor corrections in comments

Minor corrections in comments

--- cmake_modules/FindAlloutil.cmake
+++ cmake_modules/FindAlloutil.cmake
@@ -1,9 +1,9 @@
-# - Try to find Allocore
+# - Try to find Alloutil
 # Once done this will define
 #
-#  ALLOUTIL_FOUND - system has Allocore
-#  ALLOUTIL_INCLUDE_DIR - the Allocore include directory
-#  ALLOUTIL_LIBRARY - Link these to use Allocore
+#  ALLOUTIL_FOUND - system has Alloutil
+#  ALLOUTIL_INCLUDE_DIR - the Alloutil include directory
+#  ALLOUTIL_LIBRARY - Link these to use Alloutil
 #

 include(LibFindMacros)


added missing switch for linking required ONLY for gcc

--- include.cmake
+++ include.cmake
@@ -98,8 +98,10 @@

     if ("${GSYS_ENV}" STREQUAL "deg")
         add_definitions(-DDEG -DCIA_DEX)
-        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-rpath,$ORIGIN,-rpath,$ORIGIN/../../..")
-        link_libraries(stdc++fs pthread)
+        if ("${MACOS_LEGACY}" STREQUAL "true")
+            set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-rpath,$ORIGIN,-rpath,$ORIGIN/../../..")
+            link_libraries(stdc++fs pthread)
+        endif()
     endif()

     set(GPRODUCTS_ENV $ENV{GPRODUCTS})


changing windows search path for new version of flann

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@955 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindFlann.cmake
+++ cmake/Modules/FindFlann.cmake
@@ -13,7 +13,7 @@

 find_path(FLANN_INCLUDE_DIR flann/flann.hpp
           HINTS ${PC_FLANN_INCLUDEDIR} ${PC_FLANN_INCLUDE_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
-          PATHS "$ENV{PROGRAMFILES}/flann 1.6.8" "$ENV{PROGRAMW6432}/flann 1.6.8"
+          PATHS "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
           PATH_SUFFIXES include)

 # Prefer static libraries in Windows over shared ones
@@ -21,13 +21,13 @@
   find_library(FLANN_LIBRARY
                NAMES flann_cpp_s flann_cpp
                HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT}" "$ENV{FLANN_ROOT}"
-               PATHS "$ENV{PROGRAMFILES}/flann 1.6.8" "$ENV{PROGRAMW6432}/flann 1.6.8"
+               PATHS "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
                PATH_SUFFIXES lib)

   find_library(FLANN_LIBRARY_DEBUG
                NAMES flann_cpp_s-gd flann_cpp-gd flann_cpp_s flann_cpp
                HINTS ${PC_FLANN_LIBDIR} ${PC_FLANN_LIBRARY_DIRS} "${FLANN_ROOT} $ENV{FLANN_ROOT}"
-               PATHS "$ENV{PROGRAMFILES}/flann 1.6.8" "$ENV{PROGRAMW6432}/flann 1.6.8"
+               PATHS "$ENV{PROGRAMFILES}/flann 1.6.9" "$ENV{PROGRAMW6432}/flann 1.6.9"
                PATH_SUFFIXES lib)
 else(WIN32)
   find_library(FLANN_LIBRARY


Android cmake: changed -std=gnu++11 to c++11

--- cmake/android.toolchain.cmake
+++ cmake/android.toolchain.cmake
@@ -139,7 +139,7 @@
 set(ANDROID_LD_FLAGS "-shared --sysroot=${ANDROID_NDK_SYSROOT} -L${ANDROID_NDK_STL_LIBRARYPATH} -no-canonical-prefixes -Wl,--fix-cortex-a8 -Wl,--no-warn-mismatch -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now ${ORYOL_ANDROID_LINK_VERBOSE}")

 # c++ compiler flags
-set(CMAKE_CXX_FLAGS "${ANDROID_C_FLAGS} ${ORYOL_PLATFORM_DEFINES} -std=gnu++11 ${ANDROID_NDK_STL_CXXFLAGS} ${ORYOL_ANDROID_EXCEPTION_FLAGS} ${ANDROID_NDK_CXX_WARN_FLAGS}")
+set(CMAKE_CXX_FLAGS "${ANDROID_C_FLAGS} ${ORYOL_PLATFORM_DEFINES} -std=c++11 ${ANDROID_NDK_STL_CXXFLAGS} ${ORYOL_ANDROID_EXCEPTION_FLAGS} ${ANDROID_NDK_CXX_WARN_FLAGS}")
 set(CMAKE_CXX_FLAGS_RELEASE "-Os -fomit-frame-pointer -funswitch-loops -finline-limit=300 -DNDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "-O0 -fno-omit-frame-pointer -g -D_DEBUG_ -D_DEBUG -DORYOL_DEBUG=1")


fix filename for mac bundles

fix filename for mac bundles

--- cmake/packages/packages.cmake
+++ cmake/packages/packages.cmake
@@ -53,7 +53,7 @@
   include(packages/rpm)
   include(packages/tar)
 elseif ("${PACKAGING}" STREQUAL "Bundle")
-  set(CPACK_PACKAGE_FILE_NAME      "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_x86_64")
+  set(CPACK_PACKAGE_FILE_NAME      "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}.x86_64")
   include(packages/bundle)
   include(packages/tar)
 elseif (MSVC)


Backup. Major review of qin32 CXXFLAGS. All is in order now. It's remarkable to me that anything built successfully with what we were telling the compiler previously.

--- cmake_modules/LPSCommon.cmake
+++ cmake_modules/LPSCommon.cmake
@@ -208,7 +208,8 @@
        endif()

     if(WIN64MSVC)
-       set(LPS_CXX_FLAGS "/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /EHsc ${OPTIMIZATION} /D_HDF5USEDLL_" CACHE STRING "C++ Compiler Flags")
+       set(LPS_CXX_FLAGS "/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /EHsc /D_HDF5USEDLL_" CACHE STRING "C++ Compiler Flags")
+       #set(LPS_CXX_FLAGS "/D_USRDLL ${MP} /GR /nologo /DWIN32 /D_WINDOWS /W1 /EHsc ${OPTIMIZATION} /D_HDF5USEDLL_" CACHE STRING "C++ Compiler Flags")
        set(LPS_SHARED_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags for Shared Libs")
        set(LPS_EXE_LINKER_FLAGS "/INCREMENTAL:NO /NOLOGO /DLL /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /DYNAMICBASE /NXCOMPAT /MACHINE:X64" CACHE STRING "Linker Flags for Executables")
     elseif(WIN64INTEL)
@@ -244,10 +245,10 @@
     if(WIN64MSVC OR WIN64INTEL)

         if(${USE_VTK})
-            set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=1\" /MDd /DUSE_VTK" CACHE
+            set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUGGING=1\" /MDd /LDd /Od /DUSE_VTK" CACHE
                 STRING "Flags used by the C++ compiler for Debug-contracts builds" FORCE)
         else()
-             set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=1\" /MDd" CACHE
+             set(CMAKE_CXX_FLAGS_DEBUG-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUGGING=1\" /MDd /LDd /Od" CACHE
                 STRING "Flags used by the C++ compiler for Debug-contracts builds" FORCE)
         endif()

@@ -279,10 +280,10 @@
     if(WIN64MSVC OR WIN64INTEL)

         if(${USE_VTK})
-            set(CMAKE_CXX_FLAGS_DEBUG-NO-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=1\" /MDd /DUSE_VTK /DNDEBUG" CACHE
+            set(CMAKE_CXX_FLAGS_DEBUG-NO-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUGGING=1\" /MDd /LDd /Od /DUSE_VTK /DNDEBUG" CACHE
                 STRING "Flags used by the C++ compiler for Debug-no-contracts builds" FORCE)
          else()
-            set(CMAKE_CXX_FLAGS_DEBUG-NO-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=1\" /MDd /DNDEBUG" CACHE
+            set(CMAKE_CXX_FLAGS_DEBUG-NO-CONTRACTS "${LPS_CXX_FLAGS} /Zi /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUGGING=1\" /MDd /LDd /Od /DNDEBUG" CACHE
                 STRING "Flags used by the C++ compiler for Debug-no-contracts builds" FORCE)
          endif()

@@ -309,10 +310,10 @@
     if(WIN64MSVC OR WIN64INTEL)

         if(${USE_VTK})
-            set(CMAKE_CXX_FLAGS_RELEASE-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=0\" /DUSE_VTK /MD" CACHE
+            set(CMAKE_CXX_FLAGS_RELEASE-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=0\" /DUSE_VTK /MD /Ox " CACHE
                 STRING "Flags used by the C++ compiler for Release-contracts builds" FORCE)
         else()
-            set(CMAKE_CXX_FLAGS_RELEASE-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=0\" /MD" CACHE
+            set(CMAKE_CXX_FLAGS_RELEASE-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=0\" /MD /Ox " CACHE
                 STRING "Flags used by the C++ compiler for Release-contracts builds" FORCE)
         endif()

@@ -341,10 +342,10 @@
     if(WIN64MSVC OR WIN64INTEL)

        if(${USE_VTK})
-            set(CMAKE_CXX_FLAGS_RELEASE-NO-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=0\" /MD /DUSE_VTK /DNDEBUG" CACHE
+            set(CMAKE_CXX_FLAGS_RELEASE-NO-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=0\" /MD /Ox /DUSE_VTK /DNDEBUG" CACHE
                 STRING "Flags used by the C++ compiler for Release-no-contracts builds" FORCE)
        else()
-            set(CMAKE_CXX_FLAGS_RELEASE-NO-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=1\" /D\"_HAS_ITERATOR_DEBUG=0\" /MD /DNDEBUG" CACHE
+            set(CMAKE_CXX_FLAGS_RELEASE-NO-CONTRACTS "${LPS_CXX_FLAGS} /D\"_SECURE_SCL=0\" /MD /Ox /DNDEBUG" CACHE
                 STRING "Flags used by the C++ compiler for Release-no-contracts builds" FORCE)
       endif()


Add missing compile flags for AIX and Solaris

--- BdeBuildSystem/BdeDependencyUtils.cmake
+++ BdeBuildSystem/BdeDependencyUtils.cmake
@@ -12,14 +12,15 @@

     # add OS specific compilation definitions for multithreaded code
     if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
-        set_property(TARGET bbs_threads
-                     APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS
-                        _POSIX_PTHREAD_SEMANTICS
-                        _REENTRANT)
+        target_compile_definitions(bbs_threads
+            INTERFACE
+                _POSIX_PTHREAD_SEMANTICS
+                _REENTRANT)
     elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX")
         target_compile_definitions(
             bbs_threads
             INTERFACE
+                _POSIX_PTHREAD_SEMANTICS
                 _REENTRANT
                 _THREAD_SAFE
                 __VACPP_MULTI__)
@@ -38,6 +39,11 @@
     if(CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
         target_link_libraries(bbs_bsl_rt INTERFACE -lrt)
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "XL")
+        target_compile_definitions(
+            bbs_bsl_rt
+            INTERFACE
+                __NOLOCK_ON_INPUT
+                __NOLOCK_ON_OUTPUT)
     elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
         if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
             target_link_libraries(bbs_bsl_rt INTERFACE -lrt)