ARROW-4931: [C++] CMake fails on gRPC ExternalProject

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #3943 from xhochy/ARROW-4931 and squashes the following commits:

aa24d57c9 <Uwe L. Korn> ARROW-4931:  CMake fails on gRPC ExternalProject

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1979,6 +1979,7 @@
   add_dependencies(gRPC::grpc grpc_ep)
   add_dependencies(gRPC::grpc++ grpc_ep)
   add_dependencies(gRPC::address_sorting grpc_ep)
+  set(GRPC_VENDORED TRUE)
 endmacro()

 if(ARROW_WITH_GRPC)
@@ -2017,14 +2018,18 @@
   get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES)
   include_directories(SYSTEM ${GRPC_INCLUDE_DIR})

-  # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp
-  # depending on the gRPC version.
-  if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h")
+  if(GRPC_VENDORED)
     set(GRPCPP_PP_INCLUDE TRUE)
-  elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h")
-    set(GRPCPP_PP_INCLUDE FALSE)
   else()
-    message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}")
+    # grpc++ headers may reside in ${GRPC_INCLUDE_DIR}/grpc++ or ${GRPC_INCLUDE_DIR}/grpcpp
+    # depending on the gRPC version.
+    if(EXISTS "${GRPC_INCLUDE_DIR}/grpcpp/impl/codegen/config_protobuf.h")
+      set(GRPCPP_PP_INCLUDE TRUE)
+    elseif(EXISTS "${GRPC_INCLUDE_DIR}/grpc++/impl/codegen/config_protobuf.h")
+      set(GRPCPP_PP_INCLUDE FALSE)
+    else()
+      message(FATAL_ERROR "Cannot find grpc++ headers in ${GRPC_INCLUDE_DIR}")
+    endif()
   endif()
 endif()


ARROW-13428: [C++][Flight] Add missing -lssl with bundled gRPC and system shared OpenSSL

If bundled gRPC uses system shared OpenSSL, libarrow_flight.so should
link system shared OpenSSL.

See also: https://github.com/apache/arrow/pull/10768#issuecomment-884726000

Closes #10773 from kou/cpp-bundled-grpc-and-system-openssl

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Krisztián Szűcs <6bab32dc957a05a87930e779f272342e159326fa@gmail.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -2542,6 +2542,7 @@
       re2::re2
       c-ares::cares
       ZLIB::ZLIB
+      OpenSSL::SSL
       Threads::Threads)
   set_target_properties(gRPC::grpc
                         PROPERTIES IMPORTED_LOCATION "${GRPC_STATIC_LIBRARY_GRPC}"


rust.cmake: force Rust TLS model to local-exec

Rust's tls-model must be consistent with what CAmkES uses or the ipc
buffer used by sel4-sys for system calls will not be found.

Change-Id: I79fde1c08013544959ca7d037c806ce2093391f8
GitOrigin-RevId: 1da18875c28107ca2dab127990cd973b4ffafb6f

--- apps/system/rust.cmake
+++ apps/system/rust.cmake
@@ -7,6 +7,10 @@
 cmake_minimum_required(VERSION 3.8.2)
 include_guard(GLOBAL)

+# Force TLS-model to be compatible with CAmkES usage.
+# NB: we cannot use CARGO_OPTIONS, cargo will strip it out
+set(RUSTFLAGS "-Z tls-model=local-exec" CACHE INTERNAL "rustc env flags")
+
 list(APPEND CARGO_OPTIONS
   --target riscv32imac-unknown-none-elf
   -Z unstable-options
@@ -15,7 +19,6 @@
 if("${RELEASE}")
     list(APPEND CARGO_OPTIONS "--release")
 endif()
-

 # add_library but for rust libraries. Invokes cargo in the SOURCE_DIR that is provided,
 # all build output is placed in BUILD_DIR or CMAKE_CURRENT_BINARY_DIR if BUILD_DIR isn't provided.
@@ -48,7 +51,8 @@
         DEPENDS ${RUST_DEPENDS}
         WORKING_DIRECTORY ${RUST_SOURCE_DIR}
         COMMAND
-            ${CMAKE_COMMAND} -E env cargo +nightly-2021-08-05 build
+            ${CMAKE_COMMAND} -E env RUSTFLAGS=${RUSTFLAGS}
+            cargo +nightly-2021-08-05 build
             ${CARGO_OPTIONS}
             --target-dir ${RUST_BUILD_DIR}
             --out-dir ${RUST_BUILD_DIR}


Correctly supress tests that required bit to v support.

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

--- make/devices.cmake
+++ make/devices.cmake
@@ -1229,7 +1229,7 @@
       SOURCES ${ADD_FPGA_TARGET_SOURCES} ${TESTBENCH}
       )

-    if(NOT ${NO_BITSTREAM})
+    if(NOT ${NO_BIT_TO_V})
       add_testbench(
         NAME testbinch_${TESTBENCH_NAME}
         ARCH ${ARCH}
@@ -1243,7 +1243,7 @@
       message(FATAL_ERROR "EQUIV_CHECK_SCRIPT is required if EMIT_CHECK_TESTS is set.")
     endif()

-    if(NOT ${NO_BITSTREAM})
+    if(NOT ${NO_BIT_TO_V})
       add_check_test(
         NAME ${NAME}_check
         ARCH ${ARCH}


typechecker-regex-prototype: fix/unify sandbox handling

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -414,8 +414,9 @@
 			file (COPY "${CMAKE_SOURCE_DIR}/${SANDBOX_ADD_SOURCE}/" DESTINATION "${CMAKE_BINARY_DIR}/${SANDBOX_ADD_SOURCE}")

 			add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
-					    COMMAND ${CABAL_EXECUTABLE} sandbox add-source "${CMAKE_BINARY_DIR}/${SANDBOX_ADD_SOURCE}" -v0
-					    APPEND)
+				COMMAND ${CABAL_EXECUTABLE} sandbox add-source "${CMAKE_BINARY_DIR}/${SANDBOX_ADD_SOURCE}" -v0
+				APPEND
+			)
 		endforeach (SANDBOX_ADD_SOURCE ${ARG_SANDBOX_ADD_SOURCES})
 	endif (ARG_SANDBOX_ADD_SOURCES)


Configuration of the Coveralls custom target.

--- cmake/OpenMACoverallsCustomTarget.cmake
+++ cmake/OpenMACoverallsCustomTarget.cmake
@@ -9,8 +9,9 @@
   ADD_CUSTOM_TARGET(coveralls
     # Generate the output
     COMMAND ${CMAKE_COMMAND}
-      -DCOVERAGE_SRCS_PATH="${PROJECT_SOURCE_DIR}/modules"
-      -DCOVERAGE_SRCS_EXCLUDED=""
+      -DCOVERAGE_SRC_PATH="${PROJECT_SOURCE_DIR}/modules"
+      -DCOVERAGE_SRC_EXCLUDED=".*_p.h::.*test.*::.*bindings.*::.*plugins.*"
+      -DCOVERAGE_BIN_EXCLUDED=".*3rdparty.*"
       -DCOVERALLS_OUTPUT_FILE="${COVERALLS_FILE}"
       -DCOV_PATH="${PROJECT_BINARY_DIR}"
       -DPROJECT_ROOT="${PROJECT_SOURCE_DIR}"


removed print method which calls non-existent __str__ function and throws error

--- copasi/bindings/R/patch-swig-file.cmake
+++ copasi/bindings/R/patch-swig-file.cmake
@@ -44,6 +44,10 @@
 string(REGEX REPLACE "vaccessors = c\\('', ?" "vaccessors = c(" SOURCECODE "${SOURCECODE}" )
 string(REPLACE "vaccessors = c('')" "vaccessors = c()" SOURCECODE "${SOURCECODE}" )

+# Remove broken print function for ExternalReference
+string(REPLACE "setAs('ExternalReference', 'character',\nfunction(from) {if (!is.null(from\$\"__str__\")) from\$\"__str__\"()})" "" SOURCECODE "${SOURCECODE}" )
+string(REPLACE "suppressMessages(suppressWarnings(setMethod('print', 'ExternalReference',\nfunction(x) {print(as(x, \"character\"))})))" "" SOURCECODE "${SOURCECODE}" )
+
 # remove enumFrom/ToInteger code
 SET(NEW_CODE "
 enumToInteger <- function(name,type)


Add _FILE_OFFSET_BITS to build stuff

Add _FILE_OFFSET_BITS to build stuff

--- src/ibp/cmake/LStoreCommon.cmake
+++ src/ibp/cmake/LStoreCommon.cmake
@@ -28,25 +28,31 @@
 include(${CMAKE_SOURCE_DIR}/cmake/CompilerFlags.cmake)

 # Accept config options
-set(PROJECT_VERSION "local" CACHE STRING "Version string for build")
-set(PROJECT_REVISION "1" CACHE STRING "Revision number for packaging")
+set(LSTORE_PROJECT_VERSION "local" CACHE STRING "Version string for build")
+set(LSTORE_PROJECT_REVISION "1" CACHE STRING "Revision number for packaging")
 option(WANT_PACKAGE "Set options for package building, overriding all others"
                     OFF)
 cmake_dependent_option(WANT_STATIC "Attempt to build and link statically" TRUE
                                    "NOT WANT_PACKAGE" FALSE)
-if(WANT_PACKAGE)
+cmake_dependent_option(WANT_DEBUG "Build with debug flags" TRUE
+                                   "NOT WANT_PACKAGE" FALSE)
+if(WANT_DEBUG)
+    set(CMAKE_BUILD_TYPE "Debug")
+else()
     set(CMAKE_BUILD_TYPE "Release")
-endif(WANT_PACKAGE)
+endif(WANT_DEBUG)

 # Set preprocessor flags. TODO: This should be moved to config.h
 # TODO: This should be probably modified if we build on something different
 # http://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
 # _REENTRANT - tells the std library to enable reentrant functions
 # _GNU_SOURCE - uses GNU (not POSIX) functions
-# _LARGEFILE64_SOURCE - this should probably be changed to _FILE_OFFSET_BITS
+# _LARGEFILE64_SOURCE - Along with...
+# _FILE_OFFSET_BITS - Tell gcc that we want 64 bit offsets
 # TODO: Is this truely needed?
 # LINUX=2 - APR seems to want it
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE")
+
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64")
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")

 # Find and link universal deps
@@ -65,7 +71,7 @@
 endif(NOT APPLE)

 # Make the version file.
-set(LSTORE_INC_VERSION_STRING "${LSTORE_PROJECT_NAME}: ${PROJECT_VERSION}")
+set(LSTORE_INC_VERSION_STRING "${LSTORE_PROJECT_NAME}: ${LSTORE_PROJECT_VERSION}")
 site_name(BUILD_HOST)
 Date(BUILD_DATE)
 CompilerVersion(COMPILER_VERSION)
@@ -114,10 +120,10 @@

 # Below is used for building packages
 set(CPACK_PACKAGE_NAME "accre-${LSTORE_PROJECT_NAME}")
-set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
+set(CPACK_PACKAGE_VERSION "${LSTORE_PROJECT_VERSION}")
 set(CPACK_GENERATOR "RPM;DEB")
 set(CPACK_SOURCE_GENERATOR "RPM;DEB")
-set(CPACK_PACKAGE_RELEASE ${PROJECT_REVISION})
+set(CPACK_PACKAGE_RELEASE ${LSTORE_PROJECT_REVISION})
 set(CPACK_PACKAGE_CONTACT "Andrew Melo or Alan Tackett")
 set(CPACK_PACKAGE_VENDOR "Advanced Computing Center for Research and Education, Vanderbilt University")
 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")


In runsuite_common_pre.cmake (thus, all test suites and package
builds), use the most recent Visual Studio version that is installed.
Added a generator= arg so an older version can be selected.

SVN-Revision: 1666

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -74,6 +74,7 @@
   set(arg_use_make OFF) # use unix make instead of visual studio
 endif (UNIX)
 set(arg_use_ninja OFF)  # use ninja
+set(arg_generator "") # specify precise cmake generator (minus any "Win64")
 set(arg_long OFF)     # whether to run the long suite
 set(arg_already_built OFF) # for testing w/ already-built suite
 set(arg_exclude "")   # regex of tests to exclude
@@ -108,6 +109,9 @@
   endif ()
   if (${arg} STREQUAL "use_ninja")
     set(arg_use_ninja ON)
+  endif ()
+  if (${arg} MATCHES "^generator=")
+    string(REGEX REPLACE "^generator=" "" arg_generator "${arg}")
   endif ()
   if (${arg} STREQUAL "long")
     set(arg_long ON)
@@ -271,23 +275,30 @@
 elseif (arg_use_nmake)
   set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
 else ()
-  # we don't yet support VS2010 (i#401) so prefer the others
-  get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;ProductDir] REALPATH)
-  # on failure getting weird results: "c:/registry", so we assume will have Studio
-  if ("${vs_dir}" MATCHES "Studio")
-    set(vs_generator "Visual Studio 9 2008")
+  if (arg_generator)
+    set(vs_generator ${arg_generator})
   else ()
-    get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;ProductDir] REALPATH)
+    # Prefer the most recent version that's installed.  The user can use
+    # generator= to request an older version.
+    get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH)
+    # on failure getting weird results: "c:/registry", so we assume will have Studio
     if ("${vs_dir}" MATCHES "Studio")
-      set(vs_generator "Visual Studio 8 2005")
+      set(vs_generator "Visual Studio 11")
     else ()
       get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] REALPATH)
       if ("${vs_dir}" MATCHES "Studio")
         set(vs_generator "Visual Studio 10")
       else ()
-        get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH)
+        get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;ProductDir] REALPATH)
         if ("${vs_dir}" MATCHES "Studio")
-          set(vs_generator "Visual Studio 11")
+          set(vs_generator "Visual Studio 9 2008")
+        else ()
+          get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;ProductDir] REALPATH)
+          if ("${vs_dir}" MATCHES "Studio")
+            set(vs_generator "Visual Studio 8 2005")
+          else ()
+            message(FATAL_ERROR "Cannot determine Visual Studio version")
+          endif ()
         endif ()
       endif ()
     endif ()


Fixed T24840

Fixed T24840

Ensure Matchpoint core helper to always be loaded to have the data icon available.

Signed-off-by: Ralf Floca <fec4a647ab34f54e20bea9a9e3e1c74f13aefc78@dkfz-heidelberg.de>

