CMake: clean up dependencies discovery

CMake: clean up dependencies discovery

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -13,52 +13,13 @@

 # OGRE_DEPENDENCIES_DIR can be used to specify a single base
 # folder where the required dependencies may be found.
-set(OGRE_DEPENDENCIES_DIR "" CACHE PATH "Path to prebuilt OGRE dependencies")
-option(OGRE_BUILD_DEPENDENCIES "automatically build Ogre Dependencies (freetype, zzip)" TRUE)
-
-include(FindPkgMacros)
-getenv_path(OGRE_DEPENDENCIES_DIR)
-if(OGRE_BUILD_PLATFORM_EMSCRIPTEN)
-  set(OGRE_DEP_SEARCH_PATH
-    ${OGRE_DEPENDENCIES_DIR}
-    ${EMSCRIPTEN_ROOT_PATH}/system
-    ${ENV_OGRE_DEPENDENCIES_DIR}
-    "${PROJECT_BINARY_DIR}/EmscriptenDependencies"
-    "${PROJECT_SOURCE_DIR}/EmscriptenDependencies"
-    "${PROJECT_BINARY_DIR}/../EmscriptenDependencies"
-    "${PROJECT_SOURCE_DIR}/../EmscriptenDependencies"
-  )
-elseif(APPLE_IOS)
-  set(OGRE_DEP_SEARCH_PATH
-    ${OGRE_DEPENDENCIES_DIR}
-    ${ENV_OGRE_DEPENDENCIES_DIR}
-    "${PROJECT_BINARY_DIR}/iOSDependencies"
-    "${PROJECT_SOURCE_DIR}/iOSDependencies"
-    "${PROJECT_BINARY_DIR}/../iOSDependencies"
-    "${PROJECT_SOURCE_DIR}/../iOSDependencies"
-  )
-elseif(OGRE_BUILD_PLATFORM_ANDROID)
-  set(OGRE_DEP_SEARCH_PATH
-    ${OGRE_DEPENDENCIES_DIR}
-    ${ENV_OGRE_DEPENDENCIES_DIR}
-    "${PROJECT_BINARY_DIR}/AndroidDependencies"
-    "${PROJECT_SOURCE_DIR}/AndroidDependencies"
-    "${PROJECT_BINARY_DIR}/../AndroidDependencies"
-    "${PROJECT_SOURCE_DIR}/../AndroidDependencies"
-  )
-else()
-  set(OGRE_DEP_SEARCH_PATH
-    ${OGRE_DEPENDENCIES_DIR}
-    ${ENV_OGRE_DEPENDENCIES_DIR}
-    "${PROJECT_BINARY_DIR}/Dependencies"
-    "${PROJECT_SOURCE_DIR}/Dependencies"
-    "${PROJECT_BINARY_DIR}/../Dependencies"
-    "${PROJECT_SOURCE_DIR}/../Dependencies"
-  )
-endif()
-
-message(STATUS "Search path: ${OGRE_DEP_SEARCH_PATH}")
-list(GET OGRE_DEP_SEARCH_PATH 0 OGREDEPS_PATH)
+set(OGRE_DEPENDENCIES_DIR "${PROJECT_BINARY_DIR}/Dependencies" CACHE PATH "Path to prebuilt OGRE dependencies")
+option(OGRE_BUILD_DEPENDENCIES "automatically build Ogre Dependencies (SDL2, pugixml)" TRUE)
+
+message(STATUS "DEPENDENCIES_DIR: ${OGRE_DEPENDENCIES_DIR}")
+
+set(OGREDEPS_PATH "${OGRE_DEPENDENCIES_DIR}")
+set(OGRE_DEP_SEARCH_PATH "${OGRE_DEPENDENCIES_DIR}")

 if(CMAKE_CROSSCOMPILING)
     set(CMAKE_FIND_ROOT_PATH ${OGREDEPS_PATH} "${CMAKE_FIND_ROOT_PATH}")
@@ -334,18 +295,3 @@
 # Find Softimage SDK
 find_package(Softimage)
 macro_log_feature(Softimage_FOUND "Softimage" "Softimage SDK needed for building XSIExporter" FALSE "6.0" "")
-
-#######################################################################
-# Tests
-#######################################################################
-
-# now see if we have a buildable Dependencies package in
-# the source tree. If so, include that, and it will take care of
-# setting everything up, including overriding any of the above
-# findings.
-set(OGREDEPS_RUNTIME_OUTPUT ${OGRE_RUNTIME_OUTPUT})
-if (EXISTS "${PROJECT_SOURCE_DIR}/Dependencies/CMakeLists.txt")
-  add_subdirectory(Dependencies)
-elseif (EXISTS "${PROJECT_SOURCE_DIR}/ogredeps/CMakeLists.txt")
-  add_subdirectory(ogredeps)
-endif ()


Dependencies: update assimp

Dependencies: update assimp

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -142,10 +142,10 @@

       message(STATUS "Building Assimp")
       file(DOWNLOAD
-          https://github.com/assimp/assimp/archive/v5.1.3.tar.gz
-          ${PROJECT_BINARY_DIR}/v5.1.3.tar.gz)
+          https://github.com/assimp/assimp/archive/v5.1.6.tar.gz
+          ${PROJECT_BINARY_DIR}/v5.1.6.tar.gz)
       execute_process(COMMAND ${CMAKE_COMMAND}
-          -E tar xf v5.1.3.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
+          -E tar xf v5.1.6.tar.gz WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
       execute_process(COMMAND ${BUILD_COMMAND_COMMON}
           -DZLIB_ROOT=${OGREDEPS_PATH}
           -DBUILD_SHARED_LIBS=OFF
@@ -153,10 +153,10 @@
           -DASSIMP_NO_EXPORT=TRUE
           -DASSIMP_BUILD_OGRE_IMPORTER=OFF
           -DASSIMP_BUILD_ASSIMP_TOOLS=OFF
-          ${PROJECT_BINARY_DIR}/assimp-5.1.3
-          WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/assimp-5.1.3)
+          ${PROJECT_BINARY_DIR}/assimp-5.1.6
+          WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/assimp-5.1.6)
       execute_process(COMMAND ${CMAKE_COMMAND}
-        --build ${PROJECT_BINARY_DIR}/assimp-5.1.3 ${BUILD_COMMAND_OPTS})
+        --build ${PROJECT_BINARY_DIR}/assimp-5.1.6 ${BUILD_COMMAND_OPTS})
       # RelWithDebInfo has Release ABI
       if(NOT OGRE_DEBUG_MODE)
         file(REMOVE ${OGREDEPS_PATH}/lib/cmake/assimp-5.1/assimpTargets-debug.cmake)


Use SEMICOLON generator expression in arg list

This enables the OSX architectures to be passes on the command line
like other variables.

Change-Id: If69b62ff440ebb0f38f393b2530ef9260f159951

--- CMake/VariableList.cmake
+++ CMake/VariableList.cmake
@@ -47,7 +47,9 @@
   foreach( var IN LISTS ${var_list} )
     if( NOT ${var} STREQUAL "" ) # if variable has been set
       get_property( type CACHE ${var} PROPERTY TYPE )
-      list( APPEND _args "-D${var}:${type}=${${var}}" )
+      set(value ${${var}})
+      STRING( REPLACE ";" "$<SEMICOLON>" value "${value}" )
+      list( APPEND _args "-D${var}:${type}=${value}" )
     endif()
   endforeach()
   set( ${args} "${_args}" PARENT_SCOPE)


setting hdf5 directories

setting hdf5 directories

--- CMakeExternals/ITK.cmake
+++ CMakeExternals/ITK.cmake
@@ -56,10 +56,11 @@

   ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
-     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/InsightToolkit-4.9.0.tar.xz
-     URL_MD5 0ce83c0f3c08f8ee992675fca4401572
+     URL /media/neher/Rumpelkammer/toolkits/InsightToolkit-4.11.0.tar.gz
+     #URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/InsightToolkit-4.9.0.tar.xz
+     #URL_MD5 0ce83c0f3c08f8ee992675fca4401572
      # work with external GDCM
-     PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/ITK-4.9.0.patch
+     #PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/ITK-4.9.0.patch
      CMAKE_GENERATOR ${gen}
      CMAKE_ARGS
        ${ep_common_args}
@@ -67,6 +68,11 @@
        -DBUILD_EXAMPLES:BOOL=OFF
        -DITK_USE_SYSTEM_GDCM:BOOL=ON
        -DITK_USE_SYSTEM_HDF5:BOOL=ON
+       -DHDF5_DIR=${ep_prefix}
+       -DHDF5_hdf5_LIBRARY_DEBUG=${ep_prefix}/lib
+       -DHDF5_hdf5_LIBRARY_RELEASE=${ep_prefix}/lib
+       -DHDF5_hdf5_cpp_LIBRARY_DEBUG=${ep_prefix}/lib
+       -DHDF5_hdf5_cpp_LIBRARY_RELEASE=${ep_prefix}/lib
        -DGDCM_DIR:PATH=${GDCM_DIR}
      CMAKE_CACHE_ARGS
        ${ep_common_cache_args}


Automatically enable VTK 5.8 if gcc >= 4.6.

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -46,12 +46,22 @@
      )
   endif()

-  option(MITK_USE_VTK_5_8_IN_SUPERBUILD OFF)
+  option(MITK_USE_VTK_5_8_IN_SUPERBUILD "Use VTK 5.8 in MITK superbuild" OFF)
+
+  include(mitkFunctionGetGccVersion)
+  mitkFunctionGetGccVersion(${CMAKE_CXX_COMPILER} GCC_VERSION)
+  if(NOT ${GCC_VERSION} VERSION_LESS "4.6")
+    if(NOT MITK_USE_VTK_5_8_IN_SUPERBUILD)
+      message("Forcing VTK 5.8 since we're using gcc ${GCC_VERSION}")
+    endif()
+    set(MITK_USE_VTK_5_8_IN_SUPERBUILD ON CACHE BOOL "Use VTK 5.8 in MITK superbuild" FORCE)
+  endif()
+
   if(CMAKE_CXX_COMPILER MATCHES clang)
     if(NOT MITK_USE_VTK_5_8_IN_SUPERBUILD)
-      MESSAGE(STATUS "Forcing VTK 5.8 since we're using clang")
+      message("Forcing VTK 5.8 since we're using clang")
     endif()
-    SET(MITK_USE_VTK_5_8_IN_SUPERBUILD ON CACHE BOOL "Use VTK 5.8 in MITK superbuild" FORCE)
+    set(MITK_USE_VTK_5_8_IN_SUPERBUILD ON CACHE BOOL "Use VTK 5.8 in MITK superbuild" FORCE)
   endif()
   if(MITK_USE_VTK_5_8_IN_SUPERBUILD)
     set(VTK_URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/vtk-5.8.0.tar.gz)


ifdeffed -Wno-unused-local-typedefs

ifdeffed -Wno-unused-local-typedefs

[git-p4: depot-paths = "//sw/gpgpu/nvbio/main/": change = 18790824]

--- cmake-local/gcc.cmake
+++ cmake-local/gcc.cmake
@@ -2,7 +2,10 @@
     # common GCC compiler flags
     # we add -Wno-unknown-pragmas because of nvcc's #pragma unroll
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wstrict-aliasing=0")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wstrict-aliasing=0 -Wno-unused-local-typedefs")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wstrict-aliasing=0")
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.8)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
+    endif()

     set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
     if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "Intel")


removed -Wunused-local_typedefs
added platform detection

[git-p4: depot-paths = "//sw/gpgpu/nvbio/main/": change = 18790542]

--- cmake-local/gcc.cmake
+++ cmake-local/gcc.cmake
@@ -2,8 +2,12 @@
     # common GCC compiler flags
     # we add -Wno-unknown-pragmas because of nvcc's #pragma unroll
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wstrict-aliasing=0")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wstrict-aliasing=0")
-    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -msse4.2")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wstrict-aliasing=0 -Wunused-local-typedefs=0")
+
+    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
+    if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "Intel")
+        set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -msse4.2 -mpopcnt")
+    endif()

     if(WERROR)
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")


marked include/libraries as advanced

marked include/libraries as advanced

svn path=/trunk/playground/base/strigi/; revision=560469

--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
@@ -30,3 +30,8 @@
     MESSAGE(FATAL_ERROR "Could not find Iconv")
   ENDIF(Iconv_FIND_REQUIRED)
 ENDIF(Iconv_FOUND)
+
+MARK_AS_ADVANCED(
+  ICONV_INCLUDE_DIR
+  ICONV_LIBRARY
+)


[CMake] Detecting python modules should be cached

Summary: This requres exec-ing python, which in a trace I ran of the CMake re-configure time took ~2% of the reconfigure time.

Reviewers: phosek, smeenai, compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -606,16 +606,19 @@
   string(REPLACE "." "_" module_name ${module})
   string(TOUPPER ${module_name} module_upper)
   set(FOUND_VAR PY_${module_upper}_FOUND)
+  if (DEFINED ${FOUND_VAR})
+    return()
+  endif()

   execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import ${module}"
     RESULT_VARIABLE status
     ERROR_QUIET)

   if(status)
-    set(${FOUND_VAR} 0 PARENT_SCOPE)
+    set(${FOUND_VAR} OFF CACHE BOOL "Failed to find python module '${module}'")
     message(STATUS "Could NOT find Python module ${module}")
   else()
-    set(${FOUND_VAR} 1 PARENT_SCOPE)
+  set(${FOUND_VAR} ON CACHE BOOL "Found python module '${module}'")
     message(STATUS "Found Python module ${module}")
   endif()
 endfunction()


