Replace FindICU

Replace FindICU

--- builds/cmake/Modules/FindICU.cmake
+++ builds/cmake/Modules/FindICU.cmake
@@ -1,314 +1,95 @@
-# This module can find the International Components for Unicode (ICU) Library
+# Finds the International Components for Unicode (ICU) Library
 #
-# Requirements:
-# - CMake >= 2.8.3 (for new version of find_package_handle_standard_args)
-#
-# The following variables will be defined for your use:
-#   - ICU_FOUND             : were all of your specified components found (include dependencies)?
-#   - ICU_INCLUDE_DIRS      : ICU include directory
-#   - ICU_LIBRARIES         : ICU libraries
-#   - ICU_VERSION           : complete version of ICU (x.y.z)
-#   - ICU_MAJOR_VERSION     : major version of ICU
-#   - ICU_MINOR_VERSION     : minor version of ICU
-#   - ICU_PATCH_VERSION     : patch version of ICU
-#   - ICU_<COMPONENT>_FOUND : were <COMPONENT> found? (FALSE for non specified component if it is not a dependency)
-#
-# For windows or non standard installation, define ICU_ROOT variable to point to the root installation of ICU. Two ways:
-#   - run cmake with -DICU_ROOT=<PATH>
-#   - define an environment variable with the same name before running cmake
-# With cmake-gui, before pressing "Configure":
-#   1) Press "Add Entry" button
-#   2) Add a new entry defined as:
-#     - Name: ICU_ROOT
-#     - Type: choose PATH in the selection list
-#     - Press "..." button and select the root installation of ICU
-#
-# Example Usage:
-#
-#   1. Copy this file in the root of your project source directory
-#   2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
-#     set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
-#   3. Finally call find_package() once, here are some examples to pick from
-#
-#   Require ICU 4.4 or later
-#     find_package(ICU 4.4 REQUIRED)
-#
-#   if(ICU_FOUND)
-#      include_directories(${ICU_INCLUDE_DIRS})
-#      add_executable(myapp myapp.c)
-#      target_link_libraries(myapp ${ICU_LIBRARIES})
-#   endif(ICU_FOUND)
+#  ICU_FOUND          - True if ICU found.
+#  ICU_I18N_FOUND     - True if ICU's internationalization library found.
+#  ICU_INCLUDE_DIRS   - Directory to include to get ICU headers
+#                       Note: always include ICU headers as, e.g.,
+#                       unicode/utypes.h
+#  ICU_LIBRARIES      - Libraries to link against for the common ICU
+#  ICU_I18N_LIBRARIES - Libraries to link against for ICU internationaliation
+#                       (note: in addition to ICU_LIBRARIES)

-#=============================================================================
-# Copyright (c) 2011-2013, julp
-#
-# Distributed under the OSI-approved BSD License
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#=============================================================================
+# Look for the header file.
+find_path(
+  ICU_INCLUDE_DIR
+  NAMES unicode/utypes.h
+  DOC "Include directory for the ICU library")
+mark_as_advanced(ICU_INCLUDE_DIR)

-find_package(PkgConfig QUIET)
+# Look for the library.
+find_library(
+  ICU_LIBRARY
+  NAMES icuuc cygicuuc cygicuuc32
+  DOC "Libraries to link against for the common parts of ICU")
+mark_as_advanced(ICU_LIBRARY)

-########## Private ##########
-if(NOT DEFINED ICU_PUBLIC_VAR_NS)
-    set(ICU_PUBLIC_VAR_NS "ICU")                          # Prefix for all ICU relative public variables
-endif(NOT DEFINED ICU_PUBLIC_VAR_NS)
-if(NOT DEFINED ICU_PRIVATE_VAR_NS)
-    set(ICU_PRIVATE_VAR_NS "_${ICU_PUBLIC_VAR_NS}")       # Prefix for all ICU relative internal variables
-endif(NOT DEFINED ICU_PRIVATE_VAR_NS)
-if(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
-    set(PC_ICU_PRIVATE_VAR_NS "_PC${ICU_PRIVATE_VAR_NS}") # Prefix for all pkg-config relative internal variables
-endif(NOT DEFINED PC_ICU_PRIVATE_VAR_NS)
+# Copy the results to the output variables.
+if(ICU_INCLUDE_DIR AND ICU_LIBRARY)
+  set(ICU_FOUND 1)
+  set(ICU_LIBRARIES ${ICU_LIBRARY})
+  set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})

