[CMake] Fix llvm_setup_rpath function

[CMake] Fix llvm_setup_rpath function

Summary:
Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
INSTALL_RPATH is set to CMAKE_INSTALL_RPATH.
The "if(NOT DEFINED CMAKE_INSTALL_RPATH)" was missing a corresponding else
clause.
This also cleans up the fix made in r285908.

Patch by Azharuddin Mohammed

Reviewers: john.brawn, sgundapa, beanz

Subscribers: chapuni, mgorny, llvm-commits

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1302,6 +1302,10 @@
 endfunction()

 function(llvm_setup_rpath name)
+  if(CMAKE_INSTALL_RPATH)
+    return()
+  endif()
+
   if(LLVM_INSTALL_PREFIX AND NOT (LLVM_INSTALL_PREFIX STREQUAL CMAKE_INSTALL_PREFIX))
     set(extra_libdir ${LLVM_LIBRARY_DIR})
   elseif(LLVM_BUILD_LIBRARY_DIR)
@@ -1312,16 +1316,14 @@
     set(_install_name_dir INSTALL_NAME_DIR "@rpath")
     set(_install_rpath "@loader_path/../lib" ${extra_libdir})
   elseif(UNIX)
-    if(NOT DEFINED CMAKE_INSTALL_RPATH)
-      set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
-      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)
-        # $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} ")
-      endif()
+    set(_install_rpath "\$ORIGIN/../lib${LLVM_LIBDIR_SUFFIX}" ${extra_libdir})
+    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)
+      # $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} ")
     endif()
   else()
     return()


cmake: Fix 'examples' target after r225319

Add the missing `DEPENDS` keyword.  r225319 did almost the right thing
(I didn't notice the problem with it because `Kaleidoscope-Ch8` wasn't
building at all).

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -515,7 +515,7 @@
   set_target_properties(${name} PROPERTIES FOLDER "Examples")

   if(NOT TARGET examples)
-    add_custom_target(examples ${name})
+    add_custom_target(examples DEPENDS ${name})
   else()
     add_dependencies(examples ${name})
   endif()


Fix a link issue I ran into trying compiling LLVM on MinGW with CMake.
Hopefully this doesn't break anyone else's build... it shouldn't unless
the MinGW variable means something other than compiling with MinGW.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -31,7 +31,7 @@
   else( MSVC )
     add_dependencies(${name} llvm-config.target)
     if( MINGW )
-      target_link_libraries(${name} DbgHelp psapi)
+      target_link_libraries(${name} imagehlp psapi)
     elseif( CMAKE_HOST_UNIX )
       target_link_libraries(${name} dl)
     endif( MINGW )


change some variables to make it more clear - when comparing with swift/master - what exactly changed. In short: the first loop used ${MODULE} in uppercase when setting the INCLUDE paths, while the second loop used ${MODULE} in lowercase to retrieve the INCLUDE paths. This can't have worked. Also, there was a discrepancy for the first and second loop where *_INCLUDE_DIR vs *_INCLUDE_DIRS was used. Again, this cannot have worked (just try in the currenct swift/master code, surround the code with some message(STATUS ...) lines)

--- cmake/modules/FindICU.cmake
+++ cmake/modules/FindICU.cmake
@@ -5,34 +5,34 @@
 find_package(PkgConfig)

 set(ICU_REQUIRED)
-foreach(FIND_COMP_ITEM ${ICU_FIND_COMPONENTS})
-  string(TOUPPER "${FIND_COMP_ITEM}" UMODULE)
-  string(TOLOWER "${FIND_COMP_ITEM}" LMODULE)
+foreach(MODULE ${ICU_FIND_COMPONENTS})
+  string(TOUPPER "${MODULE}" MODULE)
+  string(TOLOWER "${MODULE}" module)
   list(APPEND ICU_REQUIRED
-    ICU_${UMODULE}_INCLUDE_DIR ICU_${UMODULE}_LIBRARIES)
+    ICU_${MODULE}_INCLUDE_DIR ICU_${MODULE}_LIBRARIES)

-  pkg_check_modules(PC_ICU_${UMODULE} QUIET icu-${LMODULE})
-  if(${PC_ICU_${UMODULE}_FOUND})
-    set(ICU_${UMODULE}_DEFINITIONS ${PC_ICU_${UMODULE}_CFLAGS_OTHER})
+  pkg_check_modules(PC_ICU_${MODULE} QUIET icu-${module})
+  if(${PC_ICU_${MODULE}_FOUND})
+    set(ICU_${MODULE}_DEFINITIONS ${PC_ICU_${MODULE}_CFLAGS_OTHER})

-    find_path(ICU_${UMODULE}_INCLUDE_DIR unicode
-      HINTS ${PC_ICU_${UMODULE}_INCLUDEDIR} ${PC_ICU_${UMODULE}_INCLUDE_DIRS})
-    set(ICU_${UMODULE}_INCLUDE_DIRS ${ICU_${UMODULE}_INCLUDE_DIR})
+    find_path(ICU_${MODULE}_INCLUDE_DIR unicode
+      HINTS ${PC_ICU_${MODULE}_INCLUDEDIR} ${PC_ICU_${MODULE}_INCLUDE_DIRS})
+    set(ICU_${MODULE}_INCLUDE_DIRS ${ICU_${MODULE}_INCLUDE_DIR})

-    find_library(ICU_${UMODULE}_LIBRARY NAMES icu${LMODULE}
-      HINTS ${PC_ICU_${UMODULE}_LIBDIR} ${PC_ICU_${UMODULE}_LIBRARY_DIRS})
-    set(ICU_${UMODULE}_LIBRARIES ${ICU_${UMODULE}_LIBRARY})
+    find_library(ICU_${MODULE}_LIBRARY NAMES icu${module}
+      HINTS ${PC_ICU_${MODULE}_LIBDIR} ${PC_ICU_${MODULE}_LIBRARY_DIRS})
+    set(ICU_${MODULE}_LIBRARIES ${ICU_${MODULE}_LIBRARY})
   endif()
 endforeach()

 foreach(sdk ANDROID;FREEBSD;LINUX;WINDOWS)
-  foreach(ITEM ${ICU_FIND_COMPONENTS})
-    string(TOUPPER "${ITEM}" UMODULE)
-    if("${SWIFT_${sdk}_ICU_${UMODULE}_INCLUDE}" STREQUAL "")
-      set(SWIFT_${sdk}_ICU_${UMODULE}_INCLUDE ${ICU_${UMODULE}_INCLUDE_DIRS})
+  foreach(MODULE ${ICU_FIND_COMPONENTS})
+    string(TOUPPER "${MODULE}" MODULE)
+    if("${SWIFT_${sdk}_ICU_${MODULE}_INCLUDE}" STREQUAL "")
+      set(SWIFT_${sdk}_ICU_${MODULE}_INCLUDE ${ICU_${MODULE}_INCLUDE_DIRS})
     endif()
-    if("${SWIFT_${sdk}_ICU_${UMODULE}}" STREQUAL "")
-      set(SWIFT_${sdk}_ICU_${UMODULE} ${ICU_${UMODULE}_LIBRARY})
+    if("${SWIFT_${sdk}_ICU_${MODULE}}" STREQUAL "")
+      set(SWIFT_${sdk}_ICU_${MODULE} ${ICU_${MODULE}_LIBRARY})
     endif()
   endforeach()
 endforeach()


[Hexagon] Don't use cmake glob for auto-generated source files (#10259)

* [Hexagon] Don't use cmake glob for auto-generated source files

Glob treats inputs as patterns: if the file with a given name
does not exist (is to be generated later), it won't be added to
the output.

* Restart CI

--- cmake/modules/Hexagon.cmake
+++ cmake/modules/Hexagon.cmake
@@ -209,6 +209,10 @@
     file_glob_append(RUNTIME_HEXAGON_SRCS
       "${TVMRT_SOURCE_DIR}/hexagon/host/*.cc"
       "${TVMRT_SOURCE_DIR}/hexagon/rpc/android/*.cc"
+    )
+    # Add this file separately, because it's auto-generated, and glob won't
+    # find it during cmake-time.
+    list(APPEND RUNTIME_HEXAGON_SRCS
       "${TVMRT_SOURCE_DIR}/hexagon/rpc/hexagon_rpc_stub.c"
     )
     list(APPEND TVM_RUNTIME_LINKER_LIBS cdsprpc)


update(plugins): updated json plugin to latest v0.2.2.

Signed-off-by: Federico Di Pierro <6c3e26470d5343bb7a522873746c21bb7fcc0d20@gmail.com>

--- cmake/modules/plugins.cmake
+++ cmake/modules/plugins.cmake
@@ -27,8 +27,8 @@

 ExternalProject_Add(
   json-plugin
-  URL "https://download.falco.org/plugins/stable/json-0.2.1-${PLUGINS_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}.tar.gz"
-  URL_HASH "SHA256=14d1cf4c3c651af0daec7a45162ef91172d6f0baba787f0eff0227b3cf2ca39c"
+  URL "https://download.falco.org/plugins/stable/json-0.2.2-${PLUGINS_SYSTEM_NAME}-${CMAKE_HOST_SYSTEM_PROCESSOR}.tar.gz"
+  URL_HASH "SHA256=83eb411c9f2125695875b229c6e7974e6a4cc7f028be146b79d26db30372af5e"
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
   INSTALL_COMMAND "")


Don't check for FIONREAD on windows. Execution of platforms tests are slow/flaky when building on windows. in PB:mysql-next-mr-opt-team on 2011-05-18 for win x86 debug_max, i see: -- Looking for FIONREAD -- Looking for FIONREAD - found and the build fails.

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -341,6 +341,7 @@
 SET(C_HAS_inline CACHE INTERNAL "")
 SET(C_HAS___inline 1 CACHE INTERNAL "")
 SET(FIONREAD_IN_SYS_IOCTL CACHE INTERNAL "")
+SET(FIONREAD_IN_SYS_FILIO CACHE INTERNAL "")
 SET(GWINSZ_IN_SYS_IOCTL CACHE INTERNAL "")
 SET(HAVE_CXXABI_H CACHE INTERNAL "")
 SET(HAVE_NDIR_H CACHE INTERNAL "")


Renamed `do_unit_test macro` as `do_test`.

--- cmake/DOMacros.cmake
+++ cmake/DOMacros.cmake
@@ -247,7 +247,7 @@
 # ==============================================================================
 # Specific macro to add a unit test
 #
-function (do_unit_test _unit_test_name _srcs _additional_lib_deps)
+function (do_test _test_name _srcs _additional_lib_deps)
   if (POLICY CMP0020)
     cmake_policy(SET CMP0020 OLD)
   endif (POLICY CMP0020)
@@ -272,27 +272,27 @@
   if (DEFINED pch)
     do_substep_message(
       "Activating precompiled header: '${pch}' for unit test: "
-      "'DO_${_unit_test_name}_test'"
+      "'DO_${_test_name}_test'"
     )
     list(APPEND _srcs_var ${pch})
-    do_add_msvc_precompiled_header(${pch} _srcs_var ${_unit_test_name}_test_PCH)
+    do_add_msvc_precompiled_header(${pch} _srcs_var ${_test_name}_test_PCH)
   endif ()

   # Create the unit test project
   include_directories(${gtest_DIR}/include)
-  add_executable(${_unit_test_name} ${_srcs_var})
-  target_link_libraries(${_unit_test_name}
+  add_executable(${_test_name} ${_srcs_var})
+  target_link_libraries(${_test_name}
                         ${_additional_lib_deps}
                         gtest)
   set_target_properties(
-    ${_unit_test_name} PROPERTIES
+    ${_test_name} PROPERTIES
     COMPILE_FLAGS "${ENABLE_CXX11} -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR}"
     COMPILE_DEFINITIONS DO_STATIC)
-  add_test(${_unit_test_name}
-           "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_unit_test_name}")
+  add_test(${_test_name}
+           "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_test_name}")

   if (DEFINED test_group_name)
-    set_property(TARGET ${_unit_test_name}
-                 PROPERTY FOLDER "DO Unit Tests/${test_group_name}")
-  endif ()
-endfunction (do_unit_test)
+    set_property(TARGET ${_test_name}
+                 PROPERTY FOLDER "DO Tests/${test_group_name}")
+  endif ()
+endfunction (do_test)


take include flags from INCLUDE_DIRECTORIES property

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -389,7 +389,12 @@
    # make a semicolon separated list of all flags
    string(TOUPPER "${CMAKE_BUILD_TYPE}" _tmp)
    set(_tmp "CMAKE_CXX_FLAGS_${_tmp}")
-   string(REPLACE " " ";" _flags "${CMAKE_CXX_FLAGS} ${${_tmp}} ${_flags} ${ARGN} -I${CMAKE_CURRENT_SOURCE_DIR}/include/ -I${CMAKE_CURRENT_SOURCE_DIR}/")
+   string(REPLACE " " ";" _flags "${CMAKE_CXX_FLAGS} ${${_tmp}} ${_flags} ${ARGN}")
+   get_directory_property(_inc INCLUDE_DIRECTORIES)
+   foreach(_i ${_inc})
+      list(APPEND _flags "-I${_i}")
+   endforeach()
+   message(STATUS "_flags: ${_flags}")

    set(_vc_compile_src "${_src}")


Merging request #72.

Merging request #72.

--- cmake/dtkBuild.cmake
+++ cmake/dtkBuild.cmake
@@ -4,9 +4,9 @@
 ## Copyright (C) 2008 - Julien Wintz, Inria.
 ## Created: Fri Apr  2 09:05:55 2010 (+0200)
 ## Version: $Id$
-## Last-Updated: Mon Jul 11 11:00:39 2011 (+0200)
-##           By: Thibaud Kloczko
-##     Update #: 188
+## Last-Updated: Mon Jul 18 09:26:16 2011 (+0200)
+##           By: Julien Wintz
+##     Update #: 190
 ######################################################################
 ##
 ### Commentary:
@@ -80,13 +80,13 @@
 set(RUNTIME_INSTALL_OUTPUT_PATH    ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_RUNTIME_OUTPUT_DIRECTORY})
 set(EXECUTABLE_INSTALL_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_RUNTIME_OUTPUT_DIRECTORY})

