[cmake] pyhull is also a runtime dep

[cmake] pyhull is also a runtime dep

--- cmake/siconos_find_common_dep.cmake
+++ cmake/siconos_find_common_dep.cmake
@@ -203,11 +203,11 @@
       SET(SICONOS_FORCE_NPY_INT32 TRUE)
       MESSAGE(STATUS "Old version of scipy detected. Support for 64 bits int was added in 0.14.0, forcing 32 bits int for python bindings")
     ENDIF(scipy_VERSION VERSION_LESS "0.14.0")
+    find_python_module(pyhull)
+    if(NOT pyhull_FOUND)
+      message(STATUS "Warning, python pyhull package not found. Some examples may not run properly. Try pip install pyhull.")
+    endif()
   ENDIF(NOT NO_RUNTIME_BUILD_DEP)
-  find_python_module(pyhull)
-  if(NOT pyhull_FOUND)
-    message(STATUS "Warning, python pyhull package not found. Some examples may not run properly. Try pip install pyhull.")
-  endif()
 endif()


Upgrade CMake Modules Lib Loader

Upgrade CMake Modules Lib Loader

--- cmake/CMakeModulesLibLoader.cmake
+++ cmake/CMakeModulesLibLoader.cmake
@@ -1,4 +1,35 @@
+#
+#  CMake Modules Library Loader
+#
+#
+#  This module provides a load function to clone the CMake modules library into the project using git.
+#  Since this modules typically exists as a copy in the target projects, it is equipped
+#  with a version number using Semantic Versioning convention.
+#  When improving this module, please feed the changes back to the upstream project
+#  by a pull request to https://github.com/andreaskunz/cmake-modules  Thanks!
+#
+#
+#  Copyright 2021 Andreas Kunz
+#
+#  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.
+#
+#
+#  v0.1.1
+#
+
+
 cmake_minimum_required(VERSION 3.10)
+

 if(__cmake_modules_lib_loader)
   return()
@@ -12,6 +43,9 @@
     message(FATAL_ERROR "git not found!")
   endif()

+  if(${ARGC} EQUAL 1 AND ARGV0)
+    set(LIB_CMAKE_MODULES_URL ${ARGV0} CACHE STRING "The path to the origin of the cmake-modules library")
+  endif()

   if(NOT LIB_CMAKE_MODULES_CLONED)
     set(LIB_CMAKE_MODULES_URL https://github.com/andreaskunz/cmake-modules.git CACHE STRING "The path to the origin of the cmake-modules library")


Bug 880: manually edit the DartConfiguration.tcl file to get it working with cmake 3.0.x

--- cmake/EigenConfigureTesting.cmake
+++ cmake/EigenConfigureTesting.cmake
@@ -14,49 +14,18 @@
 # check whether /bin/bash exists
 find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)

-# CMake/Ctest does not allow us to change the build command,
-# so we have to workaround by directly editing the generated DartConfiguration.tcl file
-# save CMAKE_MAKE_PROGRAM
-set(CMAKE_MAKE_PROGRAM_SAVE ${CMAKE_MAKE_PROGRAM})
-# and set a fake one
-set(CMAKE_MAKE_PROGRAM "@EIGEN_MAKECOMMAND_PLACEHOLDER@")
-
 # This call activates testing and generates the DartConfiguration.tcl
 include(CTest)

 set(EIGEN_TEST_BUILD_FLAGS "" CACHE STRING "Options passed to the build command of unit tests")

-# overwrite default DartConfiguration.tcl
-# The worarounds are different for each version of the MSVC IDE
-set(EIGEN_TEST_TARGET buildtests)
-if(MSVC_IDE)
-  if(CMAKE_MAKE_PROGRAM_SAVE MATCHES "devenv") # devenv
-    set(EIGEN_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} Eigen.sln /build Release /project ${EIGEN_TEST_TARGET}")
-  else() # msbuild
-    set(EIGEN_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} ${EIGEN_TEST_TARGET}.vcxproj /p:Configuration=\${CTEST_CONFIGURATION_TYPE}")
-  endif()
-
-  # append the build flags if provided
-  if(NOT "${EIGEN_TEST_BUILD_FLAGS}" MATCHES "^[ \t]*$")
-    set(EIGEN_BUILD_COMMAND "${EIGEN_BUILD_COMMAND} ${EIGEN_TEST_BUILD_FLAGS}")
-  endif()
-
-  # apply the dartconfig hack ...
-  set(EIGEN_MAKECOMMAND_PLACEHOLDER "${EIGEN_BUILD_COMMAND}\n#")
-else()
-  # for make and nmake
-  set(EIGEN_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} ${EIGEN_TEST_TARGET} ${EIGEN_TEST_BUILD_FLAGS}")
-  set(EIGEN_MAKECOMMAND_PLACEHOLDER "${EIGEN_BUILD_COMMAND}")
-endif()
-
-configure_file(${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl ${CMAKE_BINARY_DIR}/DartConfiguration.tcl)
-
-# restore default CMAKE_MAKE_PROGRAM
-set(CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM_SAVE})
-
-# un-set temporary variables so that it is like they never existed
-unset(CMAKE_MAKE_PROGRAM_SAVE)
-unset(EIGEN_MAKECOMMAND_PLACEHOLDER)
+# Overwrite default DartConfiguration.tcl such that ctest can build our unit tests.
+# Recall that our unit tests are not in the "all" target, so we have to explicitely ask ctest to build our custom 'buildtests' target.
+# At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable.
+file(READ  "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE)
+string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config '' -- -i ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
+       EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE})
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" ${EIGEN_DART_CONFIG_FILE2})

 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake)


[CMake] Build host builtins in Fuchsia toolchain even on Darwin

This is nedeeded for the toolchain to be actually usable as a host
toolchain on Darwin.

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

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

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -33,15 +33,11 @@
 set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")
 set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -gline-tables-only -DNDEBUG" CACHE STRING "")

-set(LLVM_BUILTIN_TARGETS "x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "")
+set(LLVM_BUILTIN_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia" CACHE STRING "")
 foreach(target x86_64;aarch64)
   set(BUILTINS_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
   set(BUILTINS_${target}-fuchsia_CMAKE_SYSTEM_NAME Fuchsia CACHE STRING "")
 endforeach()
-
-if(NOT APPLE)
-  set(LLVM_BUILTIN_TARGETS "default;${LLVM_BUILTIN_TARGETS}" CACHE STRING "" FORCE)
-endif()

 set(LLVM_RUNTIME_TARGETS "default;x86_64-fuchsia;aarch64-fuchsia;x86_64-fuchsia-asan:x86_64-fuchsia;aarch64-fuchsia-asan:aarch64-fuchsia" CACHE STRING "")
 foreach(target x86_64;aarch64)


Fail configuration if the specified CMAKE_BUILD_TYPE is unknown.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -19,7 +19,6 @@
 else()
   set(CXX ${CMAKE_CXX_COMPILER})
 endif()
-string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)

 #----Test if clang setup works----------------------------------------------------------------------
 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
@@ -57,9 +56,14 @@
 endif()

 #---Set a default build type for single-configuration CMake generators if no build type is set------
-set(CMAKE_CONFIGURATION_TYPES Release MinSizeRel Debug RelWithDebInfo)
+set(CMAKE_CONFIGURATION_TYPES Release MinSizeRel Debug RelWithDebInfo DebugFull Profile)
 if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release, MinSizeRel, Debug, RelWithDebInfo." FORCE)
+  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release, MinSizeRel, Debug, RelWithDebInfo, DebugFull, Profile." FORCE)
+endif()
+string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+string(TOUPPER "${CMAKE_CONFIGURATION_TYPES}" uppercase_CMAKE_CONFIGURATION_TYPES)
+if(NOT "${uppercase_CMAKE_CONFIGURATION_TYPES}" MATCHES "${uppercase_CMAKE_BUILD_TYPE}")
+  message(FATAL_ERROR "CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} needs to be one of known build types: ${CMAKE_CONFIGURATION_TYPES}")
 endif()
 message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")


Use -Wimplicit-fallthrough=2 for GCC7.

Use -Wimplicit-fallthrough=2 for GCC7.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -146,6 +146,12 @@
 if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
   # AppleClang and Clang proper.
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion")
+elseif(CMAKE_COMPILER_IS_GNUCXX)
+  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7)
+    # See https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
+    # > essentially accepts any comment that contains something that matches (case insensitively) "falls?[ \t-]*thr(ough|u)" regular expression.
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wimplicit-fallthrough=2")
+  endif()
 endif()


Added CXSparse lib to Find module.

Added CXSparse lib to Find module.

--- cmakemodule/FindSuiteSparse.cmake
+++ cmakemodule/FindSuiteSparse.cmake
@@ -129,9 +129,15 @@
 		string(TOUPPER ${suitesparseComp} suitesparseCompUC)
 		string(TOLOWER ${suitesparseComp} suitesparseCompLC)

+		## Special case: CXSparse library is named "libcxsparse.*" but headers are "cs.h":
+		SET(suitesparseComp_ALT "${suitesparseComp}") # Alternative names
+		if("${suitesparseComp}" STREQUAL "CXSPARSE")
+			SET(suitesparseComp_ALT "cs") # Alternative name of CXSparse
+		endif()
+
 		## try to find include dir (looking for very important header file)
 		find_path(SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR
-			NAMES 			${suitesparseComp}.h ${suitesparseCompLC}.h ${suitesparseCompUC}.h
+			NAMES 			${suitesparseComp}.h ${suitesparseCompLC}.h ${suitesparseCompUC}.h ${suitesparseComp_ALT}.h
 						${suitesparseComp}.hpp ${suitesparseCompLC}.hpp ${suitesparseCompUC}.hpp
 			PATHS			/opt/local/include
 						/usr/include
@@ -255,7 +261,7 @@

 ## Default behavior if user don't use the COMPONENTS flag in find_package(SuiteSparse ...) command
 if(NOT SuiteSparse_FIND_COMPONENTS)
-	list(APPEND SuiteSparse_FIND_COMPONENTS AMD CAMD CCOLAMD COLAMD CHOLMOD SPQR LDL BTF KLU)  ## suitesparse and metis are not searched by default (special case)
+	list(APPEND SuiteSparse_FIND_COMPONENTS AMD CAMD CCOLAMD COLAMD CHOLMOD SPQR LDL BTF KLU CXSPARSE)  ## suitesparse and metis are not searched by default (special case)
 endif()

 SuiteSparse_FIND_COMPONENTS()


android build: ignore renderscript toolchain

When detecting toolchains ignore renderscript because its not a
compiler toolchain.

--- cmake/AndroidToolchain.cmake
+++ cmake/AndroidToolchain.cmake
@@ -639,6 +639,7 @@
 endif()

 macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )
+ list( REMOVE_ITEM ${__availableToolchainsLst} "renderscript" )
  foreach( __toolchain ${${__availableToolchainsLst}} )
   if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
    string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )


Solaris build fix.

Solaris build fix.

--- cmake/BuildOptionsPONA.cmake
+++ cmake/BuildOptionsPONA.cmake
@@ -16,7 +16,7 @@
 	SET(PONA_BUILD64 ON CACHE BOOL "Build 64 bit version of libPONA.")
 	IF(PONA_BUILD64)
 		SET(CMAKE_CXX_FLAGS "-m64 ${CMAKE_CXX_FLAGS}")
-		SET(CMAKE_SHARED_LINKER_FLAGS "-m64 -U_undefined -undefined dynamic_lookup ${CMAKE_SHARED_LINKER_FLAGS}")
+		SET(CMAKE_SHARED_LINKER_FLAGS "-m64 ${CMAKE_SHARED_LINKER_FLAGS}")
 		SET(CMAKE_EXE_LINKER_FLAGS "-m64 ${CMAKE_EXE_LINKER_FLAGS}")
 	ENDIF(PONA_BUILD64)
 ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")


[build][clean] Remove unused cmake macro