--- Plugins/org.mitk.matchpoint.core.helper/manifest_headers.cmake
+++ Plugins/org.mitk.matchpoint.core.helper/manifest_headers.cmake
@@ -2,4 +2,5 @@
 SET(Plugin-Version "0.1")
 set(Plugin-Vendor "DKFZ, Medical and Biological Informatics")
 set(Plugin-ContactAddress "http://www.mitk.org")
-set(Require-Plugin org.mitk.gui.qt.common org.mitk.gui.qt.datamanager)
+set(Require-Plugin org.mitk.gui.common)
+set(Plugin-ActivationPolicy eager)


Firebase cpp: Updated opensource curl version to match internal curl version

PiperOrigin-RevId: 278905557

--- cmake/external/curl.cmake
+++ cmake/external/curl.cmake
@@ -22,7 +22,7 @@
   curl

   GIT_REPOSITORY https://github.com/curl/curl.git
-  GIT_TAG        curl-7_58_0
+  GIT_TAG        curl-7_66_0

   PREFIX ${PROJECT_BINARY_DIR}


fix snap package filename

fix snap package filename

--- cmake/packages/snap.cmake
+++ cmake/packages/snap.cmake
@@ -7,7 +7,7 @@
 if(SNAPCRAFT_FOUND)
   set(SNAPCRAFT_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Ubuntu")
   set(SNAPCRAFT_SOURCE_DIR "${CMAKE_BINARY_DIR}/_CPack_Packages/SNAP")
-  set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap")
+  set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap")

   message(STATUS "Creating snap package")


improve CUDA_ARCH_BIN set (at the moment older cuda versions cause compile error)

--- cmake/pcl_find_cuda.cmake
+++ cmake/pcl_find_cuda.cmake
@@ -34,11 +34,19 @@

 	# Find a complete list for CUDA compute capabilities at http://developer.nvidia.com/cuda-gpus

-	if(${CUDA_VERSION_STRING} VERSION_GREATER "4.1")
-		set(CUDA_ARCH_BIN "2.0 2.1(2.0) 3.0 5.0 5.2" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
-	else()
-		set(CUDA_ARCH_BIN "2.0 2.1(2.0)" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
-	endif()
+        if(NOT ${CUDA_VERSION_STRING} VERSION_LESS "6.5")
+                set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5 5.0 5.2")
+        elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "6.0")
+                set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5 5.0")
+        elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "5.0")
+                set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5")
+        elseif(${CUDA_VERSION_STRING} VERSION_GREATER "4.1")
+                set(__cuda_arch_bin "2.0 2.1(2.0) 3.0")
+        else()
+                set(__cuda_arch_bin "2.0 2.1(2.0)")
+        endif()
+
+        set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")

 	set(CUDA_ARCH_PTX "" CACHE STRING "Specify 'virtual' PTX arch to build PTX intermediate code for. Example: 1.0 1.2 or 10 12")
 	#set(CUDA_ARCH_PTX "1.1 1.2" CACHE STRING "Specify 'virtual' PTX arch to build PTX intermediate code for. Example: 1.0 1.2 or 10 12")


iox-#556 remove install directive for limitations

Signed-off-by: Dietrich Krönke <ea45bc0219d3b6c3a6b9cf3abdfa172e6bfa16ff@apex.ai>

--- iceoryx_posh/cmake/install_help_and_config.cmake
+++ iceoryx_posh/cmake/install_help_and_config.cmake
@@ -23,7 +23,6 @@
         ${CMAKE_CURRENT_SOURCE_DIR}/../NOTICE.md
         ${CMAKE_CURRENT_SOURCE_DIR}/../README.md
         ${CMAKE_CURRENT_SOURCE_DIR}/../CHANGELOG.md
-        ${CMAKE_CURRENT_SOURCE_DIR}/../limitations.md
   DESTINATION share/doc/iceoryx
   COMPONENT dev)


cmake: XercesNetAccessorSelection: Remove ICU components from CURL check

git-svn-id: 3ec853389310512053d525963cab269c063bb453@1840341 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/XercesNetAccessorSelection.cmake
+++ cmake/XercesNetAccessorSelection.cmake
@@ -31,7 +31,7 @@

   # Requires select() which is UNIX only
   if(UNIX)
-    find_package(CURL COMPONENTS uc data)
+    find_package(CURL)
     if(CURL_FOUND)
       list(APPEND netaccessors curl)
     endif()


Backup.

Backup.

--- cmake_modules/find_prerequisites.cmake
+++ cmake_modules/find_prerequisites.cmake
@@ -116,7 +116,7 @@
     find_package(JMF REQUIRED)
         if(JMF_FOUND)
             configure_file(${CMAKE_MODULE_PATH}/jmf_definitions.cmake.in ${CMAKE_BINARY_DIR}/jmf_definitions.cmake)
-            include(${CMAKE_BINARY_DIR}/jmf_definitions.cmake)
+           include(${CMAKE_BINARY_DIR}/jmf_definitions.cmake)
         endif()
 endif()


Build position independent code

Build position independent code

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -35,6 +35,7 @@
   "-DCMAKE_PREFIX_PATH:PATH=${install_prefix};${DRAKE_SUPERBUILD_PREFIX_PATH};${CMAKE_PREFIX_PATH}"
   "-DCMAKE_INSTALL_PREFIX:PATH=${install_prefix}"
   "-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
+  "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
   "-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}"
   "-DBUILD_DOCUMENTATION:BOOL=OFF"
   "-DENABLE_TESTING:BOOL=OFF"
@@ -378,7 +379,6 @@
       ${default_cmake_args}
       ${python_args}
       ${qt_args}
-      -DBUILD_SHARED_LIBS:BOOL=ON
       -DBUILD_TESTING:BOOL=OFF
       -DBUILD_EXAMPLES:BOOL=OFF
       -DVTK_RENDERING_BACKEND:STRING=OpenGL2
@@ -455,7 +455,7 @@
       ${boost_args}
       ${flann_args}
       ${vtk_args}
-      -DPCL_SHARED_LIBS:BOOL=ON
+      -DPCL_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DBUILD_TESTS:BOOL=OFF
       -DBUILD_global_tests:BOOL=OFF
       -DBUILD_examples:BOOL=OFF


little documentation fix

little documentation fix

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -312,7 +312,7 @@
 ###############################################################################
 ###############################################################################

-# configure file relevant files only once
+# configure the relevant files only once
 if(NOT EXISTS "${projectSrcDir}/torqueConfig.h")
     message(STATUS "writing ${projectSrcDir}/torqueConfig.h")
     CONFIGURE_FILE("${cmakeDir}/torqueConfig.h.in" "${projectSrcDir}/torqueConfig.h")


cmake: west: Allow mono-repo to build when west is installed

If one invokes cmake with west in the PATH but not inside a west
installation (i.e. in a monorepo setup), west will try to list the
zephyr modules issuing an error message.

Test if west list succeeds before using result for module testing.

Fixes #14177

Signed-off-by: Torsten Rasmussen <96e313834d43f704020a91f4e5eaf114be1fb11a@nordicsemi.no>
Signed-off-by: Carles Cufi <853081dc8dca4fe6a7e3c984752718b5db36e060@nordicsemi.no>

--- cmake/zephyr_module.cmake
+++ cmake/zephyr_module.cmake
@@ -17,8 +17,17 @@
     ${WEST} list --format={posixpath}
     OUTPUT_VARIABLE
     west_project_output
+    ERROR_VARIABLE
+    west_project_error
+    RESULT_VARIABLE
+    west_list_result
   )
-  string(REGEX REPLACE "[\r\n]+" ";" west_project_list "${west_project_output}")
+  if(NOT ${west_list_result})
+    string(REGEX REPLACE "[\r\n]+" ";" west_project_list "${west_project_output}")
+  elseif(NOT ("${west_project_error}" MATCHES
+              "^Error: .* is not in a west installation\..*"))
+    message(FATAL_ERROR "${west_project_error}")
+  endif()
 endif()

 if(ZEPHYR_EXTRA_MODULES)


[Config] Fixed the delivery directory of Python modules and libraries

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -497,7 +497,7 @@

     # Set the Python installation directory
     set (INSTALL_PY_LIB_DIR
-      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
+      ${INSTALL_LIB_DIR}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PROJECT_NAME}
       CACHE PATH "Installation directory for Python libraries")

     # Update the list of include directories for the project
