(#6662) Reduced RPATH for UW RPM builds

(#6662) Reduced RPATH for UW RPM builds

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -117,6 +117,9 @@
 #option used to enable/disable make package for rpm/deb with different install paths
 option(CONDOR_PACKAGE_BUILD "Enables a package build" OFF)

+#option used to control RPATH when using rpmbuild directly
+option(CONDOR_RPMBUILD "Whether rpmbuild is being used to build HTCondor" OFF)
+
 # 1st set the location of the install targets, these are the defaults for
 set( C_BIN			bin)
 set( C_LIB			lib)
@@ -161,13 +164,9 @@
 if ( ${OS_NAME} STREQUAL "LINUX" )
 	set( EXTERNALS_LIB "${C_LIB}/condor" )
 	if (${BIT_MODE} MATCHES "32" OR ${SYS_ARCH} MATCHES "IA64" )
-		if ( ${SYSTEM_NAME} MATCHES "rhel3" )
-			message (FATAL_ERROR "ERROR: RHEL3 is EOL you are trying to build new packages on a deprecated platform")
-		else()
-			set( CONDOR_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
-			set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
-			set( PYTHON_RPATH "$ORIGIN/../:/lib:/usr/lib:$ORIGIN/../condor" )
-		endif()
+		set( CONDOR_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
+		set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
+		set( PYTHON_RPATH "$ORIGIN/../:/lib:/usr/lib:$ORIGIN/../condor" )
 	else()
 		set( CONDOR_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
 		set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
@@ -175,6 +174,17 @@
 	endif()
 elseif( ${OS_NAME} STREQUAL "DARWIN" )
 	set( EXTERNALS_LIB "${C_LIB}/condor" )
+endif()
+
+# Use the limited RPATH when building directly with RPM
+if ( CONDOR_RPMBUILD )
+	if (${BIT_MODE} MATCHES "32" OR ${SYS_ARCH} MATCHES "IA64" )
+	    set( CONDOR_RPATH "/usr/lib:/usr/lib/condor" )
+	    set( PYTHON_RPATH "/usr/lib/condor" )
+	else()
+	    set( CONDOR_RPATH "/usr/lib64:/usr/lib64/condor" )
+	    set( PYTHON_RPATH "/usr/lib64/condor" )
+	endif ()
 endif()

 #this needs to be evaluated in order due to WIN collision.


Windows: fixed linker errors (this time for real).

--- toolchains/android-studio.toolchain.cmake
+++ toolchains/android-studio.toolchain.cmake
@@ -62,7 +62,7 @@
 if( NOT ( ANDROID_ABI STREQUAL "mips" OR ANDROID_ABI STREQUAL "mips64" ) )
     # Implementation note: https://github.com/android-ndk/ndk/issues/75
     #                                         (01.03.2017. Domagoj Saric)
-    if ( WIN32 )
+    if ( CMAKE_HOST_WIN32 )
         set( gold_suffix ".exe" )
     endif()
     link_libraries( -fuse-ld=gold${gold_suffix} )


Minor stylistic change.

Minor stylistic change.

--- build_options.cmake
+++ build_options.cmake
@@ -70,7 +70,7 @@

 set( TNUN_compiler_dev_release_flags ${TNUN_compiler_release_flags} )
 if ( MSVC )
-    string(REPLACE "MD" "MDd" TNUN_compiler_dev_release_flags "${TNUN_compiler_dev_release_flags}")
+    string( REPLACE "MD" "MDd" TNUN_compiler_dev_release_flags "${TNUN_compiler_dev_release_flags}" )
 endif()
 list( APPEND TNUN_compiler_release_flags -DNDEBUG )
 if( NOT TNUN_DO_NOT_ADD_DEFAULT_BUILD_FLAGS )


fixed build npp for linux

fixed build npp for linux

--- modules/gpu/FindNPP.cmake
+++ modules/gpu/FindNPP.cmake
@@ -40,17 +40,17 @@
 	unset(CUDA_NPP_INCLUDES CACHE)
 	unset(CUDA_NPP_LIBRARIES CACHE)
 endif()
-
+
 if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
-	if (UNIX OR APPLE)
+	if (UNIX OR APPLE)
 		set(NPP_SUFFIX "32")
-	else()
+	else()
 		set(NPP_SUFFIX "-mt")
 	endif()
-elseif(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
-	if (UNIX OR APPLE)
+else(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
+	if (UNIX OR APPLE)
 		set(NPP_SUFFIX "64")
-	else()
+	else()
 		set(NPP_SUFFIX "-mt-x64")
 	endif()
 endif(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
@@ -63,20 +63,21 @@
 find_path(CUDA_NPP_INCLUDES npp.h PATHS "${CUDA_NPP_LIBRARY_ROOT_DIR}/common/npp/include" NO_DEFAULT_PATH)
 # Search default search paths, after we search our own set of paths.
 find_path(CUDA_NPP_INCLUDES device_functions.h)
-mark_as_advanced(CUDA_NPP_INCLUDES)
+mark_as_advanced(CUDA_NPP_INCLUDES)

 # Find NPP library
 find_library(CUDA_NPP_LIBRARIES
-	NAMES libnpp${NPP_SUFFIX}
+	NAMES npp${NPP_SUFFIX} libnpp${NPP_SUFFIX}
 	PATHS "${CUDA_NPP_LIBRARY_ROOT_DIR}/common/lib"
 	DOC "NPP library"
 	NO_DEFAULT_PATH
-	)
+	)
+
 # Search default search paths, after we search our own set of paths.
-find_library(CUDA_NPP_LIBRARIES NAMES libnpp${NPP_SUFFIX} DOC "NPP library")
-mark_as_advanced(CUDA_NPP_LIBRARIES)
-
-if(NOT EXISTS ${CUDA_NPP_LIBRARIES} OR NOT EXISTS ${CUDA_NPP_INCLUDES}/npp.h)
+find_library(CUDA_NPP_LIBRARIES NAMES npp${NPP_SUFFIX} libnpp${NPP_SUFFIX} DOC "NPP library")
+mark_as_advanced(CUDA_NPP_LIBRARIES)
+
+if(NOT EXISTS ${CUDA_NPP_LIBRARIES} OR NOT EXISTS ${CUDA_NPP_INCLUDES}/npp.h)
 	if(NPP_FIND_REQUIRED)
 		message(FATAL_ERROR "NPP headers/libraries are not found. Specify CUDA_NPP_LIBRARY_ROOT_DIR.")
 	elseif(NOT CUDA_FIND_QUIETLY)


CMake/FindGMP.cmake: compile a test program to check the gmp version.

The existing GMP version check consists of grepping the contents of
the gmp.h header to parse out a few constants. This test fails, at
least, on Gentoo, where the usual header file is a wrapper that
includes the true header to allow for simultaneous 32/64-bit
support.

This commit updates FindGMP to compile a test program against gmp.h
that compares version constants using the C preprocessor. If GMP is
too old, the test program will fail to compile and CMake will know.

--- CMake/FindGMP.cmake
+++ CMake/FindGMP.cmake
@@ -2,28 +2,23 @@
 # https://gmplib.org/
 #
 # This module supports requiring a minimum version, e.g. you can do
-#   find_package(GMP 6.0.0)
-# to require version 6.0.0 to newer of GMP.
+#   find_package(GMP 6.2.1)
+# to require version 6.2.1 to newer of GMP.
 #
 # Once done this will define
 #
 #  GMP_FOUND - system has GMP lib with correct version
 #  GMP_INCLUDE_DIRS - the GMP include directory
 #  GMP_LIBRARIES - the GMP library
-#  GMP_VERSION - GMP version
 #
-# Copyright (c) 2016 Jack Poulson, <jack.poulson@gmail.com>
-# Redistribution and use is allowed according to the terms of the BSD license.

-find_path(GMP_INCLUDE_DIRS NAMES gmp.h PATHS $ENV{GMPDIR} ${INCLUDE_INSTALL_DIR})
-
-# Set GMP_FIND_VERSION to 5.1.0 if no minimum version is specified
+# Set GMP_FIND_VERSION to 6.0.0 if no minimum version is specified
 if(NOT GMP_FIND_VERSION)
   if(NOT GMP_FIND_VERSION_MAJOR)
-    set(GMP_FIND_VERSION_MAJOR 5)
+    set(GMP_FIND_VERSION_MAJOR 6)
   endif()
   if(NOT GMP_FIND_VERSION_MINOR)
-    set(GMP_FIND_VERSION_MINOR 1)
+    set(GMP_FIND_VERSION_MINOR 0)
   endif()
   if(NOT GMP_FIND_VERSION_PATCH)
     set(GMP_FIND_VERSION_PATCH 0)
@@ -32,43 +27,51 @@
     "${GMP_FIND_VERSION_MAJOR}.${GMP_FIND_VERSION_MINOR}.${GMP_FIND_VERSION_PATCH}")
 endif()

-if(GMP_INCLUDE_DIRS)
-  # Since the GMP version macros may be in a file included by gmp.h of the form
-  # gmp-.*[_]?.*.h (e.g., gmp-x86_64.h), we search each of them.
-  file(GLOB GMP_HEADERS "${GMP_INCLUDE_DIRS}/gmp.h" "${GMP_INCLUDE_DIRS}/gmp-*.h"
-	  "${GMP_INCLUDE_DIRS}/x86*/gmp.h")
-  foreach(gmp_header_filename ${GMP_HEADERS})
-    file(READ "${gmp_header_filename}" _gmp_version_header)
-    string(REGEX MATCH
-      "define[ \t]+__GNU_MP_VERSION[ \t]+([0-9]+)" _gmp_major_version_match
-      "${_gmp_version_header}")
-    if(_gmp_major_version_match)
-      set(GMP_MAJOR_VERSION "${CMAKE_MATCH_1}")
-      string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_MINOR[ \t]+([0-9]+)"
-        _gmp_minor_version_match "${_gmp_version_header}")
-      set(GMP_MINOR_VERSION "${CMAKE_MATCH_1}")
-      string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_PATCHLEVEL[ \t]+([0-9]+)"
-        _gmp_patchlevel_version_match "${_gmp_version_header}")
-      set(GMP_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}")
-      set(GMP_VERSION
-        ${GMP_MAJOR_VERSION}.${GMP_MINOR_VERSION}.${GMP_PATCHLEVEL_VERSION})
-    endif()
-  endforeach()
+find_path(GMP_INCLUDE_DIRS
+          NAMES gmp.h
+          PATHS $ENV{GMPDIR} ${INCLUDE_INSTALL_DIR})

-  # Check whether found version exists and exceeds the minimum requirement
-  if(NOT GMP_VERSION)
-    set(GMP_VERSION_OK FALSE)
-    message(STATUS "GMP version was not detected")
-  elseif(${GMP_VERSION} VERSION_LESS ${GMP_FIND_VERSION})
-    set(GMP_VERSION_OK FALSE)
-    message(STATUS "GMP version ${GMP_VERSION} found in ${GMP_INCLUDE_DIRS}, "
-                   "but at least version ${GMP_FIND_VERSION} is required")
-  else()
-    set(GMP_VERSION_OK TRUE)
-  endif()
+find_library(GMP_LIBRARIES
+             gmp
+             PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR})
+
+if(GMP_INCLUDE_DIRS AND GMP_LIBRARIES)
+
+  # This program will fail to compile if GMP is too old.
+  # We prefer to perform this "test" at compile-time to
+  # avoid problems with e.g. try_run() during cross-compilation.
+  file(WRITE ${PROJECT_BINARY_DIR}/gmp-version-check.c ""
+  "#include <gmp.h>\n"
+  "\n"
+  "#define GMP_FIND_VERSION_MAJOR ${GMP_FIND_VERSION_MAJOR}\n"
+  "#define GMP_FIND_VERSION_MINOR ${GMP_FIND_VERSION_MINOR}\n"
+  "#define GMP_FIND_VERSION_PATCH ${GMP_FIND_VERSION_PATCH}\n"
+  "\n"
+  "#if __GNU_MP_VERSION < GMP_FIND_VERSION_MAJOR\n"
+  "#error insufficient GMP major version\n"
+  "#elif __GNU_MP_VERSION == GMP_FIND_VERSION_MAJOR\n"
+  "#if __GNU_MP_VERSION_MINOR < GMP_FIND_VERSION_MINOR\n"
+  "#error insufficient GMP minor version\n"
+  "#elif __GNU_MP_VERSION_MINOR == GMP_FIND_VERSION_MINOR\n"
+  "#if __GNU_MP_VERSION_PATCH < GMP_FIND_VERSION_PATCH\n"
+  "#error insufficient GMP patch version\n"
+  "#endif\n"
+  "#endif\n"
+  "#endif\n"
+  "\n"
+  "int main(int argc, char** argv) { return 0; }\n")
+
+  # Try to compile the test program above with the appropriate version
+  # strings substituted in.
+  try_compile(GMP_VERSION_OK
+          "${PROJECT_BINARY_DIR}"
+          "${PROJECT_BINARY_DIR}/gmp-version-check.c"
+          CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${GMP_INCLUDE_DIRS}")
 endif()

-find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR})
+if(NOT GMP_VERSION_OK)
+  message(STATUS "No sufficient GMP version detected")
+endif()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(GMP DEFAULT_MSG


COMP: on OSGeo4W, qwt is named qwt5.lib

COMP: on OSGeo4W, qwt is named qwt5.lib

--- CMake/FindQwt.cmake
+++ CMake/FindQwt.cmake
@@ -80,7 +80,7 @@

 find_library ( QWT_LIBRARY
-  NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5
+  NAMES qwt qwt-qt3 qwt-qt4 qwt-qt5 qwt${QWT_MAJOR_VERSION}
   HINTS ${QT_LIBRARY_DIR}
 )


ENH: update for Tcl/Tk 8.5

ENH: update for Tcl/Tk 8.5

--- CMake/FindTCL.cmake
+++ CMake/FindTCL.cmake
@@ -56,10 +56,12 @@
   NAME)

 SET (TCLTK_POSSIBLE_LIB_PATHS
+  "${TCL_INCLUDE_PATH_PARENT}/lib"
+  "${TK_INCLUDE_PATH_PARENT}/lib"
+  "${TCL_LIBRARY_PATH}"
+  "${TK_LIBRARY_PATH}"
   "${TCL_TCLSH_PATH_PARENT}/lib"
   "${TK_WISH_PATH_PARENT}/lib"
-  "${TCL_INCLUDE_PATH_PARENT}/lib"
-  "${TK_INCLUDE_PATH_PARENT}/lib"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/lib"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/lib"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/lib"
@@ -119,10 +121,12 @@
 ENDIF(Tk_FRAMEWORKS)

 SET (TCLTK_POSSIBLE_INCLUDE_PATHS
+  "${TCL_LIBRARY_PATH_PARENT}/include"
+  "${TK_LIBRARY_PATH_PARENT}/include"
+  "${TCL_INCLUDE_PATH}"
+  "${TK_INCLUDE_PATH}"
   "${TCL_TCLSH_PATH_PARENT}/include"
   "${TK_WISH_PATH_PARENT}/include"
-  "${TCL_LIBRARY_PATH_PARENT}/include"
-  "${TK_LIBRARY_PATH_PARENT}/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ActiveState\\ActiveTcl\\${ActiveTcl_CurrentVersion}]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.6;Root]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Scriptics\\Tcl\\8.5;Root]/include"


compiler: do not allow expansion-to-defined

'-Wexpansion-to-defined'
     Warn whenever 'defined' is encountered in the expansion of a macro
     (including the case where the macro is expanded by an '#if'
     directive).  Such usage is not portable.  This warning is also
     enabled by '-Wpedantic' and '-Wextra'.

This is enabled by default in llvm but not in gcc. Given that it is 'not
portable', lets disallow this in gcc and keep both compilers in sync.

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- cmake/compiler/gcc/compiler_flags.cmake
+++ cmake/compiler/gcc/compiler_flags.cmake
@@ -38,6 +38,9 @@

 # Prohibit void pointer arithmetic. Illegal in C99
 check_set_compiler_property(APPEND PROPERTY warning_base -Wpointer-arith)
+
+# not portable
+check_set_compiler_property(APPEND PROPERTY warning_base -Wexpansion-to-defined)

 if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "9.1.0")
   set_compiler_property(APPEND PROPERTY warning_base


Don't let android cmake toolchain screw up the binary output path.

--- cmake/toolchain/android.toolchain.cmake
+++ cmake/toolchain/android.toolchain.cmake
@@ -714,18 +714,19 @@
 set( ANDROID_SYSTEM_INCLUDE_DIRS "" )
 set( ANDROID_SYSTEM_LIB_DIRS "" )

-# setup output directories
-set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
-set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
-
-if(NOT _CMAKE_IN_TRY_COMPILE)
- if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
-  set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
- else()
-  set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
- endif()
- set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
-endif()
+# XXX: commented for apitrace
+## setup output directories
+#set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
+#set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )
+#
+#if(NOT _CMAKE_IN_TRY_COMPILE)
+# if( EXISTS "${CMAKE_SOURCE_DIR}/jni/CMakeLists.txt" )
+#  set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME}" CACHE PATH "Output directory for applications" )
+# else()
+#  set( EXECUTABLE_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/bin" CACHE PATH "Output directory for applications" )
+# endif()
+# set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
+#endif()

 # includes
 list( APPEND ANDROID_SYSTEM_INCLUDE_DIRS "${ANDROID_SYSROOT}/usr/include" )


FindGlog: Add support for 'glogd' Debug library (#1479)

Summary:
Glog v0.4.0 when configured with Debug build type adds a 'd' suffix to
the library file. This results in FindGlog.cmake failing to locate it.

Update FindGlog.cmake to use check for 'glogd', and use
select_library_configurations() to set GLOG_LIBRARY to the correct
found filename.

(Note: this has no effect if a non-Debug type is used.)

Pull Request resolved: https://github.com/facebook/folly/pull/1479

Reviewed By: yfeldblum

Differential Revision: D24503510

Pulled By: Orvid

fbshipit-source-id: 705df05a4a3d7df2df8af3bb66c319fb044adbce

--- build/fbcode_builder/CMake/FindGlog.cmake
+++ build/fbcode_builder/CMake/FindGlog.cmake
@@ -7,12 +7,17 @@
 # GLOG_LIBRARIES - link these to use Glog

 include(FindPackageHandleStandardArgs)
+include(SelectLibraryConfigurations)

-find_library(GLOG_LIBRARY glog
+find_library(GLOG_LIBRARY_RELEASE glog
+  PATHS ${GLOG_LIBRARYDIR})
+find_library(GLOG_LIBRARY_DEBUG glogd
   PATHS ${GLOG_LIBRARYDIR})

 find_path(GLOG_INCLUDE_DIR glog/logging.h
   PATHS ${GLOG_INCLUDEDIR})
+
+select_library_configurations(GLOG)

 find_package_handle_standard_args(glog DEFAULT_MSG
   GLOG_LIBRARY


Include nn in cmake. Change: 143201255

Include nn in cmake.
Change: 143201255

--- tensorflow/contrib/cmake/tf_python.cmake
+++ tensorflow/contrib/cmake/tf_python.cmake
@@ -337,6 +337,9 @@
 add_python_module("tensorflow/contrib/metrics/python/ops")
 add_python_module("tensorflow/contrib/ndlstm")
 add_python_module("tensorflow/contrib/ndlstm/python")
+add_python_module("tensorflow/contrib/nn")
+add_python_module("tensorflow/contrib/nn/python")
+add_python_module("tensorflow/contrib/nn/python/ops")
 add_python_module("tensorflow/contrib/opt")
 add_python_module("tensorflow/contrib/opt/python")
 add_python_module("tensorflow/contrib/opt/python/training")


Fix incorrect TBB path resolution order.

When two instances of TBB were present, the system installed version would take
precedence over an explicitly specified TBB_LOCATION path. This change puts
TBB_LOCATION into the HINTS section and leaves the system paths in the PATHS
section.

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -37,6 +37,7 @@
         HINTS
             "${TBB_LOCATION}/include"
             "$ENV{TBB_LOCATION}/include"
+        PATHS
             "$ENV{PROGRAMFILES}/Intel/TBB/include"
             /usr/include
             DOC "The directory where TBB headers reside")
@@ -47,6 +48,7 @@
         HINTS
             "${TBB_LOCATION}/include"
             "$ENV{TBB_LOCATION}/include"
+        PATHS
             DOC "The directory where TBB headers reside")
 else ()
     find_path(TBB_INCLUDE_DIR
@@ -55,6 +57,7 @@
         HINTS
             "${TBB_LOCATION}/include"
             "$ENV{TBB_LOCATION}/include"
+        PATHS
             /usr/include
             /usr/local/include
             /usr/openwin/share/include


minheadless Add FileAttributesPlugin

minheadless Add FileAttributesPlugin

FileAttributesPlugin is part of the standard Squeak and Pharo VMs.

--- cmake/Plugins.cmake
+++ cmake/Plugins.cmake
@@ -99,6 +99,7 @@

 # Basic external plugins
 add_vm_plugin_auto(SurfacePlugin EXTERNAL)
+add_vm_plugin_auto(FileAttributesPlugin EXTERNAL)

 # Drop plugin
 add_vm_plugin_sources(DropPlugin INTERNAL


cmake: never build OSS adriver on win32

cmake: never build OSS adriver on win32

--- fluidsynth/cmake_admin/FindOSS.cmake
+++ fluidsynth/cmake_admin/FindOSS.cmake
@@ -19,23 +19,28 @@

 SET(OSS_FOUND FALSE)

-IF(LINUX_OSS_INCLUDE_DIR)
-	SET(OSS_FOUND TRUE)
-	SET(OSS_INCLUDE_DIR ${LINUX_OSS_INCLUDE_DIR})
-	SET(HAVE_LINUX_SOUNDCARD_H 1)
-ENDIF()

-IF(SYS_OSS_INCLUDE_DIR)
-	SET(OSS_FOUND TRUE)
-	SET(OSS_INCLUDE_DIR ${SYS_OSS_INCLUDE_DIR})
-	SET(HAVE_SYS_SOUNDCARD_H 1)
-ENDIF()
+if ( NOT WIN32 )

-IF(MACHINE_OSS_INCLUDE_DIR)
-	SET(OSS_FOUND TRUE)
-	SET(OSS_INCLUDE_DIR ${MACHINE_OSS_INCLUDE_DIR})
-	SET(HAVE_MACHINE_SOUNDCARD_H 1)
-ENDIF()
+    IF(LINUX_OSS_INCLUDE_DIR)
+            SET(OSS_FOUND TRUE)
+            SET(OSS_INCLUDE_DIR ${LINUX_OSS_INCLUDE_DIR})
+            SET(HAVE_LINUX_SOUNDCARD_H 1)
+    ENDIF()
+
+    IF(SYS_OSS_INCLUDE_DIR)
+            SET(OSS_FOUND TRUE)
+            SET(OSS_INCLUDE_DIR ${SYS_OSS_INCLUDE_DIR})
+            SET(HAVE_SYS_SOUNDCARD_H 1)
+    ENDIF()
+
+    IF(MACHINE_OSS_INCLUDE_DIR)
+            SET(OSS_FOUND TRUE)
+            SET(OSS_INCLUDE_DIR ${MACHINE_OSS_INCLUDE_DIR})
+            SET(HAVE_MACHINE_SOUNDCARD_H 1)
+    ENDIF()
+
+ENDIF(NOT WIN32)

 MARK_AS_ADVANCED (
 	OSS_FOUND


[CMake] Adding another missing include. NFC.

This also works fine today, but will break with my upcoming refactoring.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -1,3 +1,5 @@
+include(CMakeParseArguments)
+
 # On OS X SDKs can be installed anywhere on the base system and xcode-select can
 # set the default Xcode to use. This function finds the SDKs that are present in
 # the current Xcode.


[CMake] [Darwin] Log architecture test failures to CMakeError.log

This makes debugging configuration issues way easier.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -78,6 +78,10 @@
                 OUTPUT_VARIABLE TEST_OUTPUT)
     if(${CAN_TARGET_${os}_${arch}})
       list(APPEND working_archs ${arch})
+    else()
+      file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+        "Testing compiler for supporting ${os}-${arch}:\n"
+        "${TEST_OUTPUT}\n")
     endif()
   endforeach()
   set(${valid_archs} ${working_archs}


Fix CMake for STM32 F4 Cube package (#1307)

***NO_CI***

--- CMake/Modules/FindSTM32_F4_CubePackage.cmake
+++ CMake/Modules/FindSTM32_F4_CubePackage.cmake
@@ -7,25 +7,26 @@
 list(APPEND STM32_F4_CubePackage_INCLUDE_DIRS "${PROJECT_BINARY_DIR}/STM32_CubePackage_Source/Drivers/STM32F4xx_HAL_Driver/Inc")

 # source files
-set(STM32_F7_CubePackage_SRCS
+set(STM32_F4_CubePackage_SRCS

     # add HAL files here as required

     # SPIFFS
+    stm32f4xx_hal_dma.c
     stm32f4xx_hal_qspi.c
 )

-foreach(SRC_FILE ${STM32_F7_CubePackage_SRCS})
-    set(STM32_F7_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
-    find_file(STM32_F7_CubePackage_SRC_FILE ${SRC_FILE}
+foreach(SRC_FILE ${STM32_F4_CubePackage_SRCS})
+    set(STM32_F4_CubePackage_SRC_FILE SRC_FILE-NOTFOUND)
+    find_file(STM32_F4_CubePackage_SRC_FILE ${SRC_FILE}
         PATHS

         "${PROJECT_BINARY_DIR}/STM32_CubePackage_Source/Drivers/STM32F4xx_HAL_Driver/Src"

         CMAKE_FIND_ROOT_PATH_BOTH
     )
-    # message("${SRC_FILE} >> ${STM32_F7_CubePackage_SRC_FILE}") # debug helper
-    list(APPEND STM32_F4_CubePackage_SOURCES ${STM32_F7_CubePackage_SRC_FILE})
+    # message("${SRC_FILE} >> ${STM32_F4_CubePackage_SRC_FILE}") # debug helper
+    list(APPEND STM32_F4_CubePackage_SOURCES ${STM32_F4_CubePackage_SRC_FILE})
 endforeach()


xpFlatBuffersBuildTS req'd file(GLOB internal

issue https://github.com/smanders/externpro/issues/345

--- projects/use/usexp-flatbuffers-config.cmake
+++ projects/use/usexp-flatbuffers-config.cmake
@@ -53,11 +53,12 @@
   cmake_parse_arguments(P "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   xpGetPkgVar(flatbuffers FLATC_EXECUTABLE) # sets FLATBUFFERS_FLATC_EXECUTABLE
   set(cmdFile "${CMAKE_CURRENT_BINARY_DIR}/${P_TARGET}_fbs_ts_cmd")
+  file(GLOB schemas ${P_SCHEMAS})
   add_custom_command(OUTPUT ${cmdFile}
-    COMMAND $<TARGET_FILE:${FLATBUFFERS_FLATC_EXECUTABLE}> --ts -o ${P_OUTPUT_DIR} ${P_SCHEMAS}
+    COMMAND $<TARGET_FILE:${FLATBUFFERS_FLATC_EXECUTABLE}> --ts -o ${P_OUTPUT_DIR} ${schemas}
     COMMAND ${CMAKE_COMMAND} -E touch ${cmdFile}
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    DEPENDS ${P_SCHEMAS}
+    DEPENDS ${schemas}
     )
   set(tgtName ${P_TARGET}_fbs_ts)
   add_custom_target(${tgtName} ALL DEPENDS ${cmdFile})


Include copyright information.

Include copyright information.

	* build-aux/cmake/modules/ProjectInfo.cmake: Do that.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/ProjectInfo.cmake
+++ build-aux/cmake/modules/ProjectInfo.cmake
@@ -15,6 +15,9 @@
 if(NOT PROJECT_INFO_CMAKE)
   set(PROJECT_INFO_CMAKE TRUE)

+  set(PROJECT_COPYRIGHT_HOLDER "Gostai S.A.S")
+  set(PROJECT_COPYRIGHT_YEARS "2006-2008")
+
   check_cmake_vars_exists(PROJECT_VERSION_MAJOR PROJECT_VERSION_MINOR)
   set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")


Invert if-else block.

Invert if-else block.

	* build-aux/cmake/modules/ProjectInfo.cmake: Do that.

--- build-aux/cmake/modules/ProjectInfo.cmake
+++ build-aux/cmake/modules/ProjectInfo.cmake
@@ -312,10 +312,10 @@
   # Format the next tag message.
   set(PROJECT_TAG_MSG "Release ${PROJECT_NAME}")
   if(PROJECT_VENDOR)
-    set(PROJECT_TAG_MSG "${PROJECT_TAG_MSG} for Gostai")
-  else(PROJECT_VENDOR)
     set(PROJECT_TAG_MSG
       "${PROJECT_TAG_MSG} ${PROJECT_VENDOR_VERSION} for ${PROJECT_VENDOR}")
+  else(PROJECT_VENDOR)
+    set(PROJECT_TAG_MSG "${PROJECT_TAG_MSG} for Gostai")
   endif(PROJECT_VENDOR)
   set(PROJECT_TAG_MSG
     "${PROJECT_TAG_MSG} version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")


Added logic to fail fast if user wants to use system VTK but version 5 is not available.

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -256,6 +256,11 @@
   set(vtk_args -DVTK_DIR:PATH=${install_prefix}/lib/vtk-5.10)
   set(vtk_depends vtk)
 else()
+  # Verifies that the system has VTK5.
+  find_package(VTK REQUIRED)
+  if (NOT ${VTK_VERSION_MAJOR} EQUAL 5)
+    message(FATAL_ERROR "System does not have VTK5. It has version ${VTK_VERSION}.")
+  endif()

   set(vtk_homebrew_dir /usr/local/opt/vtk5/lib/vtk-5.10)
   if (APPLE AND IS_DIRECTORY ${vtk_homebrew_dir})


sync mimetypes with vlc3

sync mimetypes with vlc3

--- MimeTypes.cmake
+++ MimeTypes.cmake
@@ -15,6 +15,7 @@
     application/vnd.ms-wpl
     application/vnd.rn-realmedia
     application/vnd.rn-realmedia-vbr
+    application/x-cd-image
     application/x-extension-m4a
     application/x-extension-mp4
     application/x-flac
@@ -31,8 +32,6 @@
     audio/AMR-WB
     audio/aac
     audio/ac3
-    audio/amr
-    audio/amr-wb
     audio/basic
     audio/dv
     audio/eac3
@@ -55,9 +54,11 @@
     audio/vnd.dts
     audio/vnd.dts.hd
     audio/vnd.rn-realaudio
+    audio/vorbis
     audio/wav
     audio/webm
     audio/x-aac
+    audio/x-adpcm
     audio/x-aiff
     audio/x-ape
     audio/x-flac
@@ -102,6 +103,7 @@
     video/3gp
     video/3gpp
     video/3gpp2
+    video/avi
     video/divx
     video/dv
     video/fli
@@ -137,6 +139,7 @@
     video/x-ms-wvx
     video/x-msvideo
     video/x-nsv
+    video/x-ogm
     video/x-ogm+ogg
     video/x-theora
     video/x-theora+ogg


Add colored diagnostics when building LLVM with cmake + ninja + clang

When invoked from Ninja, clang does not detect that it can use colors : see https://github.com/martine/ninja/issues/174

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -266,3 +266,10 @@
 add_llvm_definitions( -D__STDC_CONSTANT_MACROS )
 add_llvm_definitions( -D__STDC_FORMAT_MACROS )
 add_llvm_definitions( -D__STDC_LIMIT_MACROS )
+
+# clang doesn't print colored diagnostics when invoked from Ninja
+if (UNIX AND
+    CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+    CMAKE_GENERATOR STREQUAL "Ninja")
+  append("-fcolor-diagnostics" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+endif()


[HWASAN][CMake] Allow instrumenting LLVM/clang

Differential revision: https://reviews.llvm.org/D62813

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -697,6 +697,9 @@
     if (LLVM_USE_SANITIZER STREQUAL "Address")
       append_common_sanitizer_flags()
       append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    elseif (LLVM_USE_SANITIZER STREQUAL "HWAddress")
+      append_common_sanitizer_flags()
+      append("-fsanitize=hwaddress" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
       append_common_sanitizer_flags()
       append("-fsanitize=memory" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


cmake: link release builds statically against run-time library on windows (use /MT instead of /MD)

This should fix the problem of snapshot builds created with MSVC 2012 not
working for users with MSVC 2010, etc.

Differential Revision: http://llvm-reviews.chandlerc.com/D2157

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -5,6 +5,7 @@
 include(AddLLVMDefinitions)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
+include(LLVMProcessSources)

 if( CMAKE_COMPILER_IS_GNUCXX )
   set(LLVM_COMPILER_IS_GCC_COMPATIBLE ON)
@@ -39,6 +40,15 @@
     endif()
   endif()
 endif()
+
+if(MSVC)
+  # Link release builds against the static runtime.
+  foreach(flag CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
+      CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE
+      CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL)
+    llvm_replace_compiler_option("${flag}" "/MD" "/MT")
+  endforeach()
+endif()

 if(WIN32)
   if(CYGWIN)


refs #4871 make all compiler flag changes prepends so that user-specified flags (-D CMAKE_CXX_FLAGS="-foo") will take precedence

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -43,11 +43,11 @@
 macro(set_cflags_if_supported_named flag flagname)
   check_c_compiler_flag("${flag}" HAVE_C_${flagname})
   if (HAVE_C_${flagname})
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+    set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
   endif ()
   check_cxx_compiler_flag("${flag}" HAVE_CXX_${flagname})
   if (HAVE_CXX_${flagname})
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+    set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
   endif ()
 endmacro(set_cflags_if_supported_named)

@@ -56,11 +56,11 @@
   foreach(flag ${ARGN})
     check_c_compiler_flag(${flag} HAVE_C_${flag})
     if (HAVE_C_${flag})
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+      set(CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
     endif ()
     check_cxx_compiler_flag(${flag} HAVE_CXX_${flag})
     if (HAVE_CXX_${flag})
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+      set(CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
     endif ()
   endforeach(flag)
 endmacro(set_cflags_if_supported)
@@ -70,8 +70,8 @@
   foreach(flag ${ARGN})
     check_cxx_compiler_flag(${flag} HAVE_${flag})
     if (HAVE_${flag})
-      set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
-      set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag}")
+      set(CMAKE_EXE_LINKER_FLAGS "${flag} ${CMAKE_EXE_LINKER_FLAGS}")
+      set(CMAKE_SHARED_LINKER_FLAGS "${flag} ${CMAKE_SHARED_LINKER_FLAGS}")
     endif ()
   endforeach(flag)
 endmacro(set_ldflags_if_supported)
@@ -118,8 +118,8 @@
   # we overwrite this because the default passes -DNDEBUG and we don't want that
   set(CMAKE_C_FLAGS_RELEASE "-g -O3 -flto -fuse-linker-plugin")
   set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -flto -fuse-linker-plugin")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -fuse-linker-plugin")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -g -fuse-linker-plugin")
+  set(CMAKE_EXE_LINKER_FLAGS "-g -fuse-linker-plugin ${CMAKE_EXE_LINKER_FLAGS}")
+  set(CMAKE_SHARED_LINKER_FLAGS "-g -fuse-linker-plugin ${CMAKE_SHARED_LINKER_FLAGS}")
 endif ()

 option(USE_VALGRIND "Do not pass NVALGRIND to the compiler, because valgrind will be run on the generated executables." ON)


refs #5537 little cmake cleanup

refs #5537 little cmake cleanup

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -128,7 +128,7 @@
 endif ()

 ## set warnings
-set(WARN_FLAGS
+set_cflags_if_supported(
   -Wextra
   -Wbad-function-cast
   -Wno-missing-noreturn
@@ -149,18 +149,12 @@
   #-Wvector-optimization-performance
   )

-option(WARN_ABOUT_PACKED "Warn about useless __attribute__((packed)).  This generates lots of warnings." OFF)
-if (WARN_ABOUT_PACKED)
-  list(APPEND WARN_FLAGS -Wpacked -Wno-error=packed)
-endif ()
-
 if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
   message(WARNING "Disabling -Wcast-align with clang.  TODO: fix casting and re-enable it.")
 else ()
-  list(APPEND WARN_FLAGS -Wcast-align)
-endif ()
-
-set_cflags_if_supported(${WARN_CFLAGS})
+  set_cflags_if_supported(-Wcast-align)
+endif ()
+
 ## always want these
 set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
 set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")


CMake: Limit concurrency of mpi tests

CMake: Limit concurrency of mpi tests

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32854 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_add_test.cmake
+++ deal.II/cmake/macros/macro_add_test.cmake
@@ -258,16 +258,21 @@
         TIMEOUT ${TEST_TIME_LIMIT}
         )

-      #
-      # We have to be careful not to run different mpirun settings for the
-      # same executable in parallel because this triggers a race condition
-      # when compiling the not yet existent executable that is shared
-      # between the different tests.
-      #
-      # Luckily CMake has a mechanism to force a test to be run after
-      # another has finished (and both are scheduled):
-      #
       IF(NOT "${_n_cpu}" STREQUAL "0")
+        #
+        # Limit concurrency of mpi tests:
+        #
+        SET_TESTS_PROPERTIES(${_test_full} PROPERTIES PROCESSORS ${_n_cpu})
+
+        #
+        # We have to be careful not to run different mpirun settings for the
+        # same executable in parallel because this triggers a race condition
+        # when compiling the not yet existent executable that is shared
+        # between the different tests.
+        #
+        # Luckily CMake has a mechanism to force a test to be run after
+        # another has finished (and both are scheduled):
+        #
         IF(DEFINED TEST_DEPENDENCIES_${_target})
           SET_TESTS_PROPERTIES(${_test_full} PROPERTIES
             DEPENDS ${TEST_DEPENDENCIES_${_target}}


Denoise PackageConfig as intended in #131

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -60,6 +60,8 @@
   "set(${UPPER_PROJECT_NAME}_COMPONENTS)\n"
   "if(NOT ${UPPER_PROJECT_NAME}_FOUND)\n"
   "  set(${UPPER_PROJECT_NAME}_STATUS ON)\n"
+  "else()\n"
+  "  set(${UPPER_PROJECT_NAME}_STATUS)\n"
   "endif()\n"
   "\n"
 # add dependent library finding


return to prior interval for test spec

return to prior interval for test spec

--- testing/adios2/engine/staging-common/TestSupp.cmake
+++ testing/adios2/engine/staging-common/TestSupp.cmake
@@ -118,8 +118,8 @@
 set (KillReaders3Max_TIMEOUT "300")
 set (KillReaders3Max_PROPERTIES "RUN_SERIAL;1")

-set (KillWriter_2x2_CMD "run_test.py --test_protocol kill_writer   -nw 2 -nr 2 --interval 5 --warg=RendezvousReaderCount=1,WENGINE_PARAMS --rarg=--expect_writer_failure --rarg=--num_steps --rarg=1000")
-set (KillWriterTimeout_2x2_CMD "run_test.py --test_protocol kill_writer -nw 2 -nr 2 --interval 5 --warg=RendezvousReaderCount=1,WENGINE_PARAMS --rarg=--expect_writer_failure --rarg=--num_steps --rarg=1000 --rarg=--non_blocking")
+set (KillWriter_2x2_CMD "run_test.py --test_protocol kill_writer   -nw 2 -nr 2 --interval 2 --warg=RendezvousReaderCount=1,WENGINE_PARAMS --rarg=--expect_writer_failure --rarg=--num_steps --rarg=1000")
+set (KillWriterTimeout_2x2_CMD "run_test.py --test_protocol kill_writer -nw 2 -nr 2 --interval 2 --warg=RendezvousReaderCount=1,WENGINE_PARAMS --rarg=--expect_writer_failure --rarg=--num_steps --rarg=1000 --rarg=--non_blocking")

 set (PreciousTimestep_CMD "run_test.py --test_protocol kill_readers  -nw 3 -nr 2 --max_readers 2 --warg=FirstTimestepPrecious=true,RendezvousReaderCount=0,WENGINE_PARAMS --rarg=--ignore_time_gap --rarg=--precious_first")


ctkFunctionGenerateProjectXml considers 'Documentation' label

The dependency graph will show that the target Documentation depends
on all the CTK libraries, plugins and applications.

--- CMake/ctkFunctionGenerateProjectXml.cmake
+++ CMake/ctkFunctionGenerateProjectXml.cmake
@@ -33,6 +33,8 @@
     SET(xml_subprojects ${xml_subprojects} "  <SubProject name=\"SuperBuild\">\n")
   ENDIF()

+  SET(subproject_list)
+
   FOREACH(target_info ${target_directories})

     # extract target_dir and option_name
@@ -64,7 +66,8 @@
       #MESSAGE(STATUS target_project_name:${target_project_name})

       SET(xml_subprojects ${xml_subprojects} "  <SubProject name=\"${target_project_name}\">\n")
-
+      LIST(APPEND subproject_list ${target_project_name})
+
       # Make sure the variable is cleared
       SET(dependencies )

@@ -89,6 +92,12 @@
       SET(xml_subprojects ${xml_subprojects} "  </SubProject>\n")
     #ENDIF()
   ENDFOREACH()
+
+  SET(xml_subprojects ${xml_subprojects} "  <SubProject name=\"Documentation\">\n")
+  FOREACH(subproject ${subproject_list})
+    SET(xml_subprojects ${xml_subprojects} "    <Dependency name=\"${subproject}\"/>\n")
+  ENDFOREACH()
+  SET(xml_subprojects ${xml_subprojects} "  </SubProject>\n")

   SET(xml_content "<Project name=\"${name}\">\n${xml_subprojects}</Project>")
   SET(filename "${dir}/Project.xml")


removed some unnecc lib paths

removed some unnecc lib paths

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -17,7 +17,9 @@
     ENDIF (VLI_LIBRARY)
   ENDIF (VTK_USE_VOLUMEPRO)
   INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Rendering)
-  LINK_DIRECTORIES(${VTK_BINARY_DIR}/Rendering)
+  IF (NOT VTK_LIBRARY_PATH)
+    LINK_DIRECTORIES(${VTK_BINARY_DIR}/Rendering)
+  ENDIF (NOT VTK_LIBRARY_PATH)
 ENDIF (VTK_USE_RENDERING)

 # Optional Stanford University PLY file format
@@ -31,7 +33,9 @@
   # hybrid requires rendering
   IF (VTK_USE_RENDERING)
     INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Hybrid)
-    LINK_DIRECTORIES(${VTK_BINARY_DIR}/Hybrid)
+    IF (NOT VTK_LIBRARY_PATH)
+      LINK_DIRECTORIES(${VTK_BINARY_DIR}/Hybrid)
+    ENDIF (NOT VTK_LIBRARY_PATH)
   ELSE (VTK_USE_RENDERING)
     MESSAGE("The Hybrid option requires Rendering, but you do not have Rendering selected." "Warning")
   ENDIF (VTK_USE_RENDERING)
@@ -39,12 +43,16 @@

 IF (VTK_USE_PATENTED)
   INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Patented)
-  LINK_DIRECTORIES(${VTK_BINARY_DIR}/Patented)
+  IF (NOT VTK_LIBRARY_PATH)
+    LINK_DIRECTORIES(${VTK_BINARY_DIR}/Patented)
+  ENDIF (NOT VTK_LIBRARY_PATH)
 ENDIF (VTK_USE_PATENTED)

 IF (VTK_USE_PARALLEL)
     INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Parallel)
+  IF (NOT VTK_LIBRARY_PATH)
     LINK_DIRECTORIES(${VTK_BINARY_DIR}/Parallel)
+  ENDIF (NOT VTK_LIBRARY_PATH)
 ENDIF (VTK_USE_PARALLEL)

 #
@@ -88,7 +96,7 @@
 ${VTK_SOURCE_DIR}/IO
 )

-IF (NOT LIBRARY_OUTPUT_PATH)
+IF (NOT VTK_LIBRARY_PATH)
   LINK_DIRECTORIES(
     ${VTK_BINARY_DIR}/Common
     ${VTK_BINARY_DIR}/Filtering
@@ -96,7 +104,7 @@
     ${VTK_BINARY_DIR}/Graphics
     ${VTK_BINARY_DIR}/IO
     )
-ENDIF (NOT LIBRARY_OUTPUT_PATH)
+ENDIF (NOT VTK_LIBRARY_PATH)

 IF (UNIX)
   LINK_LIBRARIES(${CMAKE_THREAD_LIBS} ${CMAKE_DL_LIBS} -lm)
@@ -108,11 +116,11 @@
 INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/zlib)
 INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/png)
 INCLUDE_DIRECTORIES(${VTK_SOURCE_DIR}/Utilities/jpeg)
-IF (NOT LIBRARY_OUTPUT_PATH)
+IF (NOT VTK_LIBRARY_PATH)
   LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/png)
   LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/zlib)
   LINK_DIRECTORIES(${VTK_BINARY_DIR}/Utilities/jpeg)
-ENDIF (NOT LIBRARY_OUTPUT_PATH)
+ENDIF (NOT VTK_LIBRARY_PATH)

 #
 # add include path for general testing header file


[build] explicitly set OSX_ARCHITECTURES for targets in stdlib

Our custom build code already sets the architecture of compilation
commands by different means, and so far we were relying on setting
`CMAKE_OSX_ARCHITECTURES` to an empty value to avoid CMake doing the
same.

However, on Apple Silicon, CMake 3.19+ enforces a default value in this
scenario
(https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291/diffs),
and this would result in the inability to compile code for x86_64.

Addresses SR-14035, rdar://80613594

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -2055,6 +2055,15 @@
           list(APPEND THIN_INPUT_TARGETS ${VARIANT_NAME})
         endif()
       endif()
+
+      if(sdk IN_LIST SWIFT_APPLE_PLATFORMS)
+        # In the past, we relied on unsetting globally
+        # CMAKE_OSX_ARCHITECTURES to ensure that CMake would
+        # not add the -arch flag
+        # This is no longer the case when running on Apple Silicon,
+        # when CMake will enforce a default (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
+        set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}")
+      endif()
     endforeach()

     # Configure module-only targets
@@ -2493,6 +2502,13 @@
       endif()

       if(${sdk} IN_LIST SWIFT_APPLE_PLATFORMS)
+        # In the past, we relied on unsetting globally
+        # CMAKE_OSX_ARCHITECTURES to ensure that CMake would
+        # not add the -arch flag
+        # This is no longer the case when running on Apple Silicon,
+        # when CMake will enforce a default (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291)
+        set_property(TARGET ${VARIANT_NAME} PROPERTY OSX_ARCHITECTURES "${arch}")
+
         add_custom_command_target(unused_var2
          COMMAND "codesign" "-f" "-s" "-" "${SWIFT_RUNTIME_OUTPUT_INTDIR}/${VARIANT_NAME}"
          CUSTOM_TARGET_NAME "${VARIANT_NAME}_signed"


BP_ ==> EPA_

BP_ ==> EPA_

This fix has a very large effect since it affects all epa_build
configurations that are automatically generated.

svn path=/trunk/; revision=12811

--- cmake/epa_build/configure_epa.cmake
+++ cmake/epa_build/configure_epa.cmake
@@ -44,9 +44,9 @@
   endif(supports_non_srcdir_builds)

   if(supports_parallel_builds)
-    set(BUILD_COMMAND BP_PARALLEL_MAKE_COMMAND)
+    set(BUILD_COMMAND EPA_PARALLEL_MAKE_COMMAND)
   else(supports_parallel_builds)
-    set(BUILD_COMMAND BP_MAKE_COMMAND)
+    set(BUILD_COMMAND EPA_MAKE_COMMAND)
   endif(supports_parallel_builds)

   # Extra CFLAGS fixups for individual packages.


CI: Android - build JNI sample

CI: Android - build JNI sample

--- ci-build.cmake
+++ ci-build.cmake
@@ -67,6 +67,7 @@
         ${CROSS}
         "-DCMAKE_CXX_FLAGS=-std=c++11 -Werror"
         -DOGRE_CONFIG_THREAD_PROVIDER=std
+        -DOGRE_BUILD_ANDROID_JNI_SAMPLE=TRUE
         -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps)
     set(BUILD_DEPS TRUE)


vigra.cmake: On Mac, use -DWITH_BOOST_THREAD.  Also, updated default version to today's master.

--- vigra.cmake
+++ vigra.cmake
@@ -31,7 +31,7 @@
 include (nose)

 # select the desired VIGRA commit
-set(DEFAULT_VIGRA_VERSION "05cf09388e28ab9db49fda3763500f128445897d") # from 2013-12-17
+set(DEFAULT_VIGRA_VERSION "4fe15e890e0252f2fb2b38552d321d43f32c07b5") # from 2014-05-23
 IF(NOT DEFINED VIGRA_VERSION)
     SET(VIGRA_VERSION "${DEFAULT_VIGRA_VERSION}")
 ENDIF()
@@ -47,6 +47,12 @@
     set(VIGRA_UPDATE_COMMAND git checkout master && git pull)
 else()
     set(VIGRA_UPDATE_COMMAND git fetch origin && git checkout ${VIGRA_VERSION})
+endif()
+
+if (APPLE)
+    set(VIGRA_THREAD_SETTING "-DWITH_BOOST_THREAD=1")
+else()
+    set(VIGRA_THREAD_SETTING "")
 endif()

 message ("Installing ${vigra_NAME}/${VIGRA_VERSION} into FlyEM build area: ${BUILDEM_DIR} ...")
@@ -65,6 +71,8 @@
         -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
         -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
         -DCMAKE_EXE_LINKER_FLAGS=${BUILDEM_LDFLAGS}
+
+        ${VIGRA_THREAD_SETTING}

         -DWITH_VIGRANUMPY=${WITH_VIGRANUMPY}
         -DDEPENDENCY_SEARCH_PREFIX=${BUILDEM_DIR}


Fixed Cmake build for Nvidia GPU support on Linux in stout.

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

--- 3rdparty/stout/cmake/StoutConfigure.cmake
+++ 3rdparty/stout/cmake/StoutConfigure.cmake
@@ -34,6 +34,7 @@
   ${STOUT_DEPENDENCIES}
   ${BOOST_TARGET}
   ${GLOG_TARGET}
+  ${NVML_TARGET}
   ${PROTOBUF_TARGET}
   ${PICOJSON_TARGET}
   )
@@ -55,6 +56,7 @@
   ${APR_INCLUDE_DIR}
   ${BOOST_INCLUDE_DIR}
   ${GLOG_INCLUDE_DIR}
+  ${NVML_INCLUDE_DIR}
   ${PICOJSON_INCLUDE_DIR}
   ${PROTOBUF_INCLUDE_DIR}
   ${SVN_INCLUDE_DIR}


Autobuild : Fix merge snaffu in Json cmake file

--- indra/cmake/JsonCpp.cmake
+++ indra/cmake/JsonCpp.cmake
@@ -14,7 +14,7 @@
       debug json_vc100debug_libmt.lib
       optimized json_vc100_libmt)
   elseif (DARWIN)
-    set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
+    set(JSONCPP_LIBRARIES libjson_linux-gcc-4.0.1_libmt.a)
   elseif (LINUX)
     set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
   endif (WINDOWS)


Set label on designer plugins associated with CTK libraries

The associated label corresponds to the associated CTK library name

--- CMake/ctkMacroBuildQtDesignerPlugin.cmake
+++ CMake/ctkMacroBuildQtDesignerPlugin.cmake
@@ -99,11 +99,15 @@
     ${MY_UI_CPP}
     ${MY_QRC_SRCS}
     )
-
+
+  # Extract library name associated with the plugin and use it as label
+  STRING(REGEX REPLACE "(.*)Plugins" "\\1" label ${lib_name})
+
   # Apply properties to the library target.
   SET_TARGET_PROPERTIES(${lib_name}  PROPERTIES
     COMPILE_FLAGS "-DQT_PLUGIN"
     LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/designer"
+    LABELS ${label}
     )

   SET(my_libs


-BUG: typo: OF -> ON

-BUG: typo: OF -> ON

--- Testing/Dashboard/pxDashboard_BIGR_linux64_gcc.cmake
+++ Testing/Dashboard/pxDashboard_BIGR_linux64_gcc.cmake
@@ -46,7 +46,7 @@
 // Some ITKTools settings, defining the configuration
 ITKTOOLS_BUILD_TESTING:BOOL=ON
 ITKTOOLS_3D_SUPPORT:BOOL=ON
-ITKTOOLS_4D_SUPPORT:BOOL=OF
+ITKTOOLS_4D_SUPPORT:BOOL=ON
 ")


grammar update

grammar update

--- reg_tests/CTestList.cmake
+++ reg_tests/CTestList.cmake
@@ -63,7 +63,7 @@
 # Regression tests
 #===============================================================================

-# openfast regression tests
+# OpenFAST regression tests
 of_regression(Test01)
 of_regression(Test02)
 of_regression(Test03)
@@ -91,5 +91,5 @@
 of_regression(Test25)
 of_regression(Test26)

-# beam dyn regression tests
+# BeamDyn regression tests
 bd_regression(bd_isotropic_rollup)


fixed: install prefix determination

fixed: install prefix determination

--- share/hugh/cmake/SetupInstallPrefix.cmake
+++ share/hugh/cmake/SetupInstallPrefix.cmake
@@ -8,6 +8,10 @@

 if(DEFINED ENV{HUGH_INSTALL_PREFIX})
   set(CMAKE_INSTALL_PREFIX $ENV{HUGH_INSTALL_PREFIX})
+else()
+  if(HUGH_INSTALL_PREFIX)
+    set(CMAKE_INSTALL_PREFIX ${HUGH_INSTALL_PREFIX})
+  endif()
 endif()

 if(VERBOSE)


Revert "CMake: fixed minor bug: when a _ROOT_DIR variable was set by the user after"

This reverts commit f6f9c5 - the behavior is faulty with command line override
and doesn't work properly with special cases like OMNIORBPY

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -465,8 +465,8 @@
   ELSE()
      SET(_var_already_there FALSE)
   ENDIF()
-  #   Make cache entry, giving precedence to the env variable
-  SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory" FORCE)
+  #   Make cache entry
+  SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory")

   ##
   ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake)


Don't generate test w/o parameters

Don't generate test w/o parameters

--- Modules/ToFProcessing/Testing/files.cmake
+++ Modules/ToFProcessing/Testing/files.cmake
@@ -3,5 +3,8 @@
   mitkToFDistanceImageToSurfaceFilterTest.cpp
   mitkToFCompositeFilterTest.cpp
   mitkToFProcessingCommonTest.cpp
+)
+
+set(MODULE_CUSTOM_TESTS
   mitkToFImageDownsamplingFilterTest.cpp
 )


This closes #1.

This closes #1.

--- cmake/platforms/raspbian/toolchain/arm-linux-gnueabihf.cmake
+++ cmake/platforms/raspbian/toolchain/arm-linux-gnueabihf.cmake
@@ -1,7 +1,3 @@
-#
-# CMake defines to cross-compile to ARM/Linux on BCM2708 using glibc.
-#
-
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
 set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)


[benchmark] Extract multisource benchmark cmake code into helper functions.

This is the next step in allowing (at least the multi-source benchmarks) to
compile swift 4 and swift 3 in a nice way.

rdar://34556274

--- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
+++ benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
@@ -71,6 +71,104 @@
         ${sources})
     set(sibfile_out "${sibfile}" PARENT_SCOPE)
   endif()
