build: sink the ICU flag handling lower (NFC)

Move the ICU flag handling to the same area as `_c_compile_variant_flags` which
computes the C compile flags.  This allows us to ensure that we order the flags
correctly when they are merged into the `c_compile_flags`.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -960,21 +960,6 @@
   endif()
   _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")

-  if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
-    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
-     target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}")
-    endif()
-    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
-     target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}")
-    endif()
-  endif()
-
   if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
     swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
     target_include_directories("${target}" SYSTEM PRIVATE ${SWIFTLIB_INCLUDE})
@@ -1218,6 +1203,21 @@
     "${SWIFTLIB_SINGLE_FORCE_BUILD_OPTIMIZED_keyword}"
     RESULT_VAR_NAME c_compile_flags
     )
+
+  if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
+    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
+     target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}")
+    endif()
+    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
+     target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}")
+    endif()
+  endif()

   if(SWIFTLIB_IS_STDLIB)
     # We don't ever want to link against the ABI-breakage checking symbols


build: add additional case of special handling for exherbo

The file system layout on exherbo is different from most other Linux
distributions.  Add an additional ignored case for the include paths for
when cross-compiling the stdlib to additional targets.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -818,12 +818,14 @@
   if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
     if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include")
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
       target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_UC_INCLUDE}")
     endif()
     if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "" AND
        NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include")
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
+       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
       target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_ICU_I18N_INCLUDE}")
     endif()
   endif()


Revert r200150, "[CMake] tablegen(): Use -I <dir> according to the list by include_directories()."

It missed include/llvm/Target. Could I avoid GLOB_RECURSE anyways? :(
FYI, I intended to prune ${LLVM_MAIN_INCLUDE_DIR} in TableGen.cmake in r200150.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -3,16 +3,8 @@
 # Adds the name of the generated file to TABLEGEN_OUTPUT.

 function(tablegen project ofn)
-  # Use the list by include_directories().
-  get_property(include_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
-
-  # Collect possible dependent *.td(s).
-  # FIXME: It is far from optimal.
-  file(GLOB dependent_tds "*.td")
-  foreach(inc ${include_dirs})
-    file(GLOB tds "${inc}/*.td")
-    list(APPEND dependent_tds ${tds})
-  endforeach()
+  file(GLOB local_tds "*.td")
+  file(GLOB_RECURSE global_tds "${LLVM_MAIN_INCLUDE_DIR}/llvm/*.td")

   if (IS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
     set(LLVM_TARGET_DEFINITIONS_ABSOLUTE ${LLVM_TARGET_DEFINITIONS})
@@ -20,20 +12,16 @@
     set(LLVM_TARGET_DEFINITIONS_ABSOLUTE
       ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS})
   endif()
-  foreach(inc ${include_dirs})
-    list(APPEND TABLEGEN_INCLUDE_DIRECTORIES -I ${inc})
-  endforeach()
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     # Generate tablegen output in a temporary file.
-    COMMAND ${${project}_TABLEGEN_EXE} ${ARGN}
-    -I ${CMAKE_CURRENT_SOURCE_DIR}
-    ${TABLEGEN_INCLUDE_DIRECTORIES}
+    COMMAND ${${project}_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
+    -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
     -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     # The file in LLVM_TARGET_DEFINITIONS may be not in the current
     # directory and local_tds may not contain it, so we must
     # explicitly list it here:
-    DEPENDS ${${project}_TABLEGEN_EXE} ${dependent_tds}
+    DEPENDS ${${project}_TABLEGEN_EXE} ${local_tds} ${global_tds}
     ${LLVM_TARGET_DEFINITIONS_ABSOLUTE}
     COMMENT "Building ${ofn}..."
     )


Use find_package to find Protobuf in FindNanopb.cmake.

--- cmake/Modules/FindNanopb.cmake
+++ cmake/Modules/FindNanopb.cmake
@@ -92,6 +92,7 @@
 #                           write FindNanopb.cmake
 # 2013.04.22 - Oliver Lee - Find and use PYTHON_EXECUTABLE instead of hardcoding
 #                           the python command.
+#                           Use find_package() to find Protobuf.
 #
 #=============================================================================

@@ -198,15 +199,7 @@
   list(APPEND NANOPB_HDRS "${${FIL}__nano_pb_file}")
 endforeach()

-# Find the protoc Executable
-find_program(PROTOBUF_PROTOC_EXECUTABLE
-    NAMES protoc
-    DOC "The Google Protocol Buffers Compiler"
-    PATHS
-    ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/Release
-    ${PROTOBUF_SRC_ROOT_FOLDER}/vsprojects/Debug
-)
-mark_as_advanced(PROTOBUF_PROTOC_EXECUTABLE)
+find_package(Protobuf REQUIRED)

 # Find nanopb generator
 find_file(NANOPB_GENERATOR_EXECUTABLE


Fix for issue #506

Fix for issue #506

Quit earlier if libusb-1.0 is not found to prevent OPENNI_FOUND from being set

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

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -23,15 +23,22 @@
                PATH_SUFFIXES lib)
    include(FindPackageHandleStandardArgs)
    find_package_handle_standard_args(USB_10 DEFAULT_MSG USB_10_LIBRARY USB_10_INCLUDE_DIR)
+   if(NOT USB_10_FOUND)
+     message(STATUS "OpeNI disabled because libusb-1.0 not found.")
+     set(HAVE_OPENNI OFF)
+     return()
+   else(NOT USB_10_FOUND)
+     include_directories(${USB_10_INCLUDE_DIR})
+   endif(NOT USB_10_FOUND)
 endif(NOT WIN32)
-
+
 if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
   pkg_check_modules(PC_OPENNI openni-dev)
 else()
   pkg_check_modules(PC_OPENNI QUIET openni-dev)
 endif()

-set(OPENNI_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER} ${PC_USB_10_CFLAGS_OTHER})
+set(OPENNI_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER})

 #add a hint so that it can find it without the pkg-config
 find_path(OPENNI_INCLUDE_DIR XnStatus.h
@@ -43,7 +50,7 @@
              NAMES OpenNI64 OpenNI
              HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib "${OPENNI_ROOT}" "$ENV{OPENNI_ROOT}"
              PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib" "$ENV{PROGRAMW6432}/OpenNI/Lib64"
-			 PATH_SUFFIXES lib Lib Lib64)
+             PATH_SUFFIXES lib Lib Lib64)

 set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIR})
 if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@@ -57,14 +64,6 @@
     OPENNI_LIBRARY OPENNI_INCLUDE_DIR)

 mark_as_advanced(OPENNI_LIBRARY OPENNI_INCLUDE_DIR)
-if(NOT WIN32 AND NOT USB_10_FOUND)
-  message(STATUS "OpenNI disabled because libusb-1.0 not found.")
-  set(HAVE_OPENNI OFF)
-  set(OPENNI_FOUND OFF)
-  return()
-else(NOT WIN32 AND NOT USB_10_FOUND)
-	include_directories(${USB_10_INCLUDE_DIR})
-endif(NOT WIN32 AND NOT USB_10_FOUND)

 if(OPENNI_FOUND)
   set(HAVE_OPENNI ON)


Missing space

Missing space

--- cmake/Modules/PluginTest.cmake
+++ cmake/Modules/PluginTest.cmake
@@ -2,7 +2,7 @@
 #
 # This module reuires the samp-server-cli script to be present in PATH in
 # order to be able to run the tests. The script can be downloaded here:
-#
+#
 #   https://github.com/Zeex/samp-server-cli
 #
 # Additionally the SAMP_SERVER_ROOT environment variable must be defined and


fix python cross-compilation

fix python cross-compilation

--- cmake/OpenCVDetectPython.cmake
+++ cmake/OpenCVDetectPython.cmake
@@ -85,9 +85,9 @@
       # not using _version_string here, because it might not conform to the CMake version format
       if(CMAKE_CROSSCOMPILING)
         # builder version can differ from target, matching base version (e.g. 2.7)
-        find_host_package(PythonLibs "${_version_major_minor}")
+        find_package(PythonLibs "${_version_major_minor}")
       else()
-        find_host_package(PythonLibs "${_version_major_minor}.${_version_patch}" EXACT)
+        find_package(PythonLibs "${_version_major_minor}.${_version_patch}" EXACT)
       endif()

       if(PYTHONLIBS_FOUND)
@@ -105,7 +105,7 @@
         set(_include_dir ${PYTHON_INCLUDE_DIR})
         set(_include_dir2 ${PYTHON_INCLUDE_DIR2})

-        # Clear find_host_package side effects
+        # Clear find_package side effects
         unset(PYTHONLIBS_FOUND)
         unset(PYTHON_LIBRARIES)
         unset(PYTHON_INCLUDE_PATH)


fixed error

fixed error

--- cmake/list/list_pop_back.cmake
+++ cmake/list/list_pop_back.cmake
@@ -1,7 +1,7 @@
 # removes the last element from list and returns it
 function(list_pop_back __list_pop_back_lst)

-  if("${${__list_pop_back_lst}}_" STREQUAL "_")
+  if("${${__list_pop_back_lst}}_" STREQUAL "_")
     return()
   endif()
   list(LENGTH "${__list_pop_back_lst}" len)


Fix capitalization in FindUnuran.cmake

Fix capitalization in FindUnuran.cmake

The package name in the call to find_package_handle_standard_args()
function must match what is used in the call to find_package() and
the find module name (e.g. FindUnuran.cmake). If there is a mismatch,
then find_package(Unuran REQUIRED) will not cause the desired failure
during configuration when the package is not found. CMake will define
both Unuran_FOUND and UNURAN_FOUND for compatibility reasons.

--- cmake/modules/FindUnuran.cmake
+++ cmake/modules/FindUnuran.cmake
@@ -18,6 +18,6 @@
 # handle the QUIETLY and REQUIRED arguments and set UNURAN_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(UNURAN DEFAULT_MSG UNURAN_LIBRARY UNURAN_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Unuran DEFAULT_MSG UNURAN_LIBRARY UNURAN_INCLUDE_DIR)

 mark_as_advanced(UNURAN_FOUND UNURAN_INCLUDE_DIR UNURAN_LIBRARY)


Version 0.2 ready

Version 0.2 ready

--- cmake/platform/Propeller.cmake
+++ cmake/platform/Propeller.cmake
@@ -18,8 +18,6 @@
 cmake_minimum_required(VERSION "2.8")
 cmake_policy(VERSION "2.8")

