simplify to a single package install for osgeo4w

--- cmake/modules/BuildOSGeo4W.cmake
+++ cmake/modules/BuildOSGeo4W.cmake
@@ -7,16 +7,8 @@

 set(OSGEO4W_DIR osgeo4w)
 set(OSGEO4W_LIB_DIR ${OSGEO4W_DIR}/lib)
-set(OSGEO4W_ETC_DIR ${OSGEO4W_DIR}/etc)
-set(OSGEO4W_ETC_INI_DIR ${OSGEO4W_DIR}/etc/ini)
-set(OSGEO4W_ETC_POSTINSTALL_DIR ${OSGEO4W_DIR}/etc/postinstall)
-set(OSGEO4W_LIB_BIN_DIR ${OSGEO4W_DIR}/lib/bin)
 set(OSGEO4W_BIN_DIR ${OSGEO4W_DIR}/bin)
-set(OSGEO4W_DEVEL_DIR ${OSGEO4W_DIR}/devel)
-set(OSGEO4W_DEVEL_INCLUDE_DIR ${OSGEO4W_DEVEL_DIR}/include)
-set(OSGEO4W_DEVEL_INCLUDE_LASZIP_DIR ${OSGEO4W_DEVEL_INCLUDE_DIR}/laszip)
-set(OSGEO4W_DEVEL_LIB_DIR ${OSGEO4W_DEVEL_DIR}/lib)
-set(OSGEO4W_DEVEL_BIN_DIR ${OSGEO4W_DEVEL_DIR}/bin)
+set(OSGEO4W_INCLUDE_DIR ${OSGEO4W_DIR}/include/laszip)

 set(OSGEO4W_PACKAGES ${OSGEO4W_DIR}/packages)

@@ -24,12 +16,7 @@
 set(OSGEO4W_DIRECTORIES
     ${OSGEO4W_DIR}
     ${OSGEO4W_LIB_DIR}
-    ${OSGEO4W_LIB_BIN_DIR}
-    ${OSGEO4W_DEVEL_DIR}
-    ${OSGEO4W_DEVEL_INCLUDE_DIR}
-    ${OSGEO4W_DEVEL_INCLUDE_LASZIP_DIR}
-    ${OSGEO4W_DEVEL_LIB_DIR}
-    ${OSGEO4W_DEVEL_BIN_DIR}
+    ${OSGEO4W_INCLUDE_DIR}
     ${OSGEO4W_PACKAGES}
     ${OSGEO4W_BIN_DIR})

@@ -103,11 +90,10 @@

 make_directories()
 copy_files(${LASZIP_BUILD_OUTPUT_DIRECTORY}/laszip.dll ${OSGEO4W_BIN_DIR}/  )