@@ -1461,7 +1461,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
+  set (pylibdir	     ${libdir}/python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}/site-packages/py${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


[Build] Added support for AirInv in the CMake framework.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -653,6 +653,38 @@
   endif (RMOL_FOUND)

 endmacro (get_rmol)
+
+# ~~~~~~~~~~ Airinv ~~~~~~~~~
+macro (get_airinv)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Airinv-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Airinv without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (Airinv ${_required_version} REQUIRED
+	HINTS ${WITH_AIRINV_PREFIX})
+  if (Airinv_FOUND)
+    #
+    message (STATUS "Found Airinv version: ${AIRINV_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AIRINV_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRINV_LIBRARIES})
+
+  else (Airinv_FOUND)
+    set (ERROR_MSG "The Airinv library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRINV_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<Airinv install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (Airinv_FOUND)
+
+endmacro (get_airinv)

 ##############################################
@@ -1654,14 +1686,28 @@
   if (RMOL_FOUND)
     message (STATUS)
     message (STATUS "* RMOL:")
-    message (STATUS "  - RMOL_VERSION ............. : ${RMOL_VERSION}")
-    message (STATUS "  - RMOL_BINARY_DIRS ......... : ${RMOL_BINARY_DIRS}")
-    message (STATUS "  - RMOL_EXECUTABLES ......... : ${RMOL_EXECUTABLES}")
-    message (STATUS "  - RMOL_LIBRARY_DIRS ........ : ${RMOL_LIBRARY_DIRS}")
-    message (STATUS "  - RMOL_LIBRARIES ........... : ${RMOL_LIBRARIES}")
-    message (STATUS "  - RMOL_INCLUDE_DIRS ........ : ${RMOL_INCLUDE_DIRS}")
+    message (STATUS "  - RMOL_VERSION ............... : ${RMOL_VERSION}")
+    message (STATUS "  - RMOL_BINARY_DIRS ........... : ${RMOL_BINARY_DIRS}")
+    message (STATUS "  - RMOL_EXECUTABLES ........... : ${RMOL_EXECUTABLES}")
+    message (STATUS "  - RMOL_LIBRARY_DIRS .......... : ${RMOL_LIBRARY_DIRS}")
+    message (STATUS "  - RMOL_LIBRARIES ............. : ${RMOL_LIBRARIES}")
+    message (STATUS "  - RMOL_INCLUDE_DIRS .......... : ${RMOL_INCLUDE_DIRS}")
   endif (RMOL_FOUND)
 endmacro (display_rmol)
+
+# Airinv
+macro (display_airinv)
+  if (Airinv_FOUND)
+    message (STATUS)
+    message (STATUS "* Airinv:")
+    message (STATUS "  - AIRINV_VERSION ............. : ${AIRINV_VERSION}")
+    message (STATUS "  - AIRINV_BINARY_DIRS ......... : ${AIRINV_BINARY_DIRS}")
+    message (STATUS "  - AIRINV_EXECUTABLES ......... : ${AIRINV_EXECUTABLES}")
+    message (STATUS "  - AIRINV_LIBRARY_DIRS ........ : ${AIRINV_LIBRARY_DIRS}")
+    message (STATUS "  - AIRINV_LIBRARIES ........... : ${AIRINV_LIBRARIES}")
+    message (STATUS "  - AIRINV_INCLUDE_DIRS ........ : ${AIRINV_INCLUDE_DIRS}")
+  endif (Airinv_FOUND)
+endmacro (display_airinv)

 ##
 macro (display_status_all_modules)
@@ -1749,6 +1795,7 @@
   display_stdair ()
   display_airrac ()
   display_rmol ()
+  display_airinv ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


[Build] Added support to read the version from the CMake cache.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -139,6 +139,8 @@
 macro (store_in_cache)
   # Force some variables that could be defined in the command line to be
   # written to cache
+  set (PACKAGE_VERSION "${PACKAGE_VERSION}" CACHE STRING
+  "Version of the project/package")
   set (BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL
 	"Set to OFF to build static libraries" FORCE)
   set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH


cmake: fixed path to vigraimpex in tests

--- config/VigraAddTest.cmake
+++ config/VigraAddTest.cmake
@@ -65,21 +65,19 @@

     # Windows: set the DLL path
     set(VIGRA_PATH "")
-    if(WIN32)
-        IF(CYGWIN)
-            SET(PATHSEP ":")
-        ELSE()
-            SET(PATHSEP ";")
-        ENDIF()
-        FOREACH(lib ${LIBRARIES})
-            GET_TARGET_PROPERTY(p ${lib} LOCATION)
-            if(p)
-                GET_FILENAME_COMPONENT(p ${p} PATH)
-                VIGRA_NATIVE_PATH(p ${p})
-                SET(VIGRA_PATH  "${p}${PATHSEP}${VIGRA_PATH}")
-           endif()
-        ENDFOREACH(lib)
-    endif()
+    IF(MSVC)
+        SET(PATHSEP ";")
+    ELSE()
+        SET(PATHSEP ":")
+    ENDIF()
+    FOREACH(lib ${LIBRARIES})
+        GET_TARGET_PROPERTY(p ${lib} LOCATION)
+        if(p)
+            GET_FILENAME_COMPONENT(p ${p} PATH)
+            VIGRA_NATIVE_PATH(p ${p})
+            SET(VIGRA_PATH  "${p}${PATHSEP}${VIGRA_PATH}")
+        endif()
+    ENDFOREACH(lib)

     VIGRA_NATIVE_PATH(VIGRA_CURRENT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
     IF(MSVC OR MINGW)


fix for finding cython.bat

fix for finding cython.bat

--- cmake/FindCython.cmake
+++ cmake/FindCython.cmake
@@ -22,7 +22,7 @@
 # limitations under the License.
 #=============================================================================

-find_program( CYTHON_EXECUTABLE NAMES cython )
+find_program( CYTHON_EXECUTABLE NAMES cython cython.bat )

 include( FindPackageHandleStandardArgs )
 FIND_PACKAGE_HANDLE_STANDARD_ARGS( Cython REQUIRED_VARS CYTHON_EXECUTABLE )


Add value of LIBIGL_DIR to the list of paths where cmake looks for libigl.

--- cmake/FindLIBIGL.cmake
+++ cmake/FindLIBIGL.cmake
@@ -9,11 +9,9 @@

 find_path(LIBIGL_INCLUDE_DIR igl/readOBJ.h
     HINTS
-        ENV LIBIGL
-        ENV LIBIGLROOT
-        ENV LIBIGL_ROOT
         ENV LIBIGL_DIR
     PATHS
+        ${LIBIGL_DIR}
         ${CMAKE_SOURCE_DIR}/../..
         ${CMAKE_SOURCE_DIR}/..
         ${CMAKE_SOURCE_DIR}


updates for opencv3 cmake

updates for opencv3 cmake

--- cmake/FindOpenCV.cmake
+++ cmake/FindOpenCV.cmake
@@ -202,12 +202,15 @@
     ${OPENCV_VERSION_MAJOR}${OPENCV_VERSION_MINOR}${OPENCV_VERSION_PATCH})

   IF (NOT OpenCV_FIND_COMPONENTS)
-    IF (OPENCV_VERSION VERSION_GREATER 2.1)
+    IF (OPENCV_VERSION VERION_GREATER 3.0)
+      SET (OpenCV_FIND_COMPONENTS calib3d core features2d flann highgui
+        imgcodecs imgproc ml objdetect shape superres video videoio)
+    ELSEIF (OPENCV_VERSION VERSION_GREATER 2.1)
       SET (OpenCV_FIND_COMPONENTS calib3d contrib core features2d flann highgui
         imgproc legacy ml objdetect video gpu)
-    ELSE (OPENCV_VERSION VERSION_GREATER 2.1)
+    ELSE (OPENCV_VERSION VERSION_GREATER 3.0)
       SET (OpenCV_FIND_COMPONENTS cxcore cv ml highgui cvaux)
-    ENDIF (OPENCV_VERSION VERSION_GREATER 2.1)
+    ENDIF (OPENCV_VERSION VERSION_GREATER 3.0)
   ENDIF (NOT OpenCV_FIND_COMPONENTS)

   # Loop over each components
@@ -384,4 +387,4 @@

 FIND_PACKAGE_HANDLE_STANDARD_ARGS (OpenCV REQUIRED_VARS OPENCV_ROOT_DIR
   OPENCV_INCLUDE_DIR ${_OPENCV_MISSING_LIBRARIES} VERSION_VAR OPENCV_VERSION
-  ${_OPENCV_FPHSA_ADDITIONAL_ARGS})+  ${_OPENCV_FPHSA_ADDITIONAL_ARGS})


gate version 0.4.2

gate version 0.4.2

--- cmake/HunterGate.cmake
+++ cmake/HunterGate.cmake
@@ -24,7 +24,7 @@
 hunter_minimum_required(
     VERSION "0.4.2"
     URL "https://github.com/ruslo/hunter/archive/v0.4.2.tar.gz"
-    SHA1 "e3f3d7d4f23f2c09a9df47d5ffa41b4fcc691fb3"
+    SHA1 "3a6c66670dc4103ff2567c03d44b2a99e288e3c8"
 )
 # -- end


fix(qt): Qt 5.0 does not work

fix(qt): Qt 5.0 does not work

--- cmake/consort/qt.cmake
+++ cmake/consort/qt.cmake
@@ -162,6 +162,13 @@
 			set( CMAKE_AUTORCC 1 )

 			message(STATUS "Qt version: ${Qt5Core_VERSION_STRING} (${QT_ROOT})")
+
+			# Qt before 5.1 didn't automatically add these
+			if( Qt5Core_VERSION_STRING VERSION_LESS "5.1" )
+				foreach(m ${_modules})
+					target_include_directories(Qt5::${m} SYSTEM BEFORE INTERFACE ${Qt5${m}_INCLUDE_DIRS})
+				endforeach()
+			endif()

 			if( NOT QT_TRANSLATIONS_DIR)
 				get_target_property(QT_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)


Propagate CMAKE_THREAD_LIBS_INIT through superbuild

This enables explicitly setting the threading library using throughout
ITK and SimpleITK. For example a static libpthreads can be specified.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -225,7 +225,10 @@

   CMAKE_PREFIX_PATH
   CMAKE_FRAMEWORK_PATH
+
   CMAKE_DL_LIBS
+  CMAKE_THREAD_LIBS_INIT
+
   CMAKE_SYSTEM_PREFIX_PATH
   CMAKE_SYSTEM_INCLUDE_PATH
   CMAKE_SYSTEM_LIBRARY_PATH


Turn off Ospray for now

Turn off Ospray for now

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -77,12 +77,6 @@
 ###########################################
 # Configure ospray
 OPTION(WITH_OSPRAY "Build Ospray." OFF)
-IF(APPLE)
-  SET(WITH_OSPRAY ON)
-ENDIF()
-IF(WIN32) # needs VS2017--turn off for now
-  SET(WITH_OSPRAY OFF)
-ENDIF()

 ###########################################
 # Configure data


Windows installs each top-level item...

Windows installs each top-level item...

This is a little tedious, if we have sample data then we must install
it into the package too.

--- projects/win32/tomviz.bundle.cmake
+++ projects/win32/tomviz.bundle.cmake
@@ -15,6 +15,12 @@
 install(DIRECTORY "${install_location}/bin/"
         DESTINATION "bin"
         COMPONENT ${AppName})
+
+if(tomviz_data_DIR)
+  install(DIRECTORY "${install_location}/share/"
+          DESTINATION "share"
+          COMPONENT ${AppName})
+endif()

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


Cotire: Temp Workaround https://github.com/inviwo/inviwo/issues/239

--- cmake/cotire.cmake
+++ cmake/cotire.cmake
@@ -3516,7 +3516,7 @@
 	endif()
 	set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_ALL TRUE)
 	if (MSVC_IDE)
-		set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
+		#set_target_properties(${_targetName} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
 	endif()
 endfunction()


ARROW-763: C++: Use  to find libpythonX.X.dylib

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #485 from xhochy/ARROW-763 and squashes the following commits:

d5a475f [Uwe L. Korn] ARROW-763: C++: Use  to find libpythonX.X.dylib

--- cpp/cmake_modules/FindPythonLibsNew.cmake
+++ cpp/cmake_modules/FindPythonLibsNew.cmake
@@ -148,10 +148,20 @@
         set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/libpython${PYTHON_LIBRARY_SUFFIX}.a")
     endif()
 elseif(APPLE)
-  # In Python C extensions on OS X, the flag "-undefined dynamic_lookup" can
-  # avoid certain kinds of dynamic linking issues with portable binaries, so
-  # you should avoid targeting libpython at link time if at all possible
-  set(PYTHON_LIBRARY "${PYTHON_PREFIX}/lib/libpython${PYTHON_LIBRARY_SUFFIX}.dylib")
+  # In some cases libpythonX.X.dylib is not part of the PYTHON_PREFIX and we
+  # need to call `python-config --prefix` to determine the correct location.
+
+  find_program(PYTHON_CONFIG python-config
+      NO_CMAKE_SYSTEM_PATH)
+  if (PYTHON_CONFIG)
+    execute_process(
+        COMMAND "${PYTHON_CONFIG}" "--prefix"
+        OUTPUT_VARIABLE PYTHON_CONFIG_PREFIX
+        OUTPUT_STRIP_TRAILING_WHITESPACE)
+    set(PYTHON_LIBRARY "${PYTHON_CONFIG_PREFIX}/lib/libpython${PYTHON_LIBRARY_SUFFIX}.dylib")
+  else()
+    set(PYTHON_LIBRARY "${PYTHON_PREFIX}/lib/libpython${PYTHON_LIBRARY_SUFFIX}.dylib")
+  endif()
 else()
     if(${PYTHON_SIZEOF_VOID_P} MATCHES 8)
         set(_PYTHON_LIBS_SEARCH "${PYTHON_PREFIX}/lib64" "${PYTHON_PREFIX}/lib" "${PYTHON_LIBRARY_PATH}")


disable CTest timeout handling

disable CTest timeout handling

--- test/cmake/ATFTestAddTests.cmake
+++ test/cmake/ATFTestAddTests.cmake
@@ -26,6 +26,7 @@
           -D \"BINARY_DIR=${BINARY_DIR}\"
           -D \"TIMEOUT=${_timeout}\"
           -P \"${TEST_RUN_SCRIPT}\")
+set_tests_properties(${_name} PROPERTIES TIMEOUT 0)
 ")

   set(script


actually enable Simmetrix nightly...

actually enable Simmetrix nightly...

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -286,6 +286,7 @@

 SET(CONFIGURE_OPTIONS-sim
   "${CONFIGURE_OPTIONS}"
+  "-DENABLE_SIMMETRIX:BOOL=ON"
   "-DSIM_PARASOLID:BOOL=ON"
   "-DSIM_MPI:STRING=mpich3.1.2"
 )


In case of Mac OSX 10.9 use libstdc++

In case of Mac OSX 10.9 use libstdc++

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -190,6 +190,18 @@
 if(MSVC_VERSION)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj /MP")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /MP")
+endif()
+
+# With the current toolkits like VTK and ITK Mac OSX 10.9
+# does not compile with if stdlib=libc++is used
+# For more information see bug 16803 and 16776
+# This could probably be remove if ITK 4.5.1 and VTK 6.1 is integrated
+if (APPLE)
+  exec_program(sw_vers ARGS -productVersion OUTPUT_VARIABLE osx_version)
+  if (osx_version VERSION_EQUAL "10.9" OR osx_version VERSION_GREATER "10.9")
+    message("Detected OS X version is ${osx_version}...setting C++ library to libstdc++")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
+  endif()
 endif()

 set(ep_common_args


FIX (#6517): use DCMTK with standard flags also on windows, pass c flags

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -50,6 +50,7 @@
   -DCMAKE_INSTALL_PREFIX:PATH=${ep_install_dir}
   -DBUILD_SHARED_LIBS:BOOL=ON
   -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+  "-DCMAKE_C_FLAGS:STRING=${ep_common_CXX_FLAGS}"
   "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS}"
 )

@@ -105,15 +106,18 @@
   SET(proj DCMTK)
   IF(UNIX)
     SET(DCMTK_CXX_FLAGS "-fPIC")
+    SET(DCMTK_C_FLAGS "-fPIC")
   ENDIF(UNIX)
   IF(DCMTK_DICOM_ROOT_ID)
     SET(DCMTK_CXX_FLAGS "${DCMTK_CXX_FLAGS} -DSITE_UID_ROOT=\\\"${DCMTK_DICOM_ROOT_ID}\\\"")
+    SET(DCMTK_C_FLAGS "${DCMTK_CXX_FLAGS} -DSITE_UID_ROOT=\\\"${DCMTK_DICOM_ROOT_ID}\\\"")
   ENDIF()
   ExternalProject_Add(${proj}
     URL http://mitk.org/download/thirdparty/dcmtk-3.6.0.tar.gz
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
          ${ep_common_args}
+         -DDCMTK_OVERWRITE_WIN32_COMPILER_FLAGS:BOOL=OFF
          -DBUILD_SHARED_LIBS:BOOL=OFF
          "-DCMAKE_CXX_FLAGS:STRING=${ep_common_CXX_FLAGS} ${DCMTK_CXX_FLAGS}"
          "-DCMAKE_C_FLAGS:STRING=${ep_common_C_FLAGS} ${DCMTK_C_FLAGS}"


forgot to remove a line

forgot to remove a line

--- salome_adm/cmake_files/FindSalomeOmniORBPy.cmake
+++ salome_adm/cmake_files/FindSalomeOmniORBPy.cmake
@@ -26,8 +26,7 @@

 IF(SalomeOmniORB_FOUND)
   # If no OMNIORBPY_ROOT_DIR is given, then try with OMNIORB_ROOT_DIR:
-  SET(OMNIORBPY_ROOT_DIR "$ENV{OMNIORBPY_ROOT_DIR}" CACHE PATH "Path to the OmniORB Python backend")
-
+
   IF(NOT OMNIORBPY_ROOT_DIR_EXP)
     SET(OMNIORBPY_ROOT_DIR "$ENV{OMNIORBPY_ROOT_DIR}" CACHE PATH "Path to the OmniORB Python backend")
     IF(EXISTS "${OMNIORB_ROOT_DIR}" AND (NOT OMNIORBPY_ROOT_DIR))


fix incorrect CMake path to find TBB when building Embree from source

--- scripts/superbuild/dependencies/dep_embree.cmake
+++ scripts/superbuild/dependencies/dep_embree.cmake
@@ -40,7 +40,7 @@
       -DCMAKE_INSTALL_DOCDIR=doc
       -DCMAKE_INSTALL_BINDIR=bin
       -DEMBREE_TUTORIALS=OFF
-      -DEMBREE_TBB_ROOT=${TBB_INSTALL_LOCATION}
+      -DEMBREE_TBB_ROOT=${TBB_PATH}
       -DEMBREE_ISPC_EXECUTABLE=${ISPC_PATH}
       -DCMAKE_BUILD_TYPE=Release
       -DBUILD_TESTING=OFF


add mmacosx-version-min to triplet file

add mmacosx-version-min to triplet file

--- contrib/cmake/vcpkg_extra_triplets/x64-osx-mega.cmake
+++ contrib/cmake/vcpkg_extra_triplets/x64-osx-mega.cmake
@@ -13,3 +13,9 @@
     # build this library statically (much simpler installation, debugging, etc)
 	set(VCPKG_LIBRARY_LINKAGE static)
 endif()
+
+set(_macos_version_min_flag "-mmacosx-version-min=${VCPKG_OSX_DEPLOYMENT_TARGET}")
+
+set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} ${_macos_version_min_flag}")
+set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} ${_macos_version_min_flag}")
+set(VCPKG_LINKER_FLAGS "${VCPKG_LINKER_FLAGS} ${_macos_version_min_flag}")


Adapted path in emscripten build

Adapted path in emscripten build

--- buildtools/emscripten.cmake
+++ buildtools/emscripten.cmake
@@ -233,8 +233,8 @@
 SET(RENDER_GL2 TRUE CACHE BOOL "GL2")
 SET(DISABLE_SOUND FALSE CACHE BOOL "Sound")

-SET(OPENAL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/Adventure/AppBuilder/AppBuilder/openal/include)
-SET(OPENAL_LIBRARY ${PROJECT_SOURCE_DIR}/Adventure/AppBuilder/AppBuilder/openal/lib/android/libopenal.so)
+SET(OPENAL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/Adventure/AdvEngine/Engine/openal/include)
+SET(OPENAL_LIBRARY ${PROJECT_SOURCE_DIR}/Adventure/AdvEngine/Engine/openal/lib/android/libopenal.so)
 SET(EMSCRIPTEN_FRONTEND TRUE CACHE BOOL "emscripten frontend")
 SET(DISABLE_XF86VMODE TRUE CACHE BOOL "x11 xf86")
 ADD_DEFINITIONS(-Wno-warn-absolute-paths)


build: Fix Vulkaninfo Bundle build on MacOS

Fixes MacOS crash while building the Vulkaninfo.app bundle.

Change-Id: Ic1e3c4cef7de5d9458f4d0fc056093abb352bf1a

--- vulkaninfo/macOS/vulkaninfo.cmake
+++ vulkaninfo/macOS/vulkaninfo.cmake
@@ -35,7 +35,7 @@
                                  ${CMAKE_CURRENT_SOURCE_DIR}/macOS/Info.plist)
 # We do this so vulkaninfo is linked to an individual library and NOT a framework.
 target_link_libraries(vulkaninfo-bundle ${Vulkan_LIBRARY} "-framework AppKit -framework QuartzCore")
-target_include_directories(vulkaninfo-bundle PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo ${CMAKE_BINARY_DIR}/vulkaninfo ${VulkanHeaders_INCLUDE_DIR})
+target_include_directories(vulkaninfo-bundle PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo ${CMAKE_CURRENT_SOURCE_DIR}/generated ${CMAKE_BINARY_DIR}/vulkaninfo ${VulkanHeaders_INCLUDE_DIR})
 add_dependencies(vulkaninfo-bundle MoltenVK_icd-staging-json)

 set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/macOS/vulkaninfo.sh PROPERTIES MACOSX_PACKAGE_LOCATION "MacOS")