-set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR})
+set(${PROJECT_NAME}_INCLUDE_DIRS ${${PROJECT_NAME}_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src ${PROJECT_BINARY_DIR})
 set(${PROJECT_NAME}_LIBRARY_DIRS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
 set(${PROJECT_NAME}_RUNTIME_DIRS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
 set(${PROJECT_NAME}_CMAKE_DIRS ${PROJECT_SOURCE_DIR}/cmake)
 set(${PROJECT_NAME}_USE_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Use.cmake)

-set(${PROJECT_NAME}_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
+set(${PROJECT_NAME}_INSTALL_INCLUDE_DIRS ${${PROJECT_NAME}_INSTALL_INCLUDE_DIRS} ${CMAKE_INSTALL_PREFIX}/include)
 set(${PROJECT_NAME}_INSTALL_LIBRARY_DIRS ${LIBRARY_INSTALL_OUTPUT_PATH})
 set(${PROJECT_NAME}_INSTALL_RUNTIME_DIRS ${RUNTIME_INSTALL_OUTPUT_PATH})
 set(${PROJECT_NAME}_INSTALL_CMAKE_DIRS ${CMAKE_INSTALL_PREFIX}/cmake)


Release v0.3.2

Release v0.3.2

--- cmake/packages.cmake
+++ cmake/packages.cmake
@@ -23,7 +23,7 @@
 endif ()

 set (PACKAGE_NAME        "${CMAKE_PROJECT_NAME}")
-set (PACKAGE_VERSION     "0.3.1.${GIT_CHECKIN_COUNT}")
+set (PACKAGE_VERSION     "0.3.2.${GIT_CHECKIN_COUNT}")
 set (PACKAGE_STRING      "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set (PACKAGE_TARNAME     "${PACKAGE_NAME}-${PACKAGE_VERSION}")
 set (PACKAGE_BUGREPORT   "https://github.com/Qihoo360/evpp/issues")


Fix autolayout issue macOS 10.15 (#44)

Fix autolayout issue macOS 10.15 (#44)

IB-6463

Signed-off-by: Raul Metsma <8b52b6b714585648fd300da0dbc0fa0678553280@metsma.ee>

--- prefPane/Info.plist.cmake
+++ prefPane/Info.plist.cmake
@@ -34,7 +34,5 @@
 	<string>ID_updater</string>
 	<key>NSRequiresAquaSystemAppearance</key>
 	<false/>
-	<key>NSPrefPaneSupportsAutoLayout</key>
-	<true/>
 </dict>
 </plist>


SuperBuild: save from a if loop. exit if patch command is not found

--- SuperBuild/CMake/patch.cmake
+++ SuperBuild/CMake/patch.cmake
@@ -1,46 +1,48 @@

 find_program(PATCH_PROGRAM NAMES patch)
-if(PATCH_PROGRAM)
-  set(OPTS)
-  if(WIN32)
-    set(OPTS "--binary")
-  endif()
-
-  separate_arguments(DOT_DIFF_FILES)
-
-  list(SORT DOT_DIFF_FILES)
-
-  foreach(dot_diff_file ${DOT_DIFF_FILES})
-    message("Input patch file: ${dot_diff_file}")
-    execute_process(
-      COMMAND
-      ${CMAKE_COMMAND} -E chdir ${SOURCE_DIR}
-      ${PATCH_PROGRAM} "-p1" "-i" "${dot_diff_file}" ${OPTS}
-      RESULT_VARIABLE patch_rv
-      OUTPUT_VARIABLE patch_ov
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      ERROR_STRIP_TRAILING_WHITESPACE)
-    set(PATCHING_FAILED FALSE)
-    if(NOT "${patch_rv}" STREQUAL "0")
-      if( NOT "${patch_ov}" MATCHES "previously applied")
-        set(PATCHING_FAILED TRUE)
-      endif()
-    endif()
-
-    if( "${patch_ov}" MATCHES "FAILED")
-      set(PATCHING_FAILED TRUE)
-    endif()
-
-    if(PATCHING_FAILED)
-      message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status \n ${patch_ov} \n")
-    else()
-      message("${patch_ov}")
-    endif()
-
-    unset(patch_rv)
-    unset(patch_ov)
-  endforeach()
-else()
+if(NOT PATCH_PROGRAM)
   message(FATAL_ERROR "patch program not found. PATCH_PROGRAM. search names :' patch'")
 endif()

+set(OPTS)
+if(WIN32)
+  set(OPTS "--binary")
+endif()
+
+separate_arguments(DOT_DIFF_FILES)
+
+list(SORT DOT_DIFF_FILES)
+
+foreach(dot_diff_file ${DOT_DIFF_FILES})
+  message("Input patch file: ${dot_diff_file}")
+  execute_process(
+    COMMAND
+    ${CMAKE_COMMAND} -E chdir ${SOURCE_DIR}
+    ${PATCH_PROGRAM} "-p1" "-i" "${dot_diff_file}" ${OPTS}
+    RESULT_VARIABLE patch_rv
+    OUTPUT_VARIABLE patch_ov
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    ERROR_STRIP_TRAILING_WHITESPACE)
+
+  set(PATCHING_FAILED FALSE)
+
+  if(NOT "${patch_rv}" STREQUAL "0")
+    if( NOT "${patch_ov}" MATCHES "previously applied")
+      set(PATCHING_FAILED TRUE)
+    endif()
+  endif()
+
+  if( "${patch_ov}" MATCHES "FAILED")
+    set(PATCHING_FAILED TRUE)
+  endif()
+
+  if(PATCHING_FAILED)
+    message(FATAL_ERROR "${PATCH_PROGRAM} returned non-zero exit status \n ${patch_ov} \n")
+  else()
+    message("${patch_ov}")
+  endif()
+
+  unset(patch_rv)
+  unset(patch_ov)
+endforeach()
+


enh: Support alternative versions for basis_find_package [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -83,7 +83,7 @@
 #
 # This function parses a dependency specification such as
 # "ITK-4.1{TestKernel,IO}" into the package name, i.e., ITK, the requested
-# (minimum) package version, i.e., 4.1, and a list of package components, i.e.,
+# (minimum) package version(s), i.e., 4.1, and a list of package components, i.e.,
 # TestKernel and IO. A valid dependency specification must specify the package
 # name of the dependency (case-sensitive). The version and components
 # specification are optional. Note that the components specification may
@@ -97,9 +97,11 @@
 # }
 # @endcode
 #
-# @param [in]  DEP Dependency specification, i.e., "<Pkg>[-<version>][{<Component1>[,...]}]".
+# VTK-7|6{}
+#
+# @param [in]  DEP Dependency specification, i.e., "<Pkg>[-<version>[|...]][{<Component1>[,...]}]".
 # @param [out] PKG Package name.
-# @param [out] VER Package version.
+# @param [out] VER Package version(s).
 # @param [out] CMP List of package components.
 function (basis_tokenize_dependency DEP PKG VER CMP)
   set (CMPS)
@@ -111,9 +113,10 @@
       list (APPEND CMPS ${C})
     endforeach ()
   endif ()
-  if (DEP MATCHES "^(.*)-([0-9]+)(\\.[0-9]+)?(\\.[0-9]+)?(\\.[0-9]+)?$")
+  if (DEP MATCHES "^([^-]*)-(.*)$")
+    string (REPLACE "|" ";" CMAKE_MATCH_2 "${CMAKE_MATCH_2}")
     set (${PKG} "${CMAKE_MATCH_1}" PARENT_SCOPE)
-    set (${VER} "${CMAKE_MATCH_2}${CMAKE_MATCH_3}${CMAKE_MATCH_4}${CMAKE_MATCH_5}" PARENT_SCOPE)
+    set (${VER} "${CMAKE_MATCH_2}" PARENT_SCOPE)
   else ()
     set (${PKG} "${DEP}" PARENT_SCOPE)
     set (${VER} ""       PARENT_SCOPE)
@@ -178,6 +181,7 @@
     endif ()
     set (VER "${CMAKE_MATCH_0}")
   endif ()
+  list (LENGTH VER _num_versions)
   # ------------------------------------------------------------------------
   # some debugging output
   if (BASIS_DEBUG)
@@ -404,7 +408,7 @@
           if (ARGN_EXACT)
             list (APPEND FIND_ARGN "EXACT")
           endif ()
-          if (ARGN_QUIET)
+          if (ARGN_QUIET OR "^${PKG}$" STREQUAL "^Boost$")
             list (APPEND FIND_ARGN "QUIET")
           endif ()
           if (FIND_ADDITIONAL_COMPONENTS)
@@ -412,11 +416,23 @@
           endif ()
           if (PKG MATCHES "^(MFC|wxWidgets)$")
             # if Find<Pkg>.cmake prints status message, don't do it here
-            find_package (${PKG} ${VER} ${FIND_ARGN})
+            if (${_num_versions} GREATER 1)
+              foreach (_version ${VER})
+                find_package (${PKG} ${_version} QUIET ${FIND_ARGN} NO_MODULE)
+                if (${PKG}_FOUND)
+                  break ()
+                endif ()
+              endforeach ()
+              unset (_version)
+            else ()
+              find_package (${PKG} ${VER} ${FIND_ARGN})
+            endif ()
           else ()
             set (_STATUS "Looking for ${PKG}")
             if (VER)
-              set (_STATUS "${_STATUS} ${VER}")
+              string (REPLACE ";" " or " _version_status "${VER}")
+              set (_STATUS "${_STATUS} ${_version_status}")
+              unset (_version_status)
             endif ()
             if (FIND_ADDITIONAL_COMPONENTS)
               set (_STATUS "${_STATUS} [${FIND_ADDITIONAL_COMPONENTS}]")
@@ -426,7 +442,20 @@
             endif ()
             set (_STATUS "${_STATUS}...")
             message (STATUS "${_STATUS}")
-            find_package (${PKG} ${VER} ${FIND_ARGN})
+            if (${_num_versions} GREATER 1)
+              foreach (_version ${VER})
+                find_package (${PKG} ${_version} QUIET ${FIND_ARGN} NO_MODULE)
+                if (${PKG}_FOUND)
+                  if (NOT ARGN_QUIET)
+                    find_package (${PKG} ${_version} ${FIND_ARGN} NO_MODULE)
+                  endif ()
+                  break ()
+                endif ()
+              endforeach ()
+              unset (_version)
+            else ()
+              find_package (${PKG} ${VER} ${FIND_ARGN})
+            endif ()
             # set common <Pkg>_VERSION_STRING variable if possible and not set
             if (NOT DEFINED ${PKG}_VERSION_STRING)
               if ("^${PKG}$" STREQUAL "^PythonInterp$")
@@ -439,10 +468,24 @@
                   set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_VERSION_MINOR})
                   if (DEFINED ${PKG}_VERSION_PATCH)
                     set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_VERSION_PATCH})
+                  elseif (DEFINED ${PKG}_SUBMINOR_VERSION) # see FindBoost.cmake
+                    set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_SUBMINOR_VERSION})
+                  endif ()
+                endif ()
+              elseif (DEFINED ${PKG}_MAJOR_VERSION)
+                set (${PKG}_VERSION_STRING ${${PKG}_MAJOR_VERSION})
+                if (DEFINED ${PKG}_MINOR_VERSION)
+                  set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_MINOR_VERSION})
+                  if (DEFINED ${PKG}_PATCH_VERSION)
+                    set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_PATCH_VERSION})
+                  elseif (DEFINED ${PKG}_SUBMINOR_VERSION) # see FindBoost.cmake
+                    set (${PKG}_VERSION_STRING ${${PKG}_VERSION_STRING}.${${PKG}_SUBMINOR_VERSION})
                   endif ()
                 endif ()
               elseif (DEFINED ${PKG}_VERSION)
                 set (${PKG}_VERSION_STRING ${${PKG}_VERSION})
+              elseif (DEFINED ${PKG}_LIB_VERSION) # see FindBoost.cmake
+                set (${PKG}_VERSION_STRING ${${PKG}_LIB_VERSION})
               endif ()
             endif ()
             # derive DEPENDS_<PKG>_DIR from common Find<PKG>.cmake variables
@@ -496,13 +539,13 @@
             # verbose output of information about found package
             if (${PKG}_FOUND)
               set (_STATUS "${_STATUS} - found")
-              if (BASIS_VERBOSE)
-                if (DEFINED ${PKG}_VERSION_STRING AND NOT ${PKG}_VERSION_STRING MATCHES "^0.0.0$")
-                  set (_STATUS "${_STATUS} v${${PKG}_VERSION_STRING}")
-                endif ()
-                if (${PKG}_DIR)
-                  set (_STATUS "${_STATUS} at ${${PKG}_DIR}")
-                endif ()
+              if ("^${PKG}$" STREQUAL "^Boost$")
+                set (_STATUS "${_STATUS} v${${PKG}_MAJOR_VERSION}.${${PKG}_MINOR_VERSION}.${${PKG}_SUBMINOR_VERSION}")
+              elseif (DEFINED ${PKG}_VERSION_STRING AND NOT "^${${PKG}_VERSION_STRING}$" STREQUAL "^0.0.0$")
+                set (_STATUS "${_STATUS} v${${PKG}_VERSION_STRING}")
+              endif ()
+              if (BASIS_VERBOSE AND ${PKG}_DIR)
+                set (_STATUS "${_STATUS} at ${${PKG}_DIR}")
               endif ()
             else ()
               set (_STATUS "${_STATUS} - not found")