-copy_files(${LASZIP_BUILD_OUTPUT_DIRECTORY}/laszip.lib ${OSGEO4W_DEVEL_LIB_DIR}/  )
-copy_files(./include/laszip/*.hpp ${OSGEO4W_DEVEL_INCLUDE_LASZIP_DIR}/  )
+copy_files(${LASZIP_BUILD_OUTPUT_DIRECTORY}/laszip.lib ${OSGEO4W_LIB_DIR}/  )
+copy_files(./include/laszip/*.hpp ${OSGEO4W_INCLUDE_DIR}/  )

-tar_directories(${OSGEO4W_DIR} ${laszip_SOURCE_DIR}/${OSGEO4W_PACKAGES}/laszip-${VERSION}-${OSGEO4W_UPSTREAM_RELEASE}.tar.bz2 "bin/")
-tar_directories(${OSGEO4W_DIR}/devel ${laszip_SOURCE_DIR}/${OSGEO4W_PACKAGES}/laszip-devel-${VERSION}-${OSGEO4W_UPSTREAM_RELEASE}.tar.bz2 "lib/;include")
+tar_directories(${OSGEO4W_DIR} ${laszip_SOURCE_DIR}/${OSGEO4W_PACKAGES}/laszip-${VERSION}-${OSGEO4W_UPSTREAM_RELEASE}.tar.bz2 "bin/;lib/;include/")

 add_custom_target(osgeo4w


Update FindTinyXML2 module to solve cmake warning (#1217)

--- cmake/modules/FindTinyXML2.cmake
+++ cmake/modules/FindTinyXML2.cmake
@@ -39,10 +39,10 @@
     include(FindPackageHandleStandardArgs)

     if(TINYXML2_FROM_SOURCE)
-        find_package_handle_standard_args(tinyxml2 DEFAULT_MSG TINYXML2_SOURCE_DIR TINYXML2_INCLUDE_DIR)
+        find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TINYXML2_SOURCE_DIR TINYXML2_INCLUDE_DIR)
         mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_SOURCE_DIR)
     else()
-        find_package_handle_standard_args(tinyxml2 DEFAULT_MSG TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR)
+        find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR)
         mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_LIBRARY)
     endif()
 endif()


dlib 19.2-p2

dlib 19.2-p2

--- cmake/projects/dlib/hunter.cmake
+++ cmake/projects/dlib/hunter.cmake
@@ -101,6 +101,17 @@
     PACKAGE_NAME
     dlib
     VERSION
+    "19.2-p2"
+    URL
+    "https://github.com/hunter-packages/dlib/archive/v19.2-p2.tar.gz"
+    SHA1
+    5ce3d09490536dc0dc9bcb0d14ee25f1bebdbfa3
+)
+
+hunter_add_version(
+    PACKAGE_NAME
+    dlib
+    VERSION
     "19.0-p3"
     URL
     "https://github.com/hunter-packages/dlib/archive/v19.0-p3.tar.gz"


Use find_package_handle_standard_args instead of libfind_process

--- cmake/FindQScintilla.cmake
+++ cmake/FindQScintilla.cmake
@@ -11,6 +11,7 @@
 #
 # Redistribution and use is allowed according to the terms of the FreeBSD license.

+include(FindPackageHandleStandardArgs)
 include(LibFindMacros)

 find_package(Qt5Core)
@@ -70,7 +71,12 @@

 set(QSCINTILLA_PROCESS_LIBRARIES QSCINTILLA_LIBRARY QSCINTILLA_LIBRARIES)
 set(QSCINTILLA_PROCESS_INCLUDE_DIRS QSCINTILLA_INCLUDE_DIR QSCINTILLA_INCLUDE_DIRS)
-libfind_process(QScintilla)
+
+find_package_handle_standard_args(QScintilla
+  FOUND_VAR QSCINTILLA_FOUND
+  REQUIRED_VARS QSCINTILLA_LIBRARY QSCINTILLA_INCLUDE_DIR
+  VERSION_VAR QSCINTILLA_VERSION
+)

 unset(BREW_EXECUTABLE CACHE)
 # The usage of brew on OSX should be considered an implementation detail


Fix wrong version number matching

Fix wrong version number matching

As the CMake MATCH takes regex parameter, sub-string could unexpectedtly
be matched. QT verseion 5.12.4, for instance, will be matched with not just
for QT5 but also for QT4 as well due to the sub-string '4' which is unexpected.
This patch resolves the issue by constraining version number testing for
Major version numbers only.

Signed-off-by: Brandon Hong <83b2ef94d9cb629447eaa3169d13e819e85d72c7@intel.com>

--- cmake/modules/FindQt.cmake
+++ cmake/modules/FindQt.cmake
@@ -26,10 +26,10 @@
     # now find qmake
     IF(QT_QMAKE_EXECUTABLE)
         EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
-        IF(QTVERSION MATCHES "4.*")
+        IF(QTVERSION MATCHES "^4.*")
             SET(QT4_INSTALLED TRUE)
         ENDIF()
-        IF(QTVERSION MATCHES "5.*")
+        IF(QTVERSION MATCHES "^5.*")
             SET(QT5_INSTALLED TRUE)
         ENDIF()
     ENDIF()


OOPS. Left in a test which is now removed by bashxx ==> bash.

svn path=/trunk/; revision=7229

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -55,7 +55,7 @@

 option(BUILD_TEST "Compile examples in the build tree and enable ctest" OFF)
 # Use bash when available for ctest and install tree test support
-find_program(SH_EXECUTABLE bashxx)
+find_program(SH_EXECUTABLE bash)
 if(SH_EXECUTABLE)
   set(HAVE_BASH ON)
 else(SH_EXECUTABLE)


Committed Werner's change to add the comdlg32 library to the Cmake build.

svn path=/trunk/; revision=7039

--- cmake/modules/wingcc.cmake
+++ cmake/modules/wingcc.cmake
@@ -31,7 +31,7 @@
   find_package(GDI32)
   if(GDI32_FOUND)
     message(STATUS "Looking for gdi32 header and library - found")
-    set(wingcc_LINK_FLAGS "${GDI32_LIBRARIES}")
+    set(wingcc_LINK_FLAGS "${GDI32_LIBRARIES};comdlg32")
     if(WITH_FREETYPE)
       set(
       wingcc_COMPILE_FLAGS


using static boost for windows

using static boost for windows

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -1,8 +1,8 @@
 # Find and set Boost flags

-if(NOT PCL_SHARED_LIBS)
+if(NOT PCL_SHARED_LIBS OR WIN32)
     set(Boost_USE_STATIC_LIBS ON)
-endif(NOT PCL_SHARED_LIBS)
+endif(NOT PCL_SHARED_LIBS OR WIN32)

 find_package(Boost 1.40.0 COMPONENTS system filesystem thread date_time)


adding REQUIRED flag to find_package(boost)

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -4,7 +4,7 @@
   set(Boost_USE_STATIC_LIBS ON)
 endif(NOT PCL_SHARED_LIBS OR WIN32)

-find_package(Boost 1.40.0 COMPONENTS system filesystem thread date_time)
+find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time)

 if(Boost_FOUND)
   # Obtain diagnostic information about Boost's automatic linking outputted


adding filesystem back - working on generating boost installers instead

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -4,7 +4,11 @@
     set(Boost_USE_STATIC_LIBS ON)
 endif(NOT PCL_SHARED_LIBS)

-find_package(Boost 1.40.0 COMPONENTS system thread date_time)
+find_package(Boost 1.40.0 COMPONENTS system filesystem thread date_time)
+
+# Obtain diagnostic information about Boost's automatic linking outputted
+# during compilation time.
+add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})

 include_directories(${Boost_INCLUDE_DIRS})
 link_directories(${Boost_LIBRARY_DIRS})


Disable vc as default for Mac (the bundled version do not work for Xcode > 7.3)

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -188,6 +188,11 @@
    set(vc_defvalue OFF)
 endif()

+#---This version of VC do not work for XCode > 7.3, so disabled by default
+if(APPLE)
+   set(vc_defvalue OFF)
+endif()
+
 #---Apply minimal or gminimal------------------------------------------------------------------
 foreach(opt ${root_build_options})
   if(NOT opt MATCHES "thread|cxx11|cling|builtin_llvm|builtin_ftgl|explicitlink")


chore: bump minimum cmake

chore: bump minimum cmake

Hi, I'm running the latest cmake:

```sh
$ cmake --version
cmake version 3.20.1
```

And I keep getting this annoying warning:

```
cmake ../..
CMake Deprecation Warning at /usr/local/vitasdk/share/vita.toolchain.cmake:33 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  Debug/vita/CMakeFiles/3.20.1/CMakeSystem.cmake:6 (include)
  CMakeLists.txt:30 (project)
```

Wondering if we could do a bump?

--- cmake_toolchain/vita.toolchain.cmake
+++ cmake_toolchain/vita.toolchain.cmake
@@ -30,7 +30,7 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.

-cmake_minimum_required( VERSION 2.6.3 )
+cmake_minimum_required( VERSION 2.8.12 )

 if( DEFINED CMAKE_CROSSCOMPILING )
   # subsequent toolchain loading is not really needed


added support to build tbb from sources as static and dynamic library

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -65,6 +65,23 @@
     FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
     FIND_LIBRARY(TBB_LIBRARY tbb)
     FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)
+
+  ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/src)
+    OPTION(EMBREE_TBB_STATIC_LIB "Build TBB as a static library (building TBB as a static library is NOT recommended)")
+    if (EMBREE_TBB_STATIC_LIB)
+      include(${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)
+      tbb_build(TBB_ROOT ${EMBREE_TBB_ROOT} CONFIG_DIR TBB_DIR MAKE_ARGS extra_inc=big_iron.inc)
+      SET(TBB_INCLUDE_DIR ${EMBREE_TBB_ROOT}/include)
+      SET(TBB_LIBRARY ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/libtbb.a)
+      SET(TBB_LIBRARY_MALLOC ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/libtbbmalloc.a)
+    else()
+      include(${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)
+      tbb_build(TBB_ROOT ${EMBREE_TBB_ROOT} CONFIG_DIR TBB_DIR)
+      SET(TBB_INCLUDE_DIR ${EMBREE_TBB_ROOT}/include)
+      SET(TBB_LIBRARY ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/libtbb.so.2)
+      SET(TBB_LIBRARY_MALLOC ${PROJECT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir_release/libtbbmalloc.so.2)
+    endif()
+
   ELSE()
     SET(TBB_INCLUDE_DIR TBB_INCLUDE_DIR-NOTFOUND)
     SET(TBB_LIBRARY TBB_LIBRARY-NOTFOUND)


ogg: update to 1.3.3

ogg: update to 1.3.3

--- packages/ogg.cmake
+++ packages/ogg.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(ogg
     DEPENDS gcc
-    URL "http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz"
-    URL_HASH SHA256=e19ee34711d7af328cb26287f4137e70630e7261b17cbe3cd41011d73a654692
+    URL "http://downloads.xiph.org/releases/ogg/libogg-1.3.3.tar.xz"
+    URL_HASH SHA256=4f3fc6178a533d392064f14776b23c397ed4b9f48f5de297aba73b643f955c08
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${EXEC} <SOURCE_DIR>/configure
         --host=${TARGET_ARCH}


modules: simplified flag parsing in FindMagnum.cmake.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -197,35 +197,20 @@

 # Configuration
 file(READ ${MAGNUM_INCLUDE_DIR}/Magnum/configure.h _magnumConfigure)
-
-string(FIND "${_magnumConfigure}" "#define MAGNUM_BUILD_DEPRECATED" _BUILD_DEPRECATED)
-if(NOT _BUILD_DEPRECATED EQUAL -1)
-    set(MAGNUM_BUILD_DEPRECATED 1)
-endif()
-string(FIND "${_magnumConfigure}" "#define MAGNUM_BUILD_STATIC" _BUILD_STATIC)
-if(NOT _BUILD_STATIC EQUAL -1)
-    set(MAGNUM_BUILD_STATIC 1)
-endif()
-string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES" _TARGET_GLES)
-if(NOT _TARGET_GLES EQUAL -1)
-    set(MAGNUM_TARGET_GLES 1)
-endif()
-string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES2" _TARGET_GLES2)
-if(NOT _TARGET_GLES2 EQUAL -1)
-    set(MAGNUM_TARGET_GLES2 1)
-endif()
-string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES3" _TARGET_GLES3)
-if(NOT _TARGET_GLES3 EQUAL -1)
-    set(MAGNUM_TARGET_GLES3 1)
-endif()
-string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_DESKTOP_GLES" _TARGET_DESKTOP_GLES)
-if(NOT _TARGET_DESKTOP_GLES EQUAL -1)
-    set(MAGNUM_TARGET_DESKTOP_GLES 1)
-endif()
-string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_WEBGL" _TARGET_WEBGL)
-if(NOT _TARGET_WEBGL EQUAL -1)
-    set(MAGNUM_TARGET_WEBGL 1)
-endif()
+set(_magnumFlags
+    BUILD_DEPRECATED
+    BUILD_STATIC
+    TARGET_GLES
+    TARGET_GLES2
+    TARGET_GLES3
+    TARGET_DESKTOP_GLES
+    TARGET_WEBGL)
+foreach(_magnumFlag ${_magnumFlags})
+    string(FIND "${_magnumConfigure}" "#define MAGNUM_${_magnumFlag}" _magnum_${_magnumFlag})
+    if(NOT _magnum_${_magnumFlag} EQUAL -1)
+        set(MAGNUM_${_magnumFlag} 1)
+    endif()
+endforeach()

 # Dependent libraries and includes
 set(MAGNUM_INCLUDE_DIRS ${MAGNUM_INCLUDE_DIR}


CMake: Fix LLVM_SYSTEM_LIBRARIES on Windows.

--- src/cmake/modules/FindLLVM.cmake
+++ src/cmake/modules/FindLLVM.cmake
@@ -52,6 +52,7 @@
     execute_process (COMMAND ${LLVM_CONFIG} --system-libs
                      OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
                      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    string (REPLACE " " ";" LLVM_SYSTEM_LIBRARIES "${LLVM_SYSTEM_LIBRARIES}")
 else ()
     # Older LLVM did not have llvm-config --system-libs, but we know that
     # on Linux, we'll need curses.


Fix inclusion of STM32 Cube package in assemblies (#2067)

Ignoring build error. This define is new on the updated SPIFFS config file. Incoming PR with updated SPIFFS it's inbound.

***NO_CI***

--- CMake/binutils.ChibiOS.cmake
+++ CMake/binutils.ChibiOS.cmake
@@ -168,6 +168,7 @@
             EXTRA_INCLUDES
                 ${CHIBIOS_INCLUDE_DIRS}
                 ${CHIBIOS_HAL_INCLUDE_DIRS}
+                ${${TARGET_STM32_CUBE_PACKAGE}_CubePackage_INCLUDE_DIRS}
                 ${ChibiOSnfOverlay_INCLUDE_DIRS}
                 ${CHIBIOS_CONTRIB_INCLUDE_DIRS}
                 ${CHIBIOS_LWIP_INCLUDE_DIRS}


Octave 3.8.0 does not have libcruft

Octave 3.8.0 does not have libcruft

--- cmake/FindOctave.cmake
+++ cmake/FindOctave.cmake
@@ -119,14 +119,16 @@
               NAMES octave liboctave
               HINTS ${OCTAVE_LIBRARIES_PATHS}
             )
-find_library( OCTAVE_CRUFT_LIBRARY
-              NAMES cruft libcruft
-              HINTS ${OCTAVE_LIBRARIES_PATHS}
-            )
-
 set ( OCTAVE_LIBRARIES ${OCTAVE_OCTINTERP_LIBRARY} )
 list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_OCTAVE_LIBRARY} )
-list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_CRUFT_LIBRARY} )
+
+if ( ${OCTAVE_VERSION_STRING} LESS 3.8.0 )
+  find_library( OCTAVE_CRUFT_LIBRARY
+                NAMES cruft libcruft
+                HINTS ${OCTAVE_LIBRARIES_PATHS}
+              )
+  list ( APPEND OCTAVE_LIBRARIES ${OCTAVE_CRUFT_LIBRARY} )
+endif ()

 find_path ( OCTAVE_INCLUDE_DIR
             NAMES mex.h


Keeps static OpenSSL library if found, otherwise uses dynamic version

--- cmake/Findcrypto.cmake
+++ cmake/Findcrypto.cmake
@@ -59,7 +59,11 @@
         if (BUILD_SHARED_LIBS)
             set(crypto_LIBRARY ${crypto_SHARED_LIBRARY})
         else()
-            set(crypto_LIBRARY ${crypto_SHARED_LIBRARY})
+            if (crypto_STATIC_LIBRARY)
+               set(crypto_LIBRARY ${crypto_STATIC_LIBRARY})
+            else()
+               set(crypto_LIBRARY ${crypto_SHARED_LIBRARY})
+            endif()
         endif()
     endif()


Added support for more gccs with Cuda

Added support for more gccs with Cuda

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -40,19 +40,26 @@
 # Main code dealing with each version of cuda
 IF(CUDA_FOUND)
   IF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)
+    # Compatible gcc can be checked in host_config.h
     SET(GCC_PATH "")
-    IF(CUDA_VERSION_MAJOR MATCHES "4")
+    IF(${CUDA_VERSION} VERSION_GREATER "4.1.99")
+      FIND_GCC(GCC_PATH "4" "6")
+    ENDIF()
+    IF(NOT GCC_PATH AND ${CUDA_VERSION} VERSION_GREATER "4.0.99")
+      FIND_GCC(GCC_PATH "4" "5")
+    ENDIF()
+    IF(NOT GCC_PATH AND ${CUDA_VERSION} VERSION_GREATER "3.99")
       FIND_GCC(GCC_PATH "4" "4")
-    ENDIF(CUDA_VERSION_MAJOR MATCHES "4")
-    IF(NOT GCC_PATH OR CUDA_VERSION_MAJOR LESS "3")
+    ENDIF()
+    IF(NOT GCC_PATH)
       FIND_GCC(GCC_PATH "4" "3")
-    ENDIF(NOT GCC_PATH OR CUDA_VERSION_MAJOR LESS "3")
+    ENDIF()

     IF(GCC_PATH)
       MESSAGE(STATUS "nvcc-check: Found adequate gcc (${GCC_PATH})... telling nvcc to use it!")
       SET(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-bindir=${GCC_PATH})
     ELSE(GCC_PATH)
-      MESSAGE(FATAL_ERROR "nvcc-check: Please install adequate gcc for cuda (gcc-4.3 or gcc-4.4 for Cuda 4).\nNote that gcc-4.x can be installed side-by-side with your current version of gcc.\n")
+      MESSAGE(FATAL_ERROR "nvcc-check: Please install adequate gcc for cuda.\nNote that gcc-4.x can be installed side-by-side with your current version of gcc.\n")
     ENDIF(GCC_PATH)
   ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux" AND CMAKE_COMPILER_IS_GNUCC)


fix gtest include dir when using gtest inside the workspace (fix #585)

--- cmake/test/gtest.cmake
+++ cmake/test/gtest.cmake
@@ -86,6 +86,7 @@
       # mark gtest targets with EXCLUDE_FROM_ALL to only build when tests are built which depend on them
       set_target_properties(gtest gtest_main PROPERTIES EXCLUDE_FROM_ALL 1)
       get_filename_component(_CATKIN_GTEST_INCLUDE_DIR ${_CATKIN_GTEST_INCLUDE} PATH)
+      get_filename_component(_CATKIN_GTEST_INCLUDE_DIR ${_CATKIN_GTEST_INCLUDE_DIR} PATH)
       # set from-source variables
       set(GTEST_FROM_SOURCE_FOUND TRUE CACHE INTERNAL "")
       set(GTEST_FROM_SOURCE_INCLUDE_DIRS ${_CATKIN_GTEST_INCLUDE_DIR} CACHE INTERNAL "")


removed incomplete add_dependency line

removed incomplete add_dependency line

--- cmake/test/tests.cmake
+++ cmake/test/tests.cmake
@@ -63,5 +63,4 @@
     COMMAND ${CATKIN_ENV} ${PYTHON_EXECUTABLE}
     ${catkin_EXTRAS_DIR}/test/run_tests.py --results ${results} ${working_dir_arg} ${_testing_COMMAND})
   add_dependencies(run_tests_${PROJECT_NAME}_${type} run_tests_${PROJECT_NAME}_${type}_${name})
-  add_dependencies(run_tests_${PROJECT_NAME}_${type}_${name})
 endfunction()


fixed target dependencies for cleaning test results

--- cmake/test/tests.cmake
+++ cmake/test/tests.cmake
@@ -23,9 +23,10 @@
   # clean out previous test results before running tests
   add_custom_target(clean-test-results
     COMMAND ${CMAKE_COMMAND} -E remove_directory ${CATKIN_TEST_RESULTS_DIR})
-  # make the 'run_tests' target depend on 'clean-test-results'
-  # which will ensure that test results are deleted before we try to run all tests
-  add_dependencies(run_tests clean-test-results)
+  # make the 'tests' target depend on 'clean-test-results'
+  # which will ensure that test results are deleted before we try to build all tests
+  # and thus before we try to run all tests
+  add_dependencies(tests clean-test-results)
 endif()

 #


Hardcode installing lapack/blas

Hardcode installing lapack/blas

We can't use install dependencies to get them because it is too slow

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -88,36 +88,16 @@
 )
 endif()

-# install dependencies of numpy libraries
+# install blas and lapack (it is too slow to call the install dependencies script on numpy,
+# it causes the test to time out)
 install(CODE
-  "file(GLOB_RECURSE plugin_libs \"${CMAKE_INSTALL_PREFIX}/lib/python3.6/site-packages/numpy\" *.so)
-  set(qt_libraries_dir \"${Qt5_DIR}/../../..\")
-  foreach(lib \${plugin_libs})
-    execute_process(COMMAND
-      ${CMAKE_COMMAND}
-        -Dexecutable:PATH=\${lib}
-        -Ddependencies_root:PATH=${install_location}
-        -Dtarget_root:PATH=\${CMAKE_INSTALL_PREFIX}/lib
-        -Dpv_version:STRING=${tomviz_version}
-        -Dqt_root:PATH=${Qt5_DIR}/../../../
-        -P ${CMAKE_CURRENT_LIST_DIR}/install_dependencies.cmake)
-  endforeach()"
-  COMPONENT superbuild)
-# install dependencies of scipy libraries
-install(CODE
-  "file(GLOB_RECURSE plugin_libs \"${CMAKE_INSTALL_PREFIX}/lib/python3.6/site-packages/scipy\" *.so)
-  set(qt_libraries_dir \"${Qt5_DIR}/../../..\")
-  foreach(lib \${plugin_libs})
-    execute_process(COMMAND
-      ${CMAKE_COMMAND}
-        -Dexecutable:PATH=\${lib}
-        -Ddependencies_root:PATH=${install_location}
-        -Dtarget_root:PATH=\${CMAKE_INSTALL_PREFIX}/lib
-        -Dpv_version:STRING=${tomviz_version}
-        -Dqt_root:PATH=${Qt5_DIR}/../../../
-        -P ${CMAKE_CURRENT_LIST_DIR}/install_dependencies.cmake)
-  endforeach()"
-  COMPONENT superbuild)
+  "execute_process(COMMAND
+    ${CMAKE_COMMAND}
+    -E copy_if_different ${install_location}/lib/libblas.so \${CMAKE_INSTALL_PREFIX}/lib)
+   execute_process(COMMAND
+    ${CMAKE_COMMAND}
+    -E copy_if_different ${install_location}/lib/liblapack.so \${CMAKE_INSTALL_PREFIX}/lib)"
+)

 # install executables
 foreach(executable tomviz)


Changing the Eigen configuration.

Changing the Eigen configuration.

--- CMake/FindEigen3.cmake
+++ CMake/FindEigen3.cmake
@@ -63,8 +63,7 @@

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
       PATHS
-      ${CMAKE_INSTALL_PREFIX}/include
-      ${KDE4_INCLUDE_DIR}
+      ${EIGEN_ROOT}
       PATH_SUFFIXES eigen3 eigen
     )


BUG: Must pass compiler to Insight ExternalProject.

Change-Id: Ibc8d59b91324abe92ecffd660f9294a7d00ed05f

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -100,6 +100,8 @@
       BINARY_DIR Insight-Build
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
+        -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
+        -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
         -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
         -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
         -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}


[cmake] remove unless flag

[cmake] remove unless flag

--- cmake/CCompilerSetup.cmake
+++ cmake/CCompilerSetup.cmake
@@ -51,8 +51,6 @@
     add_c_options("-Werror=missing-declarations")
   endif()

-  add_c_options("-Werror=overloaded-virtual")
-
   # ubuntu (at least) build with those
   add_c_options("-Wformat=2")
   add_c_options("-Werror=format-security")


Adding back msvs stuff

Adding back msvs stuff

--- cmake/External_gtest.cmake
+++ cmake/External_gtest.cmake
@@ -26,6 +26,24 @@
 # for the set_target_properties call below, so make it to avoid an error
 file(MAKE_DIRECTORY ${GTEST_INCLUDES})

+# variables defining the import location properties for the generated gtest and
+# gtestmain libraries
+if (MSVC)
+    set(GTEST_IMPORTED_LOCATION
+        IMPORTED_LOCATION_DEBUG     "${GTEST_DIR}/Debug/${CMAKE_SHARED_LIBRARY_PREFIX}gtest${CMAKE_SHARED_LIBRARY_SUFFIX}"
+        IMPORTED_LOCATION_RELEASE   "${GTEST_DIR}/Release/${CMAKE_SHARED_LIBRARY_PREFIX}gtest${CMAKE_SHARED_LIBRARY_SUFFIX}"
+        )
+    set(GTESTMAIN_IMPORTED_LOCATION
+        IMPORTED_LOCATION_DEBUG     "${GTEST_DIR}/Debug/${CMAKE_SHARED_LIBRARY_PREFIX}gtest_main${CMAKE_SHARED_LIBRARY_SUFFIX}"
+        IMPORTED_LOCATION_RELEASE   "${GTEST_DIR}/Release/${CMAKE_SHARED_LIBRARY_PREFIX}gtest_main${CMAKE_SHARED_LIBRARY_SUFFIX}"
+        )
+else()
+    set(GTEST_IMPORTED_LOCATION
+        IMPORTED_LOCATION           "${GTEST_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest${CMAKE_SHARED_LIBRARY_SUFFIX}")
+    set(GTESTMAIN_IMPORTED_LOCATION
+        IMPORTED_LOCATION           "${GTEST_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}gtest_main${CMAKE_SHARED_LIBRARY_SUFFIX}")
+endif()
+
 # Create a libgtest target to be used as a dependency by test programs
 add_library(${CMAKE_SHARED_LIBRARY_PREFIX}gtest IMPORTED SHARED GLOBAL)
 add_dependencies(${CMAKE_SHARED_LIBRARY_PREFIX}gtest googletest-${gtest_version})


add openal-soft path for freebsd fixes #1026

--- cmake/FindOpenALSoft.cmake
+++ cmake/FindOpenALSoft.cmake
@@ -8,11 +8,16 @@
 IF(NOT APPLE)
   find_path(OPENALSOFT_INCLUDE_DIR al.h
     PATHS
-      /sw # Fink
-      /opt/local # DarwinPorts
-      /opt/csw # Blastwave
+      # Fink
+      /sw
+      # DarwinPorts
+      /opt/local
+      # Blastwave
+      /opt/csw
       /opt
-      # Linux Include PATH
+      # FreeBSD
+      /usr/local/include/AL
+      # Linux
       /usr/include/AL
       # Windows SDK Include PATH
       /include/AL
@@ -25,6 +30,7 @@
       /usr/local/opt/openal-soft/lib
       /lib
       /usr/lib
+      /usr/local/lib
   )
 ENDIF(NOT APPLE)


cmake: add some compiler macros

cmake: add some compiler macros

--- cmake/Modules/Macros.cmake
+++ cmake/Modules/Macros.cmake
@@ -52,3 +52,53 @@
     add_copy_target_file_step(${target} "${file}")
   endforeach()
 endfunction()
+
+#######################################################################################################################
+# compiler stuff
+#######################################################################################################################
+
+macro(add_compiler_flags)
+  set(flags_list "")
+  parse_arguments(ARG "" "C;CXX;DEBUG;RELEASE" ${ARGN})
+
+  if(NOT ARG_DEBUG AND NOT ARG_RELEASE)
+    foreach(flag ${ARG_DEFAULT_ARGS})
+      set(flags_list "${flags_list} ${flag}")
+    endforeach()
+    if(NOT ARG_C AND NOT ARG_CXX OR ARG_C)
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flags_list}")
+    endif()
+    if(NOT ARG_C AND NOT ARG_CXX OR ARG_CXX)
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flags_list}")
+    endif()
+  elseif(ARG_DEBUG)
+    foreach(flag ${ARG_DEFAULT_ARGS})
+      set(flags_list "${flags_list} ${flag}")
+    endforeach()
+    if(NOT ARG_C AND NOT ARG_CXX OR ARG_C)
+      set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${flags_list}")
+    endif()
+    if(NOT ARG_C AND NOT ARG_CXX OR ARG_CXX)
+      set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flags_list}")
+    endif()
+  elseif(ARG_RELEASE)
+    foreach(flag ${ARG_DEFAULT_ARGS})
+      set(flags_list "${flags_list} ${flag}")
+    endforeach()
+    if(NOT ARG_C AND NOT ARG_CXX OR ARG_C)
+      set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${flags_list}")
+      set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flags_list}")
+    endif()
+    if(NOT ARG_C AND NOT ARG_CXX OR ARG_CXX)
+      set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${flags_list}")
+      set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${flags_list}")
+    endif()
+  endif()
+endmacro()
+
+macro(add_linker_flags)
+  foreach(flag ${ARGN})
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag}")
+  endforeach()
+endmacro()


add -fms-extensions for compatibility with old GCC

--- cmake/Modules/cflags.cmake
+++ cmake/Modules/cflags.cmake
@@ -9,7 +9,14 @@
 	if(HAVE_C11)
 		set(SGHERM_C_STANDARD "-std=c11")
 	else()
-		set(SGHERM_C_STANDARD "-std=c99")
+		check_c_compiler_flag("-fms-extensions" HAVE_MS_EXTENSIONS)
+		if(HAVE_MS_EXTENSIONS)
+			# this allows us to use unnamed unions and is REQUIRED
+			# on NetBSD and OS X 10.4/10.5.
+			set(SGHERM_C_STANDARD "-std=c99 -fms-extensions")
+		else()
+			set(SGHERM_C_STANDARD "-std=c99")
+		endif()
 		message(WARNING "Your compiler does not support C11.  Things may break.")
 	endif()
 endmacro()


[siconos] master: 3.9.0 -> 4.1.0

[siconos] master: 3.9.0 -> 4.1.0

--- cmake/SiconosVersion.cmake
+++ cmake/SiconosVersion.cmake
@@ -1,6 +1,6 @@
 # --- set siconos current version ---
 # This file is also required for examples.
-set(MAJOR_VERSION 3)
-set(MINOR_VERSION 9)
+set(MAJOR_VERSION 4)
+set(MINOR_VERSION 1)
 set(PATCH_VERSION 0)
 set(SICONOS_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")


Install shaders when using occt

Install shaders when using occt

--- cmake/UseOpenCASCADE.cmake
+++ cmake/UseOpenCASCADE.cmake
@@ -52,6 +52,12 @@
   option(OpenCASCADE_STATIC_LIBS "Should be checked, if static OpenCASCADE libs are linked" OFF)

   message(STATUS "Found opencascade " ${OpenCASCADE_VERSION})
+
+  FIND_PATH(OpenCASCADE_SHADER_DIRECTORY
+            NAMES PhongShading.fs
+            PATH_SUFFIXES share/opencascade/resources/Shaders
+            HINTS ${CASROOT} ${OCE_INCLUDE_DIRS}/../../
+  )
 endif(OCE_FOUND)

 set_property(TARGET TKernel APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "Standard_EXPORT=")


Extend cmake hip_platform verify

Extend cmake hip_platform verify

--- cmake/VerifyCompiler.cmake
+++ cmake/VerifyCompiler.cmake
@@ -26,7 +26,7 @@
 # Find HIP package
 find_package(HIP 1.5.18263 REQUIRED) # 1.5.18263 is HIP version in ROCm 1.8.2

-if(HIP_PLATFORM STREQUAL "hcc")
+if(HIP_PLATFORM STREQUAL "hcc" OR HIP_PLATFORM STREQUAL "clang")
   if(NOT (CMAKE_CXX_COMPILER MATCHES ".*/hcc$" OR CMAKE_CXX_COMPILER MATCHES ".*/hipcc$"))
     message(FATAL_ERROR "On ROCm platform 'hcc' or 'clang' must be used as C++ compiler.")
   else()
@@ -58,5 +58,5 @@
     find_package(hip REQUIRED CONFIG PATHS /opt/rocm)
   endif()
 else()
-  message(FATAL_ERROR "HIP_PLATFORM must be 'hcc' (AMD ROCm platform)")
+  message(FATAL_ERROR "HIP_PLATFORM must be 'hcc' or 'clang' (AMD ROCm platform)")
 endif()


Improve CMake C/CXX/AS flag handling.

Improve CMake C/CXX/AS flag handling.

Convert the flag controlling functions to macros and omit the
FORCE argument from all the set() calls. The use of FORCE was
mainly intended to set the variable in all scopes, but using
macros instead of functions is a much cleaner method of achieving
the same goal.

--- cmake/compiler_flags.cmake
+++ cmake/compiler_flags.cmake
@@ -12,7 +12,7 @@
 # Checks C compiler for support of $c_flag. Adds $c_flag to $CMAKE_C_FLAGS when
 # the compile test passes. Caches $c_flag in $DRACO_FAILED_C_FLAGS when the test
 # fails.
-function (add_c_flag_if_supported c_flag)
+macro (add_c_flag_if_supported c_flag)
   unset(C_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_C_FLAGS}" "${c_flag}" C_FLAG_FOUND)
   unset(C_FLAG_FAILED CACHE)
@@ -23,18 +23,18 @@
     message("Checking C compiler flag support for: " ${c_flag})
     check_c_compiler_flag("${c_flag}" C_FLAG_SUPPORTED)
     if (C_FLAG_SUPPORTED)
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${c_flag}" CACHE STRING "" FORCE)
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${c_flag}" CACHE STRING "")
     else ()
       set(DRACO_FAILED_C_FLAGS "${DRACO_FAILED_C_FLAGS} ${c_flag}" CACHE STRING
-          "" FORCE)
-    endif ()
-  endif ()
-endfunction ()
+          "")
+    endif ()
+  endif ()
+endmacro ()

 # Checks C++ compiler for support of $cxx_flag. Adds $cxx_flag to
 # $CMAKE_CXX_FLAGS when the compile test passes. Caches $c_flag in
 # $DRACO_FAILED_CXX_FLAGS when the test fails.