-cmake_policy(SET "CMP0045" OLD)
-
 # C Flags ######################################################################

 set(PROPELLER_C_FLAGS
@@ -112,10 +110,10 @@

 # Executable Paths #############################################################

+find_program(OPENSPIN "openspin")
+
 find_program(CMAKE_OBJCOPY "propeller-elf-objcopy")
 find_program(CMAKE_OBJDUMP "propeller-elf-objdump")
-
-find_program(OPENSPIN "openspin")

 # Size Stuff ###################################################################

@@ -152,6 +150,10 @@

     string(REGEX REPLACE "\\\\" "/" COGC_FILE_OBJ "${COGC_FILE}")
     string(REGEX REPLACE "[^0-9A-Za-z./]" "_" COGC_FILE_OBJ "${COGC_FILE_OBJ}")
+
+    string(SHA1 COGC_FILE_OBJ_PATH "${COGC_FILE_OBJ}")
+    get_filename_component(COGC_FILE_OBJ_NAME "${COGC_FILE_OBJ}" NAME)
+    set(COGC_FILE_OBJ "${COGC_FILE_OBJ_PATH}/${COGC_FILE_OBJ_NAME}")

     set(COGC_FILE_OBJ
     "${CMAKE_BINARY_DIR}/CMakeFiles/cogc.dir/${COGC_FILE_OBJ}.obj")
@@ -197,6 +199,10 @@
     string(REGEX REPLACE "\\\\" "/" SPIN_FILE_OBJ "${SPIN_FILE}")
     string(REGEX REPLACE "[^0-9A-Za-z./]" "_" SPIN_FILE_OBJ "${SPIN_FILE_OBJ}")

+    string(SHA1 SPIN_FILE_OBJ_PATH "${SPIN_FILE_OBJ}")
+    get_filename_component(SPIN_FILE_OBJ_NAME "${SPIN_FILE_OBJ}" NAME)
+    set(SPIN_FILE_OBJ "${SPIN_FILE_OBJ_PATH}/${SPIN_FILE_OBJ_NAME}")
+
     set(SPIN_FILE_OBJ
     "${CMAKE_BINARY_DIR}/CMakeFiles/spin.dir/${SPIN_FILE_OBJ}.obj")

@@ -209,12 +215,12 @@
     set(SPIN_FILE_DAT "${SPIN_FILE_OBJ_PATH}/${SPIN_FILE_OBJ_NAME}.dat")
     get_filename_component(SPIN_FILE_DAT_NAME "${SPIN_FILE_DAT}" NAME)

-    get_filename_component(SPATH "${SPIN_FILE}" DIRECTORY)
+    get_filename_component(SPIN_FILE_PATH "${SPIN_FILE}" DIRECTORY)

     add_custom_command(OUTPUT "${SPIN_FILE_OBJ}"
     COMMAND "${OPENSPIN}" -q
     ARGS -I "${PROPELLER_SDK_PATH}/propeller-gcc/spin"
-    ARGS -I "${SPATH}"
+    ARGS -I "${SPIN_FILE_PATH}"
     ARGS -o "${SPIN_FILE_DAT}"
     ARGS -c "${SPIN_FILE}"
     COMMAND "${CMAKE_COMMAND}"
@@ -526,9 +532,7 @@
         get_filename_component(FF_PATH_NAME "${FF_PATH}" NAME_WE)
         string(REGEX REPLACE "[^0-9A-Za-z]" "_" FF_PATH_NAME "${FF_PATH_NAME}")

-        get_target_property(TARGET_FOUND "${FF_PATH_NAME}" NAME)
-
-        if(NOT "${TARGET_FOUND}")
+        if(NOT TARGET "${FF_PATH_NAME}")

             list(APPEND FF_PATH_SOURCES ${FF_PATH_HEADERS})
             add_library("${FF_PATH_NAME}" STATIC ${FF_PATH_SOURCES})
@@ -569,9 +573,7 @@
         get_filename_component(FF_PATH_NAME "${FF_PATH}" NAME_WE)
         string(REGEX REPLACE "[^0-9A-Za-z]" "_" FF_PATH_NAME "${FF_PATH_NAME}")

-        get_target_property(TARGET_FOUND "${FF_PATH_NAME}" NAME)
-
-        if(NOT "${TARGET_FOUND}")
+        if(NOT TARGET "${FF_PATH_NAME}")

             list(APPEND FF_PATH_SOURCES ${FF_PATH_HEADERS})
             add_executable("${FF_PATH_NAME}" ${FF_PATH_SOURCES})
@@ -793,18 +795,18 @@

             get_filename_component(FILE_NAME "${${TARGET_NAME}_FPATH}" NAME_WE)
             string(REGEX REPLACE "[^0-9A-Za-z]" "_" FILE_NAME "${FILE_NAME}")
-
             set(FILE_NAME_BINARY "${CMAKE_BINARY_DIR}/${FILE_NAME}.binary")

             set_source_files_properties("${FILE_NAME_BINARY}" PROPERTIES
             EXTERNAL_OBJECT TRUE GENERATED TRUE)

-            get_filename_component(SPATH "${${TARGET_NAME}_FPATH}" DIRECTORY)
+            get_filename_component(SPIN_FILE_PATH "${${TARGET_NAME}_FPATH}"
+            DIRECTORY)

             add_custom_command(OUTPUT "${FILE_NAME_BINARY}"
             COMMAND "${OPENSPIN}" -q
             ARGS -I "${PROPELLER_SDK_PATH}/propeller-gcc/spin"
-            ARGS -I "${SPATH}"
+            ARGS -I "${SPIN_FILE_PATH}"
             ARGS -o "${FILE_NAME_BINARY}"
             ARGS -b "${${TARGET_NAME}_FPATH}"
             DEPENDS "${${TARGET_NAME}_FPATH}")
@@ -846,6 +848,8 @@

     if("${PROPELLER_C_FLAGS}" MATCHES "-m32bit-doubles")
         add_definitions("-D__PROPELLER_32BIT_DOUBLES__")
+    else()
+        add_definitions("-D__PROPELLER_64BIT_DOUBLES__")
     endif()

     if((DEFINED ${TARGET_NAME}_LIBS) AND ${TARGET_NAME}_LIBS)
@@ -870,10 +874,10 @@

                     get_filename_component(LIB_SOURCE_EXT "${LIB_SOURCE}" EXT)

-                    # Help the linker see cogc symbols...
-                    if("${LIB_SOURCE_EXT}" STREQUAL ".cogc.obj")
-                        list(APPEND LIB_TARGETS "${LIB_SOURCE}")
-                    endif()
+                    # # Help the linker see cogc symbols...
+                    # if("${LIB_SOURCE_EXT}" STREQUAL ".cogc.obj")
+                    #     list(APPEND LIB_TARGETS "${LIB_SOURCE}")
+                    # endif()

                     # # Help the linker see spin symbols...
                     # if("${LIB_SOURCE_EXT}" STREQUAL ".spin.obj")


STYLE: Fix indentation in ITKSetStandardCompilerFlags.cmake.

Change-Id: I5515fba99a85fb3d102097363e630e1be2f382a3

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -196,34 +196,33 @@
       set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -Wno-array-bounds")
     endif()

-   if(APPLE)
-     option(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
-     mark_as_advanced(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING)
-
-     execute_process(COMMAND "${CMAKE_C_COMPILER}" --version
-       OUTPUT_VARIABLE _version ERROR_VARIABLE _version)
-
-     # -fopenmp breaks compiling the HDF5 library in shared library mode
-     # on the OS X platform -- at least with gcc 4.2 from Xcode.
-     set(compile_flag_lists CMAKE_C_FLAGS CMAKE_CXX_FLAGS
-       CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL
-       CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
-       CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL
-       CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-     foreach(listname ${compile_flag_lists})
-       if("${${listname}}" MATCHES ".*-fopenmp.*")
-         string(REPLACE "-fopenmp" "" tmpFlags "${${listname}}")
-         set(${listname} "${tmpFlags}")
-         message("-fopenmp causes incorrect compliation of HDF, removing from ${listname}")
-       endif()
-     endforeach()
-   endif()
-
-   # gcc must have -msse2 option to enable sse2 support
-   if(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING)
-     set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -msse2")
-   endif()
-
+    if(APPLE)
+      option(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING "Turn on warnings on 64bits to 32bits truncations." OFF)
+      mark_as_advanced(ITK_USE_64BITS_APPLE_TRUNCATION_WARNING)
+
+      execute_process(COMMAND "${CMAKE_C_COMPILER}" --version
+        OUTPUT_VARIABLE _version ERROR_VARIABLE _version)
+
+      # -fopenmp breaks compiling the HDF5 library in shared library mode
+      # on the OS X platform -- at least with gcc 4.2 from Xcode.
+      set(compile_flag_lists CMAKE_C_FLAGS CMAKE_CXX_FLAGS
+          CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL
+          CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO
+          CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL
+          CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+      foreach(listname ${compile_flag_lists})
+        if("${${listname}}" MATCHES ".*-fopenmp.*")
+          string(REPLACE "-fopenmp" "" tmpFlags "${${listname}}")
+          set(${listname} "${tmpFlags}")
+          message("-fopenmp causes incorrect compliation of HDF, removing from ${listname}")
+        endif()
+      endforeach()
+    endif()
+
+    # gcc must have -msse2 option to enable sse2 support
+    if(VNL_CONFIG_ENABLE_SSE2 OR VNL_CONFIG_ENABLE_SSE2_ROUNDING)
+      set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -msse2")
+    endif()
   endif()

   #-----------------------------------------------------------------------------


Android: Disable experimental compilers (NDK 0.8c)

--HG--
branch : v1-9

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -471,6 +471,8 @@
  string( REPLACE "android-" "" ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
  file( GLOB __availableToolchains RELATIVE "${ANDROID_NDK}/toolchains" "${ANDROID_NDK}/toolchains/*" )
  __LIST_FILTER( __availableToolchains "^[.]" )
+ __LIST_FILTER( __availableToolchains ".*clang.*") # ignore experimental compilers
+ __LIST_FILTER( __availableToolchains ".*llvm.*")
  set( __availableToolchainMachines "" )
  set( __availableToolchainArchs "" )
  set( __availableToolchainCompilerVersions "" )


ENH: remove cosmetic feature, add more protection for these who changed their wrapping options in VTK after vtkMy cache has been created

--- Examples/Build/vtkMy/CMakeOptions.cmake
+++ Examples/Build/vtkMy/CMakeOptions.cmake
@@ -73,12 +73,9 @@

 IF (VTK_WRAP_TCL)

-  OPTION(WRAP_TCL
+  OPTION(VTKMY_WRAP_TCL
          "Wrap classes into the TCL interpreted language."
          ON)
-
-  SET(VTKMY_WRAP_TCL  ${WRAP_TCL} CACHE INTERNAL
-      "Wrap classes into the TCL interpreted language.")

   IF (VTKMY_WRAP_TCL)

@@ -106,9 +103,10 @@

 ELSE (VTK_WRAP_TCL)

-  IF (WRAP_TCL)
-    MESSAGE("Warning. WRAP_TCL is ON but the VTK version you have chosen has not support for Tcl (VTK_WRAP_TCL is OFF). Please set WRAP_TCL to OFF.")
-  ENDIF (WRAP_TCL)
+  IF (VTKMY_WRAP_TCL)
+    MESSAGE("Warning. VTKMY_WRAP_TCL is ON but the VTK version you have chosen has not support for Tcl (VTK_WRAP_TCL is OFF). Please set VTKMY_WRAP_TCL to OFF.")
+    SET (VTKMY_WRAP_TCL OFF)
+  ENDIF (VTKMY_WRAP_TCL)

 ENDIF (VTK_WRAP_TCL)

@@ -118,12 +116,9 @@

 IF (VTK_WRAP_PYTHON)

-  OPTION(WRAP_PYTHON
+  OPTION(VTKMY_WRAP_PYTHON
          "Wrap classes into the Python interpreted language."
          ON)
-
-  SET(VTKMY_WRAP_PYTHON  ${WRAP_PYTHON} CACHE INTERNAL
-      "Wrap classes into the Python interpreted language.")

   IF (VTKMY_WRAP_PYTHON)

@@ -158,9 +153,10 @@

 ELSE (VTK_WRAP_PYTHON)

-  IF (WRAP_PYTHON)
-    MESSAGE("Warning. WRAP_PYTHON is ON but the VTK version you have chosen has not support for Python (VTK_WRAP_PYTHON is OFF). Please set WRAP_PYTHON to OFF.")
-  ENDIF (WRAP_PYTHON)
+  IF (VTKMY_WRAP_PYTHON)
+    MESSAGE("Warning. VTKMY_WRAP_PYTHON is ON but the VTK version you have chosen has not support for Python (VTK_WRAP_PYTHON is OFF). Please set VTKMY_WRAP_PYTHON to OFF.")
+    SET (VTKMY_WRAP_PYTHON OFF)
+  ENDIF (VTKMY_WRAP_PYTHON)

 ENDIF (VTK_WRAP_PYTHON)

@@ -170,12 +166,9 @@

 IF (VTK_WRAP_JAVA)

-  OPTION(WRAP_JAVA
+  OPTION(VTKMY_WRAP_JAVA
          "Wrap classes into the Java interpreted language."
          ON)
-
-  SET(VTKMY_WRAP_JAVA  ${WRAP_JAVA} CACHE INTERNAL
-      "Wrap classes into the Java interpreted language.")

   IF (VTKMY_WRAP_JAVA)

@@ -228,9 +221,10 @@

 ELSE (VTK_WRAP_JAVA)

-  IF (WRAP_JAVA)
-    MESSAGE("Warning. WRAP_JAVA is ON but the VTK version you have chosen has not support for Java (VTK_WRAP_JAVA is OFF). Please set WRAP_JAVA to OFF.")
-  ENDIF (WRAP_JAVA)
+  IF (VTKMY_WRAP_JAVA)
+    MESSAGE("Warning. VTKMY_WRAP_JAVA is ON but the VTK version you have chosen has not support for Java (VTK_WRAP_JAVA is OFF). Please set VTKMY_WRAP_JAVA to OFF.")
+    SET (VTKMY_WRAP_JAVA OFF)
+  ENDIF (VTKMY_WRAP_JAVA)

 ENDIF (VTK_WRAP_JAVA)


Fix a issue that prevented importing Allogen modules when the path contained spaces

--- CMake/CompileAllogenInterface.cmake
+++ CMake/CompileAllogenInterface.cmake
@@ -68,7 +68,7 @@
     set(import_args "")
     if(IFT_IMPORT)
         foreach(dir ${IFT_IMPORT})
-            set(import_args ${import_args} --import "${dir}")
+            set(import_args ${import_args} --import '${dir}')
         endforeach()
     endif()

@@ -79,7 +79,7 @@

     set(module_args "")
     if(IFT_MODULE_NAME)
-        set(module_args --module "${IFT_MODULE_NAME}")
+        set(module_args --module '${IFT_MODULE_NAME}')
     endif()

     set(idls)


COMP: Fix External_VTK CMake warning

COMP: Fix External_VTK CMake warning

--- CMake/Superbuild/External_VTK.cmake
+++ CMake/Superbuild/External_VTK.cmake
@@ -56,7 +56,7 @@
   set( TubeTK_VTKHDF5_VALGRIND_ARGS )
   if( TubeTK_USE_VALGRIND )
     list( APPEND TubeTK_VTKHDF5_VALGRIND_ARGS
-      -DHDF5_ENABLE_USING_MEMCHECKER=ON )
+      -DH5_USING_MEMCHECKER:BOOL=ON )
   endif( TubeTK_USE_VALGRIND )

   ExternalProject_Add( ${proj}


Test labels did not work as expected. Using CMake var.

--- CMake/mitkTestProjectTemplate.cmake
+++ CMake/mitkTestProjectTemplate.cmake
@@ -31,12 +31,14 @@
     set(package_test_configurations CONFIGURATIONS Release)
   endif()

-  add_test(NAME mitkProjectTemplatePackageTest ${package_test_configurations}
-           COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config $<CONFIGURATION> --target package)
+  if(NOT MITK_FAST_TESTING)
+    add_test(NAME mitkProjectTemplatePackageTest ${package_test_configurations}
+             COMMAND ${CMAKE_COMMAND} --build ${MITK-ProjectTemplate_BINARY_DIR}/AwesomeProject-build --config $<CONFIGURATION> --target package)

-  set_tests_properties(mitkProjectTemplatePackageTest PROPERTIES
-                       DEPENDS mitkProjectTemplateBuildTest
-                       TIMEOUT 1200
-                       LABELS "MITK;BlueBerry;LongRunning")
+    set_tests_properties(mitkProjectTemplatePackageTest PROPERTIES
+                         DEPENDS mitkProjectTemplateBuildTest
+                         TIMEOUT 1200
+                         LABELS "MITK;BlueBerry")
+  endif()

 endif()


Make deprecation warnings on by default

Make deprecation warnings on by default

--- Compiler.cmake
+++ Compiler.cmake
@@ -27,7 +27,7 @@
   set(COMMON_MINIMUM_GCC_VERSION 4.4)
 endif()

-option(ENABLE_WARN_DEPRECATED "Enable deprecation warnings" OFF)
+option(ENABLE_WARN_DEPRECATED "Enable deprecation warnings" ON)
 if(ENABLE_WARN_DEPRECATED)
   add_definitions(-DWARN_DEPRECATED) # projects have to pick this one up
 endif()


TestBuild.cmake

TestBuild.cmake

  Do nightly tests instead of experimental ones.

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@3784 3d70eeeb-363e-0410-a505-8a46323a89f2

--- TestBuild.cmake
+++ TestBuild.cmake
@@ -11,8 +11,8 @@

 # A smoke test only builds the code and doesn't run any tests, so we
 # exclude all tests here
-#SET (CTEST_COMMAND "ctest -D Nightly")
-SET (CTEST_COMMAND "ctest -D Experimental")
+SET (CTEST_COMMAND "ctest -D Nightly")
+#SET (CTEST_COMMAND "ctest -D Experimental")

 SET(CTEST_INITIAL_CACHE "
   BUILD_EXPERIMENTAL:BOOL=OFF


ENH: CI: PKG: Added package testing.

ENH: CI: PKG: Added package testing.

--- CI/main_packages.cmake
+++ CI/main_packages.cmake
@@ -99,15 +99,14 @@
 endif()

-# ctest_test(
-#   PARALLEL_LEVEL 4
-#   RETURN_VALUE _test_rv
-#   CAPTURE_CMAKE_ERROR _test_error
-#   )
+ctest_test(
+  PARALLEL_LEVEL 1
+  RETURN_VALUE _test_rv
+  CAPTURE_CMAKE_ERROR _test_error
+  )

-# if( NOT _test_rv EQUAL 0 )
-#   message( SEND_ERROR "An error occurs during ctest_test.")
-# endif()
-
+if( NOT _test_rv EQUAL 0 )
+  message( SEND_ERROR "An error occurs during ctest_test.")
+endif()

 ctest_submit()


ENH: Need more lib to resolve all symbols

--- CMake/FindFFMPEG.cmake
+++ CMake/FindFFMPEG.cmake
@@ -20,16 +20,70 @@
   /usr/local/lib
   /usr/lib
 )
+
 FIND_LIBRARY(FFMPEG_avcodec_LIBRARY avcodec
   /usr/local/lib
   /usr/lib
 )

+FIND_LIBRARY(FFMPEG_vorbis_LIBRARY vorbis
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_dc1394_LIBRARY dc1394_control
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_vorbisenc_LIBRARY vorbisenc
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_theora_LIBRARY theora
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_avutil_LIBRARY avutil
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_dts_LIBRARY dts
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_gsm_LIBRARY gsm
+  /usr/local/lib
+  /usr/lib
+)
+
+FIND_LIBRARY(FFMPEG_z_LIBRARY z
+  /usr/local/lib
+  /usr/lib
+)
+
+
 IF(FFMPEG_INCLUDE_DIR)
-  IF(FFMPEG_LIBRARY)
-    SET( FFMPEG_FOUND "YES" )
-    SET( FFMPEG_LIBRARIES ${FFMPEG_avcodec_LIBRARY} ${FFMPEG_avformat_LIBRARY} )
-  ENDIF(FFMPEG_LIBRARY)
+  IF(FFMPEG_avcodec_LIBRARY)
+    IF(FFMPEG_avformat_LIBRARY)
+      SET( FFMPEG_FOUND "YES" )
+      SET( FFMPEG_LIBRARIES
+        ${FFMPEG_avcodec_LIBRARY}
+        ${FFMPEG_avformat_LIBRARY}
+        ${FFMPEG_vorbis_LIBRARY}
+        ${FFMPEG_dc1394_LIBRARY}
+        ${FFMPEG_vorbisenc_LIBRARY}
+        ${FFMPEG_theora_LIBRARY}
+        ${FFMPEG_avutil_LIBRARY}
+        ${FFMPEG_dts_LIBRARY}
+        ${FFMPEG_gsm_LIBRARY}
+        ${FFMPEG_z_LIBRARY})
+    ENDIF(FFMPEG_avformat_LIBRARY)
+  ENDIF(FFMPEG_avcodec_LIBRARY)
 ENDIF(FFMPEG_INCLUDE_DIR)


SuperBuild: geotiff update config values

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -19,16 +19,15 @@
   # set proj back to its original value
   set(proj GEOTIFF)

-  if(MSVC)
-    ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
-    ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(PROJ4_INCLUDE_DIR)
-    ADD_SUPERBUILD_CMAKE_VAR(PROJ4_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
-    ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
-    ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
-  endif()
+  set(GEOTIFF_SB_CONFIG)
+  ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(PROJ4_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(PROJ4_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(ZLIB_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)

   ExternalProject_Add(${proj}
     PREFIX ${proj}
@@ -44,6 +43,7 @@
     -DCMAKE_BUILD_TYPE:STRING=Release
     -DBUILD_SHARED_LIBS:BOOL=ON
     -DBUILD_TESTING:BOOL=OFF
+    ${GEOTIFF_SB_CONFIG}
     CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )


Opus: update to 1.1.2

Opus: update to 1.1.2

--- packages/opus.cmake
+++ packages/opus.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(opus
     DEPENDS gcc
-    URL "http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz"
-    URL_HASH SHA256=b9727015a58affcf3db527322bf8c4d2fcf39f5f6b8f15dbceca20206cbe1d95
+    URL "http://downloads.xiph.org/releases/opus/opus-1.1.2.tar.gz"
+    URL_HASH SHA256=0e290078e31211baa7b5886bcc8ab6bc048b9fc83882532da4a1a45e58e907fd
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${EXEC} <SOURCE_DIR>/configure
         --host=${TARGET_ARCH}


:bug: when searching for atas' cblas.h

:bug: when searching for atas' cblas.h

--- modules/FindCBLAS.cmake
+++ modules/FindCBLAS.cmake
@@ -63,27 +63,27 @@
     endif()
 endmacro()

-macro(_look_for_include_directories)
+function(_look_for_include_directories)
     # Adds BLAS_INCLUDE_DIR
-    function(include_directories_from_library_paths OUTVAR)
-        set(results)
-        foreach(path ${ARGN})
-            string(REGEX REPLACE
-                "(.*)/lib(64)?/.*" "\\1/include" current "${path}")
-            if(NOT "${current}" STREQUAL "/include"
-                AND IS_DIRECTORY "${current}")
-                list(APPEND results "${current}")
-            endif()
-        endforeach()
-        if(NOT "${results}" STREQUAL "")
-            list(REMOVE_DUPLICATES results)
-            set(${OUTVAR} ${results} PARENT_SCOPE)
+    set(directories)
+    foreach(path ${ARGN})
+        string(REGEX REPLACE
+            "(.*)/lib(64)?/.*" "\\1/include" current "${path}")
+        if(NOT "${current}" STREQUAL "/include"
+            AND IS_DIRECTORY "${current}")
+            list(APPEND directories "${current}")
         endif()
-    endfunction()
-    # find_package blas does not look for cblas.h
-    include_directories_from_library_paths(directories ${BLAS_LIBRARIES})
-    find_path(BLAS_INCLUDE_DIR NAMES cblas.h mkl.h HINTS ${directories})
-endmacro()
+    endforeach()
+    if(NOT "${directories}" STREQUAL "")
+        list(REMOVE_DUPLICATES directories)
+        set(${OUTVAR} ${directories} PARENT_SCOPE)
+        # find_package blas does not look for cblas.h
+        find_path(BLAS_INCLUDE_DIR NAMES cblas.h mkl.h HINTS ${directories})
+    else()
+        find_path(BLAS_INCLUDE_DIR NAMES cblas.h mkl.h HINTS ${directories})
+    endif()
+    set(BLAS_INCLUDE_DIR ${BLAS_INCLUDE_DIR} PARENT_SCOPE)
+endfunction()

 macro(_slot_pthread_into_mkl)
@@ -128,7 +128,7 @@
 if(BLAS_LIBRARIES)
     _slot_pthread_into_mkl()
     if(NOT BLAS_INCLUDE_DIR)
-        _look_for_include_directories()
+        _look_for_include_directories(${BLAS_LIBRARIES})
     endif()
 endif()


Change FindNumPy.cmake to work in the presence of nonnumerical markers like '1.7.0b2'

Suggested by Daniel M?llner

--- FindNumPy.cmake
+++ FindNumPy.cmake
@@ -45,44 +45,46 @@
     find_package(PythonInterp)
 endif()

-if(PYTHONINTERP_FOUND)
-    execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
-        "import numpy as n; print(n.__version__); print(n.get_include());"
-        RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS
-        OUTPUT_VARIABLE _NUMPY_VALUES
-        ERROR_VARIABLE _NUMPY_ERROR_VALUE
-        OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-    if(_NUMPY_SEARCH_SUCCESS MATCHES 0)
-        set(NUMPY_FOUND TRUE)
-
-        # Convert the process output into a list
-        string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES})
-        string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES})
-        list(GET _NUMPY_VALUES 0 NUMPY_VERSION)
-        list(GET _NUMPY_VALUES 1 NUMPY_INCLUDE_DIRS)
-
-        # Make sure all directory separators are '/'
-        string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS})
-
-        # Get the major and minor version numbers
-        string(REGEX REPLACE "\\.|rc|dev" ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION})
-        list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR)
-        list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR)
-        list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH)
-        math(EXPR NUMPY_VERSION_DECIMAL
-            "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}")
-
-        find_package_message(NUMPY
-            "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}"
-            "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}")
-    else()
-        if(NumPy_FIND_REQUIRED)
-            message(FATAL_ERROR
-                "NumPy import failure:\n${_NUMPY_ERROR_VALUE}")
-        endif()
-        set(NUMPY_FOUND FALSE)
-    endif()
-else()
+if(NOT PYTHONINTERP_FOUND)
     set(NUMPY_FOUND FALSE)
 endif()
+
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
+    "import numpy as n; print(n.__version__); print(n.get_include());"
+    RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS
+    OUTPUT_VARIABLE _NUMPY_VALUES
+    ERROR_VARIABLE _NUMPY_ERROR_VALUE
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0)
+    if(NumPy_FIND_REQUIRED)
+        message(FATAL_ERROR
+            "NumPy import failure:\n${_NUMPY_ERROR_VALUE}")
+    endif()
+    set(NUMPY_FOUND FALSE)
+endif()
+
+# Convert the process output into a list
+string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES})
+string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES})
+list(GET _NUMPY_VALUES 0 NUMPY_VERSION)
+list(GET _NUMPY_VALUES 1 NUMPY_INCLUDE_DIRS)
+
+# Make sure all directory separators are '/'
+string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS})
+
+# Get the major and minor version numbers
+string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION})
+list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR)
+list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR)
+list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH)
+string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH})
+math(EXPR NUMPY_VERSION_DECIMAL
+    "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}")
+
+find_package_message(NUMPY
+    "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}"
+    "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}")
+
+set(NUMPY_FOUND TRUE)
+


