Revert "libc++: Perform configuration checks with -nodefaultlibs"

This reverts SVN r279584 which broke the buildbots.  Will re-apply once the
issue has been root-caused and fixed.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@279596 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -1,26 +1,5 @@
 include(CheckLibraryExists)
 include(CheckCXXCompilerFlag)
-
-check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
-check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)
-
-# libc++ is built with -nodefaultlibs, so we want all our checks to also
-# use this option, otherwise we may end up with an inconsistency between
-# the flags we think we require during configuration (if the checks are
-# performed without -nodefaultlibs) and the flags that are actually
-# required during compilation (which has the -nodefaultlibs). libc is
-# required for the link to go through.
-check_cxx_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
-if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
-  list(APPEND CMAKE_REQUIRED_LIBRARIES -nodefaultlibs)
-  if (LIBCXX_HAS_C_LIB)
-    list(APPEND CMAKE_REQUIRED_LIBRARIES c)
-  endif ()
-  if (LIBCXX_HAS_GCC_S_LIB)
-    list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
-  endif ()
-endif ()
-
 include(CheckLibcxxAtomic)

 # Check compiler flags
@@ -35,5 +14,7 @@

 # Check libraries
 check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)
+check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)
 check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)
 check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
+check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)


[tsan] Enable ThreadSanitizer on OS X builds by default, take 2

Second attempt to enable building ThreadSanitizer (and running tests) on OS X by default.

Differential Revision: http://reviews.llvm.org/D15109

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -560,17 +560,10 @@
 endif()

 if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND
-    OS_NAME MATCHES "Linux|FreeBSD")
+    OS_NAME MATCHES "Darwin|Linux|FreeBSD")
   set(COMPILER_RT_HAS_TSAN TRUE)
 else()
   set(COMPILER_RT_HAS_TSAN FALSE)
-endif()
-
-if(APPLE)
-  option(COMPILER_RT_ENABLE_TSAN_OSX "Enable building TSan for OS X - Experimental" Off)
-  if(COMPILER_RT_ENABLE_TSAN_OSX)
-    set(COMPILER_RT_HAS_TSAN TRUE)
-  endif()
 endif()

 if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND


"configure" (#13539)

"configure" (#13539)

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -62,8 +62,26 @@
 endif()

 if(WIN32)
-  # windows stupid compile option for all targets.
+  # windows header option for all targets.
   add_definitions(-D_XKEYCHECK_H)
+  # Use symbols instead of absolute path, reduce the cmake link command length.
+  SET(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+  SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
+  SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+  SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+  SET(CMAKE_C_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+  SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 1)
+  SET(CMAKE_C_RESPONSE_FILE_LINK_FLAG "@")
+  SET(CMAKE_CXX_RESPONSE_FILE_LINK_FLAG "@")
+
+  # Specify the program to use when building static libraries
+  SET(CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> lib <TARGET> <LINK_FLAGS> <OBJECTS>")
+  SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> lib <TARGET> <LINK_FLAGS> <OBJECTS>")
+
+  # set defination for the dll export
+  if (NOT MSVC)
+    message(FATAL "Windows build only support msvc. Which was binded by the nvcc compiler of NVIDIA.")
+  endif(NOT MSVC)
 endif(WIN32)

 if(NOT WITH_GOLANG)


provide default runtime destination as bin for windows add_library calls.

--- cmake/libraries.cmake
+++ cmake/libraries.cmake
@@ -44,6 +44,17 @@
                  COMMAND if exist "${PROJECT_BINARY_DIR}/bin/${ARGV0}.dll" ( cp bin/*dll* ${CMAKE_BINARY_DIR}/bin )
                  WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
                  )
+        # Quite likely, linux guys hacking packages will not think to set the runtime destination to bin
+        # for dll's and this will create a huge headache in porting. Just do it here for now.
+        # From cmake docs - 'Installing a target with EXCLUDE_FROM_ALL set to true has undefined behavior.'
+        get_target_property(${ARGV0}_EXCLUDE_FROM_INSTALL ${ARGV0} EXCLUDE_FROM_ALL)
+        if ( NOT ${${ARGV0}_EXCLUDE_FROM_INSTALL} )
+            install(TARGETS ${ARGV0}
+                    RUNTIME DESTINATION bin
+                    ARCHIVE DESTINATION lib
+                    LIBRARY DESTINATION lib
+            )
+        endif()
       endif()
     endfunction()
   endif(MSVC)


#57 Added definition fPIC to compile on Linux

--- config/Settings.cmake
+++ config/Settings.cmake
@@ -30,6 +30,11 @@
 include(CheckCXXCompilerFlag)
 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+	ADD_DEFINITIONS(-fPIC)
+endif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
+
 if(COMPILER_SUPPORTS_CXX11)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 elseif(COMPILER_SUPPORTS_CXX0X)
@@ -53,4 +58,4 @@
    #if("${isSystemDir}" STREQUAL "-1")
    #    set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
    #endif()
-endif()+endif()


Improve libcaca detection

Improve libcaca detection

--- cmake/Modules/Findlibcaca.cmake
+++ cmake/Modules/Findlibcaca.cmake
@@ -2,18 +2,12 @@

 find_path(libcaca_INCLUDE_DIR caca.h)
 find_library(libcaca_LIBRARY caca)
+check_symbol_exists(CACA_API_VERSION_1 caca.h CACA_API_VERSION_1)

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(libcaca DEFAULT_MSG libcaca_LIBRARY
-	libcaca_INCLUDE_DIR)

-if(FOUND_libcaca)
-	check_symbol_exists(CACA_API_VERSION_1 caca.h CACA_API_VERSION_1)
-	if(not defined CACA_API_VERSION_1)
-		message("Your libcaca is too new (nobody ships 1.0 yet :/)")
-		unset(libcaca_INCLUDE_DIR)
-		unset(libcaca_LIBRARY)
-	endif()
-endif()
+find_package_handle_standard_args(libcaca FOUND_VAR libcaca_FOUND
+	REQUIRED_VARS libcaca_LIBRARY libcaca_INCLUDE_DIR
+	VERSION_VAR CACA_API_VERSION_1)

 mark_as_advanced(libcaca_INCLUDE_DIR libcaca_LIBRARY)


Updated Google Test dependency from 1.7 to 1.10 (#68)

* copied googletest.cmake file from latest Firestore version

* Updated copyright notice for 2020

--- cmake/external/googletest.cmake
+++ cmake/external/googletest.cmake
@@ -1,4 +1,4 @@
-# Copyright 2019 Google
+# Copyright 2020 Google LLC
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -18,19 +18,15 @@
   return()
 endif()

-# Googletest 1.8.0 fails to build on VS 2017:
-# https://github.com/google/googletest/issues/1111.
-#
-# No release has been made since, so just pick a commit since then.
-set(commit ba96d0b1161f540656efdaed035b3c062b60e006)  # master@{2018-07-10}
+set(version 1.10.0)

 ExternalProject_Add(
   googletest

   DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
-  DOWNLOAD_NAME googletest-${commit}.tar.gz
-  URL https://github.com/google/googletest/archive/${commit}.tar.gz
-  URL_HASH SHA256=949c556896cf31ed52e53449e17a1276b8b26d3ee5932f5ca49ee929f4b35c51
+  DOWNLOAD_NAME googletest-${version}.tar.gz
+  URL https://github.com/google/googletest/archive/release-${version}.tar.gz
+  URL_HASH SHA256=9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb

   PREFIX ${PROJECT_BINARY_DIR}


Teach LLVM-Config to use logical target names (1/2)

LLVM library names are now available as logical CMake targets both
to our own build and to application CMake code.  Replace use of
'list(FIND)' with a simple 'if(TARGET)' to determine whether a
library is available.

Contributed by Brad King.

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

--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -104,31 +104,25 @@
     # add codegen, asmprinter, asmparser, disassembler
     list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
     if( NOT idx LESS 0 )
-      list(FIND llvm_libs "LLVM${c}CodeGen" idx)
-      if( NOT idx LESS 0 )
+      if( TARGET LLVM${c}CodeGen )
         list(APPEND expanded_components "LLVM${c}CodeGen")
       else()
-        list(FIND llvm_libs "LLVM${c}" idx)
-        if( NOT idx LESS 0 )
+        if( TARGET LLVM${c} )
           list(APPEND expanded_components "LLVM${c}")
         else()
           message(FATAL_ERROR "Target ${c} is not in the set of libraries.")
         endif()
       endif()
-      list(FIND llvm_libs "LLVM${c}AsmPrinter" asmidx)
-      if( NOT asmidx LESS 0 )
+      if( TARGET LLVM${c}AsmPrinter )
         list(APPEND expanded_components "LLVM${c}AsmPrinter")
       endif()
-      list(FIND llvm_libs "LLVM${c}AsmParser" asmidx)
-      if( NOT asmidx LESS 0 )
+      if( TARGET LLVM${c}AsmParser )
         list(APPEND expanded_components "LLVM${c}AsmParser")
       endif()
-      list(FIND llvm_libs "LLVM${c}Info" asmidx)
-      if( NOT asmidx LESS 0 )
+      if( TARGET LLVM${c}Info )
         list(APPEND expanded_components "LLVM${c}Info")
       endif()
-      list(FIND llvm_libs "LLVM${c}Disassembler" asmidx)
-      if( NOT asmidx LESS 0 )
+      if( TARGET LLVM${c}Disassembler )
         list(APPEND expanded_components "LLVM${c}Disassembler")
       endif()
     elseif( c STREQUAL "native" )
@@ -189,12 +183,10 @@
 function(explicit_map_components_to_libraries out_libs)
   llvm_map_components_to_libnames(link_libs ${ARGN})
   llvm_expand_dependencies(expanded_components ${link_libs})
-  get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
   # Return just the libraries included in this build:
   set(result)
   foreach(c ${expanded_components})
-    list(FIND llvm_libs ${c} lib_idx)
-    if( NOT lib_idx LESS 0 )
+    if( TARGET ${c} )
       set(result ${result} ${c})
     endif()
   endforeach(c)


added copyright

added copyright

--- cmake/toolchains/linux_32.cmake
+++ cmake/toolchains/linux_32.cmake
@@ -1,3 +1,17 @@
+# Copyright 2020 Google
+#
+# 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.
+
 # Toolchain file for building 32-bit Linux libraries

 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")


make/devices.cmake: Allow *_TARGET variables to be empty

When the associated program executable does not need a target the
*_TARGET variable is empty. When getting the target property allow it to
be empty.

Signed-off-by: Nathan Rossi <2e8aa918660411855c6d44d5bb2da677aa033255@nathanrossi.com>

--- make/devices.cmake
+++ make/devices.cmake
@@ -1053,7 +1053,7 @@
     add_custom_target(${NAME}_bin DEPENDS ${OUT_BIN})
     add_output_to_fpga_target(${NAME} BIN ${OUT_LOCAL_REL}/${TOP}.bin)

-    get_target_property_required(PROG_TOOL ${BOARD} PROG_TOOL)
+    get_target_property(PROG_TOOL ${BOARD} PROG_TOOL)
     get_target_property(PROG_CMD ${BOARD} PROG_CMD)
     separate_arguments(
       PROG_CMD_LIST UNIX_COMMAND ${PROG_CMD}
@@ -1307,9 +1307,9 @@
   )

   get_target_property(IVERILOG env IVERILOG)
-  get_target_property_required(IVERILOG_TARGET env IVERILOG_TARGET)
+  get_target_property(IVERILOG_TARGET env IVERILOG_TARGET)
   get_target_property(VVP env VVP)
-  get_target_property_required(VVP_TARGET env VVP_TARGET)
+  get_target_property(VVP_TARGET env VVP_TARGET)
   set(SOURCE_LOCATIONS "")
   set(FILE_DEPENDS "")
   foreach(SRC ${ADD_TESTBENCH_SOURCES})


Update CompileOptions.cmake

Update CompileOptions.cmake

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -70,14 +70,13 @@
         /MP           # -> build with multiple processes
         /W4           # -> warning level 4
         # /WX         # -> treat warnings as errors
-        /Zm114        # -> Memory size for precompiled headers
-
         /wd4251       # -> disable warning: 'identifier': class 'type' needs to have dll-interface to be used by clients of class 'type2'
         /wd4592       # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
         # /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
         /wd4127       # -> disable warning: conditional expression is constant (caused by Qt)
-
-        /Zm200        # Enable more memory for precompiled headers
+
+        # /Zm114      # -> Memory size for precompiled headers (insufficient for msvc 2013)
+        /Zm200        # -> Memory size for precompiled headers

         #$<$<CONFIG:Debug>:
         #/RTCc         # -> value is assigned to a smaller data type and results in a data loss


Message in FindQScintilla.cmake

Message in FindQScintilla.cmake

--- cmake/FindQScintilla.cmake
+++ cmake/FindQScintilla.cmake
@@ -48,6 +48,7 @@
         # or not it actually is.  I'd rather play it safe and not assume the
         # command succeeded, though.
         set(QSCINTILLA_BREW_ROOT "${BREW_PREFIX_OUTPUT}")
+        message(STATUS "qscintilla2's brew root is ${QSCINTILLA_BREW_ROOT}")
       endif()

     else()


Un-break build on clang.

Un-break build on clang.

--- cmake/Modules/cflags.cmake
+++ cmake/Modules/cflags.cmake
@@ -25,7 +25,7 @@
 	if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
 		set(HAVE_COMPILER_CLANG "1")
 		test_c11()
-		list(APPEND CMAKE_C_FLAGS "${SGHERM_C_STANDARD} -Wpedantic -Wall -Wextra")
+		add_definitions("${SGHERM_C_STANDARD} -Wpedantic -Wall -Wextra")
 		if(HAVE_POSIX)
 			list(APPEND CMAKE_CXX_FLAGS_DEBUG "-g3")
 			list(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO "-g3")
@@ -33,7 +33,7 @@
 	elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
 		set(HAVE_COMPILER_GCC "1")
 		test_c11()
-		list(APPEND CMAKE_C_FLAGS "${SGHERM_C_STANDARD} -pedantic -Wall -Wextra")
+		add_definitions("${SGHERM_C_STANDARD} -pedantic -Wall -Wextra")
 		if(HAVE_POSIX)
 			list(APPEND CMAKE_CXX_FLAGS_DEBUG "-ggdb")
 			list(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO "-ggdb")
@@ -41,10 +41,10 @@
 	elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
 		set(HAVE_COMPILER_INTEL "1")
 		test_c11()
-		list(APPEND CMAKE_C_FLAGS "${SGHERM_C_STANDARD} -Wall -Wextra")
+		add_definitions("${SGHERM_C_STANDARD} -Wall -Wextra")
 	elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
 		set(HAVE_COMPILER_MSVC "1")
-		list(APPEND CMAKE_CXX_FLAGS "/G5 /Gr /D _CRT_SECURE_NO_WARNINGS")
+		add_definitions("/G5 /Gr /D _CRT_SECURE_NO_WARNINGS")
 		# /G5 - Enable Pentium optimisations
 		# /Gr - __fastcall as deafult
 		# /D _CRT_NO_SECURE_WARNINGS - disable whining about fopen and friends


cmake: Add support for proper Intel C compiler detection

--- cmake/PlatformDetect.cmake
+++ cmake/PlatformDetect.cmake
@@ -14,6 +14,11 @@
         # Fix gcc -> qcc naming on QNX 6
         if ((PLIB_TARGET_OS STREQUAL qnx) AND (PLIB_C_COMPILER STREQUAL gcc))
                 set (PLIB_C_COMPILER qcc)
+        endif()
+
+        # Rename intel -> icc
+        if (PLIB_C_COMPILER STREQUAL intel)
+                set (PLIB_C_COMPILER icc)
         endif()

         # Assign result


disable warning for now and just move catkin packages from DEPENDS to CATKIN_DEPENDS automatically

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -117,7 +117,7 @@
       # split multiple names (without COMPONENTS) into separate dependencies
       foreach(depend_name ${depend_list})
         if(${depend_name}_FOUND_CATKIN_PROJECT)
-          message(WARNING "catkin_package() DEPENDS on catkin package '${depend_name}' which is deprecated. Use CATKIN_DEPENDS for catkin packages instead.")
+          #message(WARNING "catkin_package() DEPENDS on catkin package '${depend_name}' which is deprecated. Use CATKIN_DEPENDS for catkin packages instead.")
           list(APPEND _PROJECT_CATKIN_DEPENDS ${depend_name})
         else()
           if(NOT ${${depend_name}_FOUND})


compiler-flags.cmake: also set CMAKE_CXX_STANDARD stuff.

Fixes https://github.com/darktable-org/rawspeed/issues/112#issuecomment-321517003

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -1,6 +1,12 @@
 include(CheckCXXCompilerFlag)
 include(CpuMarch)
 include(CheckCXXCompilerFlagAndEnableIt)
+
+# yes, need to keep both the CMAKE_CXX_FLAGS and CMAKE_CXX_STANDARD.
+# with just the CMAKE_CXX_STANDARD, try_compile() breaks:
+#   https://gitlab.kitware.com/cmake/cmake/issues/16456
+# with just the CMAKE_CXX_FLAGS, 'bundled' pugixml breaks tests
+#   https://github.com/darktable-org/rawspeed/issues/112#issuecomment-321517003

 message(STATUS "Checking for -std=c++14 support")
 CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
@@ -19,6 +25,10 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
   message(STATUS "Checking for -std=c++14 support - works")
 endif()
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)

 # always debug info
 add_definitions(-g3)


use the default cdn address for mklml package on windows test=develop

--- cmake/external/mklml.cmake
+++ cmake/external/mklml.cmake
@@ -48,7 +48,7 @@
     MESSAGE(STATUS "use pre defined download url")
     if(WIN32)
         SET(MKLML_VER "mklml_win_2019.0.20180710" CACHE STRING "" FORCE)
-        SET(MKLML_URL "https://paddle-windows.bj.bcebos.com/mklml/${MKLML_VER}.zip" CACHE STRING "" FORCE)
+        SET(MKLML_URL "https://paddlepaddledeps.cdn.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE)
     else()
         SET(MKLML_VER "mklml_lnx_2019.0.20180710" CACHE STRING "" FORCE)
         SET(MKLML_URL "http://paddlepaddledeps.cdn.bcebos.com/${MKLML_VER}.tgz" CACHE STRING "" FORCE)


installing in /opt/local

installing in /opt/local

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -73,7 +73,8 @@
 SET(CPACK_PACKAGE_FILE_NAME "embree-${EMBREE_VERSION}")
 #SET(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/embree-doc/images/icon.png)

-SET(CPACK_PACKAGE_INSTALL_DIRECTORY "/opt/local")
+SET(CPACK_PACKAGING_INSTALL_PREFIX "/opt/local")
+SET(CPACK_PACKAGE_RELOCATABLE TRUE)

 SET(CPACK_PACKAGE_VERSION_MAJOR ${EMBREE_VERSION_MAJOR})
 SET(CPACK_PACKAGE_VERSION_MINOR ${EMBREE_VERSION_MINOR})


quietly use backward_cpp/ros if available (#2988)

This is simply convenient and you always need it when you did not explicitly add it.

Follow @tylerjw's initiative to add it to MoveIt2:
https://github.com/ros-planning/moveit2/pull/794

--- moveit_core/cmake/moveit.cmake
+++ moveit_core/cmake/moveit.cmake
@@ -4,6 +4,8 @@
   endif()
   set(CMAKE_CXX_STANDARD_REQUIRED ON)
   set(CMAKE_CXX_EXTENSIONS OFF)
+
+  find_package(backward_ros QUIET)

   if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
     message("${PROJECT_NAME}: You did not request a specific build type: Choosing 'Release' for maximum performance")


Renamed EMBEDDED to LOCAL

Renamed EMBEDDED to LOCAL


Replaced path on my system with placeholder path in toolchain file.

--- Toolchain-mingw32.cmake
+++ Toolchain-mingw32.cmake
@@ -6,8 +6,8 @@
 SET(CMAKE_CXX_COMPILER i486-mingw32-g++)
 SET(CMAKE_RC_COMPILER i486-mingw32-windres)

-# here is the target environment located
-SET(POLYCODE_DIRECTORY "/home/cib/projects/Polycode")
+# here is the target environment located, please replace /path/to/Polycode with the absolute path to your polycode installation
+SET(POLYCODE_DIRECTORY "/path/to/Polycode")
 SET(CMAKE_FIND_ROOT_PATH  /usr/i486-mingw32; ${POLYCODE_DIRECTORY}/Release/Windows/Framework/Core/Dependencies; ${POLYCODE_DIRECTORY}/Release/Windows/Framework/Tools/Dependencies; /home/cib/projects/Polycode/Release/Windows/Framework/Modules/Dependencies; )

 # adjust the default behaviour of the FIND_XXX() commands:


Build SDL2 w/o Wayland support to avoid build error (#31)

Debian testing uses Wayland by default, but SDL2 reports a build error. This patch simply disables Wayland in the SDL2 build options. Truss and SDL2 still work fine in X emulation mode on Wayland systems.

Contributed by @ClintLiddick.


CMake: Fix PACKAGE_* variables in expat_config.h.cmake

--- expat/expat_config.h.cmake
+++ expat/expat_config.h.cmake
@@ -57,20 +57,26 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #cmakedefine HAVE_UNISTD_H

+/* Name of package */
+#define PACKAGE "@PACKAGE_NAME@"
+
 /* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT
+#cmakedefine PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"

 /* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME
+#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"

 /* Define to the full name and version of this package. */
-#cmakedefine PACKAGE_STRING
+#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"

 /* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME
+#cmakedefine PACKAGE_TARNAME "@PACKAGE_TARNAME@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""

 /* Define to the version of this package. */
-#cmakedefine PACKAGE_VERSION
+#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"

 /* Define to 1 if you have the ANSI C header files. */
 #cmakedefine STDC_HEADERS


CMake build: pw_add_test updates; fix C builds

- In pw_add_test, require the name argument and accept a source list.
  This is more consistent with GN and Bazel.
- Make some compile options C++-only.

Change-Id: I5c11bcf5fb35c11fe6c332034c95ca6ad9203429

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -77,7 +77,10 @@
   list(FILTER tests INCLUDE REGEX "_test.cc$")

   foreach(test IN LISTS tests)
-    pw_add_test("${test}" ${exclude_tests_from_default}
+    get_filename_component(test_name "${test}" NAME_WE)
+    pw_add_test("${MODULE}.${test_name}"
+      SOURCES
+        "${test}"
       DEPS
         "${MODULE}"
       GROUPS
@@ -153,26 +156,16 @@
 #  - <TEST_NAME>_run: builds and runs the test
 #
 # Args:
-#   SOURCE (positional arg): the main source file for the test
-#   NAME: optional name to use for the target; by default,
-#       dirname.test_file_name is used
+#   NAME: name to use for the target
+#   SOURCES: source files for this test
 #   DEPS: libraries on which this test depends
 #   GROUPS: groups to which to add this test; if none are specified, the test is
 #       added to the default and all groups
-function(pw_add_test SOURCE)
-  set(list_args DEPS GROUPS)
-  cmake_parse_arguments(PARSE_ARGV 1 arg "" "NAME" "${list_args}")
-
-  if(arg_NAME)
-    set(test_name "${arg_NAME}")
-  else()
-    get_filename_component(module "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-    get_filename_component(base "${SOURCE}" NAME_WE)
-    set(test_name "${module}.${base}")
-  endif()
-
-  add_executable("${test_name}" EXCLUDE_FROM_ALL "${SOURCE}")
-  target_link_libraries("${test_name}"
+function(pw_add_test NAME)
+  cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "SOURCES;DEPS;GROUPS")
+
+  add_executable("${NAME}" EXCLUDE_FROM_ALL ${arg_SOURCES})
+  target_link_libraries("${NAME}"
     PRIVATE
       pw_unit_test
       pw_unit_test.main
@@ -186,15 +179,15 @@
     COMMAND
       # TODO(hepler): This only runs local test binaries. Execute a test runner
       #     instead to support device test runs.
-      "$<TARGET_FILE:${test_name}>"
+      "$<TARGET_FILE:${NAME}>"
     COMMAND
-      "${CMAKE_COMMAND}" -E touch "${test_name}.stamp"
+      "${CMAKE_COMMAND}" -E touch "${NAME}.stamp"
     DEPENDS
-      "${test_name}"
+      "${NAME}"
     OUTPUT
-      "${test_name}.stamp"
-  )
-  add_custom_target("${test_name}_run" DEPENDS "${test_name}.stamp")
+      "${NAME}.stamp"
+  )
+  add_custom_target("${NAME}_run" DEPENDS "${NAME}.stamp")

   # Always add tests to the "all" group. If no groups are provided, add the
   # test to the "default" group.
@@ -205,7 +198,7 @@
   endif()

   list(REMOVE_DUPLICATES groups)
-  pw_add_test_to_groups("${test_name}" ${groups})
+  pw_add_test_to_groups("${NAME}" ${groups})
 endfunction(pw_add_test)

 # Adds a test target to the specified test groups. Test groups can be built with
@@ -238,7 +231,7 @@
     "-fno-exceptions"
     "-ffunction-sections"
     "-fdata-sections"
-    "-fno-rtti"
+    $<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
 )

 add_library(_pw_strict_warnings_copts INTERFACE)
@@ -246,19 +239,19 @@
   INTERFACE
     "-Wall"
     "-Wextra"
-    "-Wnon-virtual-dtor"
     # Make all warnings errors, except for the exemptions below.
     "-Werror"
     "-Wno-error=cpp"  # preprocessor #warning statement
     "-Wno-error=deprecated-declarations"  # [[deprecated]] attribute
+    $<$<COMPILE_LANGUAGE:CXX>:-Wnon-virtual-dtor>
 )

 add_library(_pw_cpp17_copts INTERFACE)
 target_compile_options(_pw_cpp17_copts
   INTERFACE
-    "-std=c++17"
+    $<$<COMPILE_LANGUAGE:CXX>:-std=c++17>
     # Allow uses of the register keyword, which may appear in C headers.
-    "-Wno-register"
+    $<$<COMPILE_LANGUAGE:CXX>:-Wno-register>
 )

 # Target that specifies the standard Pigweed build options.


Cosmetic change to .pc.cmake file

Cosmetic change to .pc.cmake file

--- yaml-cpp.pc.cmake
+++ yaml-cpp.pc.cmake
@@ -4,7 +4,7 @@
 includedir=@INCLUDE_INSTALL_DIR@

 Name: Yaml-cpp
-Description: A YAML parser for C++
+Description: A YAML parser and emitter for C++
 Version: @YAML_CPP_VERSION@
 Requires:
 Libs: -L${libdir} -lyaml-cpp


apr: updated DLMD5

apr: updated DLMD5

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

--- projects/apr.cmake
+++ projects/apr.cmake
@@ -22,7 +22,7 @@
   # TODO: version 1.5.2 no longer appears to be available from apache mirrors,
   #  so until we move to a new version that is available, download from the repo
   DLURL https://${REPO}/archive/${VER}.tar.gz
-  DLMD5 5b0bb763245c7d10b7c03214cc8756ec
+  DLMD5 4a6bdfe8aba67891aead7f7ed11e3361
   DLNAME apr-tag-${VER}.tar.gz
   PATCH ${PATCH_DIR}/apr.patch
   DIFF https://${FORK}/compare/apache:


boards: arm: nrf9160dk: add deprecation warning for old board names

Add a deprecation warning for nrf9160 DK when the old names
(nrf9160_pca10090, nrf52840_pca10090) are used instead of the
new board name. For nRF9160 SoC: do this for both secure and
non-secure board targets.

Signed-off-by: Ioannis Glaropoulos <5921cc8bab7e1d4329f52fd8f6268f9692e3de80@nordicsemi.no>

--- boards/deprecated.cmake
+++ boards/deprecated.cmake
@@ -11,3 +11,6 @@
 set(nrf51_pca10028_DEPRECATED nrf51dk_nrf51422)
 set(nrf52840_pca10056_DEPRECATED nrf52840dk_nrf52840)
 set(nrf52811_pca10056_DEPRECATED nrf52840dk_nrf52811)
+set(nrf9160_pca10090_DEPRECATED nrf9160dk_nrf9160)
+set(nrf9160_pca10090ns_DEPRECATED nrf9160dk_nrf9160ns)
+set(nrf52840_pca10090_DEPRECATED nrf9160dk_nrf52840)


doc: Update CMake BASIS URLs

doc: Update CMake BASIS URLs

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -27,7 +27,7 @@
 # have to be specified here such that the top-level IRTK project can analyze the
 # inter-module dependencies, as well as dependencies on third-party libraries.
 #
-# @sa http://opensource.andreasschuh.com/cmake-basis/standard/modules.html
+# @sa https://cmake-basis.github.io/standard/modules.html
 #
 # @ingroup BasisSettings
 ################################################################################


upgrade to version 0.9.5

upgrade to version 0.9.5

--- CMake/config.cmake
+++ CMake/config.cmake
@@ -28,7 +28,7 @@
 # setup version numbers
 set(RTTR_VERSION_MAJOR 0)
 set(RTTR_VERSION_MINOR 9)
-set(RTTR_VERSION_PATCH 0)
+set(RTTR_VERSION_PATCH 5)
 set(RTTR_VERSION ${RTTR_VERSION_MAJOR}.${RTTR_VERSION_MINOR}.${RTTR_VERSION_PATCH})
 set(RTTR_VERSION_STR "${RTTR_VERSION_MAJOR}.${RTTR_VERSION_MINOR}.${RTTR_VERSION_PATCH}")
 math(EXPR RTTR_VERSION_CALC "${RTTR_VERSION_MAJOR}*1000 + ${RTTR_VERSION_MINOR}*100 + ${RTTR_VERSION_PATCH}")


--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2206,14 +2206,18 @@
 			else()
 				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
 			endif()
+			# make precompiled header compilation depend on the actual compiler executable to force
+			# re-compilation when the compiler executable is updated. This prevents "created by a different GCC executable"
+			# warnings when the precompiled header is included.
+			get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
 			if (COTIRE_DEBUG)
-				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
+				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} ${_realCompilerExe} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
 			endif()
 			set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
 			add_custom_command(
 				OUTPUT "${_pchFile}"
 				COMMAND ${_cmds}
-				DEPENDS "${_prefixFile}"
+				DEPENDS "${_prefixFile}" "${_realCompilerExe}"
 				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
 				WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 				COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"


Fix for issues #242 #178

Fix for issues #242 #178

--- CMake/libogg.cmake
+++ CMake/libogg.cmake
@@ -23,6 +23,19 @@
     LIST(APPEND libogg_SRCS win32/ogg.def)
 ENDIF(MSVC)

+IF("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+	# libogg expects configure to be called on linux to
+	# generate config_types.h
+    LIST(APPEND libogg_HDRS include/ogg/config_types.h)
+
+	add_custom_command(OUTPUT include/ogg/config_types.h
+						COMMAND ./configure
+						DEPENDS include/ogg/ogg.h # Hopefully if the libogg version changes, so does this file
+												  # so configure_types.h will be regenerated.
+						WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+					   )
+ENDIF()
+
 #ADD_LIBRARY(libogg_dynamic SHARED ${libogg_SRCS} ${libogg_HDRS})
 ADD_LIBRARY(libogg ${libogg_SRCS} ${libogg_HDRS})


cmake: Change default for BUILD_ARAVIS and BUILD_DOCUMENTATION to ON

--- CMakeOptions.cmake
+++ CMakeOptions.cmake
@@ -16,13 +16,12 @@
 # This file contains all options/variables that users
 # can set to configure tiscamera

-
 option(BUILD_GST_1_0  "Build gstreamer-1.0 plugins?"         ON)
-option(BUILD_ARAVIS   "Include GigE support via aravis"      OFF)
+option(BUILD_ARAVIS   "Include GigE support via aravis"      ON)
 option(BUILD_V4L2     "Include support for USB cameras"      ON )
 option(BUILD_LIBUSB   "Include support for LibUsb cameras"   ON )
 option(BUILD_TOOLS    "Build additional utilities"           ON)
-option(BUILD_DOCUMENTATION "Build internal code documentation"    OFF)
+option(BUILD_DOCUMENTATION "Build internal code documentation"    ON)
 option(BUILD_TESTS    "Build tests."                         OFF)


ALIROOT-5507 Adding root files to the OADB.par

--- cmake/ALICE_CMake.cmake
+++ cmake/ALICE_CMake.cmake
@@ -613,14 +613,14 @@

   if(EXISTS ${CMAKE_SOURCE_DIR}/${MODULE}/PROOF-INF.${PACKAGE})
     set(PARSRCS)
-    foreach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR})
+    foreach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR} ${OTHERS} )
       get_filename_component(srcdir ${file} PATH)
       add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${file}-par
                          COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${srcdir}
                          COMMAND cp -pR ${file} ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${file}
                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
       list(APPEND PARSRCS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}/${file}-par)
-    endforeach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR})
+    endforeach(file ${SRCS} ${HDRS} ${FSRCS} ${DHDR} ${OTHERS} )

     # message(STATUS "saveEINCLUDE=${saveEINCLUDE}")
     add_custom_target(${PACKAGE}.par


Small addition to add source files to clang format. Removed it since it may confuse ides

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -48,5 +48,7 @@
 	COMMENT
 	"Formating with ${CLANGFORMAT_EXECUTABLE} ..."
       )
