[cmake] Remove dead set (i.e. LLVM_MAIN_INCLUDE_DIR already equals LLVM_MAIN_SRC_DIR/include).

rdar://26154980

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -228,7 +228,6 @@
     "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}" CACHE STRING
     "Version number that will be placed into the libclang library , in the form XX.YY")

-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_MAIN_SRC_DIR}/include")
   set(CLANG_MAIN_INCLUDE_DIR "${CLANG_MAIN_SRC_DIR}/include")
   set(CMARK_MAIN_INCLUDE_DIR "${CMARK_MAIN_SRC_DIR}/src")
   set(CMARK_BUILD_INCLUDE_DIR "${PATH_TO_CMARK_BUILD}/src")


cmake: Disable weak linking to "fix Symbol not found: _clock_gettime"

This commit was adapted from the work done by @sitsofe in
https://github.com/axboe/fio/pull/309/commits/ccf2d89d39b21bc8c7b497b40be5b82eadb80863

Description below was copied verbatim from the commit referenced above.

macOS 10.12 introduced support for clock_gettime() but when compiling
with Xcode 8 (or later) and targeting 10.11 (or older) the clock_gettime
symbol is now found at configure/compile time but referenced weakly.
Running the created binary on 10.11 results in a "dyld: lazy symbol
binding failed: Symbol not found: _clock_gettime" error.

Options for working around this issue include:

1. Turn references to functions that might be weak into compilation
   errors (-Werror=partial-availability).

2. Disable visibility of functions that might be weak at compile link
   time (-Wl,-no_weak_imports).

3. Change configure tests to directly check the targeted OSX version and
   fail the test if it is too old to have the required function.

4. Make an empty function declaration marked with
   __attribute__((weak_import)) that is used if the symbol would
   otherwise be unavailable. It is then possible to check if the symbol
   is NULL at runtime to determine availability.

This commit implements approach (2) when targeting the Darwin platform
after checking that the compiler/linker work with that option.

Co-authored-by: Sitsofe Wheeler <e18c5b5bfc46096909e8c59ff17640d7cfbe615a@yahoo.com>

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -1326,7 +1326,33 @@

 if(IS_PY3)

-check_function_exists(clock_getres HAVE_CLOCK_GETRES)
+if(APPLE)
+  cmake_push_check_state()
+  set(CMAKE_REQUIRED_FLAGS "-Wl,-no_weak_imports")
+  CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" SUPPORT_NO_WEAK_IMPORT_FLAG)
+  cmake_pop_check_state()
+else()
+  set(SUPPORT_NO_WEAK_IMPORT_FLAG 0)
+endif()
+
+cmake_push_check_state()
+set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/clock_getres.c)
+file(WRITE ${check_src} "
+#include <stdio.h>
+#include <time.h>
+int main() { return clock_getres(0, NULL); }
+")
+if(SUPPORT_NO_WEAK_IMPORT_FLAG)
+  set(CMAKE_REQUIRED_FLAGS "-Wl,-no_weak_imports")
+endif()
+python_platform_test(
+  HAVE_CLOCK_GETRES
+  "Checking for clock_getres"
+  ${check_src}
+  DIRECT
+  )
+cmake_pop_check_state()
+
 if(NOT HAVE_CLOCK_GETRES)
   cmake_push_check_state()
   set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/ac_cv_lib_rt_clock_getres.c)
@@ -1349,7 +1375,23 @@
   cmake_pop_check_state()
 endif()

-check_function_exists(clock_gettime HAVE_CLOCK_GETTIME)
+cmake_push_check_state()
+set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/clock_gettime.c)
+file(WRITE ${check_src} "
+#include <stdio.h>
+#include <time.h>
+int main() { return clock_gettime(0, NULL); }
+")
+if(SUPPORT_NO_WEAK_IMPORT_FLAG)
+  set(CMAKE_REQUIRED_FLAGS "-Wl,-no_weak_imports")
+endif()
+python_platform_test(
+  HAVE_CLOCK_GETTIME
+  "Checking for clock_gettime"
+  ${check_src}
+  DIRECT
+  )
+cmake_pop_check_state()
 if(NOT HAVE_CLOCK_GETTIME)
   cmake_push_check_state()
   set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/ac_cv_lib_rt_clock_gettime.c)


Travis fix

Travis fix

--- cmake/FindOpenImageIO.cmake
+++ cmake/FindOpenImageIO.cmake
@@ -14,7 +14,8 @@
 find_library(${setname}
   NAMES ${names}
   HINTS
-    ENV OIIO_DIR
+    ${OIIO_DIR}
+    ENV OIIO_HOME
   PATH_SUFFIXES lib
   PATHS
   ~/Library/Frameworks
@@ -30,7 +31,8 @@

 find_path(OIIO_INCLUDE_DIR OpenImageIO/version.h
   HINTS
-    ENV OIIO_DIR
+    ${OIIO_DIR}
+    ENV OIIO_HOME
   PATH_SUFFIXES include local/include
   PATHS
   ~/Library/Frameworks


Cleaned up even more messages from the MKL module

--- cmake/Modules/FindMKL.cmake
+++ cmake/Modules/FindMKL.cmake
@@ -61,7 +61,7 @@
     "Program Files (x86)/Intel/ComposerXE-2011/mkl"
 )

-MESSAGE("-- MKL_ROOT_DIR : ${MKL_ROOT_DIR}") # for debug
+#MESSAGE("-- MKL_ROOT_DIR : ${MKL_ROOT_DIR}") # for debug

 find_path(MKL_INCLUDE_DIR
   mkl_cblas.h
@@ -189,7 +189,7 @@
             set(MKL_${MODEVAR}_${THREADVAR}_LIBRARIES
                 ${MKL_${MODEVAR}_LIBRARY} ${MKL_${THREADVAR}_LIBRARY} ${MKL_CORE_LIBRARY}
                 ${MKL_LAPACK_LIBRARY} ${MKL_IOMP5_LIBRARY})
-            message("${MODEVAR} ${THREADVAR} ${MKL_${MODEVAR}_${THREADVAR}_LIBRARIES}") # for debug
+            #message("${MODEVAR} ${THREADVAR} ${MKL_${MODEVAR}_${THREADVAR}_LIBRARIES}") # for debug
         endif()
     endforeach()
 endforeach()


reorder compiler options to respect -Wno-sign-compare

-closes #3867

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -492,8 +492,8 @@
 	set(warnings
 		-Wall
 		-Werror
+		-Wextra
 		-Wno-sign-compare
-		-Wextra
 		#-Wshadow # very verbose due to eigen
 		-Wfloat-equal
 		-Wpointer-arith


cmake status message if MEMORY_DEBUG enabled

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -659,6 +659,7 @@
 	endif()

 	if ($ENV{MEMORY_DEBUG} MATCHES "1")
+		message(STATUS "address sanitizer enabled")
 		set(max_optimization -Os)

 		set(optimization_flags


[cmake] Change WIN32 test to CMAKE_HOST_WIN32

The test is about what can be run on the host, not the cmake target.
When cross-compiling (compiler-rt at least) on Windows, we end up with
lit being unable to run llvm-lit because it can't find the llvm-lit
module.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1283,7 +1283,7 @@
   endif()

   set(lit_file_name "llvm-lit")
-  if (WIN32 AND NOT CYGWIN)
+  if (CMAKE_HOST_WIN32 AND NOT CYGWIN)
     # llvm-lit needs suffix.py for multiprocess to find a main module.
     set(lit_file_name "${lit_file_name}.py")
   endif ()


[CMake] Forgot to quote the first part of STREQUAL.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -691,7 +691,7 @@
   string(TOUPPER ${nameUNDERSCORE} nameUPPER)
   #TODO: Remove this check in a few days once it has circulated through
   # buildbots and people's checkouts (cbieneman - July 14, 2015)
-  if(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
+  if("${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
     unset(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR CACHE)
   endif()
   if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR)


Fix resources/misc in FindLUG

Fix resources/misc in FindLUG

--- cmake/modules/FindLUG.cmake
+++ cmake/modules/FindLUG.cmake
@@ -60,29 +60,35 @@
 )

 # define the list of search paths for miscs
-set(FIND_LUG_MICS_PATHS
-    ${LUG_ROOT}
-    $ENV{LUG_ROOT}
-    $ENV{ANDROID_NDK}/sources/lugdunum
-    ${ANDROID_NDK}/sources/lugdunum
-    /usr/local/share/lug
+set(FIND_LUG_MISCS_PATHS
+    .
+    share/lug
 )

-# find the LUG include directory
-find_path(LUG_INCLUDE_DIR lug/Config.hpp
-          PATH_SUFFIXES include
-          PATHS ${FIND_LUG_PATHS}
-          CMAKE_FIND_ROOT_PATH_BOTH
+find_path(LUG_ROOT_DIR include/lug/Config.hpp
+               PATHS ${FIND_LUG_PATHS}
+               CMAKE_FIND_ROOT_PATH_BOTH
 )

-# find the LUG resources directory
-find_path(LUG_RESOURCES_DIR shaders
-          PATH_SUFFIXES resources
-          PATHS ${FIND_LUG_MICS_PATHS}
-          CMAKE_FIND_ROOT_PATH_BOTH
-)
+if(LUG_ROOT_DIR)
+    set(LUG_INCLUDE_DIR ${LUG_ROOT_DIR}/include)
+
+    find_path(LUG_MISC_DIR resources/shaders
+                PATH_SUFFIXES ${FIND_LUG_MISCS_PATHS}
+                PATHS ${LUG_ROOT_DIR}
+                CMAKE_FIND_ROOT_PATH_BOTH
+    )
+
+    if(LUG_MISC_DIR)
+        set(LUG_RESOURCES_DIR ${LUG_MISC_DIR}/resources)
+    endif()
+endif()

 set(LUG_FOUND TRUE) # will be set to false if one of the required modules is not found
+
+if(NOT LUG_INCLUDE_DIR)
+    set(LUG_FOUND FALSE)
+endif()

 if(LUG_OS_ANDROID)
     # this will append `lug-main` to the components to find if we are on WINDOWS or ANDROID


changes on FindJNI.cmake

changes on FindJNI.cmake

--- cmake_modules/FindJNI.cmake
+++ cmake_modules/FindJNI.cmake
@@ -101,6 +101,8 @@
   ${_JAVA_HOME}/jre/lib
   ${_JAVA_HOME}/lib
   ${_JAVA_HOME}
+  /usr/lib/jvm/java-6-openjdk/jre/lib
+  /usr/lib/jvm/java-6-openjdk-i386/jre/lib
   /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
   /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/{libarch}
   /usr/lib/jvm/java-6-openjdk-i386/jre/lib/{libarch}
@@ -139,6 +141,8 @@
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/include"
   "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\${java_install_version};JavaHome]/include"
   ${_JAVA_HOME}/include
+  /usr/lib/jvm/java-6-openjdk/jre/include
+  /usr/lib/jvm/java-6-openjdk-i386/jre/include
   /usr/include
   /usr/local/include
   /usr/lib/java/include


Added code to FindVTK so user could choose vtk 5.6 or 5.10.

--- cmake_modules/FindVTK.cmake
+++ cmake_modules/FindVTK.cmake
@@ -56,6 +56,8 @@
 # - Check in the LPS standard prerequisites location.
 #=============================================================================

+set(VERSION 5.6)
+#set(VERSION 5.10)
 # Assume not found.
 set(VTK_FOUND 0)

@@ -71,7 +73,7 @@
                    HINTS $ENV{HOME}/LPS/prerequisites/vtk $ENV{USERPROFILE}/LPS/prerequisites/vtk/lib)
 endif()

-
+if(VERSION MATCHES "5.10")

   # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.
   find_path(VTK_LIB_DIR
@@ -100,18 +102,55 @@
     # Help the user find it if we cannot.
     DOC "The ${VTK_DIR_DESCRIPTION}"
     )
+    get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
+    get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
+    set(VTK_BIN_DIR "${__TMP_DIR}/bin" CACHE PATH "VTK Runtime libraries location.")
+
+    get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
+    get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
+    set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.10" CACHE PATH "VTK Headers location.")

-get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
-get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
-set(VTK_BIN_DIR "${__TMP_DIR}/bin" CACHE PATH "VTK Runtime libraries location.")
+else()

-get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
-get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
-set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.10" CACHE PATH "VTK Headers location.")
+  # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.
+  find_path(VTK_LIB_DIR
+    NAMES UseVTK.cmake
+    PATH_SUFFIXES vtk-5.6 vtk
+    HINTS $ENV{VTK_LIB_DIR} $ENV{HOME}/LPS/prerequisites/vtk/lib $ENV{USERPROFILE}/LPS/prerequisites/vtk/lib

-#if(VTK_LIB_DIR)
-#    set(VTK_FOUND 1)
-#endif()
+    PATHS
+
+    # Support legacy cache files.
+    ${VTK_DIR_SEARCH_LEGACY}
+
+    # Read from the CMakeSetup registry entries.  It is likely that
+    # VTK will have been recently built.
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild1]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild2]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild3]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild4]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild5]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild6]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild7]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild8]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild9]
+    [HKEY_CURRENT_USER\\Software\\Kitware\\CMakeSetup\\Settings\\StartPath;WhereBuild10]
+
+    # Help the user find it if we cannot.
+    DOC "The ${VTK_DIR_DESCRIPTION}"
+    )
+    get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
+    get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
+    set(VTK_BIN_DIR "${__TMP_DIR}/bin" CACHE PATH "VTK Runtime libraries location.")
+
+    get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
+    get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
+    set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.6" CACHE PATH "VTK Headers location.")
+endif()
+
+if(VTK_LIB_DIR)
+    set(VTK_FOUND 1)
+endif()

 #-----------------------------------------------------------------------------
 if(VTK_FOUND)