revert to -O3 (slightly faster MLPs and convnets compared to -O2)

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -16,8 +16,8 @@
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fno-common")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
         set(CMAKE_CXX_FLAGS_DEBUG               "-g -fno-omit-frame-pointer")
-        set(CMAKE_CXX_FLAGS_RELEASE             "-O2 -DNDEBUG")                         # -DEIGEN_NO_DEBUG")
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO      "-O2 -g -fno-omit-frame-pointer")       # -DEIGEN_NO_DEBUG")
+        set(CMAKE_CXX_FLAGS_RELEASE             "-O3 -DNDEBUG")                         # -DEIGEN_NO_DEBUG")
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO      "-O3 -g -fno-omit-frame-pointer")       # -DEIGEN_NO_DEBUG")
         set(CMAKE_CXX_FLAGS_MINSIZEREL          "-Os -DNDEBUG")                         # -DEIGEN_NO_DEBUG")

         if(NOT CMAKE_CXX_COMPILER_ID MATCHES AppleClang)


Updates cmake output and handling of non-compatible compilers.

- CUDA in combination with gcc or clang
- Fibers + CUDA back-ends cannot be enabled at the same time
- cmake throws an error when using clang <4 (instead of a warning)

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -118,7 +118,12 @@
 #-------------------------------------------------------------------------------
 # Check supported compilers.
 IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
-    MESSAGE(WARNING "Clang versions < 4.0 are not supported!")
+    MESSAGE(FATAL_ERROR "Clang versions < 4.0 are not supported!")
+    SET(_ALPAKA_FOUND FALSE)
+ENDIF()
+
+IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE AND ALPAKA_ACC_GPU_CUDA_ENABLE)
+    MESSAGE(FATAL_ERROR "Fibers and CUDA back-end can not be enabled both at the same time.")
     SET(_ALPAKA_FOUND FALSE)
 ENDIF()

@@ -391,11 +396,11 @@
                 ELSEIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
                     IF(CUDA_VERSION VERSION_EQUAL 8.0)
                         IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 4.0)
-                            MESSAGE(FATAL_ERROR "NVCC 8.0 does not support clang 4+. Please use clang 3.9!")
+                            MESSAGE(FATAL_ERROR "NVCC 8.0 does not support clang 4+. Please use NVCC 9.1!")
                         ENDIF()
                     ELSEIF(CUDA_VERSION VERSION_EQUAL 9.0)
                         IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 4.0)
-                            MESSAGE(FATAL_ERROR "NVCC 9.0 does not support clang 4+. Please use clang 3.9!")
+                            MESSAGE(FATAL_ERROR "NVCC 9.0 does not support clang 4+. Please use NVCC 9.1!")
                         ENDIF()
                     ELSEIF(CUDA_VERSION VERSION_EQUAL 9.1)
                         IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 5.0)
@@ -403,7 +408,7 @@
                         ENDIF()
                     ELSEIF(CUDA_VERSION VERSION_EQUAL 9.2)
                         IF(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6.0)
-                            MESSAGE(FATAL_ERROR "NVCC 9.2 does not support clang 6+. Please use clang 4 or 5!")
+                            MESSAGE(FATAL_ERROR "NVCC 9.2 does not support clang 6+ and fails compiling with clang 5. Please use clang 4!")
                         ENDIF()
                     ENDIF()
                 ENDIF()


Create vivado P&R directory prior to invoking Vivado.

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- xc7/make/vivado.cmake
+++ xc7/make/vivado.cmake
@@ -408,6 +408,11 @@
   # Run vivado in another directory.
   set(WORK_DIR ${BASE_WORK_DIR}/vivado_pnr)
   string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" ""  WORK_DIR ${WORK_DIR})
+  add_custom_command(
+      OUTPUT ${WORK_DIR}
+      COMMAND ${CMAKE_COMMAND} -E make_directory ${WORK_DIR}
+      )
+  list(APPEND DEPS ${WORK_DIR})

   COMMON_VIVADO_TARGETS(
       NAME ${NAME}


Change the cacheappend argument to allow multiple args, with each appending
to the values from prior args.  This allows setting multiple vars without
having to create a separate file.

SVN-Revision: 2027

--- package.cmake
+++ package.cmake
@@ -70,7 +70,9 @@
     string(REGEX REPLACE "^outdir=" "" arg_outdir "${arg}")
   endif ()
   if (${arg} MATCHES "^cacheappend=")
-    string(REGEX REPLACE "^cacheappend=" "" arg_cacheappend "${arg}")
+    # support multiple, appending each time
+    string(REGEX REPLACE "^cacheappend=" "" entry "${arg}")
+    set(arg_cacheappend "${arg_cacheappend}\n${entry}")
   endif ()
   if (${arg} MATCHES "^cpackappend=")
     string(REGEX REPLACE "^cpackappend=" "" arg_cpackappend "${arg}")


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


remove unneeded compiler option for c++

remove unneeded compiler option for c++

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -2,10 +2,10 @@

 include(CheckCCompilerFlag)

-if (UNIX)
+if (UNIX)
   if (CMAKE_COMPILER_IS_GNUCC)
     if (WITH_CXX)
-       add_definitions(-g -std=c++0x -Weffc++ -Wall -Wextra -Wunused)
+       add_definitions(-g -Weffc++ -Wall -Wextra -Wunused)
     else()
        add_definitions(-g -std=c99 -Wall -Wextra -Wunused)
     endif (WITH_CXX)


ENH: update RTK remote file with release tag v2.0.1

--- Modules/Remote/RTK.remote.cmake
+++ Modules/Remote/RTK.remote.cmake
@@ -2,5 +2,5 @@
 itk_fetch_module(RTK
     "Reconstruction Toolkit (RTK) http://www.openrtk.org/"
   GIT_REPOSITORY ${git_protocol}://github.com/SimonRit/RTK.git
-  GIT_TAG db27af04eaf24bdbaa4c2c2020e067586d3c6341
+  GIT_TAG v2.0.1
 )


fix include_directories

fix include_directories

--- ex3_gtest_gmock/cmake/add_dl_project.cmake
+++ ex3_gtest_gmock/cmake/add_dl_project.cmake
@@ -37,7 +37,7 @@
     # include directories
     foreach(loop_inc_var ${DL_ARGS_INCLUDE_DIRS})
           #target_include_directories(gtest INTERFACE "${CMAKE_BINARY_DIR}/${DL_ARGS_PROJ}-src/${loop_inc_var}")
-          include_directories(${DL_ARGS_PROJ} INTERFACE "${CMAKE_BINARY_DIR}/${DL_ARGS_PROJ}-src/${loop_inc_var}")
+          include_directories("${CMAKE_BINARY_DIR}/${DL_ARGS_PROJ}-src/${loop_inc_var}")
     endforeach()

 endfunction()


Passes arguments on to HunterGate

Passes arguments on to HunterGate

--- scripts/AddHunter.cmake
+++ scripts/AddHunter.cmake
@@ -23,7 +23,7 @@
   if(NOT HUNTER_ROOT AND "$ENV{HUNTER_ROOT}" STREQUAL "")
     set(HUNTER_ROOT "${ih_HUNTER_ROOT}" CACHE PATH "Hunter root dir")
   endif()
-  HunterGate(URL ${ih_URL} SHA1 ${ih_SHA1} LOCAL)
+  HunterGate(URL ${ih_URL} SHA1 ${ih_SHA1} ${ih_UNPARSED_ARGUMENTS})
   if(NOT ih_NO_COOKOFF_RECIPES)
     set(HUNTER_REPOSITORY_cookoff_DIRECTORY ${GREAT_CMAKE_COOKOFF_HUNTER_RECIPES_DIR})
     set(HUNTER_REPOSITORY_cookoff_URL "local")


STYLE: Remove CMake-language block-end command arguments

Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the block.
This is no longer the preferred style.

--- Common.cmake
+++ Common.cmake
@@ -32,7 +32,7 @@
 # list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
 # if("${isSystemDir}" STREQUAL "-1")
 #   set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-# endif("${isSystemDir}" STREQUAL "-1")
+# endif()
 #####################################################################################################

 set(USE_ITKv5 ON)


build: remove `ALL_POSIX_PLATFORMS` which is no longer used

Cleanup some CMake logic that we no longer need as the entire code base
now builds on all the targets.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1693,7 +1693,6 @@
   if("${SWIFTLIB_TARGET_SDKS}" STREQUAL "")
     set(SWIFTLIB_TARGET_SDKS ${SWIFT_SDKS})
   endif()
-  list_replace(SWIFTLIB_TARGET_SDKS ALL_POSIX_PLATFORMS "ALL_APPLE_PLATFORMS;ANDROID;CYGWIN;FREEBSD;LINUX;HAIKU")
   list_replace(SWIFTLIB_TARGET_SDKS ALL_APPLE_PLATFORMS "${SWIFT_APPLE_PLATFORMS}")

   # All Swift code depends on the standard library, except for the standard


CMake hack to work around gcc-4.1 lack of pragma warning disable processing.

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -128,6 +128,13 @@
   # Let's actually get a numerical version of gxx's version
   STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION_NUMBER ${CXX_VERSION})

+  # Hacks to work around gcc 4.1 TC build pool machines which can't process pragma warning disables
+  # This is pure rubbish; I wish there was another way.
+  #
+  if(${CXX_VERSION_NUMBER} LESS 420)
+    set(CMAKE_CXX_FLAGS "-Wno-deprecated -Wno-unitialized -Wno-unused-variable -Wno-unused-function ${CMAKE_CXX_FLAGS}")
+  endif (${CXX_VERSION_NUMBER} LESS 420)
+
   # gcc 4.3 and above don't like the LL boost and also
   # cause warnings due to our use of deprecated headers
   if(${CXX_VERSION_NUMBER} GREATER 429)


define variant_CONFIG_SELECT_VARIANT

define variant_CONFIG_SELECT_VARIANT

--- src/common.cmake
+++ src/common.cmake
@@ -13,6 +13,7 @@
 add_compile_options(-Wall)
 add_compile_options(-Werror)
 add_compile_options(-O2)
+add_compile_options(-Dvariant_CONFIG_SELECT_VARIANT=variant_VARIANT_NONSTD)
 add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++14>)
 add_compile_options($<$<COMPILE_LANGUAGE:C>:-fobjc-arc>)
 add_compile_options($<$<COMPILE_LANGUAGE:C>:-fmodules>)


Tweak the OSS gflags dependency inference logic

Summary:
The current logic for "which gflags library should we use" checks for
the first library (e.g., libgflags vs. libgflags-shared) listed as a TARGET.
Unfortunately, on some number of systems, the gflags-config.cmake (read:
the file that is supposed to tell you how to use gflags with cmake) actually
defines (but doesn't use!) libraries that don't exist (!) so this logic breaks.

Instead, use the system defined gflags_LIBRARIES variable which explicitly
tells us which library to use.

Reviewed By: yfeldblum, simpkins

Differential Revision: D14512966

fbshipit-source-id: add4ecf6bade502b2d12aad2bdfcf0476eeba465

--- CMake/folly-deps.cmake
+++ CMake/folly-deps.cmake
@@ -25,14 +25,13 @@
 find_package(gflags CONFIG QUIET)
 if (gflags_FOUND)
   message(STATUS "Found gflags from package config")
+  message(STATUS "gflags_CONFIG=${gflags_CONFIG}")
   set(FOLLY_HAVE_LIBGFLAGS ON)
-  if (TARGET gflags-shared)
-    list(APPEND FOLLY_SHINY_DEPENDENCIES gflags-shared)
-  elseif (TARGET gflags)
-    list(APPEND FOLLY_SHINY_DEPENDENCIES gflags)
-  else()
-    message(FATAL_ERROR "Unable to determine the target name for the GFlags package.")
-  endif()
+  # ${GFLAGS_TARGET} contains the desired gflags target to depend on.
+  # The ${gflags_LIBRARIES} variable is an alias to it, and is more compatible
+  # with older versions of gflags.
+  message(STATUS "Using gflags libraries ${gflags_LIBRARIES}")
+  list(APPEND FOLLY_SHINY_DEPENDENCIES ${gflags_LIBRARIES})
   list(APPEND CMAKE_REQUIRED_LIBRARIES ${GFLAGS_LIBRARIES})
   list(APPEND CMAKE_REQUIRED_INCLUDES ${GFLAGS_INCLUDE_DIR})
 else()


SVN_SILENT made messages (.desktop file)

--- ds9/ds9.desktop.cmake
+++ ds9/ds9.desktop.cmake
@@ -36,6 +36,7 @@
 Name[ug]=DirectShow9
 Name[uk]=DirectShow9
 Name[x-test]=xxDirectShow9xx
+Name[zh_CN]=DirectShow9
 Name[zh_TW]=DirectShow9

 Comment=Phonon DirectShow9 backend
@@ -65,4 +66,5 @@
 Comment[sv]=Phonon Directshow 9-gränssnitt
 Comment[uk]=Модуль DirectShow9 для Phonon
 Comment[x-test]=xxPhonon DirectShow9 backendxx
+Comment[zh_CN]=Phonon DirectShow9 后端
 Comment[zh_TW]=Phonon DirectShow9 後端介面


Fix dependency order of Photoacoustics plugins

--- Plugins/PluginList.cmake
+++ Plugins/PluginList.cmake
@@ -76,6 +76,8 @@
   org.mitk.gui.qt.tofutil:OFF
   org.mitk.gui.qt.tubegraph:OFF
   org.mitk.gui.qt.ugvisualization:OFF
+  org.mitk.gui.qt.photoacoustics.pausviewer:OFF
+  org.mitk.gui.qt.photoacoustics.imageprocessing:OFF
   org.mitk.gui.qt.ultrasound:OFF
   org.mitk.gui.qt.volumevisualization:OFF
   org.mitk.gui.qt.eventrecorder:OFF
@@ -95,7 +97,5 @@
   org.mitk.gui.qt.matchpoint.visualizer:OFF
   org.mitk.gui.qt.matchpoint.evaluator:OFF
   org.mitk.gui.qt.matchpoint.manipulator:OFF
-  org.mitk.gui.qt.photoacoustics.pausviewer:OFF
-  org.mitk.gui.qt.photoacoustics.imageprocessing:OFF
   org.mitk.gui.qt.cest:OFF
 )