-function (add_cxx_flag_if_supported cxx_flag)
+macro (add_cxx_flag_if_supported cxx_flag)
   unset(CXX_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_CXX_FLAGS}" "${cxx_flag}" CXX_FLAG_FOUND)
   unset(CXX_FLAG_FAILED CACHE)
@@ -45,25 +45,24 @@
     message("Checking CXX compiler flag support for: " ${cxx_flag})
     check_cxx_compiler_flag("${cxx_flag}" CXX_FLAG_SUPPORTED)
     if (CXX_FLAG_SUPPORTED)
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cxx_flag}" CACHE STRING ""
-          FORCE)
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${cxx_flag}" CACHE STRING "")
     else()
       set(DRACO_FAILED_CXX_FLAGS "${DRACO_FAILED_CXX_FLAGS} ${cxx_flag}" CACHE
-          STRING "" FORCE)
-    endif ()
-  endif ()
-endfunction ()
+          STRING "")
+    endif ()
+  endif ()
+endmacro ()

 # Convenience method for adding a flag to both the C and C++ compiler command
 # lines.
-function (add_compiler_flag_if_supported flag)
+macro (add_compiler_flag_if_supported flag)
   add_c_flag_if_supported(${flag})
   add_cxx_flag_if_supported(${flag})
-endfunction ()
+endmacro ()

 # Checks C compiler for support of $c_flag and terminates generation when
 # support is not present.
-function (require_c_flag c_flag update_c_flags)
+macro (require_c_flag c_flag update_c_flags)
   unset(C_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_C_FLAGS}" "${c_flag}" C_FLAG_FOUND)

@@ -76,14 +75,14 @@
               "${PROJECT_NAME} requires support for C flag: ${c_flag}.")
     endif ()
     if (update_c_flags)
-      set(CMAKE_C_FLAGS "${c_flag} ${CMAKE_C_FLAGS}" CACHE STRING "" FORCE)
-    endif ()
-  endif ()
-endfunction ()
+      set(CMAKE_C_FLAGS "${c_flag} ${CMAKE_C_FLAGS}" CACHE STRING "")
+    endif ()
+  endif ()
+endmacro ()

 # Checks CXX compiler for support of $cxx_flag and terminates generation when
 # support is not present.
-function (require_cxx_flag cxx_flag update_cxx_flags)
+macro (require_cxx_flag cxx_flag update_cxx_flags)
   unset(CXX_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_CXX_FLAGS}" "${cxx_flag}" CXX_FLAG_FOUND)

@@ -96,120 +95,117 @@
               "${PROJECT_NAME} requires support for CXX flag: ${cxx_flag}.")
     endif ()
     if (update_cxx_flags)
-      set(CMAKE_CXX_FLAGS "${cxx_flag} ${CMAKE_CXX_FLAGS}" CACHE STRING ""
-          FORCE)
-    endif ()
-  endif ()
-endfunction ()
+      set(CMAKE_CXX_FLAGS "${cxx_flag} ${CMAKE_CXX_FLAGS}" CACHE STRING "")
+    endif ()
+  endif ()
+endmacro ()

 # Checks for support of $flag by both the C and CXX compilers. Terminates
 # generation when support is not present in both compilers.
-function (require_compiler_flag flag update_cmake_flags)
+macro (require_compiler_flag flag update_cmake_flags)
   require_c_flag(${flag} ${update_cmake_flags})
   require_cxx_flag(${flag} ${update_cmake_flags})
-endfunction ()
+endmacro ()

 # Checks only non-MSVC targets for support of $c_flag and terminates generation
 # when support is not present.
-function (require_c_flag_nomsvc c_flag update_c_flags)
+macro (require_c_flag_nomsvc c_flag update_c_flags)
   if (NOT MSVC)
     require_c_flag(${c_flag} ${update_c_flags})
   endif ()
-endfunction ()
+endmacro ()

 # Checks only non-MSVC targets for support of $cxx_flag and terminates
 # generation when support is not present.
-function (require_cxx_flag_nomsvc cxx_flag update_cxx_flags)
+macro (require_cxx_flag_nomsvc cxx_flag update_cxx_flags)
   if (NOT MSVC)
     require_cxx_flag(${cxx_flag} ${update_cxx_flags})
   endif ()
-endfunction ()
+endmacro ()

 # Checks only non-MSVC targets for support of $flag by both the C and CXX
 # compilers. Terminates generation when support is not present in both
 # compilers.
-function (require_compiler_flag_nomsvc flag update_cmake_flags)
+macro (require_compiler_flag_nomsvc flag update_cmake_flags)
   require_c_flag_nomsvc(${flag} ${update_cmake_flags})
   require_cxx_flag_nomsvc(${flag} ${update_cmake_flags})
-endfunction ()
+endmacro ()

 # Adds $preproc_def to C compiler command line (as -D$preproc_def) if not
 # already present.
-function (add_c_preproc_definition preproc_def)
+macro (add_c_preproc_definition preproc_def)
   unset(PREPROC_DEF_FOUND CACHE)
   string(FIND "${CMAKE_C_FLAGS}" "${preproc_def}" PREPROC_DEF_FOUND)

   if (${PREPROC_DEF_FOUND} EQUAL -1)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D${preproc_def}" CACHE STRING ""
-        FORCE)
-  endif ()
-endfunction ()
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D${preproc_def}" CACHE STRING "")
+  endif ()
+endmacro ()

 # Adds $preproc_def to CXX compiler command line (as -D$preproc_def) if not
 # already present.
-function (add_cxx_preproc_definition preproc_def)
+macro (add_cxx_preproc_definition preproc_def)
   unset(PREPROC_DEF_FOUND CACHE)
   string(FIND "${CMAKE_CXX_FLAGS}" "${preproc_def}" PREPROC_DEF_FOUND)

   if (${PREPROC_DEF_FOUND} EQUAL -1)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${preproc_def}" CACHE STRING ""
-        FORCE)
-  endif ()
-endfunction ()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${preproc_def}" CACHE STRING "")
+  endif ()
+endmacro ()

 # Adds $preproc_def to C and CXX compiler command line (as -D$preproc_def) if
 # not already present.