-function(icudebug _VARNAME)
-    if(${ICU_PUBLIC_VAR_NS}_DEBUG)
-        if(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-            message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = ${${ICU_PUBLIC_VAR_NS}_${_VARNAME}}")
-        else(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-            message("${ICU_PUBLIC_VAR_NS}_${_VARNAME} = <UNDEFINED>")
-        endif(DEFINED ${ICU_PUBLIC_VAR_NS}_${_VARNAME})
-    endif(${ICU_PUBLIC_VAR_NS}_DEBUG)
-endfunction(icudebug)
+  set(ICU_VERSION 0)
+  set(ICU_MAJOR_VERSION 0)
+  set(ICU_MINOR_VERSION 0)
+  if (EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
+    FILE(READ "${ICU_INCLUDE_DIR}/unicode/uvernum.h" _ICU_VERSION_CONENTS)
+  else()
+    FILE(READ "${ICU_INCLUDE_DIR}/unicode/uversion.h" _ICU_VERSION_CONENTS)
+  endif()

-set(${ICU_PRIVATE_VAR_NS}_ROOT "")
-if(DEFINED ENV{ICU_ROOT})
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "$ENV{ICU_ROOT}")
-endif(DEFINED ENV{ICU_ROOT})
-if (DEFINED ICU_ROOT)
-    set(${ICU_PRIVATE_VAR_NS}_ROOT "${ICU_ROOT}")
-endif(DEFINED ICU_ROOT)
+  STRING(REGEX REPLACE ".*#define U_ICU_VERSION_MAJOR_NUM ([0-9]+).*" "\\1" ICU_MAJOR_VERSION "${_ICU_VERSION_CONENTS}")
+  STRING(REGEX REPLACE ".*#define U_ICU_VERSION_MINOR_NUM ([0-9]+).*" "\\1" ICU_MINOR_VERSION "${_ICU_VERSION_CONENTS}")

-set(${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES )
-set(${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES )
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin64")
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib64")
-endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
-list(APPEND ${ICU_PRIVATE_VAR_NS}_BIN_SUFFIXES "bin")
-list(APPEND ${ICU_PRIVATE_VAR_NS}_LIB_SUFFIXES "lib")
+  set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}")

-set(${ICU_PRIVATE_VAR_NS}_COMPONENTS )
-# <icu component name> <library name 1> ... <library name N>
-macro(icu_declare_component _NAME)
-    list(APPEND ${ICU_PRIVATE_VAR_NS}_COMPONENTS ${_NAME})
-    set("${ICU_PRIVATE_VAR_NS}_COMPONENTS_${_NAME}" ${ARGN})
-endmacro(icu_declare_component)
+  # Look for the ICU internationalization libraries
+  find_library(
+    ICU_I18N_LIBRARY
+    NAMES icuin icui18n cygicuin cygicuin32
+    DOC "Libraries to link against for ICU internationalization")
+  mark_as_advanced(ICU_I18N_LIBRARY)
+  if (ICU_I18N_LIBRARY)
+    set(ICU_I18N_FOUND 1)
+    set(ICU_I18N_LIBRARIES ${ICU_I18N_LIBRARY})
+  else (ICU_I18N_LIBRARY)
+    set(ICU_I18N_FOUND 0)
+    set(ICU_I18N_LIBRARIES)
+  endif (ICU_I18N_LIBRARY)

-icu_declare_component(data icudata)
-icu_declare_component(uc   icuuc)         # Common and Data libraries
-icu_declare_component(i18n icui18n icuin) # Internationalization library
-icu_declare_component(io   icuio ustdio)  # Stream and I/O Library
-icu_declare_component(le   icule)         # Layout library
-icu_declare_component(lx   iculx)         # Paragraph Layout library
+  # Look for the ICU data libraries
+  find_library(
+      ICU_DATA_LIBRARY
+    NAMES icudata cygicudata cygicudata32
+    DOC "Libraries to link against for ICU data")
+  mark_as_advanced(ICU_DATA_LIBRARY)
+  if (ICU_DATA_LIBRARY)
+    set(ICU_DATA_FOUND 1)
+    set(ICU_DATA_LIBRARIES ${ICU_DATA_LIBRARY})
+  else (ICU_DATA_LIBRARY)
+    set(ICU_DATA_FOUND 0)
+    set(ICU_DATA_LIBRARIES)
+  endif (ICU_DATA_LIBRARY)
+else(ICU_INCLUDE_DIR AND ICU_LIBRARY)
+  set(ICU_FOUND 0)
+  set(ICU_I18N_FOUND 0)
+  set(ICU_LIBRARIES)
+  set(ICU_I18N_LIBRARIES)
+  set(ICU_INCLUDE_DIRS)
+  set(ICU_VERSION)
+  set(ICU_MAJOR_VERSION)
+  set(ICU_MINOR_VERSION)
+endif(ICU_INCLUDE_DIR AND ICU_LIBRARY)

-########## Public ##########
-set(${ICU_PUBLIC_VAR_NS}_FOUND TRUE)
-set(${ICU_PUBLIC_VAR_NS}_LIBRARIES )
-set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
-set(${ICU_PUBLIC_VAR_NS}_C_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CXX_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CPP_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS "")
-set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "")
-foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
-    string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-    set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the icu_declare_component macro
-endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-# Check components
-if(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS) # uc required at least
-    set(${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-else(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS uc)
-    list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        if(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-            message(FATAL_ERROR "Unknown ICU component: ${${ICU_PRIVATE_VAR_NS}_COMPONENT}")
-        endif(NOT DEFINED ${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(NOT ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-
-# Includes
-find_path(
-    ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-    NAMES unicode/utypes.h utypes.h
-    HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-    PATH_SUFFIXES "include"
-    DOC "Include directories for ICU"
-)
-
-if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    ########## <part to keep synced with tests/version/CMakeLists.txt> ##########
-    if(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h") # ICU >= 4
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uvernum.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h") # ICU [2;4[
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/uversion.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h") # ICU [1.4;2[
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/unicode/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    elseif(EXISTS "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h") # ICU 1.3
-        file(READ "${${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS}/utypes.h" ${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS)
-    else()
-        message(FATAL_ERROR "ICU version header not found")
-    endif()
-
-    if(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *ICU_VERSION *\"([0-9]+)\".*") # ICU 1.3
-        # [1.3;1.4[ as #define ICU_VERSION "3" (no patch version, ie all 1.3.X versions will be detected as 1.3.0)
-        set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "1")
-        set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_1}")
-        set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-    elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION_MAJOR_NUM *([0-9]+).*")
-        #
-        # Since version 4.9.1, ICU release version numbering was totaly changed, see:
-        # - http://site.icu-project.org/download/49
-        # - http://userguide.icu-project.org/design#TOC-Version-Numbers-in-ICU
-        #
-        set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_MINOR_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-        string(REGEX REPLACE ".*# *define *U_ICU_VERSION_PATCHLEVEL_NUM *([0-9]+).*" "\\1" ${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS}")
-    elseif(${ICU_PRIVATE_VAR_NS}_VERSION_HEADER_CONTENTS MATCHES ".*# *define *U_ICU_VERSION *\"(([0-9]+)(\\.[0-9]+)*)\".*") # ICU [1.4;1.8[
-        # [1.4;1.8[ as #define U_ICU_VERSION "1.4.1.2" but it seems that some 1.4.1(?:\.\d)? have releasing error and appears as 1.4.0
-        set(${ICU_PRIVATE_VAR_NS}_FULL_VERSION "${CMAKE_MATCH_1}") # copy CMAKE_MATCH_1, no longer valid on the following if
-        if(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)$")
-            set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-            set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-            set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "0")
-        elseif(${ICU_PRIVATE_VAR_NS}_FULL_VERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)")
-            set(${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION "${CMAKE_MATCH_1}")
-            set(${ICU_PUBLIC_VAR_NS}_MINOR_VERSION "${CMAKE_MATCH_2}")
-            set(${ICU_PUBLIC_VAR_NS}_PATCH_VERSION "${CMAKE_MATCH_3}")
-        endif()
-    else()
-        message(FATAL_ERROR "failed to detect ICU version")
-    endif()
-    set(${ICU_PUBLIC_VAR_NS}_VERSION "${${ICU_PUBLIC_VAR_NS}_MAJOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_MINOR_VERSION}.${${ICU_PUBLIC_VAR_NS}_PATCH_VERSION}")
-    ########## </part to keep synced with tests/version/CMakeLists.txt> ##########
-
-    # Check dependencies (implies pkg-config)
-    if(PKG_CONFIG_FOUND)
-        set(${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_DUP})
-            pkg_check_modules(PC_ICU_PRIVATE_VAR_NS "icu-${${ICU_PRIVATE_VAR_NS}_COMPONENT}" QUIET)
-
-            if(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-                foreach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY ${PC_ICU_LIBRARIES})
-                    string(REGEX REPLACE "^icu" "" ${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY ${${PC_ICU_PRIVATE_VAR_NS}_LIBRARY})
-                    list(APPEND ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS ${${PC_ICU_PRIVATE_VAR_NS}_STRIPPED_LIBRARY})
-                endforeach(${PC_ICU_PRIVATE_VAR_NS}_LIBRARY)
-            endif(${PC_ICU_PRIVATE_VAR_NS}_FOUND)
-        endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-        list(REMOVE_DUPLICATES ${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS)
-    endif(PKG_CONFIG_FOUND)
-
-    # Check libraries
-    foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PUBLIC_VAR_NS}_FIND_COMPONENTS})
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES )
-        set(${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES )
-        foreach(${ICU_PRIVATE_VAR_NS}_BASE_NAME ${${ICU_PRIVATE_VAR_NS}_COMPONENTS_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}d")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}")
-            list(APPEND ${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES "${${ICU_PRIVATE_VAR_NS}_BASE_NAME}${ICU_MAJOR_VERSION}${ICU_MINOR_VERSION}d")
-        endforeach(${ICU_PRIVATE_VAR_NS}_BASE_NAME)
-
-        find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_RELEASE_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Release libraries for ICU"
-        )
-        find_library(
-            ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-            NAMES ${${ICU_PRIVATE_VAR_NS}_POSSIBLE_DEBUG_NAMES}
-            HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT}
-            PATH_SUFFIXES ${_ICU_LIB_SUFFIXES}
-            DOC "Debug libraries for ICU"
-        )
-
-        string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
-        if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # both not found
-            set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE)
-            set("${ICU_PUBLIC_VAR_NS}_FOUND" FALSE)
-        else(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # one or both found
-            set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" TRUE)
-            if(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # release not found => we are in debug
-                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-            elseif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}) # debug not found => we are in release
-                set(${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT} "${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}")
-            else() # both found
-                set(
-                    ${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}
-                    optimized ${${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-                    debug ${${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT}}
-                )
-            endif()
-            list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
-        endif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
-    endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-
-    # Try to find out compiler flags
-    find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE icu-config HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT})
-    if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
-    endif(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
-
-    # Check find_package arguments
-    include(FindPackageHandleStandardArgs)
-    if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        find_package_handle_standard_args(
-            ${ICU_PUBLIC_VAR_NS}
-            REQUIRED_VARS ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-            VERSION_VAR ${ICU_PUBLIC_VAR_NS}_VERSION
-        )
-    else(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        find_package_handle_standard_args(${ICU_PUBLIC_VAR_NS} "ICU not found" ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-else(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-    if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-        message(FATAL_ERROR "Could not find ICU include directory")
-    endif(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
-endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-mark_as_advanced(
-    ${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS
-    ${ICU_PUBLIC_VAR_NS}_LIBRARIES
-)
-
-# IN (args)
-icudebug("FIND_COMPONENTS")
-icudebug("FIND_REQUIRED")
-icudebug("FIND_QUIETLY")
-icudebug("FIND_VERSION")
-# OUT
-# Found
-icudebug("FOUND")
-icudebug("UC_FOUND")
-icudebug("I18N_FOUND")
-icudebug("IO_FOUND")
-icudebug("LE_FOUND")
-icudebug("LX_FOUND")
-icudebug("DATA_FOUND")
-# Flags
-icudebug("C_FLAGS")
-icudebug("CPP_FLAGS")
-icudebug("CXX_FLAGS")
-icudebug("C_SHARED_FLAGS")
-icudebug("CPP_SHARED_FLAGS")
-icudebug("CXX_SHARED_FLAGS")
-# Linking
-icudebug("INCLUDE_DIRS")
-icudebug("LIBRARIES")
-# Version
-icudebug("MAJOR_VERSION")
-icudebug("MINOR_VERSION")
-icudebug("PATCH_VERSION")
-icudebug("VERSION")
-
+IF(ICU_FOUND)
+  IF( NOT ICU_FIND_QUIETLY )
+    MESSAGE( STATUS "Found ICU header files in ${ICU_INCLUDE_DIRS}")
+    MESSAGE( STATUS "Found ICU libraries: ${ICU_LIBRARIES}")
+  ENDIF( NOT ICU_FIND_QUIETLY )
+ELSE(ICU_FOUND)
+  IF(ICU_FIND_REQUIRED)
+    MESSAGE( FATAL_ERROR "Could not find ICU" )
+  ELSE(ICU_FIND_REQUIRED)
+    MESSAGE( STATUS "Optional package ICU was not found" )
+  ENDIF(ICU_FIND_REQUIRED)
+ENDIF(ICU_FOUND)


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -28,15 +28,14 @@
 Name[sr@ijekavian]=Брзо гласништво
 Name[sr@ijekavianlatin]=Brzo glasništvo
 Name[sr@latin]=Brzo glasništvo
-Name[sv]=Direktmeddelandekontakter
+Name[sv]=Direktmeddelanden
 Name[tr]=Anında Mesajlaşma
-Name[ug]=مۇڭداشقۇ
 Name[uk]=Миттєвий обмін повідомленнями
 Name[x-test]=xxInstant Messagingxx
 Name[zh_CN]=即时通讯
 Name[zh_TW]=即時訊息
 Comment=Start a chat with any of your IM contacts or change your IM status
-Comment[bs]=Pokrenite ćaskanje s bilo kojim od vaših IM kontakta ili promijenite svoj IM status
+Comment[bs]=Počnite ćaskanje s nekim od IM kontakta ili promijenite vaš IM status
 Comment[ca]=Inicia un xat amb qualsevol dels vostres contactes de MI o canvia el vostre estat de MI
 Comment[ca@valencia]=Inicia un xat amb qualsevol dels vostres contactes de MI o canvia el vostre estat de MI
 Comment[cs]=Začít rozhovor s kterýmkoliv vaším kontaktem v IM nebo změnit stav na IM


Remove OpenCV2 related CMake code

Remove OpenCV2 related CMake code

--- CMake/PackageDepends/MITK_OpenCV_Config.cmake
+++ CMake/PackageDepends/MITK_OpenCV_Config.cmake
@@ -1,52 +1,3 @@
-macro(REMOVE_LAST_PATH_ELEMENT_IF_EQUALS INPUT_VAR TARGET_VALUE)
-  STRING( REPLACE "/" ";" INPUT_VARLIST ${${INPUT_VAR}} )
-  LIST( LENGTH INPUT_VARLIST INPUT_VARLIST_LENGTH )
-
-  SET(INPUT_VARLIST_LAST_INDEX ${INPUT_VARLIST_LENGTH})
-  MATH( EXPR INPUT_VARLIST_LAST_INDEX "${INPUT_VARLIST_LENGTH}-1" )
-  LIST( GET INPUT_VARLIST ${INPUT_VARLIST_LAST_INDEX} INPUT_VARLAST_ELEMENT )
-
-  if(INPUT_VARLAST_ELEMENT MATCHES "^${TARGET_VALUE}$")
-    LIST( REMOVE_AT INPUT_VARLIST ${INPUT_VARLIST_LAST_INDEX} )
-  endif()
-
-  set(NEW_VAR "")
-  foreach(folderPart ${INPUT_VARLIST})
-    if(NOT NEW_VAR)
-      if(NOT WIN32)
-        set(folderPart "/${folderPart}")
-      endif()
-      set(NEW_VAR "${folderPart}")
-    else()
-      set(NEW_VAR "${NEW_VAR}/${folderPart}")
-    endif()
-  endforeach()
-
-  set(${INPUT_VAR} ${NEW_VAR})
-endmacro()
-
-# bug in opencv 2.4.2 and mitk: if we have a submodule OpenCV_LIB_DIR_OPT and
-# OpenCV_LIB_DIR_DBG is cached when find_package is called
-# resulting in wrong windows output paths, e.g. C:\OpenCV\lib\Release\Release
-# removing last Release and Debug string manually to fix it
-if( OpenCV_LIB_DIR )
-
-  # remove the Release/Debug in <path>\Release and <path>\Debug
-  # of OpenCV_LIB_DIR_OPT and OpenCV_LIB_DIR_DBG here
-  REMOVE_LAST_PATH_ELEMENT_IF_EQUALS(OpenCV_LIB_DIR_DBG Debug)
-  #message("OpenCV_LIB_DIR_DBG: ${OpenCV_LIB_DIR_DBG}")
-
-  set(OpenCV_LIB_DIR_OPT ${OpenCV_LIB_DIR_DBG})
-  #message("OpenCV_LIB_DIR_OPT: ${OpenCV_LIB_DIR_OPT}")
-
-  REMOVE_LAST_PATH_ELEMENT_IF_EQUALS(OpenCV_3RDPARTY_LIB_DIR_DBG Debug)
-  #message("OpenCV_3RDPARTY_LIB_DIR_DBG: ${OpenCV_3RDPARTY_LIB_DIR_DBG}")
-
-  set(OpenCV_3RDPARTY_LIB_DIR_OPT ${OpenCV_3RDPARTY_LIB_DIR_DBG})
-  #message("OpenCV_3RDPARTY_LIB_DIR_OPT: ${OpenCV_3RDPARTY_LIB_DIR_OPT}")
-
-endif()
-
 list(APPEND ALL_LIBRARIES ${OpenCV_LIBS})
 list(APPEND ALL_INCLUDE_DIRECTORIES ${OpenCV_INCLUDE_DIRS})


Fix source package

Fix source package

Add the folder /make from the source package to avoid build files to be
added to the source package.

--- build/Package.cmake
+++ build/Package.cmake
@@ -28,7 +28,7 @@

 # Sources
 set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};\\\\.git/;\\\\.git$;\\\\.gitignore$;\\\\.gitmodules$;.*\\\\.swp;.*\\\\.pyc;__pycache__/")
+set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};\\\\.git/;\\\\.git$;\\\\.gitignore$;\\\\.gitmodules$;.*\\\\.swp;.*\\\\.pyc;__pycache__/;/make/")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}")

 # Common


added date and right package name

added date and right package name

--- SuperBuild/External_CCPi-RGL.cmake
+++ SuperBuild/External_CCPi-RGL.cmake
@@ -2,8 +2,8 @@
 # Author: Benjamin A Thomas
 # Author: Kris Thielemans
 # Author: Edoardo Pasca
-# Copyright 2017 University College London
-# Copyright 2017 STFC
+# Copyright 2017-2018 University College London
+# Copyright 2017-2018 STFC
 #
 # This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild.
 #
@@ -66,7 +66,7 @@
     # $PYTHONPATH directory
   set (BUILD_PYTHON ${PYTHONLIBS_FOUND})
   if (BUILD_PYTHON)
-    set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the SIRF Python modules")
+    set(PYTHON_DEST_DIR "" CACHE PATH "Directory of the CIL regularisation Python modules")
     if (PYTHON_DEST_DIR)
      set(PYTHON_DEST "${PYTHON_DEST_DIR}")
     else()


Stop creating a logs dir

Stop creating a logs dir

--- tools/cmake/Win32PostBuild.cmake
+++ tools/cmake/Win32PostBuild.cmake
@@ -5,13 +5,6 @@
 ## create a target that gathers up the necessary dll's from the above
 ## dependencies and places them in the runtime directory for this project
 add_custom_target(DEPS)
-
-add_custom_command(
-    TARGET DEPS
-    POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E make_directory "${WIN_PROJECT_BINARY_DIR}\\bin\\$\(Configuration\)\\logs"
-    VERBATIM
-)

 get_filename_component(BOOST_PYTHON_DLL_PATH ${Boost_PYTHON3_LIBRARY_DEBUG} PATH)
 string(REPLACE "/" "\\" BOOST_PYTHON_DLL_PATH "${BOOST_PYTHON_DLL_PATH}")


cmake/clang: Disable -Wunused-but-set-variable warnings

Not sure why this is needed for this branch, but it pretty clearly is --
there are hundreds of set-but-unused variables in the codebase.

Signed-off-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>

--- cmake/compiler/clang/compiler_flags.cmake
+++ cmake/compiler/clang/compiler_flags.cmake
@@ -27,6 +27,7 @@
                       -Wformat-security
                       -Wno-format-zero-length
                       -Wno-main
+                      -Wno-unused-but-set-variable
                       -Wno-typedef-redefinition
 )


Update

Update

--- modules/nanomsg.cmake
+++ modules/nanomsg.cmake
@@ -2,13 +2,13 @@

   # Save old compiler flags
   set(CMAKE_C_FLAGS_OLD ${CMAKE_C_FLAGS})
-  message(CMAKE_C_FLAGS)
-  message(CMAKE_C_FLAGS_OLD)
+  message(${CMAKE_C_FLAGS})
+  message(${CMAKE_C_FLAGS_OLD})

   # Setup new compiler flags
   if(NOT MSVC)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-aliasing=n")
-    message(CMAKE_C_FLAGS)
+    message(${CMAKE_C_FLAGS})
   else()
     # Disable some compile warnings
     # C4100: 'identifier' : unreferenced formal parameter
@@ -43,6 +43,6 @@

   # Restore old compiler flags
   set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS_OLD})
-  message(CMAKE_C_FLAGS)
+  message(${CMAKE_C_FLAGS})

 endif()


Check if download/unpack commands succeeded

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -101,18 +101,32 @@
   find_package(benchmark REQUIRED CONFIG PATHS ${GOOGLEBENCHMARK_ROOT})
 endif()

-# Find or download/install rocm-cmake project (https://github.com/RadeonOpenCompute/rocm-cmake)
+# Find or download/install rocm-cmake project
 find_package(ROCM QUIET CONFIG PATHS /opt/rocm)
 if(NOT ROCM_FOUND)
   set(rocm_cmake_tag "master" CACHE STRING "rocm-cmake tag to download")
   file(
     DOWNLOAD https://github.com/RadeonOpenCompute/rocm-cmake/archive/${rocm_cmake_tag}.zip
     ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag}.zip
+    STATUS rocm_cmake_download_status LOG rocm_cmake_download_log
   )
+  list(GET rocm_cmake_download_status 0 rocm_cmake_download_error_code)
+  if(rocm_cmake_download_error_code)
+    message(FATAL_ERROR "Error: downloading "
+      "https://github.com/RadeonOpenCompute/rocm-cmake/archive/${rocm_cmake_tag}.zip failed "
+      "error_code: ${rocm_cmake_download_error_code} "
+      "log: ${rocm_cmake_download_log} "
+    )
+  endif()
+
   execute_process(
     COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag}.zip
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    RESULT_VARIABLE rocm_cmake_unpack_error_code
   )
+  if(rocm_cmake_unpack_error_code)
+    message(FATAL_ERROR "Error: unpacking  ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag}.zip failed")
+  endif()
   find_package(ROCM REQUIRED CONFIG PATHS ${CMAKE_CURRENT_BINARY_DIR}/rocm-cmake-${rocm_cmake_tag})
 endif()


improve compiler name and version detection

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -271,6 +271,9 @@

   set_property(GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT "0")
   set_property(GLOBAL PROPERTY EIGEN_FAILTEST_COUNT "0")
+
+  # uncomment anytime you change the ei_get_compilerver_from_cxx_version_string macro
+  # ei_test_get_compilerver_from_cxx_version_string()
 endmacro(ei_init_testing)

 macro(ei_set_sitename)
@@ -303,28 +306,63 @@
     endif()
   else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
-    # supporting a "--version" flag
-    exec_program( ${CMAKE_CXX_COMPILER}
-                  ARGS --version
-                  OUTPUT_VARIABLE eigen_cxx_compiler_version_raw
-                )
-    # first extract the compiler name which is the first word
-    string( REGEX REPLACE ".*(llvm\\-g\\+\\+|g\\+\\+|icpc|clang).*" "\\1"
-            eigen_cxx_compiler_name ${eigen_cxx_compiler_version_raw})
-
-    if(eigen_cxx_compiler_name MATCHES ".*g\\+\\+.*")
-      string( REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
-              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
-    elseif(eigen_cxx_compiler_name MATCHES "icpc|clang")
-      string( REGEX REPLACE ".* ([0-9]+\\.[0-9]+\\.[0-9]+|[0-9]+\\.[0-9]+).*" "\\1"
-              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
-    else()
-      set(eigen_cxx_compiler_version "_")
-    endif()
-
-    set(${VAR} "${eigen_cxx_compiler_name}-${eigen_cxx_compiler_version}")
+    # supporting a "--version" flag
+    execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                    COMMAND head -n 1
+                    OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+    ei_get_compilerver_from_cxx_version_string(${eigen_cxx_compiler_version_string} CNAME CVER)
+
+    set(${VAR} "${CNAME}-${CVER}")
   endif()
 endmacro(ei_get_compilerver)
+
+# Extract compiler name and version from a raw version string
+# WARNING: if you edit thid macro, then please test it by  uncommenting
+# the testing macro call in ei_init_testing() of the EigenTesting.cmake file.
+# See also the ei_test_get_compilerver_from_cxx_version_string macro at the end of the file
+macro(ei_get_compilerver_from_cxx_version_string VERSTRING CNAME CVER)
+  # extract possible compiler names
+  string(REGEX MATCH "g\\+\\+"      ei_has_gpp    ${VERSTRING})
+  string(REGEX MATCH "llvm|LLVM"    ei_has_llvm   ${VERSTRING})
+  string(REGEX MATCH "gcc|GCC"      ei_has_gcc    ${VERSTRING})
+  string(REGEX MATCH "icpc|ICC"     ei_has_icpc   ${VERSTRING})
+  string(REGEX MATCH "clang|CLANG"  ei_has_clang  ${VERSTRING})
+
+  # combine them
+  if((ei_has_llvm) AND (ei_has_gpp OR ei_has_gcc))
+    set(${CNAME} "llvm-g++")
+  elseif((ei_has_llvm) AND (ei_has_clang))
+    set(${CNAME} "llvm-clang++")
+  elseif(ei_has_icpc)
+    set(${CNAME} "icpc")
+  elseif(ei_has_gpp OR ei_has_gcc)
+    set(${CNAME} "g++")
+  else()
+    set(${CNAME} "_")
+  endif()
+
+  # extract possible version numbers
+  # first try to extract 3 isolated numbers:
+  string(REGEX MATCH " [0-9]+\\.[0-9]+\\.[0-9]+" eicver ${VERSTRING})
+  if(NOT eicver)
+    # try to extract 2 isolated ones:
+    string(REGEX MATCH " [0-9]+\\.[0-9]+" eicver ${VERSTRING})
+    if(NOT eicver)
+      # try to extract 3:
+      string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+\\.[0-9]+" eicver ${VERSTRING})
+      if(NOT eicver)
+        # try to extract 2:
+        string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+" eicver ${VERSTRING})
+      else()
+        set(eicver " _")
+      endif()
+    endif()
+  endif()
+
+  string(REGEX REPLACE ".(.*)" "\\1" ${CVER} ${eicver})
+
+endmacro(ei_get_compilerver_from_cxx_version_string)

 macro(ei_get_cxxflags VAR)
   set(${VAR} "")
@@ -402,3 +440,31 @@
     set(${VAR} 1)
   endif()
 endmacro(ei_is_64bit_env)
+
+
+# helper macro for testing ei_get_compilerver_from_cxx_version_string
+# STR: raw version string
+# REFNAME: expected compiler name
+# REFVER: expected compiler version
+macro(ei_test1_get_compilerver_from_cxx_version_string STR REFNAME REFVER)
+  ei_get_compilerver_from_cxx_version_string(${STR} CNAME CVER)
+  if((NOT ${REFNAME} STREQUAL ${CNAME}) OR (NOT ${REFVER} STREQUAL ${CVER}))
+    message("STATUS ei_get_compilerver_from_cxx_version_string error:")
+    message("Expected \"${REFNAME}-${REFVER}\", got \"${CNAME}-${CVER}\"")
+  endif()
+endmacro(ei_test1_get_compilerver_from_cxx_version_string)
+
+# macro for testing ei_get_compilerver_from_cxx_version_string
+# feel free to add more version strings
+macro(ei_test_get_compilerver_from_cxx_version_string)
+  ei_test1_get_compilerver_from_cxx_version_string("g++ (SUSE Linux) 4.5.3 20110428 [gcc-4_5-branch revision 173117]" "g++" "4.5.3")
+  ei_test1_get_compilerver_from_cxx_version_string("c++ (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)" "g++" "4.5.1")
+  ei_test1_get_compilerver_from_cxx_version_string("icpc (ICC) 11.0 20081105" "icpc" "11.0")
+  ei_test1_get_compilerver_from_cxx_version_string("g++-3.4 (GCC) 3.4.6" "g++" "3.4.6")
+  ei_test1_get_compilerver_from_cxx_version_string("SUSE Linux clang version 3.0 (branches/release_30 145598) (based on LLVM 3.0)" "llvm-clang++" "3.0")
+  ei_test1_get_compilerver_from_cxx_version_string("icpc (ICC) 12.0.5 20110719" "icpc" "12.0.5")
+  ei_test1_get_compilerver_from_cxx_version_string("Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)" "llvm-clang++" "2.1")
+  ei_test1_get_compilerver_from_cxx_version_string("i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)" "llvm-g++" "4.2.1")
+  ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 4.4.6" "g++" "4.4.6")
+  ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 2011" "g++" "4.4")
+endmacro(ei_test_get_compilerver_from_cxx_version_string)


Removed unnecessary MSVC check.

Removed unnecessary MSVC check.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -159,9 +159,9 @@
   else(EIGEN_COVERAGE_TESTING)
     set(COVERAGE_FLAGS "")
   endif(EIGEN_COVERAGE_TESTING)
-  if((EIGEN_TEST_RVALUE_REF_SUPPORT OR EIGEN_TEST_C++0x) AND NOT MSVC)
+  if(EIGEN_TEST_RVALUE_REF_SUPPORT OR EIGEN_TEST_C++0x)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-  endif((EIGEN_TEST_RVALUE_REF_SUPPORT OR EIGEN_TEST_C++0x) AND NOT MSVC)
+  endif(EIGEN_TEST_RVALUE_REF_SUPPORT OR EIGEN_TEST_C++0x)
   if(CMAKE_SYSTEM_NAME MATCHES Linux)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COVERAGE_FLAGS} -g2")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${COVERAGE_FLAGS} -O2 -g2")


fix for find gtest

fix for find gtest

--- cmake/FindGTestFix.cmake
+++ cmake/FindGTestFix.cmake
@@ -24,7 +24,7 @@
         set(GTEST_SOURCE_DIR /usr/src/gtest)
       endif()

-      if(EXISTS ${GTEST_SOURCE_DIR} AND IS_DIRECTORY ${GTEST_SOURCE_DIR})
+      if(EXISTS "${GTEST_SOURCE_DIR}" AND IS_DIRECTORY "${GTEST_SOURCE_DIR}")
         #if the source directory exists and is indeed a directory we build the
         #gtest code
         set(GTEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build)


update fifechan for appveyor builds

update fifechan for appveyor builds

--- cmake/get-fifechan.cmake
+++ cmake/get-fifechan.cmake
@@ -35,8 +35,8 @@
       PREFIX              ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR        ${DEPENDENCY_DOWNLOAD_DIR}
       #URL                 https://github.com/fifengine/fifechan/releases/tag/${FIFECHAN_VERSION}/fifechan-v${FIFECHAN_VERSION}-VC14.zip
-      URL                 https://ci.appveyor.com/api/buildjobs/ut5f5r7r7vdo9jvs/artifacts/fifechan-shared-VC14-x86.zip
-      URL_MD5             4922f113510f61b81288c9dba1538a44
+      URL                 https://ci.appveyor.com/api/buildjobs/p6sl60h2upuyqun4/artifacts/fifechan-shared-VC14-x86.zip
+      URL_MD5             62317f867f13cb37a14c90b59e3f7ede
       CONFIGURE_COMMAND   ""
       BUILD_COMMAND       ""
       INSTALL_COMMAND


Put a -I option in front of each include directory.  (This may have to
be reviewed if some compile options are mixed in with the include directory
information, but so far, so good.)
LIBRARIES ==> LINK_FLAGS
INCLUDE_DIR ==> COMPILE_FLAGS

svn path=/trunk/; revision=6760

--- cmake/modules/xwin.cmake
+++ cmake/modules/xwin.cmake
@@ -21,22 +21,25 @@
 # device driver.
 # The following variables are set/modified:
 # PLD_xwin		  - ON means the xwin device is enabled.
-# xwin_INCLUDE_DIR	  - individual INCLUDE_DIR required to compile xwin
+# xwin_COMPILE_FLAGS	  - individual COMPILE_FLAGS required to compile xwin
 # 			    device.
-# xwin_LIBRARIES	  - individual LIBRARIES for dynamic xwin device.
-# DRIVERS_LIBRARIES	  - list of LIBRARIES for all static devices.
+# xwin_LINK_FLAGS	  - individual LINK_FLAGS for dynamic xwin device.
+# DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.
 # HAVE_PTHREAD		  - ON means use pthreads with xwin driver.
 # PLPLOT_MUTEX_RECURSIVE  - Portable definition for PTHREAD_MUTEX_RECURSIVE
 if(PLD_xwin)
   find_package(X11)
   if(X11_FOUND)
-    set(xwin_INCLUDE_DIR ${X11_INCLUDE_DIR})
-    set(xwin_LIBRARIES ${X11_LIBRARIES})
+    string(REGEX REPLACE ";" ";-I"
+    xwin_COMPILE_FLAGS
+    "-I${X11_INCLUDE_DIR}"
+    )
+    set(xwin_LINK_FLAGS ${X11_LIBRARIES})
     option(HAVE_PTHREAD "use pthreads with the xwin driver" OFF)
     if(HAVE_PTHREAD)
       find_package(Threads)
       if(CMAKE_USE_PTHREADS_INIT)
-        set(xwin_LIBRARIES ${xwin_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+        set(xwin_LINK_FLAGS ${xwin_LINK_FLAGS} ${CMAKE_THREAD_LIBS_INIT})
 	if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
 	  set(PLPLOT_MUTEX_RECURSIVE "PTHREAD_MUTEX_RECURSIVE_NP")
 	else(CMAKE_SYSTEM_NAME STREQUAL "Linux")
@@ -49,7 +52,7 @@
         set(HAVE_PTHREAD OFF)
       endif(CMAKE_USE_PTHREADS_INIT)
     endif(HAVE_PTHREAD)
-    set(DRIVERS_LIBRARIES ${DRIVERS_LIBRARIES} ${xwin_LIBRARIES})
+    set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${xwin_LINK_FLAGS})
   else(X11_FOUND)
     set(PLD_xwin OFF)
   endif(X11_FOUND)


enable SSE in debug mode

enable SSE in debug mode

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@6431 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -138,6 +138,7 @@
       endif ()

     endif()
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${SSE_FLAGS}")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${SSE_FLAGS}")


Check library type before reading properties

Former-commit-id: cde5bfe3dcbd6ae415eabce6ece0fd6dc48c39bd

--- cmake/getExpandedTarget.cmake
+++ cmake/getExpandedTarget.cmake
@@ -14,8 +14,10 @@
             get_target_property(lib_type ${lib} TYPE)
             get_target_property(lib_impt ${lib} IMPORTED)
             if(lib_impt)
-                # The location property can only be read on imported targets
-                get_target_property(imported_lib  ${lib} LOCATION)
+                if(NOT lib_type MATCHES "INTERFACE" OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
+                    # The location property can only be read on imported targets, or interface imported when cmake > 3.19
+                    get_target_property(imported_lib ${target_name} LOCATION)
+                endif()
             endif()
             get_target_property(interface_libs ${lib} INTERFACE_LINK_LIBRARIES)
             # Now we have all the libs in the target "lib".
@@ -140,8 +142,10 @@
             get_target_property(lib_type ${lib} TYPE)
             get_target_property(lib_impt ${lib} IMPORTED)
             if(lib_impt)
-                # The location property can only be read on imported targets
-                get_target_property(imported_lib  ${target_name} LOCATION)
+                if(NOT lib_type MATCHES "INTERFACE" OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
+                    # The location property can only be read on imported targets, or interface imported when cmake > 3.19
+                    get_target_property(imported_lib ${target_name} LOCATION)
+                endif()
             endif()
             if(NOT lib_type MATCHES "INTERFACE")
                 get_target_property(private_libs  ${target_name} LINK_LIBRARIES)
@@ -177,8 +181,10 @@
             get_target_property(lib_type ${target_name} TYPE)
             get_target_property(lib_impt ${target_name} IMPORTED)
             if(lib_impt)
-                # The location property can only be read on imported targets
-                get_target_property(imported_lib ${target_name} LOCATION)
+                if(NOT lib_type MATCHES "INTERFACE" OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
+                    # The location property can only be read on imported targets, or interface imported when cmake > 3.19
+                    get_target_property(imported_lib ${target_name} LOCATION)
+                endif()
             endif()
             if(NOT lib_type MATCHES "INTERFACE")
                 get_target_property(private_libs  ${target_name} LINK_LIBRARIES)


Increase minimal BOOST version to 1.56.

Increase minimal BOOST version to 1.56.

This is necessary because the previous minimum, 1.54, did not support
serializing std::unique_ptr for those users who have this old a BOOST
version but want to use C++11 anyway. (It does support serializing
the boost::scoped_ptr class that we use as a fall-back in non-C++11 mode
when using std_cxx11::unique_ptr.)

--- cmake/modules/FindBOOST.cmake
+++ cmake/modules/FindBOOST.cmake
@@ -43,7 +43,7 @@

 # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
 LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-FIND_PACKAGE(Boost 1.54 COMPONENTS
+FIND_PACKAGE(Boost 1.56 COMPONENTS
   iostreams serialization system thread
   )
 LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
@@ -56,7 +56,7 @@

   # temporarily disable ${CMAKE_SOURCE_DIR}/cmake/modules for module lookup
   LIST(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
-  FIND_PACKAGE(Boost 1.54 COMPONENTS iostreams serialization system thread)
+  FIND_PACKAGE(Boost 1.56 COMPONENTS iostreams serialization system thread)
   LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules/)
 ENDIF()


Update FindNumPy.cmake

Update FindNumPy.cmake

--- cmake/modules/FindNumPy.cmake
+++ cmake/modules/FindNumPy.cmake
@@ -41,9 +41,9 @@

 # Finding NumPy involves calling the Python interpreter
 if(NumPy_FIND_REQUIRED)
-    find_package(PythonInterp REQUIRED)
+    find_package(PythonInterp 2.7 REQUIRED)
 else()
-    find_package(PythonInterp)
+    find_package(PythonInterp 2.7)
 endif()

 if(NOT PYTHONINTERP_FOUND)


use extended FindQJSON.cmake to enable build on Gentoo

--- cmake/modules/FindQJSON.cmake
+++ cmake/modules/FindQJSON.cmake
@@ -43,4 +43,8 @@
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(QJSON DEFAULT_MSG QJSON_LIBRARIES QJSON_INCLUDE_DIR)

+  if ( UNIX AND NOT APPLE )
+    set ( QJSON_LIBRARIES "${QJSON_LIBRARIES} ${QJSON_LDFLAGS}" CACHE INTERNAL "")
+  endif ()
+
 endif (QJSON_INCLUDE_DIR AND QJSON_LIBRARIES)


cmake: vigranumpycore library is no longer needed

--- cmake/modules/FindVIGRA.cmake
+++ cmake/modules/FindVIGRA.cmake
@@ -5,7 +5,6 @@
 #  VIGRA_INCLUDE_DIR        - Vigra include directory.
 #  VIGRA_IMPEX_LIBRARY      - Vigra's impex library
 #  VIGRA_IMPEX_LIBRARY_DIR  - path to Vigra impex library
-#  VIGRA_NUMPY_CORE_LIBRARY - Vigra's vigranumpycore library

 # configVersion.hxx only present, after build of Vigra
 FIND_PATH(VIGRA_INCLUDE_DIR vigra/configVersion.hxx PATHS $ENV{VIGRA_ROOT}/include ENV CPLUS_INCLUDE_PATH)
@@ -14,17 +13,10 @@
 SET( VIGRA_IMPEX_LIBRARY_DIR ${VIGRA_IMPEX_LIBRARY_PATH} CACHE PATH "Path to Vigra impex library.")

 EXECUTE_PROCESS ( COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
-FIND_FILE(VIGRA_NUMPY_CORE_LIBRARY
-          NAMES vigranumpycore.so vigranumpycore.pyd
-          PATHS ${PYTHON_SITE_PACKAGES}
-                ENV PYTHONPATH
-                ${CMAKE_PREFIX_PATH}/python/Lib/site-packages # Windows, buildem system
-          PATH_SUFFIXES vigra)
-

 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_IMPEX_LIBRARY VIGRA_INCLUDE_DIR VIGRA_NUMPY_CORE_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRA DEFAULT_MSG VIGRA_IMPEX_LIBRARY VIGRA_INCLUDE_DIR )

-MARK_AS_ADVANCED( VIGRA_INCLUDE_DIR VIGRA_IMPEX_LIBRARY VIGRA_IMPEX_LIBRARY_DIR VIGRA_NUMPY_CORE_LIBRARY)
+MARK_AS_ADVANCED( VIGRA_INCLUDE_DIR VIGRA_IMPEX_LIBRARY VIGRA_IMPEX_LIBRARY_DIR)


build: link against static libtcmalloc instead of shared library

--- cmake_modules/FindGPerf.cmake
+++ cmake_modules/FindGPerf.cmake
@@ -17,7 +17,7 @@

 SET(GPERF_LIB_SEARCH   ${THIRDPARTY_PREFIX}/lib)

-SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} tcmalloc)
+SET(TCMALLOC_NAMES ${TCMALLOC_NAMES} libtcmalloc.a)
 FIND_LIBRARY(TCMALLOC_LIBRARY
   NAMES ${TCMALLOC_NAMES}
   PATHS ${GPERF_LIB_SEARCH}


Exclude data directory and meshes from submission archive.

--- common/cmake/Submission.cmake
+++ common/cmake/Submission.cmake
@@ -2,7 +2,7 @@
 set (CPACK_GENERATOR "")
 set (CPACK_SOURCE_GENERATOR "ZIP")
 set (CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
-list (APPEND CPACK_SOURCE_IGNORE_FILES build/)
+list (APPEND CPACK_SOURCE_IGNORE_FILES build/ data/ .*\.mesh)

 set (CPACK_SOURCE_PACKAGE_FILE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_AUTHOR_SHORTNAME})


let the MIC compiler use CMAKE_MIC_C(XX)_FLAGS instead of CMAKE_C(XX)_FLAGS

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -25,7 +25,6 @@
 #
 # When MIC_NATIVE_FOUND is true you can use the macros
 # mic_add_definitions
-# mic_add_flags
 # mic_include_directories
 # mic_set_link_libraries
 # mic_add_library
@@ -144,17 +143,18 @@
          set(_mic_cflags ${_mic_cflags} "${_def}")
       endforeach()
    endmacro()
-   macro(mic_add_flags)
-      foreach(_flag ${ARGN})
-         set(_mic_cflags ${_mic_cflags} "${_flag}")
-      endforeach()
-   endmacro()
    macro(mic_include_directories)
       foreach(_dir ${ARGN})
          set(_mic_cflags ${_mic_cflags} "-I${_dir}")
       endforeach()
       include_directories(${ARGN})
    endmacro()
+   if(NOT DEFINED MIC_C_FLAGS)
+      set(MIC_C_FLAGS)
+   endif()
+   if(NOT DEFINED MIC_CXX_FLAGS)
+      set(MIC_CXX_FLAGS)
+   endif()
 else()
    message(WARNING "MIC SDK was not found!")
 endif()
@@ -165,24 +165,28 @@
       get_filename_component(_ext "${_source}" EXT)
       get_filename_component(_tmp "${_source}" NAME_WE)
       set(${_output} "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_target}.dir/${_tmp}${_ext}.mic.o")
+      set(_lang CXX)
       set(_compiler "${MIC_CXX}")
       if(_ext STREQUAL "c")
+         set(_lang C)
          set(_compiler "${MIC_CC}")
       endif()
-      set(_flags "${_mic_cflags}")
+
       string(TOUPPER "${CMAKE_BUILD_TYPE}" _tmp)
-      set(_tmp "CMAKE_CXX_FLAGS_${_tmp}")
-      string(REPLACE " " ";" _flags "${CMAKE_CXX_FLAGS} ${${_tmp}} ${_flags}")
+      string(STRIP "${CMAKE_MIC_${_lang}_FLAGS} ${CMAKE_${_lang}_FLAGS_${_tmp}} ${_mic_cflags}" _flags)
+      string(REPLACE " " ";" _flags "${_flags}")
+      message(STATUS "_mic_add_object _flags: ${_flags}")
       get_directory_property(_inc INCLUDE_DIRECTORIES)
       foreach(_i ${_inc})
          list(APPEND _flags "-I${_i}")
       endforeach()
+
       add_custom_command(OUTPUT "${${_output}}"
          COMMAND "${_compiler}" -mmic -fPIC
          -DVC_IMPL=MIC
          ${_flags} ${ARGN} -c -o "${${_output}}" "${_abs}"
          DEPENDS "${_abs}"
-         IMPLICIT_DEPENDS CXX "${_abs}"
+         IMPLICIT_DEPENDS ${_lang} "${_abs}"
          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
          COMMENT "Compiling (MIC) ${${_output}}"
          VERBATIM


Fix package_source build

Fix package_source build

--- build/Package.cmake
+++ build/Package.cmake
@@ -15,7 +15,7 @@

 # Sources
 set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_SOURCE_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES};.gitignore;.gitmodules;.git")
+set(CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR};\\\\.git/;\\\\.git$;\\\\.gitignore$;\\\\.gitmodules$;.*\\\\.swp;.*\\\\.pyc;__pycache__/")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${CMAKE_SYSTEM_PROCESSOR}_${LUA}")

 # Common


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 1665f959b9134e5eebdbbf56190e4782b7e280f7

--- cmake-modules/Fetch_Ceres.cmake
+++ cmake-modules/Fetch_Ceres.cmake
@@ -11,6 +11,7 @@
     message(STATUS "ceres will be installed into ${INSTALL_DIRECTORY}/ceres on first build.")
     get_target_property(EIGEN3_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
     get_target_property(GLOG_INCLUDE_DIR   glog::glog    INTERFACE_INCLUDE_DIRECTORIES)
+    get_target_property(GLOG_LIBRARY       glog::glog    INTERFACE_INCLUDE_DIRECTORIES)

     list (GET EIGEN3_INCLUDE_DIR 0 EIGEN3_INCLUDE_DIR)

@@ -46,6 +47,7 @@
             -DEIGEN_INCLUDE_DIR_HINTS:PATH=${EIGEN3_INCLUDE_DIR}
             -DEIGEN_PREFER_EXPORTED_EIGEN_CMAKE_CONFIGURATION:BOOL=OFF
             -DGLOG_INCLUDE_DIR:PATH=${GLOG_INCLUDE_DIR}
+            -DGLOG_LIBRARY:PATH=${GLOG_LIBRARY}
             -DLAPACK:BOOL=OFF
             -DEIGENSPARSE:BOOL=ON
             -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>


cmake: bintools: gnu: Suppress GDB check console outputs

The GDB check routine added in the PR #38749 does not suppress the
console outputs (stdout and stderr) and may print out a misleading
error message during a CMake configuration when the required version
of Python is not available on the system:

  arm-zephyr-eabi-gdb: error while loading shared libraries:
  libpython3.8.so.1.0: cannot open shared object file: No such file or
  directory

This commit adds the `OUTPUT_QUIET` and `ERROR_QUIET` options when
executing the GDB process so that the console outputs during the GDB
executable validation are not displayed to the user.

In addition, this commit removes the unused `GDB_PY_NO_PY` standard
output redirection variable since it is unnecessary.

Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>

--- cmake/bintools/gnu/target.cmake
+++ cmake/bintools/gnu/target.cmake
@@ -16,9 +16,9 @@
 if(CMAKE_GDB)
   execute_process(
     COMMAND ${CMAKE_GDB} --configuration
-    OUTPUT_VARIABLE GDB_PY_NO_PY
-    OUTPUT_STRIP_TRAILING_WHITESPACE
     RESULTS_VARIABLE GDB_CFG_ERR
+    OUTPUT_QUIET
+    ERROR_QUIET
     )
   if (${GDB_CFG_ERR})
     # Failed to execute GDB, likely because of Python deps


add hint to find_package(xlink) for local xlink

--- cmake/depthaiDependencies.cmake
+++ cmake/depthaiDependencies.cmake
@@ -70,7 +70,7 @@
     unset(_BUILD_SHARED_LIBS_SAVED)
     list(APPEND targets_to_export XLink)
 else()
-    find_package(XLink ${_QUIET} CONFIG REQUIRED HINTS "${CMAKE_CURRENT_LIST_DIR}/XLink")
+    find_package(XLink ${_QUIET} CONFIG REQUIRED HINTS "${CMAKE_CURRENT_LIST_DIR}/XLink" "${CMAKE_CURRENT_LIST_DIR}/../XLink")
 endif()

 # OpenCV 4 - (optional, quiet always)


Add usage of generate_char_array.cmake and fix variable names

--- cmake/generate_char_array.cmake
+++ cmake/generate_char_array.cmake
@@ -1,4 +1,15 @@
-file(READ ${CMAKE_ARGV3} hexdata HEX)
-string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1, " hex_split ${hexdata})
+# This script generates HEX formatted char array from input file.
+#
+# Usage:
+#   cmake -P generate_char_array.cmake <input file> <output file>
+#
+# Example of input file:
+#   This is a test
+#
+# Example of output file:
+#   0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65, 0x73, 0x74, 0x0a,
+#
+file(READ ${CMAKE_ARGV3} hex_data HEX)
+string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1, " hex_split ${hex_data})
 file(WRITE ${CMAKE_ARGV4} "/* Generated by generate_char_array.cmake */\n")
 file(APPEND ${CMAKE_ARGV4} ${hex_split})


ld_script: Add __tbss_align and __tdata_align to generated linker scripts

Scripts generated with ld_script.cmake also need to have the _align
symbols defined so that they work with TLS values.

Signed-off-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>

--- cmake/linker/ld/ld_script.cmake
+++ cmake/linker/ld/ld_script.cmake
@@ -311,6 +311,7 @@

   if(NOT nosymbols)
     set(TEMP "${TEMP}\n__${name_clean}_size = __${name_clean}_end - __${name_clean}_start;")
+    set(TEMP "${TEMP}\nPROVIDE(__${name_clean}_align = ALIGNOF(${name}));")
     set(TEMP "${TEMP}\n__${name_clean}_load_start = LOADADDR(${name});")
   endif()


Update CMake dependencies.

Update CMake dependencies.

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

--- cmake/modules/LLVMLibDeps.cmake
+++ cmake/modules/LLVMLibDeps.cmake
@@ -1,7 +1,7 @@
-set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMARMAsmPrinter LLVMARMCodeGen LLVMARMInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMARMCodeGen LLVMARMInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMARMInfo LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMAlphaAsmPrinter LLVMAlphaInfo LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMAlphaCodeGen LLVMAlphaInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMAlphaInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget)
@@ -10,12 +10,12 @@
 set(MSVC_LIB_DEPS_LLVMAsmPrinter LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMBitReader LLVMCore LLVMSupport LLVMSystem)
 set(MSVC_LIB_DEPS_LLVMBitWriter LLVMCore LLVMSupport LLVMSystem)
-set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMBlackfinAsmPrinter LLVMAsmPrinter LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMBlackfinCodeGen LLVMBlackfinInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMBlackfinInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMCBackend LLVMAnalysis LLVMCBackendInfo LLVMCodeGen LLVMCore LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa)
 set(MSVC_LIB_DEPS_LLVMCBackendInfo LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMCellSPUAsmPrinter LLVMAsmPrinter LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMCellSPUCodeGen LLVMCellSPUInfo LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMCellSPUInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMCodeGen LLVMAnalysis LLVMCore LLVMMC LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils)
@@ -32,26 +32,26 @@
 set(MSVC_LIB_DEPS_LLVMMC LLVMSupport LLVMSystem)
 set(MSVC_LIB_DEPS_LLVMMSIL LLVMAnalysis LLVMCodeGen LLVMCore LLVMMSILInfo LLVMScalarOpts LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa)
 set(MSVC_LIB_DEPS_LLVMMSILInfo LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMSP430Info LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMMSP430AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMMSP430CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMSP430Info LLVMSelectionDAG LLVMSupport LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMMSP430Info LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMMipsAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMMipsCodeGen LLVMMipsInfo LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMMipsCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMMipsInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMMipsInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMPIC16 LLVMAnalysis LLVMCodeGen LLVMCore LLVMMC LLVMPIC16Info LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
-set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMPIC16AsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPIC16 LLVMPIC16Info LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMPIC16Info LLVMSupport)
-set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMPowerPCInfo LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMPowerPCAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMPowerPCCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMPowerPCInfo LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMPowerPCInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMScalarOpts LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils)
 set(MSVC_LIB_DEPS_LLVMSelectionDAG LLVMAnalysis LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget)
-set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMSparcAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMSparcCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSparcInfo LLVMSupport LLVMSystem LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMSparcInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMSupport LLVMSystem)
 set(MSVC_LIB_DEPS_LLVMSystem )
-set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMSystemZInfo LLVMTarget)
+set(MSVC_LIB_DEPS_LLVMSystemZAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMSystemZInfo LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMSystemZCodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystemZInfo LLVMTarget)
 set(MSVC_LIB_DEPS_LLVMSystemZInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMTarget LLVMCore LLVMMC LLVMSupport LLVMSystem)
@@ -61,7 +61,7 @@
 set(MSVC_LIB_DEPS_LLVMX86CodeGen LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMX86Info)
 set(MSVC_LIB_DEPS_LLVMX86Info LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMXCore LLVMCodeGen LLVMCore LLVMMC LLVMSelectionDAG LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo)
-set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo)
+set(MSVC_LIB_DEPS_LLVMXCoreAsmPrinter LLVMAsmPrinter LLVMCodeGen LLVMCore LLVMMC LLVMSupport LLVMSystem LLVMTarget LLVMXCoreInfo)
 set(MSVC_LIB_DEPS_LLVMXCoreInfo LLVMSupport)
 set(MSVC_LIB_DEPS_LLVMipa LLVMAnalysis LLVMCore LLVMSupport LLVMSystem)
 set(MSVC_LIB_DEPS_LLVMipo LLVMAnalysis LLVMCore LLVMSupport LLVMSystem LLVMTarget LLVMTransformUtils LLVMipa)


liboro 0.7.6 - Increased the coverage of oro-server methods

New RPC methods that are now supported:
- update
- updateForAgent
- clear
- clearForAgent

+ usual bugfixing.

--- conf/LiboroVersion.cmake
+++ conf/LiboroVersion.cmake
@@ -4,4 +4,4 @@

 SET(CPACK_PACKAGE_VERSION_MAJOR "0")
 SET(CPACK_PACKAGE_VERSION_MINOR "7")
-SET(CPACK_PACKAGE_VERSION_PATCH "4")
+SET(CPACK_PACKAGE_VERSION_PATCH "6")


Do not bundle ANGLE with the Windows installer.


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -526,31 +526,31 @@
 			if(VALGRIND)
 				add_test(
 					NAME ${_TEST_NAME}_memcheck
-					COMMAND "${VALGRIND}" --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes $<TARGET_FILE:${_TEST_NAME}> --gmock_verbose=info
+					COMMAND "${VALGRIND}" --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
 					WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE}
 					)
 				add_test(
 					NAME ${_TEST_NAME}_cachegrind
-					COMMAND "${VALGRIND}" --tool=cachegrind $<TARGET_FILE:${_TEST_NAME}> --gmock_verbose=info
+					COMMAND "${VALGRIND}" --tool=cachegrind $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
 					WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE}
 					)
 				add_test(
 					NAME ${_TEST_NAME}_helgrind
-					COMMAND "${VALGRIND}" --tool=helgrind $<TARGET_FILE:${_TEST_NAME}> --gmock_verbose=info
+					COMMAND "${VALGRIND}" --tool=helgrind $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
 					WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE}
 					)
 				add_test(
 					NAME ${_TEST_NAME}_callgrind
-					COMMAND "${VALGRIND}" --tool=callgrind $<TARGET_FILE:${_TEST_NAME}> --gmock_verbose=info
+					COMMAND "${VALGRIND}" --tool=callgrind $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
 					WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE}
 					)
 				add_test(
 					NAME ${_TEST_NAME}_drd
-					COMMAND "${VALGRIND}" --tool=drd --read-var-info=yes $<TARGET_FILE:${_TEST_NAME}> --gmock_verbose=info
+					COMMAND "${VALGRIND}" --tool=drd --read-var-info=yes $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
 					WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE}
 					)
