CMake: some work on simplifying the deployment of plugins' external binaries (#966).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -611,13 +611,11 @@
             # Link the plugin to the external library

             IF(WIN32)
-                STRING(REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "${CMAKE_IMPORT_LIBRARY_PREFIX}"
+                STRING(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}"
                        IMPORT_EXTERNAL_BINARY "${EXTERNAL_BINARY}")
-                STRING(REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}"
-                       IMPORT_EXTERNAL_BINARY "${EXTERNAL_BINARY}")

                 TARGET_LINK_LIBRARIES(${PROJECT_NAME}
-                    ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${IMPORT_EXTERNAL_BINARY}
+                    ${EXTERNAL_BINARIES_DIR}/${IMPORT_EXTERNAL_BINARY}
                 )
             ELSE()
                 TARGET_LINK_LIBRARIES(${PROJECT_NAME}
@@ -770,13 +768,11 @@
                 IF(NOT "${EXTERNAL_BINARIES_DIR}" STREQUAL "")
                     FOREACH(EXTERNAL_BINARY ${EXTERNAL_BINARIES})
                         IF(WIN32)
-                            STRING(REPLACE "^${CMAKE_SHARED_LIBRARY_PREFIX}" "${CMAKE_IMPORT_LIBRARY_PREFIX}"
+                            STRING(REGEX REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}"
                                    IMPORT_EXTERNAL_BINARY "${EXTERNAL_BINARY}")
-                            STRING(REPLACE "${CMAKE_SHARED_LIBRARY_SUFFIX}$" "${CMAKE_IMPORT_LIBRARY_SUFFIX}"
-                                   IMPORT_EXTERNAL_BINARY "${EXTERNAL_BINARY}")

                             TARGET_LINK_LIBRARIES(${TEST_NAME}
-                                ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${IMPORT_EXTERNAL_BINARY}
+                                ${EXTERNAL_BINARIES_DIR}/${IMPORT_EXTERNAL_BINARY}
                             )
                         ELSE()
                             TARGET_LINK_LIBRARIES(${TEST_NAME}


Some minor cleaning up (#57). Also update our LLVM plugin binary on Mac OS X (using install_name_tool), but OpenCOR still doesn't work, so I am wondering whether LLVM doesn't have to be rebuilt following our upgrade to Xcode 4.4.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -428,7 +428,7 @@
                                                             ${CMAKE_BINARY_DIR}/${PLUGIN_FILENAME})
     ENDIF()

-    # A few things specific to OS X
+    # A few OS X specific things

     IF(APPLE)
         # Clean up our plugin's id
@@ -471,8 +471,8 @@
                                                                  ${MAC_OS_X_PROJECT_BINARY_DIR}/Contents/PlugIns/${MAIN_PROJECT_NAME}/${PLUGIN_FILENAME})
         ENDFOREACH()

-        # Make sure that the plugin refers to our embedded version of its
-        # external dependencies
+        # Make sure that the plugin refers to our embedded version of the
+        # external dependencies on which it depends
         # Note #1: we do it in two different ways, since some external libraries
         #          we use refer to the library itself (e.g. CellML) while others
         #          refer to some @executable_path information (e.g. LLVM), so...
@@ -493,18 +493,6 @@
                                COMMAND install_name_tool -change @executable_path/../lib/${EXTERNAL_DEPENDENCY_FILENAME}
                                                                  @executable_path/../Frameworks/${EXTERNAL_DEPENDENCY_FILENAME}
                                                                  ${MAC_OS_X_PROJECT_BINARY_DIR}/Contents/PlugIns/${MAIN_PROJECT_NAME}/${PLUGIN_FILENAME})
-
-            # Second, for the 'test' version of the plugin
-
-            ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
-                               COMMAND install_name_tool -change ${EXTERNAL_DEPENDENCY_FILENAME}
-                                                                 ${CMAKE_BINARY_DIR}/${EXTERNAL_DEPENDENCY_FILENAME}
-                                                                 ${CMAKE_BINARY_DIR}/${PLUGIN_FILENAME})
-
-            ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
-                               COMMAND install_name_tool -change @executable_path/../lib/${EXTERNAL_DEPENDENCY_FILENAME}
-                                                                 ${CMAKE_BINARY_DIR}/${EXTERNAL_DEPENDENCY_FILENAME}
-                                                                 ${CMAKE_BINARY_DIR}/${PLUGIN_FILENAME})
         ENDFOREACH()
     ENDIF()

@@ -702,7 +690,7 @@
                       COMMAND ${CMAKE_COMMAND} -E copy ${PLUGIN_BINARY_DIR}/${PLUGIN_FILENAME}
                                                        ${CMAKE_BINARY_DIR}/${PLUGIN_FILENAME})

-    # A few things specific to OS X
+    # A few OS X specific things

     IF(APPLE)
         # Make sure that the copy of our plugin in our main build directory


Converted LAPACK flags from Makefile.system.

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -324,4 +324,38 @@
   set(COMMON_OPT "-O2")
 endif ()

-
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_OPT} ${CCOMMON_OPT}")
+# TODO: not sure what PFLAGS is -hpa
+set(PFLAGS "${PFLAGS} ${COMMON_OPT} ${CCOMMON_OPT} -I${TOPDIR} -DPROFILE ${COMMON_PROF}")
+
+set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${COMMON_OPT} ${FCOMMON_OPT}")
+# TODO: not sure what FPFLAGS is -hpa
+set(FPFLAGS "${FPFLAGS} ${COMMON_OPT} ${FCOMMON_OPT} ${COMMON_PROF}")
+
+#For LAPACK Fortran codes.
+set(LAPACK_FFLAGS "${LAPACK_FFLAGS} ${CMAKE_Fortran_FLAGS}")
+set(LAPACK_FPFLAGS "${LAPACK_FPFLAGS} ${FPFLAGS}")
+
+#Disable -fopenmp for LAPACK Fortran codes on Windows.
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  message(STATUS "FFLAGS: ${LAPACK_FFLAGS}")
+  set(FILTER_FLAGS "-fopenmp;-mp;-openmp;-xopenmp=parralel")
+  foreach (FILTER_FLAG ${FILTER_FLAGS})
+    string(REPLACE ${FILTER_FLAG} "" LAPACK_FFLAGS ${LAPACK_FFLAGS})
+    string(REPLACE ${FILTER_FLAG} "" LAPACK_FPFLAGS ${LAPACK_FPFLAGS})
+  endforeach ()
+endif ()
+
+set(LAPACK_CFLAGS "${CMAKE_C_CFLAGS} -DHAVE_LAPACK_CONFIG_H")
+if (INTERFACE64)
+  set(LAPACK_CFLAGS "${LAPACK_CFLAGS} -DLAPACK_ILP64")
+endif ()
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  set(LAPACK_CFLAGS "${LAPACK_CFLAGS} -DOPENBLAS_OS_WINDOWS")
+endif ()
+
+if (${CMAKE_C_COMPILER} STREQUAL "LSB")
+  set(LAPACK_CFLAGS "${LAPACK_CFLAGS} -DLAPACK_COMPLEX_STRUCTURE")
+endif ()
+


emscripten: fix support for response files and Makefiles to work around cmdline length limit on Windows

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -132,6 +132,7 @@
 set(CMAKE_SYSTEM_VERSION 1)
 set(COMPILING on)
 set(CMAKE_CROSSCOMPILING TRUE)
+set(CMAKE_SYSTEM_PROCESSOR x86)

 # Find the .emscripten file and cache, this is either setup locally in the
 # emscripten SDK (this is the preferred way and used by 'fips setup emscripten',
@@ -179,6 +180,39 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

 set(CMAKE_SYSTEM_INCLUDE_PATH "${EMSCRIPTEN_ROOT_PATH}/system/include")
+
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+
+set(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@")
+set(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
+
+set(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> rc <TARGET> <LINK_FLAGS> <OBJECTS>")
+
+set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
+set(CMAKE_SIZEOF_CHAR 1)
+set(CMAKE_SIZEOF_UNSIGNED_SHORT 2)
+set(CMAKE_SIZEOF_SHORT 2)
+set(CMAKE_SIZEOF_INT 4)
+set(CMAKE_SIZEOF_UNSIGNED_LONG 4)
+set(CMAKE_SIZEOF_UNSIGNED_INT 4)
+set(CMAKE_SIZEOF_LONG 4)
+set(CMAKE_SIZEOF_VOID_P 4)
+set(CMAKE_SIZEOF_FLOAT 4)
+set(CMAKE_SIZEOF_DOUBLE 8)
+set(CMAKE_C_SIZEOF_DATA_PTR 4)
+set(CMAKE_CXX_SIZEOF_DATA_PTR 4)
+set(CMAKE_HAVE_LIMITS_H 1)
+set(CMAKE_HAVE_UNISTD_H 1)
+set(CMAKE_HAVE_PTHREAD_H 1)
+set(CMAKE_HAVE_SYS_PRCTL_H 1)
+set(CMAKE_WORDS_BIGENDIAN 0)
+set(CMAKE_DL_LIBS)

 # c++ compiler flags
 set(CMAKE_CXX_FLAGS "${EMSC_COMMON_FLAGS} ${EMSC_CXX_FLAGS} -std=c++11 -stdlib=libc++ -fstrict-aliasing -Wall -Wno-multichar -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-deprecated-writable-strings -Wno-unused-volatile-lvalue -Wno-inconsistent-missing-override -Wno-warn-absolute-paths -Wno-expansion-to-defined")


Update FW

Update FW

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "8b1325cccdb9e9a2ea7cda55f54bdde1104c6db4")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "e22af0891a00faf026a6eca545422c440eb70020")

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


Updated FW with thermal protection mechanism

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "456246cec6c17358f9eda61a41f45059c6ec7a2b")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "0db59ca9b81e4901f8bc49023fb8c0121be821a0")

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


Do not enable builtin_gl2ps if fail-on-missing=ON

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -534,10 +534,14 @@
 #---Check for gl2ps ------------------------------------------------------------------
 if(opengl AND NOT builtin_gl2ps)
   message(STATUS "Looking for gl2ps")
-  find_Package(gl2ps)
-  if(NOT GL2PS_FOUND)
-    message(STATUS "gl2ps not found. Switching on builtin_gl2ps option")
-    set(builtin_gl2ps ON CACHE BOOL "" FORCE)
+  if(fail-on-missing)
+    find_Package(gl2ps REQUIRED)
+  else()
+    find_Package(gl2ps)
+    if(NOT GL2PS_FOUND)
+      message(STATUS "gl2ps not found. Switching on builtin_gl2ps option")
+      set(builtin_gl2ps ON CACHE BOOL "" FORCE)
+    endif()
   endif()
 endif()


Ensure that the lib build destination matches the expected one for libAfterImage.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -339,7 +339,7 @@

   ExternalProject_Get_Property(AFTERIMAGE INSTALL_DIR)
   set(AFTERIMAGE_INCLUDE_DIR ${INSTALL_DIR}/include/libAfterImage)
-  set(AFTERIMAGE_LIBRARIES ${INSTALL_DIR}/lib/libAfterImage${CMAKE_STATIC_LIBRARY_SUFFIX})
+  set(AFTERIMAGE_LIBRARIES ${INSTALL_DIR}/${_LIBDIR_DEFAULT}/libAfterImage${CMAKE_STATIC_LIBRARY_SUFFIX})
 endif()

 #---Check for GSL library---------------------------------------------------------------


Fixed OpenAL package for linux.

Fixed OpenAL package for linux.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@756 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/OpenAL.cmake
+++ CMakeModules/OpenAL.cmake
@@ -4,12 +4,12 @@
 macro (FIND_OPENAL)
 	if (NOT MSVC)
 		find_package (PkgConfig)
-		pkg_search_module (OPENAL OPENAL)
-		if (NOT OPENAL_INCLUDE_DIRS AND NOT OPENAL_LIBRARIES)
+		pkg_search_module (openal openal)
+		if (NOT openal_INCLUDE_DIRS AND NOT openal_LIBRARIES)
 			message (FATAL_ERROR "OpenAL not found by pkg-config")
-		endif (NOT OPENAL_INCLUDE_DIRS AND NOT OPENAL_LIBRARIES)
-		separate_arguments (OPENAL_INCLUDE_DIRS)
-		separate_arguments (OPENAL_LIBRARIES)
+		endif (NOT openal_INCLUDE_DIRS AND NOT openal_LIBRARIES)
+		separate_arguments (openal_INCLUDE_DIRS)
+		separate_arguments (openal_LIBRARIES)
 	endif (NOT MSVC)
 endmacro (FIND_OPENAL)

@@ -20,8 +20,8 @@

 	else (MSVC)
-		include_directories (${OPENAL_INCLUDE_DIRS})
-		link_directories (${OPENAL_LIBDIR})
+		include_directories (${openal_INCLUDE_DIRS})
+		link_directories (${openal_LIBDIR})
 	endif (MSVC)
 endmacro (INCLUDE_OPENAL)

@@ -31,6 +31,6 @@
 			debug OpenAL32
 			optimized OpenAL32)
 	else (MSVC)
-		target_link_libraries (${TARGET_NAME} ${OPENAL_LIBRARIES})
+		target_link_libraries (${TARGET_NAME} ${openal_LIBRARIES})
 	endif (MSVC)
 endmacro (LINK_OPENAL)


Fix a boo-boo

Fix a boo-boo

--- cmake/Modules/frontend.cmake
+++ cmake/Modules/frontend.cmake
@@ -4,7 +4,7 @@

 macro(libcaca_check)
 	find_package(libcaca)
-	if(HAVE_libcaca)
+	if(libcaca_FOUND)
 		option(LIBCACA_ENABLE "Enable libcaca frontend" on)
 	endif()
 	if(LIBCACA_ENABLE)
@@ -20,7 +20,7 @@

 macro(sdl2_check)
 	find_package(SDL2)
-	if(HAVE_SDL2)
+	if(SDL2_FOUND)
 		option(SDL2_ENABLE "Enable SDL2 frontend" on)
 	endif()


Distinguish automatically public and private headers

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -69,10 +69,20 @@
   SET (_project_include_directories "${PROJECT_SOURCE_DIR}/output/include" "${PROJECT_SOURCE_DIR}/include")
   FOREACH (_target ${PROJECT_NAME} ${PROJECT_NAME}_static)
     FOREACH (_include_directory ${_project_include_directories})