-function (add_preproc_definition preproc_def)
+macro (add_preproc_definition preproc_def)
   add_c_preproc_definition(${preproc_def})
   add_cxx_preproc_definition(${preproc_def})
-endfunction ()
+endmacro ()

 # Adds $flag to assembler command line.
-function (append_as_flag flag)
+macro (append_as_flag flag)
   unset(AS_FLAG_FOUND CACHE)
   string(FIND "${DRACO_AS_FLAGS}" "${flag}" AS_FLAG_FOUND)

   if (${AS_FLAG_FOUND} EQUAL -1)
-    set(DRACO_AS_FLAGS "${DRACO_AS_FLAGS} ${flag}" CACHE STRING "" FORCE)
-  endif ()
-endfunction ()
+    set(DRACO_AS_FLAGS "${DRACO_AS_FLAGS} ${flag}" CACHE STRING "")
+  endif ()
+endmacro ()

 # Adds $flag to the C compiler command line.
-function (append_c_flag flag)
+macro (append_c_flag flag)
   unset(C_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_C_FLAGS}" "${flag}" C_FLAG_FOUND)

   if (${C_FLAG_FOUND} EQUAL -1)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" CACHE STRING "" FORCE)
-  endif ()
-endfunction ()
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" CACHE STRING "")
+  endif ()
+endmacro ()

 # Adds $flag to the CXX compiler command line.
-function (append_cxx_flag flag)
+macro (append_cxx_flag flag)
   unset(CXX_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_CXX_FLAGS}" "${flag}" CXX_FLAG_FOUND)

   if (${CXX_FLAG_FOUND} EQUAL -1)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" CACHE STRING "" FORCE)
-  endif ()
-endfunction ()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" CACHE STRING "")
+  endif ()
+endmacro ()

 # Adds $flag to the C and CXX compiler command lines.
-function (append_compiler_flag flag)
+macro (append_compiler_flag flag)
   append_c_flag(${flag})
   append_cxx_flag(${flag})
-endfunction ()
+endmacro ()

 # Adds $flag to the executable linker command line.
-function (append_exe_linker_flag flag)
+macro (append_exe_linker_flag flag)
   unset(LINKER_FLAG_FOUND CACHE)
   string(FIND "${CMAKE_EXE_LINKER_FLAGS}" "${flag}" LINKER_FLAG_FOUND)

   if (${LINKER_FLAG_FOUND} EQUAL -1)
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}" CACHE STRING
-        "" FORCE)
-  endif ()
-endfunction ()
+        "")
+  endif ()
+endmacro ()

 # Adds $flag to the link flags for $target.
 function (append_link_flag_to_target target flags)
@@ -233,7 +229,7 @@
 endfunction ()

 # Adds $flag to executable linker flags, and makes sure C/CXX builds still work.
-function (require_linker_flag flag)
+macro (require_linker_flag flag)
   append_exe_linker_flag(${flag})

   unset(c_passed)
@@ -244,6 +240,6 @@
   if (NOT c_passed OR NOT cxx_passed)
     message(FATAL_ERROR "Linker flag test for ${flag} failed.")
   endif ()
-endfunction ()
+endmacro ()

 endif ()  # DRACO_CMAKE_COMPILER_FLAGS_CMAKE_


Only use /usr/lib64 on x86_64, ia64 for example still uses /usr/lib

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -113,7 +113,7 @@
 #
 SET(INSTALL_BINDIR_RPM              "bin")
 SET(INSTALL_INCLUDEDIR_RPM          "include/mysql")
-IF(64BIT)
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
   SET(INSTALL_LIBDIR_RPM            "lib64")
 ELSE()
   SET(INSTALL_LIBDIR_RPM            "lib")


Fix the .deb package prefix.

Fix the .deb package prefix.

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -26,7 +26,7 @@
 #    Build as per default RPM layout, with prefix=/usr
 #
 #  DEB
-#    Build as per STANDALONE, prefix=/opt/mysql-$major.$minor
+#    Build as per STANDALONE, prefix=/opt/mysql/server-$major.$minor
 #
 #  SVR4
 #    Solaris package layout suitable for pkg* tools, prefix=/opt/mysql/mysql
@@ -74,7 +74,7 @@
   IF(INSTALL_LAYOUT MATCHES "RPM")
     SET(default_prefix "/usr")
   ELSEIF(INSTALL_LAYOUT MATCHES "DEB")
-    SET(default_prefix "/opt/${MYSQL_BASE_VERSION}")
+    SET(default_prefix "/opt/mysql/server-${MYSQL_BASE_VERSION}")
     # This is required to avoid "cpack -GDEB" default of prefix=/usr
     SET(CPACK_SET_DESTDIR ON)
   ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")


MDEV-6016 Packaging error with cmake 2.8.12 and greater

Avoid CPack complaints when a pdb file is missing for a static library
(patch from Vladislav Vaintroub)

--- cmake/install_macros.cmake
+++ cmake/install_macros.cmake
@@ -60,7 +60,11 @@
     IF(NOT comp)
       SET(comp Debuginfo_archive_only) # not in MSI
     ENDIF()
-    INSTALL(FILES ${pdb_location} DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp})
+	IF(type MATCHES "STATIC")
+	  # PDB for static libraries might be unsupported http://public.kitware.com/Bug/view.php?id=14600
+	  SET(opt OPTIONAL)
+	ENDIF()
+    INSTALL(FILES ${pdb_location} DESTINATION ${ARG_INSTALL_LOCATION} COMPONENT ${comp} ${opt})
   ENDFOREACH()
   ENDIF()
 ENDFUNCTION()


Provide NON_TRANSITIVE ON option only for the case of shared libraries.

For the internal static library case, transitive linking is used
regardless by CMake so the only effect of NON_TRANSITIVE ON for this
case would be non-transitive linking for pkg-config used by the
traditional build and test of the installed examples.  Such linking
can introduce inconsistencies with the linking and software library
detection of the core PLplot build.  So avoid that potential
inconsistency by simply not allowing NON_TRANSITIVE ON for the
static internal library build for PLplot.

svn path=/trunk/; revision=12066

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -37,11 +37,15 @@
   set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
 endif(FORCE_EXTERNAL_STATIC)

-# OFF means shared libraries (but never static libraries) are
-# transitively linked by default by CMake and also by pkg-config (used
-# to generate compile and link flags for the traditional build and
-# test system of the installed examples).
-option(NON_TRANSITIVE "Experimental option to try non-transitive linking" OFF)
+if(BUILD_SHARED_LIBS)
+  # OFF means shared libraries (but never static libraries) are
+  # transitively linked by default by CMake and also by pkg-config (used
+  # to generate compile and link flags for the traditional build and
+  # test system of the installed examples).
+  option(NON_TRANSITIVE "Experimental option to try non-transitive linking" OFF)
+else(BUILD_SHARED_LIBS)
+  set(NON_TRANSITIVE OFF CACHE BOOL "Experimental option to try non-transitive linking" FORCE)
+endif(BUILD_SHARED_LIBS)

 # Color maps (discrete and continuous) to use by default
 if(NOT DEFAULT_CMAP0_FILE)


support using nosetests with Python3

support using nosetests with Python3

--- cmake/test/nosetests.cmake
+++ cmake/test/nosetests.cmake
@@ -80,13 +80,20 @@
   catkin_run_tests_target("nosetests" ${output_file_name} "nosetests-${output_file_name}.xml" COMMAND ${cmd} DEPENDENCIES ${_nose_DEPENDENCIES} WORKING_DIRECTORY ${_nose_WORKING_DIRECTORY})
 endfunction()

-find_program(NOSETESTS nosetests)
-if(NOT nosetests_path)
-  # retry with name including major version number
-  find_program(NOSETESTS NAMES nosetests2 nosetests-2)
-endif()
-if(NOT NOSETESTS)
-  message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')")
+find_program(NOSETESTS NAMES
+  "nosetests${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+  "nosetests-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+  "nosetests${PYTHON_VERSION_MAJOR}"
+  "nosetests-${PYTHON_VERSION_MAJOR}"
+  "nosetests")
+if(NOSETESTS)
+  message(STATUS "Using Python nosetests: ${NOSETESTS}")
+else()
+  if("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
+    message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python3-nose')")
+  else()
+    message(WARNING "nosetests not found, Python tests can not be run (try installing package 'python-nose')")
+  endif()
 endif()

 macro(_strip_path_prefix var value prefix)


quote arguments

quote arguments

--- generate.cmake
+++ generate.cmake
@@ -8,13 +8,13 @@
 		get_filename_component(output "${CMAKE_CURRENT_BINARY_DIR}/${output}" ABSOLUTE)
 	endif()
 	add_custom_command(OUTPUT
-		${output}
+		"${output}"
 		COMMAND
-		${PYTHON_EXECUTABLE} ${script} > ${output}
+		${PYTHON_EXECUTABLE} ${script} > "${output}"
 		WORKING_DIRECTORY
-		${CMAKE_CURRENT_SOURCE_DIR}
+		"${CMAKE_CURRENT_SOURCE_DIR}"
 		DEPENDS
-		${CMAKE_CURRENT_SOURCE_DIR}/${script}
+		"${CMAKE_CURRENT_SOURCE_DIR}/${script}"
 		${ARGN})
 endfunction()
 function(generate_with_python_arg script arg output)
@@ -22,13 +22,13 @@
 		get_filename_component(output "${CMAKE_CURRENT_BINARY_DIR}/${output}" ABSOLUTE)
 	endif()
 	add_custom_command(OUTPUT
-		${output}
+		"${output}"
 		COMMAND
-		${PYTHON_EXECUTABLE} ${script} ${arg} > ${output}
+		${PYTHON_EXECUTABLE} ${script} ${arg} > "${output}"
 		WORKING_DIRECTORY
-		${CMAKE_CURRENT_SOURCE_DIR}
+		"${CMAKE_CURRENT_SOURCE_DIR}"
 		DEPENDS
-		${CMAKE_CURRENT_SOURCE_DIR}/${script}
+		"${CMAKE_CURRENT_SOURCE_DIR}/${script}"
 		${ARGN})
 endfunction()


fix install without static libzmq

fix install without static libzmq

If libzmq is only available as a shared library and not a static one
then cmake fails with:

-- CMake libzmq package not found, trying again with pkg-config (normal install of zeromq)
-- Found PkgConfig: /home/fabrice/buildroot/output/host/bin/pkg-config (found version "0.28")
CMake Error at CMakeLists.txt:20 (message):
  ZeroMQ was not found, neither as a CMake package nor via pkg-config

This is due to the fact that ZeroMQ_FOUND is not set to ON even if
ZEROMQ_LIBRARY is TRUE:

if(ZeroMQ_LIBRARY AND ZeroMQ_STATIC_LIBRARY)
    set(ZeroMQ_FOUND ON)
endif()

So change AND by OR as suggested in
https://github.com/zeromq/cppzmq/issues/266

Fix #266

Signed-off-by: Fabrice Fontaine <7d88633730b8b85c1516e612893df72eae9cd341@gmail.com>

--- libzmq-pkg-config/FindZeroMQ.cmake
+++ libzmq-pkg-config/FindZeroMQ.cmake
@@ -8,7 +8,7 @@
 find_library(ZeroMQ_STATIC_LIBRARY NAMES libzmq-static.a libzmq.a libzmq.dll.a
              PATHS ${PC_LIBZMQ_LIBDIR} ${PC_LIBZMQ_LIBRARY_DIRS})

-if(ZeroMQ_LIBRARY AND ZeroMQ_STATIC_LIBRARY)
+if(ZeroMQ_LIBRARY OR ZeroMQ_STATIC_LIBRARY)
     set(ZeroMQ_FOUND ON)
 endif()


Fix compiler flags for GCC

Fix compiler flags for GCC

This brings IREE closer to beeing build with GCC, see https://github.com/google/iree/issues/6#issuecomment-544168619. `-Wno-strict-prototypes` is supported by GCC in general, but only for C/Objective-C. Therefore, moving it to the CLANG flags.

Closes #159

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/159 from marbre:gcc_flags e01bb061ed3d955f98c1c9a979b4b7b4dd8aa327
PiperOrigin-RevId: 284778723

--- build_tools/cmake/iree_copts.cmake
+++ build_tools/cmake/iree_copts.cmake
@@ -27,19 +27,20 @@
 )

 iree_select_compiler_opts(IREE_DEFAULT_COPTS
-  CLANG_OR_GCC
+  CLANG
     "-Wno-strict-prototypes"
     "-Wno-shadow-uncaptured-local"
-    "-Wno-unused-parameter"
     "-Wno-gnu-zero-variadic-macro-arguments"
     "-Wno-shadow-field-in-constructor"
     "-Wno-unreachable-code-return"
-    "-Wno-undef"
     "-Wno-unused-private-field"
     "-Wno-missing-variable-declarations"
     "-Wno-gnu-label-as-value"
     "-Wno-unused-local-typedef"
     "-Wno-gnu-zero-variadic-macro-arguments"
+  CLANG_OR_GCC
+    "-Wno-unused-parameter"
+    "-Wno-undef"
   MSVC_OR_CLANG_CL
     "/DWIN32_LEAN_AND_MEAN"
     # TODO(benvanik): figure out if really required or accidentally enabled.
@@ -85,7 +86,7 @@
   "${CMAKE_CURRENT_SOURCE_DIR}/third_party/flatbuffers/include/"
 )
 iree_select_compiler_opts(FLATBUFFERS_COPTS
-  CLANG_OR_GCC
+  CLANG
     # Flatbuffers has a bunch of incorrect documentation annotations.
     "-Wno-documentation"
     "-Wno-documentation-unknown-command"


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/puffin-buffer/hunter.cmake
+++ cmake/projects/puffin-buffer/hunter.cmake
@@ -12,7 +12,7 @@
     VERSION
     "0.3.0.0"
     URL
-    "https://github.com/designerror/puffin-buffer/archive/v0.2.0.1.tar.gz"
+    "https://github.com/designerror/puffin-buffer/archive/v0.3.0.0.tar.gz"
     SHA1
     db1ffeacffea475c05e4bf7b829ebeba37a6288e
 )


scripts: Fix toolchain settings for new compiler on macOS.

--- scripts/toolchain.cmake
+++ scripts/toolchain.cmake
@@ -4,14 +4,12 @@
         set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
         set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
         set(CMAKE_ASM_COMPILER "arm-none-eabi-as")