cmake: fixing generation for compilers without openmp

Former-commit-id: 2c8d716f4fafce5afd2149c62d2e723458cd1861

--- cmake/CompilerOptions.cmake
+++ cmake/CompilerOptions.cmake
@@ -10,7 +10,7 @@
         execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCXX_VERSION)
     endif()

-    ## Disable partial inlining under gcc 4.6 (Why?)
+    ## Disable partial inlining under gcc 4.6 (Why? -> the memory was exploding)
     if("${GCXX_VERSION}" VERSION_EQUAL 4.6)
         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-partial-inlining")
     endif()
@@ -62,11 +62,15 @@
 ## OpenMP
 option(SOFA_OPENMP "Compile Sofa with OpenMP multithreading." OFF)
 if(SOFA_OPENMP)
-    find_package(OpenMP REQUIRED)
-#    target_compile_options(SofaHelper PUBLIC "${OpenMP_CXX_FLAGS}") # it is not enough to declare it for SofaHelper, because a link flag is also expected
-    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
-    set (CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} ${OpenMP_C_FLAGS}")
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-    set (CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${OpenMP_CXX_FLAGS}")
+    find_package(OpenMP QUIET)
+    if (OPENMP_FOUND)
+    #    target_compile_options(SofaHelper PUBLIC "${OpenMP_CXX_FLAGS}") # it is not enough to declare it for SofaHelper, because a link flag is also expected
+        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+        set (CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} ${OpenMP_C_FLAGS}")
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+        set (CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} ${OpenMP_CXX_FLAGS}")
+    else()
+        message("WARNING: Your compiler does not implement OpenMP.")
+    endif()
 endif()


Check STDC includes and sizeof void *

Check STDC includes and sizeof void *

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -169,6 +169,7 @@
 CHECK_INCLUDE_FILE_CONCAT ("features.h"      HAVE_FEATURES_H)
 CHECK_INCLUDE_FILE_CONCAT ("inttypes.h"      HAVE_INTTYPES_H)
 CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h"    HAVE_NETINET_IN_H)
+CHECK_INCLUDE_FILE_CONCAT ("stdlib.h;stdarg.h;string.h;float.h"	STDC_HEADERS)

 IF (NOT CYGWIN)
   CHECK_INCLUDE_FILE_CONCAT ("winsock2.h"      HAVE_WINSOCK_H)
@@ -209,6 +210,7 @@
 ENDIF (NOT APPLE)
 EAVL_CHECK_TYPE_SIZE ("long long"    SIZEOF_LONG_LONG)
 EAVL_CHECK_TYPE_SIZE (__int64        SIZEOF___INT64)
+EAVL_CHECK_TYPE_SIZE ("void *"       SIZEOF_VOID_P)
 IF (NOT SIZEOF___INT64)
   SET (SIZEOF___INT64 0)
 ENDIF (NOT SIZEOF___INT64)


Add -U_FORTIFY_SOURCE

Add -U_FORTIFY_SOURCE

--- cmake/DevBaseCompiler.cmake
+++ cmake/DevBaseCompiler.cmake
@@ -108,6 +108,8 @@
 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")

+    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -U_FORTIFY_SOURCE")
+
     # Make linker report any unresolved symbols.
     set(CMAKE_SHARED_LINKER_FLAGS
         "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
@@ -116,6 +118,8 @@

 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -U_FORTIFY_SOURCE")

     # Make linker report any unresolved symbols.
     set(CMAKE_SHARED_LINKER_FLAGS


Fixed libresample when installed by apt-get

--- cmake/FindLibResample.cmake
+++ cmake/FindLibResample.cmake
@@ -14,8 +14,18 @@
     )
   set(LIBRESAMPLE_LIBRARIES
     ${LIBRESAMPLE_DIR}/libresample.a
-    )
-else (EXISTS "${LIBRESAMPLE_DIR}")
+    )
+endif (EXISTS "${LIBRESAMPLE_DIR}")
+
+if (EXISTS "/usr/lib/libresample.a")
+  set(LIBRESAMPLE_FOUND 1)
+  set(LIBRESAMPLE_INCLUDE_DIRS /usr/include)
+  set(LIBRESAMPLE_LIBRARIES /usr/lib/libresample.a)
+  message(STATUS "Using libresample from system")
+endif (EXISTS "/usr/lib/libresample.a")
+
+
+if (NOT LIBRESAMPLE_FOUND)
   message(STATUS "libresample not found")
   set(LIBRESAMPLE_FOUND 0)
-endif (EXISTS "${LIBRESAMPLE_DIR}")
+endif (NOT LIBRESAMPLE_FOUND)


Remove nonexistent vars from docs

Remove nonexistent vars from docs

--- cmake/Modules/FindGDK.cmake
+++ cmake/Modules/FindGDK.cmake
@@ -11,10 +11,6 @@
 #   GDK_INCLUDE_DIR (cached)
 #   GDK_INCLUDE_DIRS
 #   GDK_VERSION
-#   GDK_VERSION_MAJOR
-#   GDK_VERSION_MINOR
-#   GDK_VERSION_PATCH
-#   GDK_VERSION_TWEAK
 #
 # Using this module:
 #


Typo.

Typo.

--- cmake/Modules/FindMKL.cmake
+++ cmake/Modules/FindMKL.cmake
@@ -3,7 +3,7 @@
 #
 # Options:
 #
-#   MKL_STATAIC       :   use static linking
+#   MKL_STATIC        :   use static linking
 #   MKL_MULTI_THREADED:   use multi-threading
 #   MKL_SDL           :   Single Dynamic Library interface
 #
@@ -38,20 +38,20 @@
 set(_MKL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

 if(WIN32)
-    if(MKL_STATAIC)
+    if(MKL_STATIC)
         set(CMAKE_FIND_LIBRARY_SUFFIXES .lib)
     else()
         set(CMAKE_FIND_LIBRARY_SUFFIXES _dll.lib)
     endif()
 else()
     if(APPLE)
-        if(MKL_STATAIC)
+        if(MKL_STATIC)
             set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
         else()
             set(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
         endif()
     else()
-        if(MKL_STATAIC)
+        if(MKL_STATIC)
             set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
         else()
             set(CMAKE_FIND_LIBRARY_SUFFIXES .so)
@@ -61,16 +61,16 @@

 # MKL is composed by four layers: Interface, Threading, Computational and RTL
 if(APPLE)
-    set(MKL_LIBRARIES_PATH
+    set(MKL_LIBRARIES_PATH
         # ${MKL_ROOT}/lib/ia32/
         ${MKL_ROOT}/lib/)
 else()
-    set(MKL_LIBRARIES_PATH
+    set(MKL_LIBRARIES_PATH
         # ${MKL_ROOT}/lib/ia32/
         ${MKL_ROOT}/lib/intel64/)
 endif()

-set(INTEL_LIBRARIES_PATH
+set(INTEL_LIBRARIES_PATH
     # ${INTEL_ROOT}/lib/ia32/
     ${INTEL_ROOT}/lib/intel64/)


cmake: fix git binary hash

cmake: fix git binary hash

The generated binary hash was off by one.

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -901,7 +901,8 @@
 		)
 	#message(STATUS "GIT_VERSION = ${git_version}")
 	set(git_version_short)
-	string(SUBSTRING ${git_version} 1 16 git_version_short)
+	# We use the first 16 chars, starting at index 0
+	string(SUBSTRING ${git_version} 0 16 git_version_short)
 	configure_file(${PX4_SOURCE_DIR}/cmake/templates/build_git_version.h.in ${HEADER} @ONLY)
 endfunction()


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -24,7 +24,7 @@

 # NOTE: no names with spaces!

-hunter_config(buffer VERSION 0.1.7)
+hunter_config(buffer VERSION 0.1.8)
 hunter_config(AllTheFlopsThreads VERSION 0.1-p0)
 hunter_config(Android-Apk VERSION 1.1.13)
 hunter_config(Android-Build-Tools VERSION 22.0.1)


add definition for dtkPlot

add definition for dtkPlot

--- cmake/dtkDependencies.cmake
+++ cmake/dtkDependencies.cmake
@@ -4,9 +4,9 @@
 ## Copyright (C) 2008 - Julien Wintz, Inria.
 ## Created: Fri Apr  2 09:11:53 2010 (+0200)
 ## Version: $Id$
-## Last-Updated: Tue Sep  6 09:29:11 2011 (+0200)
-##           By: Julien Wintz
-##     Update #: 64
+## Last-Updated: mar. oct.  4 11:39:43 2011 (+0200)
+##           By: Nicolas Niclausse
+##     Update #: 65
 ######################################################################
 ##
 ### Commentary:
@@ -223,5 +223,6 @@
 find_package(Qwt QUIET)

 if(QWT_FOUND)
+  add_definitions(-DHAVE_PLOT)
   include_directories(${QWT_INCLUDE_DIR})
 endif(QWT_FOUND)


fix broken cmake build

fix broken cmake build

I fumbled overlapping changes in LLVM.org LLDB and swift-lldb.
This fixes that.

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -62,16 +62,16 @@

     if (PARAM_SHARED)
       if (LLDB_LINKER_SUPPORTS_GROUPS)
-        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+        target_link_libraries(${name} PUBLIC
                     -Wl,--start-group ${SWIFT_ALL_LIBS} -Wl,--end-group)
-        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+        target_link_libraries(${name} PUBLIC
                     -Wl,--start-group ${CLANG_ALL_LIBS} -Wl,--end-group)
-        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+        target_link_libraries(${name} PUBLIC
                     -Wl,--start-group ${LLVM_ALL_LIBS} -Wl,--end-group)
       else()
-        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${SWIFT_ALL_LIBS})
-        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${CLANG_ALL_LIBS})
-        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${LLVM_ALL_LIBS})
+        target_link_libraries(${name} PUBLIC ${SWIFT_ALL_LIBS})
+        target_link_libraries(${name} PUBLIC ${CLANG_ALL_LIBS})
+        target_link_libraries(${name} PUBLIC ${LLVM_ALL_LIBS})
       endif()
     endif()
     llvm_config(${name} ${LLVM_LINK_COMPONENTS} ${LLVM_PRIVATE_LINK_COMPONENTS})


[CMake] Make CMAKE_INSTALL_RPATH work again

r285714 made it so that when CMAKE_INSTALL_RPATH is set _install_rpath is not
set, but that means INSTALL_RPATH gets set to an empty string which isn't what
we want. Fix this by setting INSTALL_RPATH only when _install_rpath is set.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1351,8 +1351,10 @@
     return()
   endif()

-  set_target_properties(${name} PROPERTIES
-                        BUILD_WITH_INSTALL_RPATH On
-                        INSTALL_RPATH "${_install_rpath}"
-                        ${_install_name_dir})
-endfunction()
+  if(DEFINED _install_rpath)
+    set_target_properties(${name} PROPERTIES
+                          BUILD_WITH_INSTALL_RPATH On
+                          INSTALL_RPATH "${_install_rpath}"
+                          ${_install_name_dir})
+  endif()
+endfunction()


updated packaging macro for better compatibility with cmake

--- cmake/oskar_packaging.cmake
+++ cmake/oskar_packaging.cmake
@@ -66,6 +66,8 @@

 add_custom_target(dist
     COMMAND ${CMAKE_MAKE_PROGRAM} package_source
-    DEPENDS write_version_file
     COMMENT "Packaging Source files"
     VERBATIM)
+
+add_dependencies(dist write_version_file)
+


Fixed code in FindJNI.cmake. Was not compatible with cmake 2.6.

--- cmake_modules/FindJNI.cmake
+++ cmake_modules/FindJNI.cmake
@@ -65,9 +65,9 @@

     # Append default list architectures if CMAKE_SYSTEM_PROCESSOR was empty or
     # system is non-Linux (where the code above has not been well tested)
-    IF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+    IF(NOT _java_libarch OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux")
         LIST(APPEND _java_libarch "i386" "amd64" "ppc")
-    ENDIF(NOT _java_libarch OR NOT (CMAKE_SYSTEM_NAME MATCHES "Linux"))
+    ENDIF(NOT _java_libarch OR NOT CMAKE_SYSTEM_NAME MATCHES "Linux")

     # Sometimes ${CMAKE_SYSTEM_PROCESSOR} is added to the list to prefer
     # current value to a hardcoded list. Remove possible duplicates.


cmake: Fix compability issues with Apple

--- cmake/Arduino.cmake
+++ cmake/Arduino.cmake
@@ -543,10 +543,16 @@
         list(APPEND COMPILE_FLAGS "-I${INC_DIR}")
     endforeach ()

+    if (APPLE)
+        list(APPEND COMPILE_FLAGS "-I/Applications/Arduino.app/Contents/Java/hardware/tools/avr/avr/include/")
+    endif ()
+
     # C link libraries
     if (NOT FOR_LIBRARY)
         list(APPEND COMPILE_FLAGS "-L${AVR_LIB_PATH}")
-        list(APPEND LIBS "c" "m")
+        if (NOT APPLE)
+            list(APPEND LIBS "c" "m")
+        endif ()
         foreach (LIB ${LIBS})
             list(APPEND COMPILE_FLAGS "-l${LIB}")
         endforeach ()


Update FindMKL to look in default Intel install directory

It should work seamlessly with all the versions of Parallel Studio

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -40,13 +40,9 @@
 #   https://code.ros.org/trac/opencv/browser/trunk/opencv/OpenCVFindIPP.cmake
 # Many portions taken from FindBoost.cmake

-# TODO:
-# - caller needs to link with libiomp5md.lib or /Qopenmp...
-# - runtime DLLs:
-#   <Composer XE directory> -> C:\Program Files\Intel\ComposerXE-2011
-#     redist\ia32\mkl
-#     redist\intel64\mkl
-# Intel from version 2016 seems to provide a common path for Win and Linux: <intel_dir>/compilers_and_libraries/${OS}/mkl and so on...
+# The user must:
+# - have the the runtime libraries directory in PATH:
+# (from Parallel Studio XE 2016) <install_parent_folder>/IntelSWTools/compilers_and_libraries/<OS>/redist/<ARCH>/mkl

 set(_MKL_IA32 FALSE)
 set(_MKL_INTEL64 FALSE)
@@ -60,10 +56,10 @@

 # Versions should be listed is decreasing order of preference
 set(_MKL_TEST_VERSIONS ${MKL_ADDITIONAL_VERSIONS}
-    "2011"
+    "2011" "2013" "2015"
     # alternative form: "2011.xxx.y"
     # (y is the release-update number and xxx is the package number)
-)
+) # no other 'years' should be added since the install directory is not influenced by that after 2015

 if (MKL_FIND_VERSION AND NOT MKL_FIND_QUIETLY)
     message(WARNING "Requesting a specific version of Intel(R) MKL is not supported")
@@ -105,11 +101,13 @@
   ${MKL_ROOT}
 )

-
+# Add the default install location to the search path
 if (WIN32)
-	list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{ProgramFiles}/Intel/Composer XE/mkl") # default until ParallelStudioXE2015
-	list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{ProgramFiles}/IntelSWTools/compilers_and_libraries/windows/mkl") # default for ParallelStudioXE2016 and later
-else()
+	SET(PROGRAM_FILE_ENVVAR "PROGRAMFILES(x86)")
+	FILE(TO_CMAKE_PATH "$ENV{${PROGRAM_FILE_ENVVAR}}" PRG_FOLD)
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "${PRG_FOLD}/Intel/Composer XE/mkl") # default until ParallelStudioXE2015
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "${PRG_FOLD}/IntelSWTools/compilers_and_libraries/windows/mkl") # default for ParallelStudioXE2016 and later
+elseif(UNIX AND NOT APPLE)
 	foreach (_MKL_VER ${_MKL_TEST_VERSIONS})
 		list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (root permissions)
 		list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{HOME}/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (no root permissions)