+	  #
+	  # The "internal" include directory is always internal, indeed
+	  #
+	  SET (_l_directory ${_include_directory})
+      STRING (TOLOWER "${_include_directory}" _include_directory_lower )
+      IF ( _include_directory_lower MATCHES "/internal/?$" )
+	    SET (_include_directory_scope "PRIVATE")
+	  ELSE ()
+	    SET (_include_directory_scope "PUBLIC")
+	  ENDIF ()
       IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-LIBRARY-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
+        MESSAGE (STATUS "[${PROJECT_NAME}-LIBRARY-DEBUG] Adding ${_include_directory_scope} ${_include_directory} include dependency to ${_target}")
       ENDIF ()
-      TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+      TARGET_INCLUDE_DIRECTORIES(${_target} ${_include_directory_scope} ${_include_directory})
     ENDFOREACH ()
   ENDFOREACH ()
   INSTALL (TARGETS ${PROJECT_NAME}        ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT DynamicLibraryComponent)


cmake: guard macro definitions in PCH scripts

fixes build with VTK

--- cmake/OpenCVPCHSupport.cmake
+++ cmake/OpenCVPCHSupport.cmake
@@ -302,7 +302,7 @@
 if [ -n \"$VERBOSE\" ]; then
   tail -n1 \$0
 fi
-${_command} -D$<JOIN:$<TARGET_PROPERTY:${_targetName},COMPILE_DEFINITIONS>, -D>
+${_command} '-D$<JOIN:$<TARGET_PROPERTY:${_targetName},COMPILE_DEFINITIONS>,' '-D>'
 ")
     GET_FILENAME_COMPONENT(_outdir ${_output} PATH)
     ADD_CUSTOM_COMMAND(


cmake: Do not use visibility attribute with GCC on IRIX

Closes #66.

--- cmake/VisibilityDetect.cmake
+++ cmake/VisibilityDetect.cmake
@@ -10,6 +10,7 @@
                                         #if (__GNUC__ >= 4) && !defined(_CRAYC) && \\\\
                                             !defined(__sun)  && !defined(sun)  && \\\\
                                             !defined(__hpux) && !defined(hpux) && \\\\
+                                            !defined(__sgi)  && !defined(sgi)  && \\\\
                                             !defined(_AIX)   && !defined(__CYGWIN__) && !defined(__MSYS__)
                                         return 0;
                                         #else


CMake: ignore clang-format requirement for Apple OSX

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -26,9 +26,14 @@
     EXEC_PROGRAM(${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
     STRING(REGEX REPLACE ".*([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CLANG_MAJOR_VERSION ${CLANG_VERSION})

-    # We currently require version 4
-    IF(${CLANG_MAJOR_VERSION} EQUAL "4")
-        MESSAGE(STATUS "Found ${CLANG_FORMAT} version 4, adding formatting targets")
+    # We currently require version 4 - which is not available on OSX...
+    IF(${CLANG_MAJOR_VERSION} EQUAL "4" OR DEFINED ${APPLE})
+        IF(DEFINED ${APPLE})
+            MESSAGE(WARNING "Found ${CLANG_FORMAT} version ${CLANG_MAJOR_VERSION}, this might lead to incompatible formatting")
+        ELSE()
+            MESSAGE(STATUS "Found ${CLANG_FORMAT} version 4, adding formatting targets")
+        ENDIF()
+
         ADD_CUSTOM_TARGET(
             format
             COMMAND


build: remove duplicated parameter to `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -673,7 +673,6 @@
 # Usage:
 #   _add_swift_host_library_single(
 #     target
-#     name
 #     [SHARED]
 #     [STATIC]
 #     [SDK sdk]
@@ -683,9 +682,6 @@
 #     source1 [source2 source3 ...])
 #
 # target
-#   Name of the target (e.g., swiftParse-IOS-armv7).
-#
-# name
 #   Name of the library (e.g., swiftParse).
 #
 # SHARED
@@ -708,7 +704,7 @@
 #
 # source1 ...
 #   Sources to add into this library
-function(_add_swift_host_library_single target name)
+function(_add_swift_host_library_single target)
   set(SWIFTLIB_SINGLE_options
         SHARED
         STATIC)
@@ -804,11 +800,11 @@
       # building on a non-DLL platform (not windows), create an imported target
       # for the library which created implicitly by the dll.
       add_custom_command_target(${target}_IMPORT_LIBRARY
-                                OUTPUT "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/${name}.lib"
+                                OUTPUT "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/${target}.lib"
                                 DEPENDS "${target}")
       add_library(${target}_IMPLIB SHARED IMPORTED GLOBAL)
       set_property(TARGET "${target}_IMPLIB" PROPERTY
-          IMPORTED_LOCATION "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/${name}.lib")
+          IMPORTED_LOCATION "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/${target}.lib")
       add_dependencies(${target}_IMPLIB ${${target}_IMPORT_LIBRARY})
     endif()
     set_property(TARGET "${target}" PROPERTY NO_SONAME ON)
@@ -849,7 +845,7 @@
   set_target_properties(${target}
       PROPERTIES
       # Library name (without the variant information)
-      OUTPUT_NAME ${name})
+      OUTPUT_NAME ${target})

   # Handle linking and dependencies.
   add_dependencies_multiple_targets(
@@ -1019,7 +1015,6 @@
   endif()

   _add_swift_host_library_single(
-    ${name}
     ${name}
     ${ASHL_SHARED_keyword}
     ${ASHL_STATIC_keyword}


build: inline single use `add_swift_executable`

Inline the single use of this function and remove the extra parameter
handling around it, letting `_add_swift_executable_single` do the heavy
lifting.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -2201,83 +2201,6 @@
       PROPERTIES FOLDER "Swift executables")
 endfunction()

-# Add an executable for the host machine.
-#
-# Usage:
-#   add_swift_executable(name
-#     [DEPENDS dep1 ...]
-#     [LLVM_COMPONENT_DEPENDS comp1 ...]
-#     [FILE_DEPENDS target1 ...]
-#     [LINK_LIBRARIES target1 ...]
-#     [EXCLUDE_FROM_ALL]
-#     [DONT_STRIP_NON_MAIN_SYMBOLS]
-#     [DISABLE_ASLR]
-#     source1 [source2 source3 ...])
-#
-#   name
-#     Name of the executable (e.g., swift).
-#
-#   LIBRARIES
-#     Libraries this executable depends on, without variant suffixes.
-#
-#   LLVM_COMPONENT_DEPENDS
-#     LLVM components this executable depends on.
-#
-#   FILE_DEPENDS
-#     Additional files this executable depends on.
-#
-#   LINK_LIBRARIES
-#     Libraries to link with.
-#
-#   EXCLUDE_FROM_ALL
-#     Whether to exclude this executable from the ALL_BUILD target.
-#
-#   DONT_STRIP_NON_MAIN_SYMBOLS
-#     Should we not strip non main symbols.
-#
-#   DISABLE_ASLR
-#     Should we compile with -Wl,-no_pie so that ASLR is disabled?
-#
-#   source1 ...
-#     Sources to add into this executable.
-#
-# Note:
-#   Host executables are not given a variant suffix. To build an executable for
-#   each SDK and ARCH variant, use add_swift_target_executable.
-function(add_swift_executable name)
-  # Parse the arguments we were given.
-  cmake_parse_arguments(SWIFTEXE
-    "EXCLUDE_FROM_ALL;DONT_STRIP_NON_MAIN_SYMBOLS;DISABLE_ASLR"
-    ""
-    "DEPENDS;LLVM_COMPONENT_DEPENDS;LINK_LIBRARIES;COMPILE_FLAGS"
-    ${ARGN})
-
-  translate_flag(${SWIFTEXE_EXCLUDE_FROM_ALL}
-      "EXCLUDE_FROM_ALL"
-      SWIFTEXE_EXCLUDE_FROM_ALL_FLAG)
-  translate_flag(${SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS}
-      "DONT_STRIP_NON_MAIN_SYMBOLS"
-      SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG)
-  translate_flag(${SWIFTEXE_DISABLE_ASLR}
-      "DISABLE_ASLR"
-      SWIFTEXE_DISABLE_ASLR_FLAG)
-
-  set(SWIFTEXE_SOURCES ${SWIFTEXE_UNPARSED_ARGUMENTS})
-
-  _add_swift_executable_single(
-      ${name}
-      ${SWIFTEXE_SOURCES}
-      DEPENDS ${SWIFTEXE_DEPENDS}
-      LLVM_COMPONENT_DEPENDS ${SWIFTEXE_LLVM_COMPONENT_DEPENDS}
-      LINK_LIBRARIES ${SWIFTEXE_LINK_LIBRARIES}
-      SDK ${SWIFT_HOST_VARIANT_SDK}
-      ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
-      COMPILE_FLAGS ${SWIFTEXE_COMPILE_FLAGS}
-      ${SWIFTEXE_EXCLUDE_FROM_ALL_FLAG}
-      ${SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG}
-      ${SWIFTEXE_DISABLE_ASLR_FLAG})
-endfunction()
-
 macro(add_swift_tool_subdirectory name)
   add_llvm_subdirectory(SWIFT TOOL ${name})
 endmacro()
@@ -2301,7 +2224,9 @@
                MESSAGE "Swift Component is required to add a host tool")

   # Create the executable rule.
-  add_swift_executable(${executable}
+  _add_swift_executable_single(${executable}
+    SDK ${SWIFT_HOST_VARIANT_SDK}
+    ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
     ${ASHT_UNPARSED_ARGUMENTS})

   swift_install_in_component(${ASHT_SWIFT_COMPONENT}


build: remove `IS_STDLIB` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -689,7 +689,6 @@
 #     [LINK_FLAGS flag1...]
 #     [FILE_DEPENDS target1 ...]
 #     [DONT_EMBED_BITCODE]
-#     [IS_STDLIB]
 #     INSTALL_IN_COMPONENT comp
 #     source1 [source2 source3 ...])
 #
@@ -743,9 +742,6 @@
 #
 # DONT_EMBED_BITCODE
 #   Don't embed LLVM bitcode in this target, even if it is enabled globally.
-#
-# IS_STDLIB
-#   Install library dylib and swift module files to lib/swift.
 #
 # INSTALL_IN_COMPONENT comp
 #   The Swift installation component that this library belongs to.
@@ -755,7 +751,6 @@
 function(_add_swift_host_library_single target name)
   set(SWIFTLIB_SINGLE_options
         DONT_EMBED_BITCODE
-        IS_STDLIB
         NOSWIFTRT
         OBJECT_LIBRARY
         SHARED
@@ -904,7 +899,6 @@
       ARCHITECTURE ${SWIFTLIB_SINGLE_ARCHITECTURE}
       MODULE_NAME ${module_name}
       COMPILE_FLAGS ${SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS}
-      ${SWIFTLIB_SINGLE_IS_STDLIB_keyword}
       ${embed_bitcode_arg}
       INSTALL_IN_COMPONENT "${SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT}")
   add_swift_source_group("${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}")
@@ -1059,10 +1053,6 @@
   if(SWIFTLIB_SINGLE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
     set(install_name_dir "@rpath")

-    if(SWIFTLIB_SINGLE_IS_STDLIB)
-      set(install_name_dir "${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
-    endif()
-
     # Always use @rpath for XCTest
     if(module_name STREQUAL "XCTest")
       set(install_name_dir "@rpath")
@@ -1104,65 +1094,20 @@
   set_target_properties("${target}" PROPERTIES BUILD_WITH_INSTALL_RPATH YES)
   set_target_properties("${target}" PROPERTIES FOLDER "Swift libraries")

-  # Configure the static library target.
-  # Set compile and link flags for the non-static target.
-  # Do these LAST.
-  set(target_static)
-  if(SWIFTLIB_SINGLE_IS_STDLIB AND SWIFTLIB_SINGLE_STATIC)
-    set(target_static "${target}-static")
-
-    # We have already compiled Swift sources.  Link everything into a static
-    # library.
-    add_library(${target_static} STATIC
-        ${SWIFTLIB_SINGLE_SOURCES}
-        ${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS}
-        ${SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES})
-
-    set_output_directory(${target_static}
-        BINARY_DIR ${SWIFT_RUNTIME_OUTPUT_INTDIR}
-        LIBRARY_DIR ${SWIFT_LIBRARY_OUTPUT_INTDIR})
-
-    if(SWIFTLIB_INSTALL_WITH_SHARED)
-      set(swift_lib_dir ${SWIFTLIB_DIR})
-    else()
-      set(swift_lib_dir ${SWIFTSTATICLIB_DIR})
-    endif()
-
-    foreach(config ${CMAKE_CONFIGURATION_TYPES})
-      string(TOUPPER ${config} config_upper)
-      escape_path_for_xcode(
-          "${config}" "${swift_lib_dir}" config_lib_dir)
-      set_target_properties(${target_static} PROPERTIES
-        LIBRARY_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR}
-        ARCHIVE_OUTPUT_DIRECTORY_${config_upper} ${config_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR})
-    endforeach()
-
-    set_target_properties(${target_static} PROPERTIES
-      LIBRARY_OUTPUT_DIRECTORY ${swift_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR}
-      ARCHIVE_OUTPUT_DIRECTORY ${swift_lib_dir}/${SWIFTLIB_SINGLE_SUBDIR})
-  endif()
-
   set_target_properties(${target}
       PROPERTIES
       # Library name (without the variant information)
       OUTPUT_NAME ${name})
-  if(target_static)
-    set_target_properties(${target_static}
-        PROPERTIES
-        OUTPUT_NAME ${name})
-  endif()

   # Don't build standard libraries by default.  We will enable building
   # standard libraries that the user requested; the rest can be built on-demand.
   if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
-    foreach(t "${target}" ${target_static})
-      set_target_properties(${t} PROPERTIES EXCLUDE_FROM_ALL TRUE)
-    endforeach()
+    set_target_properties(${target} PROPERTIES EXCLUDE_FROM_ALL TRUE)
   endif()

   # Handle linking and dependencies.
   add_dependencies_multiple_targets(
-      TARGETS "${target}" ${target_static}
+      TARGETS "${target}"
       DEPENDS
         ${SWIFTLIB_SINGLE_DEPENDS}
         ${gyb_dependency_targets}
@@ -1188,27 +1133,12 @@
     endif()
   endforeach()

-  if(target_static)
-    _list_add_string_suffix(
-        "${SWIFTLIB_SINGLE_LINK_LIBRARIES_WITHOUT_ICU}"
-        "-static"
-        target_static_depends)
-    # FIXME: should this be target_link_libraries?
-    add_dependencies_multiple_targets(
-        TARGETS "${target_static}"
-        DEPENDS ${target_static_depends})
-  endif()
-
   # Link against system frameworks.
   foreach(FRAMEWORK ${SWIFTLIB_SINGLE_FRAMEWORK_DEPENDS})
-    foreach(t "${target}" ${target_static})
-      target_link_libraries("${t}" PUBLIC "-framework ${FRAMEWORK}")
-    endforeach()
+    target_link_libraries(${target} PUBLIC "-framework ${FRAMEWORK}")
   endforeach()
   foreach(FRAMEWORK ${SWIFTLIB_SINGLE_FRAMEWORK_DEPENDS_WEAK})
-    foreach(t "${target}" ${target_static})
-      target_link_libraries("${t}" PUBLIC "-weak_framework ${FRAMEWORK}")
-    endforeach()
+    target_link_libraries(${target} PUBLIC "-weak_framework ${FRAMEWORK}")
   endforeach()

   if(NOT SWIFTLIB_SINGLE_TARGET_LIBRARY)
@@ -1262,14 +1192,6 @@
     DEPLOYMENT_VERSION_WATCHOS "${SWIFTLIB_DEPLOYMENT_VERSION_WATCHOS}"
     RESULT_VAR_NAME c_compile_flags
     )
-
-  if(SWIFTLIB_IS_STDLIB)
-    # We don't ever want to link against the ABI-breakage checking symbols
-    # in the standard library, runtime, or overlays because they only rely
-    # on the header parts of LLVM's ADT.
-    list(APPEND c_compile_flags
-      "-DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1")
-  endif()

   if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
     if(libkind STREQUAL SHARED)
@@ -1295,7 +1217,7 @@

   # Configure plist creation for OS X.
   set(PLIST_INFO_PLIST "Info.plist" CACHE STRING "Plist name")
-  if("${SWIFTLIB_SINGLE_SDK}" IN_LIST SWIFT_APPLE_PLATFORMS AND SWIFTLIB_SINGLE_IS_STDLIB)
+  if("${SWIFTLIB_SINGLE_SDK}" IN_LIST SWIFT_APPLE_PLATFORMS AND FALSE)
     set(PLIST_INFO_NAME ${name})
     set(PLIST_INFO_UTI "com.apple.dt.runtime.${name}")
     set(PLIST_INFO_VERSION "${SWIFT_VERSION}")
@@ -1436,26 +1358,6 @@
   else()
     set_property(TARGET "${target}" PROPERTY
       LINKER_LANGUAGE "CXX")
-  endif()
-
-  if(target_static)
-    target_compile_options(${target_static} PRIVATE
-      ${c_compile_flags})
-    # FIXME: The fallback paths here are going to be dynamic libraries.
-
-    if(SWIFTLIB_INSTALL_WITH_SHARED)
-      set(search_base_dir ${SWIFTLIB_DIR})
-    else()
-      set(search_base_dir ${SWIFTSTATICLIB_DIR})
-    endif()
-    set(library_search_directories
-        "${search_base_dir}/${SWIFTLIB_SINGLE_SUBDIR}"
-        "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
-        "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
-    target_link_directories(${target_static} PRIVATE
-      ${library_search_directories})
-    target_link_libraries("${target_static}" PRIVATE
-        ${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})
   endif()

   # Do not add code here.


add the possibility to specify a list of sub-test suffixes in a compact way

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -120,9 +120,9 @@

   file(READ "${testname}.cpp" test_source)
   set(parts 0)
-  string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+"
+  string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+|EIGEN_SUFFIXES(;[0-9]+)+"
          occurences "${test_source}")
-  string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_" "" suffixes "${occurences}")
+  string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_|EIGEN_SUFFIXES" "" suffixes "${occurences}")
   list(REMOVE_DUPLICATES suffixes)
   if(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
     add_custom_target(${testname})


[cmake] add  Python3_FIND_FRAMEWORK=LAST for APPLE

--- cmake/SiconosSetup.cmake
+++ cmake/SiconosSetup.cmake
@@ -51,6 +51,10 @@
   list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/extras)
 endif()

+if(APPLE)
+  set(Python3_FIND_FRAMEWORK LAST)
+endif()
+
 if(WITH_PYTHON_WRAPPER)
   find_package(Python3 COMPONENTS Development Interpreter NumPy REQUIRED)
 else()


More build errors

More build errors

--- cmake/build_header.cmake
+++ cmake/build_header.cmake
@@ -5,7 +5,7 @@
 	file(WRITE ${DIR_ROOT}/src/flat.h "#ifndef FLAT_H_\n")
 	file(APPEND ${DIR_ROOT}/src/flat.h "#define FLAT_H_\n")
 	foreach(header ${headers})
-		file(APPEND ${DIR_ROOT}/src/flat.h "#include <${header}>\n")
+		file(APPEND ${DIR_ROOT}/src/flat.h "#include <flat/${header}>\n")
 	endforeach()
 	file(APPEND ${DIR_ROOT}/src/flat.h "#endif\n")
 endmacro(build_header)


Bug #58372 cmake should not write temporary files in the source directory

cmake/do_abi_check.cmake:
  Put temporary files in ${BINARY_DIR} rather than in source directory.
  Slight reformatting for readability of commands.

--- cmake/do_abi_check.cmake
+++ cmake/do_abi_check.cmake
@@ -53,23 +53,27 @@
 SET(abi_check_out ${BINARY_DIR}/abi_check.out)

 FOREACH(file ${ABI_HEADERS})
-  SET(tmpfile ${file}.pp.tmp)
-    EXECUTE_PROCESS(
-     COMMAND ${COMPILER}
-       -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
-       -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
-       ${file}
-       ERROR_QUIET OUTPUT_FILE ${tmpfile})
-    EXECUTE_PROCESS(
-      COMMAND sed -e
-      "/^# /d" -e "/^[	]*$/d"  -e "/^#pragma GCC set_debug_pwd/d" -e "/^#ident/d"
-      RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
+  GET_FILENAME_COMPONENT(header_basename ${file} NAME)
+  SET(tmpfile ${BINARY_DIR}/${header_basename}.pp.tmp)
+
+  EXECUTE_PROCESS(
+    COMMAND ${COMPILER}
+      -E -nostdinc -dI -DMYSQL_ABI_CHECK -I${SOURCE_DIR}/include
+      -I${BINARY_DIR}/include -I${SOURCE_DIR}/include/mysql -I${SOURCE_DIR}/sql
+      ${file}
+      ERROR_QUIET OUTPUT_FILE ${tmpfile})
+  EXECUTE_PROCESS(
+    COMMAND sed -e "/^# /d"
+                -e "/^[	]*$/d"
+                -e "/^#pragma GCC set_debug_pwd/d"
+                -e "/^#ident/d"
+    RESULT_VARIABLE result OUTPUT_FILE ${abi_check_out} INPUT_FILE ${tmpfile})
   IF(NOT ${result} EQUAL 0)
     MESSAGE(FATAL_ERROR "sed returned error ${result}")
   ENDIF()
   FILE(REMOVE ${tmpfile})
-  EXECUTE_PROCESS(COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE
-     result)
+  EXECUTE_PROCESS(
+    COMMAND diff -w ${file}.pp ${abi_check_out} RESULT_VARIABLE result)
   IF(NOT ${result} EQUAL 0)
     MESSAGE(FATAL_ERROR
       "ABI check found difference between ${file}.pp and ${abi_check_out}")


ENH: Temporarily disabled MPI in superbuild-prepare stage.

--- CI/sb_configure_options.cmake
+++ CI/sb_configure_options.cmake
@@ -24,7 +24,7 @@
 CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}")

 set ( temporary_option
-"OTB_USE_LIBKML=OFF")
+"OTB_USE_LIBKML=OFF OTB_USE_MPI=OFF")

 set(concat_options
 "${cmake_configure_option}
@@ -36,4 +36,4 @@

 foreach(item ${sb_options})
   set( SB_CONFIGURE_OPTIONS "${SB_CONFIGURE_OPTIONS}-D${item};")
-endforeach(item)+endforeach(item)


Build arm64 for iOS

Build arm64 for iOS

--- CMake/Modules/AtomicIOS.cmake
+++ CMake/Modules/AtomicIOS.cmake
@@ -5,7 +5,16 @@
 add_definitions (-DIOS -DATOMIC_PLATFORM_IOS -DATOMIC_OPENGL -DKNET_UNIX -DATOMIC_TBUI)
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x")

-set (CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_INCLUDING_64_BIT))
+# set the architecture for iOS
+#if (${IOS_PLATFORM} STREQUAL "OS")
+#    set (IOS_ARCH armv7 armv7s arm64)
+#elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
+#    set (IOS_ARCH i386)
+# elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR64")
+#    set (IOS_ARCH x86_64)
+#endif (${IOS_PLATFORM} STREQUAL "OS")
+
+set (CMAKE_OSX_ARCHITECTURES arm64)
 set (CMAKE_XCODE_EFFECTIVE_PLATFORMS -iphoneos -iphonesimulator)

 # Set Base SDK to "Latest iOS"


idl-config: use find_idl_for in create_service_skeleton.

Change-Id: I3d074a1bfecff4ec25d572917273a5a5fba21716

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -115,9 +115,7 @@
   cmake_parse_arguments(ARG "" "CLASS" "INCLUDE;SEARCHPATH" ${ARGN})
   # we need to find the IDL file for proper dependency tracking
   string(REPLACE "::" "/" idlname ${ARG_CLASS})
-  find_path(idlfile ${idlname}
-    PATHS ${CMAKE_CURRENT_BINARY_DIR}
-  )
+  qi_find_idl_for(${ARG_CLASS} idlfile)
   set(search_path  "${ARG_SEARCHPATH}:${CMAKE_CURRENT_SOURCE_DIR}")
   qi_generate_src(${target}
     SRC ${idlfile}


[OGRE-84] Build device and simulator libraries to separate locations

--HG--
branch : v1-9

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -11,10 +11,10 @@

 # Default build output paths
 if (NOT OGRE_ARCHIVE_OUTPUT)
-  set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib)
+  set(OGRE_ARCHIVE_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
 endif ()
 if (NOT OGRE_LIBRARY_OUTPUT)
-  set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib)
+  set(OGRE_LIBRARY_OUTPUT ${OGRE_BINARY_DIR}/lib/$(PLATFORM_NAME))
 endif ()
 if (NOT OGRE_RUNTIME_OUTPUT)
   set(OGRE_RUNTIME_OUTPUT ${OGRE_BINARY_DIR}/bin)


Enable dynamic linking on Mac for Boost.Test

--- CMakeModules/BoostTestTargets.cmake
+++ CMakeModules/BoostTestTargets.cmake
@@ -77,9 +77,7 @@
 		if(Boost_USE_STATIC_LIBS)
 			set(_boostConfig "BoostTestTargetsStatic.h")
 		else()
-			if(NOT APPLE)
-				set(_boostConfig "BoostTestTargetsDynamic.h")
-			endif()
+			set(_boostConfig "BoostTestTargetsDynamic.h")
 		endif()
 	endif()
 	get_filename_component(_moddir ${CMAKE_CURRENT_LIST_FILE} PATH)


suppress some warnings and avoid internal compiler erros with Intel 12.0 compiler

--- CMakeModules/CompilerSettings.cmake
+++ CMakeModules/CompilerSettings.cmake
@@ -15,9 +15,10 @@
     set(IS_ICPC 0)
 endif()
 if(IS_ICPC)
+    add_definitions(-wd191 -wd411 -wd654 -wd1125 -wd1292 -wd1565 -wd1628 -wd2196)
     set(CMAKE_AR "xiar" CACHE STRING "Intel archiver" FORCE)
     set(CMAKE_CXX_FLAGS "-pthread" CACHE STRING "Default compile flags" FORCE)
-    set(CMAKE_CXX_FLAGS_RELEASE "-fast -DNDEBUG"
+    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG"
     CACHE STRING "Flags used by the C++ compiler during release builds." FORCE)
     set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING
     "Flags used by the C++ compiler during debug builds." FORCE)


Minor packaging cleanup

Minor packaging cleanup

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[x] Cleanup
[ ] Optimization
[ ] Documentation

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -115,9 +115,9 @@
 if(LINUX)
   find_program(RPM_EXE rpmbuild)
   if(${RPM_EXE} MATCHES RPM_EXE-NOTFOUND)
-    set(CPACK_GENERATOR "TGZ;DEB")
+    set(CPACK_GENERATOR "DEB")
   else()
-    set(CPACK_GENERATOR "TGZ;DEB;RPM")
+    set(CPACK_GENERATOR "RPM")
   endif()
 endif(LINUX)


Closes #105: Sequel missing from packages

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -40,7 +40,10 @@
   set(CPACK_RPM_PACKAGE_RELEASE ${EQUALIZER_PACKAGE_VERSION})
 endif()

-set(CPACK_COMPONENTS_ALL colib codev eqlib eqdev man doc apps examples tools data vmmlib)
+set(CPACK_COMPONENTS_ALL colib codev eqlib eqdev seqlib seqdev man doc apps examples tools data vmmlib)
+
+set(CPACK_COMPONENT_UNSPECIFIED_DISPLAY_NAME "Misc")
+set(CPACK_COMPONENT_UNSPECIFIED_DESCRIPTION "Miscellanous")

 set(CPACK_COMPONENT_COLIB_DISPLAY_NAME "Collage Library")
 set(CPACK_COMPONENT_COLIB_DESCRIPTION "Collage Runtime Library")
@@ -57,6 +60,14 @@
 set(CPACK_COMPONENT_EQDEV_DESCRIPTION "Header and Library Files for Equalizer Development")
 set(CPACK_COMPONENT_EQDEV_DEPENDS vmmlib eqlib codev)

+set(CPACK_COMPONENT_SEQLIB_DISPLAY_NAME "Sequel Libraries")
+set(CPACK_COMPONENT_SEQLIB_DESCRIPTION "Sequel Runtime Libraries, a simple interface for Equalizer")
+set(CPACK_COMPONENT_SEQLIB_DEPENDS eqlib colib)
+
+set(CPACK_COMPONENT_SEQDEV_DISPLAY_NAME "Sequel Development Files")
+set(CPACK_COMPONENT_SEQDEV_DESCRIPTION "Header and Library Files for Sequel Development, a simple interface for Equalizer")
+set(CPACK_COMPONENT_EQDEV_DEPENDS eqdev codev)
+
 set(CPACK_COMPONENT_MAN_DISPLAY_NAME "Man Pages")
 set(CPACK_COMPONENT_MAN_DESCRIPTION "Manual Pages")

@@ -65,15 +76,15 @@

 set(CPACK_COMPONENT_APPS_DISPLAY_NAME "Example Applications")
 set(CPACK_COMPONENT_APPS_DESCRIPTION "Example programs build with Equalizer")
-set(CPACK_COMPONENT_APPS_DEPENDS eqlib data)
+set(CPACK_COMPONENT_APPS_DEPENDS seqlib data eqlib colib)

 set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples Source Code")
 set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION "Source code of example programs")
-set(CPACK_COMPONENT_EXAMPLES_DEPENDS eqdev data)
+set(CPACK_COMPONENT_EXAMPLES_DEPENDS seqdev eqdev codev vmmlib data)

 set(CPACK_COMPONENT_TOOLS_DISPLAY_NAME "Tools")
 set(CPACK_COMPONENT_TOOLS_DESCRIPTION "Utility programs for Equalizer")
-set(CPACK_COMPONENT_TOOLS_DEPENDS eqlib)
+set(CPACK_COMPONENT_TOOLS_DEPENDS eqlib colib)

 set(CPACK_COMPONENT_DATA_DISPLAY_NAME "Data files")
 set(CPACK_COMPONENT_DATA_DESCRIPTION "Example configuration files and data sets")


Fix dashboard host

Fix dashboard host

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,7 +8,7 @@
 set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "open.cdash.org")
+set(CTEST_DROP_SITE "www.cdash.org")
 #set(CTEST_DROP_LOCATION "/CDash/submit.php?project=MatViz")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
 set(CTEST_DROP_SITE_CDASH TRUE)


Fix #358

Fix #358

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -37,7 +37,7 @@
 include(CMakeParseArguments)
 option(GIT_EXTERNAL_VERBOSE "Print git commands as they are executed" OFF)

-if(NOT GITHUB_USER AND $ENV{GITHUB_USER})
+if(NOT GITHUB_USER AND "$ENV{GITHUB_USER}")
   set(GITHUB_USER $ENV{GITHUB_USER} CACHE STRING
     "Github user name used to setup remote for 'user' forks")
 endif()


Update UseBoost.cmake

Update UseBoost.cmake

--- Superbuild/UseBoost.cmake
+++ Superbuild/UseBoost.cmake
@@ -16,7 +16,7 @@
 # http://www.boost.org/doc/libs/1_58_0/more/getting_started/windows.html
 # http://www.boost.org/doc/libs/1_58_0/more/getting_started/unix-variants.html
 if(WIN32)
-  set(DEBUG_POSTFIX "-gyd")
+  set(DEBUG_POSTFIX "-gd")
   set(boost_LIB_PREFIX "lib")
 else()
   set(DEBUG_POSTFIX "-yd")


commented messaging out

commented messaging out

--- cmake/FindCPU_FEATURES.cmake
+++ cmake/FindCPU_FEATURES.cmake
@@ -19,7 +19,7 @@

 string(STRIP "${VALUEOFINTEREST}" VALUEOFINTEREST)
 set(${RESULTVALUE} ${VALUEOFINTEREST} PARENT_SCOPE)
-message(STATUS "[wmic_get] RESULT = ${VALUEOFINTEREST}")
+#message(STATUS "[wmic_get] RESULT = ${VALUEOFINTEREST}")

 endfunction(wmic_get)


Fix syntax error in FindXGen.cmake

Fix syntax error in FindXGen.cmake

Regression introduced in adcb7f9b57532fd0fd4a9afe776c2e7fbae37b7a: Update CMake setup.

--- cmake/Modules/FindXGen.cmake
+++ cmake/Modules/FindXGen.cmake
@@ -41,6 +41,7 @@
     "/Applications/Autodesk/maya2019/Maya.app/Contents"
     "/Applications/Autodesk/maya2018/Maya.app/Contents"
     "/Applications/Autodesk/maya2017/Maya.app/Contents"
+  )
 endif(APPLE)

 if(UNIX)


cmake: remove duplicate message

cmake: remove duplicate message

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -608,7 +608,6 @@
 #=============================================================================#
 function(GENERATE_AVR_FIRMWARE INPUT_NAME)
     # TODO: This is not optimal!!!!
-    message(STATUS "Generating ${INPUT_NAME}")
     parse_generator_arguments(${INPUT_NAME} INPUT
                               "NO_AUTOLIBS;MANUAL"            # Options
                               "BOARD;PORT;PROGRAMMER"  # One Value Keywords


Adds core support for different hardware platforms

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -277,7 +277,7 @@
     endif()

     list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS})
-
+
     add_library(${INPUT_NAME} ${ALL_SRCS})

     get_arduino_flags(ARDUINO_COMPILE_FLAGS ARDUINO_LINK_FLAGS  ${INPUT_BOARD} ${INPUT_MANUAL})
@@ -427,56 +427,70 @@
 #=============================================================================#
 function(REGISTER_HARDWARE_PLATFORM PLATFORM_PATH)
     string(REGEX REPLACE "/$" "" PLATFORM_PATH ${PLATFORM_PATH})
-    message(STATUS "Loading hardware path: ${PLATFORM_PATH}")
     GET_FILENAME_COMPONENT(PLATFORM ${PLATFORM_PATH} NAME)

-    if(PLATFORM) # TODO only load a platform once
+    if(PLATFORM)
         string(TOUPPER ${PLATFORM} PLATFORM)
-        set(${PLATFORM}_PLATFORM_PATH ${PLATFORM_PATH} CACHE INTERNAL "The path to ${PLATFORM}")
-        set(PLATFORMS ${PLATFORMS} ${PLATFORM} CACHE INTERNAL "A list of registered platforms")
-
-        find_file(${PLATFORM}_CORES_PATH
-              NAMES cores
-              PATHS ${PLATFORM_PATH}
-              DOC "Path to directory containing the Arduino core sources.")
-
-        find_file(${PLATFORM}_VARIANTS_PATH
-              NAMES variants
-              PATHS ${PLATFORM_PATH}
-              DOC "Path to directory containing the Arduino variant sources.")
-
-        find_file(${PLATFORM}_BOOTLOADERS_PATH
-              NAMES bootloaders
-              PATHS ${PLATFORM_PATH}
-              DOC "Path to directory containing the Arduino bootloader images and sources.")
-
-        find_file(${PLATFORM}_PROGRAMMERS_PATH
-            NAMES programmers.txt
-            PATHS ${PLATFORM_PATH}
-            DOC "Path to Arduino programmers definition file.")
-
-        find_file(${PLATFORM}_BOARDS_PATH
-            NAMES boards.txt
-            PATHS ${PLATFORM_PATH}
-            DOC "Path to Arduino boards definition file.")
-
-        if(${PLATFORM}_BOARDS_PATH)
-            load_arduino_style_settings(${PLATFORM}_BOARDS "${PLATFORM_PATH}/boards.txt")
-        endif()
-
-        if(${PLATFORM}_PROGRAMMERS_PATH)
-            load_arduino_style_settings(${PLATFORM}_PROGRAMMERS "${ARDUINO_PROGRAMMERS_PATH}")
-        endif()
-
-        if(${PLATFORM}_VARIANTS_PATH)
-            file(GLOB sub-dir ${${PLATFORM}_VARIANTS_PATH}/*)
-            foreach(dir ${sub-dir})
-                if(IS_DIRECTORY ${dir})
-                    get_filename_component(variant ${dir} NAME)
-                    set(VARIANTS ${list_of_dirs} ${variant} CACHE INTERNAL "A list of registered variant boards")
-                    set(${variant}.path ${dir} CACHE INTERNAL "The path to the variant ${variant}")
-                endif()
-            endforeach()
+        list(FIND PLATFORMS ${PLATFORM} platform_exists)
+
+        if (platform_exists EQUAL -1)
+            set(${PLATFORM}_PLATFORM_PATH ${PLATFORM_PATH} CACHE INTERNAL "The path to ${PLATFORM}")
+            set(PLATFORMS ${PLATFORMS} ${PLATFORM} CACHE INTERNAL "A list of registered platforms")
+
+            find_file(${PLATFORM}_CORES_PATH
+                  NAMES cores
+                  PATHS ${PLATFORM_PATH}
+                  DOC "Path to directory containing the Arduino core sources.")
+
+            find_file(${PLATFORM}_VARIANTS_PATH
+                  NAMES variants
+                  PATHS ${PLATFORM_PATH}
+                  DOC "Path to directory containing the Arduino variant sources.")
+
+            find_file(${PLATFORM}_BOOTLOADERS_PATH
+                  NAMES bootloaders
+                  PATHS ${PLATFORM_PATH}
+                  DOC "Path to directory containing the Arduino bootloader images and sources.")
+
+            find_file(${PLATFORM}_PROGRAMMERS_PATH
+                NAMES programmers.txt
+                PATHS ${PLATFORM_PATH}
+                DOC "Path to Arduino programmers definition file.")
+
+            find_file(${PLATFORM}_BOARDS_PATH
+                NAMES boards.txt
+                PATHS ${PLATFORM_PATH}
+                DOC "Path to Arduino boards definition file.")
+
+            if(${PLATFORM}_BOARDS_PATH)
+                load_arduino_style_settings(${PLATFORM}_BOARDS "${PLATFORM_PATH}/boards.txt")
+            endif()
+
+            if(${PLATFORM}_PROGRAMMERS_PATH)
+                load_arduino_style_settings(${PLATFORM}_PROGRAMMERS "${ARDUINO_PROGRAMMERS_PATH}")
+            endif()
+
+            if(${PLATFORM}_VARIANTS_PATH)
+                file(GLOB sub-dir ${${PLATFORM}_VARIANTS_PATH}/*)
+                foreach(dir ${sub-dir})
+                    if(IS_DIRECTORY ${dir})
+                        get_filename_component(variant ${dir} NAME)
+                        set(VARIANTS ${VARIANTS} ${variant} CACHE INTERNAL "A list of registered variant boards")
+                        set(${variant}.path ${dir} CACHE INTERNAL "The path to the variant ${variant}")
+                    endif()
+                endforeach()
+            endif()
+
+            if(${PLATFORM}_CORES_PATH)
+                file(GLOB sub-dir ${${PLATFORM}_CORES_PATH}/*)
+                foreach(dir ${sub-dir})
+                    if(IS_DIRECTORY ${dir})
+                        get_filename_component(core ${dir} NAME)
+                        set(CORES ${CORES} ${core} CACHE INTERNAL "A list of registered cores")
+                        set(${core}.path ${dir} CACHE INTERNAL "The path to the core ${core}")
+                    endif()
+                endforeach()
+            endif()
         endif()
     endif()

@@ -599,7 +613,7 @@
             set(COMPILE_FLAGS "${COMPILE_FLAGS} -DUSB_PID=${${BOARD_ID}.build.pid}")
         endif()
         if(NOT MANUAL)
-            set(COMPILE_FLAGS "${COMPILE_FLAGS} -I\"${ARDUINO_CORES_PATH}/${BOARD_CORE}\" -I\"${ARDUINO_LIBRARIES_PATH}\"")
+            set(COMPILE_FLAGS "${COMPILE_FLAGS} -I\"${${BOARD_CORE}.path}\" -I\"${ARDUINO_LIBRARIES_PATH}\"")
         endif()
         set(LINK_FLAGS "-mmcu=${${BOARD_ID}.build.mcu}")
         if(ARDUINO_SDK_VERSION VERSION_GREATER 1.0 OR ARDUINO_SDK_VERSION VERSION_EQUAL 1.0)
@@ -635,7 +649,7 @@
     set(BOARD_CORE ${${BOARD_ID}.build.core})
     if(BOARD_CORE)
         if(NOT TARGET ${CORE_LIB_NAME})
-            set(BOARD_CORE_PATH ${ARDUINO_CORES_PATH}/${BOARD_CORE})
+            set(BOARD_CORE_PATH ${${BOARD_CORE}.path})
             find_sources(CORE_SRCS ${BOARD_CORE_PATH} True)
             # Debian/Ubuntu fix
             list(REMOVE_ITEM CORE_SRCS "${BOARD_CORE_PATH}/main.cxx")


Fix: script wasn't finding all prototypes and got confused by "else if(var == other) {"

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1425,7 +1425,7 @@
         set(ALPHANUM "${ALPHA}${NUM}")
         set(WORD "_${ALPHANUM}")
         set(LINE_START "(^|[\n])")
-        set(QUALIFIERS "([${ALPHA}]+[ ])*")
+        set(QUALIFIERS "[ \t]*([${ALPHA}]+[ ])*")
         set(TYPE "[${WORD}]+([ ]*[\n][\t]*|[ ])")
         set(FNAME "[${WORD}]+[ ]?[\n]?[\t]*[ ]*")
         set(FARGS "[(]([\t]*[ ]*[*&]?[ ]?[${WORD}](\\[([${NUM}]+)?\\])*[,]?[ ]*[\n]?)*([,]?[ ]*[\n]?)?[)]")
@@ -1440,6 +1440,10 @@
             string(REPLACE "\n" " " SKETCH_PROTOTYPE "${SKETCH_PROTOTYPE}")
             string(REPLACE "{" "" SKETCH_PROTOTYPE "${SKETCH_PROTOTYPE}")
             arduino_debug_msg("\tprototype: ${SKETCH_PROTOTYPE};")
+			# " else if(var == other) {" shoudn't be listed as prototype
+			if(NOT SKETCH_PROTOTYPE MATCHES "(if[ ]?[\n]?[\t]*[ ]*)")
+                file(APPEND ${SKETCH_CPP} "${SKETCH_PROTOTYPE};\n")
+            endif()
             file(APPEND ${SKETCH_CPP} "${SKETCH_PROTOTYPE};\n")
         endforeach()
         file(APPEND ${SKETCH_CPP} "//=== END Forward: ${SKETCH_SOURCE_PATH}\n")


OSX: fix a little quick with cmake/xcode sdk-setting for 10.8/xcode4.4

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -143,7 +143,7 @@
 	if(${XCODE_VERSION} VERSION_LESS 4.3)
 		SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
 	elseif(${XCODE_VERSION} VERSION_GREATER 4.3)
-		SET(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk)
+		set(CMAKE_XCODE_ATTRIBUTE_SDKROOT macosx10.8) # xcode 4.4-style
 	else()
 		SET(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk)
 	endif()


This should work on Windows

This should work on Windows

After talking with compnerd, because we're passing this directly to the
swift driver, we shouldn't have to do anything weird with the flags and
it should "just work". I'm frustrated enough with Windows that I'm just
going to go with that and go to bed. If I broke something, I'm sorry. I
tried as far as my sanity would allow.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -77,36 +77,31 @@

 function(_add_host_variant_swift_sanitizer_flags target)
   if (LLVM_USE_SANITIZER)
-    if (LLVM_ON_UNIX)
-
-      if (LLVM_USE_SANITIZER STREQUAL "Address")
-        set(_Swift_SANITIZER_FLAGS "-sanitize=address")
-      elseif (LLVM_USE_SANITIZER STREQUAL "HWAddress")
-        # Not supported?
-      elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
+    if (LLVM_USE_SANITIZER STREQUAL "Address")
+      set(_Swift_SANITIZER_FLAGS "-sanitize=address")
+    elseif (LLVM_USE_SANITIZER STREQUAL "HWAddress")
+      # Not supported?
+    elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
+      # Not supported
+      if(LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
         # Not supported
-        if(LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
-          # Not supported
-        endif()
-      elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
-        set(_Swift_SANITIZER_FLAGS "-sanitize=undefined")
-      elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
-        set(_Swift_SANITIZER_FLAGS "-sanitize=thread")
-      elseif (LLVM_USE_SANITIZER STREQUAL "DataFlow")
-        # Not supported
-      elseif (LLVM_USE_SANITIZER STREQUAL "Address;Undefined" OR
-              LLVM_USE_SANITIZER STREQUAL "Undefined;Address")
-        set(_Swift_SANITIZER_FLAGS "-sanitize=address -sanitize=undefined")
-      elseif (LLVM_USE_SANITIZER STREQUAL "Leaks")
-        # Not supported
-      else()
-        message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
       endif()
-
-      target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:${_Swift_SANITIZER_FLAGS}>)
-    else ()
-      # TODO (etcwilde): Pass sanitizer flags to swiftc on windows
-    endif ()
+    elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
+      set(_Swift_SANITIZER_FLAGS "-sanitize=undefined")
+    elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
+      set(_Swift_SANITIZER_FLAGS "-sanitize=thread")
+    elseif (LLVM_USE_SANITIZER STREQUAL "DataFlow")
+      # Not supported
+    elseif (LLVM_USE_SANITIZER STREQUAL "Address;Undefined" OR
+            LLVM_USE_SANITIZER STREQUAL "Undefined;Address")
+      set(_Swift_SANITIZER_FLAGS "-sanitize=address -sanitize=undefined")
+    elseif (LLVM_USE_SANITIZER STREQUAL "Leaks")
+      # Not supported
+    else()
+      message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
+    endif()
+
+    target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:${_Swift_SANITIZER_FLAGS}>)
   endif ()
 endfunction()


Pass sanitizer flags to swift on Unix-y systems

This patch fixes the part of the build system where we aren't passing
the sanitizer flags to swift, so the linker isn't linking against the
sanitizer libraries.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -75,6 +75,41 @@
   endif()
 endfunction()

+function(_add_host_variant_swift_sanitizer_flags target)
+  if (LLVM_USE_SANITIZER)
+    if (LLVM_ON_UNIX)
+
+      if (LLVM_USE_SANITIZER STREQUAL "Address")
+        set(_Swift_SANITIZER_FLAGS "-sanitize=address")
+      elseif (LLVM_USE_SANITIZER STREQUAL "HWAddress")
+        # Not supported?
+      elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
+        # Not supported
+        if(LLVM_USE_SANITIZER STREQUAL "MemoryWithOrigins")
+          # Not supported
+        endif()
+      elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
+        set(_Swift_SANITIZER_FLAGS "-sanitize=undefined")
+      elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
+        set(_Swift_SANITIZER_FLAGS "-sanitize=thread")
+      elseif (LLVM_USE_SANITIZER STREQUAL "DataFlow")
+        # Not supported
+      elseif (LLVM_USE_SANITIZER STREQUAL "Address;Undefined" OR
+              LLVM_USE_SANITIZER STREQUAL "Undefined;Address")
+        set(_Swift_SANITIZER_FLAGS "-sanitize=address -sanitize=undefined")
+      elseif (LLVM_USE_SANITIZER STREQUAL "Leaks")
+        # Not supported
+      else()
+        message(FATAL_ERROR "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
+      endif()
+
+      target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:${_Swift_SANITIZER_FLAGS}>)
+    else ()
+      # TODO (etcwilde): Pass sanitizer flags to swiftc on windows
+    endif ()
+  endif ()
+endfunction()
+
 # Usage:
 # _add_host_variant_c_compile_link_flags(name)
 function(_add_host_variant_c_compile_link_flags name)
@@ -100,6 +135,8 @@
       MACCATALYST_BUILD_FLAVOR ""
       DEPLOYMENT_VERSION "${DEPLOYMENT_VERSION}")
     target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:-target;${target}>)
+
+   _add_host_variant_swift_sanitizer_flags(${name})
   endif()

   set(_sysroot


* adding conditional build of docker

* adding conditional build of docker

--- cmake/Suil.cmake
+++ cmake/Suil.cmake
@@ -277,19 +277,23 @@
         # install targets
         message(STATUS "target '${name} install target")
         install(TARGETS ${name}
-                ARCHIVE DESTINATION lib
-                LIBRARY DESTINATION lib
-                RUNTIME DESTINATION bin)
+                ARCHIVE DESTINATION ${${name}_ARTIFACTS_DIR}
+                LIBRARY DESTINATION ${${name}_ARTIFACTS_DIR}
+                RUNTIME DESTINATION ${${name}_ARTIFACTS_DIR})

         # install directories
         set(${name}_INSTALL_DIRS ${SUIL_APP_INSTALL_DIRS})
         if (${name}_INSTALL_DIRS)
             message(STATUS "target '${name} install directories: ${${name}_INSTALL_DIRS}")
             install(DIRECTORY ${${name}_INSTALL_DIRS}
-                    DESTINATION share/${${name}_ARTIFACTS_DIR})
+                    DESTINATION ${${name}_ARTIFACTS_DIR})
         endif()
     else()
-        message(STATUS "target install is disabled")
+        message(STATUS "target install disabled, will use default")
+        install(TARGETS ${name}
+                ARCHIVE DESTINATION lib
+                LIBRARY DESTINATION lib
+                RUNTIME DESTINATION bin)
     endif()
 endfunction()


update ampere sm (#42023)

update ampere sm (#42023)

* update ampere sm

* update ampere sm

* update ampere sm

--- cmake/cuda.cmake
+++ cmake/cuda.cmake
@@ -132,7 +132,11 @@
   elseif(${CUDA_ARCH_NAME} STREQUAL "Turing")
     set(cuda_arch_bin "75")
   elseif(${CUDA_ARCH_NAME} STREQUAL "Ampere")
-    set(cuda_arch_bin "80")
+    if (${CMAKE_CUDA_COMPILER_VERSION} LESS 11.1) # CUDA 11.0
+      set(cuda_arch_bin "80")
+    elseif (${CMAKE_CUDA_COMPILER_VERSION} LESS 12.0) # CUDA 11.1+
+      set(cuda_arch_bin "80 86")
+    endif()
   elseif(${CUDA_ARCH_NAME} STREQUAL "All")
     set(cuda_arch_bin ${paddle_known_gpu_archs})
   elseif(${CUDA_ARCH_NAME} STREQUAL "Auto")


cmake(java): Try to fix multi-config generator

--- cmake/java.cmake
+++ cmake/java.cmake
@@ -84,14 +84,20 @@
 ####################
 ##  Java package  ##
 ####################
-file(GENERATE OUTPUT java/pom.xml
+file(GENERATE OUTPUT java/$<CONFIG>/replace.cmake
   CONTENT
   "FILE(READ ${PROJECT_SOURCE_DIR}/ortools/java/pom.xml.in input)
 STRING(REPLACE \"@PROJECT_VERSION@\" \"${PROJECT_VERSION}\" input \"\${input}\")
 STRING(REPLACE \"@ortools@\" \"$<TARGET_FILE:${PROJECT_NAME}>\" input \"\${input}\")
 STRING(REPLACE \"@native@\" \"$<TARGET_FILE:jniortools>\" input \"\${input}\")
-FILE(WRITE java/pom.xml \"\${input}\")"
+FILE(WRITE pom.xml \"\${input}\")"
 )
+
+add_custom_command(
+  OUTPUT java/pom.xml
+  COMMAND ${CMAKE_COMMAND} -P ./$<CONFIG>/replace.cmake
+  WORKING_DIRECTORY java
+  )

 # Main Target
 add_custom_target(java_package ALL


fix FindOPENCASCADE for OCC

fix FindOPENCASCADE for OCC

added mac[64,32]/clang/lib and lin[64,32]/gcc/lib to path_suffixes.

--- cmake/modules/FindOPENCASCADE.cmake
+++ cmake/modules/FindOPENCASCADE.cmake
@@ -61,7 +61,7 @@
   DEAL_II_FIND_LIBRARY(OPENCASCADE_${_library}
     NAMES ${_library}
     HINTS ${OPENCASCADE_DIR}
-    PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
+    PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib mac64/clang/lib mac32/clang/lib lin64/gcc/lib lin32/gcc/lib
     )
 ENDFOREACH()


cmake: propagate endianess to CMake CMAKE_<lang>_BYTE_ORDER setting

Fixes: #45270

Zephyr Kconfig defines the settings BIG_ENDIAN.
Propagate this setting to the corresponding CMAKE_C_BYTE_ORDER and
CMAKE_CXX_BYTE_ORDER variables.

This also ensures that the CMake function 'is_big_endian()' reports the
correct endianess.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/modules/FindTargetTools.cmake
+++ cmake/modules/FindTargetTools.cmake
@@ -60,6 +60,20 @@
 #   explicitly to specify the target system version.
 set(CMAKE_SYSTEM_VERSION ${PROJECT_VERSION})

+# https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_BYTE_ORDER.html
+#   Byte order of <LANG> compiler target architecture, if known.
+#
+# Zephyr Kconfig defines BIG_ENDIAN according to arch, SoC, Board, so propagate
+# this setting to allow users to read the standard CMake variable or use
+# 'test_big_endian()' function.
+if(CONFIG_BIG_ENDIAN)
+  set(CMAKE_C_BYTE_ORDER   BIG_ENDIAN)
+  set(CMAKE_CXX_BYTE_ORDER BIG_ENDIAN)
+else()
+  set(CMAKE_C_BYTE_ORDER   LITTLE_ENDIAN)
+  set(CMAKE_CXX_BYTE_ORDER LITTLE_ENDIAN)
+endif()
+
 # We are not building dynamically loadable libraries
 set(BUILD_SHARED_LIBS OFF)


translations: Add external translations support

Translations can now be pulled from external git repository, if enabled
by PULL_TRANSLATIONS.

--- cmake/modules/LXQtTranslateTs.cmake
+++ cmake/modules/LXQtTranslateTs.cmake
@@ -34,6 +34,11 @@
 #                           [TRANSLATION_DIR] translation_directory
 #                           [INSTALL_DIR] install_directory
 #                           [COMPONENT] component
+#                           [PULL_TRANSLATIONS [Yes | No]]
+#                           [CLEAN_TRANSLATIONS [Yes | No]]
+#                           [REPO_SUBDIR] repository_subdirectory
+#                           [TRANSLATIONS_REPO] remote_translation_repo
+#                           [TRANSLATIONS_REFSPEC] translations_remote_branch
 #                    )
 #     Output:
 #       qmFiles The generated compiled translations (.qm) files
@@ -60,6 +65,24 @@
 #
 #       COMPONENT Optional install component. Only effective if INSTALL_DIR
 #                   present. Defaults to "Runtime".
+#
+#       PULL_TRANSLATIONS Optional flag. If set, the translations are pulled
+#           from external repository in cmake phase (not in build/make time)
+#           into directory "${TRANSLATION_DIR}/${REPO_SUBDIR}".
+#
+#       CLEAN_TRANSLATIONS Optional flag. If set, the externally pulled
+#                          translations are removed.
+#
+#       REPO_SUBDIR Optional path in the "translations repository" to directory
+#           with translations. Only effective if PULL_TRANSLATIONS enabled.
+#           Defaults to "${TEMPLATE}".
+#
+#       TRANSLATIONS_REPO External git repository with translations - only the ${TEMPLATE} directory
+#           is pulled (using the "sparse checkout").
+#           Optional (defaults to "https://github.com/lxde/translations.git").
+#
+#       TRANSLATIONS_REFSPEC Optional refspec of external repository. Used in git pull.
+#           Defaults to "master".

 # CMake v2.8.3 needed to use the CMakeParseArguments module
 cmake_minimum_required(VERSION 2.8.3 FATAL_ERROR)
@@ -67,8 +90,23 @@
 # We use our patched version to round a annoying bug.
 include(Qt5PatchedLinguistToolsMacros)

+option(PULL_TRANSLATIONS "Pull translations" No)
+option(CLEAN_TRANSLATIONS "Clean translations" No)
+
 function(lxqt_translate_ts qmFiles)
-    set(oneValueArgs USE_QT5 UPDATE_TRANSLATIONS TEMPLATE TRANSLATION_DIR INSTALL_DIR COMPONENT)
+    set(oneValueArgs
+        USE_QT5
+        UPDATE_TRANSLATIONS
+        TEMPLATE
+        TRANSLATION_DIR
+        INSTALL_DIR
+        COMPONENT
+        PULL_TRANSLATIONS
+        CLEAN_TRANSLATIONS
+        REPO_SUBDIR
+        TRANSLATIONS_REPO
+        TRANSLATIONS_REFSPEC
+    )
     set(multiValueArgs SOURCES UPDATE_OPTIONS)
     cmake_parse_arguments(TR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

@@ -91,8 +129,97 @@
     if (NOT DEFINED TR_TRANSLATION_DIR)
         set(TR_TRANSLATION_DIR "translations")
     endif()
-
-    file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
+    get_filename_component(TR_TRANSLATION_DIR "${TR_TRANSLATION_DIR}" ABSOLUTE)
+
+    if (NOT DEFINED TR_CLEAN_TRANSLATIONS)
+        set(TR_CLEAN_TRANSLATIONS "No")
+    endif()
+    if (NOT DEFINED TR_PULL_TRANSLATIONS)
+        set(TR_PULL_TRANSLATIONS "No")
+    endif()
+    if (NOT DEFINED TR_REPO_SUBDIR)
+        set(TR_REPO_SUBDIR "${TR_TEMPLATE}")
+    endif()
+
+    if (NOT DEFINED TR_TRANSLATIONS_REPO)
+        set(TR_TRANSLATIONS_REPO "https://github.com/lxde/translations.git")
+    endif()
+
+    if (NOT DEFINED TR_TRANSLATIONS_REFSPEC)
+        set(TR_TRANSLATIONS_REFSPEC "master")
+    endif()
+
+    if (TR_CLEAN_TRANSLATIONS)
+        message(STATUS "Cleaning translations dir '${TR_TRANSLATION_DIR}' ...")
+        set(DIR_TO_REMOVE "${TR_TRANSLATION_DIR}/${TR_REPO_SUBDIR}")
+        get_filename_component(PARENT_DIR "${DIR_TO_REMOVE}" DIRECTORY)
+        while (NOT "${PARENT_DIR}" STREQAL "${TR_TRANSLATION_DIR}")
+            set(DIR_TO_REMOVE "${PARENT_DIR}")
+            get_filename_component(PARENT_DIR "${DIR_TO_REMOVE}" DIRECTORY)
+        endwhile ()
+        #TODO: is there a way to check successfulness of file command !?!
+        file(REMOVE_RECURSE "${TR_TRANSLATION_DIR}/.git" "${DIR_TO_REMOVE}")
+    endif ()
+
+    if (TR_PULL_TRANSLATIONS)
+        find_package(Git REQUIRED)
+        if (NOT (GIT_FOUND AND GIT_VERSION_STRING VERSION_GREATER "1.7.0"))
+            message(FATAL_ERROR "Git > 1.7.0 is needed For pulling translations!")
+        endif ()
+        if (NOT EXISTS "${TR_TRANSLATION_DIR}/${TR_REPO_SUBDIR}")
+            message(STATUS "Setting git repository in the translations dir '${TR_TRANSLATION_DIR}' ...")
+
+            execute_process(COMMAND rm -Rf .git
+                WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
+                RESULT_VARIABLE ex_result
+                )
+            if (NOT "${ex_result}" EQUAL 0)
+                message(FATAL_ERROR "Initialization(cleanup) of translations dir failed!")
+            endif ()
+
+            execute_process(COMMAND "${GIT_EXECUTABLE}" init
+                WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
+                RESULT_VARIABLE ex_result
+                )
+            if (NOT "${ex_result}" EQUAL 0)
+                message(FATAL_ERROR "Initialization(init) of translations dir failed!")
+            endif ()
+
+            execute_process(COMMAND "${GIT_EXECUTABLE}" remote add  origin "${TR_TRANSLATIONS_REPO}"
+                WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
+                RESULT_VARIABLE ex_result
+                )
+            if (NOT "${ex_result}" EQUAL 0)
+                message(FATAL_ERROR "Initialization(remote) of translations dir failed!")
+            endif ()
+
+            execute_process(COMMAND "${GIT_EXECUTABLE}" config core.sparseCheckout true
+                WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
+                RESULT_VARIABLE ex_result
+                )
+            if (NOT "${ex_result}" EQUAL 0)
+                message(FATAL_ERROR "Initialization(config) of translations dir failed!")
+            endif ()
+
+            file(WRITE "${TR_TRANSLATION_DIR}/.git/info/sparse-checkout" "${TR_REPO_SUBDIR}")
+        endif ()
+
+        message(STATUS "Pulling the translations...")
+        execute_process(COMMAND "${GIT_EXECUTABLE}" pull origin "${TR_TRANSLATIONS_REFSPEC}"
+            WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
+            RESULT_VARIABLE ex_result
+            )
+        if (NOT "${ex_result}" EQUAL 0)
+            message(FATAL_ERROR "Pulling translations failed!")
+        endif ()
+    endif ()
+
+    #project/module can use it's own translations (not from external)
+    if (EXISTS "${TR_TRANSLATION_DIR}/${TR_REPO_SUBDIR}/")
+        file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_REPO_SUBDIR}/*_*.ts")
+    else ()
+        file(GLOB tsFiles "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}_*.ts")
+    endif ()
     set(templateFile "${TR_TRANSLATION_DIR}/${TR_TEMPLATE}.ts")

     if(TR_USE_QT5)


template: setup.cmake

template: setup.cmake

--- setup.cmake
+++ setup.cmake
@@ -7,8 +7,9 @@

 # --- boilerplate follows
 message(STATUS "CMake ${CMAKE_VERSION}")
-if(CMAKE_VERSION VERSION_LESS 3.13)
-  message(FATAL_ERROR "Please update CMake >= 3.13")
+if(CMAKE_VERSION VERSION_LESS 3.12)
+  message(FATAL_ERROR "Please update CMake >= 3.12.
+    Try 'pip install -U cmake' or https://cmake.org/download/")
 endif()

 # site is OS name
@@ -49,11 +50,21 @@
 endif()

 # CTEST_CMAKE_GENERATOR must be defined in any case here.
-if(NOT DEFINED CTEST_CMAKE_GENERATOR)
+if(NOT DEFINED CTEST_CMAKE_GENERATOR AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
   find_program(_gen NAMES ninja ninja-build samu)
   if(_gen)
-    set(CTEST_CMAKE_GENERATOR "Ninja")
-  elseif(WIN32)
+    execute_process(COMMAND ${_gen} --version
+      OUTPUT_VARIABLE _ninja_version
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      RESULT_VARIABLE _gen_ok
+      TIMEOUT 10)
+    if(_gen_ok EQUAL 0 AND _ninja_version VERSION_GREATER_EQUAL 1.10)
+      set(CTEST_CMAKE_GENERATOR "Ninja")
+    endif()
+  endif(_gen)
+endif()
+if(NOT DEFINED CTEST_CMAKE_GENERATOR)
+  if(WIN32)
     set(CTEST_CMAKE_GENERATOR "MinGW Makefiles")
     set(CTEST_BUILD_FLAGS -j)  # not --parallel as this goes to generator directly
   else()


BUG: VXL directories missing from install tree include path.

--- itkIncludeDirectories.cmake
+++ itkIncludeDirectories.cmake
@@ -96,6 +96,7 @@
 # Include directories from the install tree.
 SET(ITK_INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include/InsightToolkit")
 SET(ITK_INCLUDE_DIRS_INSTALL_TREE ${ITK_INCLUDE_DIRS_INSTALL_TREE}
+  ${ITK_INSTALL_INCLUDE_DIR}
   ${ITK_INSTALL_INCLUDE_DIR}/Algorithms
   ${ITK_INSTALL_INCLUDE_DIR}/BasicFilters
   ${ITK_INSTALL_INCLUDE_DIR}/Common
@@ -109,6 +110,18 @@
   ${ITK_INSTALL_INCLUDE_DIR}/Utilities/DICOMParser
 )

+IF(VXL_FROM_UTILITIES)
+  SET(ITK_INCLUDE_DIRS_INSTALL_TREE ${ITK_INCLUDE_DIRS_INSTALL_TREE}
+    ${ITK_INSTALL_INCLUDE_DIR}/Utilities/vxl/vcl
+    ${ITK_INSTALL_INCLUDE_DIR}/Utilities/vxl
+  )
+ELSE(VXL_FROM_UTILITIES)
+  SET(ITK_INCLUDE_DIRS_INSTALL_TREE ${ITK_INCLUDE_DIRS_INSTALL_TREE}
+    ${ITK_INSTALL_INCLUDE_DIR}/Numerics/vxl
+    ${ITK_INSTALL_INCLUDE_DIR}/Numerics/vxl/vcl
+  )
+ENDIF(VXL_FROM_UTILITIES)
+
 # Include directory for stdlib.
 IF(NOT ITK_USE_SYSTEM_STDLIB)
   SET(ITK_INCLUDE_DIRS_INSTALL_TREE ${ITK_INCLUDE_DIRS_INSTALL_TREE}


nuttx_omnibus-f4sd_default: disable bl_update, wind_estimator, gnd_att_control, gnd_pos_control to save flash

--- cmake/configs/nuttx_omnibus-f4sd_default.cmake
+++ cmake/configs/nuttx_omnibus-f4sd_default.cmake
@@ -29,7 +29,7 @@
 	#
 	# System commands
 	#
-	systemcmds/bl_update
+	#systemcmds/bl_update
 	systemcmds/config
 	systemcmds/esc_calib
 	systemcmds/hardfault_log
@@ -80,15 +80,15 @@
 	modules/ekf2
 	modules/landing_target_estimator
 	modules/local_position_estimator
-	modules/wind_estimator
+	#modules/wind_estimator

 	#
 	# Vehicle Control
 	#
 	modules/fw_att_control
 	modules/fw_pos_control_l1
-	modules/gnd_att_control
-	modules/gnd_pos_control
+	#modules/gnd_att_control
+	#modules/gnd_pos_control
 	modules/mc_att_control
 	modules/mc_pos_control
 	modules/vtol_att_control


Fix the wrong passing of GFORTRAN_LIB to Scalapack

--- cmake/external_projects/ElMath/ScaLAPACK.cmake
+++ cmake/external_projects/ElMath/ScaLAPACK.cmake
@@ -260,7 +260,7 @@
   string(REPLACE ";" "^^" MPI_C_LIBSTRING "${MPI_C_LIBRARIES}")
   string(REPLACE ";" "^^" MPI_Fortran_LIBSTRING "${MPI_Fortran_LIBRARIES}")
   if(GFORTRAN_LIB)
-    set(GFORTRAN_COMMAND GFORTRAN_LIB=${GFORTRAN_LIB})
+    set(GFORTRAN_COMMAND -D GFORTRAN_LIB=${GFORTRAN_LIB})
   else()
     set(GFORTRAN_COMMAND)
   endif()


BUG: Update SmoothingRecursiveYvvGaussianFilter remote module

This fixes build errors and warnings on MSVC.

Conflicts:
	Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake

Change-Id: I6d4cc2c4b6e911d67a7afb078dedf423acd7b57e

--- Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake
+++ Modules/Remote/SmoothingRecursiveYvvGaussianFilter.remote.cmake
@@ -2,5 +2,5 @@
 itk_fetch_module(SmoothingRecursiveYvvGaussianFilter
   "GPU and CPU Young & Van Vliet Recursive Gaussian Smoothing Filter: http://hdl.handle.net/10380/3425"
   GIT_REPOSITORY https://github.com/Inria-Asclepios/SmoothingRecursiveYvvGaussianFilter
-  GIT_TAG d66cc15f97f98a6ecbf6e6ef8a5b52615ffb883e
+  GIT_TAG a5504a0e3849cf9e0e86af92221cae61e5c1c62b
   )


Restored part of indra/cmake/Variables.cmake that somehow got removed.

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -70,10 +70,6 @@
 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   set(LINUX ON BOOl FORCE)

-  if (INSTALL_PROPRIETARY)
-    set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.")
-  endif (INSTALL_PROPRIETARY)
-
   # If someone has specified a word size, use that to determine the
   # architecture.  Otherwise, let the architecture specify the word size.
   if (WORD_SIZE EQUAL 32)
@@ -98,18 +94,36 @@
   if (WORD_SIZE EQUAL 32)
     set(DEB_ARCHITECTURE i386)
     set(FIND_LIBRARY_USE_LIB64_PATHS OFF)
+    set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib32 ${CMAKE_SYSTEM_LIBRARY_PATH})
   else (WORD_SIZE EQUAL 32)
     set(DEB_ARCHITECTURE amd64)
+    set(FIND_LIBRARY_USE_LIB64_PATHS ON)
   endif (WORD_SIZE EQUAL 32)

-  execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH RESULT_VARIABLE DPKG_RESULT OUTPUT_VARIABLE DPKG_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+  execute_process(COMMAND dpkg-architecture -a${DEB_ARCHITECTURE} -qDEB_HOST_MULTIARCH
+      RESULT_VARIABLE DPKG_RESULT
+      OUTPUT_VARIABLE DPKG_ARCH
+      OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
   #message (STATUS "DPKG_RESULT ${DPKG_RESULT}, DPKG_ARCH ${DPKG_ARCH}")
   if (DPKG_RESULT EQUAL 0)
     set(CMAKE_LIBRARY_ARCHITECTURE ${DPKG_ARCH})
+    set(CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/${DPKG_ARCH} /usr/local/lib/${DPKG_ARCH} ${CMAKE_SYSTEM_LIBRARY_PATH})
   endif (DPKG_RESULT EQUAL 0)
+
+  include(ConfigurePkgConfig)

   set(LL_ARCH ${ARCH}_linux)
   set(LL_ARCH_DIR ${ARCH}-linux)
+
+  if (INSTALL_PROPRIETARY)
+    # Only turn on headless if we can find osmesa libraries.
+    include(FindPkgConfig)
+    pkg_check_modules(OSMESA osmesa)
+    if (OSMESA_FOUND)
+      set(BUILD_HEADLESS ON CACHE BOOL "Build headless libraries.")
+    endif (OSMESA_FOUND)
+  endif (INSTALL_PROPRIETARY)
+
 endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")

 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")


Add test for balancing weights

Add test for balancing weights

--- test/testing.cmake
+++ test/testing.cmake
@@ -195,6 +195,43 @@
     "${GRAPHS}/torus/4/"
     2
     cake/)
+
+  mpi_test(vtxBalanceCube 4
+    ./vtxBalance
+    "${GRAPHS}/cube/4/"
+    .1)
+
+  mpi_test(vtxBalanceTorus 4
+    ./vtxBalance
+    "${GRAPHS}/torus/4/"
+    .15)
+
+  mpi_test(vtxBalanceGraph 2
+    ./vtxBalance
+    "${GRAPHS}/gnutella.ebin"
+    .1)
+
+  mpi_test(balanceCube 4
+    ./balance
+    "${GRAPHS}/cube/4/")
+
+  mpi_test(balanceTorus 4
+    ./balance
+    "${GRAPHS}/torus/4/")
+
+  mpi_test(balanceTorusVtxFaceElm 4
+    ./balance
+    "${GRAPHS}/torus/4_01/"
+    yes)
+
+  mpi_test(balanceMultipleTorus 4
+    ./balanceMultiple
+    "${GRAPHS}/torus/4/")
+
+  mpi_test(balanceWeights4_100 4
+    ./balanceWeights
+    100
+    1.05)

   mpi_test(splitAndBalanceCube 8
     ./splitAndBalance
@@ -232,37 +269,6 @@
   endif()
 endif()

-mpi_test(vtxBalanceCube 4
-  ./vtxBalance
-  "${GRAPHS}/cube/4/"
-  .1)
-
-mpi_test(vtxBalanceTorus 4
-  ./vtxBalance
-  "${GRAPHS}/torus/4/"
-  .15)
-
-mpi_test(vtxBalanceGraph 2
-  ./vtxBalance
-  "${GRAPHS}/gnutella.ebin"
-  .1)
-
-mpi_test(balanceCube 4
-  ./balance
-  "${GRAPHS}/cube/4/")
-
-mpi_test(balanceTorus 4
-  ./balance
-  "${GRAPHS}/torus/4/")
-
-mpi_test(balanceTorusVtxFaceElm 4
-  ./balance
-  "${GRAPHS}/torus/4_01/"
-  yes)
-
-mpi_test(balanceMultipleTorus 4
-  ./balanceMultiple
-  "${GRAPHS}/torus/4/")

 if (ENABLE_ZOLTAN)


Dev Checkpoint 202006301545

Dev Checkpoint 202006301545

--- CMake/Checks.cmake
+++ CMake/Checks.cmake
@@ -1,5 +1,6 @@

 include(CheckCXXSourceRuns)
+include(CheckCXXSourceCompiles)
 #include(CheckVariableExists)
 #include(CheckCXXSymbolExists)

@@ -38,73 +39,90 @@
 ")

 STRING(REPLACE "TYPE" "uint8_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_UINT8_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_UINT8_T)
 SET(HAVE_UINT8_T ${HAVE_UINT8_T} ${SCOPE})

 STRING(REPLACE "TYPE" "uint16_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_UINT16_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_UINT16_T)
 SET(HAVE_UINT16_T ${HAVE_UINT16_T} ${SCOPE})

 STRING(REPLACE "TYPE" "uint32_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_UINT32_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_UINT32_T)
 SET(HAVE_UINT32_T ${HAVE_UINT32_T} ${SCOPE})

 STRING(REPLACE "TYPE" "uint64_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_UINT64_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_UINT64_T)
 SET(HAVE_UINT64_T ${HAVE_UINT64_T} ${SCOPE})

 STRING(REPLACE "TYPE" "int8_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_INT8_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_INT8_T)
 SET(HAVE_INT8_T ${HAVE_INT8_T} ${SCOPE})

 STRING(REPLACE "TYPE" "int16_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_INT16_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_INT16_T)
 SET(HAVE_INT16_T ${HAVE_INT16_T} ${SCOPE})

 STRING(REPLACE "TYPE" "int32_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_INT32_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_INT32_T)
 SET(HAVE_INT32_T ${HAVE_INT32_T} ${SCOPE})

 STRING(REPLACE "TYPE" "int64_t" TYPE_CODE "${TYPE_CODE_TEMPLATE}")
-CHECK_CXX_SOURCE_RUNS(${TYPE_CODE} HAVE_INT64_T)
+CHECK_CXX_SOURCE_COMPILES(${TYPE_CODE} HAVE_INT64_T)
 SET(HAVE_INT64_T ${HAVE_INT64_T} ${SCOPE})

 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
 # ENDIANNESS CHECK                                        #
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

-SET(ENDIAN_CODE_TEMPLATE "            \
-int main(void) {                      \n\
-    union {                           \n\
-        unsigned long int dword\;     \n\
-        unsigned char byte[4]\;       \n\
-    } value = { 0x01020304 }\;        \n\
-    return !(                         \n\
-    (value.byte[0] == TESTA) &&       \n\
-    (value.byte[2] == TESTB))\;       \n\
-}                                     \
-")
+IF (NOT CMAKE_CROSSCOMPILING)

-STRING(REPLACE "TESTA" "0x01" ENDIAN_CODE "${ENDIAN_CODE_TEMPLATE}")
-STRING(REPLACE "TESTB" "0x03" ENDIAN_CODE "${ENDIAN_CODE}")
-CHECK_CXX_SOURCE_RUNS(${ENDIAN_CODE} BIG_ENDIAN)
-SET(BIG_ENDIAN ${BIG_ENDIAN} ${SCOPE})
+    SET(ENDIAN_CODE_TEMPLATE "            \
+    int main(void) {                      \n\
+        union {                           \n\
+            unsigned long int dword\;     \n\
+            unsigned char byte[4]\;       \n\
+        } value = { 0x01020304 }\;        \n\
+        return !(                         \n\
+        (value.byte[0] == TESTA) &&       \n\
+        (value.byte[2] == TESTB))\;       \n\
+    }                                     \
+    ")

-STRING(REPLACE "TESTA" "0x04" ENDIAN_CODE "${ENDIAN_CODE_TEMPLATE}")
-STRING(REPLACE "TESTB" "0x02" ENDIAN_CODE "${ENDIAN_CODE}")
-CHECK_CXX_SOURCE_RUNS(${ENDIAN_CODE} LITTLE_ENDIAN)
-SET(LITTLE_ENDIAN ${LITTLE_ENDIAN} ${SCOPE})
+    STRING(REPLACE "TESTA" "0x01" ENDIAN_CODE "${ENDIAN_CODE_TEMPLATE}")
+    STRING(REPLACE "TESTB" "0x03" ENDIAN_CODE "${ENDIAN_CODE}")
+    CHECK_CXX_SOURCE_RUNS(${ENDIAN_CODE} BIG_ENDIAN)
+    SET(BIG_ENDIAN ${BIG_ENDIAN} ${SCOPE})

-IF (NOT BIG_ENDIAN AND NOT LITTLE_ENDIAN)
-    # Bit-Aligned and Word-Aligned Endianness Not Supported
-    MESSAGE(FATAL_ERROR "Architecture endianness not supported")
+    STRING(REPLACE "TESTA" "0x04" ENDIAN_CODE "${ENDIAN_CODE_TEMPLATE}")
+    STRING(REPLACE "TESTB" "0x02" ENDIAN_CODE "${ENDIAN_CODE}")
+    CHECK_CXX_SOURCE_RUNS(${ENDIAN_CODE} LITTLE_ENDIAN)
+    SET(LITTLE_ENDIAN ${LITTLE_ENDIAN} ${SCOPE})
+
+    IF (NOT BIG_ENDIAN AND NOT LITTLE_ENDIAN)
+        # Bit-Aligned and Word-Aligned Endianness Not Supported
+        MESSAGE(FATAL_ERROR "Architecture endianness not supported")
+    ENDIF()
+
+ELSE()
+
+    # cannot always run cross-compiled programs on host
+    # so convert this automated check into a manual one
+    # NOTE: C++20 now supports endianness checking at compile-time
+    # TODO: add compile-time checking for supported compilers
+    SET(BIG_ENDIAN OFF CACHE BOOL "architecture endianness")
+    IF (BIG_ENDIAN)
+        SET(LITTLE_ENDIAN OFF)
+    ELSE()
+        SET(LITTLE_ENDIAN ON)
+    ENDIF()
+
 ENDIF()

 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
 # FEATURE CHECK                                           #
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

-CHECK_CXX_SOURCE_RUNS(" \
+CHECK_CXX_SOURCE_COMPILES(" \
 int main(void) {        \n\
     int x = 0;          \n\
     switch (x) {        \n\


[cmake] fix MUMPS detection on Suse (and debian?)

--- cmake/FindMUMPS.cmake
+++ cmake/FindMUMPS.cmake
@@ -10,23 +10,39 @@
 # MUMPS_LIBRARY_DIRECTORY before FIND_PACKAGE(MUMPS)
 INCLUDE(FindPackageHandleStandardArgs)

+# On debian and Suse, both mpi and mpi-free version of MUMPS can be installed in parallel
+# The latter have a "_seq" suffix
+IF(IDONTWANTMPI)
+  SET(__MUMPS_NAMES dmumps_seq dmumps)
+ELSE(IDONTWANTMPI)
+  SET(__MUMPS_NAMES dmumps)
+ENDIF(IDONTWANTMPI)
+
 IF(MUMPS_LIBRARY_DIRECTORY)
-  FIND_LIBRARY(MUMPS_LIBRARY dmumps PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+  FIND_LIBRARY(MUMPS_LIBRARY NAMES ${__MUMPS_NAMES} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
   IF(NOT MUMPS_LIBRARY)
     SET(_MUMPS_DEFAULT_SEARCH_DIR TRUE)
     MESSAGE("Could not find MUMPS in directory ${MUMPS_LIBRARY_DIRECTORY}")
-    FIND_LIBRARY(MUMPS_LIBRARY dmumps)
+    FIND_LIBRARY(MUMPS_LIBRARY NAMES ${__MUMPS_NAMES})
   ENDIF()
 ELSE(MUMPS_LIBRARY_DIRECTORY)
-  FIND_LIBRARY(MUMPS_LIBRARY dmumps)
+  FIND_LIBRARY(MUMPS_LIBRARY NAMES ${__MUMPS_NAMES})
 ENDIF(MUMPS_LIBRARY_DIRECTORY)
+
+
+# Try to be smart and detect whether the MUMPS lib file has a "_seq" suffix. If yes, we add it to all the other library
+IF(IDONTWANTMPI AND MUMPS_LIBRARY MATCHES "dmumps_seq")
+  SET(__SUFFIX "_seq")
+ELSE()
+  SET(__SUFFIX "")
+ENDIF()

 IF(MUMPS_LIBRARY_DIRECTORY AND NOT _MUMPS_DEFAULT_SEARCH_DIR)
-  FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+  FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common${__SUFFIX} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
 ELSE()
-  FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common)
+  FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common${__SUFFIX})
 ENDIF()

 IF(MUMPS_LIBRARY_DIRECTORY)
@@ -39,23 +55,25 @@
 ENDIF(MUMPS_LIBRARY_DIRECTORY)

 IF(MUMPS_LIBRARY_DIRECTORY)
-  FIND_LIBRARY(PORD_LIBRARY pord PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+  FIND_LIBRARY(PORD_LIBRARY pord${__SUFFIX} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
   IF(NOT PORD_LIBRARY)
-    FIND_LIBRARY(PORD_LIBRARY pord)
+    FIND_LIBRARY(PORD_LIBRARY pord${__SUFFIX})
   ENDIF()
 ELSE(MUMPS_LIBRARY_DIRECTORY)
-  FIND_LIBRARY(PORD_LIBRARY pord)
+  FIND_LIBRARY(PORD_LIBRARY pord${__SUFFIX})
 ENDIF(MUMPS_LIBRARY_DIRECTORY)

 IF((NOT MUMPS_INCLUDE_DIR) AND MUMPS_LIBRARY)
   GET_FILENAME_COMPONENT(MUMPS_LIBRARY_DIR ${MUMPS_LIBRARY} PATH)
   GET_FILENAME_COMPONENT(MUMPS_LIBRARY_DIR_DIR ${MUMPS_LIBRARY_DIR} PATH)

+  # Suse uses /usr/include/mumps
+  # Debian has /usr/include/mumps_seq for the MPI-free version
   find_path(MUMPS_INCLUDE_DIR dmumps_c.h
     HINTS
     ${MUMPS_LIBRARY_DIR_DIR}/include
     $ENV{MPI_INCLUDE}
-    PATH_SUFFIXES MUMPS
+    PATH_SUFFIXES MUMPS mumps mumps${__SUFFIX}
     )
 ENDIF()


FindREGEX.cmake broken on old mac environment

--- cmake/FindREGEX.cmake
+++ cmake/FindREGEX.cmake
@@ -2,6 +2,7 @@
 #
 #  FindRegex.cmake: Try to find Regex
 #
+#  Copyright (C) 2014-     Yuichi Nishiwaki
 #  Copyright (C) 2005-2013 EDF-EADS-Phimeca
 #
 #  This library is free software: you can redistribute it and/or modify
@@ -20,7 +21,6 @@
 #  @author dutka
 #  @date   2010-02-04 16:44:49 +0100 (Thu, 04 Feb 2010)
 #
-#
 # - Try to find Regex
 # Once done this will define
 #
@@ -28,6 +28,17 @@
 #  REGEX_INCLUDE_DIR - The Regex include directory
 #  REGEX_LIBRARIES - The libraries needed to use Regex
 #  REGEX_DEFINITIONS - Compiler switches required for using Regex
+#
+#
+#  ChangeLogs:
+#
+#  2014/05/07 - Yuichi Nishiwaki
+#    On Mac, it finds /System/Library/Frameworks/Ruby.framework/Headers/regex.h,
+#   which was a part of superold version of glibc when POSIX standard didn't exist.
+#   To avoid this behavior, we call find_path twice, searching /usr/include and
+#   /usr/local/include first and if nothing was found then searching $PATH in the
+#   second stage.
+#

 IF (REGEX_INCLUDE_DIR AND REGEX_LIBRARIES)
    # in cache already
@@ -43,11 +54,18 @@
 #ENDIF (NOT WIN32)

 FIND_PATH(REGEX_INCLUDE_DIR regex.h
-   HINTS
-   ${REGEX_INCLUDEDIR}
-   ${PC_LIBXML_INCLUDE_DIRS}
-   PATH_SUFFIXES regex
-   )
+  PATHS /usr/include /usr/local/include
+  NO_DEFAULT_PATH
+  )
+
+IF (NOT REGEX_INCLUDE_DIR)
+  FIND_PATH(REGEX_INCLUDE_DIR regex.h
+    HINTS
+    ${REGEX_INCLUDEDIR}
+    ${PC_LIBXML_INCLUDE_DIRS}
+    PATH_SUFFIXES regex
+    )
+ENDIF()

 FIND_LIBRARY(REGEX_LIBRARIES NAMES c regex
    HINTS
@@ -57,7 +75,7 @@

 INCLUDE(FindPackageHandleStandardArgs)

-# handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set REGEX_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Regex DEFAULT_MSG REGEX_LIBRARIES REGEX_INCLUDE_DIR)


refs #95, fix MSVC warning syntax

refs #95, fix MSVC warning syntax

--- cmake/GhcHelper.cmake
+++ cmake/GhcHelper.cmake
@@ -50,7 +50,7 @@
             $<$<BOOL:${EMSCRIPTEN}>:-s DISABLE_EXCEPTION_CATCHING=0>
             $<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-error=deprecated-declarations>
             $<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Wno-psabi -Werror -Wno-error=deprecated-declarations>
-            $<$<CXX_COMPILER_ID:MSVC>:/WX /wd"4996">)
+            $<$<CXX_COMPILER_ID:MSVC>:/WX /wd4996>)
     if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
         target_compile_definitions(filesystem_test_cpp${cppStd} PRIVATE _CRT_SECURE_NO_WARNINGS)
     endif()
@@ -58,4 +58,4 @@
         set_target_properties(filesystem_test_cpp${cppStd} PROPERTIES LINK_FLAGS "-g4 -s DISABLE_EXCEPTION_CATCHING=0 -s ALLOW_MEMORY_GROWTH=1")
     endif()
     ParseAndAddCatchTests(filesystem_test_cpp${cppStd})
-endmacro()+endmacro()


[libFuzzer] Set Android specific ALL_FUZZER_SUPPORTED_ARCH

Build libFuzzer for all Android supported architectures.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -245,6 +245,8 @@

 if(OS_NAME MATCHES "Linux")
   set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64})
+elseif(OS_NAME MATCHES "Android")
+  set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64})
 else()
   set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64})
 endif()


Fix submodule sync dependencies

Fix submodule sync dependencies

Fix setting up the dependencies on the global submodule sync target so
that all projects with an update step depend on it. The old logic was
only adding the dependency — to ALL projects — when Ninja is used. This
latter is necessary due to quirks in how CMake computes dependencies for
Ninja (fixed in 3.7), but the former, which should be done for obvious
reasons, was missing. (This got messed up setting up the dependencies
for the Ninja case.)

--- cmake/externals.cmake
+++ cmake/externals.cmake
@@ -104,6 +104,23 @@
         ALWAYS 1
         )
     endif()
+  endif()
+
+  # TODO Once we require CMake 3.7, replace calls to drake_forceupdate with
+  # drake_add_submodule_sync_dependency
+  drake_add_submodule_sync_dependency(${PROJECT})
+endfunction()
+
+#------------------------------------------------------------------------------
+# Add a dependency on synchronizing submodules
+#------------------------------------------------------------------------------
+function(drake_add_submodule_sync_dependency PROJECT)
+  if(AUTO_UPDATE_EXTERNALS)
+    foreach(_step_target ${PROJECT} ${PROJECT}-update)
+      if(TARGET ${_step_target})
+        add_dependencies(${_step_target} submodule-sync)
+      endif()
+    endforeach()
   endif()
 endfunction()

@@ -364,21 +381,14 @@

     # Add external to download dependencies
     add_dependencies(download-all ${PROJECT}-update)
-  endif()
-
-  if(AUTO_UPDATE_EXTERNALS AND CMAKE_GENERATOR STREQUAL "Ninja")
+  elseif(CMAKE_GENERATOR STREQUAL "Ninja" AND CMAKE_VERSION VERSION_LESS 3.7)
     # Due to a quirk of how the CMake Ninja generator computes dependencies,
     # all targets that contain a submodule update command, or depend on a
     # target that does, need to depend on the submodule-sync target, or the
     # direct dependency will be lost.
     #
-    # TODO(bradking) This is expected to be fixed in CMake 3.7; add a version
-    # check when that is confirmed.
-    foreach(_step_target ${PROJECT} ${PROJECT}-update)
-      if(TARGET ${_step_target})
-        add_dependencies(${_step_target} submodule-sync)
-      endif()
-    endforeach()
+    # TODO remove when we require CMake 3.7
+    drake_add_submodule_sync_dependency(${PROJECT})
   endif()

   # Add extra per-project targets


restore ninja compatibility

restore ninja compatibility

The ninja generator requires all generated libraries to be declared.
This was missing in get_boost.cmake.

--- cmake/get_boost.cmake
+++ cmake/get_boost.cmake
@@ -62,6 +62,10 @@
     set(BOOTSTRAP_FILE_TYPE "sh")
   endif()

+  foreach(component ${BOOST_COMPONENTS})
+    list(APPEND BOOST_BUILD_BYPRODUCTS <INSTALL_DIR>/lib/${LIBRARY_PREFIX}boost_${component}${WINDOWS_LIB_NAME_SCHEME}${LIBRARY_SUFFIX})
+  endforeach()
+
   message(STATUS "Adding Boost components")
   include(ExternalProject)
   ExternalProject_Add(
@@ -74,6 +78,7 @@
       CONFIGURE_COMMAND ./bootstrap.${BOOTSTRAP_FILE_TYPE} --prefix=${BOOST_ROOT_DIR}
       BUILD_COMMAND ./b2 install ${BOOST_MAYBE_STATIC} --prefix=${BOOST_ROOT_DIR} variant=${VARIANT} ${WINDOWS_B2_OPTIONS} ${BOOST_COMPONENTS_FOR_BUILD}
       BUILD_IN_SOURCE true
+      BUILD_BYPRODUCTS ${BOOST_BUILD_BYPRODUCTS}
       INSTALL_COMMAND ""
       INSTALL_DIR ${BOOST_ROOT_DIR}
   )


fix for older cmake

fix for older cmake

--- cmake/gsLibrary.cmake
+++ cmake/gsLibrary.cmake
@@ -37,8 +37,8 @@

   set_target_properties(${PROJECT_NAME} PROPERTIES
   #https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B
-  VERSION ${${PROJECT_NAME}_VERSION}
-  SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}
+  VERSION "${${PROJECT_NAME}_VERSION}"
+  SOVERSION "${${PROJECT_NAME}_VERSION_MAJOR}"
   PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}.h"
   POSITION_INDEPENDENT_CODE ON
   LINKER_LANGUAGE CXX


cmake: register new mbedtls 2.26

cmake: register new mbedtls 2.26

Signed-off-by: Eduardo Silva <b6525c140147034c280e3cd2f39161f32f3f4f62@gmail.com>

--- cmake/libraries.cmake
+++ cmake/libraries.cmake
@@ -7,7 +7,7 @@
 set(FLB_PATH_LIB_LUAJIT   "lib/luajit-2.1.0-1e66d0f")
 set(FLB_PATH_LIB_MONKEY   "lib/monkey")
 set(FLB_PATH_LIB_JSMN     "lib/jsmn")
-set(FLB_PATH_LIB_MBEDTLS  "lib/mbedtls-2.24.0")
+set(FLB_PATH_LIB_MBEDTLS  "lib/mbedtls-2.26.0")
 set(FLB_PATH_LIB_SQLITE   "lib/sqlite-amalgamation-3330000")
 set(FLB_PATH_LIB_JANSSON  "lib/jansson-fd3e9e3")
 set(FLB_PATH_LIB_ONIGMO   "lib/onigmo")


logic error

logic error

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -81,8 +81,6 @@

 IF ( NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "Coverage"))
 	MESSAGE( WARNING "Code coverage results with an optimized (non-Debug) build may be misleading" )
-ELSE()
-	SET(COVERAGE_DEBUG_FLAGS "-g")
 ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"

 SET(CMAKE_CXX_FLAGS_COVERAGE


update

update

--- modules/zlib.cmake
+++ modules/zlib.cmake
@@ -1,6 +1,16 @@
 if(NOT TARGET zlib)
+  if(CMAKE_MAKE_PROGRAM MATCHES "(MSBuild|devenv|msdev|nmake)")
+    set(CMAKE_OLD_C_FLAGS ${CMAKE_C_FLAGS})
+    set(CMAKE_OLD_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4131 /wd4244")
+    set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /wd4127 /wd4131 /wd4244")
+  endif()
   option(AMD64 "Enable building amd64 assembly implementation" ON)
   add_subdirectory("zlib")
   set_target_properties(zlib zlibstatic example minigzip PROPERTIES FOLDER modules/zlib)
   set_target_properties(example minigzip PROPERTIES EXCLUDE_FROM_ALL 1 EXCLUDE_FROM_DEFAULT_BUILD 1)
+  if(CMAKE_MAKE_PROGRAM MATCHES "(MSBuild|devenv|msdev|nmake)")
+    set(CMAKE_C_FLAGS ${CMAKE_OLD_C_FLAGS})
+    set(CMAKE_CXX_FLAGS ${CMAKE_OLD_CXX_FLAGS})
+  endif()
 endif()


Fix warning in the CMake build about redefining LLVM_PATH_XDOT_PY by making sure both definitions are identical. This used to produce warnings like

In file included from .../llvm/trunk/tools/lto/LTOCodeGenerator.cpp:45:
In file included from .../llvm/trunk/include/llvm/Support/system_error.h:225:
.../include/llvm/Config/config.h:591:9: warning: 'LLVM_PATH_XDOT_PY' macro redefined
#define LLVM_PATH_XDOT_PY ".../bin/xdot.py"
        ^
.../include/llvm/Config/llvm-config.h:98:9: note: previous definition is here
#define LLVM_PATH_XDOT_PY ""
        ^
1 warning generated.

(Paths edited for clarity)

Note: This only affected people who had xdot.py installed.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@132050 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/llvm/Config/llvm-config.h.cmake
+++ include/llvm/Config/llvm-config.h.cmake
@@ -95,7 +95,7 @@
 #cmakedefine LLVM_PATH_TWOPI "${LLVM_PATH_TWOPI}"

 /* Define to path to xdot.py program if found or 'echo xdot.py' otherwise */
-#cmakedefine LLVM_PATH_XDOT_PY "${LLVM_PATH_XDOT.PY}"
+#cmakedefine LLVM_PATH_XDOT_PY "${LLVM_PATH_XDOT_PY}"

 /* Installation prefix directory */
 #cmakedefine LLVM_PREFIX "${LLVM_PREFIX}"


Set ITK package install path to be version free

Always install the ITK package files in "lib/cmake/ITK" without the
version. This fixes the common problem of using a different version of
ITK than what is specified in the CMake files and also enables an
arbitrary version to be specified with by setting ITK_GIT_TAG.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -92,6 +92,7 @@
   -DITK_LEGACY_REMOVE:BOOL=ON
   -DITK_USE_KWSTYLE:BOOL=OFF
   -DITK_USE_GIT_PROTOCOL:BOOL=${ITK_USE_GIT_PROTOCOL}
+  -DITK_INSTALL_PACKAGE_DIR=lib/cmake/ITK
   BUILD_COMMAND ${BUILD_COMMAND_STRING}
   DEPENDS
     ${ITK_DEPENDENCIES}
@@ -99,5 +100,5 @@
   )

-ExternalProject_Get_Property(ITK install_dir)
-set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.12" )
+ExternalProject_Get_Property(${proj} install_dir)
+set(ITK_DIR "${install_dir}/cmake/ITK")


ENH: Allowing to use any version of VTK that is greater or equal to 6

When finding the VTK package with cmake, we need to add the option
"NO_MODULE" to look for VTK only using the Config option[1][2]
The required version is not checked using the REQUIRED keyword anymore as
it is too restrictive (MAJOR and MINOR version of provided and requested
versions have to match). Instead, we allow any newer version than the one
that was requested, but warn the user if the version does not match
exactly.

[1] http://www.vtk.org/Bug/view.php?id=14826#c32945
[2] http://cmake.org/cmake/help/v2.8.12/cmake.html#command:find_package

--- SuperBuild/External_VTK.cmake
+++ SuperBuild/External_VTK.cmake
@@ -23,7 +23,7 @@
 # SlicerMacroCheckExternalProjectDependency
 set(extProjName VTK) #The find_package known name
 set(proj        VTK) #This local name
-set(${extProjName}_REQUIRED_VERSION "6.0")  #If a required version is necessary, then set this, else leave blank
+set(${extProjName}_REQUIRED_VERSION "6")  #If a required version is necessary, then set this, else leave blank

 #if(${USE_SYSTEM_${extProjName}})
 #  unset(${extProjName}_DIR CACHE)
@@ -147,7 +147,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://vtk.org/VTK.git)
-  set(${proj}_GIT_TAG "v6.0.0")
+  set(${proj}_GIT_TAG "v6.1.0")
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}
@@ -169,10 +169,17 @@
       ${${proj}_DEPENDENCIES}
     )

-  set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/lib/cmake/vtk-6.0)
+  set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-install/lib/cmake/vtk-6.1)
 else()
   if(${USE_SYSTEM_${extProjName}})
-    find_package(${extProjName} ${${extProjName}_REQUIRED_VERSION} REQUIRED)
+    find_package(${extProjName} NO_MODULE )
+    if( NOT ${VTK_VERSION} VERSION_EQUAL ${${extProjName}_REQUIRED_VERSION} )
+      if( ${VTK_VERSION} VERSION_LESS ${${extProjName}_REQUIRED_VERSION} )
+        message( FATAL_ERROR "Could not find a configuration file for package \"VTK\" that is compatible with requested version ${${extProjName}_REQUIRED_VERSION}.")
+      else()
+        message( WARNING "Could not find a configuration file for package \"VTK\" that matches exactly the requested version ${${extProjName}_REQUIRED_VERSION}. Using found VTK version ${VTK_VERSION} which is newer instead.")
+      endif()
+    endif()
     message("USING the system ${extProjName}, set ${extProjName}_DIR=${${extProjName}_DIR}")
   endif()
   # The project is provided using ${extProjName}_DIR, nevertheless since other


ENH: Bump ITK version to version 5.0a01

ENH: Bump ITK version to version 5.0a01


Ah right, libc++ broken with dist libs

Ah right, libc++ broken with dist libs

--- CMake/setup.cmake
+++ CMake/setup.cmake
@@ -24,7 +24,7 @@
   else()
     set(CMAKE_C_COMPILER clang CACHE STRING "Set compiler to clang" FORCE)
     set(CMAKE_CXX_COMPILER clang++ CACHE STRING "Set compiler to clang" FORCE)
-    set(CXX_STDLIB "libc++" CACHE STRING "" FORCE)
+    set(CXX_STDLIB "libstdc++11" CACHE STRING "" FORCE)
   endif()
 elseif(TOOLCHAIN STREQUAL "gcc")
   set(CMAKE_C_COMPILER gcc CACHE STRING "Set compiler to gcc" FORCE)


[t:4871] switch ctestconfig to use lex1's cdash server instead of munchkin (only works if you're running in tokulex)

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@44629 c7de825b-a66e-492c-adef-691d508d4ae1

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,6 +8,6 @@
 set(CTEST_NIGHTLY_START_TIME "23:59:00 EDT")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "munchkin.leifwalsh.com")
+set(CTEST_DROP_SITE "192.168.1.114")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=tokudb")
 set(CTEST_DROP_SITE_CDASH TRUE)


Minor mods

Minor mods

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -1,7 +1,6 @@
 IF(WIN32)
     SET(CTEST_CUSTOM_POST_TEST
       "C:\Windows\System32\cmd /C type Testing\Temporary\LastTest.log")
-#    SET(CTEST_CUSTOM_POST_TEST "type Testing\Temporary\LastTest.log")
 ELSE(WIN32)
     SET(CTEST_CUSTOM_POST_TEST "cat Testing/Temporary/LastTest.log")
 ENDIF(WIN32)


Fix typo in tools/VoltDBCompilation.cmake

--- tools/VoltDBCompilation.cmake
+++ tools/VoltDBCompilation.cmake
@@ -4,9 +4,9 @@
 #
 ########################################################################
 #
-# We give compiler options is two parts.  One is the set of base
+# We give compiler options in two parts.  One is the set of base
 # options, which all compilations use.  The second is the set of
-# compiler, platform and version options.
+# compiler, platform, and version options.
 #
 # These are the base compiler options, and some
 # other linker options.