+endfunction()
+
+function(_construct_sources_for_multibench sources_out objfile_out)
+  cmake_parse_arguments(SOURCEJSONLIST "" "" "SOURCES" ${ARGN})
+
+  set(sources)
+  set(objfiles)
+
+  foreach(source ${SOURCEJSONLIST_SOURCES})
+    list(APPEND sources "${srcdir}/${source}")
+
+    get_filename_component(basename "${source}" NAME_WE)
+    set(objfile "${objdir}/${module_name}/${basename}.o")
+
+    string(CONCAT json "${json}"
+      "  \"${srcdir}/${source}\": { \"object\": \"${objfile}\" },\n")
+
+    list(APPEND objfiles "${objfile}")
+  endforeach()
+  string(CONCAT json "${json}" "}")
+  file(WRITE "${objdir}/${module_name}/outputmap.json" ${json})
+  set(${sources_out} ${sources} PARENT_SCOPE)
+  set(${objfile_out} ${objfiles} PARENT_SCOPE)
+endfunction()
+
+# Regular whole-module-compilation: only a single object file is
+# generated.
+function (add_swift_multisource_wmo_benchmark_library objfile_out)
+  cmake_parse_arguments(BENCHLIB "" "MODULE_PATH;SOURCE_DIR;OBJECT_DIR" "SOURCES;LIBRARY_FLAGS;DEPENDS" ${ARGN})
+
+  precondition(BENCHLIB_MODULE_PATH)
+  precondition(BENCHLIB_SOURCE_DIR)
+  precondition(BENCHLIB_OBJECT_DIR)
+  precondition(BENCHLIB_SOURCES)
+
+  set(module_name_path "${BENCHLIB_MODULE_PATH}")
+  get_filename_component(module_name "${module_name_path}" NAME)
+  set(srcdir "${BENCHLIB_SOURCE_DIR}")
+  set(objdir "${BENCHLIB_OBJECT_DIR}")
+
+  set(objfile "${objdir}/${module_name}.o")
+
+  set(sources)
+  foreach(source ${BENCHLIB_SOURCES})
+    list(APPEND sources "${srcdir}/${source}")
+  endforeach()
+
+  add_custom_command(
+    OUTPUT "${objfile}"
+    DEPENDS
+      ${sources} ${BENCHLIB_DEPENDS}
+    COMMAND "${SWIFT_EXEC}"
+      ${BENCHLIB_LIBRARY_FLAGS}
+      "-parse-as-library"
+      "-emit-module" "-module-name" "${module_name}"
+      "-I" "${objdir}"
+      "-o" "${objfile}"
+      ${sources})
+
+  set(${objfile_out} "${objfile}" PARENT_SCOPE)
+endfunction()
+
+function(add_swift_multisource_nonwmo_benchmark_library objfiles_out)
+  cmake_parse_arguments(BENCHLIB "" "MODULE_PATH;SOURCE_DIR;OBJECT_DIR" "SOURCES;LIBRARY_FLAGS;DEPENDS" ${ARGN})
+
+  precondition(BENCHLIB_MODULE_PATH)
+  precondition(BENCHLIB_SOURCE_DIR)
+  precondition(BENCHLIB_OBJECT_DIR)
+  precondition(BENCHLIB_SOURCES)
+
+  set(module_name_path "${BENCHLIB_MODULE_PATH}")
+  get_filename_component(module_name "${module_name_path}" NAME)
+  set(srcdir "${BENCHLIB_SOURCE_DIR}")
+  set(objdir "${BENCHLIB_OBJECT_DIR}")
+
+  set(objfile "${objdir}/${module_name}.o")
+
+  # No whole-module-compilation or multi-threaded compilation.
+  # There is an output object file for each input file. We have to write
+  # an output-map-file to specify the output object file names.
+  set(sources)
+  set(objfiles)
+  _construct_sources_for_multibench(sources objfiles
+    SOURCES ${BENCHLIB_SOURCES})
+
+  add_custom_command(
+    OUTPUT ${objfiles}
+    DEPENDS ${sources} ${BENCHLIB_DEPENDS}
+    COMMAND "${SWIFT_EXEC}"
+      ${BENCHLIB_LIBRARY_FLAGS}
+      "-parse-as-library"
+      "-emit-module-path" "${objdir}/${module_name}.swiftmodule"
+      "-module-name" "${module_name}"
+      "-I" "${objdir}"
+      "-output-file-map" "${objdir}/${module_name}/outputmap.json"
+      ${sources})
+
+  set(${objfiles_out} ${objfiles} PARENT_SCOPE)
 endfunction()

 function (swift_benchmark_compile_archopts)