ENH: Upgrade GEOS to 1.7.1

ENH: Upgrade GEOS to 1.7.1

--- SuperBuild/CMake/External_geos.cmake
+++ SuperBuild/CMake/External_geos.cmake
@@ -26,8 +26,8 @@
   set(GEOS_URL "https://download.osgeo.org/geos/geos-3.6.5.tar.bz2")
   set(GEOS_MD5 5ddbbe9dbaf0ac45a36856c185c56b23)
 else()
-  set(GEOS_URL "https://download.osgeo.org/geos/geos-3.9.1.tar.bz2")
-  set(GEOS_MD5 efc4ce81bdbaa5e5c1caefe6c9b8553c)
+  set(GEOS_URL "https://download.osgeo.org/geos/geos-3.9.3.tar.bz2")
+  set(GEOS_MD5 80555366e6d7a518d8b79de773f70bc8)
 endif()


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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


ENH: Compiles ITK without ITKv3 compatibility.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -140,11 +140,10 @@
       -DBUILD_TESTING:BOOL=OFF
       -DBUILD_EXAMPLES:BOOL=OFF
       -DCMAKE_INSTALL_PREFIX:PATH=${EXTERNAL_BINARY_DIRECTORY}/${proj}-install
-      -DITK_LEGACY_REMOVE:BOOL=OFF
-      -DITK_FUTURE_LEGACY_REMOVE:=BOOL=ON
-      -DITKV3_COMPATIBILITY:BOOL=ON
+      -DITK_LEGACY_REMOVE:BOOL=ON
+      -DITKV3_COMPATIBILITY:BOOL=OFF
       -DITK_BUILD_DEFAULT_MODULES:BOOL=ON
-      -DModule_ITKReview:BOOL=ON
+      -DModule_ITKReview:BOOL=OFF
       #-DITK_INSTALL_NO_DEVELOPMENT:BOOL=ON
       -DKWSYS_USE_MD5:BOOL=ON # Required by SlicerExecutionModel
       -DITK_WRAPPING:BOOL=OFF #${BUILD_SHARED_LIBS} ## HACK:  QUICK CHANGE
@@ -160,8 +159,8 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG a316296e1ef188ce89b7a07dc61313afdad3cf30)
-  set(ITK_VERSION_ID ITK-4.6)
+  set(${proj}_GIT_TAG 20c05927f51d88b25429c6bd270e19c4b365b7e4)
+  set(ITK_VERSION_ID ITK-4.7)

   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


Added a macro for catch warnings

Added a macro for catch warnings

--- build/macros.cmake
+++ build/macros.cmake
@@ -423,6 +423,17 @@
 	endif()
 endmacro()

+macro(set_catch_warnings)
+	# Catch is not up to the challenge of Wall
+	replace_or_append_all_flag_compilers("/W([0-4]|all)" "IMPOSSIBLE" "/W4" "")
+	# These warnings are generated by catch test macros
+	if(MSVC)
+		append_all_compiler_flag("/wd4868") #compiler evaluation order in initializer list
+		append_all_compiler_flag("/wd4571") #catch(...) semantics changed for structured exceptions
+		append_all_compiler_flag("/wd4623") #default constructor implicitly deleted
+	endif()
+endmacro()
+
 macro(set_vector_architecture)
 	replace_or_append_all_flag_compilers("/arch:[AVX|SSE][0-9]" "-m[avx|sse][0-9]" "/arch:AVX2" "-mavx2")
 endmacro()


SWDEV-316665 - Add ATI_BITS_32 define to cmake build

Some logic in ROCclr relies on ATI_BITS_32 define

Change-Id: I2f0ef535e8d7717f9aa8646bdc80c09880bd2bee

--- cmake/ROCclr.cmake
+++ cmake/ROCclr.cmake
@@ -95,6 +95,10 @@
   target_compile_definitions(rocclr PUBLIC ATI_OS_LINUX)
 endif()

+if(NOT CMAKE_CL_64)
+  target_compile_definitions(rocclr PUBLIC ATI_BITS_32)
+endif()
+
 target_compile_definitions(rocclr PUBLIC
   ATI_ARCH_X86
   LITTLEENDIAN_CPU


PTHREAD: Export Pthread header for Android compilation.

Change-Id: Ieeb58e41d676d69fc86b00ea3c3a06c39da74888
Reviewed-on: http://gerrit.aldebaran.lan:8080/7196
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: lsouchet <714386f7236906c98b63c74419ba66cc63e06ca0@aldebaran-robotics.com>

--- cmake/qibuild/modules/pthread-config.cmake
+++ cmake/qibuild/modules/pthread-config.cmake
@@ -6,8 +6,7 @@
 fpath(PTHREAD "pthread.h")

 if(ANDROID)
-  qi_set_global(PTHREAD_LIBRARIES "")
-  export_lib(PTHREAD)
+  export_header(PTHREAD)
   return()
 endif()


Windows: fix misprint

Windows: fix misprint

--- adm_local/cmake_files/UsePyQt4.cmake
+++ adm_local/cmake_files/UsePyQt4.cmake
@@ -80,7 +80,7 @@
   _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _uniqueTargetName)
   ADD_CUSTOM_TARGET(${_uniqueTargetName} ALL DEPENDS ${${outfiles}})

- ELSEIF(NOT WIN32)
+ ELSE(NOT WIN32)
 ####
 # ANA: Workaround for the Microsoft Visual Studio 2010. Seems there is a bug in
 # the Microsoft Visual Studio 2010 or CMake 2.8.10.2: custom target doesn't work
@@ -98,7 +98,6 @@
     SET(_output ${CMAKE_CURRENT_BINARY_DIR}/${_input_name})
     _PYQT4_WRAP_GET_UNIQUE_TARGET_NAME(BUILD_UI_PY_FILES _TgName)
     ADD_CUSTOM_TARGET(${_TgName} ${PYQT_PYUIC_PATH} -o ${_output} ${CMAKE_CURRENT_SOURCE_DIR}/${_input}
-      COMMENT ANA:${_output}
       DEPENDS ${_input}
       )
     SET_TARGET_PROPERTIES(${_TgName} PROPERTIES FOLDER PYQT4_WRAP_UIC_TARGETS)


Fix build failure due to upload file name

The following error was occurring during uploading:
Problem reading file: %APPVEYOR_BUILD_FOLDER%/appveyor.yml while
creating notes

The dependent envs in the envs appear to not be evaluated.

--- test/ci/appveyor_dashboard.cmake
+++ test/ci/appveyor_dashboard.cmake
@@ -20,7 +20,8 @@
 set(CTEST_BUILD_NAME "$ENV{ITK_MODULE_NAME}-VS-${platform}-$ENV{CONFIGURATION}_${what}_${commit}")

 list(APPEND CTEST_NOTES_FILES
-  "$ENV{PROJ_SRC}/appveyor.yml"
+#  The PROJ_SRC env contains another %env% which is not being evaluated
+#  "$ENV{PROJ_SRC}/appveyor.yml"
   )

 include("${CTEST_SCRIPT_DIRECTORY}/common_dashboard.cmake")


update R version to 4.2.2 (#4920)

update R version to 4.2.2 (#4920)

Fixes https://github.com/jasp-stats/INTERNAL-jasp/issues/2146

Co-authored-by: Joris Goosen <c17a1a963e2b9ebb228030c0615fdb4bd91bd982@jorisgoosen.nl>


remove CXX -pedantic for now

remove CXX -pedantic for now

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -1,4 +1,4 @@
-set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -pedantic ${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall ${CMAKE_CXX_FLAGS}")
 set(CMAKE_C_FLAGS "-std=c11 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -pedantic ${CMAKE_C_FLAGS}")

 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lprotobuf -lz -lpthread")


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -28,25 +28,12 @@
     UPDATE_POLICIES()

     # Make sure that we are building on a supported architecture
-    # Note #1: normally, we would check the value of CMAKE_SIZEOF_VOID_P, but
-    #          in some cases it may not be set (e.g. when generating an Xcode
-    #          project file), so we determine and retrieve that value
-    #          ourselves...
-    # Note #2: we can come here from either the main project (i.e. the GUI
-    #          version of OpenCOR on Windows and the GUI/CLI versions of
-    #          OpenCOR on Linux / OS X) or the non-main project (i.e. the CLI
-    #          version of OpenCOR on Windows), hence we test the existence of
-    #          the cmake folder so that we can determine the exact location of
-    #          architecture.c file...
-
-    IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake)
-        SET(ARCHITECTURE_FILENAME ${CMAKE_SOURCE_DIR}/cmake/architecture.c)
-    ELSE()
-        SET(ARCHITECTURE_FILENAME ${CMAKE_SOURCE_DIR}/../cmake/architecture.c)
-    ENDIF()
+    # Note: normally, we would check the value of CMAKE_SIZEOF_VOID_P, but in
+    #       some cases it may not be set (e.g. when generating an Xcode project
+    #       file), so we determine and retrieve that value ourselves...

     TRY_RUN(ARCHITECTURE_RUN ARCHITECTURE_COMPILE
-            ${CMAKE_BINARY_DIR} ${ARCHITECTURE_FILENAME}
+            ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/architecture.c
             RUN_OUTPUT_VARIABLE ARCHITECTURE)

     IF(NOT ${ARCHITECTURE} EQUAL 32 AND NOT ${ARCHITECTURE} EQUAL 64)
@@ -777,26 +764,18 @@

 MACRO(COPY_FILE_TO_BUILD_DIR PROJECT_TARGET ORIG_DIRNAME DEST_DIRNAME FILENAME)
     # Determine the real destination folder
-    # Note: see the INITIALISE_PROJECT() macro for an explanation of why we
-    #       check the existence of the cmake folder below...
-
-    IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake)
-        SET(REAL_DEST_DIRNAME ${PROJECT_BUILD_DIR}/${DEST_DIRNAME})
-    ELSE()
-        SET(REAL_DEST_DIRNAME ${CMAKE_BINARY_DIR}/../../build/${CMAKE_CFG_INTDIR}/${DEST_DIRNAME})
-    ENDIF()

     IF("${ARGN}" STREQUAL "")
         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD
                            COMMAND ${CMAKE_COMMAND} -E copy ${ORIG_DIRNAME}/${FILENAME}
-                                                            ${REAL_DEST_DIRNAME}/${FILENAME})
+                                                            ${PROJECT_BUILD_DIR}/${DEST_DIRNAME}/${FILENAME})
     ELSE()
         # An argument was passed so use it to rename the file which is to be
         # copied

         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD
                            COMMAND ${CMAKE_COMMAND} -E copy ${ORIG_DIRNAME}/${FILENAME}
-                                                            ${REAL_DEST_DIRNAME}/${ARGN})
+                                                            ${PROJECT_BUILD_DIR}/${DEST_DIRNAME}/${ARGN})
     ENDIF()
 ENDMACRO()


Fix bug where BUILD_X64 would toggle to off on second build.

--- src/build_options.cmake
+++ src/build_options.cmake
@@ -7,10 +7,14 @@
 #
 cmake_minimum_required(VERSION 2.8)

-if( NOT DEFINED BUILD_X64 )
-    option(BUILD_X64 "build 64-bit" FALSE)
-    if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
-        set(BUILD_X64 TRUE)
+set(BUILD_X64 "" CACHE STRING "whether to perform 64-bit build: ON or OFF overrides default detection")
+
+# Unless user specifies BUILD_X64 explicitly, assume native target
+if (BUILD_X64 STREQUAL "")
+    if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+        set(BUILD_X64 "TRUE")
+    else()
+        set(BUILD_X64 "FALSE")
     endif()
 endif()


update code coverage module

update code coverage module

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -80,11 +80,11 @@
 SET(CODE_COVERAGE_FOUND ON CACHE STRING "Code coverage support found.")

 SET(CMAKE_CXX_FLAGS_COVERAGE
-	"-g -O0 -fprofile-arcs -ftest-coverage"
+	"-O0 --coverage -fprofile-arcs -ftest-coverage"
 	CACHE STRING "Flags used by the C++ compiler during coverage builds."
 	FORCE )
 SET(CMAKE_C_FLAGS_COVERAGE
-	"-g -O0 -fprofile-arcs -ftest-coverage"
+	"-O0 --coverage -fprofile-arcs -ftest-coverage"
 	CACHE STRING "Flags used by the C compiler during coverage builds."
 	FORCE )
 SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE


cmake: enable mmap access

cmake: enable mmap access

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -177,6 +177,9 @@

 set(CMAKE_EXTRA_INCLUDE_FILES sys/mman.h)
 vlc_check_functions_exist(mmap)
+if(HAVE_MMAP)
+  vlc_enable_modules(access_mmap)
+endif(HAVE_MMAP)
 set(CMAKE_EXTRA_INCLUDE_FILES)

 set(CMAKE_EXTRA_INCLUDE_FILES locale.h)


modify for package

modify for package

--- source/Packaging.cmake
+++ source/Packaging.cmake
@@ -131,6 +131,7 @@
   INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_thread.so.1.47.0")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_unit_test_framework.so.1.47.0")
   INSTALL_RELATED_LIBRARIES("/usr/local/lib/libthrift.so")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libmysqlclient_r.so")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libicuuc.so")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libicui18n.so")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libicudata.so")