--- cmake/Modules/FindFLEX.cmake
+++ cmake/Modules/FindFLEX.cmake
@@ -1,134 +0,0 @@
-# - Find flex executable and provides a macro to generate custom build rules
-# The module defines the following variables:
-#  FLEX_FOUND - true is flex executable is found
-#  FLEX_VERSION - the version of flex
-# If flex is found on the system, the module provides the macro:
-#  FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
-# which creates a custom command  to generate the <FlexOutput> file from
-# the <FlexInput> file.  If  COMPILE_FLAGS option is specified, the next
-# parameter is added to the flex  command line. Name is an alias used to
-# get  details of  this custom  command.  Indeed the  macro defines  the
-# following variables:
-#  FLEX_${Name}_DEFINED - true is the macro ran successfully
-#  FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
-#  alias for FlexOutput
-#  FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
-#
-# Flex scanners oftenly use tokens  defined by Bison: the code generated
-# by Flex  depends of the header  generated by Bison.   This module also
-# defines a macro:
-#  ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
-# which  adds the  required dependency  between a  scanner and  a parser
-# where  <FlexTarget>  and <BisonTarget>  are  the  first parameters  of
-# respectively FLEX_TARGET and BISON_TARGET macros.
-#
-# Example:
-#  FIND_PACKAGE(BISON)
-#  FIND_PACKAGE(FLEX)
-#  BISON_TARGET(MyParser parser.y ${PROJECT_BINARY_DIR}/parser.cpp
-#  FLEX_TARGET(MyScanner lexer.l ${PROJECT_BINARY_DIR}/lexer.cpp)
-#  ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
-#
-
-# Copyright (c) 2006, Tristan Carel
-# All rights reserved.
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of the University of California, Berkeley nor the
-#       names of its contributors may be used to endorse or promote products
-#       derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# $Id:: FindFLEX.cmake 3 2006-11-03 02:42:02Z ken                             $
-
-SET(FLEX_FOUND FALSE)
-
-FIND_PROGRAM(FLEX_EXECUTABLE flex DOC "path to the flex executable")
-MARK_AS_ADVANCED(FLEX_EXECUTABLE)
-
-FIND_LIBRARY(FL_LIBRARY NAMES fl
-  PATHS /usr/lib DOC "path to the fl library")
-SET(FLEX_LIBRARIES ${FL_LIBRARY})
-
-IF(FLEX_EXECUTABLE)
-  SET(FLEX_FOUND TRUE)
-
-  EXECUTE_PROCESS(COMMAND ${FLEX_EXECUTABLE} --version
-    OUTPUT_VARIABLE FLEX_version_output
-    ERROR_VARIABLE FLEX_version_error
-    RESULT_VARIABLE FLEX_version_result
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  IF(NOT ${FLEX_version_result} EQUAL 0)
-    MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_error}")
-  ELSE(NOT ${FLEX_version_result} EQUAL 0)
-    STRING(REGEX REPLACE "^flex (.*)$" "\\1"
-      FLEX_VERSION "${FLEX_version_output}")
-  ENDIF(NOT ${FLEX_version_result} EQUAL 0)
-
-  MACRO(FLEX_TARGET Name Input Output)
-    SET(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
-    IF(${ARGC} GREATER 3)
-      IF(${ARGC} EQUAL 5)
-	IF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-	  SET(FLEX_EXECUTABLE_opts  "${ARGV4}")
-	  SEPARATE_ARGUMENTS(FLEX_EXECUTABLE_opts)
-	ELSE("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-	  MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
-	ENDIF("${ARGV3}" STREQUAL "COMPILE_FLAGS")
-      ELSE(${ARGC} EQUAL 5)
-	MESSAGE(SEND_ERROR ${FLEX_TARGET_usage})
-      ENDIF(${ARGC} EQUAL 5)
-    ENDIF(${ARGC} GREATER 3)
-    ADD_CUSTOM_COMMAND(OUTPUT ${Output}
-      COMMAND ${FLEX_EXECUTABLE} ${FLEX_EXECUTABLE_opts} -o${Output} ${Input}
-      DEPENDS ${Input}
-      COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}"
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-
-    SET(FLEX_${Name}_DEFINED TRUE)
-    SET(FLEX_${Name}_OUTPUTS ${Output})
-    SET(FLEX_${Name}_INPUT ${Input})
-    SET(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
-  ENDMACRO(FLEX_TARGET)
-
-  MACRO(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
-    IF(NOT FLEX_${FlexTarget}_OUTPUTS)
-      MESSAGE(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
-    ENDIF(NOT FLEX_${FlexTarget}_OUTPUTS)
-    IF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
-      MESSAGE(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
-    ENDIF(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
-
-    SET_SOURCE_FILES_PROPERTIES(${FLEX_${FlexTarget}_OUTPUTS}
-      PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER})
-  ENDMACRO(ADD_FLEX_BISON_DEPENDENCY)
-
-ENDIF(FLEX_EXECUTABLE)
-
-IF(NOT FLEX_FOUND)
-  IF(NOT FLEX_FIND_QUIETLY)
-    MESSAGE(STATUS "FLEX was not found.")
-  ELSE(NOT FLEX_FIND_QUIETLY)
-    IF(FLEX_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "FLEX was not found.")
-    ENDIF(FLEX_FIND_REQUIRED)
-  ENDIF(NOT FLEX_FIND_QUIETLY)
-ENDIF(NOT FLEX_FOUND)
-
-# FindFLEX.cmake ends here


Add QVTK hint for Apple to FindQVTK.cmake (thanks Bill Lorensen)

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@5938 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindQVTK.cmake
+++ cmake/Modules/FindQVTK.cmake
@@ -8,7 +8,7 @@
 # if QVTK_FOUND then QVTK_INCLUDE_DIR is appended to VTK_INCLUDE_DIRS and
 # QVTK_LIBRARY is appended to QVTK_LIBRARY_DIR

-find_library (QVTK_LIBRARY QVTK HINT ${VTK_DIR})
+find_library (QVTK_LIBRARY QVTK HINTS ${VTK_DIR} ${VTK_DIR}/bin)
 find_path (QVTK_INCLUDE_DIR QVTKWidget.h HINT ${VTK_INCLUDE_DIRS})
 find_package_handle_standard_args(QVTK DEFAULT_MSG
   QVTK_LIBRARY QVTK_INCLUDE_DIR)


Removed debugging information

Removed debugging information

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1463,7 +1463,6 @@
 			if(NOT SKETCH_PROTOTYPE MATCHES "(if[ ]?[\n]?[\t]*[ ]*[)])")
                 file(APPEND ${SKETCH_CPP} "${SKETCH_PROTOTYPE};\n")
             else()
-                message("\trejected prototype: ${SKETCH_PROTOTYPE};")
                 arduino_debug_msg("\trejected prototype: ${SKETCH_PROTOTYPE};")
             endif()
             file(APPEND ${SKETCH_CPP} "${SKETCH_PROTOTYPE};\n")


Add option `LINK_LIBRARIES` to `add_chimera_binding()` (#113)

--- cmake/chimeraFunctions.cmake
+++ cmake/chimeraFunctions.cmake
@@ -15,7 +15,11 @@
 #                     [NAMESPACES namespace1 namespace2 ...])
 #                     SOURCES source1_file [source2_file ...]
 #                     [EXTRA_SOURCES source1_file ...]
+#                     [LINK_LIBRARIES item1 [item2 [...]]]
 #                     [DEBUG] [EXCLUDE_FROM_ALL]
+#
+# Warning: LINK_LIBRARIES option is a temporary feature and can be removed any
+# soon. See #113 for further information.
 function(add_chimera_binding)
     include(ExternalProject)

@@ -24,7 +28,7 @@
     set(prefix binding)
     set(options DEBUG EXCLUDE_FROM_ALL)
     set(oneValueArgs TARGET MODULE CONFIGURATION DESTINATION)
-    set(multiValueArgs SOURCES NAMESPACES EXTRA_SOURCES)
+    set(multiValueArgs SOURCES NAMESPACES EXTRA_SOURCES LINK_LIBRARIES)
     cmake_parse_arguments("${prefix}" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

     # Print errors if arguments are missing.
@@ -68,6 +72,10 @@
         message(STATUS "  Extra Sources:")
         foreach(source ${binding_EXTRA_SOURCES})
             message(STATUS "  - ${source}")
+        endforeach()
+        message(STATUS "  Link Libraries:")
+        foreach(library ${binding_LINK_LIBRARIES})
+            message(STATUS "  - ${library}")
         endforeach()
     endif()

@@ -119,6 +127,9 @@
     add_library("${binding_TARGET}_placeholder" EXCLUDE_FROM_ALL
         ${binding_SOURCES}
     )
+    target_link_libraries("${binding_TARGET}_placeholder"
+        ${binding_LINK_LIBRARIES}
+    )
     set_target_properties("${binding_TARGET}_placeholder" PROPERTIES
         LINKER_LANGUAGE CXX
     )


copy&paste error in cmake comment

copy&paste error in cmake comment

--- cmake/modules/FindLZMA.cmake
+++ cmake/modules/FindLZMA.cmake
@@ -2,8 +2,8 @@
 #
 # This module defines
 # LZMA_INCLUDE_DIR, where to locate LZMA header files
-# LZMA_LIBRARIES, the libraries to link against to use Pythia6
-# LZMA_FOUND.  If false, you cannot build anything that requires Pythia6.
+# LZMA_LIBRARIES, the libraries to link against to use LZMA
+# LZMA_FOUND.  If false, you cannot build anything that requires LZMA

 if(LZMA_CONFIG_EXECUTABLE)
   set(LZMA_FIND_QUIETLY 1)


cmake glui

cmake glui

--- cmake_modules/FindGLUI.cmake
+++ cmake_modules/FindGLUI.cmake
@@ -79,7 +79,7 @@

 		if(APPLE)
 			find_path(GLUI_INCLUDE_DIR
-				GLUI/glui.h
+				GL/glui.h
 				HINTS
 				${OPENGL_INCLUDE_DIR}
 				DOC
@@ -133,4 +133,4 @@

 if(GLUI_LIBRARY AND GLUI_INCLUDE_DIR)
 	mark_as_advanced(GLUI_INCLUDE_DIR GLUI_LIBRARY GLUI_DEBUG_LIBRARY)
-endif()+endif()


Update compiler.cmake

Update compiler.cmake

added -Wc++98-compat for boost suppression

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -206,6 +206,7 @@
                      " -Wno-conditional-uninitialized"
                      " -Wno-exit-time-destructors"
                      " -Wno-undefined-func-template"
+                     " -Wnoc++98-compat"
                      )
              string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
              #endif ()


Fixed omission of variable overwriting flags

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -162,6 +162,7 @@
          # make the build log readable.
          if (CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 12.0.0)
              set(CMAKE_CXX_FLAGS
+                     "${CMAKE_CXX_FLAGS}"
                      " -Wno-float-conversion"
                      " -Wno-unreachable-code-return"
                      " -Wno-unused-template"


Removed mingw --large-address-aware

Removed mingw --large-address-aware

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -113,7 +113,7 @@
          # MinGW gives some c11plus.xe out of memory messages:
          # http://sourceforge.net/p/mingw-w64/mailman/message/33182613/
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftrack-macro-expansion=0")
-         set(CMAKE_EXE_LINKER_FLAGS "-Wl,--large-address-aware")
+#         set(CMAKE_EXE_LINKER_FLAGS "-Wl,--large-address-aware")
      endif ()

  elseif (TUDAT_BUILD_MSVC)


[CMake] Cleanup ExternalProject usage of CMake 3.x features

All the ExternalProject features in use here are supported by CMake 3.4.3, so we don't need these version checks anymore.

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

--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -61,20 +61,6 @@
     list(APPEND TOOLCHAIN_BINS ${RUNTIME_LIBRARIES})
   endif()

-  if(CMAKE_VERSION VERSION_GREATER 3.1.0)
-    set(cmake_3_1_EXCLUDE_FROM_ALL EXCLUDE_FROM_ALL 1)
-    set(cmake_3_1_BUILD_ALWAYS BUILD_ALWAYS 1)
-  endif()
-
-  if(CMAKE_VERSION VERSION_GREATER 3.3.20150708)
-    set(cmake_3_4_USES_TERMINAL_OPTIONS
-      USES_TERMINAL_CONFIGURE 1
-      USES_TERMINAL_BUILD 1
-      USES_TERMINAL_INSTALL 1
-      )
-    set(cmake_3_4_USES_TERMINAL USES_TERMINAL 1)
-  endif()
-
   set(STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/${name}-stamps/)
   set(BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${name}-bins/)

@@ -117,7 +103,7 @@
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${name}-clobber-stamp)

   if(ARG_EXCLUDE_FROM_ALL)
-    set(exclude ${cmake_3_1_EXCLUDE_FROM_ALL})
+    set(exclude EXCLUDE_FROM_ALL 1)
   endif()

   ExternalProject_Add(${name}
@@ -135,8 +121,10 @@
                ${PASSTHROUGH_VARIABLES}
     INSTALL_COMMAND ""
     STEP_TARGETS configure build
-    ${cmake_3_1_BUILD_ALWAYS}
-    ${cmake_3_4_USES_TERMINAL_OPTIONS}
+    BUILD_ALWAYS 1
+    USES_TERMINAL_CONFIGURE 1
+    USES_TERMINAL_BUILD 1
+    USES_TERMINAL_INSTALL 1
     )

   if(CMAKE_VERSION VERSION_LESS 3.1.0)
@@ -150,7 +138,7 @@
       COMMENT "Forcing rebuild of ${name}"
       DEPENDEES configure clean
       DEPENDS ${ALWAYS_REBUILD} ${ARG_DEPENDS} ${TOOLCHAIN_BINS}
-      ${cmake_3_4_USES_TERMINAL} )
+      USES_TERMINAL 1 )
   endif()

   if(ARG_USE_TOOLCHAIN)
@@ -164,7 +152,7 @@
     DEPENDEES configure
     ${force_deps}
     WORKING_DIRECTORY ${BINARY_DIR}
-    ${cmake_3_4_USES_TERMINAL}
+    USES_TERMINAL 1
     )
   ExternalProject_Add_StepTargets(${name} clean)


Fix WITH_INNODB_EXTRA_DEBUG

Fix WITH_INNODB_EXTRA_DEBUG

--- storage/innobase/innodb.cmake
+++ storage/innobase/innodb.cmake
@@ -123,8 +123,8 @@

 OPTION(WITH_INNODB_EXTRA_DEBUG "Enable extra InnoDB debug checks" OFF)
 IF(WITH_INNODB_EXTRA_DEBUG)
-  IF(NOT WITH_DEBUG)
-    MESSAGE(FATAL_ERROR "WITH_INNODB_EXTRA_DEBUG can be enabled only when WITH_DEBUG is enabled")
+  IF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
+    MESSAGE(FATAL_ERROR "WITH_INNODB_EXTRA_DEBUG can be enabled only in debug builds")
   ENDIF()

   SET(EXTRA_DEBUG_FLAGS "")


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Fix a typo in cmake slist detection

Fix a typo in cmake slist detection

--- cmake/BALLConfigSList.cmake
+++ cmake/BALLConfigSList.cmake
@@ -12,5 +12,5 @@
 IF(BALL_HAS_GNU_SLIST)
 	MESSAGE(STATUS "Checking for gnu slist - Found")
 ELSE()
-	MESSAGE(STATUS "Checking for gnu slist - Found")
+	MESSAGE(STATUS "Checking for gnu slist - Not found")
 ENDIF()


Changing METIS version to modified 5.1 version

--- cmake/ThirdPartyMetis.cmake
+++ cmake/ThirdPartyMetis.cmake
@@ -4,12 +4,12 @@
 IF (THIRDPARTY_BUILD_METIS)
     INCLUDE(ExternalProject)
     EXTERNALPROJECT_ADD(
-        modmetis-5.0.2
+        modmetis-5.1.0
         PREFIX ${TPSRC}
-        URL ${TPURL}/modmetis-5.0.2.tar.bz2
-        URL_MD5 "ffbdc6a50283934389a0b3b0c32b62c0"
+        URL http://ae-nektar.ae.ic.ac.uk/~dmoxey/test/metis-5.1.0.tar.gz
+        URL_MD5 "c48620f7b5b1cebebc00ccbf73fca5d0"
         DOWNLOAD_DIR ${TPSRC}
-        CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC -DGKLIB_PATH:PATH=${TPSRC}/src/modmetis-5.0.2/GKlib ${TPSRC}/src/modmetis-5.0.2
+        CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC -DGKLIB_PATH:PATH=${TPSRC}/src/modmetis-5.1.0/GKlib ${TPSRC}/src/modmetis-5.1.0
     )
     SET(METIS_LIB metis CACHE FILEPATH
         "METIS library" FORCE)


[CMake] Work around to use target_link_libraries(PUBLIC) in BUILD_SHARED_LIBS mode.

FIXME: It may be PRIVATE since SO knows its dependent libs.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -314,6 +314,13 @@
       ${lib_deps}
       ${llvm_libs}
       )
+  elseif(ARG_SHARED AND BUILD_SHARED_LIBS)
+    # FIXME: It may be PRIVATE since SO knows its dependent libs.
+    target_link_libraries(${name} PUBLIC
+      ${ARG_LINK_LIBS}
+      ${lib_deps}
+      ${llvm_libs}
+      )
   else()
     # MODULE|SHARED
     target_link_libraries(${name} PRIVATE


cmake: Add 'examples' target

cmake: Add 'examples' target

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -513,6 +513,12 @@
     install(TARGETS ${name} RUNTIME DESTINATION examples)
   endif()
   set_target_properties(${name} PROPERTIES FOLDER "Examples")
+
+  if(NOT TARGET examples)
+    add_custom_target(examples ${name})
+  else()
+    add_dependencies(examples ${name})
+  endif()
 endmacro(add_llvm_example name)


[CMake] Also add internal header files.

[CMake] Also add internal header files.

--- cmake/modules/Utility.cmake
+++ cmake/modules/Utility.cmake
@@ -51,6 +51,14 @@

   # Add headers to generated project files.
   if(MSVC_IDE OR XCODE)
+    # Add internal headers.
+
+    file(GLOB internal_headers *.h)
+    if(internal_headers)
+      set_source_files_properties(${internal_headers} PROPERTIES HEADER_FILE_ONLY ON)
+      list(APPEND ALL_FILES ${internal_headers})
+    endif()
+
     # Add public headers.

     # Find the library name by finding its relative path.


proper CPACK RPM versioning

proper CPACK RPM versioning

--- cmake/tarantool_cpack.cmake
+++ cmake/tarantool_cpack.cmake
@@ -3,10 +3,10 @@
 #

 if ("${CPACK_GENERATOR}" STREQUAL "RPM")
-    set (CPACK_RPM_PACKAGE_REQUIRES "git, gcc44, flex >= 2.5.35, bison, cmake")
     set (CPACK_RPM_PACKAGE_NAME "tarantool_box")
     set (CPACK_RPM_PACKAGE_SUMMARY "tarantool_box")
-    set (CPACK_RPM_PACKAGE_VERSION "${TARANTOOL_VERSION}")
+    execute_process (COMMAND "date" "+%Y%m%d.%H%M" OUTPUT_VARIABLE RPM_PACKAGE_VERSION)
+    set (CPACK_RPM_PACKAGE_VERSION "${RPM_PACKAGE_VERSION}")
     set (CPACK_RPM_PACKAGE_RELEASE "8")
     set (CPACK_RPM_PACKAGE_LICENSE "BSD")
     set (CPACK_RPM_PACKAGE_GROUP "MAIL.RU")


Rermoved debug printouts. Bamboo is apparently unable to resolve the value of $HOME on linux unless it is explicitly stipulated in the config file for the plan. Something not quite right about that, but it's a story for another time.

--- cmake_modules/FindVTK.cmake
+++ cmake_modules/FindVTK.cmake
@@ -113,10 +113,6 @@
     get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
     get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
     set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.10" CACHE PATH "VTK Headers location.")
-message(STATUS "${VTK_LIB_DIR}")
-message(STATUS "${__TMP_DIR}/include/vtk-5.10")
-message(STATUS "HOME dir is: $ENV{HOME}")
-message(STATUS "$ENV{HOME}/LPS/prerequisites/vtk/lib")
 else()

   # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.


CMake: Windows: Fixed gmock and gtest `LIB_DIR`.

Multi-configuration build systems will get a `/${CMAKE_BUILD_TYPE}`
appended to their output directories automatically (by CMake).

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

--- 3rdparty/stout/cmake/StoutTestsConfigure.cmake
+++ 3rdparty/stout/cmake/StoutTestsConfigure.cmake
@@ -45,8 +45,8 @@

 # Convenience variables for `lib` directories of built third-party dependencies.
 if (WIN32)
-  set(GMOCK_LIB_DIR ${GOOGLETEST_ROOT}-build/googlemock/${CMAKE_BUILD_TYPE})
-  set(GTEST_LIB_DIR ${GOOGLETEST_ROOT}-build/googlemock/gtest/${CMAKE_BUILD_TYPE})
+  set(GMOCK_LIB_DIR ${GOOGLETEST_ROOT}-build/googlemock)
+  set(GTEST_LIB_DIR ${GOOGLETEST_ROOT}-build/googlemock/gtest)
 else (WIN32)
   set(GMOCK_LIB_DIR ${GOOGLETEST_ROOT}-lib/lib)
   set(GTEST_LIB_DIR ${GOOGLETEST_ROOT}-lib/lib/gtest)


fixed fail for missing optional libs

fixed fail for missing optional libs

--- cmake/CMakeModules/FindOpenCV.cmake
+++ cmake/CMakeModules/FindOpenCV.cmake
@@ -50,7 +50,6 @@
 FIND_OPENCV_LIBRARY(OPENCV_GPU_LIBRARY opencv_gpu)
 FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
 FIND_OPENCV_LIBRARY(OPENCV_IMGPROC_LIBRARY opencv_imgproc)
-FIND_OPENCV_LIBRARY(OPENCV_LEGACY_LIBRARY opencv_legacy)
 FIND_OPENCV_LIBRARY(OPENCV_ML_LIBRARY opencv_ml)
 FIND_OPENCV_LIBRARY(OPENCV_IMGCODECS_LIBRARY opencv_imgcodecs)

@@ -64,7 +63,6 @@
 message( STATUS "OPENCV_GPU_LIBRARY        = ${OPENCV_GPU_LIBRARY}" )
 message( STATUS "OPENCV_HIGHGUI_LIBRARY    = ${OPENCV_HIGHGUI_LIBRARY}" )
 message( STATUS "OPENCV_IMGPROC_LIBRARY    = ${OPENCV_IMGPROC_LIBRARY}" )
-message( STATUS "OPENCV_LEGACY_LIBRARY     = ${OPENCV_LEGACY_LIBRARY}" )
 message( STATUS "OPENCV_ML_LIBRARY         = ${OPENCV_ML_LIBRARY}" )
 message( STATUS "OPENCV_IMGCODECS_LIBRARY  = ${OPENCV_IMGCODECS_LIBRARY}" )

@@ -74,11 +72,20 @@
 set(OPENCV_FOUND "NO")
 if(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_XFEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_ML_LIBRARY)
    set(OPENCV_FOUND "YES")
-   set(OPENCV_LIBRARIES ${OPENCV_CALIB3D_LIBRARY} ${OPENCV_CONTRIB_LIBRARY} ${OPENCV_CORE_LIBRARY} ${OPENCV_FEATURES2D_LIBRARY} ${OPENCV_XFEATURES2D_LIBRARY} ${OPENCV_FLANN_LIBRARY} ${OPENCV_HIGHGUI_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} ${OPENCV_LEGACY_LIBRARY} ${OPENCV_ML_LIBRARY})
+   set(OPENCV_LIBRARIES ${OPENCV_CALIB3D_LIBRARY} ${OPENCV_CORE_LIBRARY} ${OPENCV_FEATURES2D_LIBRARY} ${OPENCV_XFEATURES2D_LIBRARY} ${OPENCV_FLANN_LIBRARY} ${OPENCV_HIGHGUI_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} ${OPENCV_ML_LIBRARY})
    message( STATUS "OPENCV_LIBRARIES          = ${OPENCV_LIBRARIES}" )
 else(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_XFEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_ML_LIBRARY)
    message( WARNING "Could not find OPENCV" )
 endif(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_XFEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_ML_LIBRARY)
+
+set(OPENCV_CONTRIB_FOUND "NO")
+if(OPENCV_FOUND AND OPENCV_CONTRIB_LIBRARY)
+   set(OPENCV_CONTRIB_FOUND "YES")
+   set(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${OPENCV_CONTRIB_LIBRARY})
+   message( STATUS "OPENCV_CONTRIB_LIBRARY        = ${OPENCV_CONTRIB_LIBRARY}" )
+else(OPENCV_FOUND AND OPENCV_CONTRIB_LIBRARY)
+   message( WARNING "Could not find optional OPENCV_CONTRIB_LIBRARY. " )
+endif(OPENCV_FOUND AND OPENCV_CONTRIB_LIBRARY)

 set(OPENCV_GPU_FOUND "NO")
 if(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)


[Compiler-rt] Broken compiler-rt CMake configuring on Windows

Summary:
Hi Michal,

Would you be able to review this simple fix, please?

Since r291504 compiler-rt uses `llvm-config --cmakedir` to get the path to the LLVM CMake modules.
On Windows this option returns Windows style path with backslashes. CMake treats backslashes as beginning of an escaped character and thus fails to append the path to `CMAKE_MODULE_PATH`.

Reviewers: compnerd, mgorny

Reviewed By: mgorny

Subscribers: compnerd, llvm-commits, dberris

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

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

--- cmake/Modules/CompilerRTUtils.cmake
+++ cmake/Modules/CompilerRTUtils.cmake
@@ -225,7 +225,8 @@
     RESULT_VARIABLE HAD_ERROR
     OUTPUT_VARIABLE CONFIG_OUTPUT)
   if(NOT HAD_ERROR)
-    string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH)
+    string(STRIP "${CONFIG_OUTPUT}" LLVM_CMAKE_PATH_FROM_LLVM_CONFIG)
+    file(TO_CMAKE_PATH ${LLVM_CMAKE_PATH_FROM_LLVM_CONFIG} LLVM_CMAKE_PATH)
   else()
     file(TO_CMAKE_PATH ${LLVM_BINARY_DIR} LLVM_BINARY_DIR_CMAKE_STYLE)
     set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR_CMAKE_STYLE}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm")


Update Find OpenCASCADE

Update Find OpenCASCADE

--- cmake/Modules/FindOpenCASCADE.cmake
+++ cmake/Modules/FindOpenCASCADE.cmake
@@ -37,7 +37,10 @@
                 include/oce
                 include/occ
                 include/opencascade
-                opencascade oce occ)
+                opencascade oce occ
+                opencascade/include
+                oce/include
+                occ/include)

 if(OpenCASCADE_INCLUDE_DIRS STREQUAL Standard_Version.hxx-NOTFOUND)
     unset(OpenCASCADE_INCLUDE_DIRS)