added note for PCH

added note for PCH

--- pch.cmake
+++ pch.cmake
@@ -10,6 +10,16 @@
 #
 # GCC: The precompiled header is always automatically included from
 # every header file.
+#
+# Notes:
+#   ##   All dependencies of target must be defined at the point where
+#        PCH is being added - this is required to correctly collect compile
+#        options exported from dependencies.
+#   ##   Unwrapping of generator expression is supported as long as there
+#        are no multiple compile flags in single generator expression, i.e.
+#        $<$<COFIG:DEBUG>:-flag> is supported, but $<$<COFIG:DEBUG>:-flag1 -flag2>
+#        is not.
+
 #
 # Copyright (C) 2009-2013 Lars Christensen <larsch@belunktum.dk>
 # Copyright (C) 2013-2016 Nenad Mikša <nenad.miksa@microblink.com>


Fixed version info. (2)

Fixed version info. (2)

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -89,8 +89,8 @@
     endif()
 else()
     set(CC_NAME "msvc")
-    exec_program(cl ARGS --version OUTPUT_VARIABLE CC_VERSION_VERBOSE)
-    string(FIND CC_VERSION_VERBOSE "19.10" CC_VERSION_2017)
+    exec_program(cl OUTPUT_VARIABLE CC_VERSION_VERBOSE)
+    string(FIND "${CC_VERSION_VERBOSE}" "19.10" CC_VERSION_2017)
     if(CC_VERSION_2017 GREATER_EQUAL 0)
         set(CC_VERSION "2017")
     endif()
@@ -110,8 +110,8 @@
     if(CC_ARCH_X86_64 GREATER_EQUAL 0)
         set(CC_VERSION "x86_64")
     endif()
-    string(FIND "${CC_VERSION_VERBOSE}" "amd64" CC_ARCH_X86_64)
-    if(CC_ARCH_X86_64 GREATER_EQUAL 0)
+    string(FIND "${CC_VERSION_VERBOSE}" "amd64" CC_ARCH_AMD64)
+    if(CC_ARCH_AMD64 GREATER_EQUAL 0)
         set(CC_VERSION "x86_64")
     endif()
     string(FIND "${CC_VERSION_VERBOSE}" "ARM" CC_ARCH_ARM)


update the packaging of linux

update the packaging of linux

--- superbuild/Projects/unix/nuclearRGG.bundle.cmake
+++ superbuild/Projects/unix/nuclearRGG.bundle.cmake
@@ -10,6 +10,21 @@
 #  DESTINATION "lib"
 #  USE_SOURCE_PERMISSIONS
 #  COMPONENT superbuild)
+
+if(BUILD_DOCUMENTATION)
+  install(FILES ${install_location}/Docs/RGGUsersGuide.pdf
+          DESTINATION "Documentation"
+          COMPONENT superbuild)
+endif()
+
+install(FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION bin)
+
+install(DIRECTORY
+        ${CMAKE_BINARY_DIR}/nuclearRGG/src/nuclearRGG/TestingData/Reactors/simple_hexflatcore-Modified
+        ${CMAKE_BINARY_DIR}/nuclearRGG/src/nuclearRGG/TestingData/Reactors/sixth_hexflatcore
+        ${CMAKE_BINARY_DIR}/nuclearRGG/src/nuclearRGG/TestingData/Reactors/sixth_hexvertexcore
+        ${CMAKE_BINARY_DIR}/nuclearRGG/src/nuclearRGG/TestingData/Reactors/twelfth_hexflatcore
+        DESTINATION ExampleModels)

 install(PROGRAMS ${install_location}/lib/RGGNuclear DESTINATION "lib")