modify for packaging

modify for packaging

--- source/Packaging.cmake
+++ source/Packaging.cmake
@@ -131,7 +131,8 @@
   INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_thread.so.1.47.0")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libboost_unit_test_framework.so.1.47.0")
   INSTALL_RELATED_LIBRARIES("/usr/local/lib/libthrift.so")
-  INSTALL_RELATED_LIBRARIES("/usr/lib/libmysqlclient_r.so")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libmysqlclient_r.so.16")
+  INSTALL_RELATED_LIBRARIES("/usr/lib/libmysqlclient.so.16")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libicuuc.so")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libicui18n.so")
   INSTALL_RELATED_LIBRARIES("/usr/lib/libicudata.so")
@@ -166,6 +167,7 @@
     DESTINATION "."
     COMPONENT sf1r_packings
     REGEX ".xml.in" EXCLUDE
+    PATTERN "example.xml" EXCLUDE
     )
   INSTALL( PROGRAMS
     ${CMAKE_SOURCE_DIR}/../bin/sf1r-engine


boards: nucleo_wb55rg: Add stm32cubeprogrammer runner

Use of stm32cubeprogrammer runner makes life easier
on test bench for this device.
Though, keep openocd as default.

Signed-off-by: Erwan Gouriou <de4d967452b83bb0e37525652734e7d9163b6a4c@linaro.org>

--- boards/arm/nucleo_wb55rg/board.cmake
+++ boards/arm/nucleo_wb55rg/board.cmake
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: Apache-2.0
 board_runner_args(pyocd "--target=stm32wb55rgvx")
+board_runner_args(stm32cubeprogrammer "--port=swd" "--reset=hw")

 include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
 include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)


Qt: default build type for non-Mac platforms is Release

--- cmake/projects/Qt/hunter.cmake
+++ cmake/projects/Qt/hunter.cmake
@@ -9,6 +9,7 @@

 include(hunter_add_version)
 include(hunter_cacheable)
+include(hunter_configuration_types)

 hunter_add_version(
     PACKAGE_NAME
@@ -23,4 +24,8 @@

 hunter_cacheable(Qt)

+if(NOT APPLE)
+  hunter_configuration_types(Qt CONFIGURATION_TYPES Release)
+endif()
+
 include("${CMAKE_CURRENT_LIST_DIR}/qtbase/hunter.cmake")


Add common definitions automatically in add_library

--- Common.cmake
+++ Common.cmake
@@ -179,6 +179,30 @@
 endmacro()
 macro(add_library _target)
   _add_library(${_target} ${ARGN})
+
+  # add defines TARGET_DSO_NAME and TARGET_SHARED
+  get_target_property(THIS_DEFINITIONS ${_target} COMPILE_DEFINITIONS)
+  if(NOT THIS_DEFINITIONS)
+    set(THIS_DEFINITIONS) # clear THIS_DEFINITIONS-NOTFOUND
+  endif()
+  string(TOUPPER ${_target} _TARGET)
+  if(MSVC OR XCODE_VERSION)
+    list(APPEND THIS_DEFINITIONS
+      ${_TARGET}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+  else()
+    if(APPLE)
+      list(APPEND THIS_DEFINITIONS
+        ${_TARGET}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${_target}.${VERSION_ABI}${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+    else()
+      list(APPEND THIS_DEFINITIONS
+        ${_TARGET}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${VERSION_ABI}\")
+    endif()
+  endif()
+  list(APPEND THIS_DEFINITIONS ${_TARGET}_SHARED)
+
+  set_target_properties(${_target} PROPERTIES
+    COMPILE_DEFINITIONS "${THIS_DEFINITIONS}")
+
   set_property(GLOBAL APPEND PROPERTY ALL_DEP_TARGETS ${_target})
   set_property(GLOBAL APPEND PROPERTY ALL_LIB_TARGETS ${_target})
 endmacro()


Actually generate the version strings correctly

--- cmake/GetGitRevisionDescription.cmake
+++ cmake/GetGitRevisionDescription.cmake
@@ -113,7 +113,6 @@
     execute_process(COMMAND
         "${GIT_EXECUTABLE}"
         describe
-        ${hash}
         ${ARGN}
         WORKING_DIRECTORY
         "${CMAKE_CURRENT_SOURCE_DIR}"


[libcxx] cmake - guard list remove

[libcxx] cmake - guard list remove

REMOVE_ITEM fails if CMAKE_REQUIRED_LIBRARIES is empty on some
versions of cmake.

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

--- cmake/Modules/CheckLibcxxAtomic.cmake
+++ cmake/Modules/CheckLibcxxAtomic.cmake
@@ -34,10 +34,12 @@
 # Perform the check for 64bit atomics without libatomic. It may have been
 # added to the required libraries during in the configuration of LLVM, which
 # would cause the check for CXX atomics without libatomic to incorrectly pass.
-set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
-list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic")
-check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
-set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+if (CMAKE_REQUIRED_LIBRARIES)
+  set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+  list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic")
+  check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+  set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+endif()

 check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB)
 # If not, check if the library exists, and atomics work with it.


Use /Zc:inline when building with MSVC.

Use /Zc:inline when building with MSVC.

This reduces the total .obj size when building llvm from
496,690,342 to 219,334,936 bytes.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -348,6 +348,8 @@
     append("${flag}" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endforeach(flag)

+  append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+
   # Disable sized deallocation if the flag is supported. MSVC fails to compile
   # the operator new overload in User otherwise.
   check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC)


[cmake] Disable manifest generation when LLD is the linker

Running mt.exe to make the manifest is really slow. Disabling manifest
generation doesn't seem to break anything.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -53,6 +53,14 @@
         "  due to miscompiles from earlier versions")
     endif()
   endif()
+endif()
+
+if (CMAKE_LINKER MATCHES "lld-link.exe")
+  # Pass /MANIFEST:NO so that CMake doesn't run mt.exe on our binaries.  Adding
+  # manifests with mt.exe breaks LLD's symbol tables and takes as much time as
+  # the link. See PR24476.
+  append("/MANIFEST:NO"
+    CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
 endif()

 if( LLVM_ENABLE_ASSERTIONS )
@@ -514,10 +522,6 @@
     if (CMAKE_LINKER MATCHES "lld-link.exe")
       # Use DWARF debug info with LLD.
       append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-      # Pass /MANIFEST:NO so that CMake doesn't run mt.exe on our binaries.
-      # Adding manifests with mt.exe breaks LLD's symbol tables. See PR24476.
-      append("/MANIFEST:NO"
-        CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
     else()
       # Enable codeview otherwise.
       append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)


Turn off missing field initializer warnings for gcc

gcc produces false positives for empty braces so turning the warning off.
Instead, turning the warning on for clang so proper warnings aren't missed.

Reviewers: dblaikie, chandlerc

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -178,6 +178,19 @@
 elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
   if (LLVM_ENABLE_WARNINGS)
     add_llvm_definitions( -Wall -W -Wno-unused-parameter -Wwrite-strings )
+
+    # Turn off missing field initializer warnings for gcc to avoid noise from
+    # false positives with empty {}. Turn them on otherwise (they're off by
+    # default for clang).
+    check_cxx_compiler_flag("-Wmissing-field-initializers" CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG)
+    if (CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG)
+      if (CMAKE_COMPILER_IS_GNUCXX)
+        add_llvm_definitions( -Wno-missing-field-initializers )
+      else()
+        add_llvm_definitions( -Wmissing-field-initializers )
+      endif()
+    endif()
+
     if (LLVM_ENABLE_PEDANTIC)
       add_llvm_definitions( -pedantic -Wno-long-long )
     endif (LLVM_ENABLE_PEDANTIC)


Add architecture specific path variables to SwiftConfigureSDK

New variables are introduced to track the path for the architecture
specific subdirectories

This work is mostly attributed to Zach Bowling

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -23,6 +23,9 @@
     endforeach()
   else()
     message(STATUS "  Path: ${SWIFT_SDK_${prefix}_PATH}")
+    foreach(arch ${SWIFT_SDK_${prefix}_ARCHITECTURES})
+      message(STATUS "  ${arch} Path: ${SWIFT_SDK_${prefix}_ARCH_${arch}_PATH}")
+    endforeach()
   endif()
   message(STATUS "  Version: ${SWIFT_SDK_${prefix}_VERSION}")
   message(STATUS "  Build number: ${SWIFT_SDK_${prefix}_BUILD_NUMBER}")
@@ -122,6 +125,9 @@
   set(SWIFT_SDK_${prefix}_OBJECT_FORMAT "MACHO")

   foreach(arch ${architectures})
+    # On Darwin, all archs share the same SDK path.
+    set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "${SWIFT_SDK_${prefix}_PATH}")
+
     set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
         "${arch}-apple-${SWIFT_SDK_${prefix}_TRIPLE_NAME}")
   endforeach()
@@ -137,8 +143,10 @@
   # Note: this has to be implemented as a macro because it sets global
   # variables.

+  # Todo: this only supports building an SDK for one target arch only.
   set(SWIFT_SDK_${prefix}_NAME "${name}")
   set(SWIFT_SDK_${prefix}_PATH "${sdkpath}")
+  set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "${sdkpath}")
   set(SWIFT_SDK_${prefix}_VERSION "don't use")
   set(SWIFT_SDK_${prefix}_BUILD_NUMBER "don't use")
   set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "")
@@ -186,6 +194,7 @@
       set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
           "${arch}-unknown-windows-${environment}")
     endif()
+    set(SWIFT_SDK_${prefix}_ARCH_${arch}_PATH "/")
   endforeach()

   # Add this to the list of known SDKs.


closes #5928 add fortify source to RelWithDebInfo

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@52785 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -25,6 +25,7 @@
 ## add TOKU_PTHREAD_DEBUG for debug builds
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1)
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO TOKU_PTHREAD_DEBUG=1)
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO _FORTIFY_SOURCE=2)

 ## coverage
 option(USE_GCOV "Use gcov for test coverage." OFF)


refs #5485 un-screw-up coverage builds of statically linked binaries

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@48064 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -197,7 +197,7 @@
     foreach(lib ${ARGN})
       add_space_separated_property(TARGET ${lib} COMPILE_FLAGS --coverage)
       add_space_separated_property(TARGET ${lib} LINK_FLAGS --coverage)
-      target_link_libraries(${lib} LINK_INTERFACE_LIBRARIES gcov)
+      target_link_libraries(${lib} gcov)
     endforeach(lib)
   endif (USE_GCOV)
 endfunction(maybe_add_gcov_to_libraries)


COMP: disable the gdal symbol conflict test on WIN32 since it causes runtime failures

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -161,11 +161,14 @@
     ENDIF (NOT OGR_LIBRARY)
   ENDIF(GDAL_HAS_OGR)

+
   # Check for some possible crashes when reading TIFF files, when GDAL embeds geotiff and tiff libraries
   # Known to lead to a crash with the official gdal package available in ubuntu & debian
   INCLUDE(CheckCXXSourceRunsWithArgs)

+  IF(NOT WIN32)
   # This test is known to fail with the Debian gdal package
+  # On Windows, the try-compile are always run in Debug, leading to runtime issues, so we disable them
   SET(CMAKE_REQUIRED_INCLUDES ${GDAL_INCLUDE_DIR})
   SET(CMAKE_REQUIRED_LIBRARIES "${GEOTIFF_LIBRARY};${GDAL_LIBRARY}")
   CHECK_CXX_SOURCE_RUNS_ARGS(
@@ -196,7 +199,8 @@
     "You might consider building GDAL yourself without using --with-hide-internal-symbols"
     "and pointing GEOTIFF_INCLUDE_DIRS to the geotiff headers included in gdal sources" )
   ENDIF(NOT CHECK_XTIFFOPEN_SYMBOL)
-
+  ENDIF(NOT WIN32)
+
   # This test is known to fail with gdal build with some versions of hdf library
   #${OTB_DATA_ROOT}/Input/MOD09Q1G_EVI.A2006233.h07v03.005.2008338190308.hdf  -> Test KO
   #${OTB_DATA_ROOT}/Input/GSSTF_NCEP.2b.2008.12.31.he5  -> Test OK


ENH: Bump itkVersion.cmake for 5.0.1

ENH: Bump itkVersion.cmake for 5.0.1

--- CMake/itkVersion.cmake
+++ CMake/itkVersion.cmake
@@ -1,4 +1,4 @@
 # ITK version number components.
 set(ITK_VERSION_MAJOR "5")
 set(ITK_VERSION_MINOR "0")
-set(ITK_VERSION_PATCH "0")
+set(ITK_VERSION_PATCH "1")


Squashed 'CMake/Basis/' changes from cc22ee8..8baba41

8baba41 #550 Clean module BasisProject.cmake file path before use

git-subtree-dir: CMake/Basis
git-subtree-split: 8baba41b456f94e2186c6f82638218b2e272ebd9

--- ProjectTools.cmake
+++ ProjectTools.cmake
@@ -934,6 +934,8 @@

   set (PROJECT_MODULES)
   foreach (F IN LISTS MODULE_INFO_FILES)
+    # clean path without // to fix issue with UNC paths on Windows
+    get_filename_component (F "${F}" ABSOLUTE)
     basis_module_info (${F})
     list (APPEND PROJECT_MODULES ${MODULE})
     get_filename_component (${MODULE}_BASE ${F} PATH)


Migrate the build system from Artifactory to JFrog CLI

The Artifactory CLI tool has been discontinued, and replaced
with JFrog CLI.