Respect CMAKE_INSTALL_MANDIR for sphinx generated manpages

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

--- cmake/modules/AddSphinxTarget.cmake
+++ cmake/modules/AddSphinxTarget.cmake
@@ -51,7 +51,7 @@
         # FIXME: We might not ship all the tools that these man pages describe
         install(DIRECTORY "${SPHINX_BUILD_DIR}/" # Slash indicates contents of
                 COMPONENT "${project}-sphinx-man"
-                DESTINATION share/man/man1)
+                DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)

       elseif (builder STREQUAL html)
         string(TOUPPER "${project}" project_upper)


Fix kde4automoc dependency so parallel builds work.

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

--- cmake/modules/AkonadiInternal.cmake
+++ cmake/modules/AkonadiInternal.cmake
@@ -25,6 +25,8 @@
       set(KDE4_MAKEKDEWIDGETS_EXECUTABLE ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/makekdewidgets.shell )
    endif (WIN32)

+   # when building, make automoc depend on the executable...
+   set( _KDE4_AUTOMOC_EXECUTABLE_DEP kde4automoc)

 if (WIN32)
 # use relative install prefix to avoid hardcoded install paths in cmake_install.cmake files


[cmake] add -DNDEBUG to CMAKE_CXX_FLAGS_RELEASE

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -56,7 +56,7 @@
 SET( CMAKE_EXPORT_COMPILE_COMMANDS "ON" )

 SET( CMAKE_CXX_FLAGS_RELEASE
-  "-DDNDEBUG -O2 -fPIC " )
+  "-DDNDEBUG -DNDEBUG -O2 -fPIC " )

 SET( CMAKE_CXX_FLAGS_DEBUG
   "-O0 -DDNDEBUG -g3 -ggdb  -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow  -Wundef -Wnon-virtual-dtor" )