@@ -228,66 +326,28 @@
   endforeach()

   foreach(module_name_path ${SWIFT_MULTISOURCE_BENCHES})
-    get_filename_component(module_name "${module_name_path}" NAME)
-
+    set(objfile_out)
     if ("${bench_flags}" MATCHES "-whole-module.*" AND
         NOT "${bench_flags}" MATCHES "-num-threads.*")
-      # Regular whole-module-compilation: only a single object file is
-      # generated.
-      set(objfile "${objdir}/${module_name}.o")
+      add_swift_multisource_wmo_benchmark_library(objfile_out
+        MODULE_PATH "${module_name_path}"
+        SOURCE_DIR "${srcdir}"
+        OBJECT_DIR "${objdir}"
+        SOURCES ${${module_name}_sources}
+        LIBRARY_FLAGS ${common_options} ${bench_flags}
+        DEPENDS ${bench_library_objects} ${stdlib_dependencies})
+      precondition(objfile_out)
       list(APPEND SWIFT_BENCH_OBJFILES "${objfile}")
-      set(sources)
-      foreach(source ${${module_name}_sources})
-        list(APPEND sources "${srcdir}/${source}")
-      endforeach()
-      add_custom_command(
-          OUTPUT "${objfile}"
-          DEPENDS
-            ${stdlib_dependencies} ${bench_library_objects} ${sources}
-          COMMAND "${SWIFT_EXEC}"
-          ${common_options}
-          ${bench_flags}
-          "-parse-as-library"
-          "-emit-module" "-module-name" "${module_name}"
-          "-I" "${objdir}"
-          "-o" "${objfile}"
-          ${sources})
     else()