--- Artifactory.cmake
+++ Artifactory.cmake
@@ -24,13 +24,13 @@
 mark_as_advanced(ARTIFACTORY_CACHE_DIR)

 if(ARTIFACTORY_FETCH OR ARTIFACTORY_SUBMIT)
-    find_program(ARTIFACTORY_CLI art REQUIRED)
+    find_program(ARTIFACTORY_CLI jfrog REQUIRED)

     if(NOT ARTIFACTORY_CLI)
         message(FATAL_ERROR
-            "Artifactory integration requires the `art` Artifactory "
+            "Artifactory integration requires the `jfrog` "
             "command-line client. It is available at: "
-            "https://github.com/JFrogDev/artifactory-cli-go. If it is "
+            "https://www.jfrog.com/getcli/. If `jfrog` is "
             "available but not present in PATH, please define the "
             "ARTIFACTORY_CLI variable to the location of the program.")
     endif()
@@ -68,7 +68,7 @@
 #
 #   <artifact-id>-<version>[-<classifier>].<extension>
 #
-# If ARTIFACTORY_FETCH is ON, this command will use the `art` tool to check the
+# If ARTIFACTORY_FETCH is ON, this command will use the `jfrog rt` tool to check the
 # configured Artifactory repo for the artifact. If it exists, the files will be
 # copied into the ${CMAKE_CURRENT_BINARY_DIR}/<directory>/artifact-prebuilt/
 # directory, before `add_subdirectory(<directory>)` is called. The target
@@ -84,7 +84,7 @@
 # been called, a target is created that depends on <target-name>, named
 # `artifactory-upload-<target-name>`. This will upload all files from
 # ${CMAKE_CURRENT_BINARY_DIR}/<directory>/artifact-output/ to the configured
-# Artifactory repo using the `art` tool.
+# Artifactory repo using the `jfrog rt` tool.
 #
 # If <version> ends with the string -SNAPSHOT, that is replaced with -* when
 # looking for artifacts to fetch. The artifacts fetched into the
@@ -315,8 +315,8 @@
 # Maven artifact path rules, then Artifactory will replace -SNAPSHOT with the
 # a unique timestamp & build number string in the remote filename.
 #
-# It assumes that the `art` commandline tool has been configured with the
-# correct credentials using the `art config` command.
+# It assumes that the `jfrog rt` commandline tool has been configured with the
+# correct credentials using the `jfrog rt config` command.
 #
 # Rather than taking the filenames of the artifact's files to upload, it takes
 # the name of the directory that should contain the artifact files once


i#1227 ARM: Replace --thumb-entry with --entry in utils.cmake.

With "--thumb-entry" the test programs fib-conflict{,-early} fail, natively
or under DynamoRIO, on Raspbian (Raspberry Pi 3), because the start-up code
is A32 (ARM mode). With "--entry" bit 0 of the entry point is set correctly
depending on whether _start is A32 (ARM) or T32 (Thumb).

Review-URL: https://codereview.appspot.com/310770043

--- make/utils.cmake
+++ make/utils.cmake
@@ -207,8 +207,9 @@
       endif ()
     endif ()
     if (ARM AND NOT set_bounds) # XXX: don't want for libDR: using "set_bounds" for now
-      # Somehow the entry point gets changed to ARM by using ldscript
-      set(ldflags "${ldflags} -Wl,--thumb-entry -Wl,_start")
+      # Somehow the entry point gets changed to A32 by using ldscript.
+      # Adding --entry causes the linker to set it to either A32 or T32 as appropriate.
+      set(ldflags "${ldflags} -Wl,--entry -Wl,_start")
     endif ()
     append_property_string(TARGET ${target} LINK_FLAGS "${ldflags}")
   endfunction (set_preferred_base_start_and_end)


Updated ctest drop site to codeblue

Updated ctest drop site to codeblue

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -4,20 +4,12 @@
 ## # The following are required to uses Dart and the Cdash dashboard
 ##   ENABLE_TESTING()
 ##   INCLUDE(CTest)
-set(CTEST_PROJECT_NAME "HOOMD")
-set(CTEST_NIGHTLY_START_TIME "23:00:00 CST")
+set(CTEST_PROJECT_NAME "HOOMD-blue")
+set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")

 set(CTEST_DROP_METHOD "http")

-# this convoluted setup seems to be the only way to get the SITE_NAME variable
 set(SITE ${SITE_NAME})
-
-# the automated test on nyx need to be ssh-tunneled out of the compute node
-if (SITE MATCHES "nyx")
-set(CTEST_DROP_SITE "localhost:8080")
-else (SITE MATCHES "nyx")
-set(CTEST_DROP_SITE "cdash.fourpisolutions.com")
-endif(SITE MATCHES "nyx")
-
-set(CTEST_DROP_LOCATION "/submit.php?project=HOOMD")
+set(CTEST_DROP_SITE "codeblue.umich.edu")
+set(CTEST_DROP_LOCATION "/cdash/submit.php?project=HOOMD-blue")
 set(CTEST_DROP_SITE_CDASH TRUE)


Revert "disabled curve5 test"

Revert "disabled curve5 test"

This reverts commit 76c5bb92ffca53cfac2e086c7548d7fb3db26408.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -16,4 +16,4 @@

 set(CTEST_PROJECT_NAME "Embree")
 set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
-set(TEST_MODELS_HASH d7f0128eb94041dbaaaa639e80355ffbaeef8de2)
+set(TEST_MODELS_HASH 62a08c85402a55303bc11eb6208dbd8bb0fb9672)


Make the imported OpenEXR target an interface one.

--- FindOpenEXR.cmake
+++ FindOpenEXR.cmake
@@ -43,9 +43,7 @@
         ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} )
     # Add imported targets.
     if(NOT TARGET OpenEXR::OpenEXR)
-        # NOTE: "UNKNOWN" here refers to the type of library, which could be static
-        # or dynamic (we don't know and don't care).
-        add_library(OpenEXR::OpenEXR UNKNOWN IMPORTED)
+        add_library(OpenEXR::OpenEXR INTERFACE IMPORTED)
         set_target_properties(OpenEXR::OpenEXR PROPERTIES
             INTERFACE_INCLUDE_DIRECTORIES "${OPENEXR_INCLUDE_DIR}")
         set_target_properties(OpenEXR::OpenEXR PROPERTIES


Fix rocksdb finder for newer versions

Fix rocksdb finder for newer versions

--- Findrocksdb.cmake
+++ Findrocksdb.cmake
@@ -30,10 +30,16 @@
   PATH_SUFFIXES include
   PATHS /usr /usr/local /opt /opt/local)

-if(_ROCKSDB_INCLUDE_DIR AND EXISTS "${_ROCKSDB_INCLUDE_DIR}/rocksdb/db.h")
+if(EXISTS "${_ROCKSDB_INCLUDE_DIR}/rocksdb/version.h")
+  set(_ROCKSDB_Version_file "${_ROCKSDB_INCLUDE_DIR}/rocksdb/version.h")
+elseif(EXISTS "${_ROCKSDB_INCLUDE_DIR}/rocksdb/db.h")
   set(_ROCKSDB_Version_file "${_ROCKSDB_INCLUDE_DIR}/rocksdb/db.h")
+endif()
+if(_ROCKSDB_INCLUDE_DIR AND _ROCKSDB_Version_file)
   file(READ ${_ROCKSDB_Version_file} _ROCKSDB_header_contents)
   string(REGEX REPLACE ".*kMajorVersion = ([0-9]+).*kMinorVersion = ([0-9]+).*"
+    "\\1.\\2" _ROCKSDB_VERSION "${_ROCKSDB_header_contents}")
+  string(REGEX REPLACE ".*ROCKSDB_MAJOR ([0-9]+).*ROCKSDB_MINOR ([0-9]+).*"
     "\\1.\\2" _ROCKSDB_VERSION "${_ROCKSDB_header_contents}")
   set(ROCKSDB_VERSION ${_ROCKSDB_VERSION} CACHE INTERNAL
     "The version of rocksdb which was detected")


Update Zlib Download URL (#3200)

Update Zlib Download URL (#3200)

* Update Zlib Download URL


Remove unnecessary if APPLE from cmake file


MASTER: fix findAssimp for travis

MASTER: fix findAssimp for travis

--- cmake_modules/FindASSIMPM.cmake
+++ cmake_modules/FindASSIMPM.cmake
@@ -29,7 +29,7 @@
 		PATHS
 		${ASSIMP_ROOT}/lib
 	)
-	find_library(ASSIMP_LIBRARIES_DEBUG NAMES assimp-vc120-mtd assimpd
+	find_library(ASSIMP_LIBRARIES_DEBUG NAMES assimp-vc120-mtd assimpd assimp
 		PATHS
 		${ASSIMP_ROOT}/lib
 	)


[dialyzer] Remove commented out path to ibrowse.

That we haven't been using in quite a while.

Change-Id: I2f4a273d381b925ab662799fd948e00db9af3dbe
Reviewed-on: http://review.couchbase.org/63121
Tested-by: Aliaksey Artamonau <3c875bcfb3adf2a65b2ae7686ca921e6c9433147@gmail.com>
Reviewed-by: Dave Finlay <7b10a9ed9f70e64c30b07607a671ae61c33f14c8@couchbase.com>

--- cmake_modules/do-dialyzer.cmake
+++ cmake_modules/do-dialyzer.cmake
@@ -8,7 +8,6 @@
     --apps compiler crypto erts inets kernel os_mon sasl ssl stdlib xmerl
     ${_couchdb_bin_dir}/src/mochiweb
     ${_couchdb_bin_dir}/src/snappy ${_couchdb_bin_dir}/src/etap
-    # MISSING?  ${_couchdb_bin_dir}/src/ibrowse
     ${_couchdb_bin_dir}/src/lhttpc
     ${_couchdb_bin_dir}/src/erlang-oauth deps/gen_smtp/ebin)

@@ -16,7 +15,6 @@
     --apps compiler crypto erts inets kernel os_mon sasl ssl stdlib xmerl
     ${_couchdb_bin_dir}/src/mochiweb
     ${_couchdb_bin_dir}/src/snappy ${_couchdb_bin_dir}/src/etap
-    # MISSING?  ${_couchdb_bin_dir}/src/ibrowse
     ${_couchdb_bin_dir}/src/lhttpc
     ${_couchdb_bin_dir}/src/erlang-oauth deps/gen_smtp/ebin)
 ENDIF (NOT EXISTS "${COUCHBASE_PLT}")


add 10.4 to list of searchable versions

add 10.4 to list of searchable versions

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -240,7 +240,7 @@
 	# Mathematica products in order of preference
 	set (_MathematicaApps "Mathematica" "gridMathematica Server")
 	# Mathematica product versions in order of preference
-	set (_MathematicaVersions "10.3" "10.2" "10.1" "10.0" "9.0" "8.0" "7.0" "6.0" "5.2")
+	set (_MathematicaVersions "10.4" "10.3" "10.2" "10.1" "10.0" "9.0" "8.0" "7.0" "6.0" "5.2")
 	# search for explicitly requested application version first
 	if (Mathematica_FIND_VERSION AND Mathematica_FIND_VERSION_EXACT)
 		foreach (_product IN LISTS _MathematicaApps)


Cache the GCC c++11 standard test result. Remove redundant linker flag.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -481,16 +481,21 @@
     add_definitions (-DURHO3D_CXX11)   # Note the define is NOT 'URHO3D_C++11'!
     if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
         # Use gnu++11/gnu++0x instead of c++11/c++0x as the latter does not work as expected when cross compiling
-        foreach (STANDARD gnu++11 gnu++0x)  # Fallback to gnu++0x on older GCC version
-            execute_process (COMMAND ${CMAKE_COMMAND} -E echo COMMAND ${CMAKE_CXX_COMPILER} -std=${STANDARD} -E - RESULT_VARIABLE GCC_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
-            if (GCC_EXIT_CODE EQUAL 0)
-                set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${STANDARD}")
-                break ()
-            endif ()
-        endforeach ()
-        if (NOT GCC_EXIT_CODE EQUAL 0)
-            execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION ERROR_QUIET)
-            message (FATAL_ERROR "Your GCC version ${GCC_VERSION} is too old to enable C++11 standard")
+        if (VERIFIED_SUPPORTED_STANDARD)
+            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${VERIFIED_SUPPORTED_STANDARD}")
+        else ()
+            foreach (STANDARD gnu++11 gnu++0x)  # Fallback to gnu++0x on older GCC version
+                execute_process (COMMAND ${CMAKE_COMMAND} -E echo COMMAND ${CMAKE_CXX_COMPILER} -std=${STANDARD} -E - RESULT_VARIABLE GCC_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+                if (GCC_EXIT_CODE EQUAL 0)
+                    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${STANDARD}")
+                    set (VERIFIED_SUPPORTED_STANDARD ${STANDARD} CACHE INTERNAL "GNU extension of C++11 standard that is verified to be supported by the chosen compiler")
+                    break ()
+                endif ()
+            endforeach ()
+            if (NOT GCC_EXIT_CODE EQUAL 0)
+                execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+                message (FATAL_ERROR "Your GCC version ${GCC_VERSION} is too old to enable C++11 standard")
+            endif ()
         endif ()
     elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
         # Cannot set CMAKE_CXX_FLAGS here directly because CMake uses the same flags for both C++ and Object-C languages, the latter does not support c++11 standard
@@ -623,7 +628,6 @@
             # MinGW-specific setup
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc -fno-keep-inline-dllexport")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libstdc++ -static-libgcc -fno-keep-inline-dllexport")
-            set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static")
             if (NOT URHO3D_64BIT)
                 # Prevent auto-vectorize optimization when using -O3, unless stack realign is being enforced globally
                 if (URHO3D_SSE)