adjusted bad comment

adjusted bad comment

--- cmakemodule/FindLibHttpServer.cmake
+++ cmakemodule/FindLibHttpServer.cmake
@@ -1,4 +1,4 @@
-# - Find Crypto++
+# - Find LibHttpServer

 if(LIBHTTPSERVER_INCLUDE_DIRS AND LIBHTTPSERVER_LIBRARIES)
     set(LIBHTTPSERVER_FOUND TRUE)


CMake: Set default to aggressive MPI disabled

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

--- deal.II/cmake/configure/configure_1_mpi.cmake
+++ deal.II/cmake/configure/configure_1_mpi.cmake
@@ -16,7 +16,7 @@
 # Configuration for mpi support:
 #

-SET(DEAL_II_ALLOW_GENERIC_MPI ON CACHE BOOL
+SET(DEAL_II_ALLOW_GENERIC_MPI OFF CACHE BOOL
   "Allow the usage of an external mpi library even if the current compiler is not an mpi wrapper"
   )


Add a version check for external boot: We require at least version 1.44

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@28199 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/configure/configure_boost.cmake
+++ deal.II/cmake/configure/configure_boost.cmake
@@ -37,7 +37,10 @@

 MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
-  FIND_PACKAGE (Boost COMPONENTS serialization thread)
+  #
+  # We require at least version 1.44
+  #
+  FIND_PACKAGE (Boost 1.44 COMPONENTS serialization thread)

   IF(Boost_THREAD_FOUND AND Boost_SERIALIZATION_FOUND)
     SET(${var} TRUE)


Remove comment.

Remove comment.

--- build-utils/cmake/compiler_settings.cmake
+++ build-utils/cmake/compiler_settings.cmake
@@ -64,7 +64,6 @@

 # Simd math force ref
 if(ozz_build_simd_ref)
-  message(STATUS "Forces SimdMath reference implementation")
   set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS OZZ_FORCE_SIMD_REF)
 endif()


BUG: Fix module dependency of ITK-CurvatureFlow.

Change-Id: Ic26d74529c5fcab3aa1c9d6f97f9d6348e8ee4d6

--- Modularization/modularITKCMake/ITK/Filtering/CurvatureFlow/itk-module.cmake
+++ Modularization/modularITKCMake/ITK/Filtering/CurvatureFlow/itk-module.cmake
@@ -1 +1 @@
-itk_module(ITK-CurvatureFlow DEPENDS ITK-Common TEST_DEPENDS ITK-TestKernel)
+itk_module(ITK-CurvatureFlow DEPENDS ITK-ImageFilterBase ITK-FiniteDifference TEST_DEPENDS ITK-TestKernel)


add comments about MKL ScaLAPACK w/ Cray MPI

--- cmake/toolchains/Edison-intel-mpich-mkl.cmake
+++ cmake/toolchains/Edison-intel-mpich-mkl.cmake
@@ -1,4 +1,5 @@
 #
+# module load cray-mpich/7* (any 7+ version is ok)
 # module load gcc/4.9.2 && module load PrgEnv-intel
 #

@@ -24,6 +25,10 @@

 set(OpenMP_CXX_FLAGS "-openmp")

+# We are using ScaLAPACK from MKL, which is compiled against Intel MPI.
+# We leverage ABI compatibility (http://www.mpich.org/abi/) between
+# Intel MPI 5 and Cray MPI 7 and hope for the best.
+# A more robust solution will be available in the future.
 set(MATH_LIBS "-mkl=cluster")
 set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
 set(BUILD_SHARED_LIBS OFF)


BUG: Do not try to install fiberprocess if it is not build

--- DTIAtlasFiberAnalyzer.cmake
+++ DTIAtlasFiberAnalyzer.cmake
@@ -82,10 +82,13 @@
   include( CTest )
   ADD_SUBDIRECTORY(Testing)
 ENDIF(BUILD_TESTING)
-
-set( ToolsList
+
+if( COMPILE_EXTERNAL_DTIPROCESS )
+  set( ToolsList
     ${CMAKE_CURRENT_BINARY_DIR}/${install_dir}/fiberprocess${fileextension}
-)
+  )
+endif()
+
 if( EXECUTABLES_ONLY )
   foreach( tool ${ToolsList})
     install(PROGRAMS ${tool} DESTINATION ${RUNTIME_DESTINATION})


fixing builds with CMake older than 3.4

fixing builds with CMake older than 3.4

--- examples/exe_with_static_libs/doctest_force_link_static_lib_in_target.cmake
+++ examples/exe_with_static_libs/doctest_force_link_static_lib_in_target.cmake
@@ -32,7 +32,7 @@
     get_target_property(LIB_NAME ${lib} NAME)
     if(${DDH} STREQUAL "DDH-NOTFOUND")
         # figure out the paths and names of the dummy headers - should be in the build folder for the target
-        get_target_property(BD ${lib} BINARY_DIR)
+        set(BD ${CMAKE_CURRENT_BINARY_DIR}) # get_target_property(BD ${lib} BINARY_DIR) # 'BINARY_DIR' target property unsupported before CMake 3.4 ...
         set(dummy_dir ${BD}/${LIB_NAME}_DOCTEST_STATIC_LIB_FORCE_LINK_DUMMIES/)
         set(dummy_header ${dummy_dir}/all_dummies.h)
         file(MAKE_DIRECTORY ${dummy_dir})


Fix a spelling error in a comment.

Fix a spelling error in a comment.

--- cmake/configure/configure_1_threads.cmake
+++ cmake/configure/configure_1_threads.cmake
@@ -152,7 +152,7 @@

   #
   # Workaround for an issue with C++11 mode, non gcc-compilers and missing
-  # template<typename T> std::ist_trivially_copyable<T>
+  # template<typename T> std::is_trivially_copyable<T>
   #
   IF( DEAL_II_WITH_CXX11 AND
       NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND
@@ -191,7 +191,7 @@

   #
   # Workaround for an issue with C++11 mode, non gcc-compilers and missing
-  # template<typename T> std::ist_trivially_copyable<T>
+  # template<typename T> std::is_trivially_copyable<T>
   #
   IF( DEAL_II_WITH_CXX11 AND
       NOT DEAL_II_HAVE_CXX11_IS_TRIVIALLY_COPYABLE AND


openssl.cmake: Re-added zlib dependence, and added header include path to configure step.

--- openssl.cmake
+++ openssl.cmake
@@ -9,6 +9,8 @@
 include (ExternalProject)
 include (ExternalSource)
 include (BuildSupport)
+
+include (zlib)

 external_source (openssl
     1.0.1c
@@ -35,7 +37,9 @@
     PATCH_COMMAND       ""
     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${SSL_CONFIGURE_COMMAND}
         --prefix=${BUILDEM_DIR}
+        -I${BUILDEM_INCLUDE_DIR}
         shared
+        zlib
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make
     BUILD_IN_SOURCE     1
     TEST_COMMAND        ${BUILDEM_ENV_STRING} make test


Fixed CMake problem with QT submodules (will be handled in a seperate bug in the master too).

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -135,6 +135,7 @@
         set(Q${KITNAME}_GENERATED_MOC_CPP )
         set(Q${KITNAME}_GENERATED_QRC_CPP )
         set(Q${KITNAME}_GENERATED_UI_CPP )
+        set(Q${KITNAME}_GENERATED_CPP )

         _MITK_CREATE_MODULE_CONF()
         if(NOT MODULE_EXPORT_DEFINE)


Added profile support for RelWithDebInfo and MinSizeRel

--- conan.cmake
+++ conan.cmake
@@ -256,7 +256,7 @@

 macro(parse_arguments)
   set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_OUTPUT_DIRS)
-  set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE PROFILE ARCH BUILD_TYPE)
+  set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE PROFILE ARCH BUILD_TYPE)
   set(multiValueArgs REQUIRES OPTIONS IMPORTS BUILD CONAN_COMMAND)
   cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
 endmacro()
@@ -298,6 +298,12 @@
     endif()
     if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ARGUMENTS_RELEASE_PROFILE)
       set(settings -pr ${ARGUMENTS_RELEASE_PROFILE})
+    endif()
+    if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" AND ARGUMENTS_RELWITHDEBINFO_PROFILE)
+      set(settings -pr ${ARGUMENTS_RELWITHDEBINFO_PROFILE})
+    endif()
+    if(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" AND ARGUMENTS_MINSIZEREL_PROFILE)
+      set(settings -pr ${ARGUMENTS_MINSIZEREL_PROFILE})
     endif()
     if(ARGUMENTS_PROFILE)
       set(settings -pr ${ARGUMENTS_PROFILE})


BUG: Fix non-windows cmake configuration regression

This bug was introduced with d3fa0dcc4fe

CMake Error at Modules/ThirdParty/DCMTK/itk-module-init.cmake:43 (if):
   if given arguments:
     "WIN32" "AND" "LESS" "1800"

   Unknown arguments specified
 Call Stack (most recent call first):
   CMake/ITKModuleEnablement.cmake:318 (include)
   CMakeLists.txt:356 (include)

Quote the possibly undefined variable to avoid
cmake failures.

Change-Id: Ib721afe93ccce0abf92717793be62dfe8610643e

--- Modules/ThirdParty/DCMTK/itk-module-init.cmake
+++ Modules/ThirdParty/DCMTK/itk-module-init.cmake
@@ -40,7 +40,7 @@
         )
       set(_DCMTK_USE_ICU_default OFF)
     else()
-      if(WIN32 AND ${MSVC_VERSION} LESS 1800) # No precompiled ICU for VS < 2013
+      if(WIN32 AND "${MSVC_VERSION}" LESS 1800) # No precompiled ICU for VS < 2013
         set(_DCMTK_USE_ICU_default OFF)
       elseif(WIN32 AND CMAKE_VERSION VERSION_LESS 3.7)  # FindICU.cmake included in DMCTK doesn't find Windows ICU libraries.
         set(_DCMTK_USE_ICU_default OFF)


Reverted back EXTRA_FLAGS which was changed unintendedly.

--- Source/CMake/Modules/Urho3D-CMake-magic.cmake
+++ Source/CMake/Modules/Urho3D-CMake-magic.cmake
@@ -262,25 +262,25 @@
         return ()
     endif ()

-    set (p_FLAGS "-fvisibility=hidden")
+    set (EXTRA_FLAGS "-fvisibility=hidden")
     # Either return the extra flags needed in the supplied argument, or to the
     # CMAKE_C_FLAGS if no argument is supplied.
     if (ARGV1)
-        set (${ARGV1} "${p_FLAGS}" PARENT_SCOPE)
-    else ()
-        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${p_FLAGS}" PARENT_SCOPE)
+        set (${ARGV1} "${EXTRA_FLAGS}" PARENT_SCOPE)
+    else ()
+        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE)
     endif ()

     if (COMPILER_HAS_HIDDEN_INLINE_VISIBILITY)
-        set (p_FLAGS "${p_FLAGS} -fvisibility-inlines-hidden")
+        set (EXTRA_FLAGS "${EXTRA_FLAGS} -fvisibility-inlines-hidden")
     endif ()

     # Either return the extra flags needed in the supplied argument, or to the
     # CMAKE_CXX_FLAGS if no argument is supplied.
     if (ARGV0)
-        set (${ARGV0} "${p_FLAGS}" PARENT_SCOPE)
-    else ()
-        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${p_FLAGS}" PARENT_SCOPE)
+        set (${ARGV0} "${EXTRA_FLAGS}" PARENT_SCOPE)
+    else ()
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS}" PARENT_SCOPE)
     endif ()
 endfunction ()


add aliases for cmake exported variables