clang also works with `-include`, while Android Studio's indexer gets confused when `-include-pch` is given

--- pch.cmake
+++ pch.cmake
@@ -267,11 +267,7 @@
         foreach( source ${target_sources} )
             get_source_file_property( old_flags ${source} COMPILE_FLAGS )
             if( NOT old_flags AND ${source} MATCHES ".*\\.c.+" )
-                if( ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" )
-                    set_source_files_properties( "${source}" PROPERTIES COMPILE_FLAGS "-include-pch ${GCH_PATH}/${PCH_NAME}.h.gch -Winvalid-pch" )
-                else()
-                    set_source_files_properties( "${source}" PROPERTIES COMPILE_FLAGS "-include ${GCH_PATH}/${PCH_NAME}.h -Winvalid-pch" )
-                endif()
+                set_source_files_properties( "${source}" PROPERTIES COMPILE_FLAGS "-include ${GCH_PATH}/${PCH_NAME}.h -Winvalid-pch" )
             endif()
         endforeach()
 #        target_compile_options( ${_targetName} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-include ${GCH_PATH}/${PCH_NAME}.h -Winvalid-pch> )


#1253 - OpenIGTLink code updated, changing revision tag

git-svn-id: f70d4c833b20674991d6651a5f592bbdbe6b47b2@8289 30ced1d1-d8fb-0310-b896-84269ee58dd6

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -34,7 +34,7 @@

 IF(NOT DEFINED OpenIGTLink_DIR)

-    SET(revision_tag 15bda37031)
+    SET(revision_tag 6b82eb37cb)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Bump TubeTK - Fix tube display

Bump TubeTK - Fix tube display

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "4f905cd2348d259d3ec0af3651838eb8e64e9c59"
+    GIT_TAG "dd4ee410f08ad78a96b7a598a12f75f57399b248"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


Don't use features from CMake > 2.8.4.

Don't use features from CMake > 2.8.4.

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

   if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-    set_property(TARGET ${name} APPEND_STRING PROPERTY COMPILE_FLAGS "-fPIC")
+    get_property(_compile_flags TARGET ${name} PROPERTY COMPILE_FLAGS)
+    set_property(TARGET ${name} PROPERTY COMPILE_FLAGS "${_compile_flags} -fPIC")
   endif()

   target_link_libraries(${name} ${US_LINK_LIBRARIES})


CI: try to detect error code > 0 for unit tests.

--- CTest.cmake
+++ CTest.cmake
@@ -57,5 +57,9 @@
 ctest_start("Continuous")
 # Added ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
 ctest_update()
-ctest_test()
+ctest_test(RETURN_VALUE RES)
 ctest_submit( PARTS Test Update )
+
+if (RES GREATER 0)
+  message(FATAL_ERROR "Unit tests have return code > 0")
+endif()


FIX (#4299): activate bundle

FIX (#4299): activate bundle

--- Modules/QmitkExt/files.cmake
+++ Modules/QmitkExt/files.cmake
@@ -103,8 +103,8 @@
  #QmitkOpeningToolGUI.cpp
  #QmitkClosingToolGUI.cpp
  #QmitkBinaryThresholdULToolGUI.cpp
- #QmitkToolRoiDataSelectionBox.cpp
- #QmitkBoundingObjectWidget.cpp
+ QmitkToolRoiDataSelectionBox.cpp
+ QmitkBoundingObjectWidget.cpp
 )

 IF ( NOT ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} VERSION_LESS 5.4.0 )
@@ -122,7 +122,7 @@
  QmitkBaseFunctionalityComponent.cpp
  QmitkFunctionalityComponentContainer.cpp
  QmitkFunctionalityComponents/QmitkThresholdComponent.cpp
- #QmitkToolWorkingDataSelectionBox.cpp
+ QmitkToolWorkingDataSelectionBox.cpp
  )
 ENDIF()

@@ -196,8 +196,8 @@
  #QmitkOpeningToolGUI.h
  #QmitkClosingToolGUI.h
  #QmitkBinaryThresholdULToolGUI.h
- #QmitkToolRoiDataSelectionBox.h
- #QmitkBoundingObjectWidget.h
+ QmitkToolRoiDataSelectionBox.h
+ QmitkBoundingObjectWidget.h
 )

 IF ( NOT ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} VERSION_LESS 5.4.0 )
@@ -215,7 +215,7 @@
  QmitkBaseFunctionalityComponent.h
  QmitkFunctionalityComponentContainer.h
  QmitkFunctionalityComponents/QmitkThresholdComponent.h
- #QmitkToolWorkingDataSelectionBox.h
+ QmitkToolWorkingDataSelectionBox.h
 )
 ENDIF()


Modify backup version

Modify backup version

The packages were named incorrectly, updating fallback version to see if that helps.

--- cmake/DetermineTomvizVersion.cmake
+++ cmake/DetermineTomvizVersion.cmake
@@ -7,7 +7,7 @@
 #   tomviz_version
 #   tomviz_version_long

-set(hardcoded_tomviz_version "1.3.1")
+set(hardcoded_tomviz_version "1.4.0")

 function(_set_version_vars versiontext)
   string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" version_matches "${versiontext}")


Don't try to guess svn version when current path is a symlink.

See PR 8473.

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

--- cmake/modules/VersionFromVCS.cmake
+++ cmake/modules/VersionFromVCS.cmake
@@ -4,9 +4,12 @@

 function(add_version_info_from_vcs VERS)
   set(result ${${VERS}})
-  if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.svn )
+  if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn" )
     set(result "${result}svn")
-    find_package(Subversion)
+    # FindSubversion does not work with symlinks. See PR 8437
+    if( NOT IS_SYMLINK "${CMAKE_CURRENT_SOURCE_DIR}" )
+      find_package(Subversion)
+    endif()
     if( Subversion_FOUND )
       subversion_wc_info( ${CMAKE_CURRENT_SOURCE_DIR} Project )
       if( Project_WC_REVISION )


OpenCV: disable modules with shared libraries

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -183,6 +183,10 @@
         BUILD_ZLIB=OFF
         BUILD_TIFF=OFF
         BUILD_PNG=OFF
+        # This stuff will build shared libraries. Build with PIC required for dependencies.
+        BUILD_opencv_java=OFF
+        BUILD_opencv_python2=OFF
+        BUILD_opencv_python3=OFF
 )

 # Pick a download scheme


make cmake find cuDNN on Mac OS

make cmake find cuDNN on Mac OS

dylib instead of so on OS X

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -174,11 +174,18 @@
             PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDA_TOOLKIT_INCLUDE}
             DOC "Path to cuDNN include directory." )

+  # dynamic libs have different suffix in mac and linux
+  if(APPLE)
+    set(CUDNN_LIB_NAME "libcudnn.dylib")
+  else()
+    set(CUDNN_LIB_NAME "libcudnn.so")
+  endif()
+
   get_filename_component(__libpath_hist ${CUDA_CUDART_LIBRARY} PATH)
-  find_library(CUDNN_LIBRARY NAMES libcudnn.so # libcudnn_static.a
-                             PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDNN_INCLUDE} ${__libpath_hist}
-                             DOC "Path to cuDNN library.")
-
+  find_library(CUDNN_LIBRARY NAMES ${CUDNN_LIB_NAME}
+   PATHS ${CUDNN_ROOT} $ENV{CUDNN_ROOT} ${CUDNN_INCLUDE} ${__libpath_hist} ${__libpath_hist}/../lib
+   DOC "Path to cuDNN library.")
+
   if(CUDNN_INCLUDE AND CUDNN_LIBRARY)
     set(HAVE_CUDNN  TRUE PARENT_SCOPE)
     set(CUDNN_FOUND TRUE PARENT_SCOPE)


Fix CMake link check for LLVM 3.9

Fix CMake link check for LLVM 3.9

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -619,7 +619,7 @@
        if( argc < 2 )
          exit(2);

-       llvm::LLVMContext &context = llvm::getGlobalContext();
+       llvm::LLVMContext context;
        llvm::SMDiagnostic err;
        std::unique_ptr<llvm::Module> module = llvm::parseIRFile( argv[1], err, context );


Use find_package for Python. Windows Store installed Python is then found.

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -197,10 +197,13 @@
     set_property(GLOBAL PROPERTY USE_FOLDERS ON)

     # check whether python is installed
-    find_program(PYTHON "python")
-    if (NOT PYTHON)
+    # find_package finds Windows Store installed Python. find_program does not.
+    find_package(Python)
+    if (NOT Python_FOUND)
         message(FATAL_ERROR "Python not found, required for code generation!")
     endif()
+
+    set(PYTHON ${Python_EXECUTABLE})

     # write empty YAML property tracking files
     fips_reset_targets_list()


cmake(java): Fix add_java_sample function


- изменён вывод

 - изменён вывод

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12168 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/bison.cmake
+++ rdo/packages/cmake/trunk/bison.cmake
@@ -20,7 +20,7 @@
 		COMMAND set BISON_PKGDATADIR=${BISON_FLEX_DIRECTORY}/share/bison
 		COMMAND ${BISON_EXECUTABLE} ARGS -g -v ${BISON_DEFINE} -p${BISON_NAME} -o ${GRAMMA_PATH}/rdogram${FILE_TYPE}.cpp ${GRAMMA_PATH}/rdo${FILE_TYPE}.y
 		DEPENDS ${GRAMMA_PATH}/rdo${FILE_TYPE}.y
-		COMMENT "[BISON][rdo${FILE_TYPE}.y] Building parser with bison ${BISON_VERSION}"
+		COMMENT "[BISON][rdo${FILE_TYPE}] Building parser with bison ${BISON_VERSION}"
 		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 	)
 ENDMACRO(RDO_BISON_TARGET)


Version: Update development date

Version: Update development date

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 4)
-set(CastXML_VERSION_PATCH 20210303)
+set(CastXML_VERSION_PATCH 20210304)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


MacOSX : ajout variable OTB_GLU_INCLUDE_PATH dans chemins et chemins INSTALL

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -113,6 +113,11 @@
   	        ${OTB_SOURCE_DIR}/Utilities/FLTK/src
   	        ${OTB_BINARY_DIR}/Utilities/FLTK )
 ENDIF(OTB_USE_EXTERNAL_FLTK)
+
+#For GLU header file
+SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
+  		${OTB_GLU_INCLUDE_PATH} )
+

 SET(OTB_INCLUDE_DIRS_BUILD_TREE_CXX ${OTB_INCLUDE_DIRS_BUILD_TREE_CXX}
@@ -181,6 +186,10 @@
         SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
   		        ${OTB_INSTALL_INCLUDE_DIR}/Utilities/FLTK)
 ENDIF(OTB_USE_EXTERNAL_FLTK)