and yet another try ...

and yet another try ...

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -34,8 +34,30 @@
 endif()

 # TODO: Those should be removed once catkin provides them
-get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-include(${SELF_DIR}/rosbuild_lite.cmake)
+unset(ROS_ELECTRIC_FOUND)
+unset(ROS_FUERTE_FOUND)
+unset(ROS_GROOVY_FOUND)
+unset(ROS_FUERTE_OR_ABOVE_FOUND)
+unset(ROS_GROOVY_OR_ABOVE_FOUND)
+
+if ("$ENV{ROS_ROOT}" STREQUAL "/opt/ros/electric/ros")
+    set(ROS_ELECTRIC_FOUND TRUE)
+else()
+    set(ROS_FUERTE_OR_ABOVE_FOUND TRUE)
+    set(BUNCH_OF_VARS "$ENV{ROS_ROOT}, ${CMAKE_PREFIX_PATH}, $ENV{ROS_PACKAGE_PATH}, ${CMAKE_INSTALL_PREFIX}, ${catkin_INSTALL_PREFIX}, ${catkin_EXTRAS_DIR}")
+    message(STATUS ${BUNCH_OF_VARS})
+    string(REGEX MATCH "fuerte" ROS_FUERTE_FOUND ${BUNCH_OF_VARS})
+    message(STATUS "${ROS_FUERTE_FOUND}")
+    if (ROS_FUERTE_FOUND)
+        set(ROS_FUERTE_FOUND TRUE)
+        message(STATUS "Fuerte found")
+    else()
+        set(ROS_GROOVY_FOUND TRUE)
+        set(ROS_GROOVY_OR_ABOVE_FOUND TRUE)
+        message(STATUS "Groovy found")
+    endif()
+endif()
+

 # TODO, once fuerte/Lucid is not supported anymore, remove the CMakeParseArguments file
 if (ROS_GROOVY_OR_ABOVE_FOUND)


Fix for ROOT-7205 - Do not change the CMake default CMAKE_INSTALL_PREFIX

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -202,14 +202,6 @@
 #---Avoid creating dependencies to 'non-statndard' header files -------------------------------
 include_regular_expression("^[^.]+$|[.]h$|[.]icc$|[.]hxx$|[.]hpp$")

-#---Set all directories where to install parts of root up to now everything is installed ------
-#---according to the setting of CMAKE_INSTALL_DIR
-
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT gnuinstall)
-  message(STATUS "Setting default installation prefix CMAKE_INSTALL_PREFIX to ${ROOTSYS}")
-  set(CMAKE_INSTALL_PREFIX ${ROOTSYS} CACHE PATH "Default installation of ROOT" FORCE)
-endif()
-
 #---Add Installation Variables------------------------------------------------------------------
 include(RootInstallDirs)


[CMAKE] Enable ccache by default on ARM

[CMAKE] Enable ccache by default on ARM

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -90,7 +90,11 @@
 ROOT_BUILD_OPTION(libcxx OFF "Build using libc++, requires cxx11 option (MacOS X only, for the time being)")
 ROOT_BUILD_OPTION(cxxmodules "Compile with C++ modules enabled." OFF)
 ROOT_BUILD_OPTION(castor ON "CASTOR support, requires libshift from CASTOR >= 1.5.2")
-ROOT_BUILD_OPTION(ccache OFF "Enable ccache usage for speeding up builds")
+if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+  ROOT_BUILD_OPTION(ccache ON "Enable ccache usage for speeding up builds")
+else()
+  ROOT_BUILD_OPTION(ccache OFF "Enable ccache usage for speeding up builds")
+endif()
 ROOT_BUILD_OPTION(chirp ON "Chirp support (Condor remote I/O), requires libchirp_client")
 ROOT_BUILD_OPTION(cling ON "Enable new CLING C++ interpreter")
 ROOT_BUILD_OPTION(cocoa OFF "Use native Cocoa/Quartz graphics backend (MacOS X only)")


[cxxmodules] Added runtime_cxxmodules build option

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -150,6 +150,7 @@
 ROOT_BUILD_OPTION(root7 OFF "Build the ROOT 7 interface prototype, requires >= cxx14")
 ROOT_BUILD_OPTION(rpath OFF "Set run-time library load path on executables and shared libraries (at installation area)")
 ROOT_BUILD_OPTION(ruby OFF "Ruby ROOT bindings, requires ruby >= 1.8")
+ROOT_BUILD_OPTION(runtime_cxxmodules "Enable runtime support for C++ modules." OFF)
 ROOT_BUILD_OPTION(sapdb ON "MaxDB/SapDB support, requires libsqlod and libsqlrte")
 ROOT_BUILD_OPTION(shadowpw ON "Shadow password support")
 ROOT_BUILD_OPTION(shared ON "Use shared 3rd party libraries if possible")


Cleaning up extra end-of-line spaces

Cleaning up extra end-of-line spaces

--- NodeJS.cmake
+++ NodeJS.cmake
@@ -133,11 +133,11 @@
     set(LIB64_MATCH "(^[0-9A-Fa-f]+)[\t ]+(win-)?(x64/)(.*)(.lib)$")

     # Parse function arguments