+        set(CMAKE_RANLIB "arm-none-eabi-ranlib")
+        set(CMAKE_AR "arm-none-eabi-ar")

         set(COMMON_FLAGS "-mcpu=cortex-a8 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fno-common -ffunction-sections -fdata-sections -static -Wall -Wextra -nostartfiles -nostdinc")
         set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
         set(CMAKE_EXECUTABLE_SUFFIX ".elf")
-
-        # Set linker script.
-        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T ${COSMOS_BOARD_PATH}/${COSMOS_TARGET}/${COSMOS_TARGET}.ld")
-        set(CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE} "-s")

         # Set C compilation flags.
         set(CMAKE_C_FLAGS "${COMMON_FLAGS} -std=c11")
@@ -26,6 +24,17 @@
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcheck-new")                           # Allow returning nullptr from operator new.
         set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
         set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -Werror")
+
+        # Set linker flags.
+        if (APPLE)
+            # On macOS -search_paths_first linker flag breaks the build.
+            string(REPLACE "-Wl,-search_paths_first" "" CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS} )
+            string(REPLACE "-Wl,-search_paths_first" "" CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} )
+        endif()
+
+        # Set linker flags for creating executable.
+        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T ${COSMOS_BOARD_PATH}/${COSMOS_TARGET}/${COSMOS_TARGET}.ld")
+        set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s")
     endif()

     string(REGEX REPLACE ";" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
@@ -34,13 +43,20 @@
     string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
     string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
     string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+    string(REGEX REPLACE ";" " " CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS}")
+    string(REGEX REPLACE ";" " " CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
     string(REGEX REPLACE ";" " " CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
     string(REGEX REPLACE ";" " " CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")

     message(STATUS "Setting toolchain to:")
-    message(STATUS "  C compiler         : ${CMAKE_C_COMPILER}")
-    message(STATUS "  C++ compiler       : ${CMAKE_CXX_COMPILER}")
-    message(STATUS "  assembler          : ${CMAKE_ASM_COMPILER}")
-    message(STATUS "  C compiler flags   : ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
-    message(STATUS "  C++ compiler flags : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+    message(STATUS "  C compiler        : ${CMAKE_C_COMPILER}")
+    message(STATUS "  C++ compiler      : ${CMAKE_CXX_COMPILER}")
+    message(STATUS "  assembler         : ${CMAKE_ASM_COMPILER}")
+    message(STATUS "  ranlib            : ${CMAKE_RANLIB}")
+    message(STATUS "  ar                : ${CMAKE_AR}")
+    message(STATUS "  CFLAGS            : ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_DEBUG}")
+    message(STATUS "  CXXFLAGS          : ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+    message(STATUS "  C LDFLAGS         : ${CMAKE_C_LINK_FLAGS}")
+    message(STATUS "  C++ LDFLAGS       : ${CMAKE_CXX_LINK_FLAGS}")
+    message(STATUS "  C++ LDFLAGS (exe) : ${CMAKE_EXE_LINKER_FLAGS}")
 endmacro()


Added a dependency from on tests from test, to ensure that old results get cleaned prior to running tests, #1912

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -228,6 +228,10 @@
   add_custom_target(tests)
   # The 'test' target runs all but the future tests
   add_custom_target(test)
+  # We need to build tests before running them.  Addition of this
+  # dependency also ensures that old test results get cleaned prior to a
+  # new test run.
+  add_dependencies(test tests)
   # Clean out previous test results before running tests.  Use bash
   # conditional to ignore failures (most often happens when a stale NFS
   # handle lingers in the test results directory), because CMake doesn't


try std 0x for older compilers to see if it helps with a build issue

--- cmake/Modules/SetCXX2011Flag.cmake
+++ cmake/Modules/SetCXX2011Flag.cmake
@@ -30,11 +30,14 @@
 include(CheckCXXCompilerFlag)

 # Set support for C++ 2011
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
-CHECK_CXX_COMPILER_FLAG(-std=c++11 CXX_2011_FOUND)
-if(NOT CXX_2011_FOUND)
-  message(FATAL_ERROR "Your compiler does not support C++ 2011.")
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+if(COMPILER_SUPPORTS_CXX11)
+  message(STATUS "Compiler supports C++ 2011.")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+elseif(COMPILER_SUPPORTS_CXX0X)
+  message(STATUS "Compiler supports C++ 2011.")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
 else()
-  message(STATUS "Compiler supports C++ 2011.")
+  message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
 endif()
-


[CMake] Fix LLVMConfig.cmake not found

[CMake] Fix LLVMConfig.cmake not found

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -55,9 +55,8 @@
     NO_DEFAULT_PATH)

   # BEGIN Swift Mods
-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
+  set(LLVMCONFIG_FILE "${LLDB_PATH_TO_LLVM_BUILD}/lib/cmake/llvm/LLVMConfig.cmake")
   if(EXISTS ${LLVMCONFIG_FILE})
-    file(TO_CMAKE_PATH "${LLVM_CMAKE_PATH}" LLVM_CMAKE_PATH)
     list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
     include(${LLVMCONFIG_FILE})
   else()


Added guards if subversion isn't found.

Added guards if subversion isn't found.

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -47,14 +47,16 @@

 # Find the subversion revision.
 if (CMAKE_BUILD_TYPE MATCHES debug)
-    include(FindSubversion)
-    set(PROJECT_ROOT ${PROJECT_SOURCE_DIR})
-    if (IS_SYMLINK ${PROJECT_ROOT})
-        get_filename_component(PROJECT_ROOT ${PROJECT_ROOT} REALPATH)
-    endif()
-    Subversion_WC_INFO(${PROJECT_ROOT} SVN)
-    if (SVN_WC_REVISION)
-        set(OSKAR_SVN_REVISION ${SVN_WC_REVISION})
+    find_package(Subversion QUIET)
+    if (SUBVERSION_FOUND)
+        set(PROJECT_ROOT ${PROJECT_SOURCE_DIR})
+        if (IS_SYMLINK ${PROJECT_ROOT})
+            get_filename_component(PROJECT_ROOT ${PROJECT_ROOT} REALPATH)
+        endif()
+        Subversion_WC_INFO(${PROJECT_ROOT} SVN)
+        if (SVN_WC_REVISION)
+            set(OSKAR_SVN_REVISION ${SVN_WC_REVISION})
+        endif()
     endif()
 endif()


commented enumeration of warnings problems with Eigen

--- cmake/platforms/Darwin-clang.cmake
+++ cmake/platforms/Darwin-clang.cmake
@@ -21,14 +21,18 @@
     -Wno-documentation
     # Ignore unknown documentation command (There are nrecognized but valid doxygen commands !)
     -Wno-documentation-unknown-command
-    # Too many of sign conversion problems. Ignore them for the moment.
-    #-Wno-sign-
     # Ignore warnings about C++98 compatibility
     -Wno-c++98-compat
     # Ignore warnings about c++98 compat pedantic mode
     -Wno-c++98-compat-pedantic
     # Ignore warnings about C++11 extensions (cgogn is promoting c++11 )
     -Wno-c++11-extensions
+
+    # # Too many of sign conversion problems (Eigen!!!). Ignore them for the moment.
+    # -Wno-sign-conversion
+    # #
+    # -Wno-deprecated
+    # -Wno-old-style-cast
 )

 # Compile with full warnings by default


cmake: reformat

cmake: reformat

--- scripts/cmake/ElektraCache.cmake
+++ scripts/cmake/ElektraCache.cmake
@@ -422,9 +422,8 @@
 	GIT_EXECUTABLE
 	LIBGCRYPT_INCLUDE_DIR
 	XercesC_DIR
-	OPENSSL_INCLUDE_DIR
-)
-mark_as_advanced(
+	OPENSSL_INCLUDE_DIR)
+mark_as_advanced (
 	LUA_EXECUTABLE # The following settings are internal (not to be changed by users):
 	FEDORA
 	CARGO_EXECUTABLE
@@ -481,5 +480,4 @@
 	GLib_LIBRARY
 	LibGit2_VERSION_HEADER
 	libuv_VERSION_HEADER
-	Qt5Svg_DIR
-)
+	Qt5Svg_DIR)


Remove CMAKE_EXTRA_CONFIG_OPTIONS from itkexamples_common.cmake

Use dashboard_cache variable instead.

--- scripts/itkexamples_common.cmake
+++ scripts/itkexamples_common.cmake
@@ -40,7 +40,6 @@
 #   CTEST_TEST_TIMEOUT        = Per-test timeout length
 #   CTEST_TEST_ARGS           = ctest_test args (ex: PARALLEL_LEVEL 4)
 #   CMAKE_MAKE_PROGRAM        = Path to "make" tool to use
-#   CMAKE_EXTRA_CONFIGURE_OPTIONS = Extra options to pass to cmake when #   configuring, (ex: -DITK_DIR=/home/luis/bin/ITK)
 #
 # Options to configure builds from experimental git repository:
 #   dashboard_git_url      = Custom git clone url
@@ -397,7 +396,6 @@
     safe_message("Initial configure top level project...")
     set(options
       -DCTEST_USE_LAUNCHERS=${CTEST_USE_LAUNCHERS}
-      ${CMAKE_EXTRA_CONFIGURE_OPTIONS}
       )
     ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS "${options}")
     ctest_read_custom_files(${CTEST_BINARY_DIRECTORY})
@@ -419,7 +417,6 @@

       set(options
         ${disable_last_subproj}
-        ${CMAKE_EXTRA_CONFIGURE_OPTIONS}
         )
       set(disable_last_subproj -DModule_${subproj}:BOOL=OFF)
       ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS "${options}")
@@ -473,7 +470,6 @@
     safe_message("Final configure top level project...")
     set(options
       ${disable_last_subproj}
-      ${CMAKE_EXTRA_CONFIGURE_OPTIONS}
       )
     ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS "${options}")


[Build] Fixed a merge issue in the CMake configuration file.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -224,13 +224,7 @@
   #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)

   # Initialise the source package generator with the variables above
-=======
-    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD}")
-  #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)
-
-  # Initialise the source package generator with the variables above
   include (InstallRequiredSystemLibraries)
->>>>>>> trunk
   include (CPack)

   # Add a 'dist' target, similar to what is given by GNU Autotools


C API requires Boost.PropertyTree which is headers only

--- packages/Adapters/C_API/cmake/Dependencies.cmake
+++ packages/Adapters/C_API/cmake/Dependencies.cmake
@@ -5,5 +5,5 @@
     DataTransferKitBasicGeometryAdapters
   LIB_REQUIRED_TPLS
     MPI
-    BoostLib
+    Boost
   )


Revert FindDirectX and guard the win8 search path inside OGRE_BUILD_PLATFORM_WINRT

--HG--
branch : v1-9

--- CMake/Packages/FindDirectX.cmake
+++ CMake/Packages/FindDirectX.cmake
@@ -38,6 +38,17 @@
 	"$ENV{ProgramFiles}/Microsoft DirectX SDK*"
   )

+if(OGRE_BUILD_PLATFORM_WINRT)
+  # Windows 8 SDK has custom layout
+  set(DirectX_INC_SEARCH_PATH
+    "C:/Program Files (x86)/Windows Kits/8.0/Include/shared"
+    "C:/Program Files (x86)/Windows Kits/8.0/Include/um"
+  )
+  set(DirectX_LIB_SEARCH_PATH
+    "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um"
+  )
+endif()
+
   create_search_paths(DirectX)
   # redo search if prefix path changed
   clear_if_changed(DirectX_PREFIX_PATH
@@ -46,7 +57,6 @@
   )

   find_path(DirectX_INCLUDE_DIR NAMES d3d9.h HINTS ${DirectX_INC_SEARCH_PATH})
-
   # dlls are in DirectX_ROOT_DIR/Developer Runtime/x64|x86
   # lib files are in DirectX_ROOT_DIR/Lib/x64|x86
   if(CMAKE_CL_64)
@@ -59,6 +69,13 @@
   find_library(DirectX_DXERR_LIBRARY NAMES DxErr HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
   find_library(DirectX_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})