The current exported cmake names AWSSDK_LINK_LIBRARIES and
AWSSDK_INCLUDE_DIR are not well-known for the cmake users.

Add aliases so that the names are more familiar for user.

set(AWSSDK_LIBRARIES ${AWSSDK_LINK_LIBRARIES})

set(AWSSDK_INCLUDE_DIRS ${AWSSDK_INCLUDE_DIR})

--- cmake/AWSSDKConfig.cmake
+++ cmake/AWSSDKConfig.cmake
@@ -288,3 +288,6 @@
         message(STATUS "Found ${TARGET}")
     endforeach()
 endif()
+
+set(AWSSDK_INCLUDE_DIRS ${AWSSDK_INCLUDE_DIR})
+set(AWSSDK_LIBRARIES ${AWSSDK_LINK_LIBRARIES})


added better android project name

added better android project name

--- cmake/CEGUIAndroid.cmake
+++ cmake/CEGUIAndroid.cmake
@@ -44,10 +44,6 @@
             SET(SCREEN_SIZE "|screenSize")
         endif()

-        if(OGRE_CONFIG_ENABLE_GLES2_GLSL_OPTIMISER)
-            SET(GLES_OPTIMISER "-lglsl_optimizer -lmesa -lglcpp-library")
-        endif()
-
         SET(ANDROID_TARGET "android-${ANDROID_SDK_API_LEVEL}")

         SET(NDKOUT "${CMAKE_BINARY_DIR}/SampleBrowserNDK")
@@ -65,9 +61,6 @@
         endforeach()
         SET(JNI_SRC_FILES "${COMBINED_SOURCE_FILES_STRING}")
         SET(PKG_NAME "cegui.org.uk.browser")
-        SET(HAS_CODE "false")
-        SET(HEADERS "")
-        SET(SAMPLE_LDLIBS "")
         SET(ANDROID_SHARED_LIB "${CEGUI_TARGET_NAME}")
         file(COPY "${CMAKE_SOURCE_DIR}/datafiles/imagesets/ic_launcher.png" DESTINATION "${NDKOUT}/res/drawable")
         file(COPY "${CMAKE_SOURCE_DIR}/datafiles" DESTINATION "${NDKOUT}/assets")
@@ -88,7 +81,7 @@

         add_custom_command(
             TARGET ${ANDROID_PROJECT_TARGET} POST_BUILD COMMAND ${ANDROID_EXECUTABLE}
-            update project --name ${ANDROID_MOD_NAME} --subprojects --target ${ANDROID_TARGET} --path "${NDKOUT}" WORKING_DIRECTORY ${NDKOUT})
+            update project --name ${ANDROID_PROJECT_TARGET} --subprojects --target ${ANDROID_TARGET} --path "${NDKOUT}" WORKING_DIRECTORY ${NDKOUT})

         if(DEBUG)
             add_custom_command( TARGET ${ANDROID_PROJECT_TARGET} POST_BUILD COMMAND


android cmake function changes

android cmake function changes

--- cmake/CEGUIAndroid.cmake
+++ cmake/CEGUIAndroid.cmake
@@ -1,3 +1,30 @@
+#/*******************************************************************************
+#    Filename: CEGUIAndroid.cmake
+#    Created:  28/9/2014
+#    Author:   David Reepmeyer <djreep81@gmail.com>
+#*******************************************************************************/
+#/***************************************************************************
+# *   Copyright (C) 2004 - 2013 Paul D Turner & The CEGUI Development Team
+# *
+# *   Permission is hereby granted, free of charge, to any person obtaining
+# *   a copy of this software and associated documentation files (the
+# *   "Software"), to deal in the Software without restriction, including
+# *   without limitation the rights to use, copy, modify, merge, publish,
+# *   distribute, sublicense, and/or sell copies of the Software, and to
+# *   permit persons to whom the Software is furnished to do so, subject to
+# *   the following conditions:
+# *
+# *   The above copyright notice and this permission notice shall be
+# *   included in all copies or substantial portions of the Software.
+# *
+# *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# *   OTHER DEALINGS IN THE SOFTWARE.
+# ***************************************************************************/

 macro(create_android_proj ANDROID_PROJECT_TARGET)
     if (ANDROID)
@@ -31,15 +58,6 @@
         file(WRITE "${NDKOUT}/default.properties" "target=${ANDROID_TARGET}")
         file(WRITE "${NDKOUT}/jni/Application.mk"
             "APP_ABI := ${ANDROID_ABI}\nAPP_STL := gnustl_static\nAPP_CPPFLAGS := -fexceptions -frtti -std=c++11\nNDK_TOOLCHAIN_VERSION := ${ANDROID_COMPILER_VERSION}")
-        message( "checking for gles2 or gles" )
-        if (OGRE_RenderSystem_GLES2_FOUND)
-            message( "gles2 " )
-            add_definitions(-DINCLUDE_RTSHADER_SYSTEM)
-            SET(DEPENDENCIES OgreMain RenderSystem_GLES2)
-        elseif (OGRE_RenderSystem_GLES_FOUND)
-            message( "gles " )
-            SET(DEPENDENCIES OgreMain RenderSystem_GLES)
-        endif()
         SET(ANDROID_MOD_NAME "${CEGUI_TARGET_NAME}")
         SET(JNI_PATH "${CMAKE_SOURCE_DIR}/samples/browser")
         foreach(COMBINED_SOURCE_FILE ${COMBINED_SOURCE_FILES})
@@ -47,22 +65,21 @@
         endforeach()
         SET(JNI_SRC_FILES "${COMBINED_SOURCE_FILES_STRING}")
         SET(PKG_NAME "cegui.org.uk.browser")
-        # Set this variable to false if no java code will be present (google android:hasCode for more info)
         SET(HAS_CODE "false")
         SET(HEADERS "")
         SET(SAMPLE_LDLIBS "")
         SET(ANDROID_SHARED_LIB "${CEGUI_TARGET_NAME}")
         file(COPY "${CMAKE_SOURCE_DIR}/datafiles/imagesets/ic_launcher.png" DESTINATION "${NDKOUT}/res/drawable")
         file(COPY "${CMAKE_SOURCE_DIR}/datafiles" DESTINATION "${NDKOUT}/assets")
-        #file(COPY "${CMAKE_BINARY_DIR}/datafiles/samples/samples.xml" DESTINATION
-        #    "${NDKOUT}/assets/samples/samples.xml")
+        configure_file("${OGRE_TEMPLATES_DIR}/Android_resources.cfg.in" "${NDKOUT}/assets/resources.cfg" @ONLY)
+        if (CEGUI_SAMPLES_RENDERER_OGRE_ACTIVE)
+            SET(ANDROID_GLES_VERSION "0x00020000")
+            configure_file("${OGRE_TEMPLATES_DIR}/Android.OgreGLES2.mk.in" "${NDKOUT}/jni/Android.mk" @ONLY)
+        elseif (CEGUI_SAMPLES_RENDERER_OPENGLES2_ACTIVE)
+            SET(ANDROID_GLES_VERSION "0x00030000")
+            configure_file("${OGRE_TEMPLATES_DIR}/Android.GLES3.mk.in" "${NDKOUT}/jni/Android.mk" @ONLY)
+        endif()
         configure_file("${OGRE_TEMPLATES_DIR}/AndroidManifest.xml.in" "${NDKOUT}/AndroidManifest.xml" @ONLY)
-        configure_file("${OGRE_TEMPLATES_DIR}/Android_resources.cfg.in" "${NDKOUT}/assets/resources.cfg" @ONLY)
-        if (OGRE_RenderSystem_GLES2_FOUND)
-            configure_file("${OGRE_TEMPLATES_DIR}/Android.OgreGLES2.mk.in" "${NDKOUT}/jni/Android.mk" @ONLY)
-        elseif (OGRE_RenderSystem_GLES_FOUND)
-            configure_file("${OGRE_TEMPLATES_DIR}/Android.OgreGLES1.mk.in" "${NDKOUT}/jni/Android.mk" @ONLY)
-        endif()

         add_custom_command(
             TARGET ${ANDROID_PROJECT_TARGET} POST_BUILD COMMAND ${ANDROID_EXECUTABLE}


ChibiOS: Fix I2S driver searching.

ChibiOS: Fix I2S driver searching.

--- cmake/ChibiOS3_HAL.cmake
+++ cmake/ChibiOS3_HAL.cmake
@@ -21,13 +21,14 @@
 ENDFOREACH()

 IF(STM32_FAMILY STREQUAL "F1")
-    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can ext gpt i2c icu mac pal pwm rtc sdc serial spi st uart usb)
+    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb)
     SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES
       STM32F1xx
       LLD
       LLD
       LLD/TIMv1
       LLD/I2Cv1
+      LLD/SPIv1
       LLD/TIMv1
       LLD
       LLD/GPIOv1
@@ -57,7 +58,7 @@
         nvic.c
     )
 ELSEIF(STM32_FAMILY STREQUAL "F4")
-    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c icu mac pal pwm rtc sdc serial spi st uart usb)
+    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb)
     SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES
       STM32F4xx
       LLD
@@ -65,6 +66,7 @@
       LLD
       LLD/TIMv1
       LLD/I2Cv1
+      LLD/SPIv1
       LLD/TIMv1
       LLD
       LLD/GPIOv2


Only fail on missing coverage deps in coverage builds.

It should be possible to use this just fine without coverage reports,
so we should not fail on missing dependencies (gcov, suitable compiler
etc.) unless an actual coverage build is made. Debug/Release should not
require this.

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -9,6 +9,12 @@
 # - Relax debug output.
 # - Keep a copy of the coverage output for later use.
 # - Updated coverage exclude patterns.
+#
+# 2018-01-03, HenryRLee
+# - Allow for *Clang compiler names, not just Clang.
+#
+# 2018-01-03, Bendik Samseth
+# - Only check compiler compatibility if in a coverage build.
 #
 #
 # USAGE:
@@ -43,43 +49,6 @@
 #
 #

-# Check prereqs
-FIND_PROGRAM( GCOV_PATH gcov )
-FIND_PROGRAM( LCOV_PATH lcov )
-FIND_PROGRAM( GENHTML_PATH genhtml )
-FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
-
-IF(NOT GCOV_PATH)
-	MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
-ENDIF() # NOT GCOV_PATH
-
-IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-    IF(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang")
-        MESSAGE(FATAL_ERROR "Compiler is not GNU gcc or Clang! Aborting...")
-	ENDIF()
-ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
-
-SET(CMAKE_CXX_FLAGS_COVERAGE
-    "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
-    CACHE STRING "Flags used by the C++ compiler during coverage builds."
-    FORCE )
-SET(CMAKE_C_FLAGS_COVERAGE
-    "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
-    CACHE STRING "Flags used by the C compiler during coverage builds."
-    FORCE )
-SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE
-    ""
-    CACHE STRING "Flags used for linking binaries during coverage builds."
-    FORCE )
-SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
-    ""
-    CACHE STRING "Flags used by the shared libraries linker during coverage builds."
-    FORCE )
-MARK_AS_ADVANCED(
-    CMAKE_CXX_FLAGS_COVERAGE
-    CMAKE_C_FLAGS_COVERAGE
-    CMAKE_EXE_LINKER_FLAGS_COVERAGE
-    CMAKE_SHARED_LINKER_FLAGS_COVERAGE )

 # Param _targetname     The name of new the custom make target
 # Param _testrunner     The name of the target which runs the tests.
@@ -130,8 +99,49 @@

 string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
 if (cmake_build_type_tolower STREQUAL "coverage")
+
+
+    # Check prereqs
+    FIND_PROGRAM( GCOV_PATH gcov )
+    FIND_PROGRAM( LCOV_PATH lcov )
+    FIND_PROGRAM( GENHTML_PATH genhtml )
+    FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+
+    IF(NOT GCOV_PATH)
+        MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
+    ENDIF() # NOT GCOV_PATH
+
+    IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+        IF(NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES ".*Clang")
+            MESSAGE(FATAL_ERROR "Compiler is not GNU gcc or Clang! Aborting...")
+        ENDIF()
+    ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
+
+    SET(CMAKE_CXX_FLAGS_COVERAGE
+        "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+        CACHE STRING "Flags used by the C++ compiler during coverage builds."
+        FORCE )
+    SET(CMAKE_C_FLAGS_COVERAGE
+        "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+        CACHE STRING "Flags used by the C compiler during coverage builds."
+        FORCE )
+    SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE
+        ""
+        CACHE STRING "Flags used for linking binaries during coverage builds."
+        FORCE )
+    SET(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
+        ""
+        CACHE STRING "Flags used by the shared libraries linker during coverage builds."
+        FORCE )
+    MARK_AS_ADVANCED(
+        CMAKE_CXX_FLAGS_COVERAGE
+        CMAKE_C_FLAGS_COVERAGE
+        CMAKE_EXE_LINKER_FLAGS_COVERAGE
+        CMAKE_SHARED_LINKER_FLAGS_COVERAGE )
+
+
     # If unwanted files are included in the coverage reports, you can