-  endif()
+  endif()
+
+  # set_property(TARGET clangformat PROPERTY SOURCES ${clangformat_files})
 endmacro()


Further fix for lpsolve

Further fix for lpsolve

--- cmake/FindLPSolve.cmake
+++ cmake/FindLPSolve.cmake
@@ -36,7 +36,10 @@
 			/opt/lib
 		)

-		FIND_LIBRARY(TMP_LPSOLVE_LIBRARIES lpsolve55 ${LPSOLVE_LIBRARIES} ${LPSOLVE_LIB_TRIALPATH})
+		FIND_LIBRARY(TMP_LPSOLVE_LIBRARIES
+			NAMES lpsolve55
+			PATHS ${LPSOLVE_LIBRARIES} ${LPSOLVE_LIB_TRIALPATH}
+			PATH_SUFFIXES lp_solve)
 		SET(LPSOLVE_LIBRARIES ${TMP_LPSOLVE_LIBRARIES} CACHE STRING "Full path to the lpsolve55 library (including the library)" FORCE)
 		IF (LPSOLVE_LIBRARIES)
 			SET(LPSOLVE_FOUND TRUE)


Use libstd++ on Linux for Clang and libc++ on macOS

--- cmake/compilation.cmake
+++ cmake/compilation.cmake
@@ -34,7 +34,8 @@
     )
   if (NOT (CLANG_VERSION VERSION_GREATER 3.7 OR CLANG_VERSION VERSION_EQUAL 3.7))
     message(FATAL_ERROR "Requires Clang >= 3.7.")
-  else()
+  elseif (APPLE)
+    # Use libstdc++ on Linux but libc++ on macOS.
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
   endif()
 elseif (MSVC AND MSVC14)


[clang-fuzzer] Build with newer protobuf-mutator.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@315506 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/ProtobufMutator.cmake
+++ cmake/modules/ProtobufMutator.cmake
@@ -6,7 +6,7 @@
 ExternalProject_Add(${PBM_PREFIX}
   PREFIX ${PBM_PREFIX}
   GIT_REPOSITORY https://github.com/google/libprotobuf-mutator.git
-  GIT_TAG 17789d1
+  GIT_TAG e4eae60
   CONFIGURE_COMMAND ${CMAKE_COMMAND} -G${CMAKE_GENERATOR}
     -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
     -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}


fixed parsing of ISPC version

fixed parsing of ISPC version

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -59,7 +59,7 @@

 # check ISPC version
 EXECUTE_PROCESS(COMMAND ${EMBREE_ISPC_EXECUTABLE} --version OUTPUT_VARIABLE ISPC_OUTPUT)
-STRING(REGEX MATCH " ([0-9]+[.][0-9]+[.][0-9]+)(dev|knl)? " DUMMY "${ISPC_OUTPUT}")
+STRING(REGEX MATCH "([0-9]+[.][0-9]+[.][0-9]+)" DUMMY "${ISPC_OUTPUT}")
 SET(ISPC_VERSION ${CMAKE_MATCH_1})

 IF (ISPC_VERSION VERSION_LESS ISPC_VERSION_REQUIRED)


removed if exists ispc in ispc.cmake

removed if exists ispc in ispc.cmake

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -20,9 +20,11 @@
 ENDMACRO ()

 execute_process(COMMAND which ispc OUTPUT_VARIABLE ISPC_EXECUTABLE)
-IF (EXISTS ${ISPC_EXECUTABLE})
+#IF (EXISTS "/home/benthin/Projects/ispc/ispc")
+#"${ISPC_EXECUTABLE}")
+#message(${ISPC_EXECUTABLE})
   execute_process(COMMAND dirname ${ISPC_EXECUTABLE} OUTPUT_VARIABLE ISPC_DIR_TEMP)
-ENDIF()
+#ENDIF()
 STRING(REGEX REPLACE "\n" "" ISPC_DIR "${ISPC_DIR_TEMP}")

 MACRO (ispc_compile targets)


Removed more unnecessary lines from FileList.cmake files

--- JEB/FileList.cmake
+++ JEB/FileList.cmake
@@ -1,5 +1,3 @@
-cmake_minimum_required(VERSION 2.8)
-
 set(JEB_LIB_DIR JEB)
 include(${JEB_LIB_DIR}/Algorithms/FileList.cmake)
 include(${JEB_LIB_DIR}/Bits/FileList.cmake)


ENH: NOT force recompile ITKv4 because within Slicer4

--- CMake/FindExternalTools.cmake
+++ CMake/FindExternalTools.cmake
@@ -184,13 +184,12 @@
 set(RecompileITK OFF)
 set(RecompileSEM OFF)