+
+  # look for dxgi (needed by both 10 and 11)
+  find_library(DirectX_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
+
+  # look for d3dcompiler (needed by 11)
+  find_library(DirectX_D3DCOMPILER_LIBRARY NAMES d3dcompiler HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
+
   findpkg_finish(DirectX)
   set(DirectX_LIBRARIES ${DirectX_LIBRARIES}
     ${DirectX_D3DX9_LIBRARY}
@@ -66,31 +83,17 @@
     ${DirectX_DXGUID_LIBRARY}
   )

+  mark_as_advanced(DirectX_D3DX9_LIBRARY DirectX_DXERR_LIBRARY DirectX_DXGUID_LIBRARY
+    DirectX_DXGI_LIBRARY DirectX_D3DCOMPILER_LIBRARY)
+
+
   # look for D3D11 components
   if (DirectX_FOUND)
-    find_library(DirectX_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
-
-    # Windows 8 SDK has custom layout
-    set(DirectX_INC_SEARCH_PATH
-	  "C:/Program Files (x86)/Windows Kits/8.0/Include/shared"
-	  "C:/Program Files (x86)/Windows Kits/8.0/Include/um"
-    )
-
-    set(DirectX_LIB_SEARCH_PATH
-	  "C:/Program Files (x86)/Windows Kits/8.0/Lib/win8/um"
-    )
-
-    # look for dxgi (needed by both 10 and 11)
-    find_library(DirectX_DXGI_LIBRARY NAMES dxgi HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
-
-    # look for d3dcompiler (needed by 11)
-    find_library(DirectX_D3DCOMPILER_LIBRARY NAMES d3dcompiler HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
-
     find_path(DirectX_D3D11_INCLUDE_DIR NAMES D3D11Shader.h HINTS ${DirectX_INC_SEARCH_PATH})
 	get_filename_component(DirectX_LIBRARY_DIR "${DirectX_LIBRARY}" PATH)
 	message(STATUS "DX lib dir: ${DirectX_LIBRARY_DIR}")
     find_library(DirectX_D3D11_LIBRARY NAMES d3d11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
-
+    find_library(DirectX_D3DX11_LIBRARY NAMES d3dx11 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
 	if (DirectX_D3D11_INCLUDE_DIR AND DirectX_D3D11_LIBRARY)
 	  set(DirectX_D3D11_FOUND TRUE)
 	  set(DirectX_D3D11_INCLUDE_DIR ${DirectX_D3D11_INCLUDE_DIR})
@@ -110,5 +113,4 @@
 	mark_as_advanced(DirectX_D3D11_INCLUDE_DIR DirectX_D3D11_LIBRARY DirectX_D3DX11_LIBRARY)
   endif ()

-  mark_as_advanced(DirectX_D3DX9_LIBRARY DirectX_DXERR_LIBRARY DirectX_DXGUID_LIBRARY DirectX_DXGI_LIBRARY DirectX_D3DCOMPILER_LIBRARY)
-endif(WIN32)
+endif(WIN32)


libchen: update

libchen: update

--- lib/libchen/cmake/ChenUtil.cmake
+++ lib/libchen/cmake/ChenUtil.cmake
@@ -35,17 +35,17 @@
     if(APPLE)
         execute_process(
                 COMMAND bash -c "system_profiler SPSoftwareDataType | perl -0 -pe 's/^.*System Version: ([^\n]+).*$/\\1/s'"
-                OUTPUT_VARIABLE version
+                OUTPUT_VARIABLE system
                 OUTPUT_STRIP_TRAILING_WHITESPACE
         )
-        add_definitions(-DCHEN_BUILD_SYSTEM="${version}")
+        add_definitions(-DCHEN_BUILD_SYSTEM="${system}")
     elseif(UNIX AND lsb_release)
         execute_process(
-                COMMAND lsb_release -d -s
-                OUTPUT_VARIABLE version
+                COMMAND bash -c "lsb_release -d -s | perl -0 -pe 's/^\"(.*)\"$/\\1/s'"
+                OUTPUT_VARIABLE system
                 OUTPUT_STRIP_TRAILING_WHITESPACE
         )
-        add_definitions(-DCHEN_BUILD_SYSTEM="${version}")
+        add_definitions(-DCHEN_BUILD_SYSTEM="${system}")
     else()
         add_definitions(-DCHEN_BUILD_SYSTEM="${CMAKE_SYSTEM}")
     endif()


incremented version to 1.1.1

incremented version to 1.1.1

--- version_config.cmake
+++ version_config.cmake
@@ -116,7 +116,7 @@
   set(DEFAULT_glog_TAG v035)

 else()
-  set(DEFAULT_SIRF_TAG v1.1.0)
+  set(DEFAULT_SIRF_TAG v1.1.1)

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


fix unix bundle

fix unix bundle

--- superbuild/Projects/unix/nuclearRGG.bundle.cmake
+++ superbuild/Projects/unix/nuclearRGG.bundle.cmake
@@ -45,11 +45,11 @@
 if(ENABLE_meshkit)
   set(meskit_loc)
   if(BUILD_WITH_CUBIT)
-    install(PROGRAMS ${install_location}/lib/RGGNuclear-GUI DESTINATION "lib")
+    install(PROGRAMS ${install_location}/lib/RGGNuclear DESTINATION "lib")
     install(CODE
       "execute_process(COMMAND
       ${CMAKE_COMMAND}
-        -Dexecutable:PATH=${install_location}/lib/RGGNuclear-GUI
+        -Dexecutable:PATH=${install_location}/lib/RGGNuclear
         -Ddependencies_root:PATH=${install_location}
         -Dpv_libraries_root:PATH=${install_location}/lib
         -Dcmb_libraries_root:PATH=${install_location}/lib


Fix superbuild when USE_SYSTEM_VTK is turned ON

When system VTK is used, there should not be any dependencies for ITK target to
VTK's one

--- superbuild/External-ITK.cmake
+++ superbuild/External-ITK.cmake
@@ -12,7 +12,11 @@
   set(git_protocol "http")
 endif()

-set( ITK_DEPENDENCIES VTK )
+set( ITK_DEPENDENCIES )
+
+if( ${USE_SYSTEM_VTK} MATCHES "OFF" )
+  set( ITK_DEPENDENCIES VTK ${ITK_DEPENDENCIES} )
+endif()

 if( ${USE_SYSTEM_HDF5} MATCHES "OFF" )
   set( ITK_DEPENDENCIES HDF5 ${ITK_DEPENDENCIES} )


COMP: Don't use MITK_USE variables of external projects in the setup script.

--- CMake/MITKDashboardSetup.cmake
+++ CMake/MITKDashboardSetup.cmake
@@ -48,17 +48,19 @@
 endif()

 set(OPENCV_DIR)
-if(WIN32 AND MITK_USE_OpenCV)
-  find_package(OpenCV REQUIRED CONFIG PATHS "${CTEST_BINARY_DIRECTORY}/ep")
-  set(_opencv_link_directories
-    "${OpenCV_LIB_DIR_DBG}"
-    "${OpenCV_LIB_DIR_OPT}"
-    "${OpenCV_3RDPARTY_LIB_DIR_DBG}"
-    "${OpenCV_3RDPARTY_LIB_DIR_OPT}")
-  list(REMOVE_DUPLICATES _opencv_link_directories)
-  foreach(_opencv_link_directory ${_opencv_link_directories})
-    list(APPEND OPENCV_DIR "${_opencv_link_directory}/../bin")
-  endforeach()
+if(WIN32)
+  find_package(OpenCV CONFIG PATHS "${CTEST_BINARY_DIRECTORY}/ep")
+  if(OpenCV_FOUND)
+    set(_opencv_link_directories
+      "${OpenCV_LIB_DIR_DBG}"
+      "${OpenCV_LIB_DIR_OPT}"
+      "${OpenCV_3RDPARTY_LIB_DIR_DBG}"
+      "${OpenCV_3RDPARTY_LIB_DIR_OPT}")
+    list(REMOVE_DUPLICATES _opencv_link_directories)
+    foreach(_opencv_link_directory ${_opencv_link_directories})
+      list(APPEND OPENCV_DIR "${_opencv_link_directory}/../bin")
+    endforeach()
+  endif()
 endif()

 #


Made sure TBTK_MATPLOTLIB_DO_NOT_FORCE_AGG is cleared from the cache each time cmake is executed.

--- CMake/Modules/FindPython.cmake
+++ CMake/Modules/FindPython.cmake
@@ -103,6 +103,7 @@
 		PYTHON_COMPILED
 	)
 	IF(${PYTHON_COMPILED})
+		UNSET(TBTK_MATPLOTLIB_DO_NOT_FORCE_AGG CACHE)
 		CHECK_CXX_SOURCE_RUNS(
 			"
 			#include <Python.h>


CMake: fall back to copying directories when symlinking fails on windows.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -117,27 +117,24 @@
         else ()
             unset (SLASH_D)
         endif ()
+        set (RESULT_CODE 1)
         if(${CMAKE_SYSTEM_VERSION} GREATER_EQUAL 6.0)
-            set (HAS_MKLINK ON)
-        endif ()
-        if (HAS_MKLINK)
             if (NOT EXISTS ${ABS_DESTINATION})
                 # Have to use string-REPLACE as file-TO_NATIVE_PATH does not work as expected with MinGW on "backward slash" host system
                 string (REPLACE / \\ BACKWARD_ABS_DESTINATION ${ABS_DESTINATION})
                 string (REPLACE / \\ BACKWARD_ABS_SOURCE ${ABS_SOURCE})
-                execute_process (COMMAND cmd /C mklink ${SLASH_D} ${BACKWARD_ABS_DESTINATION} ${BACKWARD_ABS_SOURCE} OUTPUT_QUIET ERROR_QUIET)
-            endif ()
-        elseif ("${ARGN}" STREQUAL FALLBACK_TO_COPY)
+                execute_process (COMMAND cmd /C mklink ${SLASH_D} ${BACKWARD_ABS_DESTINATION} ${BACKWARD_ABS_SOURCE} OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE RESULT_CODE)
+            endif ()
+        endif ()
+        if ("${RESULT_CODE}" NOT STREQUAL "0")
             if (SLASH_D)
                 set (COMMAND COMMAND ${CMAKE_COMMAND} -E copy_directory ${ABS_SOURCE} ${ABS_DESTINATION})
             else ()
                 set (COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ABS_SOURCE} ${ABS_DESTINATION})
             endif ()
             # Fallback to copy only one time
-            execute_process (${COMMAND})
-            if (TARGET ${TARGET_NAME})
-                # Fallback to copy every time the target is built
-                add_custom_command (TARGET ${TARGET_NAME} POST_BUILD ${COMMAND})
+            if (NOT EXISTS ${ABS_DESTINATION})
+                execute_process (${COMMAND})
             endif ()
         else ()
             message (WARNING "Unable to create symbolic link on this host system, you may need to manually copy file/dir from \"${SOURCE}\" to \"${DESTINATION}\"")


CMake: Remove no longer needed mingw workaround.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -575,24 +575,3 @@
     target_link_libraries(${TARGET} PRIVATE "--pre-js ${CMAKE_CURRENT_BINARY_DIR}/${RESOURCES}.load.js")
     add_dependencies(${TARGET} ${RESOURCES})
 endfunction ()
-
-# Configure for MingW
-if (CMAKE_CROSSCOMPILING AND MINGW)
-    # Symlink windows libraries and headers to appease some libraries that do not use all-lowercase names and break on
-    # case-sensitive file systems.
-    file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/workaround)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/windows.h workaround/Windows.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/shobjidl.h workaround/ShObjIdl.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/strsafe.h workaround/Strsafe.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/psapi.h workaround/Psapi.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/sddl.h workaround/Sddl.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/accctrl.h workaround/AccCtrl.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/aclapi.h workaround/Aclapi.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/oleidl.h workaround/OleIdl.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/include/shlobj.h workaround/Shlobj.h)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/lib/libws2_32.a workaround/libWs2_32.a)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/lib/libiphlpapi.a workaround/libIphlpapi.a)
-    create_symlink(/usr/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32/lib/libwldap32.a workaround/libWldap32.a)
-    include_directories(${CMAKE_BINARY_DIR}/workaround)
-    link_libraries(-L${CMAKE_BINARY_DIR}/workaround)
-endif ()


fixed cmake warning

fixed cmake warning

--- CMake/NeighborhoodSearch.cmake
+++ CMake/NeighborhoodSearch.cmake
@@ -31,7 +31,7 @@
 	   )

 	set(NEIGHBORHOOD_ASSEMBLY_NAME cuNSearch)
-	set(NEIGBORHOOD_SEARCH_LINK_DEPENDENCIES ${CUDA_LIBRARIES})
+	set(NEIGBORHOOD_SEARCH_LINK_DEPENDENCIES general ${CUDA_LIBRARIES})
 	add_compile_options(-DGPU_NEIGHBORHOOD_SEARCH)

 else(USE_GPU_NEIGHBORHOOD_SEARCH)
@@ -56,7 +56,7 @@
 set(NEIGHBORHOOD_SEARCH_LIBRARIES
 	optimized ${INSTALL_DIR}/lib/${LIB_PREFIX}${NEIGHBORHOOD_ASSEMBLY_NAME}${LIB_SUFFIX}
 	debug ${INSTALL_DIR}/lib/${LIB_PREFIX}${NEIGHBORHOOD_ASSEMBLY_NAME}_d${LIB_SUFFIX}
-	general ${NEIGBORHOOD_SEARCH_LINK_DEPENDENCIES}
+	${NEIGBORHOOD_SEARCH_LINK_DEPENDENCIES}
 )
 set(NEIGHBORHOOD_SEARCH_INCLUDE_DIR ${INSTALL_DIR}/include/)


Update QtTesting git tag : Fix crash when no Object found

--- CMakeExternals/QtTesting.cmake
+++ CMakeExternals/QtTesting.cmake
@@ -23,7 +23,7 @@

     if(NOT DEFINED QtTesting_DIR)

-      set(revision_tag 4c01c5e7cde0fdeae15c082c0cdd2efcb926675f)
+      set(revision_tag 7dbef1003157941e7315220f53cf4e17d78b5e28)
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


From Nico Kruithof, "I found that Collada wasn't found correctly with visual studio 2010."

--- CMakeModules/FindCOLLADA.cmake
+++ CMakeModules/FindCOLLADA.cmake
@@ -28,6 +28,8 @@
     SET(COLLADA_BUILDNAME "mac")
 ELSEIF(MINGW)
     SET(COLLADA_BUILDNAME "mingw")
+ELSEIF(MSVC10)
+    SET(COLLADA_BUILDNAME "vc10")
 ELSEIF(MSVC90)
     SET(COLLADA_BUILDNAME "vc9")
 ELSEIF(MSVC80)


DOC: Fix ExternalData REGEX option example documentation

Add missing "REGEX:" prefix on example option demonstrating the syntax.

Change-Id: If35c0aa381bd77b7a13e5bd130d936641c18c03c

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -84,8 +84,8 @@
 # by options using the syntax DATA{<name>,<opt1>,<opt2>,...}.  Each option may
 # specify one file by name or specify a regular expression to match file names
 # using the syntax REGEX:<regex>.  For example, the arguments
-#   DATA{MyData/MyInput.mhd,MyInput.img}             # File pair
-#   DATA{MyData/MyFrames00.png,MyFrames[0-9]+\\.png} # Series
+#   DATA{MyData/MyInput.mhd,MyInput.img}                   # File pair
+#   DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
 # will pass MyInput.mha and MyFrames00.png on the command line but ensure
 # that the associated files are present next to them.
 #


Fix to use public form of the module variable

Thanks to Utkarsh for spotting this. It would only work from inside VTK,
as VTK_MODULE_ prefixes are not defined in the "API" layer.

Change-Id: I660b8923023f54c700599eaf92afa4b4bcace881

--- CMake/vtkModuleAPI.cmake
+++ CMake/vtkModuleAPI.cmake
@@ -45,7 +45,7 @@
 # Loads the <module>_DEPENDS_INCLUDE_DIRS variable.
 macro(vtk_module_dep_includes mod)
   vtk_module_load("${mod}")
-  vtk_module_config(_dep ${VTK_MODULE_${mod}_DEPENDS})
+  vtk_module_config(_dep ${${mod}_DEPENDS})
   if(_dep_INCLUDE_DIRS)
     set(${mod}_DEPENDS_INCLUDE_DIRS ${_dep_INCLUDE_DIRS})
   endif()


Tell VTK to not use GLVND

Tell VTK to not use GLVND

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -60,6 +60,7 @@
     CMAKE_GENERATOR_PLATFORM ${gen_platform}
     CMAKE_ARGS
       ${ep_common_args}
+      -DOpenGL_GL_PREFERENCE:STRING=LEGACY
       -DVTK_ENABLE_WRAPPING:BOOL=OFF
       -DVTK_LEGACY_REMOVE:BOOL=ON
       -DVTK_MODULE_ENABLE_VTK_TestingRendering:STRING=YES


UPD: to set the color flags as part of the C default flags

--- CMakeLists.default.cmake
+++ CMakeLists.default.cmake
@@ -19,16 +19,16 @@

 if (CMAKE_COMPILER_IS_GNUCXX)
 	if (HAS_COMPILER_COLORS)
-		set(COMPILER_FLAGS_OPTS "-fdiagnostics-color=auto")
+		set(COMPILER_COLOR_FLAGS_OPTS "-fdiagnostics-color=auto")
 	else (HAS_COMPILER_COLORS)
-		set(COMPILER_FLAGS_OPTS "")
+		set(COMPILER_COLOR_FLAGS_OPTS "")
 	endif (HAS_COMPILER_COLORS)

-	set(CMAKE_C_FLAGS "-Wall -Wshadow -Wconversion -Wno-sign-conversion -pedantic-errors -fstrict-aliasing -fstack-protector-all -std=c99 ${CMAKE_USER_C_FLAGS}" CACHE STRING
+	set(CMAKE_C_FLAGS "-Wall -Wshadow -Wconversion -Wno-sign-conversion -pedantic-errors -fstrict-aliasing -fstack-protector-all -std=c99 ${COMPILER_COLOR_FLAGS_OPTS}  ${CMAKE_USER_C_FLAGS}" CACHE STRING
 		"Flags used by the compiler during all build types." FORCE
 	)

-	set(CMAKE_C_FLAGS_DEBUG "${COMPILER_FLAGS_OPTS} -g ${CMAKE_USER_C_FLAGS}"  CACHE STRING
+	set(CMAKE_C_FLAGS_DEBUG "-g ${CMAKE_USER_C_FLAGS}"  CACHE STRING
 		"Flags used by the compiler during debug build." FORCE
 	)


Install binaries to the right place

Install binaries to the right place

--- src/lio/cmake/LStoreCommon.cmake
+++ src/lio/cmake/LStoreCommon.cmake
@@ -116,6 +116,7 @@
     else()
         target_link_libraries(${f} ${library_lib})
     endif(WANT_STATIC)
+    install(TARGETS ${f} DESTINATION bin)
 endforeach(f)

 # Below is used for building packages


ENH (#2076): remove QmitkStdMultiWidget.ui

--- CoreUI/Qmitk/files.cmake
+++ CoreUI/Qmitk/files.cmake
@@ -58,7 +58,7 @@
 )
 SET(UI_FILES
 QmitkLevelWindowPresetDefinition.ui  QmitkLevelWindowWidget.ui
-QmitkLevelWindowRangeChange.ui        QmitkStdMultiWidget.ui
+QmitkLevelWindowRangeChange.ui
 )

 SET(RES_FILES


Fix cmake - based g++-version numbering for 2 digit versions.

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -23,11 +23,16 @@
 	)
 	STRING(STRIP ${CXX_COMPILER_VERSION} CXX_COMPILER_VERSION)

-	STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])" "\\1"
+	## just to make sure that the compiler version has 3 numbers and 2 dots
+	## (sometimes, g++ gives, e.g., 4.4 instead of 4.4.0)
+	STRING(REGEX REPLACE "^([0-9])\\.([0-9])$" "\\1.\\2.0"
+		CXX_COMPILER_VERSION ${CXX_COMPILER_VERSION})
+
+	STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])$" "\\1"
 		CXX_COMPILER_VERSION_MAJOR ${CXX_COMPILER_VERSION})