-    # adjust the exclude patterns on line 114.
+    # adjust the exclude patterns on line 83.
     SETUP_TARGET_FOR_COVERAGE(
                             coverage            # Name for custom target.
                             ${TEST_MAIN}        # Name of the test driver executable that runs the tests.


Fix a caffe2-gloo dependency problem

Fix a caffe2-gloo dependency problem

Summary:
The problem:
Building caffe2 fails because the installed directory contains "anaconda".

The cause:
Compiling Gloo will generate a new config.h file in the binary folder.
If we put the original config.h in front, the compiler will complain "Expected GLOO_USE_CUDA to be defined".

~~~Switch the positions of the include folders can solve the problem.~~~

Function caffe2_include_directories in cmake/Utils.cmake is a little bit hacky. If the directory contains "anaconda", it will append the new include directory after existing include path. Otherwise it will insert the directory before the path. So in the first case, the directories are inserted in order, and in the latter one, they are inserted reversely.

The solution:
See the commit.

pietern #1121
Closes https://github.com/caffe2/caffe2/pull/1258

Reviewed By: Yangqing

Differential Revision: D5907167

Pulled By: houseroad

fbshipit-source-id: 2cb3916e7e0313ebc3be3d1666bfa14bbf479607

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -356,8 +356,11 @@
       set(BUILD_TEST OFF)
       set(BUILD_BENCHMARK OFF)
       add_subdirectory(${PROJECT_SOURCE_DIR}/third_party/gloo)
-      caffe2_include_directories(${PROJECT_SOURCE_DIR}/third_party/gloo)
-      caffe2_include_directories(${PROJECT_BINARY_DIR}/third_party/gloo)
+      # Here is a little bit hacky. We have to put PROJECT_BINARY_DIR in front
+      # of PROJECT_SOURCE_DIR with/without conda system. The reason is that
+      # gloo generates a new config.h in the binary diretory.
+      include_directories(BEFORE SYSTEM ${PROJECT_SOURCE_DIR}/third_party/gloo)
+      include_directories(BEFORE SYSTEM ${PROJECT_BINARY_DIR}/third_party/gloo)
       set(BUILD_TEST ${__BUILD_TEST})
       set(BUILD_BENCHMARK ${__BUILD_BENCHMARK})


Make TriBITS pass SYSTEM to INCLUDE_DIRECTORIES() for Boost TPL when building the tests

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -9,4 +9,8 @@
   LIB_OPTIONAL_TPLS
     BoostOrg
     Netcdf
+  TEST_OPTIONAL_TPLS
+    # BoostOrg is listed twice to have -isystem added to the include directories for the TPL when compiling the tests.
+    # This is a known limitation of TriBITS (c.f. https://tribits.org/doc/TribitsDevelopersGuide.html#project-name-tpl-system-include-dirs)
+    BoostOrg
   )


Cmake: Produce error when compiling for 32-bit architecture since it does not compile otherwise (tested on Windows 10 with Visual studio 2017).

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -61,7 +61,8 @@
 endif()

 if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
-    message(WARNING "Inviwo is only supported for 64-bit architectures.")
+    message(FATAL_ERROR "Inviwo is only supported for 64-bit architectures. Resolve the error by deleting "
+	        "the cache (File->Delete Cache) and selecting 64-bit architecture when configuring.")
 endif()

 set_property(GLOBAL PROPERTY USE_FOLDERS On)


Fix Android installing/packaging instruction due to rename APK file. [ci package]

--- Source/CMake/Modules/Urho3D-CMake-common.cmake
+++ Source/CMake/Modules/Urho3D-CMake-common.cmake
@@ -585,7 +585,7 @@
             COMMENT "Stripping lib${TARGET_NAME}.so in library output directory")
         # When performing packaging, include the final apk file
         if (CMAKE_PROJECT_NAME STREQUAL Urho3D AND NOT APK_INCLUDED)
-            install (FILES ${LIBRARY_OUTPUT_PATH_ROOT}/bin/Urho3D.apk DESTINATION ${DEST_RUNTIME_DIR} OPTIONAL)
+            install (FILES ${LIBRARY_OUTPUT_PATH_ROOT}/bin/Urho3D-debug.apk DESTINATION ${DEST_RUNTIME_DIR} OPTIONAL)
             set (APK_INCLUDED 1)
         endif ()
     else ()


Add `cudnn_rnn_ops` to the Windows build

Fixes #13696.

--- tensorflow/contrib/cmake/tf_core_kernels.cmake
+++ tensorflow/contrib/cmake/tf_core_kernels.cmake
@@ -65,6 +65,8 @@
       "${tensorflow_source_dir}/tensorflow/contrib/boosted_trees/ops/split_handler_ops.cc"
       "${tensorflow_source_dir}/tensorflow/contrib/boosted_trees/ops/stats_accumulator_ops.cc"
       "${tensorflow_source_dir}/tensorflow/contrib/boosted_trees/ops/training_ops.cc"
+      "${tensorflow_source_dir}/tensorflow/contrib/cudnn_rnn/kernels/cudnn_rnn_ops.cc"
+      "${tensorflow_source_dir}/tensorflow/contrib/cudnn_rnn/ops/cudnn_rnn_ops.cc"
       "${tensorflow_source_dir}/tensorflow/contrib/factorization/kernels/clustering_ops.cc"
       "${tensorflow_source_dir}/tensorflow/contrib/factorization/kernels/masked_matmul_ops.cc"
       "${tensorflow_source_dir}/tensorflow/contrib/factorization/kernels/wals_solver_ops.cc"


ENH: Add cmake override for GIT_TAG of remote modules

An CMake variable REMOTE_GIT_TAG_${_name} can be set
in to override the value in the remote module configuration file.
The intent of the REMOTE_GIT_TAG_${_name} variable override is to
facilitate testing of remote module branch behaviors without
requiring changes to the ITK code base.

--- CMake/ITKModuleRemote.cmake
+++ CMake/ITKModuleRemote.cmake
@@ -149,10 +149,15 @@
 # The following options are currently supported:
 #    [GIT_REPOSITORY url]        # URL of git repo
 #    [GIT_TAG tag]               # Git branch name, commit id or tag
+#
+# An CMake variable REMOTE_GIT_TAG_${_name} can be set
+# in to override the value in the remote module configuration file.
+# The intent of the REMOTE_GIT_TAG_${_name} variable override is to
+# facilitate testing of remote module branch behaviors without
+# requiring changes to the ITK code base.
 function(itk_fetch_module _name _description)
   option(Module_${_name} "${_description}" OFF)
   mark_as_advanced(Module_${_name})
-

   # Fetch_$_remote_module} is deprecated. To maintain backward compatibility:
   if(Fetch_${_name})
@@ -177,9 +182,21 @@
     if("${_version}" VERSION_LESS 1.6.6)
       message(FATAL_ERROR "Git version 1.6.6 or later is required.")
     endif()
+
+    set(REMOTE_GIT_TAG "${_fetch_options_GIT_TAG}")
+
+    if( DEFINED REMOTE_GIT_TAG_${_name} AND NOT "${REMOTE_GIT_TAG_${_name}}" STREQUAL "${_fetch_options_GIT_TAG}")
+      set(REMOTE_GIT_TAG "${REMOTE_GIT_TAG_${_name}}")
+      message(STATUS "NOTE: Using override 'REMOTE_GIT_TAG_${_name}=${REMOTE_GIT_TAG}'\n"
+                     "      instead of value 'GIT_TAG=${_fetch_options_GIT_TAG}'\n"
+                     "      specified in file ${ITK_SOURCE_DIR}/Modules/Remote/${_name}.remote.cmake'")
+    endif()
+    set(REMOTE_GIT_TAG_${_name} "${REMOTE_GIT_TAG}" CACHE STRING "Override default GIT_TAG value for remote module ${_name}")
+    mark_as_advanced(REMOTE_GIT_TAG_${_name})
+
     _fetch_with_git("${GIT_EXECUTABLE}"
       "${_fetch_options_GIT_REPOSITORY}"
-      "${_fetch_options_GIT_TAG}"
+      "${REMOTE_GIT_TAG}"
       "${ITK_SOURCE_DIR}/Modules/Remote/${_name}"
       )
   endif()


Do not set (SO|)VERSION properties on VTK executables

The vtk_target_name macro sets the VERSION and SOVERSION properties to
"1" and puts the VTK version number (API version) directly in the
library file name via the OUTPUT_NAME property.  This was written for
VTK libraries and works well for them.  However, since commit 8b0cf94e
(Use the vtk_target macro to export/install wrappers, 2012-06-04) the
vtk_target macro is used also for wrapper executables.  We do not want
or need the "-1" extension added by the VERSION property on executable
targets, so do not set it on them.

Change-Id: I2f20e06c771d2e20f72307566c0c5950c7a96c9a

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -242,8 +242,11 @@
 endmacro()

 macro(vtk_target_name _name)
-  set_property(TARGET ${_name} PROPERTY VERSION 1)
-  set_property(TARGET ${_name} PROPERTY SOVERSION 1)
+  get_property(_type TARGET ${_name} PROPERTY TYPE)
+  if(NOT "${_type}" STREQUAL EXECUTABLE)
+    set_property(TARGET ${_name} PROPERTY VERSION 1)
+    set_property(TARGET ${_name} PROPERTY SOVERSION 1)
+  endif()
   if("${_name}" MATCHES "^[Vv][Tt][Kk]")
     set(_vtk "")
   else()


Fixed path suffix sdl2 dependency in cmake find script

--- CMakeModules/FindSDL2.cmake
+++ CMakeModules/FindSDL2.cmake
@@ -15,7 +15,7 @@
     PATH_SUFFIXES
     SDL2
     # path suffixes to search inside ENV{SDL2_ROOT_DIR}
-    include/SDL include
+    include/SDL2 include
     )

 FIND_LIBRARY(SDL2_LIBRARY


Change Elastix repository to SuperElastix (#95)

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -1,7 +1,7 @@
 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

-set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/mstaring/elastix )
-set( ELASTIX_GIT_TAG dedf2c3282107b515ea0a8d054a51aa8c03e60e7 )
+set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/SuperElastix/elastix )
+set( ELASTIX_GIT_TAG ef057ff89233822b26b04b31c3c043af57d5deff )

 ExternalProject_Add( Elastix
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}


Backup.

Backup.

--- system_definitions.cmake
+++ system_definitions.cmake
@@ -161,7 +161,7 @@
 #
 # Set the cmake module path.
 #
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules CACHE STRING "Location of Cmake modules")
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" CACHE STRING "Location of Cmake modules")

 #
 # Targets with global scope are declared and optionally defined in
@@ -173,6 +173,15 @@
 # Prerequisite discovery
 #
 include(${CMAKE_MODULE_PATH}/find_prerequisites.cmake)
+
+#
+# C++11 features
+#
+message(STATUS " ")
+message(STATUS "Checking for C++11 Compliance - ")
+message(STATUS " ")
+
+include(${CMAKE_MODULE_PATH}/CheckCXX11Features.cmake)

 #
 # Utility function to add a component to a system.


ENH: Update ExternalProjectDependency system based on commontk/Artichoke@ea920eb

List of changes:

$ git shortlog 0cc99d3..ea920eb --no-merges
Andras Lasso (1):
      Add support for EXTERNAL_PROJECT_ADDITIONAL_DIRS

Jean-Christophe Fillion-Robin (13):
      ExternalProjectDependency: Remove debug statement inadvertently integrated
      Add support for "ExternalProject_Add_Dependencies"
      ExternalProject_SetIfNotDefined: Add test checking interaction with cache variable
      ExternalProject_SetIfNotDefined: If any, display corresponding cache value
      ExternalProject_SetIfNotDefined: Update docstring
      ExternalProject_Include_Dependencies: Check if superbuild variable is improperly set
      ExternalProjectDependency: Fix spellcheck
      ExternalProjectDependency: Fix variable type of automatically propagated options
      circleci: Use dockbuild/centos7-devtoolset7-gcc7 instead of dockbuild/centos6
      ExternalProjectDependency: Ensure ``User Package Registry`` look up using ``find_*`` commands is disabled
      ExternalProjectDependency: Fix CMake version check for disabling ``User Package Registry``
      doc: Update website links to https versions
      ExternalProjectDependency: Force git protocol to https

--- CMake/ctkMacroCheckExternalProjectDependency.cmake
+++ CMake/ctkMacroCheckExternalProjectDependency.cmake
@@ -16,7 +16,7 @@
 #  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.txt
+#      https://www.apache.org/licenses/LICENSE-2.0.txt
 #
 #  Unless required by applicable law or agreed to in writing, software
 #  distributed under the License is distributed on an "AS IS" BASIS,
@@ -49,6 +49,13 @@
 # are searched for if not already found in ``EXTERNAL_PROJECT_DIR``.

 #.rst:
+# .. cmake:variable:: EXTERNAL_PROJECT_ADDITIONAL_DIRS
+#
+# If set, this variable represents additional directories in which external project files
+# are searched for if not already found in ``EXTERNAL_PROJECT_DIR`` and
+# ``EXTERNAL_PROJECT_ADDITIONAL_DIR``.
+
+#.rst:
 # .. cmake:variable:: EXTERNAL_PROJECT_FILE_PREFIX
 #
 # This variable describes the prefix of the external project files looked up in