@@ -124,6 +122,7 @@
                    "_MKL_ROOT_SEARCH_DIRS = ${_MKL_ROOT_SEARCH_DIRS}")
 endif()

+# Find MKL include directory
 find_path(MKL_INCLUDE_DIR
     NAMES mkl.h
     PATHS ${_MKL_ROOT_SEARCH_DIRS}
@@ -145,7 +144,6 @@
 endif()

 # Find MKL library directory
-
 set(_INTEL_LIBRARY_DIR_SUFFIXES "lib")
 if (_MKL_IA32)
     list(APPEND _INTEL_LIBRARY_DIR_SUFFIXES "lib/ia32")
@@ -263,6 +261,8 @@
         message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
                        "Found IOMP5_LIBRARY: ${IOMP5_LIBRARY}")
     endif()
+
+    #######################################

     get_filename_component(_MKL_LIB_PATH "${IOMP5_LIBRARY}" PATH)
     list(APPEND MKL_LIBRARY_DIRS ${_MKL_LIB_PATH})
@@ -341,8 +341,11 @@
     endif()
 endif()

-mark_as_advanced(
-    MKL_INCLUDE_DIR
-    MKL_INCLUDE_DIRS
-    MKL_LIBRARY_DIRS
-)
+mark_as_advanced(FORCE
+	MATH_LIBRARY
+	IOMP5_LIBRARY
+	MKL_INCLUDE_DIR
+	MKL_INCLUDE_DIRS
+	MKL_LIBRARY_DIRS
+	MKL_ROOT
+)


fix clang

fix clang

--- cmake/Targets.cmake
+++ cmake/Targets.cmake
@@ -6,28 +6,35 @@
 saber_protobuf_generate_cpp(${proto_gen_folder} proto_srcs proto_hdrs ${proto_files})

 add_library(proto STATIC ${proto_hdrs} ${proto_srcs})