+#For GLU header file
+SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}
+  		${OTB_GLU_INCLUDE_PATH} )
+

 IF(OTB_USE_EXTERNAL_ITK)
 	SET(OTB_INCLUDE_DIRS_INSTALL_TREE ${OTB_INCLUDE_DIRS_INSTALL_TREE}


COMP: link to projection/otb in ossim (temporary until SAR plugin integration)

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -45,6 +45,8 @@
   ${OTB_SOURCE_DIR}/Utilities/otbossim/include
   ${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim
   ${OTB_SOURCE_DIR}/Utilities/otbossimplugins
+  #Temporary until the SAR plugins are fully integrated:
+  ${OTB_SOURCE_DIR}/Utilities/otbossim/include/ossim/projection/otb
 # Add otbossimplugins/ossim/otb into the include directories path
   ${OTB_SOURCE_DIR}/Utilities/otbossimplugins/ossim/otb
   ${OTB_SOURCE_DIR}/Utilities/dxflib


Closes #1988

Closes #1988

--- Superbuild/QwtExternal.cmake
+++ Superbuild/QwtExternal.cmake
@@ -32,7 +32,7 @@
   "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
   )

-SET(qwt_GIT_TAG "origin/qt5-static")
+SET(qwt_GIT_TAG "origin/qt5-static-6.1.4")
 LIST(APPEND QWT_CACHE_ARGS
   "-DQt5_PATH:PATH=${Qt5_PATH}"
   "-DQt5Core_DIR:PATH=${Qt5Core_DIR}"


Don't use C++20 flags for clang-cl and AppleClang

--- test/MakeTestTarget.cmake
+++ test/MakeTestTarget.cmake
@@ -68,9 +68,7 @@
         endif()
         if( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0.0 )
             set( HAS_CPP17_FLAG TRUE )
-        endif()
-        if( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0.0 )
-            set( HAS_CPP20_FLAG TRUE )
+            set( HAS_CPPLATEST_FLAG TRUE )
         endif()
     else()
         message( STATUS "Matched: MSVC ${CMAKE_CXX_COMPILER_VERSION}" )
@@ -117,9 +115,6 @@
         endif()
         if( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.2.0 )
             set( HAS_CPP17_FLAG TRUE )
-        endif()
-        if( NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0.0 )
-            set( HAS_CPP20_FLAG TRUE )
         endif()

     # Clang: available -std flags depends on version


support mingw64, according to [Add partial support for building with MingW64 GCC 4.8-SEH.](https://github.com/LuaJIT/LuaJIT/commit/1a5fd521b830a8aa17c12d2e707d167722e8c7b1)

--- deps/luajit.cmake
+++ deps/luajit.cmake
@@ -64,8 +64,7 @@
 ENDIF()

 if ( WIN32 AND NOT CYGWIN )
-  add_definitions ( -DLUAJIT_OS=LUAJIT_OS_WINDOWS)
-  set ( LJVM_MODE coffasm )
+  set ( LJVM_MODE peobj )
 elseif ( APPLE )
   set ( CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000 ${CMAKE_EXE_LINKER_FLAGS}" )
   set ( LJVM_MODE machasm )
@@ -299,7 +298,7 @@
   )
 endmacro(add_buildvm_target)

-if (MSVC)
+if (WIN32)
   add_buildvm_target ( lj_vm.obj peobj )
   set (LJ_VM_SRC ${CMAKE_CURRENT_BINARY_DIR}/lj_vm.obj)
 else ()


fix shared version

fix shared version

--- logrotate/Options.cmake
+++ logrotate/Options.cmake
@@ -21,7 +21,13 @@
   MESSAGE("'OPTION: cmake -DBUILD_STATIC=ON'\nLinking statically with g3log. Creating static library for g3logrotate")
 ELSE()
   SET(G3LOG_LIBRARY_TYPE g3logger_shared)
-  SET(G3LOG_LIBRARY_NAME libg3logger_shared.so)
+
+  IF (MSVC)
+	SET(G3LOG_LIBRARY_NAME g3logger.lib)
+  ELSE()
+	SET(G3LOG_LIBRARY_NAME libg3logger_shared.so)
+  ENDIF()
+
   MESSAGE("'OPTION cmake -DBUILD_STATIC=ON'\nLinking dynamically with g3log. Creating dynamic library for g3logrotate")
 ENDIF()


removing duplicate BUILD_CI_CHECK reporting in summary

--- tools/cmake/summary.cmake
+++ tools/cmake/summary.cmake
@@ -99,7 +99,6 @@
     universal_status("")
     universal_status("  BUILD_C_API_LIB              :   ${BUILD_C_API_LIB}")
     universal_status("")
-    universal_status("  BUILD_CI_CHECK               :   ${BUILD_CI_CHECK}")
     universal_status("  BUILD_CMD_LINE_TOOLS         :   ${BUILD_CMD_LINE_TOOLS}")
     universal_status("  BUILD_EDUCATION_EXAMPLES     :   ${BUILD_EDUCATION_EXAMPLES}")
     universal_status("  BUILD_APPLICATION_EXAMPLES   :   ${BUILD_APPLICATION_EXAMPLES}")


STYLE: Add ifndef to SimpleITKBasicFiltersGeneratedHeaders.h

--- Code/BasicFilters/SourceCodeGenerator.cmake
+++ Code/BasicFilters/SourceCodeGenerator.cmake
@@ -67,7 +67,13 @@
 file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "" )
 file ( WRITE ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "" )

+# Add ifndefs
+file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#ifndef __SimpleITKBasicFiltersGeneratedHeaders_h\n")
+file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#define __SimpleITKBasicFiltersGeneratedHeaders_h\n")
+
 foreach ( filter ${GENERATED_FILTER_LIST} )
   file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#include \"sitk${filter}ImageFilter.h\"\n" )
   file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.i "%include \"sitk${filter}ImageFilter.h\"\n" )
 endforeach()
+
+file ( APPEND ${CMAKE_CURRENT_BINARY_DIR}/SimpleITKBasicFiltersGeneratedHeaders.h "#endif\n")


CMake: Added cmakedefine for HAVE_PTHREAD_H.

Patch by Robert Schuster!

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

--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -275,6 +275,9 @@

 /* Define to have the %a format string */
 #undef HAVE_PRINTF_A
+
+/* Have pthread.h */
+#cmakedefine HAVE_PTHREAD_H ${HAVE_PTHREAD_H}

 /* Have pthread_mutex_lock */
 #cmakedefine HAVE_PTHREAD_MUTEX_LOCK ${HAVE_PTHREAD_MUTEX_LOCK}


Fix CATKIN_INSTALL_INTO_PREFIX_ROOT for win32. (#1058)


removed stm discovery board.

removed stm discovery board.

Signed-off-by: Claudio Micheli <c3923186c4c9da9c766af46f22a325cd4677020a@auterion.com>

--- boards/stm/32f4discovery/default.cmake
+++ boards/stm/32f4discovery/default.cmake
@@ -1,106 +0,0 @@
-
-px4_add_board(
-	PLATFORM nuttx
-	VENDOR stm
-	MODEL 32f4discovery
-	TOOLCHAIN arm-none-eabi
-	ARCHITECTURE cortex-m4
-	ROMFSROOT px4fmu_common
-	#TESTING
-
-	DRIVERS
-		#barometer # all available barometer drivers
-		#batt_smbus
-		#camera_trigger
-		#differential_pressure # all available differential pressure drivers
-		#distance_sensor # all available distance sensor drivers
-		#gps
-		#heater
-		#imu # all available imu drivers
-		#irlock
-		#lights/blinkm
-		#lights/oreoled
-		#lights/rgbled
-		#magnetometer # all available magnetometer drivers
-		#mkblctrl
-		#pca9685
-		#pwm_input
-		#pwm_out_sim
-		#px4flow
-		#px4fmu
-		#rc_input
-		stm32
-		#stm32/adc
-		#stm32/tone_alarm
-		#tap_esc
-		#telemetry # all available telemetry drivers
-		#test_ppm
-		#uavcan
-
-	MODULES
-		attitude_estimator_q
-		camera_feedback
-		commander
-		dataman
-		ekf2
-		events
-		fw_att_control
-		fw_pos_control_l1
-		gnd_att_control
-		gnd_pos_control
-		land_detector
-		landing_target_estimator
-		load_mon
-		local_position_estimator
-		logger
-		mavlink
-		#mc_att_control
-		#mc_pos_control
-		#navigator
-		position_estimator_inav
-		#sensors
-		#vmount
-		#vtol_att_control
-		wind_estimator
-
-	SYSTEMCMDS
-		bl_update
-		config
-		dumpfile
-		esc_calib
-		hardfault_log
-		led_control
-		mixer
-		motor_ramp
-		motor_test
-		mtd
-		nshterm
-		param
-		perf
-		pwm
-		reboot
-		reflect
-		sd_bench
-		shutdown
-		#tests # tests and test runner
-		top
-		topic_listener
-		tune_control
-		usb_connected
-		ver
-
-	EXAMPLES
-		bottle_drop # OBC challenge
-		fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
-		hello
-		#hwtest # Hardware test
-		#matlab_csv_serial
-		#publisher
-		px4_mavlink_debug # Tutorial code from https://px4.io/dev/debug_values
-		px4_simple_app # Tutorial code from https://px4.io/dev/px4_simple_app
-		rover_steering_control # Rover example app
-		segway
-		#subscriber
-		uuv_example_app
-
-	)


Add run after build

Add run after build

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -132,6 +132,7 @@
 		"${TARGET}" ${ARGN})
 endmacro()

+option(SURGSIM_RUN_TEST_WITHIN_BUILD "This exectutes the tests directly from the chosen build system." OFF)
 # Build the unit test executable.
 # Uses UNIT_TEST_SOURCES, UNIT_TEST_HEADERS, LIBS, UNIT_TEST_SHARED_LIBS,
 # UNIT_TEST_SHARED_RELEASE_LIBS and UNIT_TEST_SHARED_DEBUG_LIBS.
@@ -140,6 +141,14 @@
 	add_executable(${TESTNAME} ${UNIT_TEST_SOURCES} ${UNIT_TEST_HEADERS})
 	target_link_libraries(${TESTNAME} SurgSimTesting gmock ${LIBS})
 	add_test(NAME ${TESTNAME} COMMAND ${TESTNAME} "--gtest_output=xml")
+
+	if(SURGSIM_RUN_TEST_WITHIN_BUILD)
+        add_custom_command(TARGET ${TESTNAME} POST_BUILD
+            COMMAND ${SURGSIM_TEST_RUN_PREFIX} $<TARGET_FILE:${TESTNAME}>
+                ${SURGSIM_TEST_RUN_SUFFIX}
+            VERBATIM)
+    endif()
+

 	# copy all ${UNIT_TEST_SHARED..._LIBS} to the test executable directory:
 	surgsim_copy_to_target_directory(${TESTNAME}


Adding test driver for python tests

Adding test driver for python tests

Change-Id: Ic4bd043694dfcd3ae871530efc8f6ecd459b3f4b

--- CMake/vtkTestingMacros.cmake
+++ CMake/vtkTestingMacros.cmake
@@ -169,9 +169,13 @@
     if(VTK_DATA_ROOT AND NOT ARGV1)
       add_test(NAME ${vtk-module}Python-${TName}
         COMMAND ${VTK_PYTHON_EXE}
+        ${VTK_SOURCE_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
         ${CMAKE_CURRENT_SOURCE_DIR}/${TName}.py
         -D ${VTK_DATA_ROOT}
-        -B ${VTK_DATA_ROOT}/Baseline/${ARGV1})
+        -T ${VTK_BINARY_DIR}/Testing/Temporary
+        -V Baseline/${ARGV1}/${TName}.png
+        -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+        -A "${VTK_LIBRARY_DIR}")
     else()
       add_test(NAME ${vtk-module}Python-${TName}
         COMMAND ${VTK_PYTHON_EXE}


Add dll option for lua

Add dll option for lua

--- CMakeModules/build_lua.cmake
+++ CMakeModules/build_lua.cmake
@@ -10,6 +10,10 @@
     SET(byproducts)
 ELSE()
     SET(byproducts BYPRODUCTS ${lua_location})
+ENDIF()
+
+IF(WIN32)
+    ADD_DEFINITIONS("-DLUA_DL_DLL")
 ENDIF()

 # FIXME Tag forge correctly during release


update sample user_options

update sample user_options

--- user_options_sample.cmake
+++ user_options_sample.cmake
@@ -41,3 +41,15 @@
     CACHE PATH "OpenCL lib path")

 ##############################################################################
+
+# Enable MPI
+SET (VSMC_ENABLE_MPI ON CACHE BOOL "Use MPI")
+# The path to mpiexec
+SET (VSMC_MPIEXEC "/usr/bin/mpiexec" CACHE STRING "mpiexec")
+
+##############################################################################
+
+# Disable checking features
+SET (RD_RAND_FOUND FALSE CACHE BOOL "NO RdRand")
+SET (RD_SEED_FOUND FALSE CACHE BOOL "NO RdSeed")
+SET (AESNI_FOUND   FALSE CACHE BOOL "NO AES-NI")


print arrow version

print arrow version

--- cmake/Templates/Arrow.CMakeLists.txt.cmake
+++ cmake/Templates/Arrow.CMakeLists.txt.cmake
@@ -8,13 +8,11 @@

 set(ARROW_VERSION "apache-arrow-0.7.1")

-message(STATUS "sdsffsf a ${ARROW_VERSION} b")
-
 if (NOT "$ENV{PARQUET_ARROW_VERSION}" STREQUAL "")
     set(ARROW_VERSION "$ENV{PARQUET_ARROW_VERSION}")
 endif()

-message(STATUS "sdsffsf a ${ARROW_VERSION} b")
+message(STATUS "Using Apache Arrow version: ${ARROW_VERSION}")

 set(ARROW_URL "https://github.com/apache/arrow/archive/${ARROW_VERSION}.tar.gz")


Just weird cmake stuff

Just weird cmake stuff

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -66,7 +66,7 @@
     string(REGEX REPLACE "\\-" "_" ${OUTVAR} "${name}")
 endmacro()

-macro(_find_package_for_lookup package REQUIRED QUIET DOWNLOAD CHECK)
+macro(_find_package_for_lookup package REQUIRED QUIET DOWNLOAD_BY_DEFAULT CHECK)
     string(TOUPPER "${package}" PACKAGE)
     set(recursive FALSE)
     _get_sane_name(${package} SANENAME)
@@ -79,14 +79,15 @@
     endif()
     # First try and find package (unless downloading by default)
     set(dolook TRUE)
-    if(DOWNLOAD AND NOT recursive)
-        if(CHECK)
-            set(do_rootchange TRUE)
-        endif()
+    if(NOT recursive)
+      if("${DOWNLOAD_BY_DEFAULT}" STREQUAL "TRUE")
         set(dolook FALSE)
-    endif()
-    if(${package}_NOFIND)
-        set(dolook FALSE)
+      else()
+        set(dolook TRUE)
+      endif()
+      if(CHECK)
+          set(do_rootchange TRUE)
+      endif()
     endif()
     # Figure out whether to add REQUIRED and QUIET keywords
     set(required "")
@@ -224,6 +225,20 @@
     else()
         set(${package}_KEEP FALSE)
     endif()
+    if(NOT ${package}_REQUIRED)
+      set(${package}_REQUIRED FALSE)
+    endif()
+    if(NOT ${package}_QUIET)
+      set(${package}_QUIET FALSE)
+    endif()
+    if(NOT ${package}_DOWNLOAD_BY_DEFAULT)
+      set(${package}_DOWNLOAD_BY_DEFAULT FALSE)
+    else()
+      set(${package}_DOWNLOAD_BY_DEFAULT TRUE)
+    endif()
+    if(NOT ${package}_CHECK_EXTERNAL)
+      set(${package}_CHECK_EXTERNAL FALSE)
+    endif()
     # users can request to download the package explicitly on the command-line
     if(LOOKUP_${package} OR LOOKUP_${PACKAGE})
         set(${package}_DOWNLOAD_BY_DEFAULT TRUE)
@@ -237,8 +252,8 @@
     endif()
     # First try and locate package
     _find_package_for_lookup(${package}
-        "${${package}_REQUIRED}" "${${package}_QUIET}"
-        "${${package}_DOWNLOAD_BY_DEFAULT}" "${${package}_CHECK_EXTERNAL}"
+        ${${package}_REQUIRED} ${${package}_QUIET}
+        ${${package}_DOWNLOAD_BY_DEFAULT} ${${package}_CHECK_EXTERNAL}
         ${${package}_UNPARSED_ARGUMENTS}
     )

@@ -278,7 +293,7 @@
     else()
         string(REGEX REPLACE "Look(u|U)p-?" "" recurse_name "${name}")
     endif()
-    set(found_var ${name}_FOUND)
+    set(found_var ${recurse_name}_FOUND)
     if(recursive_FOUND_VAR)
         set(found_var ${recursive_FOUND_VAR})
     endif()


Add optional components when finding packages in Lookup

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -219,7 +219,7 @@
     cmake_parse_arguments(${package}
         "DOWNLOAD_BY_DEFAULT;REQUIRED;QUIET;KEEP;NOFIND;CHECK_EXTERNAL"
         ""
-        "ARGUMENTS;COMPONENTS"
+        "ARGUMENTS;COMPONENTS;OPTIONAL_COMPONENTS"
         ${ARGN}
     )
     # Set explicitly to TRUE or FALSE to simplify setting
@@ -253,6 +253,10 @@
     if(${package}_COMPONENTS)
         list(APPEND ${package}_UNPARSED_ARGUMENTS COMPONENTS)
         list(APPEND ${package}_UNPARSED_ARGUMENTS ${${package}_COMPONENTS})
+    endif()
+    if(${package}_OPTIONAL_COMPONENTS)
+      list(APPEND ${package}_UNPARSED_ARGUMENTS OPTIONAL_COMPONENTS)
+      list(APPEND ${package}_UNPARSED_ARGUMENTS ${${package}_OPTIONAL_COMPONENTS})
     endif()
     # First try and locate package
     _find_package_for_lookup(${package}


[cmake] fix typo

[cmake] fix typo

--- cmake/CXXCompilerSetup.cmake
+++ cmake/CXXCompilerSetup.cmake
@@ -62,7 +62,7 @@
   # -- warnings to errors --
   add_cxx_options("-Werror=implicit-function-declaration")
   # should be supported only by Clang. The last statement is important, otherwise nothing compiles ...
-  add_cxx_options("-Werror=conversion -Wno-sign-conversion -Wno-error=sign-conversion Wno-shorten-64-to-32 -Wno-error=shorten-64-to-32")
+  add_cxx_options("-Werror=conversion -Wno-sign-conversion -Wno-error=sign-conversion -Wno-shorten-64-to-32 -Wno-error=shorten-64-to-32")
   # ADD_C_OPTIONS("-Wno-error=shorten-64-to-32") # for clang
   add_cxx_options("-Werror=switch-bool")
   add_cxx_options("-Werror=logical-not-parentheses")


Fix #160

Fix #160

Looking at 'return()' documentation in cmake, i.e.

$ cmake --help-command return
return
------

Return from a file, directory or function.

::

 return()

Returns from a file, directory or function.  When this command is
encountered in an included file (via include() or find_package()), it
causes processing of the current file to stop and control is returned
to the including file.  If it is encountered in a file which is not
included by another file, e.g.  a CMakeLists.txt, control is returned
to the parent directory if there is one.  If return is called in a
function, control is returned to the caller of the function.  Note
that a macro is not a function and does not handle return like a
function does.

call to 'return()' in a macro explains the error, it would return after each call
and files would never get installed.

instead of using a macro, we now use a function.

Co-Authored-By: Stefan Schlager <64972db2a6de30f5c3a8a96596a8f5e3bce0fc11@gmail.com>

--- cmake/ModuleHeaderTest.cmake
+++ cmake/ModuleHeaderTest.cmake
@@ -19,7 +19,7 @@
   ${CMAKE_COMMAND} --build ${statismo_BINARY_DIR}
   COMMENT "Regenerating and building the header tests." )

-macro( module_headertest _name )
+function( module_headertest _name )
   if( NOT ${BUILD_TESTING} )
     return()
   endif()
@@ -98,4 +98,4 @@
       math( EXPR _test_num "${_test_num} + 1" )
     endforeach()
   endif()
-endmacro()
+endfunction()


Remove FindBlas as it is built-in

Remove FindBlas as it is built-in

--- cmake/Modules/FindBlas.cmake
+++ cmake/Modules/FindBlas.cmake
@@ -1,29 +0,0 @@
-# - Find BLAS
-# Find the BLAS includes and library
-#
-#  BLAS_INCLUDES    - where to find cblas.h/Accelerate.h/clblas.h
-#  BLAS_LIBRARIES   - List of libraries when using BLAS.
-#  BLAS_FOUND       - True if BLAS found.
-
-include (FindPackageHandleStandardArgs)
-
-if (APPLE)
-  find_path (BLAS_INCLUDES_PRE Accelerate.h)
-  find_library (BLAS_LIBRARIES_PRE NAMES Accelerate)
-else ()
-  find_path (BLAS_INCLUDES_PRE cblas.h)
-  find_library (BLAS_LIBRARIES_PRE NAMES cblas)
-endif ()
-
-# handle the QUIETLY and REQUIRED arguments and set BLAS_FOUND to TRUE if
-# all listed variables are TRUE
-
-set (BLAS_LIBRARIES ${BLAS_LIBRARIES_PRE})
-if (BLAS_INCLUDES_PRE)
-  set (BLAS_INCLUDES ${BLAS_INCLUDES_PRE})
-  set (BLAS_FOUND TRUE CACHE INTERNAL "")
-endif ()
-
-find_package_handle_standard_args (BLAS DEFAULT_MSG BLAS_LIBRARIES BLAS_INCLUDES)
-
-mark_as_advanced (BLAS_LIBRARIES BLAS_INCLUDES)


build: clean up dead code

build: clean up dead code

This is not used currently and is unlikely to be needed in the future as well.
Remove the dead code.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -74,15 +74,6 @@
   else()
     set(${out_var} FALSE PARENT_SCOPE)
   endif()
-endfunction()
-
-function(is_windows_based_sdk sdk_name out_var)
-  if("${sdk_name}" STREQUAL "WINDOWS" OR
-     "${sdk_name}" STREQUAL "CYGWIN")
-   set(${out_var} TRUE PARENT_SCOPE)
- else()
-   set(${out_var} FALSE PARENT_SCOPE)
- endif()
 endfunction()

 # Usage:


[build] Fix 16K segment alignment on iOS.

Swift SVN r25628

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -94,6 +94,24 @@
   set("${result_var_name}" "${result}" PARENT_SCOPE)
 endfunction()

+
+# Use 16K segment alignment on 32-bit arm.
+# The linker does this by default for iOS 8+ deployment,
+# but we deploy to iOS 7.
+function(append_darwin_segalign_link_flags
+    arch result_var_name)
+  set(result ${${result_var_name}})
+
+  string(FIND "${arch}" "arm" armprefix)
+  if ("${armprefix}" STREQUAL "0" AND NOT "${arch}" STREQUAL "arm64")
+    # arch starts with "arm" and is not "arm64"
+    list(APPEND result "-Xlinker" "-segalign" "-Xlinker" "0x4000")
+  endif()
+
+  set("${result_var_name}" "${result}" PARENT_SCOPE)
+endfunction()
+
+
 function(_add_variant_c_compile_link_flags
     sdk arch build_type enable_assertions result_var_name)
   set(result ${${result_var_name}})
@@ -107,6 +125,8 @@
         "-arch" "${arch}"
         "-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks"
         "-m${SWIFT_SDK_${sdk}_VERSION_MIN_NAME}-version-min=${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION}")
+
+    append_darwin_segalign_link_flags("${arch}" result)
   endif()

   set("${result_var_name}" "${result}" PARENT_SCOPE)
@@ -162,13 +182,8 @@
   if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
     list(APPEND result
         "-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks")
-  endif()
-
-  # Use 16K segment alignment on 32-bit arm.
-  # The linker does this by default for iOS 8+ deployment,
-  # but we deploy to iOS 7.
-  if("${arch}" STREQUAL "armv7")
-    list(APPEND result "-Xlinker" "-segalign" "-Xlinker" "0x4000")
+
+    append_darwin_segalign_link_flags("${arch}" result)
   endif()

   is_build_type_optimized("${build_type}" optimized)


fix GenLexer cmake module

fix GenLexer cmake module

--- cmake/modules/GenLexer.cmake
+++ cmake/modules/GenLexer.cmake
@@ -37,6 +37,7 @@
     separate_arguments(option)

     add_custom_command(OUTPUT ${lexer_src}
-            COMMAND ${RE2C_BIN} ${option} -o ${lexer_src} ${GL_ARGS_SOURCE_FILE})
+            COMMAND ${RE2C_BIN} ${option} -o ${lexer_src} ${GL_ARGS_SOURCE_FILE}
+            MAIN_DEPENDENCY ${GL_ARGS_SOURCE_FILE})
     add_custom_target(${GL_ARGS_TARGET} DEPENDS ${lexer_src})
 endfunction()