-    cmake_parse_arguments(nodejs_init
+    cmake_parse_arguments(nodejs_init
         "" "URL;NAME;VERSION;CHECKSUM;CHECKTYPE" "" ${ARGN}
     )

-    # Allow the download URL to be overridden by command line argument
+    # Allow the download URL to be overridden by command line argument
     # NODEJS_URL
     if(NODEJS_URL)
         set(URL ${NODEJS_URL})
@@ -201,7 +201,7 @@
     set(NODEJS_INSTALLED False CACHE BOOL "Node.js install status" FORCE)
     if(VERSION STREQUAL "installed")
         if(NOT NAME STREQUAL ${NODEJS_DEFAULT_NAME})
-            message(FATAL_ERROR
+            message(FATAL_ERROR
                 "'Installed' version identifier can only be used with"
                 "the core Node.js library"
             )
@@ -217,7 +217,7 @@
                 OUTPUT_STRIP_TRAILING_WHITESPACE
             )
             if(INSTALLED_VERSION_RESULT STREQUAL "0")
-                set(NODEJS_INSTALLED True CACHE BOOL
+                set(NODEJS_INSTALLED True CACHE BOOL
                     "Node.js install status" FORCE
                 )
                 set(VERSION ${INSTALLED_VERSION})
@@ -239,7 +239,7 @@

     # If we're trying to determine the version or we haven't saved the
     # checksum file for this version, download it from the specified server
-    if(VERSION STREQUAL "latest" OR
+    if(VERSION STREQUAL "latest" OR
       (DEFINED ROOT AND NOT EXISTS ${ROOT}/CHECKSUM))
         if(DEFINED ROOT)
             # Clear away the old checksum in case the new one is different
@@ -256,7 +256,7 @@
         list(GET CHECKSUM_STATUS 0 CHECKSUM_STATUS)
         if(CHECKSUM_STATUS GREATER 0)
             file(REMOVE ${TEMP}/CHECKSUM)
-            message(FATAL_ERROR
+            message(FATAL_ERROR
                 "Unable to download checksum file"
             )
         endif()
@@ -287,7 +287,7 @@
     else()
         set(VERSION ${CMAKE_MATCH_3})
     endif()
-    set(HEADERS_ARCHIVE
+    set(HEADERS_ARCHIVE
         ${CMAKE_MATCH_2}-${CMAKE_MATCH_3}-${CMAKE_MATCH_4}${CMAKE_MATCH_5}
     )
     # Make sure that the root directory exists, and that the checksum
@@ -306,7 +306,7 @@
         file(REMOVE ${ROOT}/CHECKSUM)
         file(RENAME ${TEMP}/CHECKSUM ${ROOT}/CHECKSUM)
     endif()
-
+
     # Now that its fully resolved, report the name and version of Node.js being
     # used
     message(STATUS "NodeJS: Using ${NAME}, version ${VERSION}")
@@ -423,14 +423,14 @@
             )
             list(GET LIB32_STATUS 0 LIB32_STATUS)
             if(LIB32_STATUS GREATER 0)
-                message(FATAL_ERROR
+                message(FATAL_ERROR
                     "Unable to download Node.js windows library (32-bit)"
                 )
             endif()
             file(REMOVE_RECURSE ${ROOT}/${LIB32_PATH})
             file(MAKE_DIRECTORY ${ROOT}/${LIB32_PATH})
-            file(RENAME
-                ${TEMP}/${LIB32_PATH}/${LIB32_NAME}
+            file(RENAME
+                ${TEMP}/${LIB32_PATH}/${LIB32_NAME}
                 ${ROOT}/${LIB32_PATH}/${LIB32_NAME}
             )
             file(REMOVE_RECURSE ${TEMP}/${LIB32_PATH})
@@ -461,14 +461,14 @@
             )
             list(GET LIB64_STATUS 0 LIB64_STATUS)
             if(LIB64_STATUS GREATER 0)
-                message(FATAL_ERROR
+                message(FATAL_ERROR
                     "Unable to download Node.js windows library (64-bit)"
                 )
             endif()
             file(REMOVE_RECURSE ${ROOT}/${LIB64_PATH})
             file(MAKE_DIRECTORY ${ROOT}/${LIB64_PATH})
-            file(RENAME
-                ${TEMP}/${LIB64_PATH}/${LIB64_NAME}
+            file(RENAME
+                ${TEMP}/${LIB64_PATH}/${LIB64_NAME}
                 ${ROOT}/${LIB64_PATH}/${LIB64_NAME}
             )
             file(REMOVE_RECURSE ${TEMP}/${LIB64_PATH})
@@ -488,7 +488,7 @@
         list(APPEND INCLUDE_DIRS ${NODEJS_NAN_DIR})
     endif()

-    # Under windows, we need a bunch of libraries (due to the way
+    # Under windows, we need a bunch of libraries (due to the way
     # dynamic linking works)
     if(WIN32)
         # Generate and use a delay load hook to allow the node binary
@@ -496,9 +496,9 @@
         set(DELAY_LOAD_HOOK ${CMAKE_CURRENT_BINARY_DIR}/win_delay_load_hook.c)
         nodejs_generate_delayload_hook(${DELAY_LOAD_HOOK})
         set(SOURCES ${DELAY_LOAD_HOOK})
-
+
         # Necessary flags to get delayload working correctly
-        list(APPEND LINK_FLAGS
+        list(APPEND LINK_FLAGS
             "-IGNORE:4199"
             "-DELAYLOAD:iojs.exe"
             "-DELAYLOAD:node.exe"
@@ -508,7 +508,7 @@
         # Core system libraries used by node
         list(APPEND LIBRARIES
             kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
-            advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
+            advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
             odbc32.lib Shlwapi.lib DelayImp.lib
         )

@@ -550,8 +550,8 @@
 function(add_nodejs_module NAME)
     # Make sure node is initialized (variables set) before defining the module
     if(NOT NODEJS_INIT)
-        message(FATAL_ERROR
-            "Node.js has not been initialized. "
+        message(FATAL_ERROR
+            "Node.js has not been initialized. "
             "Call nodejs_init before adding any modules"
         )
     endif()
@@ -559,8 +559,8 @@
     # ncmake takes care of this, but be sure to set CMAKE_BUILD_TYPE yourself
     # if invoking CMake directly
     if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
-        message(FATAL_ERROR
-            "Configuration type must be specified. "
+        message(FATAL_ERROR
+            "Configuration type must be specified. "
             "Set CMAKE_BUILD_TYPE or use a different generator"
         )
     endif()
@@ -571,7 +571,7 @@
     # Two helpful ones:
     # MODULE_NAME must match the name of the build library, define that here
     # ${NAME}_BUILD is for symbol visibility under windows
-    target_compile_definitions(${NAME}
+    target_compile_definitions(${NAME}
         PRIVATE MODULE_NAME=${NAME}
         PRIVATE ${NAME}_BUILD
         PUBLIC ${NODEJS_DEFINITIONS}
@@ -601,8 +601,8 @@
     # Multi-target generators do this automatically
     # This (luckily) mirrors node-gyp conventions
     if(NOT CMAKE_CONFIGURATION_TYPES)
-        set_property(TARGET ${NAME} PROPERTY
+        set_property(TARGET ${NAME} PROPERTY
             LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BUILD_TYPE}
         )
     endif()
-endfunction()+endfunction()


Use set_target_properties instead of target_link_libraries to add LINK_FLAGS

--- NodeJS.cmake
+++ NodeJS.cmake
@@ -592,7 +592,7 @@
     target_include_directories(${NAME} PUBLIC ${NODEJS_INCLUDE_DIRS})

     # Add link flags to the module
-    target_link_libraries(${NAME} ${NODEJS_LINK_FLAGS} ${NODEJS_LIBRARIES})
+    target_link_libraries(${NAME} ${NODEJS_LIBRARIES})

     # Set required properties for the module to build properly
     # Correct naming, symbol visiblity and C++ standard
@@ -606,6 +606,7 @@
         POSITION_INDEPENDENT_CODE TRUE
         CMAKE_CXX_STANDARD_REQUIRED TRUE
         CXX_STANDARD 11
+        LINK_FLAGS "${NODEJS_LINK_FLAGS}"
     )

     # Make sure we're buiilding in a build specific output directory


Add heaptrack --help.

Add heaptrack --help.

--- heaptrack.sh.cmake
+++ heaptrack.sh.cmake
@@ -19,14 +19,42 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #

-debug=
-if [ "$1" = "--debug" ]; then
-  debug=1
-  shift 1;
+if [ "$1" = "--help" -o "$1" = "-h" ]; then
+    echo "Usage: $0 [--debug|-d] DEBUGGEE [ARGUMENT]..."
+    echo
+    echo "A heap memory usage profiler. It uses LD_PRELOAD to track all"
+    echo "calls to the core memory allocation functions and logs these"
+    echo "occurrances. Additionally, backtraces are obtained and logged."
+    echo "Combined this can give interesting answers to questions such as:"
+    echo
+    echo "  * How much heap memory is my application using?"
+    echo "  * Where is heap memory being allocated, and how often?"
+    echo "  * How much space are heap individual allocations requesting?"
+    echo
+    echo "To evaluate the generated heaptrack data, use heaptrack_print."
+    echo
+    echo "Mandatory arguments to heaptrack:"
+    echo "  DEBUGGEE        The name or path to the application that should"
+    echo "                 be run with heaptrack analyzation enabled."
+    echo
+    echo "Optional arguments to heaptrack:"
+    echo "  -d, --debug    Run the debuggee in GDB and heaptrack."
+    echo "  ARGUMENT       Any number of arguments that will be passed verbatim"
+    echo "                 to the debuggee."
+    echo
+    exit 0
 fi

-if [ -z "$1" ]; then
-    echo "$0 DEBUGEE [ARGS...]"
+debug=
+if [ "$1" = "--debug" -o "$1" = "-d" ]; then
+    debug=1
+    shift 1;
+fi
+
+if [ ! -x "$1" ]; then
+    echo "Error: Debuggee \"$1\" is not an executable."
+    echo
+    echo "Usage: $0 [--debug|-d] DEBUGGEE [ARGS...]"
     exit 1
 fi


Silence GDB stdout messages by using --batch-silent.

--- heaptrack.sh.cmake
+++ heaptrack.sh.cmake
@@ -157,12 +157,12 @@
         --eval-command="set environment DUMP_HEAPTRACK_OUTPUT=$pipe" \
         --eval-command="run" --args $client $clientargs
   else
-    gdb -n -iex="set auto-solib-add off" -p $pid \
+    gdb --batch-silent -n -iex="set auto-solib-add off" -p $pid \
         --eval-command="sharedlibrary libdl" \
         --eval-command="call (void) dlopen(\"$LIBHEAPTRACK_INJECT\", 0x002)" \
         --eval-command="sharedlibrary libheaptrack_inject" \
         --eval-command="call (void) heaptrack_inject(\"$pipe\")" \
-        --eval-command="detach" --eval-command="quit"
+        --eval-command="detach"
   fi
 fi


fix missing dependencies

fix missing dependencies

--- build/toolchains/tests.cmake
+++ build/toolchains/tests.cmake
@@ -16,9 +16,11 @@

 find_library(OPENGL_FRAMEWORK OpenGL)
 find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation)
-
+find_library(COCOA_FRAMEWORK Cocoa)
+
 list(APPEND OSX_LIBRARIES
     ${OPENGL_FRAMEWORK}
+    ${COCOA_FRAMEWORK}
     ${CORE_FOUNDATION_FRAMEWORK})

 file(GLOB TEST_SOURCES unitTests/tests/*.cpp)


fixed cmake syntax error

fixed cmake syntax error

--- cmake/FindCPU_FEATURES.cmake
+++ cmake/FindCPU_FEATURES.cmake
@@ -240,7 +240,7 @@
   wmic_get("NumberOfCores" CPU_NPHYS_CORES)

   #dirty hack that I need to validate with other machines in Win7
-  if(NOT "${L2_CACHE_SIZE}" STR_EQUAL "")
+  if(NOT "${L2_CACHE_SIZE}" STREQUAL "")
     if(${CPU_NPHYS_CORES} GREATER 1)
       math(EXPR L2_CACHE_SIZE "${L2_CACHE_SIZE}/${CPU_NPHYS_CORES}")
     endif()


fixing for osx mavericks

fixing for osx mavericks

--- cmake/Modules/FindGLEW.cmake
+++ cmake/Modules/FindGLEW.cmake
@@ -42,16 +42,17 @@

   IF (APPLE)
 # These values for Apple could probably do with improvement.
-  if (${CMAKE_VERSION_SYSTEM} VERSION_LESS "10.9.0")
+  if (${CMAKE_SYSTEM_VERSION} VERSION_LESS "13.0.0")
     FIND_PATH( GLEW_INCLUDE_DIR glew.h
       /System/Library/Frameworks/GLEW.framework/Versions/A/Headers
       ${OPENGL_LIBRARY_DIR}
       )
     SET(GLEW_GLEW_LIBRARY "-framework GLEW" CACHE STRING "GLEW library for OSX")
-  else (${CMAKE_VERSION_SYSTEM} VERSION_LESS "10.9.0")
-    find_package(Glew)
+  else (${CMAKE_SYSTEM_VERSION} VERSION_LESS "13.0.0")
+    find_package(PkgConfig)
+    pkg_check_modules(glew GLEW)
     SET(GLEW_GLEW_LIBRARY ${GLEW_LIBRARIES} CACHE STRING "GLEW library for OSX")
-  endif (${CMAKE_VERSION_SYSTEM} VERSION_LESS "10.9.0")
+  endif (${CMAKE_SYSTEM_VERSION} VERSION_LESS "13.0.0")
     SET(GLEW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
   ELSE (APPLE)


Hack to make clock_gettime work again

Hack to make clock_gettime work again

--- cmake/Modules/platform.cmake
+++ cmake/Modules/platform.cmake
@@ -40,10 +40,14 @@

 macro(clock_check)
 	if(HAVE_POSIX)
-		add_definitions(-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_VERSION=700)
+		# XXX hack to make this check work
+		set(CMAKE_REQUIRED_DEFINITIONS -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_VERSION=700)
 		check_symbol_exists(clock_gettime time.h HAVE_CLOCK_GETTIME)

-		if(NOT HAVE_CLOCK_GETTIME)
+		if(HAVE_CLOCK_GETTIME)
+			# Needed to see it
+			add_definitions(-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L -D_XOPEN_VERSION=700)
+		else()
 			# OS X check
 			check_include_files("mach/mach.h;mach/clock.h" HAVE_MACH_CLOCK_H)
 		endif()


Added missing return-type as error for linux systems

--- cmake/PlatformLinuxGCC.cmake
+++ cmake/PlatformLinuxGCC.cmake
@@ -29,12 +29,13 @@

 set(LINUX_COMPILE_FLAGS
-	"-pthread -fno-exceptions -pipe -fPIC"
+	"-pthread -fno-exceptions -pipe -fPIC -Wreturn-type -Werror=return-type"
 	# pthread       -> use pthread library
 	# no-rtti       -> disable c++ rtti
 	# no-exceptions -> disable exception handling
 	# pipe          -> use pipes
 	# fPIC          -> use position independent code
+	# -Wreturn-type -Werror=return-type -> missing returns in functions and methods are handled as errors which stops the compilation
 )
 set(DEFAULT_COMPILE_FLAGS ${LINUX_COMPILE_FLAGS})


Fix interface targets that do not have libraries (#1013)

--- cmake/catkin_libraries.cmake
+++ cmake/catkin_libraries.cmake
@@ -137,8 +137,10 @@
       get_target_property(${lib}_imported ${lib} IMPORTED)
       if(${${lib}_type} STREQUAL "INTERFACE_LIBRARY")
         get_target_property(${lib}_interface_link_libraries ${lib} INTERFACE_LINK_LIBRARIES)
-        catkin_replace_imported_library_targets(${lib}_resolved_libs ${${lib}_interface_link_libraries})
-        list(APPEND result ${${lib}_resolved_libs})
+        if(${${lib}_interface_link_libraries})
+          catkin_replace_imported_library_targets(${lib}_resolved_libs ${${lib}_interface_link_libraries})
+          list(APPEND result ${${lib}_resolved_libs})
+        endif()
       elseif(${${lib}_imported})
         set(imported_libraries)  # empty list
         get_target_property(${lib}_imported_location ${lib} IMPORTED_LOCATION)


build: ignore non-standard C warnings on Windows

Silence a warning from Microsoft's ucrt due to use of the POSIX name (strdup).

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -132,6 +132,7 @@
   if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
     list(APPEND result "-DLLVM_ON_WIN32")
     list(APPEND result "-D_CRT_SECURE_NO_WARNINGS")
+    list(APPEND result "-D_CRT_NONSTDC_NO_WARNINGS")
     # TODO(compnerd) handle /MT
     list(APPEND result "-D_DLL")
     list(APPEND result "-fms-compatibility-version=1900")


build: custom import libraries are not needed for host libraries

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -774,19 +774,7 @@
                             CXX_STANDARD 14)
   endif()

-  if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS" AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
-    if("${libkind}" STREQUAL "SHARED")
-      # Each dll has an associated .lib (import library); since we may be
-      # building on a non-DLL platform (not windows), create an imported target
-      # for the library which created implicitly by the dll.
-      add_custom_command_target(${target}_IMPORT_LIBRARY
-                                OUTPUT "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/${target}.lib"
-                                DEPENDS "${target}")
-      add_library(${target}_IMPLIB SHARED IMPORTED GLOBAL)
-      set_property(TARGET "${target}_IMPLIB" PROPERTY
-          IMPORTED_LOCATION "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/${target}.lib")
-      add_dependencies(${target}_IMPLIB ${${target}_IMPORT_LIBRARY})
-    endif()
+  if(SWIFT_HOST_VARIANT_SDK STREQUAL WINDOWS)
     set_property(TARGET "${target}" PROPERTY NO_SONAME ON)
   endif()


build: do not use the VFS overlay on MSVC

When building for Windows on Windows using Visual Studio, we would attempt to
pass the clang specific flags to cl.  It would then attempt to treat the overlay
definition as an input and fail.  Although this shouldn't be needed on Windows,
it keeps the builds with clang similar across Linux and Windows.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -802,11 +802,13 @@

   if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
     swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
-    swift_windows_generate_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY_FLAGS)
-    foreach(flag ${SWIFTLIB_SINGLE_VFS_OVERLAY_FLAGS})
-      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;${flag})
-      list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS ${flag})
-    endforeach()
+    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+      swift_windows_generate_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY_FLAGS)
+      foreach(flag ${SWIFTLIB_SINGLE_VFS_OVERLAY_FLAGS})
+        list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;${flag})
+        list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS ${flag})
+      endforeach()
+    endif()
     foreach(directory ${SWIFTLIB_INCLUDE})
       list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-I${directory})
     endforeach()


Make finder aware of external sources

Make finder aware of external sources

--- cmake/modules/FindTUIO.cmake
+++ cmake/modules/FindTUIO.cmake
@@ -15,7 +15,7 @@
 # Include dir
 find_path(TUIO_INCLUDE_DIR
   NAMES TUIO/TuioClient.h
-  PATHS ${TUIO_PKGCONF_INCLUDE_DIRS}
+  PATHS ${TUIO_PKGCONF_INCLUDE_DIRS} ${TUIO_ROOT} $ENV{TUIO_ROOT}
 )

 # also add the TUIO/ directory to the include path
@@ -27,7 +27,7 @@
 # Finally the library itself
 find_library(TUIO_LIBRARY
   NAMES TUIO
-  PATHS ${TUIO_PKGCONF_LIBRARY_DIRS}
+  PATHS ${TUIO_PKGCONF_LIBRARY_DIRS} ${TUIO_ROOT} $ENV{TUIO_ROOT}
 )

 # Set the include dir variables and the libraries and let libfind_process do the rest.


cmdline for manual run has full diff file: updated message to instruct to pull out just header to temp file

git-svn-id: ed337ca7cdb08c0ba29d8fe58632bb7686892c2d@524 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6

--- make/codereview.cmake
+++ make/codereview.cmake
@@ -493,7 +493,7 @@
       endif (arg MATCHES " ")
     endforeach(arg ${upload_cmd})
     if (NOT EXISTS "${cookie_file}")
-      message(STATUS "It looks like upload.py does not have cookies in place and will prompt you for a password.  To do so you must run it separately (and then use -DCR_ISSUE=<issue#> arg with future invocations of this script in order to update the same issue).\nPlease run:\n\t${upload_cmd_str}")
+      message(STATUS "It looks like upload.py does not have cookies in place and will prompt you for a password.  To do so you must run it separately (and then use -DCR_ISSUE=<issue#> arg with future invocations of this script in order to update the same issue).\nPlease run this command, but copy the header only\nof ${DIFF_FILE} to a new temp file and point -f at it:\n\t${upload_cmd_str}")
     else (NOT EXISTS "${cookie_file}")
       message(STATUS "running ${upload_cmd_str}")
       execute_process(COMMAND ${upload_cmd}


Add comments

Add comments

--- test/module_test.cmake
+++ test/module_test.cmake
@@ -26,6 +26,8 @@
 if(${TEST_DEBUG}) # with debug option
   set(DEBUG_FLAG --debug)
 endif()
+
+# Execute the CLAW compiler for CPU target
 add_custom_command(
   OUTPUT  ${OUTPUT_FILE_CPU}
   COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=cpu ${DEBUG_FLAG} -J ${XMOD_DIR} -o ${OUTPUT_FILE_CPU} ${ORIGINAL_FILE}
@@ -34,6 +36,7 @@
   COMMENT "Translating CLAW directive with ${CLAWFC} for CPU target"
 )

+# Execute the CLAW compiler for GPU target
 add_custom_command(
   OUTPUT  ${OUTPUT_FILE_GPU}
   COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --target=gpu ${DEBUG_FLAG} -J ${XMOD_DIR} -o ${OUTPUT_FILE_GPU} ${ORIGINAL_FILE}


Parallelize compilation on Windows (#457)

--- CMake/CompilerFlags.cmake
+++ CMake/CompilerFlags.cmake
@@ -46,6 +46,9 @@
         /DPTW32_STATIC_LIB
         /D_CRT_SECURE_NO_WARNINGS
         /D_SCL_SECURE_NO_WARNINGS
+    )
+    add_compile_options(
+        /MP # Enable multi-processor compilation
     )
 endif()


What?  What is this file?  Why is it here? This looks like it dates back to 2009 or earlier.

--- CMake/CompilerFlags.cmake
+++ CMake/CompilerFlags.cmake
@@ -1,16 +0,0 @@
-
-set(CMAKE_C_FLAGS "-Wall")
-
-set(CMAKE_CXX_FLAGS "-Wall -Woverloaded-virtual -fno-exceptions -Wparentheses")
-set(CMAKE_CXX_FLAGS_DEBUG "g3 -DDEBUG -O0")
-set(CMAKE_CXX_FLAGS_RELEASE
-    "-O2 -finline-functions -finline-limit=2000 -g -DDEBUG")
-set(CMAKE_CXX_FLAGS_VERBOSE "-g -DDEBUG -DVERBOSE")
-set(CMAKE_CXX_FLAGS_FAST "O2 -finline-functions -finline-limit=2000 -fomit-frame-pointer -g -DNDEBUG")
-set(CMAKE_CXX_FLAGS_UNSAFE "-O3 -ffast-math -g -fomit-frame-pointer -DNDEBUG")
-set(CMAKE_CXX_FLAGS_PROFILE "-O2 -pg -finline-limit=12 -DPROFILE -DNDEBUG")
-set(CMAKE_CXX_FLAGS_SMALL "-Os -DNDEBUG")
-set(CMAKE_CXX_FLAGS_TRACE "-g -DNDEBUG")
-
-add_definitions( -DDISABLE_DISK_MATRIX )
-


Smarter handling of HDF5 dependency search, especially for Debian systems where things are Weird(TM).

--- CMake/FindArmadillo.cmake
+++ CMake/FindArmadillo.cmake
@@ -222,7 +222,27 @@

     # Search for HDF5 (or replacement).
     if (NOT "${ARMA_USE_HDF5}" STREQUAL "")
-      find_package(HDF5 REQUIRED)
+      find_package(HDF5 QUIET)
+
+      if(NOT HDF5_FOUND)
+        # On Debian systems, the HDF5 package has been split into multiple
+        # packages so that it is co-installable.  But this may mean that the
+        # include files are hidden somewhere very odd that the FindHDF5.cmake
+        # script will not find.  Thus, we'll also quickly check pkgconfig to see
+        # if there is information on what to use there.
+        find_package(PkgConfig)
+        if (PKG_CONFIG_FOUND)
+          pkg_check_modules(HDF5 hdf5)
+          # But using pkgconfig is a little weird because HDF5_LIBRARIES won't
+          # be filled with exact library paths, like the other scripts.  So
+          # instead what we get is HDF5_LIBRARY_DIRS which is the equivalent of
+          # what we'd pass to -L.
+          if (HDF5_FOUND)
+            # I'm not sure what I think of doing this here...
+            link_directories("${HDF5_LIBRARY_DIRS}")
+          endif()
+        endif()
+      endif()

       set(SUPPORT_INCLUDE_DIRS "${SUPPORT_INCLUDE_DIRS}" "${HDF5_INCLUDE_DIRS}")
       set(SUPPORT_LIBRARIES "${SUPPORT_LIBRARIES}" "${HDF5_LIBRARIES}")
@@ -230,17 +250,38 @@

   else("${ARMA_USE_WRAPPER}" STREQUAL "")
     # Some older versions still require linking against HDF5 since they did not
-    # wrap libhdf5.  This was true until 4.300 (check this!).
-
-    if(NOT "${ARMA_USE_HDF5}" STREQUAL "")
+    # wrap libhdf5.  This was true for versions older than 4.300.
+
+    if(NOT "${ARMA_USE_HDF5}" STREQUAL "" AND
+       "${ARMADILLO_VERSION_STRING}" VERSION_LESS "4.300.0")
       message(STATUS "Armadillo HDF5 support is enabled and manual linking is "
                      "required.")
       # We have HDF5 support and need to link against HDF5.
-      find_package(HDF5 REQUIRED)
-
-      set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
-      set(SUPPORT_LIBRARIES "${HDF5_LIBRARIES}")
-    endif(NOT "${ARMA_USE_HDF5}" STREQUAL "")
+      find_package(HDF5)
+
+      if(NOT HDF5_FOUND)
+        # On Debian systems, the HDF5 package has been split into multiple
+        # packages so that it is co-installable.  But this may mean that the
+        # include files are hidden somewhere very odd that the FindHDF5.cmake
+        # script will not find.  Thus, we'll also quickly check pkgconfig to see
+        # if there is information on what to use there.
+        find_package(PkgConfig)
+        if (PKG_CONFIG_FOUND)
+          pkg_check_modules(HDF5 hdf5)
+          # But using pkgconfig is a little weird because HDF5_LIBRARIES won't
+          # be filled with exact library paths, like the other scripts.  So
+          # instead what we get is HDF5_LIBRARY_DIRS which is the equivalent of
+          # what we'd pass to -L.
+          if (HDF5_FOUND)
+            # I'm not sure what I think of doing this here...
+            link_directories("${HDF5_LIBRARY_DIRS}")
+          endif()
+        endif()
+
+        set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
+        set(SUPPORT_LIBRARIES "${HDF5_LIBRARIES}")
+      endif()
+    endif()

   endif("${ARMA_USE_WRAPPER}" STREQUAL "")


Fix PackageConfig

Fix PackageConfig

--- CMake/PackageConfig.cmake
+++ CMake/PackageConfig.cmake
@@ -237,6 +237,10 @@
   DESTINATION ${CMAKE_MODULE_INSTALL_PATH} COMPONENT dev)

 # create and install Project.pc
+if(NOT LIBRARY_DIR)
+  set(LIBRARY_DIR lib)
+endif()
+
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/pkg/${CMAKE_PROJECT_NAME}.pc
   "prefix=${CMAKE_INSTALL_PREFIX}\n"
   "exec_prefix=\${prefix}\n"


Aaand another Boost fix

Aaand another Boost fix

--- Common.cmake
+++ Common.cmake
@@ -82,6 +82,11 @@
 if(NOT Boost_USE_STATIC_LIBS)
   add_definitions(-DBOOST_TEST_DYN_LINK) # generates main() for unit tests
 endif()
+if(NOT "$ENV{BOOST_ROOT}" STREQUAL "" OR
+    NOT "$ENV{BOOST_LIBRARYDIR}" STREQUAL "")
+  # Fix find of non-system Boost
+  option(Boost_NO_SYSTEM_PATHS "Disable system paths for FindBoost" ON)
+endif()

 include(TestBigEndian)
 test_big_endian(BIGENDIAN)


- EN COURS - task references #211: Mise à jour de Ogre vers v1-9.0 stable - Correction FindFreeImage

--- CMake/Packages/FindFreeImage.cmake
+++ CMake/Packages/FindFreeImage.cmake
@@ -40,8 +40,8 @@

 find_path(FreeImage_INCLUDE_DIR NAMES FreeImage.h HINTS ${FreeImage_INC_SEARCH_PATH} ${FreeImage_PKGC_INCLUDE_DIRS})

-find_library(FreeImage_LIBRARY_REL NAMES ${FreeImage_LIBRARY_NAMES} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Release RelWithDebInfo MinSizeRel)
-find_library(FreeImage_LIBRARY_DBG NAMES ${FreeImage_LIBRARY_NAMES_DBG} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" Debug)
+find_library(FreeImage_LIBRARY_REL NAMES ${FreeImage_LIBRARY_NAMES} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
+find_library(FreeImage_LIBRARY_DBG NAMES ${FreeImage_LIBRARY_NAMES_DBG} HINTS ${FreeImage_LIB_SEARCH_PATH} ${FreeImage_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)

 make_library_set(FreeImage_LIBRARY)


:bug: Fixed missing include in FindOpenGLES2.cmake

--- CMake/Packages/FindOpenGLES2.cmake
+++ CMake/Packages/FindOpenGLES2.cmake
@@ -22,6 +22,8 @@
 #  EGL_FOUND        - system has EGL
 #  EGL_INCLUDE_DIR  - the EGL include directory
 #  EGL_LIBRARIES    - Link these to use EGL
+
+include(FindPkgMacros)

 IF(APPLE)
   create_search_paths(/Developer/Platforms)


add a helper to include drivers files

add a helper to include drivers files

--- board_examples/cmake/example.cmake
+++ board_examples/cmake/example.cmake
@@ -1,6 +1,17 @@

 set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../backends/cmake/)
 include(embedded)
+
+if (PROJECT_DRIVERS)
+	foreach (driver ${PROJECT_DRIVERS})
+		if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/../../drivers/${driver})
+			include_directories(${CMAKE_CURRENT_LIST_DIR}/../../drivers/${driver}/)
+			file (GLOB cpp_driver_files ${CMAKE_CURRENT_LIST_DIR}/../../drivers/${driver}/*.cpp)
+			file (GLOB hpp_driver_files ${CMAKE_CURRENT_LIST_DIR}/../../drivers/${driver}/*.hpp)
+			list (APPEND PROJECT_SOURCES ${cpp_driver_files} ${hpp_driver_files})
+		endif()
+	endforeach()
+endif()

 ADD_EXECUTABLE(${CMAKE_PROJECT_NAME}.elf		${PROJECT_SOURCES})


Add MacPorts to CMake search path

Add MacPorts to CMake search path

--- Common.cmake
+++ Common.cmake
@@ -130,6 +130,7 @@
 set(LIBRARY_DIR lib${LIB_SUFFIX})

 if(APPLE)
+  list(APPEND CMAKE_PREFIX_PATH "/opt/local/")
   if(NOT CMAKE_OSX_ARCHITECTURES OR CMAKE_OSX_ARCHITECTURES STREQUAL "")
     if(_CMAKE_OSX_MACHINE MATCHES "ppc")
       set(CMAKE_OSX_ARCHITECTURES "ppc;ppc64" CACHE


Removed BALL component Queasy

Removed BALL component Queasy

--- cmake/BALLComponents.cmake
+++ cmake/BALLComponents.cmake
@@ -35,7 +35,6 @@

 	## applications
 	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION}")
-	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION}")
 	SET(COMPONENT_TOOLS    "BALLTools${BALL_PACKAGE_VERSION}")
 ELSEIF(APPLE)
 	## libraries
@@ -57,7 +56,6 @@

 	## applications
 	SET(COMPONENT_BALLVIEW "BALLView${BALL_PACKAGE_VERSION}")
-	SET(COMPONENT_QUEASY   "QuEasy${BALL_PACKAGE_VERSION}")
 	SET(COMPONENT_TOOLS    "BALLTools${BALL_PACKAGE_VERSION}")
 ELSEIF(WIN32)
 	## libraries
@@ -79,13 +77,12 @@

 	## applications
 	SET(COMPONENT_BALLVIEW "BALLView")
-	SET(COMPONENT_QUEASY   "QuEasy")
 	SET(COMPONENT_TOOLS    "BALLTools")
 ENDIF()

 INCLUDE(source/EXTENSIONS/BALLPluginComponents.cmake)

-## Note: On MacOS X, it is necessary to have the applications (COMPONENT_BALLVIEW, COMPONENT_QUEASY) at the
+## Note: On MacOS X, it is necessary to have the applications (COMPONENT_BALLVIEW) at the
 ##       *end* of this list; otherwise, the automatic fixing of import library names will omit all components
 ##       that come after it
 SET(BALL_COMPONENTS
@@ -104,10 +101,6 @@

 IF (BALL_BUILD_BALLAXY)
 	LIST(APPEND BALL_COMPONENTS ${COMPONENT_TOOLS})
-ENDIF()
-
-IF (BALL_BUILD_QUEASY)
-	LIST(APPEND BALL_COMPONENTS ${COMPONENT_QUEASY})
 ENDIF()

 LIST(APPEND BALL_COMPONENTS ${COMPONENT_BALLVIEW})
@@ -202,12 +195,4 @@
 SET_COMPONENT_DEPENDENCIES(${COMPONENT_TOOLS} "${COMPONENT_LIBBALL}")
 ENDIF()

-IF (BALL_BUILD_QUEASY)
-	SET_COMPONENT_NAME(${COMPONENT_QUEASY}
-		"QuEasy"
-		"QuEasy is a frontend to BALL's QSAR capabilities"
-	)
-	SET_COMPONENT_DEPENDENCIES(${COMPONENT_QUEASY} "${COMPONENT_LIBVIEW}")
-ENDIF()
-
 SET(CPACK_COMPONENTS_ALL ${BALL_COMPONENTS})


Fix error in MacOS build

Fix error in MacOS build

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -125,7 +125,7 @@
             -Wreturn-stack-address
         >

-        $<$<PLATFORM_ID:"Darwin">:
+        $<$<PLATFORM_ID:Darwin>:
             -pthread
         >
     )


Attempt at fixing ABI problem.

Attempt at fixing ABI problem.

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

 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-set(EXTRA_CXX_FLAGS "-Werror -Wall -Wpedantic -Wextra")
+set(EXTRA_CXX_FLAGS "-Werror -Wall -Wpedantic -Wextra -D_GLIBCXX_USE_CXX11_ABI=1")
 set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -flto -O3 -DRELEASE -DNDEBUG")
 #set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} "-ggdb -fno-omit-frame-pointer")