-
-      # No whole-module-compilation or multi-threaded compilation.
-      # There is an output object file for each input file. We have to write
-      # an output-map-file to specify the output object file names.
-      set(sources)
-      set(objfiles)
-      set(json "{\n")
-      foreach(source ${${module_name}_sources})
-          list(APPEND sources "${srcdir}/${source}")
-
-          get_filename_component(basename "${source}" NAME_WE)
-          set(objfile "${objdir}/${module_name}/${basename}.o")
-
-              string(CONCAT json "${json}"
-    "  \"${srcdir}/${source}\": { \"object\": \"${objfile}\" },\n")
-
-          list(APPEND objfiles "${objfile}")
-          list(APPEND SWIFT_BENCH_OBJFILES "${objfile}")
-      endforeach()
-      string(CONCAT json "${json}" "}")
-      file(WRITE "${objdir}/${module_name}/outputmap.json" ${json})
-
-      add_custom_command(
-          OUTPUT ${objfiles}
-          DEPENDS
-            ${stdlib_dependencies} ${bench_library_objects} ${sources}
-          COMMAND "${SWIFT_EXEC}"
-          ${common_options}
-          ${bench_flags}
-          "-parse-as-library"
-          "-emit-module-path" "${objdir}/${module_name}.swiftmodule"
-          "-module-name" "${module_name}"
-          "-I" "${objdir}"
-          "-output-file-map" "${objdir}/${module_name}/outputmap.json"
-          ${sources})
+      add_swift_multisource_nonwmo_benchmark_library(objfiles_out
+        MODULE_PATH "${module_name_path}"
+        SOURCE_DIR "${srcdir}"
+        OBJECT_DIR "${objdir}"
+        SOURCES ${${module_name}_sources}
+        LIBRARY_FLAGS ${common_options} ${bench_flags}
+        DEPENDS ${bench_library_objects} ${stdlib_dependencies})
+      precondition(objfiles_out)
+      list(APPEND SWIFT_BENCH_OBJFILES ${objfiles_out})
     endif()
   endforeach()