@@ -85,12 +92,17 @@
 #.rst:
 # .. cmake:variable:: EP_GIT_PROTOCOL
 #
-# The value of this variable is controled by the option ``<SUPERBUILD_TOPLEVEL_PROJECT>_USE_GIT_PROTOCOL``
-# automatically defined by including this CMake module. Setting this option allows to update the value of
-# ``EP_GIT_PROTOCOL`` variable.
-#
-# If enabled, the variable ``EP_GIT_PROTOCOL`` is set to ``git``. Otherwise, it is set to ``https``.
-# The option is enabled by default.
+# The value of this variable is always set to ``https``.
+#
+# Following the removal of git protocol by GitHub, the option
+# ``<SUPERBUILD_TOPLEVEL_PROJECT>_USE_GIT_PROTOCOL`` is obsolete.
+# It allowed to toggle between ``git`` and ``https``.
+# If this option is enabled, a warning is reported and the option is forced to ``OFF``.
+#
+# Similarly, if the variable ``EP_GIT_PROTOCOL`` is already set to ``git``, a warning is reported
+# and the value is forced to ``https``.
+#
+# See details at https://github.blog/2021-09-01-improving-git-protocol-security-github
 #
 # The variable ``EP_GIT_PROTOCOL`` can be used when adding external project. For example:
 #
@@ -102,9 +114,22 @@
 #     [...]
 #     )
 #
-option(${SUPERBUILD_TOPLEVEL_PROJECT}_USE_GIT_PROTOCOL "If behind a firewall turn this off to use https instead." ON)
-set(EP_GIT_PROTOCOL "git")
-if(NOT ${SUPERBUILD_TOPLEVEL_PROJECT}_USE_GIT_PROTOCOL)
+if(DEFINED ${SUPERBUILD_TOPLEVEL_PROJECT}_USE_GIT_PROTOCOL AND ${SUPERBUILD_TOPLEVEL_PROJECT}_USE_GIT_PROTOCOL)
+  message(WARNING "Forcing ${SUPERBUILD_TOPLEVEL_PROJECT}_USE_GIT_PROTOCOL to OFF (Already set to ON in current scope)")
+  set(${SUPERBUILD_TOPLEVEL_PROJECT}_USE_GIT_PROTOCOL OFF CACHE BOOL "" FORCE)
+endif()
+if(DEFINED EP_GIT_PROTOCOL)
+  if("${EP_GIT_PROTOCOL}" STREQUAL "git")
+    get_property(_value_set_in_cache CACHE EP_GIT_PROTOCOL PROPERTY VALUE SET)
+    if(_value_set_in_cache)
+      message(WARNING "Forcing EP_GIT_PROTOCOL cache variable to 'https' (Already set to '${EP_GIT_PROTOCOL}' in current scope)")
+      set(EP_GIT_PROTOCOL "https" CACHE STRING "" FORCE)
+    else()
+      message(WARNING "Forcing EP_GIT_PROTOCOL variable to 'https' (Already set to '${EP_GIT_PROTOCOL}' in current scope)")
+      set(EP_GIT_PROTOCOL "https")
+    endif()
+  endif()
+else()
   set(EP_GIT_PROTOCOL "https")
 endif()

@@ -440,16 +465,37 @@

   set(_ep_arguments "")

+  # Option CMAKE_FIND_USE_PACKAGE_REGISTRY was introduced in CMake 3.16
+  if(NOT CMAKE_VERSION VERSION_LESS "3.16")
+    if(NOT DEFINED CMAKE_FIND_USE_PACKAGE_REGISTRY)
+      set(CMAKE_FIND_USE_PACKAGE_REGISTRY OFF)
+    endif()
+  else()
+    if(NOT DEFINED CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
+      set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON)
+    endif()
+  endif()
+
+  # Set list of CMake options to propagate
+  set(_options
+    CMAKE_EXPORT_COMPILE_COMMANDS:BOOL
+    CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY:BOOL
+    CMAKE_JOB_POOL_COMPILE:STRING
+    CMAKE_JOB_POOL_LINK:STRING
+    CMAKE_JOB_POOLS:STRING
+    )
+  if(NOT CMAKE_VERSION VERSION_LESS "3.16")
+    list(APPEND _options
+      CMAKE_FIND_USE_PACKAGE_REGISTRY:BOOL
+      )
+  endif()
+
   # Automatically propagate CMake options
-  foreach(_cmake_option IN ITEMS
-    CMAKE_EXPORT_COMPILE_COMMANDS
-    CMAKE_JOB_POOL_COMPILE
-    CMAKE_JOB_POOL_LINK
-    CMAKE_JOB_POOLS
-    )
+  foreach(_cmake_option_and_type IN LISTS _options)
+    _sb_extract_varname_and_vartype(${_cmake_option_and_type} _cmake_option _cmake_option_type)
     if(DEFINED ${_cmake_option})
       list(APPEND _ep_arguments CMAKE_CACHE_ARGS
-        -D${_cmake_option}:BOOL=${${_cmake_option}}
+        -D${_cmake_option}:${_cmake_option_type}=${${_cmake_option}}
         )
     endif()
   endforeach()
@@ -580,6 +626,41 @@
   endif()
   set(${output_var} ${optional} PARENT_SCOPE)
 endfunction()