@@ -42,22 +57,22 @@

 #install qt
-if (qt_ENABLED AND NOT USE_SYSTEM_qt)
-    install(DIRECTORY
+#if (qt_ENABLED AND NOT USE_SYSTEM_qt)
+#    install(DIRECTORY
       # install all qt plugins (including sqllite).
       # FIXME: we can reconfigure Qt to be built with inbuilt sqllite support to
       # avoid the need for plugins.
-      "@install_location@/plugins/"
-      DESTINATION "bin"
-      COMPONENT superbuild
-      PATTERN "*.a" EXCLUDE
-      PATTERN "paraview-${pv_version}" EXCLUDE
-      PATTERN "${program}-${cmb_version}" EXCLUDE
-      PATTERN "fontconfig" EXCLUDE
-      PATTERN "*.jar" EXCLUDE
-      PATTERN "*.debug.*" EXCLUDE
-      PATTERN "libboost*" EXCLUDE)
-  endif()
+#      "@install_location@/plugins/"
+#      DESTINATION "bin"
+#      COMPONENT superbuild
+#      PATTERN "*.a" EXCLUDE
+#      PATTERN "paraview-${pv_version}" EXCLUDE
+#      PATTERN "${program}-${cmb_version}" EXCLUDE
+#      PATTERN "fontconfig" EXCLUDE
+#      PATTERN "*.jar" EXCLUDE
+#      PATTERN "*.debug.*" EXCLUDE
+#      PATTERN "libboost*" EXCLUDE)
+#  endif()

 #add the installer as a test
 if (BUILD_TESTING)


Update

Update

--- modules/cpp-optparse.cmake
+++ modules/cpp-optparse.cmake
@@ -5,7 +5,8 @@
   add_library(cpp-optparse ${SOURCE_FILES})
   if(MSVC)
     # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
-    set_target_properties(cpp-optparse PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4244")
+    # C4996: <header> is removed in C++20
+    set_target_properties(cpp-optparse PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4244 /wd4996")
   else()
     set_target_properties(cpp-optparse PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
   endif()


s/EIGEN_WORK_DIRECTORY/EIGEN_WORK_DIR in testsuite script

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -19,27 +19,32 @@
 #        <arch> = i386, x86_64, ia64, powerpc, etc.
 #        <compiler-version> = gcc-4.3.2, icc-11.0, MSVC-2008, etc.
 #  - EIGEN_EXPLICIT_VECTORIZATION: novec, SSE2, Altivec
-#      default: SSE2 for x86_64 systems, novec otherwise
+#       default: SSE2 for x86_64 systems, novec otherwise
+#       Its value is automatically appended to EIGEN_BUILD_STRING
 #  - EIGEN_CMAKE_DIR: path to cmake executable
 #  - EIGEN_MODE: dashboard model, can be Experimental, Nightly, or Continuous
 #      default: Nightly
-#  - EIGEN_WORK_DIRECTORY: directory used to download the source files and make the builds
+#  - EIGEN_WORK_DIR: directory used to download the source files and make the builds
 #      default: folder which contains this script
 #  - CTEST_SOURCE_DIRECTORY: path to eigen's src (use a new and empty folder, not the one you are working on)
-#      default: <EIGEN_WORK_DIRECTORY>/src
+#      default: <EIGEN_WORK_DIR>/src
 #  - CTEST_BINARY_DIRECTORY: build directory
-#      default: <EIGEN_WORK_DIRECTORY>/nightly-<EIGEN_CXX>
+#      default: <EIGEN_WORK_DIR>/nightly-<EIGEN_CXX>
 #
 # Here is an example running several compilers on a linux system:
 # #!/bin/bash
-# EIGEN_ARCH=`uname -m`
-# EIGEN_SITE=`hostname`
-# EIGEN_OS_VERSION=opensuse-11.1
-# COMMON=/home/gael/Coding/eigen2/test/testsuite.cmake,EIGEN_WORK_DIRECTORY=/home/gael/Coding/eigen2/cdash,EIGEN_SITE=$EIGEN_SITE,EIGEN_MODE=$1,EIGEN_BUILD_STRING=$EIGEN_OS_VERSION-$EIGEN_ARCH
-# ctest -S $COMMON-gcc-3.4.6,EIGEN_CXX=g++-3.4
-# ctest -S $COMMON-gcc-4.0.1,EIGEN_CXX=g++-4.0.1
-# ctest -S $COMMON-gcc-4.3.2,EIGEN_CXX=g++-4.3
-# ctest -S $COMMON-icc-11.0,EIGEN_CXX=icpc
+# ARCH=`uname -m`
+# SITE=`hostname`
+# VERSION=opensuse-11.1
+# WORK_DIR=/home/gael/Coding/eigen2/cdash
+# # get the last version of the script
+# svn cat svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2/test/testsuite.cmake > $WORK_DIR/testsuite.cmake
+# COMMON="ctest -S $WORK_DIR/testsuite.cmake,EIGEN_WORK_DIR=$WORK_DIR,EIGEN_SITE=$SITE,EIGEN_MODE=$1,EIGEN_BUILD_STRING=$OS_VERSION-$ARCH"
+# $COMMON-gcc-3.4.6,EIGEN_CXX=g++-3.4
+# $COMMON-gcc-4.0.1,EIGEN_CXX=g++-4.0.1
+# $COMMON-gcc-4.3.2,EIGEN_CXX=g++-4.3,EIGEN_EXPLICIT_VECTORIZATION=novec
+# $COMMON-gcc-4.3.2,EIGEN_CXX=g++-4.3,EIGEN_EXPLICIT_VECTORIZATION=SSE2
+# $COMMON-icc-11.0,EIGEN_CXX=icpc
 #
 ####################################################################

@@ -90,17 +95,7 @@
   # let's try to find all information we need to make the build string ourself

   # OS
-#   if(CYGWIN)
-#     SET(EIGEN_OS_VERSION cygwin)
-#   elseif(WIN32)
-#     SET(EIGEN_OS_VERSION windows)
-#   elseif(UNIX)
-#     SET(EIGEN_OS_VERSION unix)
-#   elseif(APPLE)
-#     SET(EIGEN_OS_VERSION osx)
-#   else(CYGWIN)
-    build_name(EIGEN_OS_VERSION)
-#   endif(CYGWIN)
+  build_name(EIGEN_OS_VERSION)

   # arch
   set(EIGEN_ARCH ${CMAKE_SYSTEM_PROCESSOR})
@@ -118,16 +113,16 @@
   set(EIGEN_BUILD_STRING ${EIGEN_BUILD_STRING}-${EIGEN_EXPLICIT_VECTORIZATION})
 endif(DEFINED EIGEN_EXPLICIT_VECTORIZATION)

-if(NOT EIGEN_WORK_DIRECTORY)
-  set(EIGEN_WORK_DIRECTORY ${CTEST_SCRIPT_DIRECTORY})
-endif(NOT EIGEN_WORK_DIRECTORY)
+if(NOT EIGEN_WORK_DIR)
+  set(EIGEN_WORK_DIR ${CTEST_SCRIPT_DIRECTORY})
+endif(NOT EIGEN_WORK_DIR)

 if(NOT CTEST_SOURCE_DIRECTORY)
-  SET (CTEST_SOURCE_DIRECTORY "${EIGEN_WORK_DIRECTORY}/src")
+  SET (CTEST_SOURCE_DIRECTORY "${EIGEN_WORK_DIR}/src")
 endif(NOT CTEST_SOURCE_DIRECTORY)

 if(NOT CTEST_BINARY_DIRECTORY)
-  SET (CTEST_BINARY_DIRECTORY "${EIGEN_WORK_DIRECTORY}/nightly_${EIGEN_CXX}")
+  SET (CTEST_BINARY_DIRECTORY "${EIGEN_WORK_DIR}/nightly_${EIGEN_CXX}")
 endif(NOT CTEST_BINARY_DIRECTORY)

 if(NOT EIGEN_MODE)


fixed: default header locations

fixed: default header locations

--- share/hugh/cmake/FindSDL.cmake
+++ share/hugh/cmake/FindSDL.cmake
@@ -39,7 +39,9 @@

 set(_sdl_HEADER_SEARCH_DIRS
     "/usr/include"
-    "/usr/local/include")
+    "/usr/local/include"
+    "/usr/include/SDL2"
+    "/usr/local/include/SDL2")

 set(_sdl_HEADER_NAMES
     "SDL.h")


Test was installing cython to wrong path

--- tests/python_modules/cython_build.cmake
+++ tests/python_modules/cython_build.cmake
@@ -21,8 +21,8 @@
 add_to_python_path("@EXTERNAL_ROOT@/python")
 add_to_python_path("${PYTHON_BINARY_DIR}")

-lookup_python_package(pytest REQUIRED PATH "${EXTERNAL_ROOT}/python")
-lookup_python_package(cython REQUIRED PATH "${EXTERNAL_ROOT}/python")
+lookup_python_package(pytest REQUIRED PATH "@EXTERNAL_ROOT@/python")
+lookup_python_package(cython REQUIRED PATH "@EXTERNAL_ROOT@/python")
 get_filename_component(directory "${PYTHON_EXECUTABLE}" PATH)
 find_program(cython_EXECUTABLE cython HINTS "${directory}")


Suppress unused-command-line-argument when enabling LLD. (#7450)

It seems possible to invoke the C compiler in a way that `-fuse-linker` is considered unused, and this is often the way that flags are probed. This was keeping the LLVM `-fPIC` check from working properly.

The go folks reported a similar issue: https://github.com/golang/go/issues/41527

--- build_tools/cmake/iree_setup_toolchain.cmake
+++ build_tools/cmake/iree_setup_toolchain.cmake
@@ -20,13 +20,25 @@
 if(IREE_USE_LINKER)
   set(IREE_LINKER_FLAG "-fuse-ld=${IREE_USE_LINKER}")

+  # Depending on how the C compiler is invoked, it may trigger an unused
+  # argument warning about -fuse-ld, which can foul up compiler flag detection,
+  # causing false negatives. We lack a finer grained way to suppress such a
+  # thing, and this is deemed least bad.
+  if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    iree_append("-Wno-unused-command-line-argument"
+      CMAKE_REQUIRED_FLAGS
+      CMAKE_EXE_LINKER_FLAGS
+      CMAKE_MODULE_LINKER_FLAGS
+      CMAKE_SHARED_LINKER_FLAGS
+    )
+  endif()
+
   iree_append("${IREE_LINKER_FLAG}"
     CMAKE_REQUIRED_FLAGS
     CMAKE_EXE_LINKER_FLAGS
     CMAKE_MODULE_LINKER_FLAGS
     CMAKE_SHARED_LINKER_FLAGS
   )
-
   include(CheckCXXSourceCompiles)
   include(CheckCSourceCompiles)
   set(MINIMAL_SRC "int main() { return 0; }")


Update advice regarding UPDATE_DISCONNECTED

Fixes: #12

--- DownloadProject.cmake
+++ DownloadProject.cmake
@@ -59,14 +59,17 @@
 #       prevent a check at the remote end for changes every time CMake is run
 #       after the first successful download. See the documentation of the ExternalProject
 #       module for more information. It is likely you will want to use this option if it
-#       is available to you. Note, however, that a bug in the ExternalProject implementation
-#       before CMake 3.6 means that some generators do not properly handle the
-#       UPDATE_DISCONNECTED option in some situations. Details can be found here:
+#       is available to you. Note, however, that the ExternalProject implementation contains
+#       bugs which result in incorrect handling of the UPDATE_DISCONNECTED option when
+#       using the URL download method or when specifying a SOURCE_DIR with no download
+#       method. Fixes for these have been created, the last of which is scheduled for
+#       inclusion in CMake 3.8.0. Details can be found here:
 #
 #           https://gitlab.kitware.com/cmake/cmake/commit/bdca68388bd57f8302d3c1d83d691034b7ffa70c
+#           https://gitlab.kitware.com/cmake/cmake/issues/16428
 #
-#       If you experience build errors when using URL as the download method, consider
-#       avoiding the use of UPDATE_DISCONNECTED.
+#       If you experience build errors related to the update step, consider avoiding
+#       the use of UPDATE_DISCONNECTED.
 #
 # EXAMPLE USAGE:
 #


NVCC 8.0: GCC <= 5.3

NVCC 8.0: GCC <= 5.3

It turns out, GCC <= 5.3 does not yet have the problem with std::tuple
in NVCC 8.0 and works.

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -381,12 +381,12 @@
             ELSE()
                 IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
                     IF(CUDA_VERSION VERSION_EQUAL 8.0)
-                        IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 5.0)
-                            MESSAGE(FATAL_ERROR "NVCC 8.0 does not support GCC 6+ and fails compiling the std::tuple implementation in GCC 5+. Please use GCC 4.9!")
+                        IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 5.4)
+                            MESSAGE(FATAL_ERROR "NVCC 8.0 does not support GCC 5.4+. Please use GCC 4.9 - 5.3!")
                         ENDIF()
                     ELSEIF((CUDA_VERSION VERSION_EQUAL 9.0) OR (CUDA_VERSION VERSION_EQUAL 9.1))
                         IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6.0)
-                            MESSAGE(FATAL_ERROR "NVCC 9.0-9.1 do not support GCC 7+ and fail compiling the std::tuple implementation in GCC 6+. Please use GCC 4.9 or 5!")
+                            MESSAGE(FATAL_ERROR "NVCC 9.0 - 9.1 do not support GCC 7+ and fail compiling the std::tuple implementation in GCC 6+. Please use GCC 4.9 - 5.5!")
                         ENDIF()
                     ELSEIF(CUDA_VERSION VERSION_EQUAL 9.2)
                         IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 8.0)


Be pedantic about #defining _FILE_OFFSET_BITS

svn path=/trunk/kdesupport/strigi/; revision=702274