-if(COMPILE_EXTERNAL_dtiprocessTK OR COMPILE_EXTERNAL_BRAINS OR COMPILE_EXTERNAL_ANTS OR COMPILE_EXTERNAL_ResampleDTI) # If one of these tools needed, need to recompile ITK so the version is OK
-  set(RecompileITK ON) # Automatically recompile SlicerExecutionModel
-else() # If no need, recompile ITK or SEM only if not found
-  find_package(ITK) # Not required because will be recompiled if not found
-  if(ITK_FOUND)
-    include(${ITK_USE_FILE}) # set ITK_DIR
-
+find_package(ITK QUIET) # Not required because will be recompiled if not found
+if(ITK_FOUND)
+  include(${ITK_USE_FILE}) # set ITK_DIR and ITK_VERSION_MAJOR
+  if(NOT ${ITK_VERSION_MAJOR} EQUAL 4)
+    set(RecompileITK ON)
+  else() # NO recompile ITK
     # If ITK not recompiled, look for SlicerExecutionModel
     find_package(SlicerExecutionModel) # Not required because will be recompiled if not found
     if(SlicerExecutionModel_FOUND)
@@ -199,16 +198,15 @@
       message(WARNING "SlicerExecutionModel not found. It will be downloaded and recompiled.")
       set(RecompileSEM ON)
     endif(SlicerExecutionModel_FOUND)
-
-  else(ITK_FOUND)
-    message(WARNING "ITK not found. ITKv4.4.0 will be downloaded and recompiled.")
-    set(RecompileITK ON) # Automatically recompile SlicerExecutionModel
-  endif(ITK_FOUND)
-endif() # COMPILE_EXTERNAL_dtiprocessTK OR COMPILE_EXTERNAL_BRAINS OR COMPILE_EXTERNAL_ANTS OR COMPILE_EXTERNAL_ResampleDTI
+  endif() # (${ITK_VERSION_MAJOR} NOT EQUAL 4)
+else(ITK_FOUND)
+  set(RecompileITK ON) # Automatically recompile SlicerExecutionModel
+endif(ITK_FOUND)

 set(ITK_DEPEND "")
 set(RecompileBatchMake OFF)
 if(RecompileITK)
+  message("ITKv4 not found. It will be downloaded and recompiled, unless a path is manually specified in the ITK_DIR variable.") # Not a Warning = just info
   # Download and compile ITKv4
   ExternalProject_Add(I4 # BRAINSStandAlone/SuperBuild/External_ITKv4.cmake # !! All args needed as they are # Name shorten from ITKv4 because Windows ITKv4 path limited to 50 chars
     GIT_REPOSITORY "${git_protocol}://itk.org/ITK.git"
@@ -234,7 +232,7 @@
 #      -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_CURRENT_BINARY_DIR}/ITKv4-build/lib # Needed for BRAINSTools to compile
 #      -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_CURRENT_BINARY_DIR}/ITKv4-build/bin # Needed for BRAINSTools to compile
     )
-  set(ITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4-i/lib/cmake/ITK-4.4) # Use the downloaded ITK for all tools # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
+  set(ITK_DIR ${CMAKE_CURRENT_BINARY_DIR}/I4-i/lib/cmake/ITK-4.4 FORCE) # Use the downloaded ITK for all tools # Path shorten from ITKv4 because Windows SOURCE_DIR path limited to 50 chars
   set(ITK_DEPEND I4)
   set(RecompileSEM ON) # If recompile ITK, recompile SlicerExecutionModel
   set(RecompileBatchMake ON) # If recompile ITK, recompile BatchMake


COMP: Ensure client project can find externally build ITK module

This commit fixes a regression introduced in 5b09d5466 (COMP: Allow
install lib directory name changes).

Client project not explicitly setting CMAKE_INSTALL_LIBDIR (or including
the "GNUInstallDirs" CMake module) would fail to find externally build
ITK module.

This commit addresses this by setting CMAKE_INSTALL_LIBDIR default value
to "lib". This approach is consistent with how the CMAKE_INSTALL_LIBDIR
default value is set in the top-level CMakeLists.txt.

Before this change, there was discrepancy between the value of
"/path/to/<module>.cmake" used when configuring the file and the
one used when looking up the file following a call
to "find_package(ITK COMPONENTS <module>)".

For example:

  Location of the configured file:
  /path/to/ITK-build//cmake/ITK-5.3/Modules/Ultrasound.cmake

vs

  Location expected by "itk_module_load()"
  /path/to/ITK-build/lib/cmake/ITK-5.3/Modules/Ultrasound.cmake

--- CMake/ITKModuleExternal.cmake
+++ CMake/ITKModuleExternal.cmake
@@ -48,6 +48,12 @@
 #     ITK/CMake/ITKModuleExternal.cmake -- use ITK_DIR as root
 if(NOT ITK_BINARY_DIR)
   set(ITK_BINARY_DIR ${ITK_DIR})
+endif()
+
+# Set default value for project that are not using the
+# "GNUInstallDirs" CMake module.
+if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
+  set(CMAKE_INSTALL_LIBDIR "lib")
 endif()

 # The default path when not wrapping.  Restore standard build location


Update test data.

Update test data.

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

 if(BUILD_TESTING)

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

   ExternalProject_Add(${proj}


FindOGITOR.cmake script now links to the correct library for each target

--- CMakeModules/FindOGITOR.cmake
+++ CMakeModules/FindOGITOR.cmake
@@ -45,7 +45,7 @@
 if(OGITOR_INCLUDE_DIR AND OGITOR_LIBRARY_REL AND OGITOR_LIBRARY_DBG)
 	set(OGITOR_FOUND TRUE)
 endif(OGITOR_INCLUDE_DIR AND OGITOR_LIBRARY_REL AND OGITOR_LIBRARY_DBG)
-set(OGITOR_LIBRARIES ${OGITOR_LIBRARY_REL} ${OGITOR_LIBRARY_DBG})
+set(OGITOR_LIBRARIES optimized ${OGITOR_LIBRARY_REL} debug ${OGITOR_LIBRARY_DBG})
 set(OGITOR_LIBRARIES ${OGITOR_LIBRARIES} CACHE STRING "Ogitor libraries")
 set(OGITOR_INCLUDE_DIRS ${OGITOR_INCLUDE_DIR})


Adding parasails to the package list. This should be temporary until stratimikos is fixed

--- PackagesList.cmake
+++ PackagesList.cmake
@@ -11,6 +11,7 @@
 ##---------------------------------------------------------------------------##

 SET(Profugus_PACKAGES_AND_DIRS_AND_CLASSIFICATIONS
+  ParaSails ParaSails          SS
   MCLS      MCLS               SS
   Utils     packages/Utils     SS
   Matprop   packages/Matprop   SS


r9192/sofa : cmake: fixed case error in sofa_base_collision.cmake

Former-commit-id: 1d7b782c97640ac97401df48106e9caa1af57807

--- modules/sofa/component/sofa_base_collision.cmake
+++ modules/sofa/component/sofa_base_collision.cmake
@@ -70,6 +70,6 @@
 add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})

 set(COMPILER_DEFINES "SOFA_BUILD_BASE_COLLISION")
-set(LINKER_DEPENDENCIES SofaBaseMechanics SofaRigid MiniFlowVR SofaSphFluid)
+set(LINKER_DEPENDENCIES SofaBaseMechanics SofaRigid miniFlowVR SofaSphFluid)

 include(${SOFA_CMAKE_DIR}/post.cmake)


improve add_compile_options

improve add_compile_options

--- src/common.cmake
+++ src/common.cmake
@@ -11,9 +11,8 @@
 add_compile_options(-Wall)
 add_compile_options(-Werror)
 add_compile_options(-O2)
-add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
-add_compile_options($<$<COMPILE_LANGUAGE:C>:-fobjc-arc>)
-add_compile_options($<$<COMPILE_LANGUAGE:C>:-fmodules>)
+add_compile_options(-fobjc-arc)
+add_compile_options(-fmodules)

 # Version


enforce static library

enforce static library

--- src/cmake/macros.cmake
+++ src/cmake/macros.cmake
@@ -26,7 +26,7 @@
 endmacro()

 macro(cycles_add_library target library_deps)
-  add_library(${target} ${ARGN})
+  add_library(${target} STATIC ${ARGN})

   install(TARGETS ${target} ARCHIVE DESTINATION lib)
   install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION "include" FILES_MATCHING PATTERN "*.h")


BUG: Fix issue #1939: Use -mtune=generic

to avoid build-time CPU detection of -mtune=native
to get reproducible build results.

See https://reproducible-builds.org/ for why this is good.

Fixes #1939

This PR was done while working on reproducible builds for openSUSE.

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -241,7 +241,8 @@
     set(InstructionSetOptimizationFlags
        # https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/i386-and-x86_002d64-Options.html
        # NOTE the corei7 release date was 2008
-       -mtune=native # Tune the code for the computer used compile ITK, but allow running on generic cpu archetectures
+       #-mtune=native # Tune the code for the computer used compile ITK, but allow running on generic cpu archetectures
+       -mtune=generic # for reproducible results https://github.com/InsightSoftwareConsortium/ITK/issues/1939
        -march=corei7 # Use ABI settings to support corei7 (circa 2008 ABI feature sets, core-avx circa 2013)
        )
   endif()


start 3.2.7

start 3.2.7

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -34,7 +34,7 @@
 cmake_policy(POP)

 set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set (Mathematica_CMAKE_MODULE_VERSION "3.2.6")
+set (Mathematica_CMAKE_MODULE_VERSION "3.2.7")

 # activate select policies
 if (POLICY CMP0025)


add Mathematica 12.0 to list of supported versions

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -245,7 +245,7 @@
 	set (_MathematicaApps "Mathematica" "gridMathematica Server")
 	# Mathematica product versions in order of preference
 	set (_MathematicaVersions
-		"11.3" "11.2" "11.1" "11.0"
+		"12.0" "11.3" "11.2" "11.1" "11.0"
 		"10.4" "10.3" "10.2" "10.1" "10.0"
 		"9.0" "8.0" "7.0" "6.0" "5.2")
 	# search for explicitly requested application version first


Simplify the variables used in two-phase setups of enable_pch() macro.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -460,9 +460,9 @@
 include (GenerateExportHeader)

 # Macro for precompiling header (On MSVC, the dummy C++ implementation file for precompiling the header file would be generated if not already exists)
+# This macro should be called before the CMake target has been added
+# Typically, user should indirectly call this macro by using the 'PCH' option when calling define_source_file() macro
 macro (enable_pch HEADER_PATHNAME)
-    set (${TARGET_NAME}_HEADER_PATHNAME ${HEADER_PATHNAME})
-
     # Determine the precompiled header output filename
     get_filename_component (HEADER_FILENAME ${HEADER_PATHNAME} NAME)
     if (CMAKE_COMPILER_IS_GNUCXX)
@@ -475,7 +475,7 @@

     if (MSVC)
         get_filename_component (NAME_WE ${HEADER_FILENAME} NAME_WE)
-        if (TARGET_NAME AND TARGET ${TARGET_NAME})
+        if (TARGET ${TARGET_NAME})
             foreach (FILE ${SOURCE_FILES})
                 if (FILE MATCHES \\.cpp$)
                     if (FILE MATCHES ${NAME_WE}\\.cpp$)
@@ -490,9 +490,10 @@
                     endif ()
                 endif ()
             endforeach ()
+            unset (${TARGET_NAME}_HEADER_PATHNAME)
         else ()
             # The target has not been created yet, so set an internal variable to come back here again later
-            set (${TARGET_NAME}_ENABLE_PCH 1)
+            set (${TARGET_NAME}_HEADER_PATHNAME ${HEADER_PATHNAME})
             # But proceed to add the dummy C++ implementation file if necessary
             set (CXX_FILENAME ${NAME_WE}.cpp)
             get_filename_component (PATH ${HEADER_PATHNAME} PATH)
@@ -507,7 +508,7 @@
         endif ()
     else ()
         # GCC or Clang
-        if (TARGET_NAME AND TARGET ${TARGET_NAME})
+        if (TARGET ${TARGET_NAME})
             # Cache the compiler flags setup for the current scope so far
             get_directory_property (COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
             get_directory_property (INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES)
@@ -552,9 +553,10 @@
                     endif ()
                 endif ()
             endforeach ()
+            unset (${TARGET_NAME}_HEADER_PATHNAME)
         else ()
             # The target has not been created yet, so set an internal variable to come back here again later
-            set (${TARGET_NAME}_ENABLE_PCH 1)
+            set (${TARGET_NAME}_HEADER_PATHNAME ${HEADER_PATHNAME})
             # But proceed to add the dummy source file(s) to trigger the custom command output rule
             if (CMAKE_CONFIGURATION_TYPES)
                 # Multi-config, trigger all rules and let the compiler to choose which precompiled header is suitable to use
@@ -578,7 +580,7 @@
     define_dependency_libs (${TARGET_NAME})
     target_link_libraries (${TARGET_NAME} ${ABSOLUTE_PATH_LIBS} ${LIBS})
     # Enable PCH if requested
-    if (${TARGET_NAME}_ENABLE_PCH)
+    if (${TARGET_NAME}_HEADER_PATHNAME)
         enable_pch (${${TARGET_NAME}_HEADER_PATHNAME})
     endif ()


ctkMacroCompilePythonScript - Simplify code using "LIST(APPEND ... "

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -53,8 +53,8 @@
                         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
                         OUTPUT ${tgt}
                         COMMENT "Copying python script: ${file}")