@@ -591,6 +634,7 @@
   endif ()
   unset (PKG)
   unset (VER)
+  unset (_num_versions)
   unset (PKG_IS_MODULE)
   unset (PKG_IS_PROJECT)
 endmacro ()


[OGRE-201] Update FindOgre.cmake after OGRE-181

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -559,6 +559,7 @@
   Media
   media
   share/OGRE/media
+  share/OGRE/Media
 )

 clear_if_changed(OGRE_PREFIX_WATCH OGRE_MEDIA_DIR)


ManageGConf: Use GCONF2_PACKAGE_NAME instead of GConf2

--- Modules/ManageGConf.cmake
+++ Modules/ManageGConf.cmake
@@ -29,19 +29,20 @@
 SET(_MANAGE_GCONF_CMAKE_ DEFINED)
 INCLUDE(ManageDependency)
 SET(GCONF2_PKG_CONFIG "gconf-2.0" CACHE STRING "GConf2 pkg-config name")
+SET(GCONF2_PACKAGE_NAME "GConf2" CACHE STRING "GConf2 package name")
 SET(GCONF2_DEVEL_PACKAGE_NAME "GConf2-devel" CACHE STRING "GConf2 devel package name")
 MANAGE_DEPENDENCY(REQUIRES GCONF2 REQUIRED PACKAGE_NAME "GConf2")
 MANAGE_DEPENDENCY(BUILD_REQUIRES GCONF2 REQUIRED
     PKG_CONFIG ${GCONF2_PKG_CONFIG} PACKAGE_NAME "${GCONF2_DEVEL_PACKAGE_NAME}"
     )
 MANAGE_DEPENDENCY(REQUIRES_PRE GCONF2 REQUIRED
-    PACKAGE_NAME "GConf2"
+    PACKAGE_NAME "${GCONF2_PACKAGE_NAME}"
     )
 MANAGE_DEPENDENCY(REQUIRES_PREUN GCONF2 REQUIRED
-    PACKAGE_NAME "GConf2"
+    PACKAGE_NAME "${GCONF2_PACKAGE_NAME}"
     )
 MANAGE_DEPENDENCY(REQUIRES_POST GCONF2 REQUIRED
-    PACKAGE_NAME "GConf2"
+    PACKAGE_NAME "${GCONF2_PACKAGE_NAME}"
     )

 SET(MANAGE_GCONF_SCHEMAS_VALID_OPTIONS "FILE" "INSTALL_DIR" "CONFIG_SOURCE")


COMP: Modernize searching in list

COMP: Modernize searching in list

CMake failure in sanity test is resolved by using
modern list searching paradim.

Use 'if( ${var} IN_LIST MYLIST)'

CMake Error at Wrapping/TypedefMacros.cmake:326 (message):
  itk_wrap_class: Invalid option 'EXPLICIT_SPECIALIZATION'.  Possible values
  are POINTER, POINTER_WITH_CONST_POINTER, POINTER_WITH_SUPERCLASS,
  POINTER_WITH_2_SUPERCLASSES, EXPLICIT_SPECIALIZATION,
  POINTER_WITH_EXPLICIT_SPECIALIZATION, ENUM and AUTOPOINTER
Call Stack (most recent call first):
  Wrapping/TypedefMacros.cmake:272 (itk_wrap_named_class)
  Modules/Core/Common/wrapping/vnl_c_vector.wrap:7 (itk_wrap_class)
  Wrapping/TypedefMacros.cmake:196 (include)
  Wrapping/TypedefMacros.cmake:150 (itk_load_submodule)
  Modules/Core/Common/wrapping/CMakeLists.txt:60 (itk_auto_load_submodules)

--- Wrapping/TypedefMacros.cmake
+++ Wrapping/TypedefMacros.cmake
@@ -316,14 +316,9 @@

   if("${ARGC}" EQUAL 3)
     set(WRAPPER_WRAP_METHOD "${ARGV2}")
-    set(ok 0)
-    foreach(opt POINTER POINTER_WITH_CONST_POINTER POINTER_WITH_SUPERCLASS POINTER_WITH_2_SUPERCLASSES EXPLICIT_SPECIALIZATION POINTER_WITH_EXPLICIT_SPECIALIZATION ENUM AUTOPOINTER)
-      if("${opt}" STREQUAL "${WRAPPER_WRAP_METHOD}")
-        set(ok 1)
-      endif()
-    endforeach()
-    if(ok EQUAL 0)
-      message(SEND_ERROR "itk_wrap_class: Invalid option '${WRAPPER_WRAP_METHOD}'. Possible values are POINTER, POINTER_WITH_CONST_POINTER, POINTER_WITH_SUPERCLASS, POINTER_WITH_2_SUPERCLASSES, EXPLICIT_SPECIALIZATION, POINTER_WITH_EXPLICIT_SPECIALIZATION, ENUM and AUTOPOINTER")
+    set(VALID_WRAP_METHODS POINTER POINTER_WITH_CONST_POINTER POINTER_WITH_SUPERCLASS POINTER_WITH_2_SUPERCLASSES EXPLICIT_SPECIALIZATION POINTER_WITH_EXPLICIT_SPECIALIZATION ENUM AUTOPOINTER)
+    if( NOT "${WRAPPER_WRAP_METHOD}" IN_LIST VALID_WRAP_METHODS)
+      message(SEND_ERROR "itk_wrap_class: Invalid option '${WRAPPER_WRAP_METHOD}'. Possible values are ${VALID_WRAP_METHODS}")
     endif()
   endif()


Removed ROSPACK_MAKEDIST logic, because it's not needed

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -141,12 +141,6 @@
   # Check that manifest.xml is valid
   _rosbuild_check_manifest()

-  # If we're making a distribution, then we don't need to assemble build
-  # flags and such.  More to the point, this step will likely fail, because
-  # it can rely on call foo-config for a 3rdparty package foo that was
-  # cleaned before getting here.
-  if(NOT ROSPACK_MAKEDIST)
-
   # Add ROS_PACKAGE_NAME define
   add_definitions(-DROS_PACKAGE_NAME='\"${PROJECT_NAME}\"')

@@ -403,8 +397,6 @@
   _rosbuild_list_remove_duplicates(${_gtest_LIBRARIES} _tmplist)
   set(_gtest_LIBRARIES ${_tmplist})
   list(REVERSE _gtest_LIBRARIES)
-
-  endif(NOT ROSPACK_MAKEDIST)
 endmacro(rosbuild_init)
 ###############################################################################


Add support for NDDSHOME set to /usr

Add support for NDDSHOME set to /usr

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -93,6 +93,7 @@
   set(_search_library_paths "")
   foreach(_library_name ${_expected_library_names})
     list(APPEND _search_library_paths "${_lib_path}/*/${_library_name}")
+    list(APPEND _search_library_paths "${_lib_path}/${_library_name}")
   endforeach()

   # find library nddscpp


ENH (#1571): activated pointSetLocalTest again.

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -51,7 +51,7 @@
   mitkStepperTest.cpp
   itkTotalVariationDenoisingImageFilterTest.cpp
   mitkDICOMLocaleTest.cpp
-  #mitkPointSetLocaleTest.cpp
+  mitkPointSetLocaleTest.cpp
   mitkRenderingManagerTest.cpp
   vtkMitkThickSlicesFilterTest.cpp
 )


Add more warnings to gcc.

Add more warnings to gcc.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -4,7 +4,8 @@

 if (UNIX AND NOT WIN32)
   if (CMAKE_COMPILER_IS_GNUCC)
-    add_definitions(-std=gnu99 -pedantic -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement -Wunused)
+    # add -Wconversion ?
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute")

     # with -fPIC
     check_c_compiler_flag("-fPIC" WITH_FPIC)


Add optimizing flag to avoid warning for FORTIFY_SOURCE from gcc 6.2

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -62,7 +62,7 @@

     check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
     if (WITH_FORTIFY_SOURCE)
-      add_definitions(-D_FORTIFY_SOURCE=2)
+      add_definitions(-D_FORTIFY_SOURCE=2 -O)
     endif (WITH_FORTIFY_SOURCE)
   endif (CMAKE_COMPILER_IS_GNUCC OR COMPILER_IS_CLANG)
 endif (UNIX)


Add WIN32 flag on Msys2

Add WIN32 flag on Msys2

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -56,3 +56,7 @@
         add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
     endif (MSVC)
 endif (WIN32)
+
+if (MSYS)
+   add_definitions(-DWIN32)
+endif (MSYS)


Fix library name

Fix library name