@@ -560,7 +560,7 @@
 		else()
 			add_test(
 				NAME ${_TEST_NAME}_test
-				COMMAND $<TARGET_FILE:${_TEST_NAME}> --gmock_verbose=info
+				COMMAND $<TARGET_FILE:${_TEST_NAME}_exe> --gmock_verbose=info
 				WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 				CONFIGURATIONS ${BUILD_TYPE}
 				)


Wrapped PREFIX variable in quotes to avoid issues with empty string

--- config/config.cmake
+++ config/config.cmake
@@ -84,9 +84,9 @@
 set(libdir ${BD}/../lib)
 set(incdir ${BD}/../include)
 else(WIN32)
-IF(${PREFIX} STREQUAL "")
+IF("${PREFIX}" STREQUAL "")
 set(PREFIX /usr/local)
-endif(${PREFIX} STREQUAL "")
+endif("${PREFIX}" STREQUAL "")
 set(bindir ${PREFIX}/bin)
 set(libdir ${PREFIX}/lib)
 set(incdir ${PREFIX}/include)


Added gcc -pthread flag

Added gcc -pthread flag

--- config/config.cmake
+++ config/config.cmake
@@ -52,7 +52,7 @@
     SET(WORDSIZE "WORDSIZE64")
   ENDIF(UNAMEM STREQUAL "x86_64")