-    SET(copied_python_files ${copied_python_files} ${tgt})
-    SET(copied_files ${copied_files} ${tgt})
+    LIST(APPEND copied_python_files ${tgt})
+    LIST(APPEND copied_files ${tgt})
   ENDFOREACH()

   IF(DEFINED MY_RESOURCES)
@@ -66,7 +66,7 @@
                           COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
                           OUTPUT ${tgt}
                           COMMENT "Copying python resource: ${file}")
-      SET(copied_files ${copied_files} ${tgt})
+      LIST(APPEND copied_files ${tgt})
     ENDFOREACH()
   ENDIF()


Change deprecation message for python option

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -379,12 +379,18 @@
   endif()
 endforeach()

-#---Deprecated options---------------------------------------------------------
-foreach(opt memstat vmc python)
+#---Deprecated options------------------------------------------------------------------------
+foreach(opt memstat vmc)
   if(${opt})
     message(DEPRECATION ">>> Option '${opt}' is deprecated and will be removed in the next release of ROOT. Please contact root-dev@cern.ch should you still need it.")
   endif()
 endforeach()
+
+#---Replaced options--------------------------------------------------------------------------
+if(python)
+  message(DEPRECATION ">>> Please use the equivalent option 'pyroot' instead of 'python'; the latter will be removed in v6.22.")
+  set(pyroot ON CACHE BOOL "" FORCE)
+endif()

 #---Avoid creating dependencies to 'non-standard' header files -------------------------------
 include_regular_expression("^[^.]+$|[.]h$|[.]icc$|[.]hxx$|[.]hpp$")


Update Libevent release.

Update Libevent release.

--- cmake/projects/Libevent/hunter.cmake
+++ cmake/projects/Libevent/hunter.cmake
@@ -2,14 +2,21 @@

 include(hunter_add_version)
 include(hunter_cacheable)
+include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)

 hunter_add_version(
     PACKAGE_NAME Libevent
     VERSION "2.1.8"
-    URL "https://github.com/isaachier/libevent/archive/hunter-2.1.8-p2.tar.gz"
-    SHA1 "a82155f66165a46283682f8128d2afeb2c6c068c")
+    URL "https://github.com/isaachier/libevent/archive/hunter-2.1.8-p4.tar.gz"
+    SHA1 "241616673bf8b13b69771c4969dc37d8d3954cbd")
+
+hunter_cmake_args(Libevent CMAKE_ARGS
+                  EVENT__DISABLE_TESTS=ON
+                  EVENT__DISABLE_SAMPLES=ON
+                  EVENT__DISABLE_REGRESS=ON
+                  EVENT__DISABLE_BENCHMARK=ON)

 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(Libevent)


TRAVIS: enable c++11 for muparserx

TRAVIS: enable c++11 for muparserx

--- Utilities/Maintenance/TravisBuild.cmake
+++ Utilities/Maintenance/TravisBuild.cmake
@@ -57,7 +57,7 @@
 OTB_USE_OPENGL:BOOL=ON
 OTB_USE_GLEW:BOOL=ON
 CMAKE_C_FLAGS:STRING=-Wextra
-CMAKE_CXX_FLAGS:STRING=-Wextra -Wno-gnu-static-float-init -Wno-\\#warnings
+CMAKE_CXX_FLAGS:STRING=-Wextra -Wno-gnu-static-float-init -Wno-\\#warnings -std=c++11
 CMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}
 QT_INSTALL_TRANSLATIONS:PATH=${XDK_INSTALL_DIR}/translations
 QT_MOC_EXECUTABLE:FILEPATH=${XDK_INSTALL_DIR}/bin/moc


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

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


ENH: detect required ITK modules

ENH: detect required ITK modules

--- Modules/ThirdParty/ITK/otb-module-init.cmake
+++ Modules/ThirdParty/ITK/otb-module-init.cmake
@@ -1,5 +1,86 @@
-find_package ( ITK REQUIRED )
-# TODO : ensure all necessary modules are enabled with COMPONENTS
+set(OTBITK_ITK_REQUIRED_MODULE_LIST
+    ITKCommon
+    ITKFiniteDifference
+    ITKGPUCommon
+    ITKGPUFiniteDifference
+    ITKImageAdaptors
+    ITKImageFunction
+    ITKMesh
+    ITKQuadEdgeMesh
+    ITKSpatialObjects
+    #ITKTestKernel
+    ITKTransform
+
+    ITKAnisotropicSmoothing
+    ITKAntiAlias
+    ITKBiasCorrection
+    ITKBinaryMathematicalMorphology
+    ITKColormap
+    ITKConvolution
+    ITKCurvatureFlow
+    ITKDeconvolution
+    ITKDenoising
+    #ITKDiffusionTensorImage
+    ITKDisplacementField
+    ITKDistanceMap
+    ITKFastMarching
+    ITKFFT
+    ITKGPUAnisotropicSmoothing
+    ITKGPUImageFilterBase
+    ITKGPUSmoothing
+    ITKGPUThresholding
+    ITKImageCompare
+    ITKImageCompose
+    ITKImageFeature
+    ITKImageFilterBase
+    ITKImageFusion
+    ITKImageGradient
+    ITKImageGrid
+    ITKImageIntensity
+    ITKImageLabel
+    ITKImageSources
+    ITKImageStatistics
+    ITKLabelMap
+    ITKMathematicalMorphology
+    ITKPath
+    ITKQuadEdgeMeshFiltering
+    ITKSmoothing
+    ITKSpatialFunction
+    ITKThresholding
+
+    ITKEigen
+    #ITKFEM
+    ITKNarrowBand
+    ITKNeuralNetworks
+    ITKOptimizers
+    ITKOptimizersv4
+    ITKPolynomials
+    ITKStatistics
+
+    ITKRegistrationCommon
+    #ITKFEMRegistration
+    ITKGPURegistrationCommon
+    ITKGPUPDEDeformableRegistration
+    ITKMetricsv4
+    ITKPDEDeformableRegistration
+    ITKRegistrationMethodsv4
+
+    #ITKBioCell
+    ITKClassifiers
+    ITKConnectedComponents
+    ITKDeformableMesh
+    ITKKLMRegionGrowing
+    ITKLabelVoting
+    ITKLevelSets
+    ITKLevelSetsv4
+    #ITKLevelSetsv4Visualization
+    ITKMarkovRandomFieldsClassifiers
+    ITKRegionGrowing
+    ITKSignedDistanceFunction
+    ITKVoronoi
+    ITKWatersheds)
+
+find_package ( ITK COMPONENTS ${OTBITK_ITK_REQUIRED_MODULE_LIST})

 # set ( ITK_NO_IO_FACTORY_REGISTER_MANAGER TRUE )
 # include (${ITK_USE_FILE})


Fix configure.cmake for Alpine Linux

Fix configure.cmake for Alpine Linux

--- src/Native/Unix/configure.cmake
+++ src/Native/Unix/configure.cmake
@@ -467,16 +467,28 @@
     HAVE_TCP_VAR_H
 )

+check_include_files(
+    sys/cdefs.h
+    HAVE_SYS_CDEFS_H)
+
+if (HAVE_SYS_CDEFS_H)
+    set(CMAKE_REQUIRED_DEFINITIONS "-DHAVE_SYS_CDEFS_H")
+endif()
+
 # If sys/cdefs is not included on Android, this check will fail because
 # __BEGIN_DECLS is not defined
 check_cxx_source_compiles(
     "
+#ifdef HAVE_SYS_CDEFS_H
     #include <sys/cdefs.h>
+#endif
     #include <netinet/tcp.h>
     int main() { int x = TCP_ESTABLISHED; return x; }
     "
     HAVE_TCP_H_TCPSTATE_ENUM
 )
+
+set(CMAKE_REQUIRED_DEFINITIONS)

 check_symbol_exists(
     TCPS_ESTABLISHED


trivial: Fix layout of introspection-search script

--- data/cmake/FindGI.cmake
+++ data/cmake/FindGI.cmake
@@ -12,53 +12,53 @@
 # INTROSPECTION_LIBS
 #
 # Copyright (C) 2010, Pino Toscano, <pino@kde.org>
-#		2011, Matthias Klumpp <matthias@tenstral.net>
+#               2011, Matthias Klumpp <matthias@tenstral.net>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname)
-execute_process(
-COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0
-OUTPUT_VARIABLE _result
-RESULT_VARIABLE _null
-)
+  execute_process(
+    COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0
+    OUTPUT_VARIABLE _result
+    RESULT_VARIABLE _null
+  )

-if (_null)
-else()
-string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
-string(REGEX REPLACE " +$" "" _result "${_result}")
-separate_arguments(_result)
-set(${_outvar} ${_result} CACHE INTERNAL "")
-endif()
+  if (_null)
+  else()
+    string(REGEX REPLACE "[\r\n]" " " _result "${_result}")
+    string(REGEX REPLACE " +$" "" _result "${_result}")
+    separate_arguments(_result)
+    set(${_outvar} ${_result} CACHE INTERNAL "")
+  endif()
 endmacro(_GIR_GET_PKGCONFIG_VAR)

 find_package(PkgConfig)
 if(PKG_CONFIG_FOUND)
-if(PACKAGE_FIND_VERSION_COUNT GREATER 0)
-set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}")
-endif()
-pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp})
-if(_pc_gir_FOUND)
-set(INTROSPECTION_FOUND TRUE)
-_gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner")
-_gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler")
-_gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate")
-_gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir")
-_gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir")
-set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}")
-set(INTROSPECTION_LIBS "${_pc_gir_LIBS}")
-endif()
+  if(PACKAGE_FIND_VERSION_COUNT GREATER 0)
+    set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}")
+  endif()
+  pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp})
+  if(_pc_gir_FOUND)
+    set(INTROSPECTION_FOUND TRUE)
+    _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner")
+    _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler")
+    _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate")
+    _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir")
+    _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir")
+    set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}")
+    set(INTROSPECTION_LIBS "${_pc_gir_LIBS}")
+  endif()
 endif()

 mark_as_advanced(
-INTROSPECTION_SCANNER
-INTROSPECTION_COMPILER
-INTROSPECTION_GENERATE
-INTROSPECTION_GIRDIR
-INTROSPECTION_TYPELIBDIR
-INTROSPECTION_CFLAGS
-INTROSPECTION_LIBS
+  INTROSPECTION_SCANNER
+  INTROSPECTION_COMPILER
+  INTROSPECTION_GENERATE
+  INTROSPECTION_GIRDIR
+  INTROSPECTION_TYPELIBDIR
+  INTROSPECTION_CFLAGS
+  INTROSPECTION_LIBS
 )

 function(find_gir id name)


added make rules for SunOS

added make rules for SunOS

--- deps/uv.cmake
+++ deps/uv.cmake
@@ -92,10 +92,6 @@
     ${LIBUVDIR}/src/win/winsock.h
   )
 else()
-  add_definitions(
-    -D__EXTENSIONS__
-    -D_XOPEN_SOURCE=500
-  )
   include_directories(${LIBUVDIR}/src/unix)
   set(SOURCES ${SOURCES}
     ${LIBUVDIR}/include/uv-unix.h
@@ -155,6 +151,17 @@
   )
 endif()