--- config.h.cmake
+++ config.h.cmake
@@ -54,7 +54,14 @@
 //////////////////////////////
 //support large files
 //////////////////////////////
-#define _FILE_OFFSET_BITS 64
+#if defined(_FILE_OFFSET_BITS)
+# if (_FILE_OFFSET_BITS<64)
+#  undef _FILE_OFFSET_BITS
+#  define _FILE_OFFSET_BITS 64
+# endif
+#else
+# define _FILE_OFFSET_BITS 64
+#endif

 //////////////////////////////
 //missing functions


Support for CMake < 3.5

Support for CMake < 3.5

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -13,6 +13,8 @@
 * Sets standard_BUILD* variables for consumption later down the line.
 * Enforces the project has a VERSION set.
 ]]
+
+include (CMakeParseArguments) #Backwards compatibilty

 #This must be a macro since project defines scope-local variables
 #that we generally rely on being in the root context.


use proper include directory

use proper include directory

--- src/tritonsort/cmake_tools/Findjsoncpp.cmake
+++ src/tritonsort/cmake_tools/Findjsoncpp.cmake
@@ -1,4 +1,4 @@
-FIND_PATH(JSONCPP_INCLUDE_DIR "json/reader.h")
+FIND_PATH(JSONCPP_INCLUDE_DIR "jsoncpp/json/json.h")

 FIND_LIBRARY(JSONCPP_LIBRARY jsoncpp)

@@ -8,4 +8,4 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(jsoncpp "jsoncpp required: https://github.com/open-source-parsers/jsoncpp"
   JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY)

-INCLUDE_DIRECTORIES(${JSONCPP_INCLUDE_DIR})+INCLUDE_DIRECTORIES(${JSONCPP_INCLUDE_DIR}/jsoncpp)


Fix typos

Fix typos

--- cmake-modules/FindMHD.cmake
+++ cmake-modules/FindMHD.cmake
@@ -1,5 +1,5 @@
 #.rst:
-# FindJansson
+# FindMHD
 # -----------
 #
 # Find libmicrohttpd
@@ -58,7 +58,7 @@
 endif ()

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(mhd
+find_package_handle_standard_args(MHD
         REQUIRED_VARS MHD_LIBRARY MHD_INCLUDE_DIR
         VERSION_VAR MHD_VERSION_STRING)


Add boost::chrono to required libraries

Add boost::chrono to required libraries

--- cmake/BALLConfigBoost.cmake
+++ cmake/BALLConfigBoost.cmake
@@ -1,4 +1,4 @@
-SET(BALL_BOOST_COMPONENTS system thread iostreams regex date_time serialization)
+SET(BALL_BOOST_COMPONENTS system thread iostreams regex date_time serialization chrono)
 if ( WIN32 )
   LIST(APPEND BALL_BOOST_COMPONENTS zlib bzip2)
 	ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)


Update find gdal logic

Update find gdal logic

--- cmake/DevBaseExternal.cmake
+++ cmake/DevBaseExternal.cmake
@@ -137,6 +137,11 @@

 if(DEVBASE_GDAL_REQUIRED)
     find_package(GDAL REQUIRED)