-	STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])" "\\2"
+	STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])$" "\\2"
 		CXX_COMPILER_VERSION_MINOR ${CXX_COMPILER_VERSION})
-	STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])" "\\3"
+	STRING(REGEX REPLACE "([0-9])\\.([0-9])\\.([0-9])$" "\\3"
 		CXX_COMPILER_VERSION_MINOR_MINOR ${CXX_COMPILER_VERSION})

 	## tr1 support in g++ often requires -std=c++0x


Turn GCC 5.x -Wdeprecated-declarations off

Eigen3 uses the deprecated std::binder2nd functor which
results in heavy warning spam whenever an Eigen3 header is included.

This disables the warning, as none of our code triggered it.

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -60,7 +60,9 @@
 		SET(USE_PEDANTIC OFF)
 	ENDIF()

-	ADD_DEFINITIONS(-Wall -Wextra -Wno-long-long)
+	# Added -Wno-deprecated-declarations as Eigen3 currently uses binder2nd
+	# which spams the compiler output.
+	ADD_DEFINITIONS(-Wall -Wextra -Wno-long-long -Wno-deprecated-declarations)

 	IF(USE_PEDANTIC)
 		ADD_BALL_DEFINITIONS("-pedantic")


Find yaml-cpp: Reformat file with `cmake-format`

--- cmake/Modules/Findyaml-cpp.cmake
+++ cmake/Modules/Findyaml-cpp.cmake
@@ -1,6 +1,7 @@
 # Try to find yaml-cpp
 # ====================

+# ~~~
 # Once done this will define
 #
 #  YAML-CPP_FOUND		System has yaml-cpp
@@ -8,20 +9,15 @@
 #  YAML-CPP_LIBRARIES		The libraries needed to use yaml-cpp
 #  YAML-CPP_VERSION		The version string of yaml-cpp
 #
-# This script is a modified version of the code available here:
-#	https://cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules
+# This script is a modified version of the code available here: https://cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules
+# ~~~

 find_package (PkgConfig)
 pkg_check_modules (PC_YAML-CPP QUIET yaml-cpp)

-find_path (YAML-CPP_INCLUDE_DIR
-	NAMES yaml-cpp/yaml.h
-	HINTS ${PC_YAML-CPP_INCLUDEDIR} ${PC_YAML-CPP_INCLUDE_DIRS}
-	PATH_SUFFIXES yaml-cpp)
+find_path (YAML-CPP_INCLUDE_DIR NAMES yaml-cpp/yaml.h HINTS ${PC_YAML-CPP_INCLUDEDIR} ${PC_YAML-CPP_INCLUDE_DIRS} PATH_SUFFIXES yaml-cpp)

-find_library (YAML-CPP_LIBRARY
-	NAMES yaml-cpp
-	HINTS ${PC_YAML-CPP_LIBDIR} ${PC_YAML-CPP_LIBRARY_DIRS})
+find_library (YAML-CPP_LIBRARY NAMES yaml-cpp HINTS ${PC_YAML-CPP_LIBDIR} ${PC_YAML-CPP_LIBRARY_DIRS})

 set (YAML-CPP_VERSION ${PC_YAML-CPP_VERSION})


Use NO_FILESYSTEM for emscripten compiles, for smaller js

--- cmake/emscripten.toolchain.cmake
+++ cmake/emscripten.toolchain.cmake
@@ -28,6 +28,7 @@
 set(EMSCRIPTEN_TOTAL_MEMORY_WORKER 16777216)
 set(EMSCRIPTEN_USE_MEMORY_INIT_FILE 1)
 set(EMSCRIPTEN_LTO_LEVEL 1)
+set(EMSCRIPTEN_NO_FILESYSTEM 1)

 # disable closure for now, as long as ANGLE_instanced_array support is not fully supported in emscripten
 set(EMSCRIPTEN_USE_CLOSURE 0)
@@ -59,6 +60,7 @@
 message("EMSCRIPTEN_ASSERTIONS: ${EMSCRIPTEN_ASSERTIONS}")
 message("EMSCRIPTEN_OUTLINING_LIMIT: ${EMSCRIPTEN_OUTLINING_LIMIT}")
 message("EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING: ${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING}")
+message("EMSCRIPTEN_NO_FILESYSTEM: ${EMSCRIPTEN_NO_FILESYSTEM}")

 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_SYSTEM_VERSION 1)
@@ -124,13 +126,13 @@
 set(CMAKE_C_FLAGS_PROFILING "-O3 -profiling")

 # linker flags
-set(CMAKE_EXE_LINKER_FLAGS "--memory-init-file ${EMSCRIPTEN_USE_MEMORY_INIT_FILE} -s WARN_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY} -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING}")
+set(CMAKE_EXE_LINKER_FLAGS "--memory-init-file ${EMSCRIPTEN_USE_MEMORY_INIT_FILE} -s WARN_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY} -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING} -s NO_FILESYSTEM=${EMSCRIPTEN_NO_FILESYSTEM}")
 set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O3 --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-O3 -g -s ASM_JS=1 -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE}")
 set(CMAKE_EXE_LINKER_FLAGS_PROFILING "-profiling -O3 --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT}")

 # dynamic lib linker flags
-set(CMAKE_SHARED_LINKER_FLAGS "-shared --memory-init-file 0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY_WORKER} -s BUILD_AS_WORKER=1 -s EXPORTED_FUNCTIONS=[\\\"_dowork\\\"] -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING}")
+set(CMAKE_SHARED_LINKER_FLAGS "-shared --memory-init-file 0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY_WORKER} -s BUILD_AS_WORKER=1 -s EXPORTED_FUNCTIONS=[\\\"_dowork\\\"] -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING} -s NO_FILESYSTEM=${EMSCRIPTEN_NO_FILESYSTEM}")
 set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-O3 --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "-O3 -g -s ASM_JS=1 -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} --closure 0")
 set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "-profiling -O3 --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT}")


[cmake] Pass LLVM_USE_LINKER flag when building host tools, e.g.,
LLVM_OPTIMIZED_TABLEGEN=ON, and not crosscompiling.

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

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

--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -14,6 +14,9 @@

   if (buildtype)
     set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
+  endif()
+  if (LLVM_USE_LINKER AND NOT CMAKE_CROSSCOMPILING)
+    set(linker_flag "-DLLVM_USE_LINKER=${LLVM_USE_LINKER}")
   endif()
   if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
     # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
@@ -32,7 +35,7 @@
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
         -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
-        ${build_type_flags} ${external_clang_dir}
+        ${build_type_flags} ${linker_flag} ${external_clang_dir}
     WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
     DEPENDS CREATE_LLVM_${target_name}
     COMMENT "Configuring ${target_name} LLVM...")


add arm64 support for M1 Mac

add arm64 support for M1 Mac

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -17,8 +17,12 @@
 function(get_swift_host_arch result_var_name)
   if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
     set("${result_var_name}" "x86_64" PARENT_SCOPE)
-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
-    set("${result_var_name}" "aarch64" PARENT_SCOPE)
+  elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "AArch64|aarch64|arm64")
+    if(CMAKE_SYSTEM_NAME MATCHES Darwin)
+      set("${result_var_name}" "arm64" PARENT_SCOPE)
+    else()
+      set("${result_var_name}" "aarch64" PARENT_SCOPE)
+    endif()
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64")
     set("${result_var_name}" "powerpc64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le")


Define realtime clock for systems not having one

--- cmake/posix/px4_impl_posix.cmake
+++ cmake/posix/px4_impl_posix.cmake
@@ -206,6 +206,7 @@
 	if (DARWIN_VERSION LESS 16)
 		list(APPEND added_definitions
 			-DCLOCK_MONOTONIC=1
+			-DCLOCK_REALTIME=0
 			-D__PX4_APPLE_LEGACY
 			)
 	endif()


fixed debug message

fixed debug message

--- cmake/safe_execute_process.cmake
+++ cmake/safe_execute_process.cmake
@@ -4,7 +4,7 @@
     set(_cmd "${_cmd} ${_arg}")
   endforeach()

-  debug_message(2 "execute_process(${cmd})")
+  debug_message(2 "execute_process(${_cmd})")
   execute_process(${ARGV} RESULT_VARIABLE _res)

   if(NOT _res EQUAL 0)


Fix build

Fix build

--- cmake/schemes/tests/common.cmake
+++ cmake/schemes/tests/common.cmake
@@ -3,10 +3,10 @@

 cmake_minimum_required(VERSION 2.8.8)