+## SunOS
+if("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
+  add_definitions(
+    -D__EXTENSIONS__
+    -D_XOPEN_SOURCE=500
+  )
+  set(SOURCES ${SOURCES}
+    ${LIBUVDIR}/src/unix/sunos.c
+  )
+endif()
+
 ## Darwin
 if(APPLE)
   add_definitions(
@@ -195,6 +202,14 @@
   )
 endif()

+if("${CMAKE_SYSTEM_NAME}" MATCHES "SunOS")
+  target_link_libraries(uv
+    kstat
+    socket
+    sendfile
+  )
+endif()
+
 if(APPLE)
   find_library(FOUNDATION_LIBRARY Foundation)
   find_library(CORESERVICES_LIBRARY CoreServices)


maybe?

maybe?

--- CMake/GOMCCUDASetup.cmake
+++ CMake/GOMCCUDASetup.cmake
@@ -9,6 +9,7 @@
 ######## For CUDA Debugging in Eclipse/cuda-gdb
 set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")

+include_directories(src/GPU)
 #set(CUDA_VERBOSE_BUILD ON)
 set(CUDA_SEPARABLE_COMPILATION ON)


Revert "headers are added as target_sources, don't need fake target"

This reverts commit e6f26b084efe26eb30d9f81ecf0890ac07a9292d.

--- cmake/CaneyInternalAddComponent.cmake
+++ cmake/CaneyInternalAddComponent.cmake
@@ -106,6 +106,9 @@
 		target_include_directories("caney-objects-${_comp}" INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
 		target_link_libraries("caney-objects-${_comp}" INTERFACE ${args_PRIVATE_LINK} ${args_LINK})

+		# make the files show up in qtcreator; target_sources doesn't seem to do the trick here.
+		add_custom_target("caney-objects-${_comp}-headers" SOURCES ${args_HEADERS})
+
 		add_library("caney-static-${_comp}" INTERFACE)
 		target_link_libraries("caney-static-${_comp}" INTERFACE "caney-objects-${_comp}")


[CMake] Include apinotes in StandaloneOverlay.cmake (#21928)

...because the Darwin overlay is responsible for installing them.

Context: Within Apple, overlays are sometimes built separately from
the rest of the Swift project. This doesn't currently work with just
the public repo (rdar://problem/47324189), but it could, and I broke
it with my recent API notes cleanup. This should get things working
again.

rdar://problem/47294352

--- cmake/modules/StandaloneOverlay.cmake
+++ cmake/modules/StandaloneOverlay.cmake
@@ -61,6 +61,7 @@
 # Some overlays include the runtime's headers,
 # and some of those headers are generated at build time.
 add_subdirectory("${SWIFT_SOURCE_DIR}/include" "swift/include")
+add_subdirectory("${SWIFT_SOURCE_DIR}/apinotes" "swift/apinotes")

 # Without this line, installing components is broken. This needs refactoring.
 swift_configure_components()


version 0.0.0.3 ;)

version 0.0.0.3 ;)

--- PluginConfig.cmake
+++ PluginConfig.cmake
@@ -11,13 +11,13 @@

 # ActiveX constants:
 set(FBTYPELIB_NAME FBVLCLib)
-set(FBTYPELIB_DESC "FBVLC 0.0.0.2 Type Library")
+set(FBTYPELIB_DESC "FBVLC 0.0.0.3 Type Library")
 set(IFBControl_DESC "FBVLC Control Interface")
 set(FBControl_DESC "FBVLC Control Class")
 set(IFBComJavascriptObject_DESC "FBVLC IComJavascriptObject Interface")
 set(FBComJavascriptObject_DESC "FBVLC ComJavascriptObject Class")
 set(IFBComEventSource_DESC "FBVLC IFBComEventSource Interface")
-set(AXVERSION_NUM "0.0.0.2")
+set(AXVERSION_NUM "0.0.0.3")

 # NOTE: THESE GUIDS *MUST* BE UNIQUE TO YOUR PLUGIN/ACTIVEX CONTROL!  YES, ALL OF THEM!
 set(FBTYPELIB_GUID a6283703-2b52-5487-b262-119d9bf8c79c)
@@ -34,7 +34,7 @@
 # strings
 set(FBSTRING_CompanyName "RSATom")
 set(FBSTRING_PluginDescription "VLC Web Plugin (powered by FireBreath)")
-set(FBSTRING_PLUGIN_VERSION "0.0.0.2")
+set(FBSTRING_PLUGIN_VERSION "0.0.0.3")
 set(FBSTRING_LegalCopyright "Copyright 2012 RSATom")
 set(FBSTRING_PluginFileName "np${PLUGIN_NAME}.dll")
 set(FBSTRING_ProductName "FireBreathed VLC")


ilastik.cmake: Updated git tag.

ilastik.cmake: Updated git tag.

--- ilastik.cmake
+++ ilastik.cmake
@@ -28,7 +28,7 @@
 include (cylemon)

 external_git_repo (ilastik
-    flyem-20130701
+    flyem-20130702
     http://github.com/janelia-flyem/flyem-ilastik)

 message ("Installing ${ilastik_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")


Pull Request #236. Fix Freetype detection

--HG--
branch : v1-9

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)
@@ -43,7 +43,7 @@
 findpkg_framework(FREETYPE)
 message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")

-find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2)
+find_path(FREETYPE_INCLUDE_DIR NAMES freetype.h freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2)
 find_path(FREETYPE_FT2BUILD_INCLUDE_DIR NAMES ft2build.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS})

 find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel)


Fix copy error in FindHIREDIS.cmake

Fix copy error in FindHIREDIS.cmake

--- cmake/FindHIREDIS.cmake
+++ cmake/FindHIREDIS.cmake
@@ -1,9 +1,9 @@
 find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
-  pkg_check_modules(SHARED_HIREDIS REQUIRED hiredis)
+  pkg_search_module(SHARED_HIREDIS REQUIRED hiredis)
 endif()

-find_path(HIREDIS_INCLUDE_DIR msgpack.h
+find_path(HIREDIS_INCLUDE_DIR hiredis/hiredis.h
   HINTS ${SHARED_HIREDIS_INCLUDEDIR} ${SHARED_HIREDIS_INCLUDE_DIRS}
   ${LIMIT_SEARCH})


Fix the cmake finder

Fix the cmake finder

Modify the cmake finder to find kpeoplewidgets as well
Properly find the kpeople include directory

--- cmake/FindKPeople.cmake
+++ cmake/FindKPeople.cmake
@@ -13,7 +13,7 @@

 find_library(KPEOPLE_LIBRARY NAMES kpeople HINTS ${KDE4_LIB_INSTALL_DIR} ${QT_LIBRARY_DIR})

-find_path(KPEOPLE_INCLUDE_DIR NAMES kpeople/kpeople_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR})
+find_path(KPEOPLE_INCLUDE_DIR NAMES kpeople_export.h HINTS ${KDE4_INCLUDE_INSTALL_DIR} ${QT_INCLUDE_DIR} ${INCLUDE_INSTALL_DIR} PATH_SUFFIXES kpeople)

 if(KPEOPLE_INCLUDE_DIR AND KPEOPLE_LIBRARY)
    set(KPEOPLE_LIBS ${kpeople_LIB_DEPENDS} ${KPEOPLE_LIBRARY})


build: use uppercase XRENDER_FOUND

build: use uppercase XRENDER_FOUND

FIND_PACKAGE_HANDLE_STANDARD_ARGS sets <UPPERCASED_NAME>_FOUND

--- cmake/FindXrender.cmake
+++ cmake/FindXrender.cmake
@@ -26,18 +26,18 @@
 # limitations under the License.
 #=============================================================================