Backport compile failure tests to travis' cmake version

--- cmake/modules/VisionarayCompileFailureTest.cmake
+++ cmake/modules/VisionarayCompileFailureTest.cmake
@@ -9,27 +9,41 @@
 #
 # visionaray_test_compile_success can be used to test a reference code.

-macro(visionaray_test_compile_failure FILENAME TESTNAME)
+function(visionaray_test_compile_failure FILENAME TESTNAME)
     add_executable(cft_${TESTNAME} ${FILENAME})
     set_target_properties(cft_${TESTNAME} PROPERTIES
                           EXCLUDE_FROM_ALL TRUE
                           EXCLUDE_FROM_DEFAULT_BUILD TRUE)
-    target_compile_definitions(cft_${TESTNAME} PRIVATE ${ARGN})
+
+    # Get old compile definitions, concatenate with given arguments
+    get_property(ORIGINAL_COMPILE_DEFINITIONS TARGET cft_${TESTNAME} PROPERTY COMPILE_DEFINITIONS)
+    set(NEW_COMPILE_DEFINITIONS ${ORIGINAL_COMPILE_DEFINITIONS} ${ARGN})
+    set_target_properties(cft_${TESTNAME} PROPERTIES
+        "COMPILE_DEFINITIONS" "${NEW_COMPILE_DEFINITIONS}"
+    )
+
     add_test(NAME ${TESTNAME}
              COMMAND ${CMAKE_COMMAND} --build . --target cft_${TESTNAME} --config $<CONFIGURATION>
              WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
     set_tests_properties(${TESTNAME} PROPERTIES WILL_FAIL TRUE)
-endmacro()
+endfunction()

-macro(visionaray_test_compile_success FILENAME TESTNAME)
+function(visionaray_test_compile_success FILENAME TESTNAME)
     add_executable(cft_${TESTNAME} ${FILENAME})
     set_target_properties(cft_${TESTNAME} PROPERTIES
                           EXCLUDE_FROM_ALL TRUE
                           EXCLUDE_FROM_DEFAULT_BUILD TRUE)
-    target_compile_definitions(cft_${TESTNAME} PRIVATE ${ARGN})
+
+    # Get old compile definitions, concatenate with given arguments
+    get_property(ORIGINAL_COMPILE_DEFINITIONS TARGET cft_${TESTNAME} PROPERTY COMPILE_DEFINITIONS)
+    set(NEW_COMPILE_DEFINITIONS ${ORIGINAL_COMPILE_DEFINITIONS} ${ARGN})
+    set_target_properties(cft_${TESTNAME} PROPERTIES
+        "COMPILE_DEFINITIONS" "${NEW_COMPILE_DEFINITIONS}"
+    )
+
     add_test(NAME ${TESTNAME}
              COMMAND ${CMAKE_COMMAND} --build . --target cft_${TESTNAME} --config $<CONFIGURATION>
              WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
-endmacro()
+endfunction()


use "Groonga" form

use "Groonga" form

--- config.h.cmake
+++ config.h.cmake
@@ -14,7 +14,7 @@
 #define PACKAGE_URL          "${PACKAGE_URL}"
 #define PACKAGE_VERSION      "${VERSION}"

-/* groonga related constants */
+/* Groonga related constants */
 #define GRN_CONFIG_PATH      "${GRN_CONFIG_PATH}"
 #define GRN_LOG_PATH         "${GRN_LOG_PATH}"
 #define GRN_VERSION          "${GRN_VERSION}"


zero out ao arrays at entry to ao eval lib

--- cmake/custom/balboa.cmake
+++ cmake/custom/balboa.cmake
@@ -4,7 +4,7 @@
     balboa
     PREFIX "${PROJECT_BINARY_DIR}/balboa"
     GIT_REPOSITORY https://github.com/bast/balboa.git
-    GIT_TAG b7fc688e890ad728e07d505802eedbaf54a1ad9e
+    GIT_TAG 3a761627e07a2df57bdb991fefb49b81136d26a8
     INSTALL_COMMAND true  # currently no install command
     CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
     )


Upgrade ONNX to 1.6 version. (#4244)

Upgrade ONNX to 1.6 version. (#4244)

Co-authored-by: aslepko <9e299a1527b0bd3517f664f5453026effb78217d@users.noreply.github.com>


WL#5665: Removal of the autotools-based build system  - Make the cmake files depend on VERSION, causing    cmake rerun when VERSION changes

--- cmake/mysql_version.cmake
+++ cmake/mysql_version.cmake
@@ -21,17 +21,21 @@
 SET(PROTOCOL_VERSION "10")
 SET(DOT_FRM_VERSION "6")

+# Generate "something" to trigger cmake rerun when VERSION changes
+CONFIGURE_FILE(
+  ${CMAKE_SOURCE_DIR}/VERSION
+  ${CMAKE_BINARY_DIR}/VERSION.dep
+)
+
 # Read value for a variable from VERSION.

 MACRO(MYSQL_GET_CONFIG_VALUE keyword var)
  IF(NOT ${var})
-   IF (EXISTS ${CMAKE_SOURCE_DIR}/VERSION)
-     FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
-    IF(str)
-      STRING(REPLACE "${keyword}=" "" str ${str})
-      STRING(REGEX REPLACE  "[ ].*" ""  str "${str}")
-      SET(${var} ${str})
-    ENDIF()
+   FILE (STRINGS ${CMAKE_SOURCE_DIR}/VERSION str REGEX "^[ ]*${keyword}=")
+   IF(str)
+     STRING(REPLACE "${keyword}=" "" str ${str})
+     STRING(REGEX REPLACE  "[ ].*" ""  str "${str}")
+     SET(${var} ${str})
    ENDIF()
  ENDIF()
 ENDMACRO()


comment out symserver integration

comment out symserver integration

--- cmake/packages/nsis.cmake
+++ cmake/packages/nsis.cmake
@@ -111,12 +111,13 @@

 list(APPEND CLEAN_PACKAGES_LIST remove_packages)

-set(SYMSRVDIR $ENV{SYMSRV})
-if (NOT ${SYMSRVDIR} STREQUAL "")
-  message("Storing symbols:")
-  include(../../arangod/CMakeList.txt)
-  add_custom_command(TARGET ${BIN_ARANGOD} POST_BUILD
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-    COMMAND "find -name \\*pdb |grep -v Release |grep -v Debug |grep -v 3rdParty |grep -v vc120.pdb  > pdbfiles_list.txt"
-    COMMAND "symstore.exe add /f '@${PROJECT_BINARY_DIR}/pdbfiles_list.txt' /s '${SYMSRVDIR}' /t ArangoDB /compress")
-endif()
+# set(SYMSRVDIR $ENV{SYMSRV})
+# if (NOT ${SYMSRVDIR} STREQUAL "")
+#
+#   message("Storing symbols:")
+#   include(../../arangod/CMakeList.txt)
+#   add_custom_command(TARGET ${BIN_ARANGOD} POST_BUILD
+#     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+#     COMMAND "find -name \\*pdb |grep -v Release |grep -v Debug |grep -v 3rdParty |grep -v vc120.pdb  > pdbfiles_list.txt"
+#     COMMAND "symstore.exe add /f '@${PROJECT_BINARY_DIR}/pdbfiles_list.txt' /s '${SYMSRVDIR}' /t ArangoDB /compress")
+# endif()


qibuild: do not hide deprecated warnings

Change-Id: I6d97fd72805a6be7997bbb102700f2f09d5037b5
Reviewed-on: http://gerrit.aldebaran.lan/21148
Tested-by: gerrit
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/flags.cmake
+++ cmake/qibuild/flags.cmake
@@ -30,9 +30,6 @@

     # Do not produce warnings when not using _s functions
     add_definitions("-D_CRT_SECURE_NO_DEPRECATE")
-
-    # Do not produce warnings when using POSIX functions
-    add_definitions("/wd4996")

     # Activate warnings
     # note that wchar.h causes warnings when using /Wall or /W4 ...
@@ -78,4 +75,3 @@
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" CACHE INTERNAL "" FORCE)
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" CACHE INTERNAL "" FORCE)
 endif()
-


cmake: qi_add_test: add DYLD_FRAMEWORK_PATH, too

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -43,7 +43,7 @@
   # HACK for apple until the .dylib problems are fixed...
   if(APPLE)
     set_tests_properties(${test_name} PROPERTIES
-      ENVIRONMENT "DYLD_LIBRARY_PATH=${QI_SDK_DIR}/${QI_SDK_LIB}"
+      ENVIRONMENT "DYLD_LIBRARY_PATH=${QI_SDK_DIR}/${QI_SDK_LIB} DYLD_FRAMEWORK_PATH=${QI_SDK_DIR}"
     )
   endif()
 endfunction()


editing description of SALOME_GUI_MODE() macro

--- adm_local/cmake_files/FindSalomeGUI.cmake
+++ adm_local/cmake_files/FindSalomeGUI.cmake
@@ -65,12 +65,20 @@
 #   _options [input] List - The list of CMake options given to SALOME GUI
 #
 # Notes:
-# The arguments list can include "OPTIONAL" keywords:
-#  * All arguments preceded by "OPTIONAL" keyword are mandatory for current module.
-#    If GUI module was compiled without this functionality, further installation
-#    of the current module becomes impossible.
-#  * All arguments following "OPTIONAL" keyword are optional for current module, which
-#    uses this functionality, but can be installed without it.
+# - The arguments list can include "OPTIONAL" keywords:
+#   * All arguments preceded by "OPTIONAL" keyword are mandatory for current module.
+#     If GUI module was compiled without this functionality, further installation
+#     of the current module becomes impossible.
+#   * All arguments following "OPTIONAL" keyword are optional for current module, which
+#     uses this functionality, but can be installed without it.
+#
+# - At present there are next options in the GUI module:
+#   SALOME_USE_OCCVIEWER, SALOME_USE_VTKVIEWER, SALOME_USE_GLVIEWER, SALOME_USE_PLOT2DVIEWER,
+#   SALOME_USE_GRAPHICSVIEW, SALOME_USE_QXGRAPHVIEWER, SALOME_USE_PVVIEWER, SALOME_USE_PYVIEWER,
+#   SALOME_USE_PYCONSOLE, SALOME_USE_SALOMEOBJECT
+#
+# Example of usage:
+#   SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_SALOMEOBJECT OPTIONAL SALOME_USE_PYCONSOLE)
 #
 MACRO(SALOME_GUI_MODE)
   MESSAGE(STATUS "")


Error fixed in AutoVersioning when no .git is found

--- cmake/AutoVersioning.cmake
+++ cmake/AutoVersioning.cmake
@@ -40,7 +40,8 @@
   endif()

   # Check if has not commited changes
-  execute_process(COMMAND git update-index -q --refresh)
+  execute_process(COMMAND git update-index -q --refresh
+                  ERROR_QUIET)
   execute_process(COMMAND git diff-index --name-only HEAD --
                   OUTPUT_VARIABLE CHANGED_SOURCE
                   OUTPUT_STRIP_TRAILING_WHITESPACE


Fix ENDFOREACH

Fix ENDFOREACH

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -100,7 +100,7 @@
         ENDIF ()
       ENDIF ()
       ADD_DEFINITIONS("-D${_definition}")
-    ENDIF ()
+    ENDFOREACH ()
   ENDIF ()
   #
   # Prepare output directories


Attempt to fix setting MSVC runtime for sub-build.

--- cmake/external_rules.cmake
+++ cmake/external_rules.cmake
@@ -156,11 +156,19 @@
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MTd")
         set(CMAKE_SUB_CONFIGURE_OPTIONS
             ${CMAKE_SUB_CONFIGURE_OPTIONS}
+            -DCMAKE_C_FLAGS_RELEASE="/MT"
+            -DCMAKE_C_FLAGS_DEBUG="/MTd"
+            -DCMAKE_CXX_FLAGS_RELEASE="/MT"
+            -DCMAKE_CXX_FLAGS_DEBUG="/MTd"
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug)
       else()
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MDd")
         set(CMAKE_SUB_CONFIGURE_OPTIONS
             ${CMAKE_SUB_CONFIGURE_OPTIONS}
+            -DCMAKE_C_FLAGS_RELEASE="/MD"
+            -DCMAKE_C_FLAGS_DEBUG="/MDd"
+            -DCMAKE_CXX_FLAGS_RELEASE="/MD"
+            -DCMAKE_CXX_FLAGS_DEBUG="/MDd"
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL)
       endif()
     else()
@@ -169,11 +177,19 @@
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MT")
         set(CMAKE_SUB_CONFIGURE_OPTIONS
             ${CMAKE_SUB_CONFIGURE_OPTIONS}
+            -DCMAKE_C_FLAGS_RELEASE="/MT"
+            -DCMAKE_C_FLAGS_DEBUG="/MTd"
+            -DCMAKE_CXX_FLAGS_RELEASE="/MT"
+            -DCMAKE_CXX_FLAGS_DEBUG="/MTd"
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded)
       else()
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MD")
         set(CMAKE_SUB_CONFIGURE_OPTIONS
-            ${CMAKE_SUB_CONFIGURE_OPTIONS}
+            ${CMAKE_SUB_CONFIGURE_OPTIONS}
+            -DCMAKE_C_FLAGS_RELEASE="/MD"
+            -DCMAKE_C_FLAGS_DEBUG="/MDd"
+            -DCMAKE_CXX_FLAGS_RELEASE="/MD"
+            -DCMAKE_CXX_FLAGS_DEBUG="/MDd"
             -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL)
       endif()
     endif()


removed test_command from lemon (tests fail to build with gcc4.7+

--- lemon.cmake
+++ lemon.cmake
@@ -44,7 +44,8 @@

     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make
     INSTALL_COMMAND     ${BUILDEM_ENV_STRING} make install
-    TEST_COMMAND        ${BUILDEM_ENV_STRING} make check
+    # checks fail to build with gcc4.7+
+    TEST_COMMAND        "" # ${BUILDEM_ENV_STRING} make check
 )

 set_target_properties(${lemon_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)


Fix for Win32 linking w/ shared boost libraries

--- Common.cmake
+++ Common.cmake
@@ -68,7 +68,7 @@
 if(BOOST_ROOT)
   set(Boost_NO_SYSTEM_PATHS TRUE)
 endif()
-add_definitions(-DBOOST_ALL_NO_LIB) # Don't use 'pragma lib' on Windows
+add_definitions(-DBOOST_ALL_NO_LIB -DBOOST_ALL_DYN_LINK) # Don't use 'pragma lib' on Windows

 include(TestBigEndian)
 test_big_endian(BIGENDIAN)


CMake: Remove a compatibility check

CMake: Remove a compatibility check

This check is not relevant any more. See #4964

Further, it is a good idea anyway to trim our compatibility checks a
bit...

--- cmake/checks/check_03_generator_bugs.cmake
+++ cmake/checks/check_03_generator_bugs.cmake
@@ -1,33 +0,0 @@
-## ---------------------------------------------------------------------
-##
-## Copyright (C) 2013 - 2014 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE at
-## the top level of the deal.II distribution.
-##
-## ---------------------------------------------------------------------
-
-
-#
-# CMakes Ninja generator is currently incompatible with everything but gcc
-# and clang.
-#
-# - Matthias Maier, 2013
-#
-
-IF( CMAKE_GENERATOR MATCHES "Ninja" AND NOT
-    ( CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR
-      CMAKE_CXX_COMPILER_ID MATCHES "Clang"  ) )
-  MESSAGE(FATAL_ERROR "\n"
-    "Error!\n"
-    "The CMAKE_GENERATOR \"${CMAKE_GENERATOR}\" "
-    "currently only supports the GNU and Clang C++ compilers, but "
-    "\"${CMAKE_CXX_COMPILER_ID}\" was found.\n\n"
-    )
-ENDIF()


Fix for Windows, patch for VTK wasn't applying because of whitespace differences...

--- cmake/externals/projects_modules/VTK.cmake
+++ cmake/externals/projects_modules/VTK.cmake
@@ -87,7 +87,7 @@
 set(VTK_PATCHES VTK_WindowLevel.patch)
 set(VTK_PATCHES_TO_APPLY)
 foreach (patch ${VTK_PATCHES})
-    execute_process(COMMAND git apply --check ${CMAKE_SOURCE_DIR}/patches/${patch}
+    execute_process(COMMAND git apply --ignore-whitespace --check ${CMAKE_SOURCE_DIR}/patches/${patch}
                     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/VTK
                     RESULT_VARIABLE   PATCH_OK
                     OUTPUT_QUIET
@@ -99,7 +99,7 @@

 set(VTK_PATCH_COMMAND)
 if (NOT "${VTK_PATCHES_TO_APPLY}" STREQUAL "")
-    set(VTK_PATCH_COMMAND git apply ${VTK_PATCHES_TO_APPLY})
+    set(VTK_PATCH_COMMAND git apply --ignore-whitespace ${VTK_PATCHES_TO_APPLY})
 endif()

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


not setting TBB vars to NOT-FOUND when TBB_ROOT set to empty string

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -19,9 +19,6 @@
     DOC "Root of TBB installation"
     PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
   )
-  SET(TBB_INCLUDE_DIR TBB_INCLUDE_DIR-NOTFOUND)
-  SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
-  SET(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)

   IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET(TBB_ARCH intel64)
@@ -40,9 +37,18 @@
   SET(TBB_LIBDIR ${TBB_ROOT}/lib/${TBB_ARCH}/${TBB_VCVER})
   SET(TBB_BINDIR ${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER})

-  FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
-  FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
-  FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
+  IF (TBB_ROOT STREQUAL "")
+    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
+    FIND_LIBRARY(TBB_LIBRARY tbb)
+    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)
+  ELSE()
+    SET(TBB_INCLUDE_DIR TBB_INCLUDE_DIR-NOTFOUND)
+    SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
+    SET(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
+    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
+    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
+    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_LIBDIR} NO_DEFAULT_PATH)
+  ENDIF()

 ELSE ()

@@ -50,31 +56,26 @@
     DOC "Root of TBB installation"
     PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/composerxe/tbb
   )
-  SET(TBB_INCLUDE_DIR TBB_INCLUDE_DIR-NOTFOUND)
-  SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
-  SET(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
-
-  SET(TBB_INCLUDE_DIR_MIC TBB_INCLUDE_DIR_MIC-NOTFOUND)
-  SET(TBB_LIBRARY_MIC TBB_LIBRARY_MIC-NOTFOUND)
-  SET(TBB_LIBRARY_MALLOC_MIC TBB_LIBRARY_MALLOC_MIC-NOTFOUND)
-
-  IF (APPLE)
-    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+
+  IF (TBB_ROOT STREQUAL "")
+    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
+    FIND_LIBRARY(TBB_LIBRARY tbb)
+    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)
   ELSE()
-    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib/intel64/gcc4.4 ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib/intel64/gcc4.4 ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 NO_DEFAULT_PATH)
+    SET(TBB_INCLUDE_DIR TBB_INCLUDE_DIR-NOTFOUND)
+    SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)
+    SET(TBB_LIBRARY_MALLOC TBB_LIBRARY_MALLOC-NOTFOUND)
+    IF (APPLE)
+      FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
+      FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+      FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
+    ELSE()
+      FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
+      FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib/intel64/gcc4.4 ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 NO_DEFAULT_PATH)
+      FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib/intel64/gcc4.4 ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 NO_DEFAULT_PATH)
+    ENDIF()
   ENDIF()