cmake: Replaced CMAKE_CURRENT_SOURCE_DIR with CMAKE_SOURCE_DIR

cr_add_subproejct didn't work correctly when Criterion was used as a git
submoudle in another project as follows.

    $ cd my_git_project
    $ mkdir vendor
    $ git submodule add \
        https://github.com/Snaipe/Criterion.git vendor/criterion

The cause of the problem was the use of CMAKE_SOURCE_DIR.
CMAKE_SOURCE_DIR was expanded to the path to the top level of the source
tree.

The problem was fixed by replacing CMAKE_SOURCE_DIR with
CMAKE_CURRENT_SOURCE_DIR which was expanded to the path to the source
directory currently being processed.

--- .cmake/Modules/Subprojects.cmake
+++ .cmake/Modules/Subprojects.cmake
@@ -37,7 +37,7 @@
       set (epa_opts ${epa_opts} GIT_TAG "${object}")
     endif ()
   elseif (ARGS_PATH)
-      set (epa_opts SOURCE_DIR "${CMAKE_SOURCE_DIR}/${ARGS_PATH}")
+      set (epa_opts SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_PATH}")
   endif ()

   if (ARGS_CMAKE)


Fixed the resource path for MacOSX.

Fixed the resource path for MacOSX.

--- Source/cmake/Modules/Urho3D-CMake-magic.cmake
+++ Source/cmake/Modules/Urho3D-CMake-magic.cmake
@@ -325,7 +325,7 @@
 macro (setup_main_executable)
     # Define resource files
     if (APPLE)