--- cmake/Qt5Widgets_HunterPlugin_5_9.cmake
+++ cmake/Qt5Widgets_HunterPlugin_5_9.cmake
@@ -37,8 +37,8 @@
   # Qt non-imported
   _qt_cmake_extra_helpers_add_interface_release_debug(
       Qt5::Widgets
-      "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}.a"
-      "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}_debug.a"
+      "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}.a"
+      "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}_debug.a"
   )

   _qt_cmake_extra_helpers_add_interface_release_debug(
@@ -97,8 +97,8 @@
   # Qt non-imported
   _qt_cmake_extra_helpers_add_interface_release_debug(
       Qt5::Widgets
-      "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}.a"
-      "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}_debug.a"
+      "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}.a"
+      "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}_debug.a"
   )

   _qt_cmake_extra_helpers_add_interface_release_debug(
@@ -160,7 +160,7 @@
   # defined `hb_ot_tags_from_script'
   # should be set before Qt5::Gui
   _qt_cmake_extra_helpers_add_interface(
-      Qt5::Widgets "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}.a"
+      Qt5::Widgets "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}.a"
   )

   # should be set before Qt5::Gui
@@ -170,7 +170,7 @@

   # libs should be set before libQt5PlatformSupport
   # defined: QPlatformMenuItem::activated()
-  # (depends on z, lib${_qt_harfbuff_name}, GL)
+  # (depends on z, lib${_qt_harfbuzz_name}, GL)
   _qt_cmake_extra_helpers_add_interface(Qt5::Widgets Qt5::Gui)

   # before libQt5PlatformSupport.a
@@ -207,8 +207,8 @@
   # defined: '_hb_buffer_create'
   _qt_cmake_extra_helpers_add_interface_release_debug(
       Qt5::Widgets
-      "${_qt_install_prefix}/lib/${_qt_harfbuff_name}.lib"
-      "${_qt_install_prefix}/lib/${_qt_harfbuff_name}d.lib"
+      "${_qt_install_prefix}/lib/${_qt_harfbuzz_name}.lib"
+      "${_qt_install_prefix}/lib/${_qt_harfbuzz_name}d.lib"
   )

   # defined: 'CreateTLSIndex'
@@ -316,8 +316,8 @@
   # defined: '_hb_buffer_create'
   _qt_cmake_extra_helpers_add_interface_release_debug(
       Qt5::Widgets
-      "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}.a"
-      "${_qt_install_prefix}/lib/lib${_qt_harfbuff_name}d.a"
+      "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}.a"
+      "${_qt_install_prefix}/lib/lib${_qt_harfbuzz_name}d.a"
   )

   # defined: 'QPalette::~QPalette'


[added] install to CMAKE_BINARY_DIR/INSTALL by default

--- cmake/BOTG.cmake
+++ cmake/BOTG.cmake
@@ -336,6 +336,11 @@
     # Clear the cache unless provided -D KEEP_CACHE:BOOL=ON.
     BOTG_ClearCMakeCache("${KEEP_CACHE}")

+    # Install locally by default.
+    IF( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+        SET( CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/INSTALL" CACHE PATH "default install path" FORCE )
+    ENDIF()
+
     # Enable the hunter gate for downloading/installing TPLs!
     PROJECT("" NONE) #hack to make HunterGate happy
     INCLUDE( "${BOTG_SOURCE_DIR}/cmake/HunterGate.cmake" )


Adding -std=c++14 flag.

Adding -std=c++14 flag.

--- cmake/conf.cmake
+++ cmake/conf.cmake
@@ -10,7 +10,7 @@
 	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -m32 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden")
 	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -m32 -fvisibility=hidden")
 else()
-	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -m32 -fvisibility=hidden -fvisibility-inlines-hidden")
+	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -m32 -std=c++14 -fvisibility=hidden -fvisibility-inlines-hidden")
 	SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -m32 -fvisibility=hidden")
 endif()


getdeps: allow aliasing sources for add_fb_python_executable

Summary:
* Fix a minor issue with `add_fb_python_executable` where it would
  emit `--main` even if `MAIN_MODULE` had not been specified
* Introduce the ability to rename python sources in the manifest so
  that they have a different install path.
* Note that this changes the DEPENDS parameters to reference abs_sources;
  previously these were using relative paths to the sources pulled directly
  from the SOURCES arguments, but since those can now contain aliasing
  operations we need to pre-process the list.  I switched to abs_sources
  because that was already being maintained.  If for some reason the
  DEPENDS list needs to be relative paths, this will need to be adjusted.

Reviewed By: simpkins

Differential Revision: D17147417

fbshipit-source-id: d0825bfbdad6be658c078aaac6645e6926a1530f

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -47,10 +47,11 @@
 # Build a self-executing python binary.
 #
 # This accepts the same arguments as add_fb_python_library().
-# In addition, a MAIN_MODULE argument is required.  This argument specifies
+#
+# In addition, a MAIN_MODULE argument is accepted.  This argument specifies
 # which module should be started as the __main__ module when the executable is
-# run.
-#
+# run.  If left unspecified, a __main__.py script must be present in the
+# manifest.
 function(add_fb_python_executable EXE_NAME)
   # Parse the arguments
   set(one_value_args BASE_DIR NAMESPACE MAIN_MODULE TYPE)
@@ -105,11 +106,15 @@
     endif()
   endif()

+  if(DEFINED ARG_MAIN_MODULE)
+    set(main_argument "--main" "${ARG_MAIN_MODULE}")
+  endif()
+
   add_custom_command(
     OUTPUT "${output_file}"
     ${extra_cmd_params}
     COMMAND
-      "${MAKE_PYTHON_ARCHIVE}" -o "${EXE_NAME}" --main "${ARG_MAIN_MODULE}"
+      "${MAKE_PYTHON_ARCHIVE}" -o "${EXE_NAME}" ${main_argument}
       ${make_py_args}
     DEPENDS
       ${source_files}
@@ -145,6 +150,11 @@
 #   namespace of "foo.bar"
 # - SOURCES <src1> <...>:
 #   The python source files.
+#   You may optionally specify as source using the form: PATH=ALIAS where
+#   PATH is a relative path in the source tree and ALIAS is the relative
+#   path into which PATH should be rewritten.  This is useful for mapping
+#   an executable script to the main module in a python executable.
+#   e.g.: `python/bin/watchman-wait=__main__.py`
 # - DEPENDS <target1> <...>:
 #   Other python libraries that this one depends on.
 # - INSTALL_DIR <dir>:
@@ -229,23 +239,43 @@
   file(WRITE "${tmp_manifest}" "FBPY_MANIFEST 1\n")
   set(abs_sources)
   foreach(src_path IN LISTS ARG_SOURCES)
+    if("${src_path}" MATCHES "=")
+      # We want to split the string on the `=` sign, but cmake doesn't
+      # provide much in the way of helpers for this, so we rewrite the
+      # `=` sign to `;` so that we can treat it as a cmake list and
+      # then index into the components
+      string(REPLACE "=" ";" src_path_list "${src_path}")
+      list(GET src_path_list 0 src_path)
+      # Note that we ignore the `namespace_dir` in the alias case
+      # in order to allow aliasing a source to the top level `__main__.py`
+      # filename.
+      list(GET src_path_list 1 dest_path)
+    else()
+      unset(dest_path)
+    endif()
+
     get_filename_component(abs_source "${src_path}" ABSOLUTE)
     list(APPEND abs_sources "${abs_source}")
     file(RELATIVE_PATH rel_src "${ARG_BASE_DIR}" "${abs_source}")
+
+    if(NOT DEFINED dest_path)
+      if("${rel_src}" MATCHES "^../")
+        message(
+          FATAL_ERROR "${LIB_NAME}: source file \"${abs_source}\" is not inside "
+          "the base directory ${ARG_BASE_DIR}"
+        )
+      endif()
+      set(dest_path "${namespace_dir}${rel_src}")
+    endif()
+
     target_sources(
       "${LIB_NAME}.py_lib" INTERFACE
       "$<BUILD_INTERFACE:${abs_source}>"
-      "$<INSTALL_INTERFACE:${install_dir}${LIB_NAME}/${namespace_dir}${rel_src}>"
+      "$<INSTALL_INTERFACE:${install_dir}${LIB_NAME}/${dest_path}>"
     )
-    if("${rel_src}" MATCHES "^../")
-      message(
-        FATAL_ERROR "${LIB_NAME}: source file \"${abs_source}\" is not inside "
-        "the base directory ${ARG_BASE_DIR}"
-      )
-    endif()
     file(
       APPEND "${tmp_manifest}"
-      "${abs_source} :: ${namespace_dir}${rel_src}\n"
+      "${abs_source} :: ${dest_path}\n"
     )
   endforeach()
   configure_file("${tmp_manifest}" "${manifest_path}" COPYONLY)
@@ -260,7 +290,7 @@
   # This is needed in case some of the source files are generated.  This will
   # ensure that these source files are brought up-to-date before we build
   # any python binaries that depend on this library.
-  add_custom_target("${LIB_NAME}.py_sources_built" DEPENDS ${ARG_SOURCES})
+  add_custom_target("${LIB_NAME}.py_sources_built" DEPENDS ${abs_sources})
   add_dependencies("${LIB_NAME}.py_lib" "${LIB_NAME}.py_sources_built")

   # Hook up library dependencies, and also make the *.py_sources_built target
@@ -306,7 +336,7 @@
       --install-dir "${LIB_NAME}"
       -o "${build_install_dir}/${LIB_NAME}" "${manifest_path}"
     DEPENDS
-      "${ARG_SOURCES}"
+      "${abs_sources}"
       "${manifest_path}"
       "${MAKE_PYTHON_ARCHIVE}"
   )


Add DEBUG define for modules

Add DEBUG define for modules

--- prosoft/core/modules/config_module.cmake
+++ prosoft/core/modules/config_module.cmake
@@ -40,6 +40,9 @@
 endif()

 macro(ps_core_module_config TARGET_NAME)
+	if(DEBUG)
+        target_compile_definitions(${TARGET_NAME} PRIVATE DEBUG=1)
+    endif()
 	if(WIN32 AND BUILD_SHARED_LIBS)
 		target_compile_definitions(${TARGET_NAME} PRIVATE PS_LIB_EXPORTS=1)
 	endif()


Updated project source file groups.

Updated project source file groups.

--- build/cmake/Project.cmake
+++ build/cmake/Project.cmake
@@ -57,6 +57,14 @@

 	file(GLOB SOURCE_FILES src/ThirdParty/Box2D/*)
 	source_group("Source Files\\ThirdParty\\Box2D" FILES ${SOURCE_FILES})
+	file(GLOB SOURCE_FILES src/ThirdParty/Box2D/Lua/*)
+	source_group("Source Files\\ThirdParty\\Box2D\\Lua" FILES ${SOURCE_FILES})
+	file(GLOB SOURCE_FILES src/ThirdParty/Box2D/Lua/Collision/Shapes/*)
+	source_group("Source Files\\ThirdParty\\Box2D\\Lua\\Collision\\Shapes" FILES ${SOURCE_FILES})
+	file(GLOB SOURCE_FILES src/ThirdParty/Box2D/Lua/Dynamics/*)
+	source_group("Source Files\\ThirdParty\\Box2D\\Lua\\Dynamics" FILES ${SOURCE_FILES})
+	file(GLOB SOURCE_FILES src/ThirdParty/Box2D/Lua/Dynamics/Contacts/*)
+	source_group("Source Files\\ThirdParty\\Box2D\\Lua\\Dynamics\\Contacts" FILES ${SOURCE_FILES})

 	file(GLOB SOURCE_FILES src/ThirdParty/Spine/*)
 	source_group("Source Files\\ThirdParty\\Spine" FILES ${SOURCE_FILES})


Windows: Only add /permissive- for Visual Studio 2017+.

--- build/cmake/Windows.cmake
+++ build/cmake/Windows.cmake
@@ -67,7 +67,10 @@
     set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} /Oi /MT")
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /MT")
     set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /MTd")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR- /wd4065 /wd4244 /wd4456 /wd4800 /W4 /WX /permissive- /std:c++latest")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR- /wd4065 /wd4244 /wd4456 /wd4800 /W4 /WX /std:c++latest")
+    if(MSVC_VERSION GREATER 1900)
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive-")
+    endif()
     set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Oi /MT")
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /MT")
     string(REGEX REPLACE "/D NDEBUG" "" MSVC_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})


Do not try to be too inteligent in C++11 support detection

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -1,30 +1,16 @@
 include(CheckCXXCompilerFlag)

-# C++11 support in some compilers. The other compilers are supported with the
-# set(CMAKE_CXX_STANDARD 11) command in the top-level CMakeLists.txt
-set(cxx11_flag_needed OFF)
-if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
-    set(cxx11_flag_needed ON)
-elseif(${CMAKE_COMPILER_IS_GNUCC})
-    if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 5.0)
-        set(cxx11_flag_needed ON)
-    elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
-        set(cxx11_flag_needed ON)
-    endif()
-endif()
-
-if(${cxx11_flag_needed})
-    CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
-    CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
-    if(COMPILER_SUPPORTS_CXX11)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-    elseif(COMPILER_SUPPORTS_CXXOX)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-    else()
-        message(SEND_ERROR
-            "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.
-            Please use a different C++ compiler.")
-    endif()
+# C++11 support.
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+if(COMPILER_SUPPORTS_CXX11)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(COMPILER_SUPPORTS_CXXOX)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+else()
+    message(SEND_ERROR
+        "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.
+    Please use a different C++ compiler.")
 endif()

 macro(set_debug_flag_if_possible _flag_)


Configure nvcc compiler flags after package inclusion to remove warnings in cdash

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -7,6 +7,8 @@
   # FindCuda is included with CMake 2.8
   set (CUDA_FOUND FALSE)
 else ()
+  find_package (CUDA QUIET)
+
   # GCS 2011.03.16
   # Make nvcc less whiny
   if (CMAKE_COMPILER_IS_GNUCC)
@@ -15,8 +17,6 @@
       set (CUDA_NVCC_FLAGS --compiler-options ${CMAKE_C_FLAGS})
     endif ()
   endif ()
-
-  find_package (CUDA QUIET)
 endif ()

 set (CUDA_FOUND ${CUDA_FOUND} CACHE BOOL "Did we find cuda?")


More work on warning fix

More work on warning fix

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -17,9 +17,9 @@
   # the flag -ftest-coverage causes nvcc to barf, so exclude that one
   if (CMAKE_COMPILER_IS_GNUCC)
     string (REPLACE "-ftest-coverage" "" TMP "${CMAKE_CXX_FLAGS}")
-    string (REPLACE "-ftemplate-depth=50" "" TMP "${TMP}")
+    string (REPLACE "-ftemplate-depth-50" "" TMP "${TMP}")
     string (REPLACE " " "," TMP "${TMP}")
-    set (CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS} ${TMP})
+    set (CUDA_CXX_FLAGS ${TMP})
   endif ()

   # GCS 2012-05-07: Workaround for poor, troubled FindCUDA


fix location of rootdicts

fix location of rootdicts

--- cmake/MacroRootDict.cmake
+++ cmake/MacroRootDict.cmake
@@ -9,14 +9,14 @@
 SET( ROOT_CINT_WRAPPER ${LD_LIBRARY_PATH_VAR}=${ROOT_LIBRARY_DIR}:${LD_LIBRARY_PATH_CONTENTS} ${ROOT_CINT_EXECUTABLE} )

 IF( NOT DEFINED ROOT_DICT_OUTPUT_DIR )
-    SET( ROOT_DICT_OUTPUT_DIR "${PROJECT_BINARY_DIR}/rootdict" )
+    SET( ROOT_DICT_OUTPUT_DIR "${PROJECT_BINARY_DIR}/lib" )
 ENDIF()

 # clean generated header files with 'make clean'
 SET_DIRECTORY_PROPERTIES( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ROOT_DICT_OUTPUT_DIR}" )

 IF( NOT ROOT_FIND_QUIETLY )
-    MESSAGE( STATUS "Check for ROOT_DICT_OUTPUT_DIR: ${PROJECT_BINARY_DIR}/rootdict" )
+    MESSAGE( STATUS "Check for ROOT_DICT_OUTPUT_DIR: ${PROJECT_BINARY_DIR}/lib" )
     MESSAGE( STATUS "Check for ROOT_DICT_CINT_DEFINITIONS: ${ROOT_DICT_CINT_DEFINITIONS}" )
 ENDIF()


Remove unused module

Remove unused module

--- cmake/find/FindJPEG.cmake
+++ cmake/find/FindJPEG.cmake
@@ -1,22 +0,0 @@
-if(HUNTER_STATUS_DEBUG)
-  message("[hunter] Custom FindJPEG module")
-endif()
-
-find_package(JPEG CONFIG REQUIRED)
-set(JPEG_LIBRARY JPEG::jpeg)
-set(JPEG_INCLUDE_DIR "${JPEG_ROOT}/include")
-
-# handle the QUIETLY and REQUIRED arguments and set JPEG_FOUND to TRUE if
-# all listed variables are TRUE
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(JPEG REQUIRED_VARS JPEG_LIBRARY JPEG_INCLUDE_DIR)
-
-if(JPEG_FOUND)
-  set(JPEG_LIBRARIES ${JPEG_LIBRARY})
-endif()
-
-# Do not mark as advanced:
-#  * JPEG_INCLUDE_DIR
-#  * JPEG_LIBRARY
-# Problem with FindJasper. Looks like it's loading standard module anyway so
-# expect some variables to be visible, otherwise will start a search again.


build: turn off FLB_RECORD_ACCESSOR if bison/flex unavailable

Without this, cmake emits an error while initialization, due to
bison/flex required by record-accessor but not available.

> This is a build time dependency, you can either install the dependencies or
> disable the feature setting the CMake option -DFLB_RECORD_ACCESSOR=Off .

Signed-off-by: Fujimoto Seiji <ef879192bb1e41d519c82cf76440dc8e9a530806@clear-code.com>

--- cmake/windows-setup.cmake
+++ cmake/windows-setup.cmake
@@ -86,5 +86,6 @@
   if (NOT (${FLEX_FOUND} AND ${BISON_FOUND}))
     message(STATUS "flex and bison not found. Disable stream_processor building.")
     set(FLB_STREAM_PROCESSOR No)
+    set(FLB_RECORD_ACCESSOR  No)
   endif()
 endif()


Fixed typo

Fixed typo

--- cmake/externals/ConfigureExternalProjects.cmake
+++ cmake/externals/ConfigureExternalProjects.cmake
@@ -88,7 +88,7 @@

 ## #############################################################################
-## Add custom targets update, and build to explicitly updtae and rebuild all.
+## Add custom targets update, and build to explicitly update and rebuild all.
 ## #############################################################################

     if(update-${external_project})


cmake: adjust extension of APPLE systems

--- cmake-module/gepetto-viewer-plugin.cmake
+++ cmake-module/gepetto-viewer-plugin.cmake
@@ -65,6 +65,9 @@
     ${PLUGIN_RESOURCES_RCC}
     )
   SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "")
+  IF(APPLE)
+    SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES SUFFIX ".so")
+  ENDIF(APPLE)

   TARGET_LINK_LIBRARIES(${PLUGIN_NAME} ${QT_LIBRARIES} ${PLUGIN_LINK_DEPENDENCIES})
   FOREACH(DEP ${PLUGIN_PKG_CONFIG_DEPENDENCIES})


Missing SGX SDK Include fixed (#275)

Missing SGX SDK Include fixed (#275)

* Missing SGX SDK Include fixed

* Update shared_platform.cmake

Co-authored-by: Joshua Heinemann <b9ec4306c702ef2ae8f3bbbfc8d2a1d5572c3638@ibr.cs.tu-bs.de>
Co-authored-by: wenyongh <72d239bf6f56acd79b6650c7c7b18a0cf25756b4@intel.com>

--- core/shared/platform/linux-sgx/shared_platform.cmake
+++ core/shared/platform/linux-sgx/shared_platform.cmake
@@ -8,6 +8,15 @@
 include_directories(${PLATFORM_SHARED_DIR})
 include_directories(${PLATFORM_SHARED_DIR}/../include)

+if ("$ENV{SGX_SDK}" STREQUAL "")
+  set (SGX_SDK_DIR "/opt/intel/sgxsdk")
+else()
+  set (SGX_SDK_DIR $ENV{SGX_SDK})
+endif()
+
+include_directories (${SGX_SDK_DIR}/include
+                     ${SGX_SDK_DIR}/include/tlibc
+                     ${SGX_SDK_DIR}/include/libcxx)

 file (GLOB_RECURSE source_all ${PLATFORM_SHARED_DIR}/*.c)


cmake: Add an interpreter-based hint for the Python library search.

Uses the `LIBDIR` config variable in Python to get the path for the
interpreter's dynamic library. This is the first path used to search for
the python dynamic library. However, this will likely be the only path
required.

--- config/FindVIGRANUMPY_DEPENDENCIES.cmake
+++ config/FindVIGRANUMPY_DEPENDENCIES.cmake
@@ -37,11 +37,19 @@
             CACHE FILEPATH "Python libraries"
             FORCE)
     ELSE()
+        IF(WIN32)
+            set(PYTHON_LIBRARY_NAME python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
+        ELSE()
+            execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
+                             "from distutils.sysconfig import *; print(get_config_var('LDLIBRARY'))"
+                              OUTPUT_VARIABLE PYTHON_LIBRARY_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
+        ENDIF()
         execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
-                         "import sys; skip = 2 if sys.platform.startswith('win') else 1; print 'python' + sys.version[0:3:skip]"
-                          OUTPUT_VARIABLE PYTHON_LIBRARY_NAME OUTPUT_STRIP_TRAILING_WHITESPACE)
-        FIND_LIBRARY(PYTHON_LIBRARIES ${PYTHON_LIBRARY_NAME} HINTS "${PYTHON_PREFIX}"
+		        "from distutils.sysconfig import *; print(get_config_var('LIBDIR'))"
+			OUTPUT_VARIABLE PYTHON_LIBRARY_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
+        FIND_LIBRARY(PYTHON_LIBRARIES ${PYTHON_LIBRARY_NAME} HINTS "${PYTHON_LIBRARY_PREFIX}" "${PYTHON_PREFIX}"
                      PATH_SUFFIXES lib lib64 libs DOC "Python libraries")
+        unset(PYTHON_LIBRARY_PREFIX)
     ENDIF()

     # find Python includes


[cmake] make unreachable code a warning when Bullet is enabled

When DEV_MODE=TRUE and we are compiling with Bullet using clang, some
unreachable code is found in the Bullet headers which causes the build
to fail.

--- cmake/CXXCompilerSetup.cmake
+++ cmake/CXXCompilerSetup.cmake
@@ -50,7 +50,12 @@
 if(DEV_MODE)
   # --- Clang ----
   #add_cxx_options("-Weverything" Clang) # like Wall and more
-  add_cxx_options("-Werror=unreachable-code" "Clang")
+  if (WITH_BULLET)
+    # some unreachable code errors come from the Bullet headers
+    add_cxx_options("-Wunreachable-code" "Clang")
+  else()
+    add_cxx_options("-Werror=unreachable-code" "Clang")
+  endif()
   # --- All compilers but MSVC (Microsoft Visual C) ---
   if(NOT MSVC)
     add_cxx_options("-Wall")


Increased minimum ios deployment target.

--- cmake/ConfigOptionsiOS.cmake
+++ cmake/ConfigOptionsiOS.cmake
@@ -19,5 +19,5 @@
 	set(FREERDP_IOS_EXTERNAL_SSL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/openssl")
 endif()
 mark_as_advanced(FREERDP_IOS_EXTERNAL_SSL_PATH)
-set(IOS_TARGET_SDK 9.3 CACHE STRING "Application target iOS SDK")
+set(IOS_TARGET_SDK 12.0 CACHE STRING "Application target iOS SDK")


debug clang-format version

debug clang-format version

--- cmake/FindCLANG_FORMAT.cmake
+++ cmake/FindCLANG_FORMAT.cmake
@@ -40,7 +40,7 @@
                    "${clang_format_version}")
     # CLANG_FORMAT_VERSION sample: "3.9.1"
   else()
-    set(CLANG_FORMAT_VERSION 0.0)
+    set(CLANG_FORMAT_VERSION "${clang_format_version}")
   endif()
 else()
   set(CLANG_FORMAT_VERSION 0.0)


Fix meta examples/tests in BSD mode

Fix meta examples/tests in BSD mode

--- cmake/FindMetaExamples.cmake
+++ cmake/FindMetaExamples.cmake
@@ -30,6 +30,7 @@
 	IF(NOT USE_GPL_SHOGUN)
 		LIST(APPEND EXCLUDED_META_EXAMPLES
 			gaussian_processes/gaussian_process_regression.sg
+			gaussian_processes/gaussian_process_classifier.sg
 			multiclass_classifier/multiclass_logisticregression.sg
             statistical_testing/linear_time_mmd.sg
             statistical_testing/quadratic_time_mmd.sg


Added MultiarchSpec for linux in search library (https://wiki.ubuntu.com/MultiarchSpec)

--- cmake/Modules/FindUUID.cmake
+++ cmake/Modules/FindUUID.cmake
@@ -74,6 +74,10 @@
 		$ENV{UUID_DIR}/lib
 		/usr/local/lib
 		/usr/lib
+		/lib/i386-linux-gnu
+		/lib/x86_64-linux-gnu
+		/usr/lib/i386-linux-gnu
+		/usr/lib/x86_64-linux-gnu
 		/sw/lib
 		/opt/local/lib
 		/opt/csw/lib


set dispatched_main lib to static

set dispatched_main lib to static

--- cmake/dispatched_build.cmake
+++ cmake/dispatched_build.cmake
@@ -64,7 +64,7 @@
     foreach(branch ${target_branches})
         message(STATUS "Adding dispatched main ${target_name}.${branch}")

-        add_library("${target_name}.${branch}" ${target_sources})
+        add_library("${target_name}.${branch}" STATIC ${target_sources})
         add_dependencies("${target_name}.${branch}" "zacc.generate.${branch}.types" "zacc.generate.${branch}.tests" ${target_dependencies})

         target_include_directories(${target_name}.${branch} PUBLIC ${target_includes})


Generated headers now always appear in the source directory

--- cmake/generate_sources.cmake
+++ cmake/generate_sources.cmake
@@ -1,5 +1,5 @@
 message(STATUS "Generating sources")
 execute_process(
   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/generate_sources ${LLVM_ROOT_PATH}
-  WORKING_DIRECTORY $ENV{PWD}
+  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 )


build: remove explicit link against `atomic`

This is no longer required after the fix for the over-aligned type for
the atomic type.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -348,13 +348,11 @@
       ${CMAKE_BINARY_DIR}/winsdk_lib_${SWIFT_HOST_VARIANT_ARCH}_symlinks)
   elseif(SWIFT_HOST_VARIANT_SDK STREQUAL HAIKU)
     target_link_libraries(${target} PRIVATE
-      atomic
       bsd)
     target_link_options(${target} PRIVATE
       "SHELL:-Xlinker -Bsymbolic")
   elseif(SWIFT_HOST_VARIANT_SDK STREQUAL ANDROID)
     target_link_libraries(${target} PRIVATE
-      atomic
       dl
       log
       # We need to add the math library, which is linked implicitly by libc++


Updated compiler linker for clang (win)

Updated compiler linker for clang (win)

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -12,17 +12,38 @@
  #         Software Competence Center Hagenberg GmbH (SCCH)
  #         <thomas.natschlaeger@scch.at>, <office@scch.at>

+
+ ####################
+ # Debug information
+ ####################
+ message("")
+ message("*** COMPILER CONFIGURATION ***")
+ message("")
+ message(STATUS "CMAKE_C_COMPILER:   ${CMAKE_CXX_COMPILER}")
+ message(STATUS "CMAKE_CXX_COMPILER: ${CMAKE_CXX_COMPILER}")
+
  add_compile_definitions(CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
+
  # Provide options to force building with GNU or Clang, if the standard compiler is not desired
  option(USE_CLANG "Force build with clang (if gcc is standard)" OFF) # OFF is the default
  option(USE_GNU "Force build with gcc (if clang is standard)" OFF) # OFF is the default
- set(CLANG_C_COMPILER "/usr/bin/clang" CACHE FILEPATH "Path to clang C compiler")
- set(CLANG_CXX_COMPILER "/usr/bin/clang++" CACHE FILEPATH "Path to clang C++ compiler")
- set(GNU_C_COMPILER "/usr/bin/gcc" CACHE FILEPATH "Path to C compiler")
- set(GNU_CXX_COMPILER "/usr/bin/g++" CACHE FILEPATH "Path to C++ compiler")
+
+ if (UNIX AND NOT APPLE)
+     set(CLANG_C_COMPILER "/usr/bin/clang" CACHE FILEPATH "Path to clang C compiler")
+     set(CLANG_CXX_COMPILER "/usr/bin/clang++" CACHE FILEPATH "Path to clang C++ compiler")
+     set(GNU_C_COMPILER "/usr/bin/gcc" CACHE FILEPATH "Path to C compiler")
+     set(GNU_CXX_COMPILER "/usr/bin/g++" CACHE FILEPATH "Path to C++ compiler")
+ elseif (APPLE)
+     # ...
+ elseif (WIN32)
+     # ...
+ endif ()
+ message(STATUS "CMAKE_CXX_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}")

  # Set the platform type and override compiler if necessary
  if (USE_CLANG OR USE_GNU)
+     message(STATUS "Forcing compiler selection... I hope you know what you're doing.")
+     message(AUTHOR_WARNING "This attempts to guess the CMAKE_C(XX)_COMPILER. Other Compiler variables are not deduced.")
      message(STATUS "Guessing compiler executables:")
      if (USE_GNU)
          message(STATUS "  GNU C     : ${GNU_C_COMPILER}")
@@ -61,30 +82,136 @@

  # Set the compile flags
  if (TUDAT_BUILD_CLANG)
+     # add compile definition and print status
      add_compile_definitions(TUDAT_BUILD_CLANG)
-     if(WIN32)
-      add_definitions("-D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_MD")
-     endif()
      message(STATUS "Using clang compiler.")
+
+     # set default cmake c flags for clang
      set(CMAKE_C_FLAGS "-Wall -std=c11")
      set(CMAKE_C_FLAGS_DEBUG "-g")
      set(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
      set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")
      set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
+
      if (APPLE)
-         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libc++")
-     elseif (NOT WIN32)
-         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
-     else()
-         # this implies clang on windows
-         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -Wno-unused-result")
-         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXFLAGS} /MD /EHsc /W3 /FC /Ox -D_SCL_SECURE_NO_WARNINGS")
-         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS}")
-     endif ()
-     set(CMAKE_CXX_FLAGS_DEBUG "-g")
-     set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
-     set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
-     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+         # standard apple clang compiler flags
+         set(CMAKE_CXX_FLAGS
+                 "${CMAKE_CXX_FLAGS}"
+                 " -std=c++11"
+                 " -stdlib=libc++"
+                 " -Wall "
+                 " -Wextra"
+                 )
+         string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+         # disabled warnings for warnings coming from legacy tudat code
+         set(CMAKE_CXX_FLAGS
+                 "${CMAKE_CXX_FLAGS}"
+                 " -Wno-unused-parameter"
+                 " -Wno-unused-variable"
+                 )
+         string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+     elseif (UNIX AND NOT APPLE)
+         # standard linux clang compiler flags
+         set(CMAKE_CXX_FLAGS
+                 "${CMAKE_CXX_FLAGS}"
+                 " -std=c++11"
+                 " -stdlib=libstdc++"
+                 " -Wall"
+                 " -Wextra"
+                 " -Wno-unused-parameter"
+                 " -Wno-unused-variable")
+         string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+     elseif (WIN32)
+         # fixes an issue [reference this]
+         add_definitions("-D_ENABLE_EXTENDED_ALIGNED_STORAGE")
+
+         # standard windows clang c++ compiler flags
+         set(CMAKE_CXX_FLAGS
+                 "${CMAKE_CXX_FLAGS}"
+                 " -std=c++11"
+                 " -Wall"
+                 " -Wextra"
+                 " -Wno-unused-parameter"
+                 " -Wno-unused-variable"
+                 " -Wno-unused-result"
+                 )
+         string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+         # if the clang msvc-like command line interface is being used
+         if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+             set(CMAKE_CXX_FLAGS
+                     "${CMAKE_CXX_FLAGS}"
+                     " /MD"
+                     " /EHsc"
+                     " /W3"
+                     " /FC"
+                     " /Ox"
+                     " -D_SCL_SECURE_NO_WARNINGS"
+                     " ${CXXFLAGS}"
+                     )
+             string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+             # clang-cl 9 doesn't properly implement an alternative for -isystem <dir>
+             # for system headers, all warnings incurred by eigen must be silenced to
+             # make the build log readable.
+             if (CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 12.0.0)
+                 set(CMAKE_CXX_FLAGS
+                         " -Wno-float-conversion"
+                         " -Wno-unreachable-code-return"
+                         " -Wno-unused-template"
+                         " -Wno-sign-conversion"
+                         " -Wno-undef"
+                         " -Wno-unused-result"
+                         " -Wno-documentation-unknown-command"
+                         " -Wno-missing-prototypes"
+                         " -Wno-missing-noreturn"
+                         " -Wno-deprecated-declarations"
+                         " -Wno-implicit-int-conversion"
+                         " -Wno-shadow-field-in-constructor"
+                         " -Wno-shadow-field"
+                         " -Wno-switch-enum"
+                         " -Wno-cast-align"
+                         " -Wno-float-equal"
+                         " -Wno-deprecated-dynamic-exception-spec"
+                         " -Wno-header-hygiene"
+                         " -Wno-zero-as-null-pointer-constant"
+                         " -Wno-vla-extension"
+                         " -Wno-old-style-cast"
+                         " -Wno-disabled-macro-expansion"
+                         " -Wno-covered-switch-default"
+                         " -Wno-range-loop-analysis"
+                         " -Wno-shadow"
+                         " -Wno-reserved-id-macro"
+                         " -Wno-float-overflow-conversion"
+                         " -Wno-unknown-argument"
+                         " -Wno-extra-semi"
+                         " -Wno-global-constructors"
+                         " -Wno-extra-semi-stmt"
+                         " -Wno-documentation-deprecated-sync"
+                         " -Wno-unused-variable"
+                         " -Wno-shadow-uncaptured-local"
+                         " -Wno-documentation"
+                         " -Wno-deprecated"
+                         " -Wno-unused-macros"
+                         " -Wno-vla"
+                         " -Wno-unreachable-code-break"
+                         " -Wno-implicit-fallthrough"
+                         " -Wno-conditional-uninitialized"
+                         " -Wno-exit-time-destructors"
+                         " -Wno-undefined-func-template"
+                         )
+                 string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+
+             endif ()
+         endif ()
+         set(CMAKE_CXX_FLAGS_DEBUG "-g")
+         set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
+         set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
+         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+     endif ()

  elseif (TUDAT_BUILD_GNU)
      add_compile_definitions(TUDAT_BUILD_GNU)
@@ -214,7 +341,7 @@
      endif ()
      if (CMAKE_C_COMPILER_ID MATCHES "Clang")

-     else()
+     else ()
          string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR ${MSVC_DISABLED_WARNINGS_LIST})
          string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
      endif ()


Set the CTEST_CONFIGURATION_TYPE variable.

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -72,6 +72,8 @@
 #message("empty_binary_directory:${empty_binary_directory}")
 #message("force_build:${initial_force_build}")

+set(CTEST_CONFIGURATION_TYPE ${CTEST_BUILD_CONFIGURATION})
+
 if(empty_binary_directory)
   message("Directory ${CTEST_BINARY_DIRECTORY} cleaned !")
   ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})


Remove out dated comment

Remove out dated comment

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -47,7 +47,6 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-# NOTE: it is very important to update the ITK_DIR path with the ITK version
 set(ITK_GIT_TAG "v4.12.0" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


BUG: Update ITK_DIR to match version

BUG: Update ITK_DIR to match version

Change-Id: I7605935008c08184758566bd3ecfacc169c9a6cc

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -90,5 +90,5 @@

 ExternalProject_Get_Property(ITK install_dir)
-set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.8" )
-set(WrapITK_DIR "${install_dir}/lib/cmake/ITK-4.8/WrapITK")
+set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.9" )
+set(WrapITK_DIR "${install_dir}/lib/cmake/ITK-4.9/WrapITK")


Always build ITK with hidden visibility with static libraries

Change-Id: If66e47135ff7f4c3e19bc3b11d3b24d16f7c79b7

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -46,6 +46,7 @@
   set( ITK_BUILD_SHARED_LIBS ON )
 else()
   set( ITK_BUILD_SHARED_LIBS OFF )
+  list( APPEND ep_itk_args"-DCMAKE_C_VISIBILITY_PRESET:BOOL=hidden" "-DCMAKE_CXX_VISIBILITY_PRESET:BOOL=hidden" )
 endif()


ENH: Bump ITK ExternalProject version to 2017-02-23 master

Change-Id: Ib88bb6b34ed9be3623e0bca02bc9130bd322b0e5

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -2,8 +2,8 @@
 # Get and build itk

 if( NOT ITK_TAG )
-  # ITK master 2016-09-20
-  set( ITK_TAG "077527e86d96daf88663fda6bf7abeb1e92b9d9d" )
+  # ITK master 2017-01-23
+  set( ITK_TAG "c510b1019499470f21861c724493f5623d06cf29" )
 endif()

 set( _vtk_args )


make the opengl2 module required for the backend

the domainschemistryopengl2 module is lightweight so
make it on by default if domains chem is on

--- Domains/ChemistryOpenGL2/module.cmake
+++ Domains/ChemistryOpenGL2/module.cmake
@@ -7,6 +7,7 @@
     vtkDomainsChemistry
   BACKEND
     OpenGL2
+  IMPLEMENTATION_REQUIRED_BY_BACKEND
   PRIVATE_DEPENDS
     vtkglew
   KIT


XSDKDefaults tweaks

XSDKDefaults tweaks

--- config/XSDKDefaults.cmake
+++ config/XSDKDefaults.cmake
@@ -74,7 +74,7 @@

 IF (NOT COMMAND PRINT_VAR)
   FUNCTION(PRINT_VAR  VAR_NAME)
-    MESSAGE("-- " "${VAR_NAME} = '${${VAR_NAME}}'")
+    MESSAGE(STATUS "${VAR_NAME} = '${${VAR_NAME}}'")
   ENDFUNCTION()
 ENDIF()

@@ -96,7 +96,7 @@
 ENDIF()
 SET(USE_XSDK_DEFAULTS  ${USE_XSDK_DEFAULTS_DEFAULT}  CACHE  BOOL
   "Use XSDK defaults and behavior.")
-#PRINT_VAR(USE_XSDK_DEFAULTS)
+PRINT_VAR(USE_XSDK_DEFAULTS)

 SET_DEFAULT(XSDK_ENABLE_C  TRUE)
 SET_DEFAULT(XSDK_ENABLE_CXX  TRUE)
@@ -181,6 +181,10 @@

 ENDIF()

+#
+# Set TPL MFEM_USE_* Defaults
+#
+
 IF (DEFINED TPL_ENABLE_MPI)
   SET(MFEM_USE_MPI ${TPL_ENABLE_MPI} CACHE BOOL "Enable MPI parallel build" FORCE)
 ENDIF()


COMP: Disable the gold linker for static builds on Ubuntu 14.04.

Five failing tests occur with this build.

MaximumRatioDecisionRuleTest
MinimumDecisionRuleTest
MaximumDecisionRuleTest
GaussianDensityFunctionTest
EuclideanDistanceTest

Segmentation faults occur.  This only occurs with BUILD_SHARED_LIBS OFF on
Ubuntu 14.04 with GCC 4.8.4 and binutils 2.24.

Change-Id: Ib3ee1349e97f449eb9eee91a0a2eb4f8a0d60ff3

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

-    if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "4.8.3" AND
-       "${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
+    if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
       ITK_CHECK_CXX_COMPILER_FLAG("-fuse-ld=gold" have_gold)
       if(have_gold)
-        option(ITK_USE_GOLD_LINKER "Use the gold linker instead of ld." ON)
+        set(_use_gold_linker_default ON)
+        set(_gold_linker_failure_condition_0 "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.4")
+        set(_gold_linker_failure_condition_1  NOT BUILD_SHARED_LIBS AND "${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "4.8.4")
+        if( (${_gold_linker_failure_condition_0}) OR (${_gold_linker_failure_condition_1}) )
+          set(_use_gold_linker_default OFF)
+        endif()
+        option(ITK_USE_GOLD_LINKER "Use the gold linker instead of ld." ${_use_gold_linker_default})
         mark_as_advanced(ITK_USE_GOLD_LINKER)
         # The gold linker is approximately 3X faster.
         if(ITK_USE_GOLD_LINKER)


CMake-based support of LTO

CMake-based support of LTO

[skip ci]

--- flags/lto.cmake
+++ flags/lto.cmake
@@ -7,54 +7,11 @@
   set(POLLY_FLAGS_LTO_CMAKE_ 1)
 endif()

-include(polly_add_cache_flag)
 include(polly_fatal_error)

-string(COMPARE EQUAL "${ANDROID_NDK_VERSION}" "" _not_android)
-
-# TODO: test other platfroms, CMAKE_CXX_FLAGS_INIT should work for all
-if(_not_android)
-  polly_add_cache_flag(CMAKE_CXX_FLAGS "-flto")
-  polly_add_cache_flag(CMAKE_C_FLAGS "-flto")
-else()
-  polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-flto")
-  polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-flto")
-
-  string(COMPARE EQUAL "${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}" "clang" _is_clang)
-
-  if(_is_clang)
-    # Fix for error "format not recognized"
-    # (tested with 'android-ndk-r14-api-21-arm64-v8a-clang-hid-sections-lto')
-    polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=gold")
-    polly_add_cache_flag(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=gold")
-  else()
-    # GCC, fix for "BFD: ... : plugin needed to handle lto object"
-    if(CMAKE_HOST_WIN32)
-      set(_host_tag "windows")
-    elseif(CMAKE_HOST_APPLE)
-      set(_host_tag "darwin")
-    else()
-      set(_host_tag "linux")
-    endif()
-
-    set(
-        CMAKE_AR
-        "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/${_host_tag}-x86_64/bin/arm-linux-androideabi-gcc-ar"
-        CACHE
-        PATH
-        ""
-        FORCE
-    )
-
-    set(
-        CMAKE_RANLIB
-        "${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/${_host_tag}-x86_64/bin/arm-linux-androideabi-gcc-ranlib"
-        CACHE
-        PATH
-        ""
-        FORCE
-    )
-  endif()
+if(NOT POLICY CMP0069)
+  polly_fatal_error("Bad CMake version")
 endif()

-list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "lto")
+set(CMAKE_INTERPROCEDURAL_OPTIMIZATION YES)
+list(APPEND HUNTER_TOOLCHAIN_UNDETECTABLE_ID "lto.v2")


Do not rely on Qt version tags but use latest head of 4.8 branch

--- qt4.cmake
+++ qt4.cmake
@@ -41,7 +41,7 @@
     DEPENDS             ${freetype2_NAME}
     PREFIX              ${BUILDEM_DIR}
 	GIT_REPOSITORY	${qt4_URL}
-	GIT_TAG		v4.8.5
+	GIT_TAG		4.8
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} echo "yes" | ${qt4_SRC_DIR}/configure # pipe "yes" to stdin to accept the license.


Updating Plugin CMake codes to better organize the Visual Studio and Xcode projects.

--- FilterParameterWidgets/SourceList.cmake
+++ FilterParameterWidgets/SourceList.cmake
@@ -64,9 +64,9 @@
 set(RegisterKnownFilterParameterWidgetsFile ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/RegisterKnownFilterParameterWidgets.cpp)

-cmp_IDE_SOURCE_PROPERTIES( "${PLUGIN_NAME}/FilterParameterWidgets" "${${PLUGIN_NAME}_ParameterWidgets_HDRS}" "${${PLUGIN_NAME}_ParameterWidgets_SRCS}" "0")
+cmp_IDE_SOURCE_PROPERTIES( "FilterParameterWidgets" "${${PLUGIN_NAME}_ParameterWidgets_MOC_HDRS}" "${${PLUGIN_NAME}_ParameterWidgets_SRCS}" "0")

-cmp_IDE_GENERATED_PROPERTIES("${PLUGIN_NAME}/FilterParameterWidgets/UI_Files" "${${PLUGIN_NAME}_ParameterWidgets_UIS}" "")
+cmp_IDE_GENERATED_PROPERTIES("FilterParameterWidgets/UI_Files" "${${PLUGIN_NAME}_ParameterWidgets_UIS}" "")

 # --------------------------------------------------------------------
 # and finally this will run moc:


fixes another small error in libdvid versioning

--- libdvidcpp.cmake
+++ libdvidcpp.cmake
@@ -12,7 +12,8 @@
 include (cppnetlib)

-set(LIBDVID_VERSION "df9ae21dc5ef24c8396e46c66e4d7db893376e93") # 2014-10-05
+set(DEFAULT_LIBDVID_VERSION "df9ae21dc5ef24c8396e46c66e4d7db893376e93") # 2014-10-05
+set(LIBDVID_VERSION "${DEFAULT_LIBDVID_VERSION}")

 external_git_repo (libdvidcpp
     ${LIBDVID_VERSION}
@@ -27,6 +28,7 @@
     DEPENDS             ${cppnetlib_NAME}
     PREFIX              ${BUILDEM_DIR}
     GIT_REPOSITORY      ${libdvidcpp_URL}
+    GIT_TAG             ${libdvidcpp_TAG}
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
     LIST_SEPARATOR      ^^


STYLE: Make Python3_ROOT_DIR user-visible

Move the exposure of Python3_ROOT_DIR to a more central
place to where its value is set.

--- CMake/ITKSetPython3Vars.cmake
+++ CMake/ITKSetPython3Vars.cmake
@@ -25,3 +25,7 @@
   set(Python3_EXECUTABLE ${_specified_Python3_EXECUTABLE} CACHE INTERNAL
     "Path to the Python interpreter" FORCE)
 endif()
+
+# Add user-visible cache entry
+set(Python3_ROOT_DIR ${Python3_ROOT_DIR} CACHE PATH
+  "Which installation or virtual environment of Python to use" FORCE)


adjusted data hash

adjusted data hash

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

 if(BUILD_TESTING)

-  set(revision_tag 57cfb02) # first 8 characters of hash-tag
+  set(revision_tag 57cfb02c) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


EHN: Updated CMakeExternals/PythonQt.cmake file to expose PythonQt Wrapping options

--- CMakeExternals/PythonQt.cmake
+++ CMakeExternals/PythonQt.cmake
@@ -14,6 +14,14 @@
     SET(proj PythonQt)
   #   MESSAGE(STATUS "Adding project:${proj}")
     SET(PythonQt_DEPENDS ${proj})
+
+    # Expose PythonQt options
+    SET(ep_PythonQt_args)
+    foreach(qtlib gui network opengl sql svg uitools webkit xml xmlpatterns)
+      OPTION(CTK_PythonQt_Wrap_Qt${qtlib} "Make all of Qt${qtlib} available in python" OFF)
+      MARK_AS_ADVANCED(CTK_PythonQt_Wrap_Qt${qtlib})
+      LIST(APPEND ep_PythonQt_args -DPythonQt_Wrap_Qt${qtlib}:BOOL=${CTK_PythonQt_Wrap_Qt${qtlib}})
+    endforeach()

     # Python is required
     FIND_PACKAGE(PythonLibs)
@@ -31,6 +39,7 @@
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
         -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}
         -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}
+        ${ep_PythonQt_args}
       )
     SET(PYTHONQT_INSTALL_DIR ${ep_install_dir})


ENH: Upgrade expat to 2.4.6

ENH: Upgrade expat to 2.4.6

--- SuperBuild/CMake/External_expat.cmake
+++ SuperBuild/CMake/External_expat.cmake
@@ -24,8 +24,8 @@

 ExternalProject_Add(EXPAT
   PREFIX EXPAT
-  URL "https://downloads.sourceforge.net/project/expat/expat/2.4.1/expat-2.4.1.tar.gz"
-  URL_MD5 8738ef9ed1c5dcc03207286ea84f4299
+  URL "https://downloads.sourceforge.net/project/expat/expat/2.4.6/expat-2.4.6.tar.gz"
+  URL_MD5 f1a94f57311ba32e7a525ab0a098cccf
   BINARY_DIR ${EXPAT_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}


BUG: Add Python3 CMake module workarounds to ITKModuleExternal

Ported from ITK/CMakeLists.txt

This prevents missing required Python related variables especially when
wrapping.

--- CMake/ITKModuleExternal.cmake
+++ CMake/ITKModuleExternal.cmake
@@ -11,8 +11,23 @@
   message(FATAL_ERROR "Modules can only be built against an ITK build tree; they cannot be built against an ITK install tree.")
 endif()

+if(ITK_WRAP_PYTHON)
+  if(DEFINED Python3_EXECUTABLE)
+    set(_specified_Python3_EXECUTABLE ${Python3_EXECUTABLE})
+  endif()
+  find_package(Python3 COMPONENTS Interpreter Development)
+  set(Python3_EXECUTABLE ${_specified_Python3_EXECUTABLE} CACHE INTERNAL
+    "Path to the Python interpreter" FORCE)
+else()
+  find_package(Python3 COMPONENTS Interpreter)
+endif()
+if(NOT Python3_EXECUTABLE AND _Python3_EXECUTABLE)
+  set(Python3_EXECUTABLE ${_Python3_EXECUTABLE} CACHE INTERNAL
+    "Path to the Python interpreter" FORCE)
+endif()
+
 # To hide dependent variables
-include( CMakeDependentOption )
+include(CMakeDependentOption)

 # Install rules when creating a Python package with scikit-build
 if(SKBUILD)


COMP: Only use the visibility flags if shared libraries are being built.

--- CMake/vtkCompilerExtras.cmake
+++ CMake/vtkCompilerExtras.cmake
@@ -38,7 +38,7 @@
   mark_as_advanced(VTK_USE_GCC_VISIBILITY)

   if(${_gcc_version} VERSION_GREATER 4.2.0 AND HAVE_GCC_VISIBILITY
-    AND VTK_USE_GCC_VISIBILITY)
+    AND VTK_USE_GCC_VISIBILITY AND BUILD_SHARED_LIBS)
     # Should only be set if GCC is newer than 4.2.0
     set(VTK_ABI_CXX_FLAGS "-fvisibility=hidden -fvisibility-inlines-hidden")
   else()


Change revision tag number

Change revision tag number

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

 if(BUILD_TESTING)

-  set(revision_tag 15d4ad4a)
+  set(revision_tag 0872af7b)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Add workaround for CMake issue #14983 This should be fixed but at least for the moment does not seem to be working on android, so explicitly add -pie flag for executables.

--- flags/fpic.cmake
+++ flags/fpic.cmake
@@ -17,10 +17,12 @@
   polly_add_cache_flag(CMAKE_C_FLAGS "-fPIC")
   polly_add_cache_flag(CMAKE_Fortran_FLAGS "-fPIC")
 else()
+  polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-fPIC")
   polly_add_cache_flag(CMAKE_CXX_FLAGS_INIT "-fPIC")
-  polly_add_cache_flag(CMAKE_C_FLAGS_INIT "-fPIC")
   polly_add_cache_flag(CMAKE_Fortran_FLAGS_INIT "-fPIC")
 endif()
+# CMake doesn't add "-pie" by default for executables (CMake issue #14983)
+polly_add_cache_flag(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")

 set(
     CMAKE_POSITION_INDEPENDENT_CODE


Force /usr/local/include as search path on FreeBSD

CMake does not find headers installed in /usr/local/include by default. On
FreeBSD this is the default location for libunwind.h though. Define
CMAKE_REQUIERED_INCLUDE to include both /usr/local/include and /usr/include.
This change only affects FreeBSD. Also FreeBSD (like Darwin) does not work with
_DEFAULT_SOURCE or _POSIX_C_SOURCE defined. Closes #547

--- src/pal/src/configure.cmake
+++ src/pal/src/configure.cmake
@@ -6,7 +6,9 @@
 include(CheckStructHasMember)
 include(CheckTypeSize)

-if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
+if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
+  set(CMAKE_REQUIRED_INCLUDES "/usr/local/include" "/usr/include")
+elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin)
   set(CMAKE_REQUIRED_DEFINITIONS "-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
 endif()
 check_include_files(ieeefp.h HAVE_IEEEFP_H)


added default find_file calls in case custom ones dont work

--- cmake/FindFFTWWrappers.cmake
+++ cmake/FindFFTWWrappers.cmake
@@ -5,6 +5,8 @@
 #
 # It sets the following variables:
 #   FFTWWrappers_FOUND          ... true if fftw is found on the system
+#   FFTWWrappers_GNU_LIBRARIES  ... list of library that were build with the GNU binary layout
+#   FFTWWrappers_INTEL_LIBRARIES  ... list of library that were build with the intel binary layout
 #   FFTWWrappers_LIBRARIES      ... list of library identifiers that were found (will be filled with serial/openmp/pthreads enabled file names if present, only stubs will be filled in not full paths)
 #   FFTWWrappers_MKL_LIBRARIES  ... list of library in the MKL that need to be linked to (intel64)
 #   FFTWWrappers_MKL_INCLUDE_DIR  ... folder containing fftw3.h
@@ -28,16 +30,35 @@

 #initialize library variables
 find_library(
-  FFTWWrappers_LIBRARIES
+  FFTWWrappers_GNU_LIBRARIES
   NAMES libfftw3xc_gnu libfftw3xc_gnu.a
   PATHS ${FFTWWrappers_ROOT}
   PATH_SUFFIXES "lib" "lib64"
   NO_DEFAULT_PATH
   )
+find_library(
+  FFTWWrappers_GNU_LIBRARIES
+  NAMES libfftw3xc_gnu libfftw3xc_gnu.a
+  )

+if(EXISTS ${FFTWWrappers_GNU_LIBRARIES})
+  get_filename_component(FFTWWrappers_LIBRARY_DIR ${FFTWWrappers_GNU_LIBRARIES} DIRECTORY)
+endif()

-if(EXISTS ${FFTWWrappers_LIBRARIES})
-  get_filename_component(FFTWWrappers_LIBRARY_DIR ${FFTWWrappers_LIBRARIES} DIRECTORY)
+find_library(
+  FFTWWrappers_INTEL_LIBRARIES
+  NAMES libfftw3xc_intel libfftw3xc_intel.a
+  PATHS ${FFTWWrappers_ROOT}
+  PATH_SUFFIXES "lib" "lib64"
+  NO_DEFAULT_PATH
+  )
+find_library(
+  FFTWWrappers_INTEL_LIBRARIES
+  NAMES libfftw3xc_intel libfftw3xc_intel.a
+)
+
+if(EXISTS ${FFTWWrappers_INTEL_LIBRARIES})
+  get_filename_component(FFTWWrappers_LIBRARY_DIR ${FFTWWrappers_INTEL_LIBRARIES} DIRECTORY)
 endif()

 ######################################### MKL related #####################################
@@ -124,9 +145,10 @@

 list(APPEND FFTWWrappers_MKL_LIBRARIES "m;pthread;dl")

-if(NOT FFTWWrappers_VERBOSE_FIND)
+if(NOT ${FFTW_FIND_QUIETLY})
   message("++ FindFFTWWrappers")
-  message("++ FFTWWrappers_LIBRARIES        : ${FFTWWrappers_LIBRARIES}")
+  message("++ FFTWWrappers_GNU_LIBRARIES    : ${FFTWWrappers_GNU_LIBRARIES}")
+  message("++ FFTWWrappers_INTEL_LIBRARIES  : ${FFTWWrappers_INTEL_LIBRARIES}")
   message("++ FFTWWrappers_LIBRARY_DIR      : ${FFTWWrappers_LIBRARY_DIR}")
   message("++ FFTWWrappers_MKL_LIBRARIES    : ${FFTWWrappers_MKL_LIBRARIES}")
   message("++ FFTWWrappers_MKL_LIBRARY_DIRS : ${FFTWWrappers_MKL_LIBRARY_DIRS}")
@@ -138,12 +160,16 @@

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(FFTWWrappers DEFAULT_MSG
-  FFTWWrappers_LIBRARIES
+  FFTWWrappers_GNU_LIBRARIES
 #  HANDLE_COMPONENTS
   )

+set(FFTWWrappers_LIBRARIES "${FFTWWrappers_GNU_LIBRARIES};${FFTWWrappers_INTEL_LIBRARIES}")
+
 mark_as_advanced(
   FFTWWrappers_LIBRARIES
+  FFTWWrappers_GNU_LIBRARIES
+  FFTWWrappers_INTEL_LIBRARIES
   FFTWWrappers_LIBRARY_DIR
   FFTWWrappers_MKL_LIBRARIES
   FFTWWrappers_MKL_LIBRARY_DIR


guard mmd and gp meta examples

guard mmd and gp meta examples

--- cmake/FindMetaExamples.cmake
+++ cmake/FindMetaExamples.cmake
@@ -24,13 +24,18 @@

     IF(NOT HAVE_NLOPT)
         LIST(APPEND EXCLUDED_META_EXAMPLES
-            gaussian_process/regression.sg)
+            gaussian_process/regression.sg
+            )
     ENDIF()

 	IF(NOT USE_GPL_SHOGUN)
 		LIST(APPEND EXCLUDED_META_EXAMPLES
 			multiclass/logistic_regression.sg
-			)
+      statistical_testing/linear_time_maximum_mean_discrepancy.sg
+      statistical_testing/quadratic_time_maximum_mean_discrepancy.sg
+      gaussian_process/classifier.sg
+      gaussian_process/regression.sg
+      )
 	ENDIF()

 	IF(NOT HAVE_LAPACK)
@@ -44,7 +49,7 @@
 			binary/multiple_kernel_learning.sg
 		)
 	ENDIF()
-
+  LIST(REMOVE_DUPLICATES EXCLUDED_META_EXAMPLES)
     SET(EXCLUDED_META_EXAMPLES ${EXCLUDED_META_EXAMPLES} PARENT_SCOPE)

 endfunction()


[axl_cmake] added setting: GCC_FLAG_DEBUG_INFO_RELEASE for adding debug info to release builds

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -251,6 +251,13 @@
 		)

 	axl_create_compiler_flag_setting(
+		GCC_FLAG_DEBUG_INFO_RELEASE
+		DESCRIPTION "Add debugging information to Release builds"
+		DEFAULT " "
+		" " "-g"
+		)
+
+	axl_create_compiler_flag_setting(
 		GCC_FLAG_C_STANDARD
 		DESCRIPTION "Specify the C standard to use"
 		"-std=c90" "-std=c99" "-std=c11" "-std=gnu90" "-std=gnu99" "-std=gnu11"


[CMake] Expand SWIFT_MODULE_DEPENDS_LINUX to Android

2633a0f3 expanded SWIFT_MODULE_DEPENDS_* to treat Linux and FreeBSD
separately. Android needs the same treatment as Linux, so expand the
Linux check to include Android as well. These changes fix an Android
build error, in which Glibc was not linked to private stdlib libraries
that relied upon it.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1204,7 +1204,7 @@
         elseif("${sdk}" STREQUAL "FREEBSD")
           list(APPEND swiftlib_module_depends_flattened
                ${SWIFTLIB_SWIFT_MODULE_DEPENDS_FREEBSD})
-        elseif("${sdk}" STREQUAL "LINUX")
+        elseif("${sdk}" STREQUAL "LINUX" OR "${sdk}" STREQUAL "ANDROID")
           list(APPEND swiftlib_module_depends_flattened
               ${SWIFTLIB_SWIFT_MODULE_DEPENDS_LINUX})
         endif()


build: fix a mixup with the cmake variables

This adjusts the windows build for cross-compiling to use the correct
variable.  Import libraries will be generated and tracked properly if
the CMAKE_SYSTEM_NAME is set to Windows.  It does not matter what the
build system is.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1312,7 +1312,7 @@
   # doing so will result in incorrect symbol resolution and linkage.  We created
   # import library targets when the library was added.  Use that to adjust the
   # link libraries.
-  if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
+  if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
     foreach(library_list LINK_LIBRARIES INTERFACE_LINK_LIBRARIES PRIVATE_LINK_LIBRARIES)
       set(import_libraries)
       foreach(library ${SWIFTLIB_SINGLE_${library_list}})


build: remove `SWIFT_COMPILE_FLAGS` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -679,7 +679,6 @@
 #     [SDK sdk]
 #     [ARCHITECTURE architecture]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
-#     [SWIFT_COMPILE_FLAGS flag1...]
 #     INSTALL_IN_COMPONENT comp
 #     source1 [source2 source3 ...])
 #
@@ -703,9 +702,6 @@
 #
 # LLVM_LINK_COMPONENTS
 #   LLVM components this library depends on.
-#
-# SWIFT_COMPILE_FLAGS
-#   Extra compile flags (Swift).
 #
 # INSTALL_IN_COMPONENT comp
 #   The Swift installation component that this library belongs to.
@@ -727,8 +723,7 @@
         SDK)
   set(SWIFTLIB_SINGLE_multiple_parameter_options
         GYB_SOURCES
-        LLVM_LINK_COMPONENTS
-        SWIFT_COMPILE_FLAGS)
+        LLVM_LINK_COMPONENTS)

   cmake_parse_arguments(SWIFTLIB_SINGLE
                         "${SWIFTLIB_SINGLE_options}"
@@ -800,20 +795,7 @@
   string(REPLACE swift "" module_name "${name}")

   if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
-    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
-      swift_windows_get_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY)
-      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS
-        -Xcc;-Xclang;-Xcc;-ivfsoverlay;-Xcc;-Xclang;-Xcc;${SWIFTLIB_SINGLE_VFS_OVERLAY})
-    endif()
     swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
-    foreach(directory ${SWIFTLIB_INCLUDE})
-      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;-isystem;-Xcc;${directory})
-    endforeach()
-    if("${SWIFTLIB_SINGLE_ARCHITECTURE}" MATCHES arm)
-      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)
-    endif()
-    list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS
-      -libc;${SWIFT_STDLIB_MSVC_RUNTIME_LIBRARY})
   endif()

   handle_swift_sources(
@@ -829,7 +811,6 @@
       SDK ${SWIFTLIB_SINGLE_SDK}
       ARCHITECTURE ${SWIFTLIB_SINGLE_ARCHITECTURE}
       MODULE_NAME ${module_name}
-      COMPILE_FLAGS ${SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS}
       ${embed_bitcode_arg}
       INSTALL_IN_COMPONENT "${SWIFTLIB_SINGLE_INSTALL_IN_COMPONENT}")
   add_swift_source_group("${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}")


[CMake] Always use @rpath for XCTest

[CMake] Always use @rpath for XCTest

rdar://problem/23942371

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -915,8 +915,12 @@

   if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     set(install_name_dir "@rpath")
+
     if(SWIFTLIB_SINGLE_IS_STDLIB)
-      set(install_name_dir "${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
+      # Always use @rpath for XCTest.
+      if(NOT "${module_name}" STREQUAL "XCTest")
+        set(install_name_dir "${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
+      endif()
     endif()

     set_target_properties("${target}"


Fix Windows dependency library names

Fix Windows dependency library names

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -951,10 +951,17 @@
   set(prefixed_link_libraries)
   foreach(dep ${SWIFTLIB_SINGLE_LINK_LIBRARIES})
     if("${dep}" MATCHES "^clang")
-      set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
-    endif()
-    if("${dep}" STREQUAL "cmark")
-      set(dep "${CMARK_LIBRARY_DIR}/lib${dep}.a")
+      if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
+        set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/${dep}.lib")
+      else()
+        set(dep "${LLVM_LIBRARY_OUTPUT_INTDIR}/lib${dep}.a")
+      endif()
+    elseif("${dep}" STREQUAL "cmark")
+      if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
+        set(dep "${CMARK_LIBRARY_DIR}/${dep}.lib")
+      else()
+        set(dep "${CMARK_LIBRARY_DIR}/lib${dep}.a")
+      endif()
     endif()
     list(APPEND prefixed_link_libraries "${dep}")
   endforeach()


FindRuby.cmake - switch to RbConfig::

FindRuby.cmake - switch to RbConfig::

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -15,28 +15,28 @@
    set(RUBY_FIND_QUIETLY TRUE)
 endif (RUBY_LIBRARY AND RUBY_INCLUDE_PATH)

-#   RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"archdir"@:>@)'`
-#   RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitearchdir"@:>@)'`
-#   RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"sitelibdir"@:>@)'`
-#   RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"libdir"@:>@)'`
-#   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",Config::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`
+#   RUBY_ARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"archdir"@:>@)'`
+#   RUBY_SITEARCHDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitearchdir"@:>@)'`
+#   RUBY_SITEDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"sitelibdir"@:>@)'`
+#   RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
+#   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`

 FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby1.8 ruby18 )

-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']"
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['archdir']"
    OUTPUT_VARIABLE RUBY_ARCH_DIR)

-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']"
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['libdir']"
    OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH)

-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubylibdir']"
    OUTPUT_VARIABLE RUBY_RUBY_LIB_PATH)

 # site_ruby
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitearchdir']"
    OUTPUT_VARIABLE RUBY_SITEARCH_DIR)

-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitelibdir']"
    OUTPUT_VARIABLE RUBY_SITELIB_DIR)

@@ -45,17 +45,17 @@
    OUTPUT_VARIABLE RUBY_VENDOR_ARG)

 IF(RUBY_VENDOR_ARG)
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
+    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
        OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)

-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']"
+    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorlibdir']"
        OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
 ELSE(RUBY_VENDOR_ARG)
     # fall back to site*dir
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
+    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitearchdir']"
        OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)

-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
+    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitelibdir']"
        OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
 ENDIF(RUBY_VENDOR_ARG)


fix the mkspecs install directory when cross-compiling using Qt5

REVIEW:128308

--- cmake/modules/QcaMacro.cmake
+++ cmake/modules/QcaMacro.cmake
@@ -19,7 +19,7 @@
     EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_HEADERS" OUTPUT_VARIABLE QT_HEADERS_DIR )
     EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DOCS" OUTPUT_VARIABLE QT_DOC_DIR )
     EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DATA" OUTPUT_VARIABLE QT_DATA_DIR )
-    EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_ARCHDATA" OUTPUT_VARIABLE QT_ARCHDATA_DIR )
+    EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_HOST_DATA" OUTPUT_VARIABLE QT_ARCHDATA_DIR )
     SET( QT_MKSPECS_DIR "${QT_ARCHDATA_DIR}/mkspecs" )
   ENDMACRO(SETUP_QT5_DIRS)
 ELSE (Qt5Core_FOUND)


AWM-4345 disable fuzzy matching

AWM-4345 disable fuzzy matching

--- cmake/scripts/msgmerge.cmake
+++ cmake/scripts/msgmerge.cmake
@@ -1,6 +1,6 @@
 if (EXISTS ${lang_file})
     execute_process(
-        COMMAND ${MSGMERGE} --update ${lang_file} ${POT_FILE}
+        COMMAND ${MSGMERGE} --no-fuzzy-matching --update ${lang_file} ${POT_FILE}
         OUTPUT_QUIET ERROR_QUIET
     )
 else()


update compiler.cmake

update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -63,7 +63,7 @@
  if (TUDAT_BUILD_CLANG)
      add_compile_definitions(TUDAT_BUILD_CLANG)
      if(WIN32)
-      add_definitions("-D_ENABLE_EXTENDED_ALIGNED_STORAGE")
+      add_definitions("-D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_MD")
      endif()
      message(STATUS "Using clang compiler.")
      set(CMAKE_C_FLAGS "-Wall -std=c11")
@@ -76,7 +76,7 @@
      elseif (NOT WIN32)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
      else()
-         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -Wno-unused-result")
+         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -Wno-unused-result -D_MD")
      endif ()
      set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -90,7 +90,7 @@
      message(STATUS "Using clang compiler.")

      # set default cmake c flags for clang
-     set(CMAKE_C_FLAGS "-Wall -std=c11")
+     set(CMAKE_C_FLAGS "-Wall -std=c11 ${CFLAGS}")
      set(CMAKE_C_FLAGS_DEBUG "-g")
      set(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
      set(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG")


CMake, Add doc target, whose depends of doxygen.

	* build-aux/cmake/modules/Doxygen.cmake: Here.

--- build-aux/cmake/modules/Doxygen.cmake
+++ build-aux/cmake/modules/Doxygen.cmake
@@ -126,6 +126,8 @@

   add_custom_target(doxygen ${DOXYGEN_EXECUTABLE} ${DOXY_CONFIG})
   add_dependencies(doxygen doxygen_mainpage)
+  add_custom_target(doc)
+  add_dependencies(doc doxygen)

   # create a windows help .chm file using hhc.exe
   # HTMLHelp DLL must be in path!


Removed buildid from the tarball name and internal directory.

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -64,8 +64,8 @@
 set(CPACK_SOURCE_STRIP_FILES TRUE)

 # here is where we can
-if (PLATFORM AND BUILDID)
-  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_VER}-${PLATFORM}-${BUILDID}" )
+if (PLATFORM)
+  set (CPACK_PACKAGE_FILE_NAME "${CONDOR_VER}-${PLATFORM}" )
 else()
   set (CPACK_PACKAGE_FILE_NAME "${CONDOR_VER}-${OS_NAME}-${SYS_ARCH}" )
 endif()


Add ldc2 to the auto-detection of the compiler

Closes issue #12

--- cmake-d/CMakeDetermineDCompiler.cmake
+++ cmake-d/CMakeDetermineDCompiler.cmake
@@ -44,7 +44,7 @@
   if(CMAKE_D_COMPILER_INIT)
     set(CMAKE_D_COMPILER_LIST ${CMAKE_D_COMPILER_INIT})
   else()
-    set(CMAKE_D_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gdc ${_CMAKE_TOOLCHAIN_PREFIX}dmd)
+    set(CMAKE_D_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gdc ${_CMAKE_TOOLCHAIN_PREFIX}dmd  ${_CMAKE_TOOLCHAIN_PREFIX}ldc2)
   endif()

   # Find the compiler.


Added support for additional search paths defined for the brew install on MAC

--- cmake/CMakeModules/FindOpenJPEG.cmake
+++ cmake/CMakeModules/FindOpenJPEG.cmake
@@ -21,6 +21,7 @@
 FIND_PATH(OPENJPEG_INCLUDE_DIR openjpeg.h
   PATHS
     /usr/local/include/openjpeg
+    /usr/local/include/openjpeg-1.5
     /usr/local/include
     /usr/include/openjpeg
     /usr/include
@@ -28,8 +29,11 @@
     openjpeg-2.1
   DOC "Location of OpenJPEG Headers"
 )
+FIND_LIBRARY(MINIZIP_LIBRARY NAMES ${MINIZIP_NAMES} )
+MARK_AS_ADVANCED( MINIZIP_LIBRARY MINIZIP_INCLUDE_DIR )

 SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjp2)
+SET(OPENJPEG_NAMES ${OPENJPEG_NAMES} openjpeg)
 FIND_LIBRARY(OPENJPEG_LIBRARY
   NAMES ${OPENJPEG_NAMES}
   PATHS /usr/lib /usr/local/lib
@@ -42,7 +46,6 @@
   SET(OPENJPEG_FOUND "NO")
 ENDIF (OPENJPEG_LIBRARY AND OPENJPEG_INCLUDE_DIR)

-
 IF (OPENJPEG_FOUND)
    IF (NOT OPENJPEG_FIND_QUIETLY)
       MESSAGE(STATUS "Found OpenJPEG: ${OPENJPEG_LIBRARIES}")


Set version to 1.8.21.

Set version to 1.8.21.

--- cmake/CMakeModules/OssimVersion.cmake
+++ cmake/CMakeModules/OssimVersion.cmake
@@ -1,6 +1,6 @@
 SET(OSSIM_MAJOR_VERSION_NUMBER "1")
 SET(OSSIM_MINOR_VERSION_NUMBER "8")
-SET(OSSIM_PATCH_VERSION_NUMBER "19")
+SET(OSSIM_PATCH_VERSION_NUMBER "21")
 SET(OSSIM_RELEASE_NUMBER "1")
 SET(OSSIM_VERSION "${OSSIM_MAJOR_VERSION_NUMBER}.${OSSIM_MINOR_VERSION_NUMBER}.${OSSIM_PATCH_VERSION_NUMBER}" )
 SET(OSSIM_SOVERSION "${OSSIM_MAJOR_VERSION_NUMBER}" )