-#  FIND_PATH(TBB_INCLUDE_DIR_MIC tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
-#  FIND_LIBRARY(TBB_LIBRARY_MIC tbb PATHS ${TBB_ROOT}/lib/mic NO_DEFAULT_PATH)
-#  FIND_LIBRARY(TBB_LIBRARY_MALLOC_MIC tbbmalloc PATHS ${TBB_ROOT}/lib/mic NO_DEFAULT_PATH)
-
-#  MARK_AS_ADVANCED(TBB_INCLUDE_DIR_MIC)
-#  MARK_AS_ADVANCED(TBB_LIBRARY_MIC)
-#  MARK_AS_ADVANCED(TBB_LIBRARY_MALLOC_MIC)
 ENDIF()

 INCLUDE(FindPackageHandleStandardArgs)
@@ -83,12 +84,6 @@
 IF (TBB_FOUND)
   SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
   SET(TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_LIBRARY_MALLOC})
-ENDIF()
-
-IF (TBB_INCLUDE_DIR AND TBB_LIBRARY_MIC AND TBB_LIBRARY_MALLOC_MIC)
-  SET(TBB_FOUND_MIC TRUE)
-  SET(TBB_INCLUDE_DIRS_MIC ${TBB_INCLUDE_DIR_MIC})
-  SET(TBB_LIBRARIES_MIC ${TBB_LIBRARY_MIC} ${TBB_LIBRARY_MALLOC_MIC})
 ENDIF()

 MARK_AS_ADVANCED(TBB_INCLUDE_DIR)


update call signature to regression test python script