-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic -fPIC")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpic -fPIC -pthread")

   IF (CLANG)
     SET(LIBS ${LIBS} "dl pthread")


biogeme cmake

biogeme cmake

--- src/cmake/Modules/FindBiogeme.cmake
+++ src/cmake/Modules/FindBiogeme.cmake
@@ -25,13 +25,13 @@
     )

   find_library( LIB_UTILS
-    NAMES NAMES utils libutils patUtils libutils.la utils.la
+    NAMES NAMES utils libutils patUtils libutils.la utils.la libutils.a
     PATHS
       ${BIOGEME_POSSIBLE_ROOT_DIRS}
   )

     find_library(LIB_PARAMETERS
-                    NAMES param libparameters patParams parameters libparameters.la  parameters.la
+                    NAMES param libparameters patParams parameters libparameters.la  parameters.la libparameters.a
                     PATHS
                           ${BIOGEME_POSSIBLE_ROOT_DIRS})


fix findlibtm cmake for debug libs.

fix findlibtm cmake for debug libs.

--- CMake/Findlibtm.cmake
+++ CMake/Findlibtm.cmake
@@ -42,7 +42,7 @@
 # Look for the library debug flavor.
 find_library(LIBTM_LIBRARY_DEBUG
 	NAMES
-	tmd
+	tm
 	HINTS
 	"${LIBTM_DIR}/bin/Debug"
 	)