-        set (RESOURCE_FILES ${PROJECT_SOURCE_DIR}/Bin/CoreData ${PROJECT_SOURCE_DIR}/Bin/Data)
+        set (RESOURCE_FILES ${PROJECT_SOURCE_DIR}/../Bin/CoreData ${PROJECT_SOURCE_DIR}/../Bin/Data)
         set_source_files_properties(${RESOURCE_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
         set (SOURCE_FILES ${SOURCE_FILES} ${RESOURCE_FILES})
     endif ()


PKG: gtk libs must be installed in lib/gtk

--- Packaging/install_rule.cmake
+++ Packaging/install_rule.cmake
@@ -121,6 +121,7 @@
 	set(lib_dir "lib")
 	if(is_gtk_lib)
 	  set(lib_dir "lib/gtk")
+	  set(install_dir "lib/gtk")
 	endif()

 	file(APPEND


Added CLAPACK_LINKER_FLAGS to the CMAKE_LINKER_FLAGS for applications.

--- copasi/CMakeConsoleApp.cmake
+++ copasi/CMakeConsoleApp.cmake
@@ -9,7 +9,7 @@
 # for apple we set the Accelerate framework

 set(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${CLAPACK_LIBRARIES})
-#   LAPACK LDFLAGS    = ${CLAPACK_LINKER_FLAGS}
+set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${CLAPACK_LINKER_FLAGS})

 if(ENABLE_COPASI_SEDML)
 set(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${LIBSEDML_LIBRARY})


Make sure we look for release lib for release config and not debug!

--- cmake/CEGUIFindHelpers.cmake
+++ cmake/CEGUIFindHelpers.cmake
@@ -72,7 +72,7 @@

     _find_dep_lib(${_PREFIX} ${_LIB} dynamic)
     _find_dep_lib(${_PREFIX} ${_LIB}_d dynamic _DBG)
-    _find_dep_lib(${_PREFIX} ${_LIB}_d static _STATIC TRUE)
+    _find_dep_lib(${_PREFIX} ${_LIB} static _STATIC TRUE)
     _find_dep_lib(${_PREFIX} ${_LIB}_d static _STATIC_DBG TRUE)

     cegui_find_package_handle_standard_args(${_PREFIX} ${_PREFIX}_FOUND_ALL_LIBS ${_PREFIX}_INCLUDE_DIR)


Fixes an issue in the FindUUID.cmake

Fixes an issue in the FindUUID.cmake

--- cmake/Modules/FindUUID.cmake
+++ cmake/Modules/FindUUID.cmake
@@ -34,4 +34,6 @@

 mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)
+set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR})
+set(UUID_LIBRARIES ${UUID_LIBRARY})


Squashed '3rdparty/github/cmake-utils/' changes from e6038fef..c5dec90e

c5dec90e Enable NTRACE only when exactly in Debug build mode, version 1.0.0

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: c5dec90e7f45c5b6950efe60fe99eba6a2c0e7ab

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -47,7 +47,7 @@
   # ... Tracing
   #
   STRING (TOUPPER ${PROJECT_NAME} _PROJECTNAME)
-  IF ((NOT CMAKE_BUILD_TYPE MATCHES Debug) AND (NOT CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
+  IF (NOT CMAKE_BUILD_TYPE MATCHES Debug)
     FOREACH (_target ${PROJECT_NAME} ${PROJECT_NAME}_static)
       TARGET_COMPILE_DEFINITIONS(${_target} PRIVATE -D${_PROJECTNAME}_NTRACE)
     ENDFOREACH ()


Cmake: add hints in FindFFTW

Cmake: add hints in FindFFTW

--- cmake/modules/FindFFTW.cmake
+++ cmake/modules/FindFFTW.cmake
@@ -5,10 +5,12 @@
   PATH_SUFFIXES include/fftw
   HINTS ENV MKLROOT
   HINTS ENV FFTWROOT
+  HINTS ENV FFTW_INC
   )

 find_library(FFTW_LIBRARIES NAMES fftw3
   HINTS ENV MKLROOT
+  HINTS ENV FFTW_DIR
   HINTS ENV FFTWROOT
   )


also build with the msvc IDE (comment only for Xcode)

svn path=/trunk/KDE/kdepim/; revision=690834

--- cmake/modules/FindKode.cmake
+++ cmake/modules/FindKode.cmake
@@ -15,8 +15,10 @@
 # check if we are currently building kdepim
 if ( EXISTS ${CMAKE_SOURCE_DIR}/libkdepim/kdepim_export.h )
 	if (WIN32)
-		set( KODE_XML_COMPILER_EXECUTABLE ${CMAKE_BINARY_DIR}/bin/kxml_compiler.exe.bat )
+		# CMAKE_CFG_INTDIR is the output subdirectory created e.g. by XCode and MSVC
+		set( KODE_XML_COMPILER_EXECUTABLE ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/kxml_compiler.exe.bat )
 	else(WIN32)
+		# On problems when building with XCode try adding ${CMAKE_CFG_INTDIR}, see also FindKDE4Internal.cmake
 		set( KODE_XML_COMPILER_EXECUTABLE ${CMAKE_BINARY_DIR}/kode/kxml_compiler/kxml_compiler.shell )
 	endif(WIN32)
 	set( _KODE_XML_COMPILER_DEP kxml_compiler )


Straighten out EXISTS logic which does not allow BOOLEAN operators.

svn path=/trunk/; revision=6858

--- cmake/modules/freetype.cmake
+++ cmake/modules/freetype.cmake
@@ -87,14 +87,23 @@
 endforeach(FONT_ENTRY PL_FREETYPE_FONT_LIST)

 # Check a couple of fonts actually exists
-if (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SANS} AND EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SYMBOL})
-else (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SANS} AND EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SYMBOL})
+if (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SANS})
+  if (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SYMBOL})
+  else (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SYMBOL})
+    message("Fonts not found - disabling freetype")
+    set(WITH_FREETYPE OFF CACHE BOOL
+    "Enable driver options for using freetype library for fonts" FORCE
+    )
+  endif (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SYMBOL})
+else (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SANS})
   message("Fonts not found - disabling freetype")
-  set(WITH_FREETYPE OFF CACHE BOOL "Enable driver options for using freetype library for fonts" FORCE)
+  set(WITH_FREETYPE OFF CACHE BOOL
+  "Enable driver options for using freetype library for fonts" FORCE
+  )
 endif (EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SANS} AND EXISTS ${PL_FREETYPE_FONT_DIR}${PL_FREETYPE_SYMBOL})

 endif (WITH_FREETYPE)

 if (WITH_FREETYPE)
   set(HAVE_FREETYPE ON)
-endif (WITH_FREETYPE)+endif (WITH_FREETYPE)


LIBRARY_OUTPUT_PATH_ROOT now defaults to CMAKE_BINARY_DIR, so we can to out-of-source android builds

--- src/android.toolchain.cmake
+++ src/android.toolchain.cmake
@@ -74,7 +74,7 @@
 #      libraries. Automatically turned on for NDK r5x and r6x due to GLESv2
 #      problems.
 #
-#    LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_SOURCE_DIR} - where to output binary
+#    LIBRARY_OUTPUT_PATH_ROOT=${CMAKE_BINARY_DIR} - where to output binary
 #      files. See additional details below.
 #
 #    ANDROID_SET_OBSOLETE_VARIABLES=ON - it set, then toolchain defines some
@@ -106,7 +106,7 @@
 #
 #    LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
 #    libraries will be installed.
-#    Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
+#    Default is ${CMAKE_BINARY_DIR}, and the android libs will always be
 #    under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
 #    (depending on the target ABI). This is convenient for Android packaging.
 #
@@ -715,7 +715,7 @@
 set( ANDROID_SYSTEM_LIB_DIRS "" )

 # setup output directories
-set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_SOURCE_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
+set( LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_BINARY_DIR} CACHE PATH "root for library output, set this to change where android libs are installed to" )
 set( CMAKE_INSTALL_PREFIX "${ANDROID_TOOLCHAIN_ROOT}/user" CACHE STRING "path for installing" )

 if(NOT _CMAKE_IN_TRY_COMPILE)


fixing filename

fixing filename

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@4536 3d70eeeb-363e-0410-a505-8a46323a89f2

--- src/ten/sources.cmake
+++ src/ten/sources.cmake
@@ -70,7 +70,7 @@
   tenModel.c
   modelBall.c
   model1Stick.c
-  model1StickEMD.c
+  modelBall1StickEMD.c
   modelBall1Stick.c
   modelBall1Cylinder.c
   model1Cylinder.c


COMP: Disabled OverwriteSliceImageFilterTest temporary: See Bug 13309

--- Modules/Segmentation/Testing/files.cmake
+++ Modules/Segmentation/Testing/files.cmake
@@ -3,13 +3,13 @@
   mitkContourTest.cpp
   mitkDataNodeSegmentationTest.cpp
   mitkSegmentationInterpolationTest.cpp
-#  mitkOverwriteSliceFilterTest.cpp
+  mitkOverwriteSliceFilterTest.cpp
 #  mitkOverwriteSliceFilterObliquePlaneTest.cpp
 )

 set(MODULE_IMAGE_TESTS
   mitkManualSegmentationToSurfaceFilterTest.cpp
-  mitkOverwriteSliceImageFilterTest.cpp
+#  mitkOverwriteSliceImageFilterTest.cpp
 )
 set(MODULE_CUSTOM_TESTS
 )


NO_DEFAULT_PATH is mandatory

NO_DEFAULT_PATH is mandatory

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@1977 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/FindSiconosNumerics.cmake
+++ Numerics/cmake/FindSiconosNumerics.cmake
@@ -10,7 +10,11 @@
 # SiconosNumerics_LIBRARY_DIRECTORY before FIND_PACKAGE(SiconosNumerics)

 IF(SiconosNumerics_LIBRARY_DIRECTORY)