--- reg_tests/CTestList.cmake
+++ reg_tests/CTestList.cmake
@@ -5,7 +5,7 @@
 # Standard regression test
 function(add_test_r testname )
   add_test(
-    ${testname} python ${CMAKE_CURRENT_SOURCE_DIR}/executeRegressionTestCase.py ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${testname} ${TOLERANCE} ${CMAKE_SYSTEM_NAME} ${CMAKE_Fortran_COMPILER_ID}
+    ${testname} python ${CMAKE_CURRENT_SOURCE_DIR}/executeRegressionTestCase.py ${testname} ${CMAKE_BINARY_DIR}/glue-codes/fast/openfast ${CMAKE_SOURCE_DIR} ${TOLERANCE} ${CMAKE_SYSTEM_NAME} ${CMAKE_Fortran_COMPILER_ID}
   )
   # limit each test to ~15 minutes: 1000s
   set_tests_properties(${testname} PROPERTIES TIMEOUT 1000 WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" LABELS "regression")


COMP: Correct typo in CMake variable name

--- DTIReg.cmake
+++ DTIReg.cmake
@@ -48,7 +48,7 @@
 GenerateCLP(DTIReg_SOURCE DTI-Reg.xml)

 add_executable( DTI-Reg ${DTIReg_SOURCE} )
-target_link_libraries(DTI-Reg ${ITK_LIBRARIES} ${BatchMak_LIBRARIES})
+target_link_libraries(DTI-Reg ${ITK_LIBRARIES} ${BatchMake_LIBRARIES})

 install(TARGETS DTI-Reg DESTINATION ${INSTALL_RUNTIME_DESTINATION} )


Fix private plugins integration in package on windows

--- packaging/windows/WindowsPackaging.cmake
+++ packaging/windows/WindowsPackaging.cmake
@@ -65,9 +65,12 @@
 	Delete '\$SMPROGRAMS\\\\$MUI_TEMP\\\\*.*'
 ")

-file(TO_CMAKE_PATH PRIVATE_PLUGINS_DIRS PRIVATE_PLUGINS_DIRS)
 if (NOT PRIVATE_PLUGINS_DIRS STREQUAL "")
-    foreach(pluginpath ${PRIVATE_PLUGINS_DIRS})
+    foreach(pluginpath ${PRIVATE_PLUGINS_DIRS})
+        file(TO_CMAKE_PATH ${pluginpath} pluginpath)
+# Add an extra slash, otherwise we copy the folder, not its content
+        set(pluginpath "${pluginpath}/")
+    	message("Adding ${pluginpath} to the private plugins dirs...")
         install(DIRECTORY ${pluginpath} DESTINATION plugins COMPONENT Runtime FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}")
     endforeach()
 endif()


Fixed OgreInstallDependencies.cmake to only install the CG.dll if OGRE_BUILD_PLUGIN_CG is on

--HG--
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/trunk%401265

--- Dependencies/OgreInstallDependencies.cmake
+++ Dependencies/OgreInstallDependencies.cmake
@@ -42,29 +42,39 @@

   # copy the dependency DLLs to the right places
   install(FILES
+    ${OGRE_DEP_BIN_DIR}/debug/OIS_d.dll
+	  DESTINATION bin/debug CONFIGURATIONS Debug
+  )
+  install(FILES
+    ${OGRE_DEP_BIN_DIR}/release/OIS.dll
+	  DESTINATION bin/release CONFIGURATIONS Release None ""
+  )
+  install(FILES
+    ${OGRE_DEP_BIN_DIR}/release/OIS.dll
+	  DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
+  )
+  install(FILES
+    ${OGRE_DEP_BIN_DIR}/release/OIS.dll
+	  DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
+  )
+  if (OGRE_BUILD_PLUGIN_CG)
+  install(FILES
     ${OGRE_DEP_BIN_DIR}/debug/cg.dll
-    ${OGRE_DEP_BIN_DIR}/debug/OIS_d.dll
-    ${OGRE_DEP_BIN_DIR}/debug/libgles_cm.dll
 	  DESTINATION bin/debug CONFIGURATIONS Debug
   )
   install(FILES
     ${OGRE_DEP_BIN_DIR}/release/cg.dll
-    ${OGRE_DEP_BIN_DIR}/release/OIS.dll
-    ${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
 	  DESTINATION bin/release CONFIGURATIONS Release None ""
   )
   install(FILES
     ${OGRE_DEP_BIN_DIR}/release/cg.dll
-    ${OGRE_DEP_BIN_DIR}/release/OIS.dll
-    ${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
 	  DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
   )
   install(FILES
     ${OGRE_DEP_BIN_DIR}/release/cg.dll
-    ${OGRE_DEP_BIN_DIR}/release/OIS.dll
-    ${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
 	  DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
   )
+  endif ()

   # install GLES dlls
   if (OGRE_BUILD_RENDERSYSTEM_GLES)
@@ -88,17 +98,17 @@
 endif ()

 # copy the required DLLs to the build directory (configure_file is the only copy-like op I found in CMake)
-configure_file(${OGRE_DEP_BIN_DIR}/debug/cg.dll ${OGRE_BINARY_DIR}/bin/debug/cg.dll COPYONLY)
 configure_file(${OGRE_DEP_BIN_DIR}/debug/OIS_d.dll ${OGRE_BINARY_DIR}/bin/debug/OIS_d.dll COPYONLY)
+configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/release/OIS.dll COPYONLY)
+configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/OIS.dll COPYONLY)
+configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/minsizerel/OIS.dll COPYONLY)

-configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/release/cg.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/release/OIS.dll COPYONLY)
-
-configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/cg.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/OIS.dll COPYONLY)
-
-configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/minsizerel/cg.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/minsizerel/OIS.dll COPYONLY)
+if (OGRE_BUILD_PLUGIN_CG)
+	configure_file(${OGRE_DEP_BIN_DIR}/debug/cg.dll ${OGRE_BINARY_DIR}/bin/debug/cg.dll COPYONLY)
+	configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/release/cg.dll COPYONLY)
+	configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/cg.dll COPYONLY)
+	configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/minsizerel/cg.dll COPYONLY)
+endif ()

 if (OGRE_BUILD_RENDERSYSTEM_GLES)
 	configure_file(${OGRE_DEP_BIN_DIR}/debug/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/debug/libgles_cm.dll COPYONLY)


Make FindDRM.cmake saner.

Make FindDRM.cmake saner.

--- CMake/FindDRM.cmake
+++ CMake/FindDRM.cmake
@@ -1,66 +1,35 @@
-############################################################################
+# Find DRM and friends
 #
-# Copyright 2010, 2011 BMW Car IT GmbH
-# Copyright (C) 2011 DENSO CORPORATION and Robert Bosch Car Multimedia Gmbh
+# DRM_INCLUDE_DIR
+# DRM_LIBRARIES
+# DRM_FOUND
 #
+# GBM_INCLUDE_DIR
+# GBM_LIBRARIES
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-############################################################################
+# UDEV_INCLUDE_DIR
+# UDEV_LIBRARIES

-FIND_PATH(UDEV_INCLUDE_DIR /libudev.h
-/usr/include
-)
+FIND_PATH(UDEV_INCLUDE_DIR libudev.h)

-FIND_LIBRARY(UDEV_LIBRARIES
-NAMES udev
-PATHS /usr/lib
-)
+FIND_LIBRARY(UDEV_LIBRARIES NAMES udev)

-FIND_PATH(GBM_INCLUDE_DIR /gbm.h
-/usr/include
-)
+FIND_PATH(GBM_INCLUDE_DIR gbm.h)

-FIND_LIBRARY(GBM_LIBRARIES
-NAMES gbm
-PATHS /usr/lib
-)
+FIND_LIBRARY(GBM_LIBRARIES NAMES gbm)

-FIND_PATH(DRM_INCLUDE_DIR /drm.h
-/usr/include/libdrm /usr/include/drm
-)
+FIND_PATH(DRM_INCLUDE_DIR NAMES drm.h PATH_SUFFIXES libdrm)

-FIND_LIBRARY(DRM_LIBRARIES
-NAMES drm
-PATHS /usr/lib
-)
+FIND_LIBRARY(DRM_LIBRARIES NAMES drm)

-SET( DRM_FOUND "NO" )
-IF(UDEV_LIBRARIES AND GBM_LIBRARIES AND DRM_LIBRARIES)
-    SET( DRM_FOUND "YES" )
-    message(STATUS "Found udev libs: ${UDEV_LIBRARIES}")
-    message(STATUS "Found udev includes: ${UDEV_INCLUDE_DIR}")
-    message(STATUS "Found gbm libs: ${GBM_LIBRARIES}")
-    message(STATUS "Found gbm includes: ${GBM_INCLUDE_DIR}")
-    message(STATUS "Found drm includes: ${DRM_INCLUDE_DIR}")
-    message(STATUS "Found drm libs: ${DRM_LIBRARIES}")
-ENDIF(UDEV_LIBRARIES AND GBM_LIBRARIES AND DRM_LIBRARIES)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(DRM DEFAULT_MSG UDEV_INCLUDE_DIR UDEV_LIBRARIES GBM_INCLUDE_DIR GBM_LIBRARIES DRM_INCLUDE_DIR DRM_LIBRARIES)

-MARK_AS_ADVANCED(
-  UDEV_INCLUDE_DIR
-  UDEV_LIBRARIES
-  GBM_INCLUDE_DIR
-  GBM_LIBRARIES
-  DRM_INCLUDE_DIR
-  DRM_LIBRARIES
-)
+IF (DRM_FOUND)
+  message(STATUS "Found udev libs: ${UDEV_LIBRARIES}")
+  message(STATUS "Found udev includes: ${UDEV_INCLUDE_DIR}")
+  message(STATUS "Found gbm libs: ${GBM_LIBRARIES}")
+  message(STATUS "Found gbm includes: ${GBM_INCLUDE_DIR}")
+  message(STATUS "Found drm includes: ${DRM_INCLUDE_DIR}")
+  message(STATUS "Found drm libs: ${DRM_LIBRARIES}")
+ENDIF (DRM_FOUND)


build: bump version number

build: bump version number

--- CMake/version.cmake
+++ CMake/version.cmake
@@ -1,3 +1,3 @@
 set (VV_VERSION_MAJOR 2)
-set (VV_VERSION_MINOR 0)
-set (VV_VERSION_PATCH 0)
+set (VV_VERSION_MINOR 5)
+set (VV_VERSION_PATCH 1)


CMake: it is now ok to work on no branch.
We suppose we are on "master" kind branch.

	* build-aux/cmake/modules/ProjectInfo.cmake: .

--- build-aux/cmake/modules/ProjectInfo.cmake
+++ build-aux/cmake/modules/ProjectInfo.cmake
@@ -37,10 +37,6 @@

     git_current_branch(branch)
     message(STATUS "Project branch: ${branch}")
-    if(branch STREQUAL "(no branch)")
-      message(SEND_ERROR "project_describe_info: cannot extract information from no branch.")
-      return()
-    endif(branch STREQUAL "(no branch)")
     git_describe(HEAD desc --match "[0-9]*")
     if(desc STREQUAL NOTFOUND)
       set(desc "0.0")
@@ -74,9 +70,11 @@
     set(patch -1 PARENT_SCOPE)

     # Are we are on master branch?
+    # For now suppose no branch is a master branch
     if(branch MATCHES "^master$"
 	OR branch MATCHES "^candidates/.*$"
-	OR branch MATCHES "^perso/.*$")
+	OR branch MATCHES "^perso/.*$"
+        OR branch MATCHES "(no branch)")
       message(STATUS "Project on the master branch.")
       set(ver1_rx "^${ver_base_rx}$")
       set(ver2_rx "^${ver_base_rx}-(.*)-([0-9]+)$")


PackageConfig: Fix status output