-target_link_libraries(proto ${PROTOBUF_LIBRARIES})
+target_link_libraries(proto PUBLIC ${PROTOBUF_LIBRARIES})
+target_include_directories(proto PUBLIC ${PROTOBUF_INCLUDE_DIR})

 list(INSERT Saber_LINKER_LIBS 0 PUBLIC proto)

 file(GLOB_RECURSE saber_server_srcs
-  ${proto_srcs}
   src/saber/util/*.cc
   src/saber/net/*.cc
   src/saber/storage/.*cc
   src/saber/paxos/*.cc
   src/saber/service/*.cc
   src/saber/server/*.cc
+  ${proto_srcs}
 )

 file(GLOB_RECURSE saber_client_srcs
-  ${proto_srcs}
   src/saber/util/*.cc
   src/saber/net/*.cc
   src/saber/storage/.*cc
   src/saber/service/*.cc
   src/saber/client/*.cc
+  $${proto_srcs}
 )
+
+add_executable(saber_server src/saber/server/saber_server_main.cc ${saber_server_srcs})
+add_executable(saber_client src/saber/client/saber_client_main.cc ${saber_client_srcs})
+
+target_link_libraries(saber_server ${Saber_LINKER_LIBS})
+target_link_libraries(saber_client ${Saber_LINKER_LIBS})

 if(CMAKE_BUILD_SHARED_LIBS)
   add_library(saber SHARED ${saber_client_srcs})
@@ -37,22 +44,13 @@
   set_target_properties(saber_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
   set_target_properties(saber PROPERTIES VERSION 1.0 SOVERSION 1)
   target_link_libraries(saber ${Saber_LINKER_LIBS})
-  install(DIRECTORY ${Saber_INCLUDE_DIRS}/saber DESTINATION include)
-  install(FILES ${proto_hdrs} DESTINATION include/saber/proto)
   install(TARGETS saber DESTINATION lib)
   install(TARGETS saber_static LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
 else()
   add_library(saber ${saber_client_srcs})
   target_link_libraries(saber ${Saber_LINKER_LIBS})
-  install(DIRECTORY ${Saber_INCLUDE_DIRS}/saber DESTINATION include)
-  install(FILES ${proto_hdrs} DESTINATION include/saber/proto)
   install(TARGETS saber DESTINATION lib)
 endif()

-add_executable(saber_server src/saber/server/saber_server_main.cc ${saber_server_srcs})
-add_executable(saber_client src/saber/client/saber_client_main.cc ${saber_client_srcs})
-
-target_link_libraries(saber_server ${Saber_LINKER_LIBS})
-target_link_libraries(saber_client ${Saber_LINKER_LIBS})
-
-
+install(DIRECTORY ${Saber_INCLUDE_DIRS}/saber DESTINATION include)
+install(FILES ${proto_hdrs} DESTINATION include/saber/proto)


cmake: update summary on dependencies

cmake: update summary on dependencies

Signed-off-by: Artur Wojcik <ea75e86c6673ace627dcd6a91fbef5d4fea719d0@intel.com>

--- cmake/summary.cmake
+++ cmake/summary.cmake
@@ -66,6 +66,7 @@
     else()
         report_status("    AEON Service               : No")
     endif()
+    report_status("    AEON Client                : " ENABLE_AEON_CLIENT THEN "Yes" ELSE "No")
     report_status("    AEON Python Interface      : " PYTHONLIBS_FOUND AND NUMPY_FOUND THEN "Yes" ELSE "No (Python not found, see details below)")
     report_status("    AEON Python Plugin         : " PYTHON_PLUGIN THEN "Yes" ELSE "No")
     if (ENABLE_AEON_SERVICE)
@@ -86,9 +87,15 @@
     report_status("    OpenCV                     : " OpenCV_FOUND THEN "Yes (ver. ${OpenCV_VERSION})" ELSE "Not Found")
     report_status("    SoX                        : " SOX_FOUND THEN "Yes (ver. ${SOX_VERSION})" ELSE "Not Found")
     report_status("    Curl                       : " CURL_FOUND THEN "Yes (ver. ${CURL_VERSION_STRING})" ELSE "Not Found")
-    report_status("    CppREST                    : " CPPREST_FOUND THEN "Yes (ver. ${CPPREST_VERSION})" ELSE "Not Found")
-    report_status("    Fabric                     : " OPENFABRICS_FOUND THEN "Yes (ver. ${OPENFABRICS_VERSION})" ELSE "Not Found")
-    report_status("    OpenSSL                    : " OPENSSL_FOUND THEN "Yes (ver. ${OPENSSL_VERSION})" ELSE "Not Found")
+    if (ENABLE_AEON_SERVICE)
+        report_status("    CppREST                    : " CPPREST_FOUND THEN "Yes (ver. ${CPPREST_VERSION})" ELSE "Not Found")
+    endif()
+    if (ENABLE_OPENFABRICS_CONNECTOR)
+        report_status("    Fabric                     : " OPENFABRICS_FOUND THEN "Yes (ver. ${OPENFABRICS_VERSION})" ELSE "Not Found")
+    endif()
+    if (ENABLE_AEON_SERVICE)
+        report_status("    OpenSSL                    : " OPENSSL_FOUND THEN "Yes (ver. ${OPENSSL_VERSION})" ELSE "Not Found")
+    endif()
     report_status("")
     report_status("  Python:")
     report_status("    Interpreter                : " PYTHON_EXECUTABLE THEN "${PYTHON_EXECUTABLE} (ver. ${PYTHON_VERSION_STRING})" ELSE "No")


Factor out export machinery

Factor out export machinery

--- cmake/targets.cmake
+++ cmake/targets.cmake
@@ -36,6 +36,20 @@
     install(${ARGN})
   endif ()
 endfunction ()
+
+macro (vistk_export name)
+  set(exports)
+
+  if (NOT no_export)
+    set(exports
+      EXPORT vistk_exports)
+
+    export(
+      TARGETS ${name}
+      APPEND
+      FILE    "${vistk_export_file}")
+  endif ()
+endmacro ()

 function (vistk_compile_pic name)
   # TODO: Bump minimum CMake version to 2.8.9
@@ -102,20 +116,6 @@
       runtime)
   endif ()

-  if (NOT no_export)
-    set(exports)
-
-    if ("${library_subdir}" STREQUAL "")
-      set(exports
-        EXPORT vistk_exports)
-    endif ()
-
-    export(
-      TARGETS ${name}
-      APPEND
-      FILE    "${vistk_export_file}")
-  endif ()
-
   get_target_property(target_type
     ${name} TYPE)

@@ -127,6 +127,8 @@
       ${name}
       CACHE INTERNAL "Libraries built as part of vistk")
   endif ()
+
+  vistk_export(${name})

   vistk_install(
     TARGETS       ${name}


CoTech decision: move MEDWrapper from MED to SMESH

-FIND_LIBRARY(MEDWrapperBase MEDWrapperBase ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapper MEDWrapper ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapper_V2_1 MEDWrapper_V2_1 ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapper_V2_2 MEDWrapper_V2_2 ${MED_ROOT_DIR}/lib/salome)

--- adm_local/cmake_files/FindMED.cmake
+++ adm_local/cmake_files/FindMED.cmake
@@ -35,10 +35,6 @@
 FIND_LIBRARY(medsplitter medsplitter ${MED_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(MEDSPLITTERTest MEDSPLITTERTest ${MED_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(med_V2_1 med_V2_1 ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapperBase MEDWrapperBase ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapper MEDWrapper ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapper_V2_1 MEDWrapper_V2_1 ${MED_ROOT_DIR}/lib/salome)
-FIND_LIBRARY(MEDWrapper_V2_2 MEDWrapper_V2_2 ${MED_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(paramedcouplingcorba paramedcouplingcorba ${MED_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(paramedloader paramedloader ${MED_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(paramedmemcompo paramedmemcompo ${MED_ROOT_DIR}/lib/salome)


Add tensorflow/contrib/deprecated module to tf_python.cmake

--- tensorflow/contrib/cmake/tf_python.cmake
+++ tensorflow/contrib/cmake/tf_python.cmake
@@ -233,6 +233,7 @@
 add_python_module("tensorflow/contrib/cudnn_rnn/python")
 add_python_module("tensorflow/contrib/cudnn_rnn/python/kernel_tests")
 add_python_module("tensorflow/contrib/cudnn_rnn/python/ops")
+add_python_module("tensorflow/contrib/deprecated")
 add_python_module("tensorflow/contrib/distributions")
 add_python_module("tensorflow/contrib/distributions/python")
 add_python_module("tensorflow/contrib/distributions/python/kernel_tests")


CMAKE_OSX_ARCHITECTURES must be set with FORCE

`CMAKE_OSX_ARCHITECTURES` is actually assigned on the command line, and if not there, is assigned by CMake to an empty string.  This means that it has a value when the `set` command is encountered, and therefore unless `FORCE` is also specified, the `set` will be ignored.

See #3 for more information.

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -39,10 +39,10 @@
   # project()
   if(APPLE)
     if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
-      set(CMAKE_OSX_ARCHITECTURES "arm" CACHE STRING "Mac OS X build architectures")
+      set(CMAKE_OSX_ARCHITECTURES "arm" CACHE STRING "Mac OS X build architectures" FORCE)
     else()
       # Build Fat binaries on OSX by default
-      set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" CACHE STRING "Mac OS X build architectures")
+      set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" CACHE STRING "Mac OS X build architectures" FORCE)
     endif()
   endif()


fixed: compiler options (msvc 1900)

fixed: compiler options (msvc 1900)

--- share/hugh/cmake/compiler/msvc.cmake
+++ share/hugh/cmake/compiler/msvc.cmake
@@ -8,31 +8,35 @@

 set(GLOBAL_COMPILER_FLAGS)
 set(GLOBAL_LINKER_FLAGS)
+
+# using 'SHARED' blocked by [https://connect.microsoft.com/VisualStudio/feedback/details/1403302]
+# [http://stackoverflow.com/questions/30765256]; agree w/ last comment: this is hell!
 set(CMAKE_LIBRARY_TYPE "STATIC")

 set(DISABLED_WARNINGS)

-# temp disable for glm/gli
-list(APPEND DISABLED_WARNINGS /wd4100)
-list(APPEND DISABLED_WARNINGS /wd4310)
-list(APPEND DISABLED_WARNINGS /wd4458)
-
 # unknown pragma
 #list(APPEND DISABLED_WARNINGS /wd4068)
+
+# 'variable': unreferenced formal parameter
+list(APPEND DISABLED_WARNINGS /wd4100)

 # nonstandard extension used : nameless struct/union
 list(APPEND DISABLED_WARNINGS /wd4201)

-if("SHARED" STREQUAL "${CMAKE_LIBRARY_TYPE}")
+if("${CMAKE_LIBRARY_TYPE}" STREQUAL "SHARED")
   # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
-  #list(APPEND DISABLED_WARNINGS /wd4251)
+  list(APPEND DISABLED_WARNINGS /wd4251)
 endif()

 # cast truncates constant value
-#list(APPEND DISABLED_WARNINGS /wd4310)
+list(APPEND DISABLED_WARNINGS /wd4310)

 # new behavior: elements of array '*' will be default initialized
 #list(APPEND DISABLED_WARNINGS /wd4351)
+
+# declaration of 'type' hides class member
+list(APPEND DISABLED_WARNINGS /wd4458)

 # declaration of '*' hides global declaration
 list(APPEND DISABLED_WARNINGS /wd4459)
@@ -56,6 +60,10 @@
 list(APPEND GLOBAL_COMPILER_FLAGS ${DISABLED_WARNINGS})
 list(APPEND GLOBAL_COMPILER_FLAGS /EHa) # exception-handling for asynchronous (structured) and
                                         # synchronous (C++) exceptions
+
+# [https://msdn.microsoft.com/en-us/library/6sehtctf.aspx?f=255&MSPPError=-2147217396]
+# [http://www.cplusplus.com/forum/general/25253/]
+add_definitions(-D_WIN32_WINNT=0x0601)

 # avoid pulling all of windows.h
 add_definitions(-DWIN32_LEAN_AND_MEAN)


mkdir

mkdir

--- 3rd_party/protobuf/protobuf.cmake
+++ 3rd_party/protobuf/protobuf.cmake
@@ -17,6 +17,10 @@
     set(3RD_PARTY_PROTOBUF_PIE -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC)
 else()
     set(3RD_PARTY_PROTOBUF_PIE )
+endif()
+
+if (NOT EXISTS ${3RD_PARTY_PROTOBUF_PKG_DIR})
+    file(MAKE_DIRECTORY ${3RD_PARTY_PROTOBUF_PKG_DIR})
 endif()

 FindConfigurePackage(


Allow to configure language in cppcheck with a global var (#239)

* Allow to configure language in cppcheck with a global var

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* Added feedback

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* added feedback

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* added feedback

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* Added feedback

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* Fixed cpplint

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* Print language message if it's not empty

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* fixed language message

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

* Improved comment

Signed-off-by: ahcorde <fe24216aaec92db5406308aba9df1265f69c8694@gmail.com>

--- ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake
+++ ament_cmake_cppcheck/cmake/ament_cmake_cppcheck_lint_hook.cmake
@@ -33,7 +33,14 @@
     list(APPEND _all_include_dirs ${ament_cmake_cppcheck_ADDITIONAL_INCLUDE_DIRS})
   endif()

-  # Get exclde paths for added targets
+  # Forces cppcheck to consider ament_cmake_cppcheck_LANGUAGE as the given language if defined
+  set(_language "")
+  if(DEFINED ament_cmake_cppcheck_LANGUAGE)
+    set(_language LANGUAGE ${ament_cmake_cppcheck_LANGUAGE})
+    message(STATUS "Configured cppcheck language: ${ament_cmake_cppcheck_LANGUAGE}")
+  endif()
+
+  # Get exclude paths for added targets
   set(_all_exclude "")
   if(DEFINED ament_cmake_cppcheck_ADDITIONAL_EXCLUDE)
     list(APPEND _all_exclude ${ament_cmake_cppcheck_ADDITIONAL_EXCLUDE})
@@ -73,5 +80,7 @@
   message(
     STATUS "Configured cppcheck exclude dirs and/or files: ${_all_exclude}"
   )
-  ament_cppcheck(INCLUDE_DIRS ${_all_include_dirs} EXCLUDE ${_all_exclude})
+  ament_cppcheck(
+    ${_language} INCLUDE_DIRS ${_all_include_dirs} EXCLUDE ${_all_exclude}
+  )
 endif()


Add FOLDER parameter to ctkMacroBuildQtPlugin

If specified, the target(s) associated with designer, icon engine and
style plugins will be added into the specified folder when the project is
configured for an IDE supporting it.

For more details, see http://www.cmake.org/cmake/help/v2.8.9/cmake.html#prop_tgt:FOLDER

--- CMake/ctkMacroBuildQtPlugin.cmake
+++ CMake/ctkMacroBuildQtPlugin.cmake
@@ -27,7 +27,7 @@
 macro(ctkMacroBuildQtPlugin)
   cmake_parse_arguments(MY
     "" # no options
-    "NAME;EXPORT_DIRECTIVE;PLUGIN_DIR" # one value args
+    "NAME;EXPORT_DIRECTIVE;FOLDER;PLUGIN_DIR" # one value args
     "SRCS;MOC_SRCS;UI_FORMS;INCLUDE_DIRECTORIES;TARGET_LIBRARIES;RESOURCES" # multi value args
     ${ARGN}
     )
@@ -143,6 +143,10 @@
     )
   target_link_libraries(${lib_name} ${my_libs})

+  if(NOT "${MY_FOLDER}" STREQUAL "")
+    set_target_properties(${lib_name} PROPERTIES FOLDER ${MY_FOLDER})
+  endif()
+
   # Install the library
   # CTK_INSTALL_QTPLUGIN_DIR:STRING can be passed when configuring CTK
   # By default, it is the same path as CTK_INSTALL_LIB_DIR


ENH: boost is already included above

ENH: boost is already included above

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -78,14 +78,6 @@
     ${OTB_SOURCE_DIR}/Code/Wrappers/CommandLine )
 ENDIF(BUILD_APPLICATIONS)

-IF(NOT OTB_USE_EXTERNAL_BOOST)
-  SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
-    ${OTB_SOURCE_DIR}/Utilities/otbkml/third_party/boost_1_34_1)
-ELSE(NOT OTB_USE_EXTERNAL_BOOST)
-  SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
-    ${Boost_INCLUDE_DIR})
-ENDIF(NOT OTB_USE_EXTERNAL_BOOST)
-
 IF(NOT OTB_USE_EXTERNAL_OSSIM)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
   ${OTB_SOURCE_DIR}/Utilities/otbossim/include


Workaround for recent CMake bug w.r.t. CF guard

Recent versions of CMake generates the <LinkControlFlowGuard> node
under the <Link> node when it finds /guard:cf linker option in the
linker options. But that is not correct. It should generate it under
the <PropertyGroup> node so that the Microsoft.CppCommon.targets would
then generate <ControlFlowGuard> node under the <Link>.

To workaround the problem, change the casing of /guard:cf to uppercase.
CMake then doesn't detect the option as something known to it and passes
the option to the linker as additional option, which fixes the problem.

--- src/settings.cmake
+++ src/settings.cmake
@@ -155,8 +155,8 @@
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864")

-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /GUARD:CF")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /GUARD:CF")

     # Debug build specific flags
     set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE")


iOS: (attempt to) enable tuned arch-specific compiler options.

--- toolchains/ios.toolchain.cmake
+++ toolchains/ios.toolchain.cmake
@@ -28,7 +28,7 @@
 set( CMAKE_SYSTEM_PROCESSOR arm    )
 set( APPLE true )
 set( iOS   true )
-# compatibility with build scripts that rely on ios toolchains defining IOS instead of iOS
+# Compatibility with build scripts that rely on iOS toolchains defining IOS instead of iOS
 # CMake variables are case sensitive (unlike functions, macros and commands: https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variables
 set( IOS   true )
 set( UNIX  true )
@@ -39,7 +39,7 @@

 # Compiler detection is skipped, so we must manually set these variables so code that depend on them can work
 set( CMAKE_CXX_COMPILER_ID "AppleClang" CACHE STRING "C++ compiler id" )
-set( CMAKE_C_COMPILER_ID "AppleClang"  CACHE STRING "C compiler id" )
+set( CMAKE_C_COMPILER_ID   "AppleClang" CACHE STRING "C compiler id"   )

 set( TNUN_os_suffix iOS )

@@ -63,9 +63,17 @@
 set( CMAKE_XCODE_ATTRIBUTE_SDKROOT   iphoneos ) # "Latest iOS"

 list( APPEND TNUN_compiler_optimize_for_size -mthumb ) #...mrmlj...this will cause (harmless) warnings on ARM64 builds...
-set( XCODE_ATTRIBUTE_CFLAGS_armv7  "-mcpu=cortex-a8 -mtune=cortex-a9"  )
-set( XCODE_ATTRIBUTE_CFLAGS_armv7s "                -mtune=cortex-a15" ) # http://www.anandtech.com/show/6292/iphone-5-a6-not-a15-custom-core
-
+#...mrmlj...this no longer appears to work (Xcode 8.2):
+# http://www.cmake.org/pipermail/cmake/2011-October/046737.html
+# http://stackoverflow.com/questions/1211854/xcode-conditional-build-settings-based-on-architecture-device-arm-vs-simulat
+# http://cmake.3232098.n2.nabble.com/Different-settings-for-different-configurations-in-Xcode-td6908021.html
+# http://public.kitware.com/Bug/view.php?id=8915 Missing feature to set Xcode specific build settings
+set( XCODE_ATTRIBUTE_CFLAGS_armv7  "-mcpu=cortex-a8 -mfpu=neon -mtune=cortex-a9"  )
+set( XCODE_ATTRIBUTE_CFLAGS_armv7s "                -mfpu=neon -mtune=cortex-a15" ) # http://www.anandtech.com/show/6292/iphone-5-a6-not-a15-custom-core
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=armv7]          "${XCODE_ATTRIBUTE_CFLAGS_armv7}  $(OTHER_CFLAGS)"         )
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=armv7s]         "${XCODE_ATTRIBUTE_CFLAGS_armv7s} $(OTHER_CFLAGS)"         )
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=armv7]  "${XCODE_ATTRIBUTE_CFLAGS_armv7}  $(OTHER_CPLUSPLUSFLAGS)" )
+set( CMAKE_XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=armv7s] "${XCODE_ATTRIBUTE_CFLAGS_armv7s} $(OTHER_CPLUSPLUSFLAGS)" )

 # Implementation note:
 # Disable optimiser pass reports for iOS builds as they get run by the


flatbuffers use script: xpFlatBuffersBuildTS

cmake function that generates typescript files
issue https://github.com/smanders/externpro/issues/336

--- projects/use/usexp-flatbuffers-config.cmake
+++ projects/use/usexp-flatbuffers-config.cmake
@@ -47,3 +47,19 @@
     target_include_directories(${P_TARGET} ${scope} ${P_GENERATED_INCLUDES_DIR})
   endif()
 endfunction()
+function(xpFlatBuffersBuildTS)
+  set(oneValueArgs OUTPUT_DIR TARGET)
+  set(multiValueArgs SCHEMAS)
+  cmake_parse_arguments(P "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+  xpGetPkgVar(flatbuffers FLATC_EXECUTABLE) # sets FLATBUFFERS_FLATC_EXECUTABLE
+  set(cmdFile "${CMAKE_CURRENT_BINARY_DIR}/${P_TARGET}_fbs_ts_cmd")
+  add_custom_command(OUTPUT ${cmdFile}
+    COMMAND $<TARGET_FILE:${FLATBUFFERS_FLATC_EXECUTABLE}> --ts -o ${P_OUTPUT_DIR} ${P_SCHEMAS}
+    COMMAND ${CMAKE_COMMAND} -E touch ${cmdFile}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+    DEPENDS ${P_SCHEMAS}
+    )
+  set(tgtName ${P_TARGET}_fbs_ts)
+  add_custom_target(${tgtName} ALL DEPENDS ${cmdFile})
+  set_property(TARGET ${tgtName} PROPERTY FOLDER ${folder})
+endfunction()


run distance test on aero 1B elm parts

run distance test on aero 1B elm parts

--- test/testing.cmake
+++ test/testing.cmake
@@ -124,6 +124,16 @@
 mpi_test(testDistanceQueueParallel 4
   ./testDistanceQueue)

+# aero mesh tests
+mpi_test(testDistanceQueueAero25114 1
+  ./testDistanceQueue "${GRAPHS}/aero1Belm/graph128Ki_25114")
+mpi_test(testDistanceQueueAero88637 1
+  ./testDistanceQueue "${GRAPHS}/aero1Belm/graph128Ki_88637")
+mpi_test(testDistanceQueueAero81334 1
+  ./testDistanceQueue "${GRAPHS}/aero1Belm/afterMigr_81334")
+mpi_test(testDistanceQueueAero1457 1
+  ./testDistanceQueue "${GRAPHS}/aero1Belm/afterMigr_1457")
+
 if (ENABLE_PARMETIS)
   mpi_test(splitCube1to2 2
     ./split


COMP: Bump Superbuild ITK to 2018-02-23

COMP: Bump Superbuild ITK to 2018-02-23

Required for C++11 changes made to the code.

Change-Id: Ie7afc080387b958f738951b19e414fd8bf72642d


boards: frdm_kw41z: Default to daplink firmware and pyocd runner

The frdm_kw41z board was originally configured in zephyr to use the
jlink runner by default because pyocd didn't yet support the kw41z soc.
Support for kw41z was added in pyocd v0.9.0, so we can now default to
daplink firmware and pyocd.

Now all freedom boards in zephyr consistently use daplink and pyocd.

Signed-off-by: Maureen Helm <87a696db5547fa477bda9f9e0f00013c839c14d3@nxp.com>

--- boards/arm/frdm_kw41z/board.cmake
+++ boards/arm/frdm_kw41z/board.cmake
@@ -1,4 +1,4 @@
-set_ifndef(OPENSDA_FW jlink)
+set_ifndef(OPENSDA_FW daplink)

 if(OPENSDA_FW STREQUAL jlink)
   set_ifndef(BOARD_DEBUG_RUNNER jlink)


propagate some CMake variables to the installed physis header files

--- include/physis/config.h.cmake
+++ include/physis/config.h.cmake
@@ -1,5 +1,14 @@
 #ifndef PHYSIS_CONFIG_H_
 #define PHYSIS_CONFIG_H_
+
+// These are duplicates of common/config.h, but need to be here since
+// common/config.h is not going to be installed, while this header file
+// is installed by make install.
+#cmakedefine CUDA_ENABLED
+#cmakedefine MPI_ENABLED
+#cmakedefine PS_DEBUG
+#cmakedefine PS_VERBOSE_DEBUG
+#cmakedefine PS_VERBOSE

 #cmakedefine AUTO_DOUBLE_BUFFERING


Update jenkins_mercury.cmake to find SSM

--- Testing/jenkins_mercury.cmake
+++ Testing/jenkins_mercury.cmake
@@ -76,9 +76,11 @@
 OPA_INCLUDE_DIR:PATH=/usr/include/mpich2
 OPA_LIBRARY:FILEPATH=/usr/lib/libopa.so
 NA_USE_SSM:BOOL=ON
+SSM_DUMB_INCLUDE_DIR:PATH=$ENV{WORKSPACE}/.install/include
 SSM_INCLUDE_DIR:PATH=$ENV{WORKSPACE}/.install/include
-SSM_LIBRARY_SSM:FILEPATH=$ENV{WORKSPACE}/.install/lib/libssm.a
-SSM_LIBRARY_SSMPTCP:FILEPATH=$ENV{WORKSPACE}/.install/lib/libssmptcp.a
+SSM_LIBRARY:FILEPATH=$ENV{WORKSPACE}/.install/lib/libssm.a
+SSM_PTCP_LIBRARY:FILEPATH=$ENV{WORKSPACE}/.install/lib/libssmptcp.a
+SSM_PTCP_INCLUDE_DIR:PATH=$ENV{WORKSPACE}/.install/include
 MPIEXEC_MAX_NUMPROCS:STRING=4
 ")


Add note on possible functionization

Add note on possible functionization

--- Modules/CetCompilerSettings.cmake
+++ Modules/CetCompilerSettings.cmake
@@ -156,6 +156,22 @@
 # .. _`UPS Qualifiers`: https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/AboutQualifiers
 # .. _`SD-6`: https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
 #
+# TODO: Look at functionizing the below - at present, have to do
+#
+#  set(CET_COMPILER_CXX_STANDARD_MINIMUM 14)
+#  include(CetCompilerSettings)
+#
+# Review whether it's better to do
+#
+#  include(CetCompilerSettings)
+#  cet_compiler_cxx_standard_minimum(14)
+#
+# NB: trick here is that variable has sensible default (NULL),
+# but how to do a default function call? Could just set CXX_STANDARD
+# to sensible default in CetCompilerSettings, then if the function is
+# overidden, provides configuration?
+
+
 # Projects may need to define the minimum standard, so VALUES needs to
 # take that into account, and set DEFAULT to the first entry.
 # Because upcoming versions may be alphanumeric, this list should be ordered


Implement basic C/CXX flag conglomeration

Provide basic collection and merging of warning, optimization and
debugging flags at end of CetCompilerSettings module. Call
cet_default_asserts on PROJECT_SOURCE_DIR and then enable assertions
on it if the user request that option.

--- Modules/CetCompilerSettings.cmake
+++ Modules/CetCompilerSettings.cmake
@@ -116,8 +116,6 @@
     set(CET_COMPILER_${_lang}_DIAGFLAGS_PARANOID "${CET_COMPILER_${_lang}_DIAGFLAGS_VIGILANT} -pedantic -Wformat-y2k -Wswitch-default -Wsync-nand -Wtrampolines -Wlogical-op -Wshadow -Wcast-qual")
   endif()
 endforeach()
-
-

 if(CET_COMPILER_WARNINGS_ARE_ERRORS)
   foreach(_lang "C" "CXX")
@@ -334,4 +332,61 @@
 endfunction()

-
+#-----------------------------------------------------------------------
+# Private implementation detail
+# - Combine flags and set default assertions on the project source
+#   directory
+# - General, All Mode Options
+string(TOUPPER "${CET_COMPILER_DIAGNOSTIC_LEVEL}" CET_COMPILER_DIAGNOSTIC_LEVEL)
+set(CMAKE_C_FLAGS "${CET_COMPILER_C_DIAGFLAGS_${CET_COMPILER_DIAGNOSTIC_LEVEL}} ${CET_COMPILER_C_ERROR_FLAGS} ${CMAKE_C_FLAGS}")
+set(CMAKE_CXX_FLAGS "${CET_COMPILER_CXX_DIAGFLAGS_${CET_COMPILER_DIAGNOSTIC_LEVEL}} ${CET_COMPILER_CXX_ERROR_FLAGS} ${CMAKE_CXX_FLAGS}")
+
+# Per-Mode flags (Release, Debug, RelWithDebInfo, MinSizeRel)
+# DWARF done here as it's not completely generic like warnings
+# - C Language
+if(CMAKE_C_COMPILER_ID MATCHES "GNU|(Apple)+Clang|Intel")
+  set(CMAKE_C_FLAGS_RELEASE        "-O3 -g ${CET_COMPILER_C_DWARF_FLAGS}")
+  set(CMAKE_C_FLAGS_DEBUG          "-O0 -g ${CET_COMPILER_C_DWARF_FLAGS}")
+  set(CMAKE_C_FLAGS_MINSIZEREL     "-O3 -g ${CET_COMPILER_C_DWARF_FLAGS} -fno-om
+it-frame-pointer")
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
+endif()
+
+# - CXX Language
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|(Apple)+Clang|Intel")
+  set(CMAKE_CXX_FLAGS_RELEASE        "-O3 -g ${CET_COMPILER_CXX_DWARF_FLAGS}")
+  set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g ${CET_COMPILER_CXX_DWARF_FLAGS}")
+  set(CMAKE_CXX_FLAGS_MINSIZEREL     "-O3 -g ${CET_COMPILER_CXX_DWARF_FLAGS} -fno-omit-frame-pointer")
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+endif()
+
+# - Fortran language
+# TODO
+
+# SSE2 flags only in release (optimized) modes?
+
+# Assertions are handled by compile definitions so they can be changed
+# on a per directory tree basis. Set defaults here for project
+cet_default_asserts(DIRECTORY "${PROJECT_SOURCE_DIR}")
+
+# - If user requested, enable assertions in all modes
+if(CET_COMPILER_ENABLE_ASSERTS)
+  cet_enable_asserts(DIRECTORY "${PROJECT_SOURCE_DIR}")
+endif()
+
+# If we're generating for single-mode and no build type has been set,
+# default to RelWithDebInfo
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE RelWithDebInfo
+      CACHE STRING "Choose the type of build, options are: None Release MinSizeRel Debug RelWithDebInfo"
+      FORCE
+      )
+  else()
+    set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}"
+      CACHE STRING "Choose the type of build, options are: None Release MinSizeRel Debug RelWithDebInfo"
+      FORCE
+      )
+  endif()
+endif()
+


BUG: Check for undefined varName variable

On Windows we need to check that varName is defined before trying
to do a string replace operation on it.

Change-Id: I787db3b5266fcb47365e7ef7480d9c0d3ec38938

--- CMake/sitkCheckRequiredFlags.cmake
+++ CMake/sitkCheckRequiredFlags.cmake
@@ -30,7 +30,9 @@
       CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
       CMAKE_SHARED_LINKER_FLAGS_DEBUG
       CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO )
-    STRING(REGEX REPLACE "INCREMENTAL(:[a-zA-Z]+)?" "INCREMENTAL:NO" ${_varName} ${${_varName}})
+    if(DEFINED ${_varName})
+      STRING(REGEX REPLACE "INCREMENTAL(:[a-zA-Z]+)?" "INCREMENTAL:NO" ${_varName} ${${_varName}})
+    endif()
   endforeach()

 endif()


Add ngraph test suite to tests and remove the tests it replaces

--- test/testing.cmake
+++ test/testing.cmake
@@ -18,6 +18,13 @@
   ./ConstructTestSuite)
 mpi_test(ConstructTest_4 4
   ./ConstructTestSuite)
+
+mpi_test(NgraphTest_1 1
+  ./NgraphTestSuite)
+mpi_test(NgraphTest_2 2
+  ./NgraphTestSuite)
+mpi_test(NgraphTest_4 4
+  ./NgraphTestSuite)

 mpi_test(testMigration2 2
   ./testMigration)
@@ -102,41 +109,6 @@
     0
     1)
 ENDIF()
-
-mpi_test(testAdjacentSerial 1
-  ./testAdjacentTraversal
-  "${GRAPHS}/cube/cube"
-  "${GRAPHS}/ring.ebin")
-
-mpi_test(testAdjacentParallel 2
-  ./testAdjacentTraversal
-  "${GRAPHS}/cube/4/"
-  "${GRAPHS}/tree.ebin")
-
-mpi_test(testEdgeRing 1
-  ./testEdgeTraversal
-  "${GRAPHS}/ring.ebin")
-
-mpi_test(testEdgeTree 2
-  ./testEdgeTraversal
-  "${GRAPHS}/tree.ebin")
-
-#Diffusive Load Balancing Tests
-
-mpi_test(testDistanceQueueSerial 1
-  ./testDistanceQueue)
-mpi_test(testDistanceQueueParallel 4
-  ./testDistanceQueue)
-
-# aero mesh tests
-mpi_test(testDistanceQueueAero25114 1
-  ./testDistanceQueue "${GRAPHS}/aero1Belm/graph128Ki_25114")
-mpi_test(testDistanceQueueAero88637 1
-  ./testDistanceQueue "${GRAPHS}/aero1Belm/graph128Ki_88637")
-mpi_test(testDistanceQueueAero81334 1
-  ./testDistanceQueue "${GRAPHS}/aero1Belm/afterMigr_81334")
-mpi_test(testDistanceQueueAero1457 1
-  ./testDistanceQueue "${GRAPHS}/aero1Belm/afterMigr_1457")

 if (ENABLE_PARMETIS)
   mpi_test(splitCube1to2 2


PKG: libEGL is not compiled anymore

PKG: libEGL is not compiled anymore

--- Packaging/prepare_file_list.cmake
+++ Packaging/prepare_file_list.cmake
@@ -107,7 +107,6 @@
   if(MSVC)
     list(APPEND file_list "ucrtbase.dll")
     list(APPEND file_list "proj.dll")
-    list(APPEND file_list "libEGL.dll")
   endif()

   # Qt plugins


Update BuildSettings.cmake

Update BuildSettings.cmake

--- cmake/Modules/BuildSettings.cmake
+++ cmake/Modules/BuildSettings.cmake
@@ -50,6 +50,9 @@
     set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ STL standard")
 endif(WIN32)

+if(CMAKE_CXX_COMPILER_IS_CLANG)
+    add(CMAKE_CXX_FLAGS "-stdlib=libc++")
+endif()

 # ---------------------------------------------------------------------------- #
 # set the output directory (critical on Windows


- Fix small CMake issue in iOS project

- Fix small CMake issue in iOS project

--- cmake/Packaging/MacAppBuild.cmake
+++ cmake/Packaging/MacAppBuild.cmake
@@ -103,7 +103,10 @@
                             XCODE_PRODUCT_TYPE "com.apple.product-type.application"
                             )

-        target_link_libraries ( ${TARGET} ${SDL2_LIBRARY} ${SDL2_LIBRARIES} )
+        target_link_libraries ( ${TARGET}
+            PUBLIC
+            ${SDL2_LIBRARY} ${SDL2_LIBRARIES}
+            )

         set ( IOS_NAME "${TITLE}" )


Set icon only for macOS bundle

Set icon only for macOS bundle

--- cmake/modules/PackageHipacc.cmake
+++ cmake/modules/PackageHipacc.cmake
@@ -7,7 +7,6 @@
 set(CPACK_PACKAGE_VERSION ${HIPACC_VERSION})
 set(CPACK_PACKAGE_VENDOR "hipacc")
 set(CPACK_PACKAGE_CONTACT "https://hipacc-lang.org/#authors")
-set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/res/hipacc.png)
 set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)

@@ -76,6 +75,7 @@
     configure_file(README.md ${CMAKE_BINARY_DIR}/README.txt)
     set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_BINARY_DIR}/LICENSE.txt)
     set(CPACK_RESOURCE_FILE_README ${CMAKE_BINARY_DIR}/README.txt)
+    set(CPACK_PACKAGE_ICON ${CMAKE_SOURCE_DIR}/res/hipacc.png)
     set(CPACK_GENERATOR productbuild)

     if(NOT HIPACC_PACKAGING_PREFIX)


Add cudnn v5 path in CMAKE

Add cudnn v5 path in CMAKE

--- cmake/cudnn.cmake
+++ cmake/cudnn.cmake
@@ -11,6 +11,7 @@
     ${CUDNN_ROOT}
     ${CUDNN_ROOT}/lib64
     ${CUDNN_ROOT}/lib
+    ${CUDNN_ROOT}/lib/x86_64-linux-gnu
     $ENV{CUDNN_ROOT}
     $ENV{CUDNN_ROOT}/lib64
     $ENV{CUDNN_ROOT}/lib


add sanitizer flags to linker as well (it seems gcc needs it when using ld)

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -50,6 +50,7 @@
         if_flag("-O1" CMAKE_CXX_FLAGS)
         if_flag("-fno-omit-frame-pointer" CMAKE_CXX_FLAGS)
         if_flag("-fno-optimize-sibling-calls" CMAKE_CXX_FLAGS)
+        if_flag("-fsanitize=address" CMAKE_EXE_LINKER_FLAGS)
         to_parent()
 endfunction()

@@ -63,6 +64,7 @@
         if_flag("-O1" CMAKE_CXX_FLAGS)
         if_flag("-fno-omit-frame-pointer" CMAKE_CXX_FLAGS)
         if_flag("-fno-optimize-sibling-calls" CMAKE_CXX_FLAGS)
+        if_flag("-fsanitize=undefined" CMAKE_EXE_LINKER_FLAGS)
         to_parent()
 endfunction()

@@ -72,12 +74,14 @@
         if_flag("-O1" CMAKE_CXX_FLAGS)
         if_flag("-fno-omit-frame-pointer" CMAKE_CXX_FLAGS)
         if_flag("-fno-optimize-sibling-calls" CMAKE_CXX_FLAGS)
+        if_flag("-fsanitize=leak" CMAKE_EXE_LINKER_FLAGS)
         to_parent()
 endfunction()

 # setup thread sanitizer
 function(setup_tsan)
         if_flag("-fsanitize=thread" CMAKE_CXX_FLAGS)
+        if_flag("-fsanitize=thread" CMAKE_EXE_LINKER_FLAGS)
         to_parent()
 endfunction()

@@ -93,6 +97,7 @@
         if_flag("-fsanitize-blacklist=${CMAKE_SOURCE_DIR}/blacklist_msan.txt" CMAKE_CXX_FLAGS)
         if_flag("-fPIE" CMAKE_CXX_FLAGS)
         if_flag("-pie" CMAKE_EXE_LINKER_FLAGS)
+        if_flag("-fsanitize=memory" CMAKE_EXE_LINKER_FLAGS)
         to_parent()
 endfunction()


Fix the cmake parser to identify more patterns

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -15,35 +15,83 @@
 # Reads a Makefile into CMake vars.
 macro(ParseMakefileVars MAKEFILE_IN)
   message(STATUS "Reading vars from ${MAKEFILE_IN}...")
-        set (IfElse 0)
-        set (ElseSeen 0)
+  set (C_COMPILER ${CMAKE_C_COMPILER_ID})
+  set (IfElse 0)
+  set (ElseSeen 0)
+  set (SkipIfs 0)
+  set (SkipElse 0)
   file(STRINGS ${MAKEFILE_IN} makefile_contents)
   foreach (makefile_line ${makefile_contents})
-#message(STATUS "parsing ${makefile_line}")
-    if (${IfElse} GREATER 0)
+    #message(STATUS "parsing ${makefile_line}")
+    # Skip the entire scope of the else statement given that the if statement that precedes it has the valid condition.
+    # The variable SkipIfs is used to identify which endif statement closes the scope of the else statement.
+    if (${SkipElse} EQUAL 1)
+      #message(STATUS "skipping ${makefile_line}")
+      string(REGEX MATCH "(ifeq|ifneq|ifdef|ifndef) .*$" line_match "${makefile_line}")
+      if (NOT "${line_match}" STREQUAL "")
+        MATH(EXPR SkipIfs "${SkipIfs}+1")
+      endif ()
       string(REGEX MATCH "endif[ \t]*" line_match "${makefile_line}")
       if (NOT "${line_match}" STREQUAL "")
-#           message(STATUS "ENDIF ${makefile_line}")
-        set (IfElse 0)
-        set (ElseSeen 0)
+        if (${SkipIfs} EQUAL 0)
+          set (SkipElse 0)
+        else ()
+          MATH(EXPR SkipIfs "${SkipIfs}-1")
+        endif ()
+      endif ()
+      continue ()
+    endif ()
+    # The variable IfElse is greater than 0 if and only if the previously parsed line is an if statement.
+    if (${IfElse} GREATER 0)
+      # If the current scope is the one that has to be skipped, the if/endif/else statements
+      # along with it till the endif that closes the current scope have to be ignored as well.
+      string(REGEX MATCH "(ifeq|ifneq|ifdef|ifndef) .*$" line_match "${makefile_line}")
+      if (NOT "${line_match}" STREQUAL "")
+        if ((${IfElse} EQUAL 2 AND ${ElseSeen} EQUAL 0) OR (${IfElse} EQUAL 1 AND ${ElseSeen} EQUAL 1))
+          #message(STATUS "skipping ${makefile_line}")
+          MATH(EXPR SkipIfs "${SkipIfs}+1")
+          continue ()
+        endif ()
+      endif ()
+      string(REGEX MATCH "endif[ \t]*" line_match "${makefile_line}")
+      if (NOT "${line_match}" STREQUAL "")
+        if (${SkipIfs} EQUAL 0)
+          #message(STATUS "ENDIF ${makefile_line}")
+          set (IfElse 0)
+          set (ElseSeen 0)
+        else ()
+          #message(STATUS "skipping ${makefile_line}")
+          MATH(EXPR SkipIfs "${SkipIfs}-1")
+        endif ()
         continue ()
       endif ()
       string(REGEX MATCH "else[ \t]*" line_match "${makefile_line}")
-        if (NOT "${line_match}" STREQUAL "")
-#           message(STATUS "ELSE ${makefile_line}")
-           set (ElseSeen 1)
-           continue ()
-        endif()
-      if ( (${IfElse} EQUAL 2 AND ${ElseSeen} EQUAL 0) OR ( ${IfElse} EQUAL 1 AND ${ElseSeen} EQUAL 1))
-#           message(STATUS "skipping ${makefile_line}")
-         continue ()
+      if (NOT "${line_match}" STREQUAL "")
+        if (${SkipIfs} EQUAL 0)
+          #message(STATUS "ELSE ${makefile_line}")
+          set (ElseSeen 1)
+        else ()
+          #message(STATUS "skipping ${makefile_line}")
+        endif ()
+        continue ()
+      endif()
+      # Skip the lines that are not part of the path that has to be taken.
+      if ((${IfElse} EQUAL 2 AND ${ElseSeen} EQUAL 0) OR (${IfElse} EQUAL 1 AND ${ElseSeen} EQUAL 1) OR (${SkipIfs} GREATER 0))
+        #message(STATUS "skipping ${makefile_line}")
+        continue ()
       endif ()
-    endif ()
+    endif ()
+    # Skip commented lines (the ones that start with '#')
+    string(REGEX MATCH "[ \t]*\\#.*$" line_match "${makefile_line}")
+    if (NOT "${line_match}" STREQUAL "")
+      #message(STATUS "skipping ${makefile_line}")
+      continue ()
+    endif ()
     string(REGEX MATCH "([0-9_a-zA-Z]+)[ \t]*=[ \t]*(.+)$" line_match "${makefile_line}")
     if (NOT "${line_match}" STREQUAL "")
-#message(STATUS "match on ${line_match}")
+      #message(STATUS "match on ${line_match}")
       set(var_name ${CMAKE_MATCH_1})
-#      set(var_value ${CMAKE_MATCH_2})
+      #set(var_value ${CMAKE_MATCH_2})
       string(STRIP ${CMAKE_MATCH_2} var_value)
       # check for Makefile variables in the string, e.g. $(TSUFFIX)
       string(REGEX MATCHALL "\\$\\(([0-9_a-zA-Z]+)\\)" make_var_matches ${var_value})
@@ -54,39 +102,93 @@
         string(REPLACE "$(${make_var})" "${${make_var}}" var_value ${var_value})
       endforeach ()
       set(${var_name} ${var_value})
-    else ()
-      string(REGEX MATCH "include \\$\\(KERNELDIR\\)/(.+)$" line_match "${makefile_line}")
-      if (NOT "${line_match}" STREQUAL "")
-#message(STATUS "match on include ${line_match}")
-        ParseMakefileVars(${KERNELDIR}/${CMAKE_MATCH_1})
-      else ()
-#        message(STATUS "unmatched line ${line_match}")
-        string(REGEX MATCH "ifeq \\(\\$\\(([_A-Z]+)\\),[ \t]*([0-9_A-Z]+)\\)" line_match "${makefile_line}")
-        if (NOT "${line_match}" STREQUAL "")
-#          message(STATUS "IFEQ: ${line_match} first: ${CMAKE_MATCH_1} second: ${CMAKE_MATCH_2}")
-          if (DEFINED ${${CMAKE_MATCH_1}} AND ${${CMAKE_MATCH_1}} STREQUAL ${CMAKE_MATCH_2})
-#            message (STATUS "condition is true")
-            set (IfElse 1)
-          else ()
-            set (IfElse 2)
-          endif ()
-        else ()
-          string(REGEX MATCH "ifneq \\(\\$\\(([_A-Z]+)\\),[ \t]*([0-9_A-Z]+)\\)" line_match "${makefile_line}")
-          if (NOT "${line_match}" STREQUAL "")
-#            message(STATUS "IFNEQ: ${line_match} first: ${CMAKE_MATCH_1} second: ${CMAKE_MATCH_2}")
-            if ( ${CMAKE_MATCH_1} STREQUAL C_COMPILER)
-                 set (CMAKE_MATCH_1 CMAKE_C_COMPILER)
-            endif ()
-            if (NOT ( ${${CMAKE_MATCH_1}} STREQUAL ${CMAKE_MATCH_2}))
-#              message (STATUS "condition is true")
-              set (IfElse 1)
-            else ()
-              set (IfElse 2)
-            endif ()
-          endif ()
-        endif ()
-      endif ()
-    endif ()
+      continue ()
+    endif ()
+    # Include a new file to be parsed
+    string(REGEX MATCH "include \\$\\(KERNELDIR\\)/(.+)$" line_match "${makefile_line}")
+    if (NOT "${line_match}" STREQUAL "")
+      #message(STATUS "match on include ${line_match}")
+      ParseMakefileVars(${KERNELDIR}/${CMAKE_MATCH_1})
+      continue ()
+    endif ()
+    # The if statement that precedes this else has the path taken
+    # Thus, this else statement has to be skipped.
+    string(REGEX MATCH "else[ \t]*" line_match "${makefile_line}")
+    if (NOT "${line_match}" STREQUAL "")
+      #message(STATUS "skipping ${makefile_line}")
+      set (SkipElse 1)
+      continue()
+    endif()
+    # Example 1: ifdef HAVE_MSA
+    # Example 2: ifndef ZNRM2KERNEL
+    string(REGEX MATCH "(ifdef|ifndef) ([0-9_A-Z]+)" line_match "${makefile_line}")
+    if (NOT "${line_match}" STREQUAL "")
+      #message(STATUS "${CMAKE_MATCH_1} first: ${CMAKE_MATCH_2}")
+      set (ElseSeen 0)
+      if (DEFINED ${CMAKE_MATCH_2})
+        if (${CMAKE_MATCH_1} STREQUAL "ifdef")
+          #message (STATUS "condition is true")
+          set (IfElse 1)
+        else ()
+          set (IfElse 2)
+        endif ()
+      else ()
+        if (${CMAKE_MATCH_1} STREQUAL "ifdef")
+          set (IfElse 2)
+        else ()
+          #message (STATUS "condition is true")
+          set (IfElse 1)
+        endif ()
+      endif ()
+      continue ()
+    endif ()
+    # Example 1: ifeq ($(SGEMM_UNROLL_M), 16)
+    # Example 2: ifeq ($(SGEMM_UNROLL_M)x$(SGEMM_UNROLL_N), 8x8)
+    # Example 3: ifeq ($(__BYTE_ORDER__)$(ELF_VERSION),__ORDER_BIG_ENDIAN__2)
+    # Ignore the second group since (?:...) does not work on cmake
+    string(REGEX MATCH "ifeq \\(\\$\\(([0-9_A-Z]+)\\)(([0-9_A-Za-z]*)\\$\\(([0-9_A-Z]+)\\))?,[ \t]*([0-9_A-Za-z]+)\\)" line_match "${makefile_line}")
+    if (NOT "${line_match}" STREQUAL "")
+      #message(STATUS "IFEQ: ${line_match} first: ${CMAKE_MATCH_1} second: ${CMAKE_MATCH_3} third: ${CMAKE_MATCH_4} fourth: ${CMAKE_MATCH_5}")
+      if (DEFINED ${CMAKE_MATCH_1})
+        if (DEFINED ${CMAKE_MATCH_4})
+          set (STR ${${CMAKE_MATCH_1}}${CMAKE_MATCH_3}${${CMAKE_MATCH_4}})
+        else ()
+          set (STR ${${CMAKE_MATCH_1}})
+        endif ()
+        if (${STR} STREQUAL ${CMAKE_MATCH_5})
+          #message (STATUS "condition is true")
+          set (IfElse 1)
+          continue ()
+        endif ()
+      endif ()
+      set (IfElse 2)
+      continue ()
+    endif ()
+    # Example 1 (Group 3): ifneq ($(SGEMM_UNROLL_M), $(SGEMM_UNROLL_N))
+    # Example 2 (Group 4): ifneq ($(C_COMPILER), PGI)
+    string(REGEX MATCH "ifneq \\(\\$\\(([0-9_A-Z]+)\\),[ \t]*(\\$\\(([0-9_A-Z]+)\\)|([0-9_A-Z]+))\\)" line_match "${makefile_line}")
+    if (NOT "${line_match}" STREQUAL "")
+      #message(STATUS "IFNEQ: ${line_match} first: ${CMAKE_MATCH_1} second: ${CMAKE_MATCH_3} third: ${CMAKE_MATCH_4}")
+      set (ElseSeen 0)
+      set (HasValidGroup 0)
+      if (DEFINED ${CMAKE_MATCH_3})
+        set (HasValidGroup 1)
+        set (STR ${${CMAKE_MATCH_3}})
+      elseif (NOT ${CMAKE_MATCH_4} STREQUAL "")
+        set (HasValidGroup 1)
+        set (STR ${CMAKE_MATCH_4})
+      endif ()
+      if (DEFINED ${CMAKE_MATCH_1} AND ${HasValidGroup} EQUAL 1)
+        if (NOT (${${CMAKE_MATCH_1}} STREQUAL ${STR}))
+          #message (STATUS "condition is true")
+          set (IfElse 1)
+          continue ()
+        endif ()
+      endif ()
+      set (IfElse 2)
+      continue ()
+    endif ()
+    #message(STATUS "unmatched line ${line_match}")
   endforeach ()
 endmacro ()