-  FIND_LIBRARY(SiconosNumerics_FOUND SiconosNumerics PATHS "${SiconosNumerics_LIBRARY_DIRECTORY}")
+  MESSAGE(STATUS "Looking for Numerics library in ${SiconosNumerics_LIBRARY_DIRECTORY}")
+  FIND_LIBRARY(SiconosNumerics_FOUND SiconosNumerics PATHS "${SiconosNumerics_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+  IF(SiconosNumerics_FOUND)
+    MESSAGE(STATUS "Found : ${SiconosNumerics_FOUND}")
+  ENDIF(SiconosNumerics_FOUND)
 ELSE(SiconosNumerics_LIBRARY_DIRECTORY)
   FIND_LIBRARY(SiconosNumerics_FOUND SiconosNumerics)
 ENDIF(SiconosNumerics_LIBRARY_DIRECTORY)


iOS: emulate OpenCV toolchain

iOS: emulate OpenCV toolchain

--- os/iphone.cmake
+++ os/iphone.cmake
@@ -105,3 +105,7 @@
       "IOS_SDK_VERSION: ${IOS_SDK_VERSION}\n"
   )
 endif()
+
+# Emulate OpenCV toolchain --
+set(IOS YES)
+# -- end


SVN_SILENT made messages (.desktop file)

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -93,6 +93,7 @@
 Comment[sr@latin]=VLC kao pozadina Phonona
 Comment[sv]=Phonon VLC-gränssnitt
 Comment[tr]=Phonon VLC arkaucu
+Comment[ug]=Phonon VLC ئارقا ئۇچى
 Comment[uk]=Модуль VLC Phonon
 Comment[x-test]=xxPhonon VLC backendxx
 Comment[zh_CN]= Phonon VLC 后端


oss: FindLibEvent.cmake: workaround cmake POLICY annoyances

Summary:
When pulled in as an external project into an environment
that has changed the default cmake policy, the trick we're using
to extract the full library path errors out.  This works around
that issue by saving the policy settings and then setting them
how we need them before restoring them after we're done.

refs https://github.com/facebook/folly/issues/1100

Reviewed By: yfeldblum

Differential Revision: D14766991

fbshipit-source-id: e2506bc0aebd9e66bc70b12c4c538c9e034f9f73

--- build/fbcode_builder/CMake/FindLibEvent.cmake
+++ build/fbcode_builder/CMake/FindLibEvent.cmake
@@ -36,7 +36,13 @@
   # this results in linker errors.
   # To resolve this, we ask cmake to lookup the full path to the library
   # and use that instead.
+  cmake_policy(PUSH)
+  if(POLICY CMP0026)
+    # Allow reading the LOCATION property
+    cmake_policy(SET CMP0026 OLD)
+  endif()
   get_target_property(LIBEVENT_LIB event LOCATION)
+  cmake_policy(POP)

   set(LibEvent_FOUND ${Libevent_FOUND})
   if (NOT LibEvent_FIND_QUIETLY)


add vad_add_var function to append/add variables within a vad_*** script (which will belong to the respective package)

Change-Id: I951579b0200e4a6b183e67bd97fa4e970145d2a3

--- external/vigra_cmake/VigraAddDep.cmake
+++ external/vigra_cmake/VigraAddDep.cmake
@@ -263,6 +263,14 @@
   set(VAD_NEW_VARS_${_VAD_NAME} ${_DIFFVARS} CACHE INTERNAL "")
 endmacro()

+function(vad_add_var _VARNAME _VARVAL)
+  if (NOT _VAD_NAME)
+    message(FATAL_ERROR "vad_add_var requires _VAD_NAME to be set!")
+  endif()
+  set(${_VARNAME} ${_VARVAL} CACHE INTERNAL "")
+  set(VAD_NEW_VARS_${_VAD_NAME} "${VAD_NEW_VARS_${_VAD_NAME}};${_VARNAME}" CACHE INTERNAL "")
+endfunction()
+
 # In addition to calling the builtin find_package(), this function
 # will take care of exporting as global variables the variables defined by the builtin find_package(), and to make
 # the imported targets defined by the builtin find_package() global.


Run FOTS driver with verbose=true.

Run FOTS driver with verbose=true.

--- test/fots/ImportFOTS.cmake
+++ test/fots/ImportFOTS.cmake
@@ -76,6 +76,7 @@
     "-e fotsPath:=${_outdir}/2011/QT3-test-suite/catalog.xml "
     "-e mode:=run-test-sets -e testSetPrefixes:=${_testset} "
     "-e expectedFailuresPath:=${BUILDDIR}/FOTSExpectedFailures.xml "
+    "-e verbose:=true "
     "--disable-http-resolution --indent "
     "-z \"cdata-section-elements=${FOTS_CDATA_ELEMENTS}\")\n"
     "ZORBA_SET_TEST_PROPERTY (FOTS/${_testset} "
@@ -102,6 +103,7 @@
       "-e mode:=run-test-case "
       "-e testSetName:=${_testset} -e testCaseName:=${_testcase} "
       "-e expectedFailuresPath:=${BUILDDIR}/FOTSExpectedFailures.xml "
+      "-e verbose:=true "
       "--disable-http-resolution --indent "
       "-z \"cdata-section-elements=${FOTS_CDATA_ELEMENTS}\")\n"
       "ZORBA_SET_TEST_PROPERTY (FOTS/${_testset}/${_testcase} "


Fix dependency for openvdb

Fix dependency for openvdb