@@ -57,7 +57,7 @@
 # Look for the library debug flavor.
 find_library(INFRA_LIBRARY_DEBUG
 	NAMES
-	infrad
+	infra
 	HINTS
 	"${LIBTM_DIR}/bin/Debug"
 	)


Fix Release builds on OS X

Fix Release builds on OS X

--- CMake/Utilities.cmake
+++ CMake/Utilities.cmake
@@ -3,7 +3,7 @@
 #

 macro(stagedebug target)
-  if(NOT(CMAKE_BUILD_TYPE STREQUAL ""))
+  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
     if(APPLE)
       add_custom_command(TARGET ${target}
         POST_BUILD
@@ -13,7 +13,7 @@
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
         VERBATIM)
     endif(APPLE)
-  endif(NOT(CMAKE_BUILD_TYPE STREQUAL ""))
+  endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
 endmacro()

 MACRO(SOURCE_GROUP_BY_FOLDER target)


Add new platform in src/Native/Runtime/unix/configure.cmake: NetBSD

--- src/Native/Runtime/unix/configure.cmake
+++ src/Native/Runtime/unix/configure.cmake
@@ -905,7 +905,28 @@
   else()
     message(FATAL_ERROR "Cannot find libc on this system.")
   endif()
-
+
+elseif(CMAKE_SYSTEM_NAME STREQUAL NetBSD)
+  if(NOT HAVE_LIBUNWIND_H)
+    unset(HAVE_LIBUNWIND_H CACHE)
+    message(WARNING "Cannot find libunwind. Try installing libunwind8 and libunwind8-dev (or the appropriate packages for your platform)")
+  endif()
+  if(NOT HAVE_BSD_UUID_H)
+    unset(HAVE_BSD_UUID_H CACHE)
+    message(FATAL_ERROR "Cannot find uuid.h")
+  endif()
+  set(DEADLOCK_WHEN_THREAD_IS_SUSPENDED_WHILE_BLOCKED_ON_MUTEX 0)
+  set(PAL_PTRACE "ptrace((cmd), (pid), (void*)(addr), (data))")
+  set(PAL_PT_ATTACH PT_ATTACH)
+  set(PAL_PT_DETACH PT_DETACH)
+  set(PAL_PT_READ_D PT_READ_D)
+  set(PAL_PT_WRITE_D PT_WRITE_D)
+  set(USE_SIGNALS_FOR_THREAD_SUSPENSION 1)
+  set(JA_JP_LOCALE_NAME ja_JP_LOCALE_NOT_FOUND)
+  set(KO_KR_LOCALE_NAME ko_KR_LOCALE_NOT_FOUND)
+  set(ZH_TW_LOCALE_NAME zh_TW_LOCALE_NOT_FOUND)
+  set(HAS_FTRUNCATE_LENGTH_ISSUE 0)
+
 else() # Anything else is Linux
   if(NOT HAVE_LIBUNWIND_H)
     unset(HAVE_LIBUNWIND_H CACHE)