-include(${CMAKE_CURRENT_LIST_DIR}/utilities.cmake)
-
 set(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../..")
 include(${HUNTER_ROOT}/cmake/Hunter)
+
+include(${CMAKE_CURRENT_LIST_DIR}/utilities.cmake)

 # rewrite base for testing
 set(HUNTER_BASE ${PROJECT_BINARY_DIR}/_hunter_base)


Added llvm 6.0.0 to cmake_modules/FindLibClang.cmake

--- cmake_modules/FindLibClang.cmake
+++ cmake_modules/FindLibClang.cmake
@@ -14,7 +14,8 @@
 #               Known LLVM release numbers.

 # most recent versions come first
-set(LIBCLANG_KNOWN_LLVM_VERSIONS 5.0.1 5.0.0 5.0
+set(LIBCLANG_KNOWN_LLVM_VERSIONS 6.0.0 6.0
+  5.0.1 5.0.0 5.0
   4.0.1
   4.0.0_1 4.0.0 4.0
   3.9.1
@@ -63,7 +64,7 @@
 find_path(LIBCLANG_INCLUDE_DIR clang-c/Index.h
   PATHS ${libclang_llvm_header_search_paths}
   PATH_SUFFIXES LLVM/include #Windows package from http://llvm.org/releases/
-    llvm50/include llvm41/include llvm40/include llvm39/include llvm38/include llvm37/include llvm36/include # FreeBSD
+    llvm60/include llvm50/include llvm41/include llvm40/include llvm39/include llvm38/include llvm37/include llvm36/include # FreeBSD
   DOC "The path to the directory that contains clang-c/Index.h")

 # On Windows with MSVC, the import library uses the ".imp" file extension
@@ -77,7 +78,7 @@
 find_library(LIBCLANG_LIBRARY NAMES libclang.imp libclang clang
   PATHS ${libclang_llvm_lib_search_paths}
   PATH_SUFFIXES LLVM/lib #Windows package from http://llvm.org/releases/
-    llvm50/lib llvm41/lib llvm40/lib llvm39/lib llvm38/lib llvm37/lib llvm36/lib # FreeBSD
+    llvm60/lib llvm50/lib llvm41/lib llvm40/lib llvm39/lib llvm38/lib llvm37/lib llvm36/lib # FreeBSD
   DOC "The file that corresponds to the libclang library.")

 get_filename_component(LIBCLANG_LIBRARY_DIR ${LIBCLANG_LIBRARY} PATH)


Added LLVM version 3.8.0 installed by brew in OS X (#258)

--- cmake_modules/FindLibClang.cmake
+++ cmake_modules/FindLibClang.cmake
@@ -16,6 +16,7 @@
 # most recent versions come first
 set(LIBCLANG_KNOWN_LLVM_VERSIONS 3.9
   3.8.1
+  3.8.0
   3.8
   3.7.1
   3.7


trailing whitespace

trailing whitespace

--- test/testing.cmake
+++ test/testing.cmake
@@ -278,9 +278,9 @@
   if (PHASTA_CHEF_ENABLED)
     mpi_test(chefStream 1 ${CMAKE_CURRENT_BINARY_DIR}/chefStream
       WORKING_DIRECTORY ${MDIR})
-    set(cmd
-      ${CMAKE_BINARY_DIR}/phasta/bin/checkphasta
-      ${MDIR}/1-procs_case/
+    set(cmd
+      ${CMAKE_BINARY_DIR}/phasta/bin/checkphasta
+      ${MDIR}/1-procs_case/
       ${MESHES}/phasta/1-1-Chef-Tet-Part/good_phasta/
       0 1e-6)
     add_test(


option to not install npm

option to not install npm

--- projects/node.cmake
+++ projects/node.cmake
@@ -98,7 +98,7 @@
   set(nodeHdrs ${SOURCE_DIR}/src/*.h)
   set(uvDir ${SOURCE_DIR}/deps/uv/include)
   set(v8Hdrs ${SOURCE_DIR}/deps/v8/include/*.h)
-  set(nmpDir ${SOURCE_DIR}/deps/npm)
+  set(npmDir ${SOURCE_DIR}/deps/npm)
   set(XP_TARGET node_stage_hdrs)
   if(NOT TARGET ${XP_TARGET})
     ExternalProject_Add(${XP_TARGET} DEPENDS ${node_DEPS}
@@ -110,12 +110,15 @@
       INSTALL_COMMAND ${CMAKE_COMMAND} -Dsrc:STRING=${v8Hdrs}
         -Ddst:STRING=<INSTALL_DIR> -P ${MODULES_DIR}/cmscopyfiles.cmake
       )
-    # copy npm to STAGE_DIR
-    ExternalProject_Add_Step(${XP_TARGET} post_${XP_TARGET}
-      COMMAND ${CMAKE_COMMAND} -E make_directory ${STAGE_DIR}/node_modules/npm
-      COMMAND ${CMAKE_COMMAND} -E copy_directory ${nmpDir} ${STAGE_DIR}/node_modules/npm
-      DEPENDEES install
-      )
+    option(XP_PRO_NODE_NPM "copy npm to installer" ON)
+    if(XP_PRO_NODE_NPM)
+      # copy npm to STAGE_DIR
+      ExternalProject_Add_Step(${XP_TARGET} post_${XP_TARGET}
+        COMMAND ${CMAKE_COMMAND} -E make_directory ${STAGE_DIR}/node_modules/npm
+        COMMAND ${CMAKE_COMMAND} -E copy_directory ${npmDir} ${STAGE_DIR}/node_modules/npm
+        DEPENDEES install
+        )
+    endif()
     set_property(TARGET ${XP_TARGET} PROPERTY FOLDER ${bld_folder})
   endif()
 endfunction()


Fix unspecified dep libcryptsetup in CentOS/RHEL

`libcryptsetup` is a required runtime dependency.

Corresponding sections of provision files:

- [CentOS provision file](https://github.com/facebook/osquery/blob/8235fd155f25334e8edf21218491cc511853c17e/tools/provision/centos.sh#L73-L78)
- [RHEL provision file](https://github.com/facebook/osquery/blob/8235fd155f25334e8edf21218491cc511853c17e/tools/provision/rhel.sh#L94-L99)

CentOS 6
--------

[Demonstration of problem and work around.](https://gist.github.com/brandt/e32af345b63c339ddbdb#file-centos-6-log-L81)

Error message:

```
[root@b1a7318dbf3c /]# osqueryi
osqueryi: error while loading shared libraries: libcryptsetup.so.1: cannot open shared object file: No such file or directory
```

CentOS 7
--------

[Demonstration of problem and work around.](https://gist.github.com/brandt/e32af345b63c339ddbdb#file-centos-7-log-L314)

Error message:

```
[root@be01c8b1bb18 /]# osqueryi
osqueryi: error while loading shared libraries: libcryptsetup.so.4: cannot open shared object file: No such file or directory
```

--- CMake/Packages.cmake
+++ CMake/Packages.cmake
@@ -47,12 +47,14 @@
       set(PACKAGE_ITERATION "1.el6_6.5")
       set(PACKAGE_DEPENDENCIES
         "${PACKAGE_DEPENDENCIES}"
+        "cryptsetup-luks-libs"
         "libudev"
       )
     elseif(OSQUERY_BUILD_DISTRO STREQUAL "centos7")
       set(PACKAGE_ITERATION "1.el7_7.0")
       set(PACKAGE_DEPENDENCIES
         "${PACKAGE_DEPENDENCIES}"
+        "cryptsetup-libs"
       )
     endif()
   elseif(RHEL)
@@ -70,12 +72,14 @@
       set(PACKAGE_ITERATION "1.el6_6.5")
       set(PACKAGE_DEPENDENCIES
         "${PACKAGE_DEPENDENCIES}"
+        "cryptsetup-luks-libs"
         "libudev"
       )
     elseif(OSQUERY_BUILD_DISTRO STREQUAL "rhel7")
       set(PACKAGE_ITERATION "1.el7_7.0")
       set(PACKAGE_DEPENDENCIES
         "${PACKAGE_DEPENDENCIES}"
+        "cryptsetup-libs"
       )
     endif()
   endif()


Allow CPack generator to be set on the cmdline

Allow commandline Cpack generator setting arguments to override default so we are not forced to always build debs on rpm based systems or vise versa

--- src/lio/cmake/LStoreCommon.cmake
+++ src/lio/cmake/LStoreCommon.cmake
@@ -123,8 +123,12 @@
 # Below is used for building packages
 set(CPACK_PACKAGE_NAME "accre-${LSTORE_PROJECT_NAME}")
 set(CPACK_PACKAGE_VERSION "${LSTORE_PROJECT_VERSION}")
-set(CPACK_GENERATOR "RPM;DEB")
-set(CPACK_SOURCE_GENERATOR "RPM;DEB")
+if(NOT DEFINED CPACK_GENERATOR)
+    set(CPACK_GENERATOR "RPM;DEB")
+endif(NOT DEFINED CPACK_GENERATOR)
+if(NOT DEFINED CPACK_SOURCE_GENERATOR)
+    set(CPACK_SOURCE_GENERATOR "RPM;DEB")
+endif(NOT DEFINED CPACK_SOURCE_GENERATOR)
 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")


cmake/version: explicitly set defaults for returned variables

--- thrust/cmake/thrust-config-version.cmake
+++ thrust/cmake/thrust-config-version.cmake
@@ -13,14 +13,13 @@
 set(THRUST_VERSION "${THRUST_VERSION_MAJOR}.${THRUST_VERSION_MINOR}.${THRUST_VERSION_PATCH}.${THRUST_VERSION_TWEAK}")

 set(PACKAGE_VERSION ${THRUST_VERSION})
+set(PACKAGE_VERSION_COMPATIBLE FALSE)
+set(PACKAGE_VERSION_EXACT FALSE)
+set(PACKAGE_VERSION_UNSUITABLE FALSE)

-if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
-  set(PACKAGE_VERSION_COMPATIBLE FALSE)
-else()
+if(PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION)
   if(PACKAGE_FIND_VERSION_MAJOR STREQUAL THRUST_VERSION_MAJOR)
     set(PACKAGE_VERSION_COMPATIBLE TRUE)
-  else()
-    set(PACKAGE_VERSION_COMPATIBLE FALSE)
   endif()

   if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)


Use find_program to find compiler files

Use find_program to find compiler files

--- toolchain/Toolchain-Freescale-HC12.cmake
+++ toolchain/Toolchain-Freescale-HC12.cmake
@@ -20,11 +20,11 @@
 # Toolchain - Compilers, librarian (archiver) and linker.
 #              Piper is a Freescale command line tool that is used to redirect their GUI tools output to stdout.
 #
-SET (HC12_PIPER			 		"piper"		CACHE STRING "Freescale tool to capture GUI output to stdout")
-SET (CMAKE_C_COMPILER 	 		"chc12" 	CACHE STRING "Tool chain C compiler")
-SET (CMAKE_CXX_COMPILER	 		"chc12"		CACHE STRING "Tool chain C++ compiler")
-SET (CMAKE_AR 			 		"libmaker"	CACHE STRING "Tool chain library archiver")
-SET (CMAKE_LINKER 		 		"linker"	CACHE STRING "Tool chain linker")
+find_program(HC12_PIPER         NAMES piper)
+find_program(CMAKE_C_COMPILER   NAMES chc12)
+find_program(CMAKE_CXX_COMPILER NAMES chc12)
+find_program(CMAKE_AR           NAMES libmaker)
+find_program(CMAKE_LINKER       NAMES linker)

 #
 # We have to setup the object type very early, as this can't be overridden later on.


Bump pybind11 version from 2.2.1 to 2.2.4 (#2031)

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -525,7 +525,7 @@

 option (BUILD_PYBIND11_FORCE "Force local download/build of Pybind11 even if installed" OFF)
 option (BUILD_MISSING_PYBIND11 "Local download/build of Pybind11 if not installed" ON)
-set (BUILD_PYBIND11_VERSION "v2.2.1" CACHE STRING "Preferred pybind11 version, of downloading/building our own")
+set (BUILD_PYBIND11_VERSION "v2.2.4" CACHE STRING "Preferred pybind11 version, of downloading/building our own")
 set (PYBIND11_HOME "" CACHE STRING "Installed pybind11 location hint")

 macro (find_or_download_pybind11)


boards: px4_fmu-v5_optimized disable temperature_compensation to save flash

--- boards/px4/fmu-v5/optimized.cmake
+++ boards/px4/fmu-v5/optimized.cmake
@@ -37,7 +37,7 @@
 		imu/invensense/icm20602
 		imu/invensense/icm20689
 		imu/invensense/icm20948 # required for ak09916 mag
-		irlock
+		#irlock
 		lights # all available light drivers
 		#lights/rgbled_pwm
 		#magnetometer # all available magnetometer drivers
@@ -91,7 +91,7 @@
 		#rover_pos_control
 		sensors
 		#sih
-		temperature_compensation
+		#temperature_compensation
 		#uuv_att_control
 		#uuv_pos_control
 		#vmount


Fix gmock failure Pin to googletest 1.8.1


Fix missing ifdefs in amalgamated libhs.h

--- cmake/AmalgamateSourceFiles.cmake
+++ cmake/AmalgamateSourceFiles.cmake
@@ -45,18 +45,9 @@
             file(READ "${include_file_full}" include_content)
             string(REGEX REPLACE "\n$" "" include_content "${include_content}")

-            string(FIND "${include_content}" "#ifndef " offset_ifndef)
-            string(FIND "${include_content}" "#include " offset_include)
-            if(offset_ifndef EQUAL -1 AND offset_include EQUAL -1)
+            string(FIND "${include_content}" "#" offset)
+            if(offset EQUAL -1)
                 set(offset 0)
-            elseif(offset_include EQUAL -1)
-                set(offset ${offset_ifndef})
-            elseif(offset_ifndef EQUAL -1)
-                set(offset ${offset_include})
-            elseif(offset_include GREATER offset_ifndef)
-                set(offset ${offset_ifndef})
-            else()
-                set(offset ${offset_include})
             endif()
             string(SUBSTRING "${include_content}" ${offset} -1 include_content)
             string(REGEX REPLACE "(#include \"[a-zA-Z0-9\\.-_]+\")" "// \\1" include_content "${include_content}")


Enable c++11 for clang release builds

Enable c++11 for clang release builds

--- cmake/CMakeCompilerSettings.cmake
+++ cmake/CMakeCompilerSettings.cmake
@@ -7,6 +7,7 @@
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
     endif()
 elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
     # TODO figure clang stuff to enable test-coverage
     # Instrument Program flow should be set to Yes
     # http://stackoverflow.com/questions/7949781/undefined-symbols-for-architecture-i386-upgrading-project-to-ios-5


Fixing bug in cmake coveralls json writer

--- cmake/CoverallsGenerateGcov.cmake
+++ cmake/CoverallsGenerateGcov.cmake
@@ -388,6 +388,10 @@
 # as well, and generate JSON for those as well with 0% coverage.
 foreach(NOT_COVERED_SRC ${COVERAGE_SRCS_REMAINING})

+        file(MD5 "${NOT_COVERED_SRC}" GCOV_CONTENTS_MD5)
+        file(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${NOT_COVERED_SRC}")
+
+
 	# Loads the source file as a list of lines.
 	file(STRINGS ${NOT_COVERED_SRC} SRC_LINES)


[noetic-devel][Windows] Fix file COPY cannot read symlink (#1109)

* conditionally file copying on Windows.

* fix condition

Co-authored-by: Dirk Thomas <19795c8185177e940eedd30ceb2b716a54a3d5dc@users.noreply.github.com>

--- cmake/catkin_install_python.cmake
+++ cmake/catkin_install_python.cmake
@@ -40,7 +40,10 @@
         file(MAKE_DIRECTORY ${rewritten_file})
         # even though the content of the file is overwritten
         # the copy makes sure the file has the right permissions
-        file(COPY ${source_file} DESTINATION ${rewritten_file} USE_SOURCE_PERMISSIONS)
+        if(NOT WIN32 OR NOT IS_SYMLINK "${source_file}")
+          # CMake doesn't support copying symlinks on Windows
+          file(COPY ${source_file} DESTINATION ${rewritten_file} USE_SOURCE_PERMISSIONS)
+        endif()
         set(rewritten_file "${rewritten_file}/${filename}")
         file(WRITE ${rewritten_file} "${data}")
       else()


fix ninja not finding libsqlite3.a

fix ninja not finding libsqlite3.a

--- cmake/modules/Build-sqlite3.cmake
+++ cmake/modules/Build-sqlite3.cmake
@@ -5,6 +5,7 @@
 set(_byproducts
   ${SQLITE3_INSTALL_DIR}/lib/libsqlite3.lib
   ${SQLITE3_INSTALL_DIR}/lib/libsqlite3.so
+  ${SQLITE3_INSTALL_DIR}/lib/libsqlite3.a
 )

 ExternalProject_Add(


Don't set MLPACK_USE_64BIT_WORD when on a 32-bit system.

--- CMake/CreateArmaConfigInfo.cmake
+++ CMake/CreateArmaConfigInfo.cmake
@@ -13,7 +13,12 @@
 # If we are using Armadillo 5+, ARMA_64BIT_WORD is implicitly enabled.
 set(ARMA_HAS_64BIT_WORD 0) # This may be unnecessary.
 if(NOT (${ARMADILLO_VERSION_MAJOR} LESS 5))
-  set(ARMA_HAS_64BIT_WORD 1)
+  # ARMA_64BIT_WORD is only set if we are on a 64-bit system.
+  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(ARMA_HAS_64BIT_WORD 1)
+  else (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    set(ARMA_HAS_64BIT_WORD 0)
+  endif (CMAKE_SIZEOF_VOID_P EQUAL 8)
 else(NOT (${ARMADILLO_VERSION_MAJOR} LESS 5))
   # Otherwise, we'll need to open the config.hpp we are using and inspect the
   # setting of ARMA_64BIT_WORD.