PackageConfig: Fix status output

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -63,8 +63,6 @@

 set(_config_file_body
 # reset before using them
-  "set(_output_type)\n"
-  "set(_out)\n"
   "set(_req)\n"
   "set(_quiet)\n"
   "set(_fail)\n"
@@ -77,6 +75,18 @@
   "\n"
   "@DEPENDENTS@" # add dependent library finding
   "set(${UPPER_PROJECT_NAME}_FIND_FILES ${${UPPER_PROJECT_NAME}_FIND_FILES})\n"
+# (re)set output type after running dependents (which have different settings)
+  "set(_output_type)\n"
+  "set(_out)\n"
+  "if(${PROJECT_NAME}_FIND_REQUIRED)\n"
+  "  set(_output_type FATAL_ERROR)\n"
+  "  set(_out 1)\n"
+  "else()\n"
+  "  set(_output_type STATUS)\n"
+  "  if(NOT ${PROJECT_NAME}_FIND_QUIETLY)\n"
+  "    set(_out 1)\n"
+  "  endif()\n"
+  "endif()\n"
 )

 set(_config_file_standard_find
@@ -268,14 +278,7 @@
 # 1. set the search mode for the dependent projects [ required | optional ]
 set(DEPENDENTS
   "if(${PROJECT_NAME}_FIND_REQUIRED)\n"
-  "  set(_output_type FATAL_ERROR)\n"
-  "  set(_out 1)\n"
   "  set(_req REQUIRED)\n"
-  "else()\n"
-  "  set(_output_type STATUS)\n"
-  "  if(NOT ${PROJECT_NAME}_FIND_QUIETLY)\n"
-  "    set(_out 1)\n"
-  "  endif()\n"
   "endif()\n"
   "if(${PROJECT_NAME}_FIND_QUIETLY)\n"
   "  set(_quiet QUIET)\n"


add gtest dependencies for the target if necessary

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -589,6 +589,7 @@
       if (NOT EXISTS "${CMAKE_BINARY_DIR}/_gtest_from_src")
         # for now, this would only work on Ubuntu
         add_subdirectory("/usr/src/gtest/" ${CMAKE_BINARY_DIR}/_gtest_from_src)
+        add_dependencies(${exe} gtest gtest_main)
       endif()
     else()
       message(WARNING "GTest not found; C++ tests will fail to build.")


ADD primitive test to check if exec windows dependancies installer is needed in continous build

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3500 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/openVibeTests.cmake
+++ test/openVibeTests.cmake
@@ -87,11 +87,16 @@
 set(CTEST_UPDATE_COMMAND               "${CTEST_SVN_COMMAND}")

-
+SET(NEED_CONFIGURE TRUE)
 IF(WIN32)
 	## -- Configure Command
+	IF(${MODEL} MATCHES Continuous)
+		IF(EXISTS "${CTEST_SOURCE_DIRECTORY}/dependencies/Uninstall.exe")
+			SET(NEED_CONFIGURE FALSE)
+		ENDIF(EXISTS "${CTEST_SOURCE_DIRECTORY}/dependencies/Uninstall.exe")
+	ENDIF(${MODEL} MATCHES Continuous)
 	set(CTEST_CONFIGURE_COMMAND            "${CTEST_SOURCE_DIRECTORY}/scripts/win32-install_dependencies.exe /S")
-
+
 	## -- Build Command
 	set(CTEST_BUILD_COMMAND                "cmd /C \"win32-build.cmd --no-pause\"")
 ELSE(WIN32)
@@ -147,45 +152,47 @@
 message(" -- Start dashboard ${MODEL} - ${CTEST_BUILD_NAME} --")
 ctest_start(${MODEL} TRACK ${MODEL})

-set(ALL_OK "TRUE")
+set(ALL_OK TRUE)

 ## -- Update
-IF(ALL_OK MATCHES "TRUE")
+IF(ALL_OK)
 	message(" -- Update ${MODEL} - ${CTEST_BUILD_NAME} --")
 	ctest_update( SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
 	IF(res==-1)
 		message(SEND_ERROR "  Update failed.")
-		set(ALL_OK "FALSE")
+		set(ALL_OK FALSE)
 	ENDIF(res==-1)
-ENDIF(ALL_OK MATCHES "TRUE")
+ENDIF(ALL_OK)

 ## -- Configure
-IF(ALL_OK MATCHES "TRUE")
-	message(" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
-	ctest_configure(BUILD  "${CTEST_SOURCE_DIRECTORY}/scripts" SOURCE "${CTEST_SOURCE_DIRECTORY}/scripts" RETURN_VALUE res)
-	IF(res!=0)
-		message(SEND_ERROR "  Configure failed.")
-		set(ALL_OK "FALSE")
-	ENDIF(res!=0)
-ENDIF(ALL_OK MATCHES "TRUE")
+IF(ALL_OK)
+	IF(NEED_CONFIGURE)
+		message(" -- Configure ${MODEL} - ${CTEST_BUILD_NAME} --")
+		ctest_configure(BUILD  "${CTEST_SOURCE_DIRECTORY}/scripts" SOURCE "${CTEST_SOURCE_DIRECTORY}/scripts" RETURN_VALUE res)
+		IF(res!=0)
+			message(SEND_ERROR "  Configure failed.")
+			set(ALL_OK FALSE)
+		ENDIF(res!=0)
+	ENDIF(NEED_CONFIGURE)
+ENDIF(ALL_OK)

 ## -- BUILD
-IF(ALL_OK MATCHES "TRUE")
+IF(ALL_OK)
 	message(" -- Build ${MODEL} - ${CTEST_BUILD_NAME} --")
 	ctest_build(BUILD  "${CTEST_SOURCE_DIRECTORY}/scripts" SOURCE "${CTEST_SOURCE_DIRECTORY}/scripts" RETURN_VALUE res)
 	IF(res!=0)
 		message(SEND_ERROR "  Build failed.")
-		set(ALL_OK "FALSE")
+		set(ALL_OK FALSE)
 	ENDIF(res!=0)
-ENDIF(ALL_OK MATCHES "TRUE")
+ENDIF(ALL_OK)

 ## -- TEST
-IF(ALL_OK MATCHES "TRUE")
+IF(ALL_OK)
 	message(" -- Test ${MODEL} - ${CTEST_BUILD_NAME} --")
 	set( $ENV{CTEST_BINARY_DIRECTORY}    "${CTEST_BINARY_DIRECTORY}" )
 	ctest_test(BUILD  "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
 	message(STATUS "  INFO : ctest_test(...) returned '${res}'")
-ENDIF(ALL_OK MATCHES "TRUE")
+ENDIF(ALL_OK)

 ## -- SUBMIT
 message(" -- Submit ${MODEL} - ${CTEST_BUILD_NAME} --")


Fix get_filename_component usage for CMake <2.8.11

Former-commit-id: 93d282bf52482368830181717690553157677a5c

--- PENCIL.cmake
+++ PENCIL.cmake
@@ -41,7 +41,7 @@
   endif()
   foreach(pencil_file ${COMPILE_PENCIL_FILES})
     get_filename_component(PENCIL_FILE_NAME ${pencil_file} NAME_WE)
-    get_filename_component(PENCIL_FILE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${pencil_file} DIRECTORY)
+    get_filename_component(PENCIL_FILE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${pencil_file} PATH)
     list(APPEND ${COMPILE_PENCIL_DEST_INCLUDE_DIRS} ${PENCIL_FILE_DIRECTORY})
     add_custom_command(OUTPUT ${PENCIL_FILE_NAME}.ppcg.c ${PENCIL_FILE_NAME}.ppcg_kernel.cl
                        COMMAND ${PENCIL_COMPILER}


Adapt the 'legacy' Android toolchain file to support Android NDK r12b. This will be the last time we modify this toolchain file for Urho3D project. We are forced to touch it one last time because we need to bump the NDK version in urho3d/android-ndk repository.

--- CMake/Toolchains/android.toolchain.cmake
+++ CMake/Toolchains/android.toolchain.cmake
@@ -29,7 +29,7 @@
 # POSSIBILITY OF SUCH DAMAGE.

 # ------------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the Android NDK r5-r11c
+#  Android CMake toolchain file, for use with the Android NDK r5-r12b
 #  Requires cmake 2.6.3 or newer (2.8.9 or newer is recommended).
 #  See home page: https://github.com/taka-no-me/android-cmake
 #
@@ -85,6 +85,21 @@
 #    ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 - the name of compiler
 #      toolchain to be used. The list of possible values depends on the NDK
 #      version.
+#
+#      For NDK r12b the possible values are:
+#
+#        * aarch64-linux-android-4.9
+#        * aarch64-linux-android-clang
+#        * arm-linux-androideabi-4.9 (default)
+#        * arm-linux-androideabi-clang
+#        * mips64el-linux-android-4.9
+#        * mips64el-linux-android-clang
+#        * mipsel-linux-android-4.9
+#        * mipsel-linux-android-clang
+#        * x86-4.9
+#        * x86-clang
+#        * x86_64-4.9
+#        * x86_64-clang
 #
 #      For NDK r11c the possible values are:
 #
@@ -239,7 +254,7 @@
 set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )

 # NDK search paths
-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r11c -r11b -r11 -r10e -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r12b -r11c -r11b -r11 -r10e -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if( NOT DEFINED ANDROID_NDK_SEARCH_PATHS )
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -568,16 +583,17 @@

 macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )
  foreach( __toolchain ${${__availableToolchainsLst}} )
-  if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
+  # Urho3D - add support for r12b which drops the Clang version number from the toolchain name
+  if( "${__toolchain}" MATCHES "-clang.*$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
    SET( __toolchainVersionRegex "^TOOLCHAIN_VERSION[\t ]+:=[\t ]+(.*)$" )
    FILE( STRINGS "${ANDROID_NDK_TOOLCHAINS_CONFIG_PATH}/${__toolchain}/setup.mk" __toolchainVersionStr REGEX "${__toolchainVersionRegex}" )
    if( __toolchainVersionStr )
     string( REGEX REPLACE "${__toolchainVersionRegex}" "\\1" __toolchainVersionStr "${__toolchainVersionStr}" )
-    string( REGEX REPLACE "-clang3[.][0-9]$" "-${__toolchainVersionStr}" __gcc_toolchain "${__toolchain}" )
+    string( REGEX REPLACE "-clang.*$" "-${__toolchainVersionStr}" __gcc_toolchain "${__toolchain}" )
    else()
     # Urho3D - fallback to use the latest GCC toolchain available
     foreach( __gcc_ver 4.9 4.8 4.6 )
-     string( REGEX REPLACE -clang3[.][0-9]$ -${__gcc_ver} __gcc_toolchain "${__toolchain}" )
+     string( REGEX REPLACE -clang.*$ -${__gcc_ver} __gcc_toolchain "${__toolchain}" )
      if( EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}" )
       break()
      endif()
@@ -1000,8 +1016,8 @@
  set( ANDROID_COMPILER_IS_CLANG 1 )
  execute_process( COMMAND "${ANDROID_CLANG_TOOLCHAIN_ROOT}/bin/clang${TOOL_OS_SUFFIX}" --version OUTPUT_VARIABLE ANDROID_CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE )
  string( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}")
-elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
- string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}")
+elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang(.*)$" )
+ set (ANDROID_CLANG_VERSION ${CMAKE_MATCH_1})
  string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-${ANDROID_COMPILER_VERSION}" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
  if( ANDROID_NDK_LAYOUT STREQUAL RELEASE2)
   set( ANDROID_CLANG_TOOLCHAIN_ROOT "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
@@ -1256,7 +1272,11 @@

 foreach( lang C CXX ASM )
  if( ANDROID_COMPILER_IS_CLANG )
-  set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_CLANG_VERSION} )
+  if (ANDROID_CLANG_VERSION)
+   set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_CLANG_VERSION} )
+  else ()
+   set (CMAKE_${lang}_COMPILER_VERSION 3.8)
+  endif ()
  else()
   set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_COMPILER_VERSION} )
  endif()
@@ -1802,7 +1822,7 @@
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
 #   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86", "mips", "arm64-v8a", "x86_64", "mips64" depending on ANDROID_ABI
-#   ANDROID_NDK_RELEASE : from r5 to r11c; set only for NDK
+#   ANDROID_NDK_RELEASE : from r5 to r12b; set only for NDK
 #   ANDROID_NDK_VERSION : major.minor.patch; set only for NDK; e.g. r10e = 10.5.0 but r11c = 11.2.2725575 (as defined in the source.properties)
 #   ANDROID_ARCH_NAME : "arm", "x86", "mips", "arm64", "x86_64", "mips64" depending on ANDROID_ABI
 #   ANDROID_SYSROOT : path to the compiler sysroot


ENH: Update ctkMacroAddCtkLibraryOptions to make use of ctkMacroExtractOptionNameAndValue

--- CMake/ctkMacroAddCtkLibraryOptions.cmake
+++ CMake/ctkMacroAddCtkLibraryOptions.cmake
@@ -16,18 +16,7 @@
     INCLUDE(${filepath})

     FOREACH(option ${ctk_library_options})
-
-      # Make sure option is correctly formated
-      IF(NOT "${option}" MATCHES "^[A-Za-z0-9]+:(ON|OFF)")
-        MESSAGE(FATAL_ERROR "In ${filepath}, option ${option} is incorrect. Options should be specified using the following format OPT1:[ON|OFF]. For example OPT1:OFF or OPT2:ON")
-      ENDIF()
-
-      # Extract option name and option default value
-      STRING(REPLACE ":" "\\;" option ${option})
-      SET(optionlist ${option})
-      LIST(GET optionlist 0 option_name)
-      LIST(GET optionlist 1 option_value)
-
+      ctkMacroExtractOptionNameAndValue(${option} option_name option_value)
       OPTION(CTK_LIB_${lib}_${option_name} "Enable ${lib} Library ${option_name} option." ${option_value})
     ENDFOREACH()


move to use openhumanoids snopt instead of RL version

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -76,7 +76,7 @@
 set(spotless_revision 91e1e3970e62b8dd8d74bbc4446504b11990f598)
 set(spotless_depends)

-set(snopt_url ssh://git@github.com/RobotLocomotion/snopt.git)
+set(snopt_url ssh://git@github.com/openhumanoids/snopt.git)
 set(snopt_revision 95d908275156f2665ef3941f08cb89c767480a6e)
 set(snopt_depends)


COMP: ctkMacroValidateBuildOptions - Display project name in error message

--- CMake/ctkMacroValidateBuildOptions.cmake
+++ CMake/ctkMacroValidateBuildOptions.cmake
@@ -123,7 +123,7 @@
         OUTPUT_STRIP_TRAILING_WHITESPACE
         )
       IF(RESULT_VAR)
-        MESSAGE(FATAL_ERROR "Failed to obtain dependence path of ${subir}.\n${RESULT_VAR}\n${CTK_BINARY_DIR}\n${error}")
+        MESSAGE(FATAL_ERROR "Failed to obtain dependence path of ${target_project_name}.\n${RESULT_VAR}\n${CTK_BINARY_DIR}\n${error}")
       ENDIF()

       # Convert 'dep_path' to a list


Fix performance issue on Emscripten build due to wrong SSE detection. [ci package] Close #1259.

--- CMake/Modules/CheckCompilerToolchain.cmake
+++ CMake/Modules/CheckCompilerToolchain.cmake
@@ -144,8 +144,10 @@
         endforeach ()
     else ()
         check_extension (mmx)
-        check_extension (sse)
-        check_extension (sse2)
+        if (NOT EMSCRIPTEN)     # Emscripten does not support SSE/SSE2 (yet) now but erroneously responding positively to our probe, so skip them for Emscripten for now
+            check_extension (sse)
+            check_extension (sse2)
+        endif ()
      endif ()
     # As newer CPUs from AMD do not support 3DNow! anymore, we cannot make any assumption for 3DNow! extension check
     # Don't bother with this check on AppleClang and MSVC compiler toolchains (Urho3D only supports CPU with SSE2 on the asscoiated platforms anyway)


Split off 8.0.32

Split off 8.0.32

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

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


Split off 8.0.10

Split off 8.0.10

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

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


[axl] release 6.0.0 (re-release)

[axl] release 6.0.0 (re-release)

prev release was never publicly available


Fixed boost-download to look for files in download-dir explicitly (else the file-command obviously used the current cmakelist-dir instead)

--- src/cmake/boost-download.cmake
+++ src/cmake/boost-download.cmake
@@ -109,7 +109,7 @@

     file(GLOB_RECURSE NON_SOURCE_DIRS
         LIST_DIRECTORIES true
-        "*"
+        "${args_BOOST_DIR}/*"
     )
     # Filter away all folder-paths not ending in either "doc", "example" or "test"
     list(FILTER NON_SOURCE_DIRS


library linking and building works for DMD on Linux

--- CMakeDInformation.cmake
+++ CMakeDInformation.cmake
@@ -88,14 +88,23 @@
 # Static library tools
 # <CMAKE_AR>
 # <CMAKE_RANLIB>
+
 IF(CMAKE_COMPILER_IS_GDC)
   SET(CMAKE_OUTPUT_D_FLAG "-o ")
-#  SET(CMAKE_SHARED_LIBRARY_D_FLAGS "-g -O2 -fPIC")
-#  SET(CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS "-shared")
+  SET(CMAKE_SHARED_LIBRARY_D_FLAGS "-fPIC")
+  SET(CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS "-shared")
 ELSE(CMAKE_COMPILER_IS_GDC)
   SET(CMAKE_OUTPUT_D_FLAG "-of")
-#  SET(CMAKE_SHARED_LIBRARY_D_FLAGS "-g -O -L-fPIC")
-#  SET(CMAKE_SHARED_LIBRARY_CREATE_D_FLAGS "-L-shared")
+  IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+    # not a good way but works because dmd using gcc
+    # for linker on Linux
+    SET(CMAKE_LINK_LIBRARY_FLAG "-L-l")
+    SET(CMAKE_LIBRARY_PATH_FLAG "-L-L")
+  ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+    # dmd part doesn't work for now
+    SET(CMAKE_LINK_LIBRARY_FLAG "-L+")
+    SET(CMAKE_LIBRARY_PATH_FLAG "-I")
+  ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
 ENDIF(CMAKE_COMPILER_IS_GDC)