Remove debug message

Remove debug message

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -149,7 +149,6 @@
 ## Workaround for Bug 1115136 otherwise el7 won't work
 RELEASE_FEDORA_FIND_DEPENDENCY(BODHI-CLIENT_EXECUTABLE bodhi client.py
     PATHS "/usr/bin/bodhi")
-MESSAGE("CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH=${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH}")
 RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_KOJI_EXECUTABLE "cmake-fedora-koji"
     PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH} NO_DEFAULT_PATH)
 RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_FEDPKG_EXECUTABLE "cmake-fedora-fedpkg"


COMP: Fixing instantiation of templated functions.

To address compilation errors from MacOSX-gcc4.2-Release-IOSTL.

The build in the Mac does not honor the instantiation of templated
functions based on the type of the  argument. This change added the
explicit use of the template argument in the name of the function.

Change-Id: I94d09775f6e1d645e1a60746e71522697470f6c4

--- Modules/Remote/IOSTL.remote.cmake
+++ Modules/Remote/IOSTL.remote.cmake
@@ -3,5 +3,5 @@
   "This module contains classes for reading and writing QuadEdgeMeshes using
   the STL (STereoLithography)file format. http://hdl.handle.net/10380/3452"
   GIT_REPOSITORY https://github.com/luisibanez/ITKSTLMeshIO.git