+
+    if(NOT GDAL_FOUND)
+        message(FATAL_ERROR "GDAL not found")
+    endif()
+
     include_directories(
         SYSTEM
         ${GDAL_INCLUDE_DIRS}
@@ -153,6 +158,8 @@
     else()
         SET(GDAL_DATA ${GDAL_DIRECTORY}/share/gdal)
     endif()
+
+    include(CheckGDalLibrary)
 endif()


Updated Clarius Cast to version 9.0.0 (not tested yet)

--- cmake/ExternalClarius.cmake
+++ cmake/ExternalClarius.cmake
@@ -3,7 +3,7 @@

 ExternalProject_Add(clarius_headers
     PREFIX ${FAST_EXTERNAL_BUILD_DIR}/clarius
-    URL https://github.com/clariusdev/cast/archive/refs/tags/8.6.0.zip
+    URL https://github.com/clariusdev/cast/archive/refs/tags/v9.0.0.zip
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
@@ -11,11 +11,11 @@
 )

 if(WIN32)
-    set(URL "https://github.com/clariusdev/cast/releases/download/8.6.0/clarius-cast-v860-windows.zip")
+    set(URL "https://github.com/clariusdev/cast/releases/download/v9.0.0/clarius-cast-v900-windows.zip")
 elseif(APPLE)
-    set(URL "https://github.com/clariusdev/cast/releases/download/8.6.0/clarius-cast-v860-macos.zip")
+    set(URL "https://github.com/clariusdev/cast/releases/download/v9.0.0/clarius-cast-v900-macos.zip")
 else()
-    set(URL "https://github.com/clariusdev/cast/releases/download/8.6.0/clarius-cast-v860-linux.zip")
+    set(URL "https://github.com/clariusdev/cast/releases/download/v9.0.0/clarius-cast-v900-linux.zip")
 endif()

 if(WIN32)


doc [ci skip]

doc [ci skip]

--- cmake/Modules/FindCAF.cmake
+++ cmake/Modules/FindCAF.cmake
@@ -1,6 +1,4 @@
-# https://github.com/certik/hermes/blob/master/hermes_common/cmake/FindSCALAPACK.cmake
-# ScaLAPACK and BLACS
-#
+# Determines if/where Coarray Fortran libraries are installed (for GNU GFortran >= 2008)

 find_path(CAF_DIR libcoarrays HINTS ENV CAF_DIR)


added guard to prevent linking VTK with Qt5

--- cmake/OpenCVDetectVTK.cmake
+++ cmake/OpenCVDetectVTK.cmake
@@ -1,4 +1,9 @@
 if(NOT WITH_VTK OR ANDROID OR IOS)
+  return()
+endif()
+
+if (HAVE_QT5)
+  message(STATUS "VTK is disabled because OpenCV is linked with Q5. Some VTK disributives are compiled with Q4 and therefore can't be linked together Qt5.")
   return()
 endif()


Added explicit deb package dependency from libtbb-dev if TBB is enabled.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -99,6 +99,14 @@
   set(CPACK_COMPONENT_dev_DEPENDS libs)
 endif()

+if(HAVE_TBB AND NOT BUILD_TBB)
+  if(CPACK_DEB_DEV_PACKAGE_DEPENDS)
+    set(CPACK_DEB_DEV_PACKAGE_DEPENDS "${CPACK_DEB_DEV_PACKAGE_DEPENDS}, libtbb-dev")
+  else()
+    set(CPACK_DEB_DEV_PACKAGE_DEPENDS "libtbb-dev")
+  endif()
+endif()
+
 if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
   set(CPACK_COMPONENT_LIBS_DESCRIPTION "Open Computer Vision Library")
   set(CPACK_DEBIAN_COMPONENT_LIBS_NAME "lib${CMAKE_PROJECT_NAME}")


Fix detection of PEACOCK_PREFIX vars

Fix detection of PEACOCK_PREFIX vars

--- cmake/PeacockPlatform.cmake
+++ cmake/PeacockPlatform.cmake
@@ -84,12 +84,15 @@
         set(peacock_compiler_id "msvc")
     elseif(peacock_compiler_id STREQUAL "Clang")
         set(peacock_compiler_id "clang")
+    elseif(peacock_compiler_id STREQUAL "Intel")
+        set(peacock_compiler_id "intel")
     else()
-        message(FATAL_ERROR "Add compiler id")
-    endif()
-
-
-    if((peacock_compiler_id STREQUAL "gcc") OR (peacock_compiler_id STREQUAL "mingw") OR
+        message(FATAL_ERROR "Add compiler id for ${peacock_compiler_id}")
+    endif()
+
+
+    if((peacock_compiler_id STREQUAL "gcc") OR
+            (peacock_compiler_id STREQUAL "mingw") OR
             (peacock_compiler_id STREQUAL "clang"))
         string(FIND ${peacock_compiler_version} "." period_index)
         string(SUBSTRING ${peacock_compiler_version} 0 ${period_index}
@@ -103,6 +106,11 @@
             set(peacock_compiler_version "14")
             set(peacock_compiler_main_version "14")
         endif()
+    elseif(peacock_compiler_id STREQUAL "intel")
+        # e.g.: 17.0.4.20170411
+        string(FIND ${peacock_compiler_version} "." period_index)
+        string(SUBSTRING ${peacock_compiler_version} 0 ${period_index}
+            peacock_compiler_main_version)
     endif()

@@ -153,8 +161,11 @@
                 set(peacock_gnu_configure_host "x86_64-unknown-linux")
             elseif(peacock_compiler_id STREQUAL "clang")
                 set(peacock_gnu_configure_host "x86_64-unknown-linux")
-            else()
-                message(FATAL_ERROR "Add GNU configure host")
+            elseif(peacock_compiler_id STREQUAL "intel")
+                set(peacock_gnu_configure_host "x86_64-unknown-linux")
+            else()
+                message(FATAL_ERROR
+                    "Add GNU configure host for $peacock_compiler_id")
             endif()
         elseif(target_system_name STREQUAL "darwin")
             if(peacock_compiler_id STREQUAL "gcc")


shield: cmake: using Kconfig.shield instead of looking for overlay files

Fixes: #26522

Now searching for Kconfig.shield instead of recursively looking for
overlay files.

Globbing recursively for overlay files also picks up board overlays,
which leads to errors in the shield handling, as user could wrongly
specify certain boards as shields.
Also it led to wrongly list some board as shields, as reported
in #26522.

The folder containing a Kconfig.shield is then used when looking up
overlay files, as all overlay files in that folder represents a shield.

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

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -306,45 +306,44 @@
 # When found, use that path to infer the ARCH we are building for.
 foreach(root ${BOARD_ROOT})
   set(shield_dir ${root}/boards/shields)
-  # Match the .overlay files in the shield directories to make sure we are
-  # finding shields, e.g. x_nucleo_iks01a1/x_nucleo_iks01a1.overlay
-  file(GLOB_RECURSE shields_refs_list
-    RELATIVE ${shield_dir}
-    ${shield_dir}/*/*.overlay
-    )
+  # Match the Kconfig.shield files in the shield directories to make sure we are
+  # finding shields, e.g. x_nucleo_iks01a1/Kconfig.shield
+  file(GLOB_RECURSE shields_refs_list ${shield_dir}/*/Kconfig.shield)

   # The above gives a list like
-  # x_nucleo_iks01a1/x_nucleo_iks01a1.overlay;x_nucleo_iks01a2/x_nucleo_iks01a2.overlay
-  # we construct a list of shield names by extracting file name and
-  # removing the extension.
+  # x_nucleo_iks01a1/Kconfig.shield;x_nucleo_iks01a2/Kconfig.shield
+  # we construct a list of shield names by extracting the folder and find
+  # and overlay files in there. Each overlay corresponds to a shield.
+  # We obtain the shield name by removing the overlay extension.
   unset(SHIELD_LIST)
-  foreach(shield_path ${shields_refs_list})
-    get_filename_component(shield ${shield_path} NAME_WE)
-    list(APPEND SHIELD_LIST ${shield})
+  foreach(shields_refs ${shields_refs_list})
+    get_filename_component(shield_path ${shields_refs} DIRECTORY)
+    file(GLOB shield_overlays RELATIVE ${shield_path} ${shield_path}/*.overlay)
+    foreach(overlay ${shield_overlays})
+      get_filename_component(shield ${overlay} NAME_WE)
+      list(APPEND SHIELD_LIST ${shield})
+      set(SHIELD_DIR_${shield} ${shield_path})
+    endforeach()
   endforeach()

   if(DEFINED SHIELD)
     foreach(s ${SHIELD_AS_LIST})
-      list(FIND SHIELD_LIST ${s} _idx)
-      if (_idx EQUAL -1)
+      if(NOT ${s} IN_LIST SHIELD_LIST)
         continue()
       endif()

       list(REMOVE_ITEM SHIELD-NOTFOUND ${s})
-
-      list(GET shields_refs_list ${_idx} s_path)
-      get_filename_component(s_dir ${s_path} DIRECTORY)

       # if shield config flag is on, add shield overlay to the shield overlays
       # list and dts_fixup file to the shield fixup file
       list(APPEND
         shield_dts_files
-        ${shield_dir}/${s_path}
+        ${SHIELD_DIR_${s}}/${s}.overlay
         )

       list(APPEND
         shield_dts_fixups
-        ${shield_dir}/${s_dir}/dts_fixup.h
+        ${SHIELD_DIR_${s}}/dts_fixup.h
         )

       # search for shield/shield.conf file
@@ -352,15 +351,15 @@
         # add shield.conf to the shield config list
         list(APPEND
           shield_conf_files
-          ${shield_dir}/${s_dir}/${s}.conf
+          ${SHIELD_DIR_${s}}/${s}.conf
           )
       endif()

-      zephyr_file(CONF_FILES ${shield_dir}/${s_dir}/boards
+      zephyr_file(CONF_FILES ${SHIELD_DIR_${s}}/boards
                   DTS   shield_dts_files
                   KCONF shield_conf_files
       )
-      zephyr_file(CONF_FILES ${shield_dir}/${s_dir}/boards/${s}
+      zephyr_file(CONF_FILES ${SHIELD_DIR_${s}}/boards/${s}
                   DTS   shield_dts_files
                   KCONF shield_conf_files
       )


[cmake] typo

[cmake] typo

--- cmake/default_options.cmake
+++ cmake/default_options.cmake
@@ -31,7 +31,7 @@
 option(WITH_MUMPS "Compilation with the MUMPS solver. Default = OFF" OFF)
 option(WITH_UMFPACK "Compilation with the UMFPACK solver. Default = OFF" OFF)
 option(WITH_SUPERLU "Compilation with the SuperLU solver. Default = OFF" OFF)
-option(WITH_SUPERLU "Compilation with the SuperLU solver, multithreaded version. Default = OFF" OFF)
+option(WITH_SUPERLU_MT "Compilation with the SuperLU solver, multithreaded version. Default = OFF" OFF)
 option(WITH_FCLIB "link with fclib when this mode is enable. Default = OFF" OFF)
 option(WITH_FREECAD "Use FreeCAD. Default = OFF" OFF)
 option(WITH_MECHANISMS "Generation of bindings for Mechanisms toolbox (required OCE). Default = OFF" OFF)


Revert "[CMake] Avoid clang-tablegen-targets dependency when building sphinx docs (experimental)"

This reverts commit 511066858d44101703d61eded9abf8caff0f9fe0.
This turned out unnecessary to fix the bot.

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

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -93,7 +93,7 @@
   # Hack: only some LLDB libraries depend on the clang autogenerated headers,
   # but it is simple enough to make all of LLDB depend on some of those
   # headers without negatively impacting much of anything.
-  if(NOT LLDB_BUILT_STANDALONE AND NOT LLVM_ENABLE_SPHINX)
+  if(NOT LLDB_BUILT_STANDALONE)
     add_dependencies(${name} clang-tablegen-targets)
   endif()


Strip local symbols when using externalized debug info.

When we build LLVM with externalized debug info, all debugging and
symbolication related data is extracted into dSYM files prior to
stripping. As such, there is no need to preserve local symbols in LLVM
binaries after dSYM creation.

This shrinks libLLVM.dylib from 58MB to 55MB on my system.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1191,7 +1191,7 @@
     endif()
     add_custom_command(TARGET ${name} POST_BUILD
       COMMAND xcrun dsymutil $<TARGET_FILE:${name}>
-      COMMAND xcrun strip -Sl $<TARGET_FILE:${name}>)
+      COMMAND xcrun strip -Sxl $<TARGET_FILE:${name}>)
   else()
     message(FATAL_ERROR "LLVM_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
   endif()


[CMake] Support symlinks with the same name as the binary

This supports creating symlinks to tools in different directories than
the tool is built to. This is useful for the LLDB framework build which
I’m sending patches for shortly.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1246,6 +1246,12 @@

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

+  set(target_name ${name})
+  if(TARGET ${name})
+    set(target_name ${name}-link)
+  endif()
+
+
   if(ARG_ALWAYS_GENERATE)
     set_property(DIRECTORY APPEND PROPERTY
       ADDITIONAL_MAKE_CLEAN_FILES ${dest_binary})
@@ -1255,8 +1261,8 @@
     add_custom_command(OUTPUT ${output_path}
                      COMMAND ${CMAKE_COMMAND} -E ${LLVM_LINK_OR_COPY} "${dest_binary}" "${output_path}"
                      DEPENDS ${dest})
-    add_custom_target(${name} ALL DEPENDS ${output_path})
-    set_target_properties(${name} PROPERTIES FOLDER Tools)
+    add_custom_target(${target_name} ALL DEPENDS ${output_path})
+    set_target_properties(${target_name} PROPERTIES FOLDER Tools)

     # Make sure the parent tool is a toolchain tool, otherwise exclude this tool
     list(FIND LLVM_TOOLCHAIN_TOOLS ${dest} LLVM_IS_${dest}_TOOLCHAIN_TOOL)


[cmake] Append -Wl,-rpath-link conditionally to GNULD

Append -Wl,-rpath-link conditionally to whether GNU ld.bfd is used
rather than the Linux+!gold conditionals. Also move it out of 'else'
branch of *BSD handling. This fixes build failures with ld.bfd
on Gentoo/FreeBSD, and should cause no harm on other systems using
ld.bfd.

This patch improves the original logic by reusing results of linker
detection introduced in r307852.

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1589,7 +1589,8 @@
     if(${CMAKE_SYSTEM_NAME} MATCHES "(FreeBSD|DragonFly)")
       set_property(TARGET ${name} APPEND_STRING PROPERTY
                    LINK_FLAGS " -Wl,-z,origin ")
-    elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT LLVM_LINKER_IS_GOLD)
+    endif()
+    if(LLVM_LINKER_IS_GNULD)
       # $ORIGIN is not interpreted at link time by ld.bfd
       set_property(TARGET ${name} APPEND_STRING PROPERTY
                    LINK_FLAGS " -Wl,-rpath-link,${LLVM_LIBRARY_OUTPUT_INTDIR} ")


CMake: Recognise Freetype version 239

CMake: Recognise Freetype version 239

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

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

-set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238)
+set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238 freetype239)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


none

git-svn-id: c9c70d932578d225f5ddfa9374686ab873093b42@765 b8439097-6f30-0410-869d-b57f63bf1bb9

--- 2010/software/trunk/standardPCOpts.cmake
+++ 2010/software/trunk/standardPCOpts.cmake
@@ -1,12 +1,9 @@
-SET(CDEBUG "-g3")
-SET(CWARN "-Wall -Wstrict-prototypes -Wextra -Wuninitialized -Werror=uninitialized")
-SET(CXXWARN "-Wall -Wextra -Wuninitialized -Werror=uninitialized")
-SET(CXXSTANDARD "-std=gnu++0x")
-#SET(CTUNING "-funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums")
-SET(COPT "-O2")

-SET(CFLAGS "${CDEBUG} ${COPT} ${CWARN}")
-SET(CXXFLAGS "${CDEBUG} ${COPT} ${CXXWARN} ${CXXSTANDARD}")
+#SET(CFLAGS "-Wall -Wstrict-prototypes -Wextra -Wuninitialized -Werror=uninitialized -g3 -O2 -pthread")
+#SET(CXXFLAGS "-std=gnu++0x -Wall -Wextra -Wuninitialized -Werror=uninitialized -g3 -O2 -pthread")
+
+SET(CFLAGS "-Wall -Wstrict-prototypes -Wextra -g3 -O0 -pthread")
+SET(CXXFLAGS "-std=gnu++0x -Wall -Wextra -g3 -O0 -pthread")

 SET(CMAKE_C_FLAGS  ${CFLAGS})
 SET(CMAKE_CXX_FLAGS ${CXXFLAGS})


:bug: when using PREFIX in cython module

Source file name would include a new uncreated directory when including PREFIX
option. Correction: "PREFIX/" to "PREFIX.".

--- scripts/PythonModule.cmake
+++ scripts/PythonModule.cmake
@@ -260,6 +260,7 @@
     # Call cython
     string(REGEX REPLACE "\\.pyx" "" cy_module "${source}")
     string(REGEX REPLACE "\\.pxd" "" cy_module "${cy_module}")
+    string(REGEX REPLACE "/" "." cy_module "${cy_module}")
     unset(arguments)
     if(cython_EXECUTABLE)
         set(arguments ${cython_EXECUTABLE})
@@ -287,7 +288,7 @@
         $<$<OR:$<CONFIG:RelWithDebInfo>,$<CONFIG:Debug>>:${cygdb_line}>
         WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
         DEPENDS ${DEPENDENCIES}
-        COMMENT "Generating c/c++ source ${source} with cython"
+        COMMENT "Generating c/c++ source ${source} with cython (${directory})"
     )

     # Extension name


#239 For Mac OS X, must search for SDKs in Applications directory.      Since Xcode 4.3, the "Developer" directory is no longer.    Xcode is now in Applications, so we need to search there for SDKs.

--- CMake/ctkBlockSetCMakeOSXVariables.cmake
+++ CMake/ctkBlockSetCMakeOSXVariables.cmake
@@ -48,22 +48,29 @@
   set(OSX_SDK_104_NAME "Tiger")
   set(OSX_SDK_105_NAME "Leopard")
   set(OSX_SDK_106_NAME "Snow Leopard")
+  set(OSX_SDK_107_NAME "Lion")

+  set(OSX_SDK_ROOTS
+    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
+    /Developer/SDKs
+    )
   set(SDK_VERSIONS_TO_CHECK 10.7 10.6 10.5)
   foreach(SDK_VERSION ${SDK_VERSIONS_TO_CHECK})
     if(NOT CMAKE_OSX_DEPLOYMENT_TARGET OR "${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
-      set(TEST_OSX_SYSROOT "/Developer/SDKs/MacOSX${SDK_VERSION}.sdk")
-      if(EXISTS "${TEST_OSX_SYSROOT}")
-        # Retrieve OSX target name
-        string(REPLACE "." "" sdk_version_no_dot ${SDK_VERSION})
-        set(OSX_NAME ${OSX_SDK_${sdk_version_no_dot}_NAME})
-        set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Force build for 64-bit ${OSX_NAME}." FORCE)
-        set(CMAKE_OSX_DEPLOYMENT_TARGET "${SDK_VERSION}" CACHE STRING "Force build for 64-bit ${OSX_NAME}." FORCE)
-        set(CMAKE_OSX_SYSROOT "${TEST_OSX_SYSROOT}" CACHE PATH "Force build for 64-bit ${OSX_NAME}." FORCE)
-        message(STATUS "Setting OSX_ARCHITECTURES to '${CMAKE_OSX_ARCHITECTURES}' as none was specified.")
-        message(STATUS "Setting OSX_DEPLOYMENT_TARGET to '${SDK_VERSION}' as none was specified.")
-        message(STATUS "Setting OSX_SYSROOT to '${TEST_OSX_SYSROOT}' as none was specified.")
-      endif()
+      foreach(SDK_ROOT ${OSX_SDK_ROOTS})
+        set(TEST_OSX_SYSROOT "${SDK_ROOT}/MacOSX${SDK_VERSION}.sdk")
+        if(EXISTS "${TEST_OSX_SYSROOT}")
+          # Retrieve OSX target name
+          string(REPLACE "." "" sdk_version_no_dot ${SDK_VERSION})
+          set(OSX_NAME ${OSX_SDK_${sdk_version_no_dot}_NAME})
+          set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Force build for 64-bit ${OSX_NAME}." FORCE)
+          set(CMAKE_OSX_DEPLOYMENT_TARGET "${SDK_VERSION}" CACHE STRING "Force build for 64-bit ${OSX_NAME}." FORCE)
+          set(CMAKE_OSX_SYSROOT "${TEST_OSX_SYSROOT}" CACHE PATH "Force build for 64-bit ${OSX_NAME}." FORCE)
+          message(STATUS "Setting OSX_ARCHITECTURES to '${CMAKE_OSX_ARCHITECTURES}' as none was specified.")
+          message(STATUS "Setting OSX_DEPLOYMENT_TARGET to '${SDK_VERSION}' as none was specified.")
+          message(STATUS "Setting OSX_SYSROOT to '${TEST_OSX_SYSROOT}' as none was specified.")
+        endif()
+      endforeach()
     endif()
   endforeach()

@@ -72,4 +79,7 @@
       message(FATAL_ERROR "error: CMAKE_OSX_SYSROOT='${CMAKE_OSX_SYSROOT}' does not exist")
     endif()
   endif()
+  mark_as_advanced( CMAKE_OSX_ARCHITECTURES )
+  mark_as_advanced( CMAKE_OSX_DEPLOYMENT_TARGET )
+  mark_as_advanced( CMAKE_OSX_SYSROOT )
 endif()


grpc changed to only build Release flavor (#11861)

--- tensorflow/contrib/cmake/external/grpc.cmake
+++ tensorflow/contrib/cmake/external/grpc.cmake
@@ -21,9 +21,9 @@

 if(WIN32)
   set(grpc_STATIC_LIBRARIES
-      ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/$(Configuration)/grpc++_unsecure.lib
-      ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/$(Configuration)/grpc_unsecure.lib
-      ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/$(Configuration)/gpr.lib)
+      ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/Release/grpc++_unsecure.lib
+      ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/Release/grpc_unsecure.lib
+      ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/Release/gpr.lib)
 else()
   set(grpc_STATIC_LIBRARIES
       ${CMAKE_CURRENT_BINARY_DIR}/grpc/src/grpc/libgrpc++_unsecure.a


Documented CMake function.

Documented CMake function.

--- CMake/usFunctionGenerateModuleInit.cmake
+++ CMake/usFunctionGenerateModuleInit.cmake
@@ -1,3 +1,26 @@
+#! Generate a source file which handles proper initialization of a module.
+#!
+#! This CMake function will store the path to a generated source file in the
+#! src_var variable, which should be compiled into a module. Example usage:
+#!
+#! \verbatim
+#! set(module_srcs )
+#! usFunctionGenerateModuleInit(module_srcs
+#!                              NAME "My Module"
+#!                              LIBRARY_NAME "mylib"
+#!                              VERSION "1.2.0"
+#!                             )
+#! add_library(mylib ${module_srcs})
+#! \endverbatim
+#!
+#! \param src_var (required) The name of a list variable to which the path of the generated
+#!        source file will be appended.
+#! \param NAME (required) A human-readable name for the module.
+#! \param LIBRARY_NAME (optional) The name of the module, without extension. If empty, the
+#!        NAME argument will be used.
+#! \param DEPENDS (optional) A string containing module dependencies.
+#! \param VERSION (optional) A version string for the module.
+#!
 function(usFunctionGenerateModuleInit src_var)

 MACRO_PARSE_ARGUMENTS(US_MODULE "NAME;LIBRARY_NAME;DEPENDS;VERSION" "EXECUTABLE" ${ARGN})


fixed #460

fixed #460

--- version_config.cmake
+++ version_config.cmake
@@ -124,7 +124,7 @@

 ## ISMRMRD
 set(DEFAULT_ISMRMRD_URL https://github.com/ismrmrd/ismrmrd )
-set(DEFAULT_ISMRMRD_TAG v1.4.0)
+set(DEFAULT_ISMRMRD_TAG v1.4.1)

 ## Gadgetron
 set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )
@@ -165,7 +165,8 @@

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
-  set(DEFAULT_STIR_TAG 3a277f7a819f35a553a8d6097402ea25cf55a240)
+  set(DEFAULT_STIR_TAG 74676768610b7d8be9792e1192ac6dd68bff2424)
+  #set(DEFAULT_STIR_TAG 3a277f7a819f35a553a8d6097402ea25cf55a240)

   ## siemens_to_ismrmrd
   set(DEFAULT_siemens_to_ismrmrd_URL https://github.com/ismrmrd/siemens_to_ismrmrd)


set SIRF_TAG to v2.1.0-rc.2

set SIRF_TAG to v2.1.0-rc.2

--- version_config.cmake
+++ version_config.cmake
@@ -1,3 +1,4 @@
+
 #========================================================================
 # Author: Edoardo Pasca
 # Author: Benjamin A Thomas
@@ -187,7 +188,7 @@
   set(DEFAULT_CCPi-Astra_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG v2.1.0-rc.1)
+  set(DEFAULT_SIRF_TAG v2.1.0-rc.2)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


Added support for COMPONENTS in FindROOT.cmake (ROOT-6717)

--- etc/cmake/FindROOT.cmake
+++ etc/cmake/FindROOT.cmake
@@ -1,50 +1,64 @@
 # - Finds ROOT instalation
-# This module sets up ROOT information
+# This module sets up ROOT information
 # It defines:
 # ROOT_FOUND          If the ROOT is found
 # ROOT_INCLUDE_DIR    PATH to the include directory
+# ROOT_INCLUDE_DIRS   PATH to the include directories (not cached)
 # ROOT_LIBRARIES      Most common libraries
-# ROOT_LIBRARY_DIR    PATH to the library directory
+# ROOT_<name>_LIBRARY Full path to the library <name>
+# ROOT_LIBRARY_DIR    PATH to the library directory
 #
 # Updated by K. Smith (ksmith37@nd.edu) to properly handle
-#  dependncies in ROOT_GENERATE_DICTIONARY
+#  dependencies in ROOT_GENERATE_DICTIONARY

 find_program(ROOT_CONFIG_EXECUTABLE root-config
   PATHS $ENV{ROOTSYS}/bin)

-if(NOT ROOT_CONFIG_EXECUTABLE)
-  set(ROOT_FOUND FALSE)
-else()
-  set(ROOT_FOUND TRUE)
-
-  execute_process(
-    COMMAND ${ROOT_CONFIG_EXECUTABLE} --prefix
-    OUTPUT_VARIABLE ROOTSYS
+execute_process(
+    COMMAND ${ROOT_CONFIG_EXECUTABLE} --prefix
+    OUTPUT_VARIABLE ROOTSYS
     OUTPUT_STRIP_TRAILING_WHITESPACE)

-  execute_process(
-    COMMAND ${ROOT_CONFIG_EXECUTABLE} --version
+execute_process(
+    COMMAND ${ROOT_CONFIG_EXECUTABLE} --version
     OUTPUT_VARIABLE ROOT_VERSION
     OUTPUT_STRIP_TRAILING_WHITESPACE)

-  execute_process(
+execute_process(
     COMMAND ${ROOT_CONFIG_EXECUTABLE} --incdir
     OUTPUT_VARIABLE ROOT_INCLUDE_DIR
     OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(ROOT_INCLUDE_DIRS ${ROOT_INCLUDE_DIR})

-  execute_process(
-    COMMAND ${ROOT_CONFIG_EXECUTABLE} --libs
-    OUTPUT_VARIABLE ROOT_LIBRARIES
+execute_process(
+    COMMAND ${ROOT_CONFIG_EXECUTABLE} --libdir
+    OUTPUT_VARIABLE ROOT_LIBRARY_DIR
     OUTPUT_STRIP_TRAILING_WHITESPACE)
+set(ROOT_LIBRARY_DIRS ${ROOT_LIBRARY_DIR})

-  #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO -lProof)
-  #set(ROOT_LIBRARIES ${ROOT_LIBRARIES} -lProofPlayer -lMLP -lSpectrum -lEve -lRGL -lGed -lXMLParser -lPhysics)
-  set(ROOT_LIBRARY_DIR ${ROOTSYS}/lib)
-endif()
+set(rootlibs Core Cint RIO Net Hist Graf Graf3d Gpad Tree Rint Postscript Matrix Physics MathCore Thread)
+set(ROOT_LIBRARIES)
+foreach(_cpt ${rootlibs} ${ROOT_FIND_COMPONENTS})
+  find_library(ROOT_${_cpt}_LIBRARY ${_cpt} HINTS ${ROOT_LIBRARY_DIR})
+  if(ROOT_${_cpt}_LIBRARY)
+    mark_as_advanced(ROOT_${_cpt}_LIBRARY)
+    list(APPEND ROOT_LIBRARIES ${ROOT_${_cpt}_LIBRARY})
+    list(REMOVE_ITEM ROOT_FIND_COMPONENTS ${_cpt})
+  endif()
+endforeach()
+list(REMOVE_DUPLICATES ROOT_LIBRARIES)
+
+execute_process(
+  COMMAND ${ROOT_CONFIG_EXECUTABLE} --features
+  OUTPUT_VARIABLE _root_options
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
+foreach(_opt ${_root_options})
+  set(ROOT_${_opt}_FOUND TRUE)
+endforeach()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(ROOT DEFAULT_MSG ROOT_CONFIG_EXECUTABLE
-    ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES   ROOT_LIBRARY_DIR)
+    ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES ROOT_LIBRARY_DIR)

 mark_as_advanced(ROOT_CONFIG_EXECUTABLE)

@@ -54,16 +68,16 @@
 find_package(GCCXML)

 #----------------------------------------------------------------------------
-# function ROOT_GENERATE_DICTIONARY( dictionary
-#                                    header1 header2 ...
-#                                    LINKDEF linkdef1 ...
+# function ROOT_GENERATE_DICTIONARY( dictionary
+#                                    header1 header2 ...
+#                                    LINKDEF linkdef1 ...
 #                                    OPTIONS opt1...)
 function(ROOT_GENERATE_DICTIONARY dictionary)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LINKDEF;OPTIONS" "" ${ARGN})
   #---Get the list of include directories------------------
   get_directory_property(incdirs INCLUDE_DIRECTORIES)
-  set(includedirs)
-  foreach( d ${incdirs})
+  set(includedirs)
+  foreach( d ${incdirs})
      set(includedirs ${includedirs} -I${d})
   endforeach()
   #---Get the list of header files-------------------------
@@ -91,17 +105,17 @@
   endforeach()
   #---call rootcint------------------------------------------
   add_custom_command(OUTPUT ${dictionary}.cxx ${dictionary}.h
-                     COMMAND ${ROOTCINT_EXECUTABLE} -cint -f  ${dictionary}.cxx
-                                          -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs}
+                     COMMAND ${ROOTCINT_EXECUTABLE} -cint -f  ${dictionary}.cxx
+                                          -c ${ARG_OPTIONS} ${includedirs} ${headerfiles} ${linkdefs}
                      DEPENDS ${headerfiles} ${linkdefs} VERBATIM)
 endfunction()

 #----------------------------------------------------------------------------
-# function REFLEX_GENERATE_DICTIONARY(dictionary
-#                                     header1 header2 ...
-#                                     SELECTION selectionfile ...
+# function REFLEX_GENERATE_DICTIONARY(dictionary
+#                                     header1 header2 ...
+#                                     SELECTION selectionfile ...
 #                                     OPTIONS opt1...)
-function(REFLEX_GENERATE_DICTIONARY dictionary)
+function(REFLEX_GENERATE_DICTIONARY dictionary)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "SELECTION;OPTIONS" "" ${ARGN})
   #---Get the list of header files-------------------------
   set(headerfiles)
@@ -118,18 +132,18 @@
   #---Get Selection file------------------------------------
   if(IS_ABSOLUTE ${ARG_SELECTION})
     set(selectionfile ${ARG_SELECTION})
-  else()
+  else()
     set(selectionfile ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_SELECTION})
   endif()
   #---Get the list of include directories------------------
   get_directory_property(incdirs INCLUDE_DIRECTORIES)
-  set(includedirs)
-  foreach( d ${incdirs})
+  set(includedirs)
+  foreach( d ${incdirs})
     set(includedirs ${includedirs} -I${d})
   endforeach()
   #---Get preprocessor definitions--------------------------
   get_directory_property(defs COMPILE_DEFINITIONS)
-  foreach( d ${defs})
+  foreach( d ${defs})
    set(definitions ${definitions} -D${d})
   endforeach()
   #---Nanes and others---------------------------------------
@@ -139,7 +153,7 @@
   else()
     #set(gccxmlopts "--gccxmlopt=\'--gccxml-cxxflags -m64 \'")
     set(gccxmlopts)
-  endif()
+  endif()
   #set(rootmapname ${dictionary}Dict.rootmap)
   #set(rootmapopts --rootmap=${rootmapname} --rootmap-lib=${libprefix}${dictionary}Dict)
   #---Check GCCXML and get path-----------------------------
@@ -149,9 +163,9 @@
     message(WARNING "GCCXML not found. Install and setup your environment to find 'gccxml' executable")
   endif()
   #---Actual command----------------------------------------
-  add_custom_command(OUTPUT ${gensrcdict} ${rootmapname}
+  add_custom_command(OUTPUT ${gensrcdict} ${rootmapname}
                      COMMAND ${GENREFLEX_EXECUTABLE} ${headerfiles} -o ${gensrcdict} ${gccxmlopts} ${rootmapopts} --select=${selectionfile}
                              --gccxmlpath=${gccxmlpath} ${ARG_OPTIONS} ${includedirs} ${definitions}
                      DEPENDS ${headerfiles} ${selectionfile})
 endfunction()
-
+


Make Darwin default fallback system name on older versions of CMake.

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -452,9 +452,12 @@
     set(CMAKE_IOS_INSTALL_COMBINED YES CACHE INTERNAL "" ${FORCE_CACHE})
     message(STATUS "Will combine built (static) artifacts into FAT lib...")
   endif()
+elseif(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10")
+  # Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
+  set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
 else()
   # Legacy code path prior to CMake 3.14 or fallback if no SDK_NAME specified
-  set(CMAKE_SYSTEM_NAME iOS CACHE INTERNAL "" ${FORCE_CACHE})
+  set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" ${FORCE_CACHE})
 endif()
 # Standard settings.
 set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "")


Update last iOS version that supports 32 bits to 10.3.4

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -206,11 +206,11 @@

 set(PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets.")

-# Handle the case where we are targeting iOS and a version above 10.3.2 (32-bit support dropped officially)
-if(PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.2)
+# Handle the case where we are targeting iOS and a version above 10.3.4 (32-bit support dropped officially)
+if(PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
   set(PLATFORM_INT "OS64")
   message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
-elseif(PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.2)
+elseif(PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
   set(PLATFORM_INT "SIMULATOR64")
   message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
 endif()


Changed default BN precision.

Changed default BN precision.

--- cmake/bn.cmake
+++ cmake/bn.cmake
@@ -36,7 +36,7 @@

 # Choose the arithmetic precision.
 if (NOT BN_PRECI)
-	set(BN_PRECI 256)
+	set(BN_PRECI 1024)
 endif(NOT BN_PRECI)
 set(BN_PRECI ${BN_PRECI} CACHE INTEGER "Arithmetic precision in bits")


ctest: allow more asm variants on 32-bit

on 32-bit the disasm may start with a mov, therefore move the ^ into the
64-bit asm regex

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- tests/abi.cmake
+++ tests/abi.cmake
@@ -10,9 +10,9 @@
 # Note the regex parts looking for %esp can only match on ia32. (Not sure about x32, though)
 # 'retq' on the other hand, can only match on x64
 if("${IMPL}" STREQUAL SSE)
-   set(reference "^(addps %xmm(0,%xmm1 movaps %xmm1,%xmm0 retq|1,%xmm0 retq)|vaddps %xmm(0,%xmm1|1,%xmm0),%xmm0 retq|.*v?movaps 0x[12]4\\(%esp\\),%xmm[01]( | .+ )v?(add|mova)ps 0x[12]4\\(%esp\\),%xmm[01])")
+   set(reference "(^addps %xmm(0,%xmm1 movaps %xmm1,%xmm0 retq|1,%xmm0 retq)|vaddps %xmm(0,%xmm1|1,%xmm0),%xmm0 retq|.*v?movaps 0x[12]4\\(%esp\\),%xmm[01]( | .+ )v?(add|mova)ps 0x[12]4\\(%esp\\),%xmm[01])")
 elseif("${IMPL}" STREQUAL AVX OR "${IMPL}" STREQUAL AVX2)
-   set(reference "^(vaddps %ymm(0,%ymm1|1,%ymm0),%ymm0 retq|vmovaps 0x[24]4\\(%esp\\),%ymm[01]( | .+ )v(add|mova)ps 0x[24]4\\(%esp\\),%ymm[01],%ymm)")
+   set(reference "(^vaddps %ymm(0,%ymm1|1,%ymm0),%ymm0 retq|vmovaps 0x[24]4\\(%esp\\),%ymm[01]( | .+ )v(add|mova)ps 0x[24]4\\(%esp\\),%ymm[01],%ymm)")
 elseif("${IMPL}" STREQUAL MIC)
    set(reference "^vaddps %zmm(0,%zmm1|1,%zmm0),%zmm0 retq")
 else()


fix: basis_find_package components quietly [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -312,19 +312,32 @@
             message (FATAL_ERROR "Module ${PROJECT_NAME} has module ${_BFP_CMP} of top-level project ${PKG}"
                                  " as dependency, but no such module exists.")
           endif ()
-          if (${PKG}_FIND_REQUIRED_${_BFP_CMP})
-            list (FIND PROJECT_MODULES_ENABLED "${_BFP_CMP}" _BFP_CMPIDX)
-            if (_BFP_CMPIDX EQUAL -1)
-              message (FATAL_ERROR "Module ${PROJECT_NAME} requires module ${_BFP_CMP}"
-                                   " of top-level project ${PKG}, but module ${_BFP_CMP}"
-                                   " is not enabled.")
+          list (FIND PROJECT_MODULES_ENABLED "${_BFP_CMP}" _BFP_CMPIDX)
+          if (_BFP_CMPIDX EQUAL -1)
+            if (BASIS_DEBUG)
+              message ("**     Identified it as disabled module of this project.")
             endif ()
-          endif ()
-          if (BASIS_DEBUG)
-            message ("**     Identified it as other module of this project.")
-          endif ()
-          include ("${BINARY_LIBCONF_DIR}/${TOPLEVEL_PROJECT_PACKAGE_CONFIG_PREFIX}${_BFP_CMP}Config.cmake")
-          set (${PKG}_${_BFP_CMP}_FOUND TRUE)
+            if (${PKG}_FIND_REQUIRED_${_BFP_CMP})
+              if (_BFP_ARGN_REQUIRED)
+                message (FATAL_ERROR
+                  "Module ${PROJECT_NAME} requires module ${_BFP_CMP} of top-level project ${PKG},"
+                  " but module ${_BFP_CMP} is not enabled."
+                )
+              elseif (NOT _BFP_ARGN_QUIET)
+                message (WARNING
+                  "Module ${PROJECT_NAME} uses module ${_BFP_CMP} of top-level project ${PKG},"
+                  " but module ${_BFP_CMP} is not enabled."
+                )
+              endif ()
+            endif ()
+            set (${PKG}_${_BFP_CMP}_FOUND FALSE)
+          else ()
+            if (BASIS_DEBUG)
+              message ("**     Identified it as enabled module of this project.")
+            endif ()
+            include ("${BINARY_LIBCONF_DIR}/${TOPLEVEL_PROJECT_PACKAGE_CONFIG_PREFIX}${_BFP_CMP}Config.cmake")
+            set (${PKG}_${_BFP_CMP}_FOUND TRUE)
+          endif ()
         endforeach ()
       else ()
         if (BASIS_DEBUG)
@@ -339,14 +352,28 @@
       if (NOT _BFP_PKGIDX EQUAL -1)
         set (_BFP_IS_MODULE TRUE)
         list (FIND PROJECT_MODULES_ENABLED "${PKG}" _BFP_PKGIDX)
-        if (NOT _BFP_PKGIDX EQUAL -1)
+        if (_BFP_PKGIDX EQUAL -1)
           if (BASIS_DEBUG)
-            message ("**     Identified it as other module of this project.")
+            message ("**     Identified it as disable module of this project.")
+          endif ()
+          if (_BFP_ARGN_REQUIRED)
+            message (FATAL_ERROR
+              "Module ${PROJECT_NAME} requires module ${_BFP_CMP} of top-level project ${PKG},"
+              " but module ${_BFP_CMP} is not enabled."
+            )
+          elseif (NOT _BFP_ARGN_QUIET)
+            message (WARNING
+              "Module ${PROJECT_NAME} optionally uses module ${_BFP_CMP} of top-level project ${PKG},"
+              " but module ${_BFP_CMP} is not enabled."
+            )
+          endif ()
+          set (${PKG}_FOUND FALSE)
+        else ()
+          if (BASIS_DEBUG)
+            message ("**     Identified it as enabled module of this project.")
           endif ()
           include ("${BINARY_LIBCONF_DIR}/${TOPLEVEL_PROJECT_PACKAGE_CONFIG_PREFIX}${PKG}Config.cmake")
           set (${PKG}_FOUND TRUE)
-        else ()
-          set (${PKG}_FOUND FALSE)
         endif ()
       endif ()
     endif ()


reset OGRE_FRAMEWORK_INCLUDES if NOTFOUND. It avoids having a NOTFOUND in OGRE_INCLUDE_DIR that breaks some build systems

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -240,6 +240,9 @@
   set(OGRE_LIBRARY "NOTFOUND")
 endif ()

+if(${OGRE_FRAMEWORK_INCLUDES} STREQUAL NOTFOUND)
+  unset(OGRE_FRAMEWORK_INCLUDES CACHE)
+endif()
 set(OGRE_INCLUDE_DIR ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INCLUDE_DIR} ${OGRE_FRAMEWORK_INCLUDES})
 list(REMOVE_DUPLICATES OGRE_INCLUDE_DIR)
 findpkg_finish(OGRE)


Improve coverage logic.

Improve coverage logic.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -311,15 +311,18 @@
             file(WRITE ${CTEST_BINARY_DIRECTORY}/${OCC_TEST}Coverage.xml ${OCC_TESTXML})
             string(FIND ${OCC_TESTS} "#" OCC_ABORT)
         endwhile()
-        exec_program(python ${CTEST_SOURCE_DIRECTORY} ARGS ci-tools/merge_cobertura.py -p "${CTEST_BINARY_DIRECTORY}" -o "${CTEST_BINARY_DIRECTORY}\\coverage.xml")
+        exec_program(python2 ${CTEST_SOURCE_DIRECTORY} ARGS ci-tools/merge_cobertura.py -p "${CTEST_BINARY_DIRECTORY}" -o "${CTEST_BINARY_DIRECTORY}\\coverage.xml")
         set(ENV{COBERTURADIR} "${CTEST_BINARY_DIRECTORY}")
     endif()
     ctest_coverage()
+    find_program(CURL_COMMAND NAMES curl)
     if(UNIX)
-        exec_program(curl $ENV{HOME} ARGS -s https://codecov.io/bash OUTPUT_VARIABLE CODECOV)
-        file(WRITE $ENV{HOME}/codecov.io "${CODECOV}")
-        exec_program(chmod $ENV{HOME} ARGS +x codecov.io)
-        exec_program($ENV{HOME}/codecov.io ${CTEST_SOURCE_DIRECTORY} ARGS -X gcov -s ${CTEST_BINARY_DIRECTORY})
+        exec_program(${CURL_COMMAND} $ENV{HOME} ARGS -o $ENV{HOME}/codecov -s https://uploader.codecov.io/latest/linux/codecov)
+        exec_program(chmod $ENV{HOME} ARGS +x codecov)
+        exec_program($ENV{HOME}/codecov ${CTEST_SOURCE_DIRECTORY} ARGS -X gcov -s ${CTEST_BINARY_DIRECTORY})
+    else()
+        exec_program(${CURL_COMMAND} $ENV{HOME} ARGS-o $ENV{HOME}/codecov.exe https://uploader.codecov.io/latest/windows/codecov.exe)
+        exec_program($ENV{HOME}/codecov.exe ${CTEST_SOURCE_DIRECTORY} ARGS -s ${CTEST_BINARY_DIRECTORY})
     endif()
     if(DEFINED ${CTEST_SUBMIT_URL})
         ctest_submit(PARTS Start Update Configure Build Test Coverage Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)


detect mingw

detect mingw

--- cmake/lib.cmake
+++ cmake/lib.cmake
@@ -21,9 +21,11 @@

-if (WIN32 OR ${CMAKE_GENERATOR} STREQUAL "Xcode")
-    set_property (TARGET ethkey APPEND PROPERTY STATIC_LIBRARY_FLAGS ${CMAKE_CURRENT_BINARY_DIR}/libsecp256k1.a ${CMAKE_CURRENT_BINARY_DIR}/libscrypt.a ${CMAKE_CURRENT_BINARY_DIR}/libethkey-core.a)
-elseif (UNIX)
+if (WIN32 AND NOT MINGW)
+    set_property (TARGET ethkey APPEND PROPERTY STATIC_LIBRARY_FLAGS "\"${CMAKE_CURRENT_BINARY_DIR}\\secp256k1.lib\" \"${CMAKE_CURRENT_BINARY_DIR}\\scrypt.lib\" \"${CMAKE_CURRENT_BINARY_DIR}\\ethkey-core.lib\"")
+elseif (${CMAKE_GENERATOR} STREQUAL "Xcode")
+    set_property (TARGET ethkey APPEND PROPERTY STATIC_LIBRARY_FLAGS "${CMAKE_CURRENT_BINARY_DIR}/secp256k1.a ${CMAKE_CURRENT_BINARY_DIR}/libscrypt.a ${CMAKE_CURRENT_BINARY_DIR}/ethkey-core.a")
+else()
     set(LIB_OBJ_DIR ${CMAKE_CURRENT_BINARY_DIR}/lib.obj)
     make_directory (${LIB_OBJ_DIR})


add vcredist option for nsis package

add vcredist option for nsis package

--- packages/pack-glow.cmake
+++ packages/pack-glow.cmake
@@ -65,6 +65,8 @@
     set(CPACK_PACKAGE_ICON                  "")
     set(CPACK_PACKAGE_RELOCATABLE           OFF)

+    #set(CPACK_NSIS_DISPLAY_NAME             "${package_name}-${META_VERSION}")
+

     # Debian package information

@@ -101,12 +103,34 @@
 #   set(CPACK_RPM_<POST/PRE>_<UN>INSTALL_SCRIPT_FILE     "")
 #   set(CPACK_RPM_PACKAGE_DEBUG                          1)
     set(CPACK_RPM_PACKAGE_RELOCATABLE                    OFF)
+

-
     # Package name

     set(CPACK_PACKAGE_FILE_NAME "${package_name}-${CPACK_PACKAGE_VERSION}")

+    # NOTE: for using MUI (UN)WELCOME images and isntaller icon we suggest to replace nsis defautls,
+    # since there is currently no way to do so without manipulating the installer template (which we won't).
+
+    #string(REGEX REPLACE "/" "\\\\\\\\" CPACK_PACKAGE_ICON ${CPACK_PACKAGE_ICON})
+
+
+    # Optional Preliminaries (i.e., silent Visual Studio Redistributable install)
+
+    if(NOT INSTALL_MSVC_REDIST_FILEPATH)
+        set(INSTALL_MSVC_REDIST_FILEPATH "" CACHE FILEPATH "Visual C++ Redistributable Installer (note: manual match the selected generator)" FORCE)
+    endif()
+
+    if(EXISTS ${INSTALL_MSVC_REDIST_FILEPATH})
+        get_filename_component(MSVC_REDIST_NAME ${INSTALL_MSVC_REDIST_FILEPATH} NAME)
+        string(REGEX REPLACE "/" "\\\\\\\\" INSTALL_MSVC_REDIST_FILEPATH ${INSTALL_MSVC_REDIST_FILEPATH})
+        list(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS "
+            SetOutPath \\\"$TEMP\\\"
+            File \\\"${INSTALL_MSVC_REDIST_FILEPATH}\\\"
+            ExecWait '\\\"$TEMP\\\\${MSVC_REDIST_NAME} /quiet\\\"'
+            Delete \\\"$TEMP\\\\${MSVC_REDIST_NAME}\\\"
+            ")
+    endif()

     # Install files


initial setup for optical tracker driver, commented out build temporarily


COMP: Update RigidAlignment to fix "dirent.h" not found windows build error

List of changes:

$ git shortlog 07e6049bc..a37cbff59 --no-merges
Jean-Christophe Fillion-Robin (2):
      COMP: Support customization of RigidAlignment CLI category
      COMP: Fix "dirent.h" not found windows build error

--- SuperBuild/External_RigidAlignment.cmake
+++ SuperBuild/External_RigidAlignment.cmake
@@ -34,7 +34,7 @@

   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-    "07e6049bc3ddcc75e35130602c6f34b494566e33" # master 2021-05-26
+    "a37cbff5996071f971b41d1ce4e2cb7bbe1d6938" # master 2022-04-29
     QUIET
     )


fixed eigsolver test linking

fixed eigsolver test linking

Former-commit-id: 39ea8057bd0d367751fdc4c7839bb856b43fd5da

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -28,7 +28,7 @@
     set(HDF5_WANT_VERSION 1.10)
 endif()

-if(NOT HDF5_ROOT AND $ENV{HDF5_ROOT})
+if(NOT HDF5_ROOT)
     set(HDF5_ROOT $ENV{HDF5_ROOT})
 endif()


CMake: disable clang's -Wnonportable-system-include-path on windows

--- cmake/compiler-warnings-clang.cmake
+++ cmake/compiler-warnings-clang.cmake
@@ -49,6 +49,8 @@
 if(NOT (UNIX OR APPLE))
   # bogus warnings about std functions...
   list(APPEND CLANG_DISABLED_WARNING_FLAGS "used-but-marked-unused")
+  # just don't care.
+  list(APPEND CLANG_DISABLED_WARNING_FLAGS "nonportable-system-include-path")
 endif()

 foreach(warning ${CLANG_WARNING_FLAGS})


Retain old version for PocoCpp on updates.

--- cmake/projects/PocoCpp/hunter.cmake
+++ cmake/projects/PocoCpp/hunter.cmake
@@ -3,6 +3,17 @@
 include(hunter_pick_scheme)
 include(hunter_cacheable)
 include(hunter_download)
+
+hunter_add_version(
+    PACKAGE_NAME
+    PocoCpp
+    VERSION
+    1.7.3
+    URL
+    "https://github.com/pocoproject/poco/archive/poco-1.7.3-release.zip"
+    SHA1
+    22dcb34d85d2cbf2ce71fd84b28489c99ed112d0
+)

 hunter_add_version(
     PACKAGE_NAME


Fixed cmake error

Fixed cmake error

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -183,6 +183,4 @@
 		SOURCES ${ALLOSYSTEM_APP_SRC}
 		COMMENT "Running: ${APP_NAME}")
   endif()
-endif()
-
 endif(NOT RUN_IN_DEBUGGER)


Fix pwsat.asm target

Fix pwsat.asm target


Remove trailing space.

Remove trailing space.

--- cmake/arch.cmake
+++ cmake/arch.cmake
@@ -20,9 +20,9 @@
 # Fixed with check types
 #
 if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
-    if (CMAKE_SIZEOF_VOID_P MATCHES 8)
-        set(CMAKE_SYSTEM_PROCESSOR "x86_64")
-    else(CMAKE_SIZEOF_VOID_P MATCHES 8)
-        set(CMAKE_SYSTEM_PROCESSOR "x86")
-    endif(CMAKE_SIZEOF_VOID_P MATCHES 8)
+    if (CMAKE_SIZEOF_VOID_P MATCHES 8)
+        set(CMAKE_SYSTEM_PROCESSOR "x86_64")
+    else(CMAKE_SIZEOF_VOID_P MATCHES 8)
+        set(CMAKE_SYSTEM_PROCESSOR "x86")
+    endif(CMAKE_SIZEOF_VOID_P MATCHES 8)
 endif()