--- openvdb.cmake
+++ openvdb.cmake
@@ -42,7 +42,7 @@
 message ("Installing ${openvdb_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${openvdb_NAME}
     DEPENDS             ${boost_NAME} ${cppunit_NAME} ${zlib_NAME} ${openexr_NAME}
-                        ${tbb_NAME} ${doxygen_NAME} ${glfw}
+                        ${tbb_NAME} ${doxygen_NAME} ${glfw_NAME}
     PREFIX              ${BUILDEM_DIR}
     SOURCE_DIR          ${BUILDEM_DIR}/src/openvdb  # Needed due to include paths
     URL                 ${openvdb_URL}


openssl.cmake: Special configure command for mac.

--- openssl.cmake
+++ openssl.cmake
@@ -18,6 +18,15 @@
     ae412727c8c15b67880aef7bd2999b2e
     http://www.openssl.org/source)

+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    # On Mac, 64-bit builds must be manually requested.
+    set (SSL_CONFIGURE_COMMAND ./Configure darwin64-x86_64-cc )
+else()
+    # The config script seems to auto-select the platform correctly on linux
+    # It calls ./Configure for us.
+    set (SSL_CONFIGURE_COMMAND ./config)
+endif()
+
 message ("Installing ${openssl_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${openssl_NAME}
     DEPENDS             ${zlib_NAME}
@@ -26,7 +35,7 @@
     URL_MD5             ${openssl_MD5}
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
-    CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ./config
+    CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${SSL_CONFIGURE_COMMAND}
         --prefix=${BUILDEM_DIR}
         zlib
         shared


adaptor for sub library when using -stdlib=libc++

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -116,7 +116,8 @@
         find_library (COMPILER_CLANG_HAS_LIBCXX NAMES c++ libc++)
         find_library (COMPILER_CLANG_HAS_LIBCXXABI NAMES c++abi libc++abi)
         if(COMPILER_CLANG_HAS_LIBCXX AND COMPILER_CLANG_HAS_LIBCXXABI)
-            add_definitions(-stdlib=libc++ -Wno-unused-command-line-argument)
+            list(APPEND CMAKE_CXX_FLAGS -stdlib=libc++ -Wno-unused-command-line-argument)
+            list(APPEND CMAKE_C_FLAGS -Wno-unused-command-line-argument)
             message(STATUS "Clang use stdlib=libc++")
             list(APPEND COMPILER_OPTION_EXTERN_CXX_LIBS c++ c++abi)
         else()
@@ -153,7 +154,8 @@
         find_library (COMPILER_CLANG_HAS_LIBCXX NAMES c++ libc++)
         find_library (COMPILER_CLANG_HAS_LIBCXXABI NAMES c++abi libc++abi)
         if(COMPILER_CLANG_HAS_LIBCXX AND COMPILER_CLANG_HAS_LIBCXXABI)
-            add_definitions(-stdlib=libc++ -Wno-unused-command-line-argument)
+            list(APPEND CMAKE_CXX_FLAGS -stdlib=libc++ -Wno-unused-command-line-argument)
+            list(APPEND CMAKE_C_FLAGS -Wno-unused-command-line-argument)
             message(STATUS "AppleClang use stdlib=libc++")
             list(APPEND COMPILER_OPTION_EXTERN_CXX_LIBS c++ c++abi)
         else()


check if list is empty before calling REMOVE_DUBLICATES

--- CMake/OSGConfigurePackages.cmake
+++ CMake/OSGConfigurePackages.cmake
@@ -874,7 +874,9 @@
       SET(OSG_QT_INC_DIR ${OSG_QT_INC_DIR};${Qt5Gui_PRIVATE_INCLUDE_DIRS})
     ENDIF()

+    IF(OSG_QT_INC_DIR)
     LIST(REMOVE_DUPLICATES OSG_QT_INC_DIR)
+    ENDIF()

     FOREACH(_QT_DEF ${_OSG_QT_DEFS_COLLECT})


adapt path to new build system

adapt path to new build system

--- CMake/ToolExtensionHelpers.cmake
+++ CMake/ToolExtensionHelpers.cmake
@@ -31,7 +31,7 @@
       # configure a file that contains an itkObjectFactory for this tool
       SET( FACTORY_NAME ${TOOL_NAME}Factory )
       SET( FACTORY_DESCRIPTION "Generated factory for ${TOOL_NAME}" )
-      CONFIGURE_FILE( ${MITK_DIR}/ToolExtensionITKFactory.cpp.in
+      CONFIGURE_FILE( ${MITK_DIR}/CMake/ToolExtensionITKFactory.cpp.in
                       ${PROJECT_BINARY_DIR}/mitk${FACTORY_NAME}.h
                       @ONLY )
       INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
@@ -67,7 +67,7 @@
       # configure a file that contains an itkObjectFactory for this tool
       STRING(REGEX REPLACE "(.+)\\.c(pp|xx)$" "\\1Factory" FACTORY_NAME ${TOOL_GUI_FILE})
       SET( FACTORY_DESCRIPTION "Generated factory for Qmitk${TOOL_NAME}GUI" )
-      CONFIGURE_FILE( ${MITK_DIR}/ToolGUIExtensionITKFactory.cpp.in
+      CONFIGURE_FILE( ${MITK_DIR}/CMake/ToolGUIExtensionITKFactory.cpp.in
                       ${PROJECT_BINARY_DIR}/${FACTORY_NAME}.h
                       @ONLY )
       INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
@@ -97,7 +97,7 @@
   IF (TOOL_FILES OR TOOL_QT3GUI_FILES OR TOOL_QT4GUI_FILES)
     IF (libraryname AND reallycreatelibrary)
       # configure one file with the itkLoad method
-      CONFIGURE_FILE( ${MITK_DIR}/ToolExtensionITKFactoryLoader.cpp.in
+      CONFIGURE_FILE( ${MITK_DIR}/CMake/ToolExtensionITKFactoryLoader.cpp.in
                       ${PROJECT_BINARY_DIR}/mitkToolExtensionITKFactoryLoader.cpp
                       @ONLY )
       # also mark this file for compilation


Fix spelling error in CMake file.

Fix spelling error in CMake file.

--HG--
branch : vanilla

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -276,7 +276,7 @@
 endif ()

 if(OGRE_CONFIG_STATIC_LINK_CRT)
-#We statically link to reduce dependancies
+#We statically link to reduce dependencies
 foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
     if(${flag_var} MATCHES "/MD")
         string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")


Fix bug 285: Feature summary was incorrect if OGRE_CONFIG_ALLOCATOR=1.

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -133,7 +133,7 @@
 endmacro ()

 # allocator settings
-if (OGRE_CONFIG_ALlOCATOR EQUAL 1)
+if (OGRE_CONFIG_ALLOCATOR EQUAL 1)
 	set(_allocator "standard")
 elseif (OGRE_CONFIG_ALLOCATOR EQUAL 2)
 	set(_allocator "nedmalloc")


BUG: Read the correct file (did not work if more than one dir given in TCL_INCLUDE_PATH) and do not quote the CMake variable name in the STRING REGEX REPLACE operations.

--- CMake/vtkTclTkMacros.cmake
+++ CMake/vtkTclTkMacros.cmake
@@ -42,14 +42,14 @@

   FOREACH(dir ${TCL_INCLUDE_PATH})
     IF(EXISTS "${dir}/tcl.h")
-      FILE(READ "${TCL_INCLUDE_PATH}/tcl.h" tcl_include_file)
+      FILE(READ "${dir}/tcl.h" tcl_include_file)
       STRING(REGEX REPLACE
         ".*#define TCL_VERSION[ \t]*\"([0-9][0-9]*\\.[0-9][0-9]*)\".*" "\\1"
         tcl_include_file "${tcl_include_file}")
       IF(${tcl_include_file} MATCHES "^[0-9]*\\.[0-9]*$")
-        STRING(REGEX REPLACE "^([0-9]*)\\.([0-9]*)$" "\\1" "${tcl_tk_major_version}"
+        STRING(REGEX REPLACE "^([0-9]*)\\.([0-9]*)$" "\\1" ${tcl_tk_major_version}
           "${tcl_include_file}")
-        STRING(REGEX REPLACE "^([0-9]*)\\.([0-9]*)$" "\\2" "${tcl_tk_minor_version}"
+        STRING(REGEX REPLACE "^([0-9]*)\\.([0-9]*)$" "\\2" ${tcl_tk_minor_version}
           "${tcl_include_file}")
       ENDIF(${tcl_include_file} MATCHES "^[0-9]*\\.[0-9]*$")
     ENDIF(EXISTS "${dir}/tcl.h")


Add detailed documentation for the FindMKL module

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -1,15 +1,62 @@
 # Copyright (c) 2018, ArrayFire
 # All rights reserved.
 #
-# This file is distributed under 3-clause BSD license.
-# The complete license agreement can be obtained at:
-# http://arrayfire.com/licenses/BSD-3-Clause
+# This file is distributed under 3-clause BSD license. The complete license
+# agreement can be obtained at: http://arrayfire.com/licenses/BSD-3-Clause
 #
 # A FindMKL script based on the recommendations by the Intel's Link Line
 # Advisor. It currently only tested on the 2018 version of MKL on Windows,
-# Linux, and OSX but it should work on older versions. It creates an MKL::MKL
-# library which has the required dependencies to for a dynamic link based
-# on the advisor's output.
+# Linux, and OSX but it should work on older versions.
+#
+# To use this module call the mklvars.(sh,bat) script before you call cmake. This
+# script is located in the bin folder of your mkl installation. This will set the
+# MKLROOT environment variable which will be used to find the libraries on your system.
+#
+# Example:
+# set(MKL_THREAD_LAYER "TBB")
+# find_package(MKL)
+#
+# add_executable(myapp main.cpp)
+# target_link_libraries(myapp PRIVATE MKL::MKL)
+#
+# This module bases its behavior based on the following variables:
+#
+# ``MKL_THREAD_LAYER``
+#   The threading layer that needs to be used by the MKL library. This
+#   Defines which library will be used to parallelize the MKL kernels. Possible
+#   options are TBB(Default), GNU OpenMP, Intel OpenMP, Sequential
+#
+# This module provides the following :prop_tgt:'IMPORTED' targets:
+#
+# ``MKL::MKL``
+#   Target used to define and link all MKL libraries required by Intel's Link
+#   Line Advisor. This usually the only thing you need to link against unless
+#   you want to link against the single dynamic library version of MKL
+#   (libmkl_rt.so)
+#
+#  Optional:
+#
+# ``MKL::ThreadLayer{_STATIC}``
+#   Target used to define the threading layer(TBB, OpenMP, etc.) based on
+#   MKL_THREAD_LAYER variable.
+#
+# ``MKL::ThreadingLibrary``
+#   Target used to define the threading library(libtbb, libomp, etc) that the
+#   application will need to link against.
+#
+# ``MKL::Interface``
+#   Target used to determine which interface library to use(32bit int or 64bit
+#   int).
+#
+# ``MKL::Core``
+#   Target for the dynamic library dispatcher
+#
+# ``MKL::RT``
+#   Target for the single dynamic library
+#
+# ``MKL::{mkl_def;mkl_mc;mkl_mc3;mkl_avx;mkl_avx2;mkl_avx512}{_STATIC}``
+#   Targets for MKL kernel libraries.
+
 include(CheckTypeSize)

 check_type_size("int" INT_SIZE


Update to TF 1.4.0

Update to TF 1.4.0

--- tensorflow_cc/cmake/TensorflowBase.cmake
+++ tensorflow_cc/cmake/TensorflowBase.cmake
@@ -3,7 +3,7 @@
 ExternalProject_Add(
   tensorflow_base
   GIT_REPOSITORY http://github.com/tensorflow/tensorflow.git
-  GIT_TAG v1.4.0-rc0
+  GIT_TAG v1.4.0
   TMP_DIR "/tmp"
   STAMP_DIR "tensorflow-stamp"
   DOWNLOAD_DIR "tensorflow"


Fixed change that somehow I reverted.

Fixed change that somehow I reverted.

--- tools/cmake/ANHLibrary.cmake
+++ tools/cmake/ANHLibrary.cmake
@@ -187,8 +187,8 @@
             if(ENABLE_TEST_REPORT)
                 foreach(configuration Debug Release MinSizeRel RelWithDebInfo)
                     add_test(
-                        NAME all_${name}_tests_${CMAKE_BUILD_TYPE}
-                        CONFIGURATIONS ${CMAKE_BUILD_TYPE}
+                        NAME all_${name}_tests_${configuration}
+                        CONFIGURATIONS ${configuration}
                         COMMAND ${name}_test "--gtest_output=xml:${PROJECT_BINARY_DIR}/reports/$<CONFIGURATION>/"
                         WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${configuration}
                     )


Fixed test generation for unix platform

Fixed test generation for unix platform

--- tools/cmake/ANHLibrary.cmake
+++ tools/cmake/ANHLibrary.cmake
@@ -187,8 +187,8 @@
             if(ENABLE_TEST_REPORT)
                 foreach(configuration Debug Release MinSizeRel RelWithDebInfo)
                     add_test(
-                        NAME all_${name}_tests_${configuration}
-                        CONFIGURATIONS ${configuration}
+                        NAME all_${name}_tests_${CMAKE_BUILD_TYPE}
+                        CONFIGURATIONS ${CMAKE_BUILD_TYPE}
                         COMMAND ${name}_test "--gtest_output=xml:${PROJECT_BINARY_DIR}/reports/$<CONFIGURATION>/"
                         WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${configuration}
                     )


fix for Fedora users who need explicit pthread linking

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@1790 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -150,7 +150,11 @@
 macro(PCL_ADD_EXECUTABLE _name _component)
     add_executable(${_name} ${ARGN})
     # must link explicitly against boost.
-    target_link_libraries(${_name} ${Boost_LIBRARIES})
+    if(UNIX)
+      target_link_libraries(${_name} ${Boost_LIBRARIES} pthread)
+    else(UNIX)
+      target_link_libraries(${_name} ${Boost_LIBRARIES})
+    endif(UNIX)
     #
     # Only link if needed
     if(WIN32 AND MSVC)


Split off 7.10.50

Split off 7.10.50

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 10 )
-set ( HPCC_POINT 49 )
+set ( HPCC_POINT 51 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Nagios Monitoring 5.2.0-rc3 Release Candidate 3

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -6,5 +6,5 @@
 set ( HPCC_MINOR 2 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 2 )
+set ( HPCC_SEQUENCE 3 )
 ###


Nagios Monitoring 6.0.2-rc1 Release Candidate 1

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 6 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "release" )
+set ( HPCC_POINT 2 )
+set ( HPCC_MATURITY "rc" )
 set ( HPCC_SEQUENCE 1 )
 ###


added contour source class to file.cmake

--- Modules/Segmentation/files.cmake
+++ Modules/Segmentation/files.cmake
@@ -19,6 +19,7 @@
 Algorithms/mitkVtkImageOverwrite.cpp
 Algorithms/mitkDiffSliceOperation.cpp
 Algorithms/mitkDiffSliceOperationApplier.cpp
+Algorithms/mitkContourModelSource.cpp
 Algorithms/mitkContourModelToPointSetFilter.cpp
 Algorithms/mitkContourModelToVtkPolyDataFilter.cpp
 Controllers/mitkSegmentationInterpolationController.cpp


[cmake] version bump to 1.9.0 (SONAME must be updated due to many ABI changes since 1.8.7)

--- version.cmake
+++ version.cmake
@@ -10,8 +10,8 @@
 #...............................................................................

 set(JANCY_VERSION_MAJOR     1)
-set(JANCY_VERSION_MINOR     8)
-set(JANCY_VERSION_REVISION  7)
+set(JANCY_VERSION_MINOR     9)
+set(JANCY_VERSION_REVISION  0)
 set(JANCY_VERSION_TAG)

 set(JANCY_VERSION_FULL "${JANCY_VERSION_MAJOR}.${JANCY_VERSION_MINOR}.${JANCY_VERSION_REVISION}")


Split off 7.8.34

Split off 7.8.34

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
-set ( HPCC_POINT 33 )
+set ( HPCC_POINT 35 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Graph Control 4.0.0-rc1 Release Candidate 1

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_MAJOR 4 )
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "closedown" )
+set ( HPCC_MATURITY "rc" )
 set ( HPCC_SEQUENCE 1 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )


Split off 8.6.0

Split off 8.6.0

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@
 set ( HPCC_NAME "Nagios Monitoring" )
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
-set ( HPCC_MINOR 5 )
+set ( HPCC_MINOR 7 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "trunk" )
 set ( HPCC_SEQUENCE 0 )


[cmake] add -ftemplate-depth=1024 to clang flags when compiling io with serialization

--- cmake/CXXCompilerSetup.cmake
+++ cmake/CXXCompilerSetup.cmake
@@ -128,5 +128,9 @@
 # Clang
 add_cxx_options("-Wno-string-plus-int" "Clang")

+if(WITH_SERIALIZATION)
+  add_cxx_options("-ftemplate-depth=1024" Clang)
+endif(WITH_SERIALIZATION)
+
 # Do we still need this?
 append_cxx_flags("-D_NUMERICS_INTERNAL_CXX_")


Cmake: disable default include paths when searching for fuse include path in the case when package config returns non empty list of fuse include paths in order to ensure that osxfuse includes is selected in macos, in the case where both macfuse and osxfuse include files are present.

--- cmake/Modules/FindFUSE.cmake
+++ cmake/Modules/FindFUSE.cmake
@@ -92,12 +92,22 @@
     endif(PC_FUSE_FOUND)
 endif(PKG_CONFIG_FOUND)

-find_path(
-    FUSE_INCLUDE_DIRS
-    NAMES fuse.h
-    PATHS "${PC_FUSE_INCLUDE_DIRS}"
-    DOC "Include directories for FUSE"
-)
+if ("${PC_FUSE_INCLUDE_DIRS}" STREQUAL "")
+    find_path(
+        FUSE_INCLUDE_DIRS
+        NAMES fuse.h
+        PATHS "${PC_FUSE_INCLUDE_DIRS}"
+        DOC "Include directories for FUSE"
+    )
+else()
+    find_path(
+        FUSE_INCLUDE_DIRS
+        NAMES fuse.h
+        NO_DEFAULT_PATH
+        PATHS "${PC_FUSE_INCLUDE_DIRS}"
+        DOC "Include directories for FUSE"
+    )
+endif()

 if(NOT FUSE_INCLUDE_DIRS)
     set(FUSE_FOUND FALSE)
@@ -117,7 +127,7 @@

 if(FUSE_FOUND)
     FOREACH(FUSE_VERSION_INCLUDE
-            "${FUSE_INCLUDE_DIRS}/osxfuse/fuse_common.h"
+            "${FUSE_INCLUDE_DIRS}/osxfuse/fuse/fuse_common.h"
             "${FUSE_INCLUDE_DIRS}/fuse/fuse_common.h"
             "${FUSE_INCLUDE_DIRS}/fuse_common.h")
         if (EXISTS "${FUSE_VERSION_INCLUDE}")


add Ampere CC   * Ampere has CC 8.0   * Arm64 server support has been added in CUDA 11 (only V100 for now)

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -72,13 +72,14 @@

   message(STATUS "CUDA detected: " ${CUDA_VERSION})

-  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing")
+  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing" "Ampere")
   set(_arch_fermi   "2.0")
   set(_arch_kepler  "3.0;3.5;3.7")
   set(_arch_maxwell "5.0;5.2")
   set(_arch_pascal  "6.0;6.1")
   set(_arch_volta   "7.0")
   set(_arch_turing  "7.5")
+  set(_arch_ampere  "8.0")
   if(NOT CMAKE_CROSSCOMPILING)
     list(APPEND _generations "Auto")
   endif()
@@ -141,6 +142,8 @@
     set(__cuda_arch_bin ${_arch_volta})
   elseif(CUDA_GENERATION STREQUAL "Turing")
     set(__cuda_arch_bin ${_arch_turing})
+  elseif(CUDA_GENERATION STREQUAL "Ampere")
+    set(__cuda_arch_bin ${_arch_ampere})
   elseif(CUDA_GENERATION STREQUAL "Auto")
     ocv_detect_native_cuda_arch(_nvcc_res _nvcc_out)
     if(NOT _nvcc_res EQUAL 0)
@@ -158,7 +161,8 @@
       ocv_detect_native_cuda_arch(_nvcc_res _nvcc_out)
       if(NOT _nvcc_res EQUAL 0)
         message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
-        set(__cuda_arch_bin "5.3 6.2 7.2")
+        # TX1 (5.3) TX2 (6.2) Xavier (7.2) V100 (7.0)
+        set(__cuda_arch_bin "5.3 6.2 7.2 7.0")
       else()
         set(__cuda_arch_bin "${_nvcc_out}")
       endif()
@@ -171,6 +175,7 @@
           ${_arch_pascal}
           ${_arch_volta}
           ${_arch_turing}
+          ${_arch_ampere}
       )
     endif()
   endif()


Adds support for optional arguments

Adds support for optional arguments

This has only been tested on the attiny84

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -619,7 +619,9 @@
         if(ARDUINO_SDK_VERSION VERSION_GREATER 1.0 OR ARDUINO_SDK_VERSION VERSION_EQUAL 1.0)
             if(NOT MANUAL)
                 set(PIN_HEADER ${${${BOARD_ID}.build.variant}.path})
-                set(COMPILE_FLAGS "${COMPILE_FLAGS} -I\"${PIN_HEADER}\"")
+                if(PIN_HEADER)
+                    set(COMPILE_FLAGS "${COMPILE_FLAGS} -I\"${PIN_HEADER}\"")
+                endif()
             endif()
         endif()

@@ -1130,19 +1132,25 @@
         )

     # Programmer
-    if(${BOARD_ID}.upload.protocol STREQUAL "stk500")
+    if(NOT ${BOARD_ID}.upload.protocol OR ${BOARD_ID}.upload.protocol STREQUAL "stk500")
         list(APPEND AVRDUDE_ARGS "-cstk500v1")
     else()
         list(APPEND AVRDUDE_ARGS "-c${${BOARD_ID}.upload.protocol}")
     endif()

+    set(UPLOAD_SPEED "19200")
+    if(${BOARD_ID}.upload.speed)
+        set(UPLOAD_SPEED ${${BOARD_ID}.upload.speed})
+    endif()
+
     list(APPEND AVRDUDE_ARGS
-        "-b${${BOARD_ID}.upload.speed}"     # Baud rate
+        "-b${UPLOAD_SPEED}"     # Baud rate
         "-P${PORT}"                         # Serial port
         "-D"                                # Dont erase
         )

     list(APPEND AVRDUDE_ARGS ${AVRDUDE_FLAGS})
+    message(STATUS "DEBUG: ARGS: ${AVRDUDE_ARGS}")

     set(${OUTPUT_VAR} ${AVRDUDE_ARGS} PARENT_SCOPE)
 endfunction()


Fix output message

Fix output message

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -89,7 +89,11 @@
         MESSAGE(STATUS "Could NOT find run-clang-tidy script")
     ENDIF()
 ELSE()
-    MESSAGE(STATUS "Could NOT find clang-tidy ${CMAKE_CXX_COMPILER_ID}")
+    IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+        MESSAGE(STATUS "Could NOT find clang-tidy")
+    ELSE()
+        MESSAGE(STATUS "Could NOT check for clang-tidy, wrong compiler: ${CMAKE_CXX_COMPILER_ID}")
+    ENDIF()
 ENDIF()

 FIND_PROGRAM(CPPCHECK "cppcheck")


adding -fexceptions for clang (win)

adding -fexceptions for clang (win)

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -134,7 +134,11 @@
      # problem: https://dev.azure.com/tudat-team/feedstock-builds/_build/results?buildId=95&view=logs&j=00f5923e-fdef-5026-5091-0d5a0b3d5a2c&t=3cc4a9ed-60e1-5810-6eb3-5f9cd4a26dba
      # solution: https://stackoverflow.com/questions/1091662/vc-internal-compiler-error
      #     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /Ox /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
-#     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
+     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /FC /Ox -D_SCL_SECURE_NO_WARNINGS")
+     if(CMAKE_COMPILER_ID MATCHES "Clang")
+          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXFLAGS} -fexceptions")
+          set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS}")
+     endif()
      if (TUDAT_FORCE_DYNAMIC_RUNTIME)
          # This is needed for conda builds, as the prebuilt libraries are MD.
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")
@@ -210,6 +214,7 @@
                  )
      endif ()
      if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+
      else()
          string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR ${MSVC_DISABLED_WARNINGS_LIST})
          string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})