-  GIT_TAG 76f994628acab8f32d0638ac845f7692c5bdc096
+  GIT_TAG dd92020fa5b2c17e32f7b90ef8d285832ada8b0f
   )


fix: get_filename_component support for PROGRAM_ARGS and BASE_DIR [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -1100,35 +1100,38 @@
 #
 # @sa http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:get_filename_component
 # @sa basis_get_filename_component()
-function (get_filename_component)
-  if (ARGC LESS 3)
-    message (FATAL_ERROR "[basis_]get_filename_component(): At least three arguments required!")
-  elseif (ARGC GREATER 4)
-    message (FATAL_ERROR "[basis_]get_filename_component(): Too many arguments!")
-  endif ()
-  list (GET ARGN 0 VAR)
-  list (GET ARGN 1 STR)
-  list (GET ARGN 2 CMD)
-  if (CMD MATCHES "^EXT")
-    _get_filename_component (${VAR} "${STR}" ${CMD})
+function (get_filename_component VAR STR CMP)
+  list (FIND ARGN "CACHE" IDX)
+  if (IDX EQUAL -1)
+    set (OPT_CACHE 0)
+  else ()
+    list (REMOVE_ITEM ARGN "CACHE")
+    set (OPT_CACHE 1)
+  endif ()
+  if (CMP MATCHES "^EXT")
+    _get_filename_component (${VAR} "${STR}" ${CMP} ${ARGN})
     string (REGEX MATCHALL "\\.[^.]*" PARTS "${${VAR}}")
     list (LENGTH PARTS LEN)
     if (LEN GREATER 1)
       math (EXPR LEN "${LEN} - 1")
       list (GET PARTS ${LEN} ${VAR})
     endif ()
-  elseif (CMD MATCHES "NAME_WE")
-    _get_filename_component (${VAR} "${STR}" NAME)
+  elseif (CMP MATCHES "NAME_WE")
+    _get_filename_component (${VAR} "${STR}" NAME ${ARGN})
     string (REGEX REPLACE "\\.[^.]*$" "" ${VAR} ${${VAR}})
   else ()
-    _get_filename_component (${VAR} "${STR}" ${CMD})
-  endif ()
-  if (ARGC EQUAL 4)
-    if (NOT "^${ARGV3}$" STREQUAL "^CACHE$")
-      message (FATAL_ERROR "[basis_]get_filename_component(): Invalid fourth argument: ${ARGV3}!")
-    else ()
-      set (${VAR} "${${VAR}}" CACHE STRING "")
-    endif ()
+    _get_filename_component (${VAR} "${STR}" ${CMP} ${ARGN})
+    if (CMP MATCHES "PROGRAM")
+      list (FIND ARGN "PROGRAM_ARGS" IDX)
+      if (NOT IDX EQUAL -1)
+        math (EXPR IDX "${IDX} + 1")
+        list (GET ARGN ${IDX} ARG_VAR)
+        set (${ARG_VAR} "${${ARG_VAR}}" PARENT_SCOPE)
+      endif ()
+    endif ()
+  endif ()
+  if (OPT_CACHE)
+    set (${VAR} "${${VAR}}" CACHE STRING "")
   else ()
     set (${VAR} "${${VAR}}" PARENT_SCOPE)
   endif ()