+
+#.rst:
+# .. cmake:function:: ExternalProject_Add_Dependencies
+#
+# .. code-block:: cmake
+#
+#  ExternalProject_Add_Dependencies(<project_name>
+#      DEPENDS <dep1> [<dep2> [...]]
+#    )
+#
+#
+# .. code-block:: cmake
+#
+#  DEPENDS  List of additional dependencies to associat with `<project_name>`.
+#
+macro(ExternalProject_Add_Dependencies project_name)
+  set(options)
+  set(oneValueArgs)
+  set(multiValueArgs DEPENDS)
+  cmake_parse_arguments(_epad "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+  # Sanity checks
+  if(x${project_name} STREQUAL xDEPENDS)
+    message(FATAL_ERROR "Argument <project_name> is missing !")
+  endif()
+  if(_epad_UNPARSED_ARGUMENTS)
+    message(FATAL_ERROR "Invalid arguments: ${_epad_UNPARSED_ARGUMENTS}")
+  endif()
+
+  if(NOT _epad_DEPENDS)
+    message(FATAL_ERROR "Argument DEPENDS is missing")
+  endif()
+
+  set_property(GLOBAL PROPERTY SB_${project_name}_ADDITIONAL_DEPENDS ${_epad_DEPENDS})
+endmacro()

 #.rst:
 # .. cmake:function:: ExternalProject_Include_Dependencies
@@ -716,6 +797,11 @@
     #message("[${project_name}] Setting _sb_SB_VAR with default value '${_sb_SB_VAR}'")
   endif()

+  # Try to detect if superbuild variable was improperly passed
+  if("${_sb_SB_VAR}" STREQUAL "_SUPERBUILD")
+    message(FATAL_ERROR "SUPERBUILD_VAR value is incorrectly set to '_SUPERBUILD'")
+  endif()
+
   # Set local variables
   set(_sb_DEPENDS ${${_sb_DEPENDS_VAR}})
   set(_sb_USE_SYSTEM ${${_sb_USE_SYSTEM_VAR}})
@@ -735,6 +821,12 @@
   if(${_sb_proj} STREQUAL ${SUPERBUILD_TOPLEVEL_PROJECT} AND NOT DEFINED SB_FIRST_PASS)
     message(STATUS "SuperBuild - First pass")
     set(SB_FIRST_PASS TRUE)
+  endif()
+
+  # Extra dependencies specified using "ExternalProject_Add_Dependencies"
+  get_property(_sb_ADDITIONAL_DEPENDS GLOBAL PROPERTY SB_${_sb_proj}_ADDITIONAL_DEPENDS)
+  if(NOT "x${_sb_ADDITIONAL_DEPENDS}" STREQUAL "x")
+    list(APPEND _sb_DEPENDS ${_sb_ADDITIONAL_DEPENDS})
   endif()

   set(_sb_REQUIRED_DEPENDS)
@@ -790,15 +882,25 @@
   foreach(dep ${_sb_DEPENDS})
     get_property(_included GLOBAL PROPERTY SB_${dep}_FILE_INCLUDED)
     if(NOT _included)
-      # XXX - Refactor - Add a single variable named 'EXTERNAL_PROJECT_DIRS'
       if(EXISTS "${EXTERNAL_PROJECT_DIR}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake")
         include(${EXTERNAL_PROJECT_DIR}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake)
       elseif(EXISTS "${${dep}_FILEPATH}")
+        # Originally implemented to support CTK buildsystem
         include(${${dep}_FILEPATH})
       elseif(EXISTS "${EXTERNAL_PROJECT_ADDITIONAL_DIR}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake")
         include(${EXTERNAL_PROJECT_ADDITIONAL_DIR}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake)
       else()
-        message(FATAL_ERROR "Can't find ${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake")
+        set(_found_ep_cmake FALSE)
+        foreach(_external_project_additional_dir ${EXTERNAL_PROJECT_ADDITIONAL_DIRS})
+          if(EXISTS "${_external_project_additional_dir}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake")
+            include(${_external_project_additional_dir}/${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake)
+            set(_found_ep_cmake TRUE)
+            break()
+          endif()
+        endforeach()
+        if(NOT _found_ep_cmake)
+          message(FATAL_ERROR "Can't find ${EXTERNAL_PROJECT_FILE_PREFIX}${dep}.cmake")
+        endif()
       endif()
       set_property(GLOBAL PROPERTY SB_${dep}_FILE_INCLUDED 1)
     endif()
@@ -959,13 +1061,16 @@
 #
 #  ExternalProject_SetIfNotDefined(<var> <defaultvalue> [OBFUSCATE] [QUIET])
 #
-# The default value is set with:
-#  (1) if set, the value environment variable <var>.
-#  (2) if set, the value of local variable variable <var>.
-#  (3) if none of the above, the value passed as a parameter.
-#
-# Setting the optional parameter 'OBFUSCATE' will display 'OBFUSCATED' instead of the real value.
-# Setting the optional parameter 'QUIET' will not display any message.
+# If *NOT* already defined, the variable <var> is set with:
+#  (1) the value of the environment variable <var>, if defined.
+#  (2) the value of the local variable variable <var>, if defined.
+#  (3) if none of the above is defined, the <defaultvalue> passed as a parameter.
+#
+# Passing the optional parameter 'OBFUSCATE' will display 'OBFUSCATED' instead of the real value.
+# Passing the optional parameter 'QUIET' will not display any message.
+#
+# For convenience, the value of the cache variable named <var> will
+# be displayed if it was set and if QUIET has not been passed.
 macro(ExternalProject_SetIfNotDefined var defaultvalue)
   set(_obfuscate FALSE)
   set(_quiet FALSE)
@@ -996,6 +1101,14 @@
       message(STATUS "Setting '${var}' variable with default value '${_value}'")
     endif()
     set(${var} "${defaultvalue}")
+  endif()
+  get_property(_is_set CACHE ${var} PROPERTY VALUE SET)
+  if(_is_set AND NOT _quiet)
+    set(_value "${${var}}")
+    if(_obfuscate)
+      set(_value "OBFUSCATED")
+    endif()
+    message(STATUS "Cache variable '${var}' set to '${_value}'")
   endif()
 endmacro()


Fix path bug on windows direct call to ctest

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

--- test/CTestTestfile.cmake
+++ test/CTestTestfile.cmake
@@ -19,11 +19,23 @@
 # ${TEST_LOCAL} is repleased by "FALSE" only by automatic test call, else {TEST_LOCAL} is not defined
 SET(LOCAL ${TEST_LOCAL})
 IF(NOT (LOCAL MATCHES "FALSE"))
-	set(OV_ROOT_DIR              "$ENV{PWD}/..")
+	IF(WIN32)
+		# triky way to get absolute path for ../. directory in windows with cygwin
+		# todo: try to find a cmake way to get this for simple call to ctest in OV_ROOT_DIR\test directory in the aim to run all test
+		exec_program("cygpath" ARGS "-a -w ../." OUTPUT_VARIABLE "OV_ROOT_DIR")
+	ELSE(WIN32)
+		set(OV_ROOT_DIR              "$ENV{PWD}/..")
+	ENDIF(WIN32)
+
 	set(CTEST_SOURCE_DIRECTORY		"${OV_ROOT_DIR}")
 	set(ENV{OV_BINARY_PATH} "${OV_ROOT_DIR}/dist")
 	message("running local test here= $ENV{OV_BINARY_PATH}")
 ENDIF(NOT (LOCAL MATCHES "FALSE"))
+
+get_cmake_property(_variableNames VARIABLES)
+foreach (_variableName ${_variableNames})
+    message(STATUS "${_variableName}=${${_variableName}}")
+endforeach()

 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/openvibe-plugins/acquisition/trunc/test")
@@ -82,6 +94,3 @@
 SUBDIRS("${CTEST_SOURCE_DIRECTORY}/scripts/software/tmp/vrpn/java_vrpn/test")

-
-
-


cmake: Fix VLC.app target.

cmake: Fix VLC.app target.

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -153,7 +153,8 @@
         COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx
         COMMAND cp -R ${CMAKE_CURRENT_SOURCE_DIR}/extras/package/macosx/vlc.xcodeproj ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx
         COMMAND cp -R ${CMAKE_CURRENT_SOURCE_DIR}/extras/package/macosx/Resources ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx
-        COMMAND for i in AUTHORS COPYING extras/package/macosx/README.MacOSX.rtf THANKS\;do cp ${CMAKE_CURRENT_SOURCE_DIR}/$$i ${CMAKE_CURRENT_BINARY_DIR}/tmp/ \; done
+        COMMAND cp -R ${CMAKE_CURRENT_SOURCE_DIR}/extras/package/macosx/README.MacOSX.rtf ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx
+        COMMAND for i in AUTHORS COPYING THANKS\;do cp ${CMAKE_CURRENT_SOURCE_DIR}/$$i ${CMAKE_CURRENT_BINARY_DIR}/tmp/ \; done
         COMMAND for i in AppleRemote.h AppleRemote.m about.h about.m applescript.h applescript.m controls.h controls.m equalizer.h equalizer.m intf.h intf.m macosx.m misc.h misc.m open.h open.m output.h output.m playlist.h playlist.m playlistinfo.h playlistinfo.m prefs_widgets.h prefs_widgets.m prefs.h prefs.m vout.h voutqt.m voutgl.m wizard.h wizard.m extended.h extended.m bookmarks.h bookmarks.m sfilters.h sfilters.m update.h update.m interaction.h interaction.m embeddedwindow.h embeddedwindow.m fspanel.h fspanel.m vout.m\; do cp ${CMAKE_CURRENT_SOURCE_DIR}/modules/gui/macosx/$$i ${CMAKE_CURRENT_BINARY_DIR}/tmp/modules/gui/macosx\; done
         COMMAND cd ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx && xcodebuild -target vlc | grep -vE '^\([ \\t]|$$\)' && cd ../../../../ && cp ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx/build/Default/VLC.bundle/Contents/Info.plist ${CMAKE_CURRENT_BINARY_DIR}/VLC.app/Contents && cp -R ${CMAKE_CURRENT_BINARY_DIR}/tmp/extras/package/macosx/build/Default/VLC.bundle/Contents/Resources/English.lproj ${CMAKE_CURRENT_BINARY_DIR}/VLC.app/Contents/Resources
         COMMAND cp -r ${CMAKE_CURRENT_SOURCE_DIR}/extras/package/macosx/Resources ${CMAKE_CURRENT_BINARY_DIR}/VLC.app/Contents


Fix cmake < v3.7 compatibility in Cuda.cmake (#6338)

Fix for compatibility with CMake <3.7 (related conversation under 37e4289)

* Fix cmake < v3.7 compatibility in Cuda.cmake

* Fix version test variable naming in Cuda.cmake

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -109,8 +109,8 @@
   set(__nvcc_flags "")
   set(__nvcc_archs_readable "")

-  string(COMPARE GREATER_EQUAL "${CUDA_VERSION}" "9.0" iscudanewerthan90)
-  if(iscudanewerthan90)
+  string(COMPARE LESS "${CUDA_VERSION}" "9.0" iscudaolderthan90)
+  if(NOT iscudaolderthan90)
     string(REPLACE "21(20)" "" __cuda_arch_bin "${__cuda_arch_bin}")
     string(REPLACE "20" "" __cuda_arch_bin "${__cuda_arch_bin}")
   endif()


COMP: Superbuild - Reviewed and simplify ExternalProject

Removed the function _ep_write_gitupdate_script which was mainly used
to re-apply patch when the repository was updated.

A better pratice consist to fixed the version/tag when patches are applied.

If nevertheless, the head of the repository is tracked and patches are
applied, the external_project_step(s) should be added.

These extra step(s) would include
 - git reset --hard HEAD
 - Switch back to master: git checkout master
 - Pull in changes: git pull
 - If a tag is specified, attempt to checkout: git checkout TAG
 - If patch_cmd is specified, attempt to re-apply the patches

.. and should depend from the "update" one

--- CMake/ExternalProject.cmake
+++ CMake/ExternalProject.cmake
@@ -240,59 +240,6 @@
 )
 endfunction(_ep_write_gitclone_script)

-#
-# Since patch may have been applied: git reset --hard HEAD
-# Switch back to master: git checkout master
-# Pull in changes: git pull
-# If a tag is specified, attempt to checkout: git checkout TAG
-# If patch_cmd is specified, attempt to re-apply the patches
-function(_ep_write_gitupdate_script script_filename source_dir git_EXECUTABLE git_repository git_tag src_name work_dir patch_cmd)
-  file(WRITE ${script_filename}
-"execute_process(
-  COMMAND \"${git_EXECUTABLE}\" reset --hard HEAD
-  WORKING_DIRECTORY \"${work_dir}\"
-  RESULT_VARIABLE error_code
-  )
-execute_process(
-  COMMAND \"${git_EXECUTABLE}\" checkout master
-  WORKING_DIRECTORY \"${work_dir}\"
-  RESULT_VARIABLE error_code
-  )
-if(error_code)
-  message(FATAL_ERROR \"Failed to checkout master - repository: ${git_repository}\")
-endif()
-execute_process(
-  COMMAND \"${git_EXECUTABLE}\" pull
-  WORKING_DIRECTORY \"${work_dir}\"
-  RESULT_VARIABLE error_code
-  )
-if(error_code)
-  message(FATAL_ERROR \"Failed to pull - repository: ${git_repository}\")
-endif()
-if(NOT \"${git_tag}\" STREQUAL \"\")
-  execute_process(
-    COMMAND \"${git_EXECUTABLE}\" checkout ${git_tag}
-    WORKING_DIRECTORY \"${work_dir}\"
-    RESULT_VARIABLE error_code
-    ERROR_QUIET
-    )
-  if(error_code)
-    message(FATAL_ERROR \"Failed to checkout tag ${git_tag} - repository: ${git_repository}\")
-  endif()
-endif()
-if(NOT \"${patch_cmd}\" STREQUAL \"\")
-  execute_process(
-    COMMAND \"${patch_cmd}\"
-    WORKING_DIRECTORY \"${work_dir}\"
-    RESULT_VARIABLE error_code
-    )
-  if(error_code)
-    message(FATAL_ERROR \"Failed to apply patch for ${name}\")
-  endif()
-endif()
-")
-endfunction(_ep_write_gitupdate_script)
-
 function(_ep_write_downloadfile_script script_filename remote local timeout)
   if(timeout)
     set(timeout_args TIMEOUT ${timeout})
@@ -698,6 +645,17 @@
     )
 endfunction(_ep_add_mkdir_command)

+function(_ep_get_git_version git_EXECUTABLE git_version_var)
+  if(git_EXECUTABLE)
+    execute_process(
+      COMMAND "${git_EXECUTABLE}" --version
+      OUTPUT_VARIABLE ov
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      )
+    string(REGEX REPLACE "^git version (.+)$" "\\1" version "${ov}")
+    set(${git_version_var} "${version}" PARENT_SCOPE)
+  endif()
+endfunction()

 function(_ep_add_download_command name)
   ExternalProject_Get_Property(${name} source_dir stamp_dir download_dir tmp_dir)
@@ -782,8 +740,20 @@
     if(NOT git_EXECUTABLE)
       message(FATAL_ERROR "error: could not find git for clone of ${name} - Make sure git_EXECUTABLE is set properly")
     endif()
+
+    # The git submodule update '--recursive' flag requires git >= v1.6.5
+    #
+    _ep_get_git_version("${git_EXECUTABLE}" git_version)
+    if(git_version VERSION_LESS 1.6.5)
+      message(FATAL_ERROR "error: git version 1.6.5 or later required for 'git submodule update --recursive': git_version='${git_version}'")
+    endif()

     get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
+    # Since the default branch in git repository may be different from 'master',
+    # let's NOT default to 'master'
+    #if(NOT git_tag)
+    #  set(git_tag "master")
+    #endif()

     set(repository ${git_repository})
     set(module)
@@ -866,9 +836,6 @@
   get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
   get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
   get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
-
-  # Patch
-  get_property(patch_cmd TARGET ${name} PROPERTY _EP_PATCH_COMMAND)

   set(work_dir)
   set(comment)
@@ -898,19 +865,21 @@
     set(always 1)
   elseif(git_repository)
     if(NOT git_EXECUTABLE)
-      message(FATAL_ERROR "error: could not find git for pull of ${name}")
-    endif()
+      message(FATAL_ERROR "error: could not find git for fetch of ${name}")
+    endif()
+    set(comment "Performing update step (git fetch) for '${name}'")
     set(work_dir ${source_dir})
-    get_filename_component(src_name "${source_dir}" NAME)
-
     get_property(git_tag TARGET ${name} PROPERTY _EP_GIT_TAG)
-
-    # The following script will allow to reset, pull and re-apply patches
-    _ep_write_gitupdate_script(${tmp_dir}/${name}-gitupdate.cmake ${source_dir} ${git_EXECUTABLE}
-    ${git_repository} "${git_tag}" ${src_name} ${work_dir} "${patch_cmd}")
-
-    set(comment "Performing update step (git pull) for '${name}'")
-    set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake)
+    # Since the default branch in git repository may be different from 'master',
+    # let's NOT default to 'master'
+    #if(NOT git_tag)
+    #  set(git_tag "master")
+    #endif()
+
+    set(cmd ${git_EXECUTABLE} fetch
+      COMMAND ${git_EXECUTABLE} checkout ${git_tag}
+      COMMAND ${git_EXECUTABLE} submodule update --recursive
+      )
     set(always 1)
   endif()


vtkModuleMacros: allow skipping header installation

Headers might be installed elsewhere.

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -751,7 +751,7 @@
   vtk_module_export("${ARGN}")

   # Figure out which headers to install.
-  if(NOT VTK_INSTALL_NO_DEVELOPMENT AND _hdrs)
+  if(NOT VTK_INSTALL_NO_DEVELOPMENT AND VTK_INSTALL_NO_HEADERS AND _hdrs)
     install(FILES ${_hdrs}
       DESTINATION ${VTK_INSTALL_INCLUDE_DIR}
       COMPONENT Development


Change order in which zlib libraries names are searched

We need to look for zlib first in order to have the right dll filename found within a Windows Conda environment

--- CMakeModules/FindZLIB.cmake
+++ CMakeModules/FindZLIB.cmake
@@ -20,7 +20,7 @@

 check_include_file(zlib.h HAVE_ZLIB_H)

-find_library(ZLIB_LIBRARY NAMES z zlibdll zlib PATHS ${ZLIB_LIBRARY_DIR})
+find_library(ZLIB_LIBRARY NAMES zlibdll zlib z PATHS ${ZLIB_LIBRARY_DIR})
 if(ZLIB_LIBRARY)
   check_library_exists(${ZLIB_LIBRARY} deflate "" HAVE_ZLIB_LIBRARY)
 endif(ZLIB_LIBRARY)


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -98,7 +98,7 @@
     math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")

     # if we could extract them, compare with the requested version number
-    if (SFML_VERSION_MAJOR)
+    if (SFML_VERSION_PATCH)
         # transform version numbers to an integer
         math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")


COMP: Fix LSTK warning.

COMP: Fix LSTK warning.

EXCLUDE_FROM_ALL is replaced by EXCLUDE_FROM_DEFAULT in the latest
LSTK commit:c03168c0ff69386d7f59b00b46875273852068c7.

Change-Id: I3ff3e6528fc9cbff4b4a30214a28b07ca2d4785e

--- Modules/Remote/LesionSizingToolkit.remote.cmake
+++ Modules/Remote/LesionSizingToolkit.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(LesionSizingToolkit
   "Framework for determining the sizes of lesions in medical images."
   GIT_REPOSITORY http://public.kitware.com/LesionSizingToolkit.git
-  GIT_TAG  4c4a381f8dd302fbc3418d882fe1a78539b605da
+  GIT_TAG  c03168c0ff69386d7f59b00b46875273852068c7
   )


refactor: remove dead code

refactor: remove dead code

--- Superbuild/Projects/win32/veloview.bundle.cmake
+++ Superbuild/Projects/win32/veloview.bundle.cmake
@@ -16,17 +16,6 @@
 install(DIRECTORY "${install_location}/bin/"
         DESTINATION "bin"
         COMPONENT ${AppName})
-
-if(0)
-SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
-  "MessageBox MB_YESNO \\\"Setup will now download/install WinPCAP. Do you want to install WinPCAP? It is needed for VeloView to work.\\\" /SD IDYES IDNO endActiveSync
-NSISdl::download http://www.winpcap.org/install/bin/WinPcap_4_1_2.exe $INSTDIR\\\\WinPcap_4_1_2.exe
-ExecWait \\\"$INSTDIR\\\\WinPcap_4_1_2.exe\\\"
-Delete \\\"$INSTDIR\\\\WinPcap_4_1_2.exe\\\"
-Goto endActiveSync
-endActiveSync:
-")
-endif()

 # install python since (since python dlls are not in the install location)
 if (python_ENABLED AND NOT USE_SYSTEM_python)