appveyor mingw debugging

appveyor mingw debugging

--- scripts/exec_test.cmake
+++ scripts/exec_test.cmake
@@ -28,7 +28,7 @@

 if("${TEST_MODE}" STREQUAL "COMPARE")
     if(NOT CMAKE_HOST_UNIX)
-        #execute_process(COMMAND dos2unix ${TEST_TEMP_FILE})
+        execute_process(COMMAND unix2dos ${TEST_TEMP_FILE})
     endif()

     execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_OUTPUT_FILE} ${TEST_TEMP_FILE} RESULT_VARIABLE cmp_result)


fixed gcc host compiler for cuda to be able to have the new(est) gcc installed

--- imp_cmake/cmake/macros/imp_finders.cmake
+++ imp_cmake/cmake/macros/imp_finders.cmake
@@ -24,8 +24,12 @@
 ##! @todo (MWE) find/check the path of the compiler as well as the OS
 string(REGEX MATCH "/ccache/" SYSTEM_USE_CCACHE "${CMAKE_C_COMPILER}")
 if(SYSTEM_USE_CCACHE)
-   #set(CUDA_HOST_COMPILER /usr/bin/gcc)
-   set(CUDA_HOST_COMPILER /opt/cuda/bin/gcc)
+   if(EXISTS "${CUDA_TOOLKIT_ROOT_DIR}/bin/gcc")
+      set(CUDA_HOST_COMPILER ${CUDA_TOOLKIT_ROOT_DIR}/bin/gcc)
+   elseif(EXISTS "/usr/bin/gcc")
+      set(CUDA_HOST_COMPILER /usr/bin/gcc)
+   endif()
+   imp_debug("CUDA_HOST_COMPILER: ${CUDA_HOST_COMPILER}")
 endif()

 include_directories(
@@ -39,7 +43,7 @@
    # CUDA 7.0
    #imp_debug("IMP library compiled with CUDA 7.0")
    add_definitions(-DCUDA_VERSION_70)
-elseif()
+else()
    message(FATAL_ERROR "unknown CUDA version. some things might not be tested.")
 endif()


Remove duplicated checks

Remove duplicated checks

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -114,7 +114,7 @@
 set(CMAKE_EXTRA_INCLUDE_FILES)

 set(CMAKE_EXTRA_INCLUDE_FILES arpa/inet.h)
-vlc_check_functions_exist(inet_pton inet_aton inet_ntop inet_pton)
+vlc_check_functions_exist(inet_aton inet_ntop inet_pton)
 set(CMAKE_EXTRA_INCLUDE_FILES)

 set(CMAKE_REQUIRED_LIBRARIES)
@@ -138,7 +138,6 @@
  int main() { return 0;}" HAVE_STDINT_H_WITH_UINTMAX)

 check_symbol_exists(ntohl "sys/param.h"  NTOHL_IN_SYS_PARAM_H)
-check_symbol_exists(scandir "dirent.h"   HAVE_SCANDIR)
 check_symbol_exists(scandir "dirent.h"   HAVE_SCANDIR)
 check_symbol_exists(localtime_r "time.h" HAVE_LOCALTIME_R)
 check_symbol_exists(alloca "alloca.h"    HAVE_ALLOCA)


BUG: Removed extra else()

BUG: Removed extra else()

--- CMake/ctkMacroSetupQt.cmake
+++ CMake/ctkMacroSetupQt.cmake
@@ -72,9 +72,6 @@
     else()
       message(FATAL_ERROR "error: Qt4 was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable")
     endif()
-
-  else()
-    message(FATAL_ERROR "error: Qt4 was not found on your system. You probably need to set the QT_QMAKE_EXECUTABLE variable")
   endif()

   mark_as_superbuild(CTK_QT_VERSION)


fixedmerge error

fixedmerge error

--- CMakeExternals/Python.cmake
+++ CMakeExternals/Python.cmake
@@ -114,6 +114,7 @@
       list(APPEND additional_cmake_cache_args
         "-DCMAKE_PROJECT_${proj}_INCLUDE:FILEPATH=${CMAKE_ROOT}/Modules/CTestUseLaunchers.cmake"
       )
+    endif()

     set(_python_install_dir )
     if(WIN32)


COMP: update opencv search path relative to the include dir in v4

--- CMake/FindOpenCV.cmake
+++ CMake/FindOpenCV.cmake
@@ -104,6 +104,10 @@

 if(NOT OPENCV_SEARCH_PATH)
   get_filename_component(OPENCV_SEARCH_PATH "${opencv_INCLUDE_DIR}" PATH)
+  # include dir is include/opencv4 in v4
+  if(OpenCV_VERSION_MAJOR EQUAL 4)
+    get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
+  endif()
 endif()

 # Prefer the static library.


BUG: SlicerExecutionModel use same compiler.

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -284,6 +284,8 @@
   BINARY_DIR ${proj}-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}


Cosmetic change to .pc.cmake file

Cosmetic change to .pc.cmake file

--- yaml-cpp.pc.cmake
+++ yaml-cpp.pc.cmake
@@ -4,7 +4,7 @@
 includedir=@INCLUDE_INSTALL_DIR@

 Name: Yaml-cpp
-Description: A YAML parser for C++
+Description: A YAML parser and emitter for C++
 Version: @YAML_CPP_VERSION@
 Requires:
 Libs: -L${libdir} -lyaml-cpp


Updated bootloader with PCIe internal clock fixes

--- cmake/Depthai/DepthaiBootloaderConfig.cmake
+++ cmake/Depthai/DepthaiBootloaderConfig.cmake
@@ -4,4 +4,4 @@

 # "version if applicable"
 # set(DEPTHAI_BOOTLOADER_VERSION "0.0.17")
-set(DEPTHAI_BOOTLOADER_VERSION "0.0.18+823e0c827043dc8965ce8e094355bcb1d22993b1")
+set(DEPTHAI_BOOTLOADER_VERSION "0.0.18+80bb8460c6d1fed73a587184c3d2b8dff4a61375")


Update FW: report exposure + iso too in ImgFrame for RGB, (note: lens position may be reported one frame in advance), fix black image when initial manual exposure was set with other controls, fix switching from auto to manual exposure causing the lens to jump to zero (note: the lens is directly set now with manual focus, bypassing 3A)

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "302a12b8943b08d0e1862044e745fafe75f67fde")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "5f3f8e24b6ec6b39f79472daba8e7606ed99fc90")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


COMP: adding cherryIQtPreferencePage.cpp to the right place

--- openCherry/Bundles/org.opencherry.ui.qt/files.cmake
+++ openCherry/Bundles/org.opencherry.ui.qt/files.cmake
@@ -1,4 +1,5 @@
 SET(SRC_CPP_FILES
+  cherryIQtPreferencePage.cpp
   cherryQModelIndexObject.cpp
   cherryQtEditorPart.cpp
   cherryQtItemSelection.cpp
@@ -26,7 +27,6 @@
   util/cherryTabbedStackPresentation.cpp
   util/cherryTabFolderEvent.cpp

-  cherryIQtPreferencePage.cpp
   cherryQtControlWidget.cpp
   cherryQtDisplay.cpp
   cherryQtDnDTweaklet.cpp