-find_path(Xrender_INCLUDE_DIR NAMES X11/extensions/Xrender.h
+find_path(XRENDER_INCLUDE_DIR NAMES X11/extensions/Xrender.h
           DOC "The Xrender include directory")

-find_library(Xrender_LIBRARY NAMES Xrender
+find_library(XRENDER_LIBRARY NAMES Xrender
           DOC "The Xrender library")

 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xrender DEFAULT_MSG Xrender_LIBRARY Xrender_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Xrender DEFAULT_MSG XRENDER_LIBRARY XRENDER_INCLUDE_DIR)

-if(Xrender_FOUND)
-	set(XRENDER_LIBRARIES ${Xrender_LIBRARY})
-	set(XRENDER_INCLUDE_DIRS ${Xrender_INCLUDE_DIR})
+if(XRENDER_FOUND)
+	set(XRENDER_LIBRARIES ${XRENDER_LIBRARY})
+	set(XRENDER_INCLUDE_DIRS ${XRENDER_INCLUDE_DIR})
 endif()

 mark_as_advanced(XRENDER_INCLUDE_DIRS XRENDER_LIBRARIES)


Work around Gtest build failure caused by -Werror=unused-function. (#529)

We're propagating extra warning flags to the gtest build, which
can cause it to fail. This patch prevents passing "-Wextra" to
gtest, since the library itself doesn't test with that flag.

--- cmake/HandleGTest.cmake
+++ cmake/HandleGTest.cmake
@@ -23,6 +23,11 @@
   if ("${GTEST_BUILD_TYPE}" STREQUAL "COVERAGE")
     set(GTEST_BUILD_TYPE "DEBUG")
   endif()
+  # FIXME: Since 10/Feb/2017 the googletest trunk has had a bug where
+  # -Werror=unused-function fires during the build on OS X. This is a temporary
+  # workaround to keep our travis bots from failing. It should be removed
+  # once gtest is fixed.
+  list(APPEND GTEST_FLAGS "-Wno-unused-function")
   split_list(GTEST_FLAGS)
   ExternalProject_Add(googletest
       EXCLUDE_FROM_ALL ON


install shared libraries

install shared libraries

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@777 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -91,7 +91,9 @@
         VERSION ${PCL_VERSION}
         SOVERSION ${PCL_MAJOR_VERSION}
         DEFINE_SYMBOL "PCLAPI_EXPORTS")
-    install(TARGETS ${_name} LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+    install(TARGETS ${_name}
+        RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+        LIBRARY DESTINATION ${LIB_INSTALL_DIR}
         ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
         COMPONENT ${_component})
 endmacro(PCL_ADD_LIBRARY)


output mpi configure variables

output mpi configure variables

--- cmake/vSMCFindMPI.cmake
+++ cmake/vSMCFindMPI.cmake
@@ -12,7 +12,6 @@
     INCLUDE (FindMPI)
     IF (MPI_CXX_FOUND)
         MESSAGE (STATUS "Found MPI_CXX_INCLUDE_PATH: ${MPI_CXX_INCLUDE_PATH}")
-        MESSAGE (STATUS "Found MPIEXEC: ${MPIEXEC}")
     ENDIF (MPI_CXX_FOUND)
     IF (NOT Boost_MPI_FOUND OR NOT Boost_SERIALIZATION_FOUND)
         FIND_PACKAGE (Boost COMPONENTS mpi serialization)
@@ -22,7 +21,6 @@
         SET (VSMC_MPI_LINK_LIBRARIES
             ${Boost_MPI_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
             ${MPI_CXX_LIBRARIES} CACHE STRING "MPI Link Libraries")
-        MESSAGE (STATUS "VSMC_MPI_LINK_LIBRARIES: ${VSMC_MPI_LINK_LIBRARIES}")
         IF (NOT DEFINED VSMC_MPIEXEC)
             SET (VSMC_MPIEXEC ${MPIEXEC} CACHE STRING "MPIEXEC")
         ENDIF (NOT DEFINED VSMC_MPIEXEC)
@@ -38,7 +36,14 @@
             SET (VSMC_MPIEXEC_POSTFLAGS ${MPIEXEC_POSTFLAGS}
                 CACHE STRING "MPIEXEC")
         ENDIF (NOT DEFINED VSMC_MPIEXEC_POSTFLAGS)
+        MESSAGE (STATUS "VSMC_MPI_LINK_LIBRARIES: ${VSMC_MPI_LINK_LIBRARIES}")
+        MESSAGE (STATUS "VSMC_MPIEXEC: ${VSMC_MPIEXEC}")
+        MESSAGE (STATUS "VSMC_MPIEXEC_NUMPROC_FLAG: ${VSMC_MPIEXEC_NUMPROC_FLAG}")
+        MESSAGE (STATUS "VSMC_MPIEXEC_PREFLAGS: ${VSMC_MPIEXEC_PREFLAGS}")
+        MESSAGE (STATUS "VSMC_MPIEXEC_POSTFLAGS: ${VSMC_MPIEXEC_POSTFLAGS}")
+        MESSAGE (STATUS "Found MPI")
     ELSE (MPI_CXX_FOUND AND Boost_FOUND)
+        MESSAGE (STATUS "NOT Found MPI")
         SET (VSMC_MPI_FOUND FALSE CACHE BOOL "NOT Found MPI")
     ENDIF (MPI_CXX_FOUND AND Boost_FOUND)
 ENDIF (NOT DEFINED VSMC_MPI_FOUND)


BUILD: Fix python linking

BUILD: Fix python linking

--- cmake/wrap-python.cmake
+++ cmake/wrap-python.cmake
@@ -13,6 +13,7 @@
   add_library(${library_name}PythonD ${generated_python_sources})
   add_library(${library_name}Python MODULE ${library_name}PythonInit.cxx)
   target_link_libraries(${library_name}PythonD ${library_name})
+  target_link_libraries(${library_name}PythonD vtkCommonCorePythonD vtkCommonExecutionModelPythonD)
   #foreach(c ${VTK_LIBRARIES})
   #  target_link_libraries(${library_name}PythonD ${c}PythonD)
   #endforeach(c)


cmake: Error-out when 'project' is invoked too early

Error-out when 'project' is invoked before boilerplate.cmake is
included. This is not supported and causes obscure errors.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -27,6 +27,14 @@
 # to the new behaviour.
 # CMP0079: "target_link_libraries() allows use with targets in other directories"
 cmake_policy(SET CMP0079 OLD)
+
+# Error-out if 'project' has been invoked to avoid obscure user
+# errors.
+if(DEFINED CMAKE_PROJECT_NAME)
+  message(FATAL_ERROR
+    "'project()' was called before boilerplate.cmake was included, this is not supported."
+    )
+endif()

 define_property(GLOBAL PROPERTY ZEPHYR_LIBS
     BRIEF_DOCS "Global list of all Zephyr CMake libs that should be linked in"


[CMake] Rename target->dest as per feedback from Chapuni on http://reviews.llvm.org/D12864

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1023,28 +1023,28 @@
   endif()
 endfunction()

-function(add_llvm_tool_symlink name target)
+function(add_llvm_tool_symlink name dest)
   if(UNIX)
     set(LLVM_LINK_OR_COPY create_symlink)
-    set(target_binary "${target}${CMAKE_EXECUTABLE_SUFFIX}")
+    set(dest_binary "${dest}${CMAKE_EXECUTABLE_SUFFIX}")
   else()
     set(LLVM_LINK_OR_COPY copy)
-    set(target_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}")
+    set(dest_binary "${LLVM_RUNTIME_OUTPUT_INTDIR}/${dest}${CMAKE_EXECUTABLE_SUFFIX}")
   endif()

   set(output_path "${LLVM_RUNTIME_OUTPUT_INTDIR}/${name}${CMAKE_EXECUTABLE_SUFFIX}")

   add_custom_command(OUTPUT ${output_path}
-                     COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${target_binary}" "${output_path}"
-                     DEPENDS ${target})
+                     COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${dest_binary}" "${output_path}"
+                     DEPENDS ${dest})

   add_custom_target(${name} ALL DEPENDS ${output_path})
   set_target_properties(${name} PROPERTIES FOLDER Tools)

-  # MAke sure the parent tool is a toolchain tool, otherwise exclude this tool
-  list(FIND LLVM_TOOLCHAIN_TOOLS ${target} LLVM_IS_${target}_TOOLCHAIN_TOOL)
-  if (NOT LLVM_IS_${target}_TOOLCHAIN_TOOL GREATER -1)
-    set(LLVM_IS_${name}_TOOLCHAIN_TOOL ${LLVM_IS_${target}_TOOLCHAIN_TOOL})
+  # Make sure the parent tool is a toolchain tool, otherwise exclude this tool
+  list(FIND LLVM_TOOLCHAIN_TOOLS ${dest} LLVM_IS_${dest}_TOOLCHAIN_TOOL)
+  if (NOT LLVM_IS_${dest}_TOOLCHAIN_TOOL GREATER -1)
+    set(LLVM_IS_${name}_TOOLCHAIN_TOOL ${LLVM_IS_${dest}_TOOLCHAIN_TOOL})
   else()
     list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL)
   endif()
@@ -1054,7 +1054,7 @@
   if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     if( LLVM_BUILD_TOOLS )
       install(SCRIPT ${CMAKE_SOURCE_DIR}/cmake/modules/install_symlink.cmake
-              CODE "install_symlink(${name} ${target})"
+              CODE "install_symlink(${name} ${dest})"
               COMPONENT ${name})

       if (NOT CMAKE_CONFIGURATION_TYPES)


[CMake] Install import libraries

[CMake] Install import libraries

Simplify the cmake logic to install both runtime and import
libraries (treated as ARCHIVE), as the later are needed to link
against llvm.

Patch by Julien Schueller!

Differential Revision: https://reviews.llvm.org/D61425

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -671,21 +671,6 @@
     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "LTO" OR
         ${name} STREQUAL "Remarks" OR
         (LLVM_LINK_LLVM_DYLIB AND ${name} STREQUAL "LLVM"))
-      set(install_dir lib${LLVM_LIBDIR_SUFFIX})
-      if(ARG_MODULE OR ARG_SHARED OR BUILD_SHARED_LIBS)
-        if(WIN32 OR CYGWIN OR MINGW)
-          set(install_type RUNTIME)
-          set(install_dir bin)
-        else()
-          set(install_type LIBRARY)
-        endif()
-      else()
-        set(install_type ARCHIVE)
-      endif()
-
-      if (ARG_MODULE)
-        set(install_type LIBRARY)
-      endif()

       set(export_to_llvmexports)
       if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
@@ -697,7 +682,9 @@

       install(TARGETS ${name}
               ${export_to_llvmexports}
-              ${install_type} DESTINATION ${install_dir}
+              LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+              ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+              RUNTIME DESTINATION bin
               COMPONENT ${name})

       if (NOT LLVM_ENABLE_IDE)


[CMake] Add mapping for IBM XL -qnoeh and -qnortti

Summary:
This patch maps in the `-qnoeh` and `-qnortti` options for building with
IBM XL compilers.

Reviewers: daltenty, xingxue, jasonliu

Reviewed By: daltenty

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65669

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -28,6 +28,8 @@
     elseif(MSVC)
       list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
       list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-")
+    elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL")
+      list(APPEND LLVM_COMPILE_FLAGS "-qnoeh")
     endif()
   endif()

@@ -41,6 +43,8 @@
       list(APPEND LLVM_COMPILE_FLAGS "-fno-rtti")
     elseif (MSVC)
       list(APPEND LLVM_COMPILE_FLAGS "/GR-")
+    elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL")
+      list(APPEND LLVM_COMPILE_FLAGS "-qnortti")
     endif ()
   elseif(MSVC)
     list(APPEND LLVM_COMPILE_FLAGS "/GR")


update re2c to v2.0.2

update re2c to v2.0.2

--- cmake/modules/GetRE2C.cmake
+++ cmake/modules/GetRE2C.cmake
@@ -20,7 +20,7 @@
     download_project(
             PROJ                re2c
             GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
-            GIT_TAG             2.0.1
+            GIT_TAG             2.0.2
             GIT_PROGRESS        1
     )


Removed MSYS from list of conditions: MSYS now relies on Windows API for dynamic drivers. This works fine if you start the program in a DOS-box, but it does notwork under rxvt, the MSYS-specific shell. The reason is completely obscure, as the program's output to the standard out channel is buffered by that shell. However, as it works when run via the ordinary means, I think it is okay to make the change. (Previously, enabling dynamic drivers failed on the lack of libtool for this platform)

svn path=/trunk/; revision=9859

--- cmake/modules/drivers.cmake
+++ cmake/modules/drivers.cmake
@@ -25,7 +25,7 @@
 # ENABLE_DYNDRIVERS (ON or OFF): whether to dynamically load device drivers.
 # PLD_devicename (ON or OFF): whether each PLplot-related device is enabled
 #   or not.  devicename is png, jpeg, etc.
-# devicename_COMPILE_FLAGS: compile (e.g., -I) options for each individual
+# devicename_COMPILE_FLAGS: compile (e.g., -I) options for each individual
 #   device.
 # devicename_LINK_FLAGS: link options (e.g., -L  and -l) for each
 #   individual device.
@@ -37,17 +37,17 @@
 set(DRIVERS_LINK_FLAGS)
 option(ENABLE_DYNDRIVERS "Enable dynamic loading of device drivers" ON)
 if(ENABLE_DYNDRIVERS AND NOT BUILD_SHARED_LIBS)
-  message(STATUS
+  message(STATUS
     "WARNING: Shared libraries not built. Setting ENABLE_DYNDRIVERS OFF."
     )
-  set(ENABLE_DYNDRIVERS OFF CACHE BOOL
+  set(ENABLE_DYNDRIVERS OFF CACHE BOOL
     "Enable dynamic loading of device drivers" FORCE)
 endif(ENABLE_DYNDRIVERS AND NOT BUILD_SHARED_LIBS)
 if(ENABLE_DYNDRIVERS AND WIN32)
-  if(NOT CYGWIN AND NOT MSYS)
+  if(NOT CYGWIN)
     set(LTDL_WIN32 ON)
     set(LTDL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
-  endif(NOT CYGWIN AND NOT MSYS)
+  endif(NOT CYGWIN)
 endif(ENABLE_DYNDRIVERS AND WIN32)
 if(ENABLE_DYNDRIVERS AND NOT LTDL_WIN32)
   find_package(LTDL)
@@ -57,12 +57,12 @@
     message(STATUS "LTDL_LIBRARY_DIR = ${LTDL_LIBRARY_DIR}")
     message(STATUS "LTDL_LIBRARIES = ${LTDL_LIBRARIES}")
   else(LTDL_FOUND)
-    message(STATUS
+    message(STATUS
       "WARNING: libltdl library not found. Setting ENABLE_DYNDRIVERS OFF.\n"
       "   Please install that library and/or set the environment variables\n"
       "   CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH appropriately."
       )
-    set(ENABLE_DYNDRIVERS OFF CACHE BOOL
+    set(ENABLE_DYNDRIVERS OFF CACHE BOOL
       "Enable dynamic loading of device drivers" FORCE)
   endif(LTDL_FOUND)
 endif(ENABLE_DYNDRIVERS AND NOT LTDL_WIN32)
@@ -74,7 +74,7 @@
 include(drivers-init)

 # Find *_COMPILE_FLAGS and *_LINK_FLAGS resources for device drivers that need them,
-# and set appropriate PLD_devicename to OFF if the required resources are
+# and set appropriate PLD_devicename to OFF if the required resources are
 # not available.
 include(cairo)
 include(cgm)


ilastik: Added iiboost dependency

ilastik: Added iiboost dependency

--- ilastik.cmake
+++ ilastik.cmake
@@ -34,6 +34,7 @@
 include (jsonschema) # Required for the dvid extension.
 include (opengm)
 include (futures)
+include (iiboost)

 # select the desired ilastik commit
 set(DEFAULT_ILASTIK_VERSION 779685cc1e6b78b633fcd1737c5eae78e8b72ddb) # 2014-09-18
@@ -74,6 +75,11 @@
 set (ilastik_dependencies ${vigra_NAME} ${h5py_NAME} ${psutil_NAME} ${nose_NAME} ${futures_NAME}
                           ${blist_NAME} ${greenlet_NAME} ${yapsy_NAME} ${faulthandler_NAME}
                           ${cylemon_NAME} ${scikit-learn_NAME} ${jsonschema_NAME} ${opengm_NAME} )
+
+set(ILASTIK_BUILD_IIBOOST TRUE CACHE BOOL "Build support for the IIBoost synapse detection ilastik workflow.")
+if (ILASTIK_BUILD_IIBOOST)
+  set(ilastik_dependencies ${ilastik_dependencies} ${iiboost_NAME})
+endif()

 if (${build_pgmlink})
     # Tracking depends on pgmlink, which depends on CPLEX.


Clang-Tidy: include libCellML's header files.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -123,7 +123,7 @@

     # The full list of Clang-Tidy checks can be found at
     # https://clang.llvm.org/extra/clang-tidy/checks/list.html
-    set(_CLANG_TIDY_WARNINGS
+    set(_CLANG_TIDY_CHECKS
       -*
       bugprone-*
       cert-*
@@ -157,20 +157,20 @@
       -readability-magic-numbers
     )
     string(REPLACE ";" ","
-           _CLANG_TIDY_WARNINGS "${_CLANG_TIDY_WARNINGS}")
+           _CLANG_TIDY_CHECKS "${_CLANG_TIDY_CHECKS}")
     if(LIBCELLML_TREAT_WARNINGS_AS_ERRORS)
-      set(_CLANG_TIDY_WARNINGS_AS_ERRORS ";-warnings-as-errors=${_CLANG_TIDY_WARNINGS}")
+      set(_CLANG_TIDY_WARNINGS_AS_ERRORS ";-warnings-as-errors=${_CLANG_TIDY_CHECKS}")
     endif()

-    file(RELATIVE_PATH _RELATIVE_SOURCE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src)
-    set(_RELATIVE_SOURCE_PATH "${CMAKE_BINARY_DIR}/${_RELATIVE_SOURCE_PATH}")
+    file(RELATIVE_PATH _RELATIVE_SOURCE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
+    set(_RELATIVE_SOURCE_PATH "${CMAKE_BINARY_DIR}/${_RELATIVE_SOURCE_PATH}src")
     string(REPLACE "." "\\\."
            _RELATIVE_SOURCE_PATH "${_RELATIVE_SOURCE_PATH}")
     string(REPLACE "/" "\\\/"
            _RELATIVE_SOURCE_PATH "${_RELATIVE_SOURCE_PATH}")

     set_target_properties(${_TARGET} PROPERTIES
-      CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${_CLANG_TIDY_WARNINGS};-header-filter=${_RELATIVE_SOURCE_PATH}\\\/.*${_CLANG_TIDY_WARNINGS_AS_ERRORS}"
+      CXX_CLANG_TIDY "${CLANG_TIDY_EXE};-checks=${_CLANG_TIDY_CHECKS};-header-filter=${_RELATIVE_SOURCE_PATH}.*${_CLANG_TIDY_WARNINGS_AS_ERRORS}"
     )
   endif()
 endfunction()


Removed configuration.

Removed configuration.

Setting up doc step to automatically skip doc if doxygen is not found.

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -1,6 +0,0 @@
-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-	add_definitions("-std=c++11")
-endif()
-
-option(VMATH_BUILD_DOC "Built HTML documentation." ON)
-option(VMATH_BUILD_TESTS "Build tests." ON)


Remove settings about SGX in config.cmake (#6530)

removed settings about SGX since SGX is removed from TVM core

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -87,17 +87,6 @@
 # Whether enable MicroTVM runtime
 set(USE_MICRO OFF)

-# Whether to enable SGX runtime
-#
-# Possible values for USE_SGX:
-# - /path/to/sgxsdk: path to Intel SGX SDK
-# - OFF: disable SGX
-#
-# SGX_MODE := HW|SIM
-set(USE_SGX OFF)
-set(SGX_MODE "SIM")
-set(RUST_SGX_SDK "/path/to/rust-sgx-sdk")
-
 # Whether enable RPC runtime
 set(USE_RPC ON)


Build COI device per default when KNC support enabled

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -163,9 +163,7 @@
   OSPRAY_CHECK_COMPILER_SUPPORT(AVX512)

   IF (THIS_IS_MIC)
-    # whether to build in MIC/xeon phi support
-    SET(OSPRAY_BUILD_COI_DEVICE OFF CACHE BOOL
-        "Build COI Device for OSPRay's MIC support?")
+    OPTION(OSPRAY_BUILD_COI_DEVICE "Build COI Device for OSPRay's MIC support?" ON)
   ENDIF()

   INCLUDE(${PROJECT_SOURCE_DIR}/cmake/ispc.cmake)


kp ld multiple definition bugfix (#42707)

--- cmake/xpu_kp.cmake
+++ cmake/xpu_kp.cmake
@@ -15,6 +15,10 @@
 if(NOT WITH_XPU_KP)
     return()
 endif()
+
+set(LINK_FLAGS    "-Wl,--allow-multiple-definition")
+set(CMAKE_EXE_LINKER_FLAGS    "${LINK_FLAGS}")
+set(CMAKE_SHARED_LINKER_FLAGS "${LINK_FLAGS}")

 if(NOT XPU_TOOLCHAIN)
   set(XPU_TOOLCHAIN /workspace/output/XTDK-ubuntu_x86_64)


[added] BOTG_EnableFortran and change BOTG_UseCxxStandard to not use CMAKE_CXX_STANDARD--was not working.

--- cmake/BOTG.cmake
+++ cmake/BOTG.cmake
@@ -263,13 +263,21 @@
 ENDMACRO()
 #-------------------------------------------------------------------------------
 MACRO( BOTG_UseCxxStandard version )
-    IF( CMAKE_VERSION VERSION_LESS "3.1" )
-        BOTG_AddCompilerFlags( CXX "GNU|Clang" ANY
-            "-std=c++${version}"
-        )
-    ELSE()
-        SET(CMAKE_CXX_STANDARD ${version})
-    ENDIF()
+    BOTG_AddCompilerFlags( CXX "GNU|Clang" ANY
+        "-std=c++${version}"
+    )
+ENDMACRO()
+#-------------------------------------------------------------------------------
+MACRO( BOTG_EnableFortran )
+    FOREACH( directive ${ARGN} )
+        IF( directive STREQUAL "C_PREPROCESSOR" )
+            BOTG_AddCompilerFlags( Fortran "GNU|Clang" ANY "-cpp" )
+        ELSEIF( directive STREQUAL "UNLIMITED_LINE_LENGTH" )
+            BOTG_AddCompilerFlags( Fortran "GNU|Clang" ANY "-ffree-line-length-none" )
+        ELSE()
+            MESSAGE(FATAL_ERROR "[BootsOnTheGround] EnableFortran directive=${directive} is unknown!")
+        ENDIF()
+    ENDFOREACH()
 ENDMACRO()
 #-------------------------------------------------------------------------------
 MACRO( BOTG_CheckCompilerFlag lang flag found )


Force release build for dlib when not MSVS.

--- cmake/DLib.cmake
+++ cmake/DLib.cmake
@@ -36,6 +36,7 @@
     message(STATUS "  * Configure dlib library")
     execute_process(
       COMMAND ${CMAKE_COMMAND}
+        -DCMAKE_BUILD_TYPE=Release
         -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
         -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE}
         -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
@@ -80,25 +81,35 @@
     message("${_output}")
     message("============================================================")

-    message(STATUS "  * Build Debug dlib library")
-    execute_process(
-      COMMAND ${CMAKE_COMMAND} --build . --target install --config Debug -- ${build_options}
-      WORKING_DIRECTORY ${dlibprovider_BINARY_DIR}
-      OUTPUT_FILE       ${dlibprovider_BINARY_DIR}/build_output.log
-      ERROR_FILE        ${dlibprovider_BINARY_DIR}/build_output.log
-    )
-
-    file(READ "${dlibprovider_BINARY_DIR}/build_output.log" _output)
-    message("============================================================")
-    message("${_output}")
-    message("============================================================")
+    if(MSVC)
+      message(STATUS "  * Build Debug dlib library")
+      execute_process(
+	COMMAND ${CMAKE_COMMAND} --build . --target install --config Debug -- ${build_options}
+	WORKING_DIRECTORY ${dlibprovider_BINARY_DIR}
+	OUTPUT_FILE       ${dlibprovider_BINARY_DIR}/build_output.log
+	ERROR_FILE        ${dlibprovider_BINARY_DIR}/build_output.log
+	)
+
+      file(READ "${dlibprovider_BINARY_DIR}/build_output.log" _output)
+      message("============================================================")
+      message("${_output}")
+      message("============================================================")
+    endif()
   endif()

   message(STATUS "  * Create targets for dlib library")
   add_library(dlib::dlib STATIC IMPORTED)
-  set_target_properties(dlib::dlib PROPERTIES
-    IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/install/dlib/lib/${CMAKE_STATIC_LIBRARY_PREFIX}dlib${CMAKE_STATIC_LIBRARY_SUFFIX}"
-    IMPORTED_LOCATION_DEBUG "${CMAKE_BINARY_DIR}/install/dlib/lib/${CMAKE_STATIC_LIBRARY_PREFIX}dlibd${CMAKE_STATIC_LIBRARY_SUFFIX}"
-    INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/install/dlib/include"
-  )
+
+  if(MSVC)
+    set_target_properties(dlib::dlib PROPERTIES
+      IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/install/dlib/lib/${CMAKE_STATIC_LIBRARY_PREFIX}dlib${CMAKE_STATIC_LIBRARY_SUFFIX}"
+      IMPORTED_LOCATION_DEBUG "${CMAKE_BINARY_DIR}/install/dlib/lib/${CMAKE_STATIC_LIBRARY_PREFIX}dlibd${CMAKE_STATIC_LIBRARY_SUFFIX}"
+      INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/install/dlib/include"
+      )
+  else()
+    set_target_properties(dlib::dlib PROPERTIES
+      IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/install/dlib/lib/${CMAKE_STATIC_LIBRARY_PREFIX}dlib${CMAKE_STATIC_LIBRARY_SUFFIX}"
+      INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_BINARY_DIR}/install/dlib/include"
+      )
+  endif()
 endif()


Remove extra newline (#444)

Remove extra newline (#444)

--- cmake/ffig.cmake
+++ cmake/ffig.cmake
@@ -43,7 +43,6 @@
   add_custom_command(OUTPUT ${ffig_output_dir}/${module}_c.h ${ffig_output_dir}/${module}_c.cpp
     COMMAND ${PYTHON_EXECUTABLE} -m ffig -i ${input} -m ${module} -o ${ffig_output_dir} -b _c.h.tmpl _c.cpp.tmpl
     COMMAND ${CMAKE_COMMAND} -E copy_if_different ${input} ${ffig_output_dir}/
-
     DEPENDS ${input} ${FFIG_SOURCE}
     WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
     COMMENT "Generating FFIG bindings for ${module}: ${ffig_outputs}")


moving chef tests to run_sim subdirs

moving chef tests to run_sim subdirs


use ThriftCppLibrary.cmake from fbcode_builder

Summary:
Update fboss to use `ThriftCppLibrary.cmake` directly from fbcode_builder
rather than maintaining its own copy of this file.

Reviewed By: chadaustin

Differential Revision: D17005421

fbshipit-source-id: a64df426118df6088b47f09410dad7b8b7e79a43

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,6 +1,4 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
-# NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
-# needs to be changed.  TODO: this should be handled via shipit.

 include(FBCMakeParseArgs)


cmake: Fix typo of waffle_build_htmldocs

In Options.cmake, s/waffle_build_htmldoc/waffle_build_htmldocs/

Signed-off-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

--- Options.cmake
+++ Options.cmake
@@ -8,7 +8,7 @@

 option(waffle_build_tests "Build tests" ON)
 option(waffle_build_manpages "Build manpages" OFF)
-option(waffle_build_htmldoc "Build html documentation" OFF)
+option(waffle_build_htmldocs "Build html documentation" OFF)
 option(waffle_build_examples "Build example programs" ON)

 set(waffle_xsltproc "xsltproc"


i#1014: Add a cpackappend= arg to package.cmake

This gives the caller of package.cmake an escape hatch to pass arbitrary
options to cpack.

My intention is to use it like this on the bots:
cpackappend='set(CPACK_PACKAGE_FILE_NAME "DrMemory-package")'

By setting the package name, I can make the directory that cpack uses to
stage the .zip archive predictable.  I can use that to make a 7-zip
self-extracting exe of it instead of a zipfile, which is what the Chrome
scripts expect.

Review URL: https://codereview.appspot.com/6499085

git-svn-id: fe3cd4388a6e5a968b09397a3d721fe124e8117a@1021 5b54908e-ead4-fc18-b48a-0285e6dbc711

--- package.cmake
+++ package.cmake
@@ -41,6 +41,7 @@
 set(arg_preload "")    # cmake file to include prior to each 32-bit build
 set(arg_preload64 "")  # cmake file to include prior to each 64-bit build
 set(arg_use_nmake OFF) # use nmake even if gnu make is present
+set(arg_cpackappend "")# string to append to CPackConfig.cmake before packaging

 foreach (arg ${CTEST_SCRIPT_ARG})
   if (${arg} MATCHES "^build=")
@@ -63,6 +64,9 @@
   endif ()
   if (${arg} MATCHES "^cacheappend=")
     string(REGEX REPLACE "^cacheappend=" "" arg_cacheappend "${arg}")
+  endif ()
+  if (${arg} MATCHES "^cpackappend=")
+    string(REGEX REPLACE "^cpackappend=" "" arg_cpackappend "${arg}")
   endif ()
   if (${arg} MATCHES "^drmem_only" OR
       ${arg} MATCHES "^drmemory_only")
@@ -137,6 +141,14 @@
   CMAKE_BUILD_TYPE:STRING=Debug
   " OFF ON "")

+if (arg_cpackappend)
+  # ${last_package_build_dir} is a global var set in parent scope by
+  # testbuild_ex to communicate with runsuite_common_post.  We use it to access
+  # the CPackConfig.cmake file.
+  file(APPEND "${last_package_build_dir}/CPackConfig.cmake"
+    "\n${arg_cpackappend}\n")
+endif ()
+
 set(build_package ON)
 include("${runsuite_include_path}/runsuite_common_post.cmake")


Mark CMake var as internal.

Mark CMake var as internal.

This prevents an internal variable from appearing in CMake's UIs when
our CMake package is used.

--- thrust/cmake/thrust-config-version.cmake
+++ thrust/cmake/thrust-config-version.cmake
@@ -6,6 +6,7 @@
     ${CMAKE_CURRENT_LIST_DIR}/../..            # Source tree
     ${CMAKE_CURRENT_LIST_DIR}/../../../include # Install tree
 )
+set_property(CACHE _THRUST_VERSION_INCLUDE_DIR PROPERTY TYPE INTERNAL)
 file(READ "${_THRUST_VERSION_INCLUDE_DIR}/thrust/version.h" THRUST_VERSION_HEADER)
 string(REGEX MATCH "#define[ \t]+THRUST_VERSION[ \t]+([0-9]+)" DUMMY "${THRUST_VERSION_HEADER}")
 set(THRUST_VERSION_FLAT ${CMAKE_MATCH_1})