CMake: Fixed OpenCL build for embedded targets

Setting RS_TARGET_API for OpenCL embedded targets is not
necessary. For that reason, only append this define to
compiler calls for Renderscript and Filterscript, but not
globally for OpenCL.

--- cmake/modules/FindRenderScript.cmake
+++ cmake/modules/FindRenderScript.cmake
@@ -112,7 +112,7 @@
   HINTS ${ANDROID_SOURCE_DIR}/out/target/product/${TARGET_NAME}/system/lib
   DOC "NDK target library directory")

-SET (NDK_CXX_FLAGS "-fno-rtti" -DRS_TARGET_API=${RS_TARGET_API})
+SET (NDK_CXX_FLAGS "-fno-rtti")

 SET (NDK_INCLUDE_DIRS -I${ANDROID_SOURCE_DIR}/frameworks/rs/cpp
                       -I${ANDROID_SOURCE_DIR}/frameworks/rs
@@ -193,13 +193,15 @@
   IF (RS_SOURCES STREQUAL "")
     ADD_CUSTOM_TARGET (${NAME} ALL
       COMMAND ${NDK_CXX_COMPILER} ${NDK_CXX_FLAGS} ${NDK_DEFINITIONS}
-              ${NDK_INCLUDE_DIRS} ${NDK_LINK_LIBRARIES} ${ARGN} -o ${NAME}
+              -DRS_TARGET_API=${RS_TARGET_API} ${NDK_INCLUDE_DIRS}
+              ${NDK_LINK_LIBRARIES} ${ARGN} -o ${NAME}
               ${NDK_LINK_LIBRARIES_${NAME}})
   ELSE ()
     ADD_CUSTOM_TARGET (${NAME} ALL
       COMMAND ${RS_COMPILER} ${RS_FLAGS} ${RS_INCLUDE_DIRS} ${RS_SOURCES}
       COMMAND ${NDK_CXX_COMPILER} ${NDK_CXX_FLAGS} ${NDK_DEFINITIONS}
-              ${NDK_INCLUDE_DIRS} ${NDK_LINK_LIBRARIES} ${ARGN} -o ${NAME}
+              -DRS_TARGET_API=${RS_TARGET_API} ${NDK_INCLUDE_DIRS}
+              ${NDK_LINK_LIBRARIES} ${ARGN} -o ${NAME}
               ${NDK_LINK_LIBRARIES_${NAME}})
   ENDIF ()
 ENDMACRO ()


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

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

-#---Set all directories where to install parts of root up to now everything is installed ------
-#---according to the setting of CMAKE_INSTALL_DIR
-
-if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT gnuinstall)
-  message(STATUS "Setting default installation prefix CMAKE_INSTALL_PREFIX to ${CMAKE_BINARY_DIR}/root")
-  set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/root CACHE PATH "Default installation of ROOT" FORCE)
-endif()
-
 #---Add defines for CINT limits-----------------------------------------------------------------
 if(DEFINED CINTMAXSTRUCT)
   add_definitions(-DG__MAXSTRUCT=${CINTMAXSTRUCT})


CMake: Bump version number

CMake: Bump version number

--- version.cmake
+++ version.cmake
@@ -3,7 +3,7 @@
 endif()
 set(LIB_VERSION_MAJOR 0)
 set(LIB_VERSION_MINOR 8)
-set(LIB_VERSION_PATCH 2)
+set(LIB_VERSION_PATCH 3)
 set(LIB_VERSION_ABI 0.8)
 set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
 set(SUMMARY "${PROJECT_NAME} Game Boy Advance Emulator")


Split off 6.0.4

Split off 6.0.4

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

--- version.cmake
+++ version.cmake
@@ -4,8 +4,8 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 6 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 2 )
-set ( HPCC_MATURITY "release" )
+set ( HPCC_POINT 3 )
+set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 1 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )


Split off 4.2.x branch

Split off 4.2.x branch

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

--- version.cmake
+++ version.cmake
@@ -3,7 +3,7 @@
 ###
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 4 )
-set ( HPCC_MINOR 1 )
+set ( HPCC_MINOR 3 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "trunk" )
 set ( HPCC_SEQUENCE 1 )


build: correct handling of argument generation

This adjusts the target specific argument handling to use the same logic
as the toolchain, and in doing so, silences the spurious warnings when
building with a MSVC toolchain.

--- cmake/modules/AddSwiftUnittests.cmake
+++ cmake/modules/AddSwiftUnittests.cmake
@@ -57,9 +57,11 @@
       _ENABLE_EXTENDED_ALIGNED_STORAGE)
   endif()

-  if(SWIFT_USE_LINKER)
-    set_property(TARGET "${test_dirname}" APPEND_STRING PROPERTY
-      LINK_FLAGS " -fuse-ld=${SWIFT_USE_LINKER}")
+  if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+    if(SWIFT_USE_LINKER)
+      target_link_options(${test_dirname} PRIVATE
+        -fuse-ld=${SWIFT_USE_LINKER}$<$<STREQUAL:${CMAKE_HOST_SYSTEM_NAME},Windows>:.exe>)
+    endif()
   endif()

   if(SWIFT_ANALYZE_CODE_COVERAGE)


[t:4871] remove -Wcast-align on darwin

[t:4871] remove -Wcast-align on darwin

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -119,7 +119,6 @@
   ## set gcc warnings
   set(CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")
   set(WARN_CFLAGS
-    -Wcast-align
     -Wbad-function-cast
     -Wno-missing-noreturn
     -Wstrict-prototypes
@@ -129,9 +128,9 @@
     -Wmissing-format-attribute
     )
   if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
-    message(WARNING "Disabling -Wshadow on osx.  TODO: fix shadowed declarations and re-enable it.")
+    message(WARNING "Disabling -Wcast-align and -Wshadow on osx.  TODO: fix casting and shadowed declarations and re-enable them.")
   else ()
-    list(APPEND WARN_CFLAGS -Wshadow)
+    list(APPEND WARN_CFLAGS -Wcast-align -Wshadow)
   endif ()
 endif()


typo in FindOpenNI.cmake

typo in FindOpenNI.cmake

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

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -58,7 +58,7 @@

 mark_as_advanced(OPENNI_LIBRARY OPENNI_INCLUDE_DIR)
 if(NOT WIN32 AND NOT USB_10_FOUND)
-  message(STATUS "OpeNI disabled because libusb-1.0 not found.")
+  message(STATUS "OpenNI disabled because libusb-1.0 not found.")
   set(HAVE_OPENNI OFF)
   return()
 else(NOT WIN32 AND NOT USB_10_FOUND)


Update: try to fix where the found library is usb-2 on Mac using OS name

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

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -28,7 +28,7 @@
              PATHS "$ENV{PROGRAMFILES}/OpenNI/Lib${OPENNI_SUFFIX}" "$ENV{PROGRAMW6432}/OpenNI/Lib${OPENNI_SUFFIX}")

 set(OPENNI_INCLUDE_DIRS ${OPENNI_INCLUDE_DIR})
-if(APPLE)
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
   set(OPENNI_LIBRARIES ${OPENNI_LIBRARY} usb-1.0)
 else()
   set(OPENNI_LIBRARIES ${OPENNI_LIBRARY})


fix cake project project file search bugs

--- Modules/private/CakeProject.cmake
+++ Modules/private/CakeProject.cmake
@@ -62,16 +62,16 @@
           if(NOT CAKE_CURRENT_DIRECTORY)
             message(FATAL_ERROR "[cake] Internal error: CAKE_CURRENT_DIRECTORY is not set.")
           endif()
-          set(CMAKE_PROJECT_DIR "${CAKE_CURRENT_DIRECTORY}")
+          set(CAKE_PROJECT_DIR "${CAKE_CURRENT_DIRECTORY}")
         else()
-          set(CMAKE_PROJECT_DIR "${CMAKE_HOME_DIRECTORY}")
+          set(CAKE_PROJECT_DIR "${CMAKE_HOME_DIRECTORY}")
         endif()
         while(1)
-          if(EXISTS "${CMAKE_PROJECT_DIR}/${_CAKE_PROJECT_FILE_NAME}")
+          if(EXISTS "${CAKE_PROJECT_DIR}/${_CAKE_PROJECT_FILE_NAME}")
             break()
           endif()
           set(_cake_prev_project_dir "${CAKE_PROJECT_DIR}")
-          string(REGEX_REPLACE "/[^/]*$" "" CAKE_PROJECT_DIR "${CAKE_PROJECT_DIR}")
+          string(REGEX REPLACE "/[^/]*$" "" CAKE_PROJECT_DIR "${CAKE_PROJECT_DIR}")
           if(CAKE_PROJECT_DIR STREQUAL _cake_prev_project_dir)
             set(CAKE_PROJECT_DIR "")
             break()


Fix the CMake check for std::atomic_int.

std::atomic_int of Visual C++ 2012 cannot be constructed with integer.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -46,7 +46,7 @@
 check_cxx_source_compiles("
   #include <atomic>
   int main() {
-    std::atomic_int x;
+    std::atomic_int x(1);
     ++x;
     --x;
     return 0;


Fix missing PROJECT_NAME on target

Fix missing PROJECT_NAME on target

--- CppcheckTargets.cmake
+++ CppcheckTargets.cmake
@@ -208,7 +208,7 @@
       COMMENT
       "${_name}_cppcheck: Running cppcheck on target ${_name}..."
       VERBATIM)
-    add_dependencies(cppcheck ${_name}_cppcheck)
+    add_dependencies(cppcheck_${PROJECT_NAME} ${_name}_cppcheck)
   endif()

 endfunction()


Bugfix

Bugfix

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@27259 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_cached_variables.cmake
+++ deal.II/cmake/setup_cached_variables.cmake
@@ -56,7 +56,7 @@
 #                                                                         #
 ###########################################################################

-If(DEAL_II_WITH_BUNDLED_DIRECTORY)
+If(DEAL_II_HAVE_BUNDLED_DIRECTORY)
   OPTION(DEAL_II_ALLOW_BUNDLED
     "Allow the use of libraries bundled with the source tarball. (DEAL_II_FORCE_BUNDLED* will overwrite this option.)"
     ON
@@ -73,7 +73,7 @@
   OFF
   )

-If(DEAL_II_WITH_DOC_DIRECTORY)
+If(DEAL_II_HAVE_DOC_DIRECTORY)
   OPTION(DEAL_II_COMPONENT_DOCUMENTATION
     "Enable configuration, build and installation of the documentation. This adds a COMPONENT \"documentation\" to the build system."
     OFF


Fix spelling in example

Fix spelling in example

The example calls this file `DownloadProject` instead of `download_project`. The `.cmake` is not needed. I recommend mentioning that you can add it to your cmake (modules) sub-directory, too.

--- DownloadProject.cmake
+++ DownloadProject.cmake
@@ -73,7 +73,7 @@
 #
 # EXAMPLE USAGE:
 #
-#   include(download_project.cmake)
+#   include(DownloadProject)
 #   download_project(PROJ                googletest
 #                    GIT_REPOSITORY      https://github.com/google/googletest.git
 #                    GIT_TAG             master


ENH: With cmake 3.0, findQt matches the exact version of Qt instead of any version above the required one.

--- SuperBuild/External_Qt4.cmake
+++ SuperBuild/External_Qt4.cmake
@@ -19,7 +19,6 @@
 # SlicerMacroCheckExternalProjectDependency
 set(extProjName Qt) #The find_package known name
 set(proj      Qt4) #This local name
-set(${extProjName}_REQUIRED_VERSION "4.6")  #If a required version is necessary, then set this, else leave blank

 #if(${USE_SYSTEM_${extProjName}})
 #  unset(${extProjName}_DIR CACHE)
@@ -36,7 +35,7 @@
 # Include dependent projects if any
 SlicerMacroCheckExternalProjectDependency(${proj})

-find_package(${extProjName} ${${extProjName}_REQUIRED_VERSION} COMPONENTS QtCore QtGui QtNetwork QtXml REQUIRED )
+find_package(${extProjName} COMPONENTS QtCore QtGui QtNetwork QtXml REQUIRED )
 # The project is provided using ${extProjName}_DIR, nevertheless since other
 # project may depend on ${extProjName}, let's add an 'empty' one
 SlicerMacroEmptyExternalProject(${proj} "${${proj}_DEPENDENCIES}")


Updated CTK to a version that is Qt 5.5 compatible

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 1e3470e7)
+    set(revision_tag 5bc07082)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -82,7 +82,7 @@
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
       #GIT_REPOSITORY https://github.com/commontk/CTK.git
       #GIT_TAG origin/master
-      URL_MD5 4cd017f7b4ac5ee9b396f4e7d0ed5024
+      URL_MD5 34b94d196546fa3b2e610a37da1a163d
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Add full option for OTB

Add full option for OTB

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -107,8 +107,11 @@
 set ( CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/" )
 set ( PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}" )

-# SuperBuild case : one configure option
-set ( CONFIGURE_OPTIONS  "-DCMAKE_PREFIX_PATH=${XDK_PATH}" )
+set (CONFIGURE_OPTIONS  "")
+include ( "${CMAKE_CURRENT_LIST_DIR}/configure_option.cmake" )
+# SuperBuild case : one more configure option
+set ( CONFIGURE_OPTIONS
+  "${CONFIGURE_OPTIONS};-DCMAKE_PREFIX_PATH=${XDK_PATH}" )

 # FIX ME this part might platform dependent
 set( GDAL_DATA "${XDK_PATH}/share/gdal" )


fix linking static SDL2 on windows

fix linking static SDL2 on windows

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -349,9 +349,13 @@

 # Find sdl2
 if(NOT ANDROID)
-# find script does not work in cross compilation environment
-find_package(SDL2)
-macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library needed for input handling in samples" "https://www.libsdl.org/" FALSE "" "")
+  # find script does not work in cross compilation environment
+  find_package(SDL2)
+  macro_log_feature(SDL2_FOUND "SDL2" "Simple DirectMedia Library needed for input handling in samples" "https://www.libsdl.org/" FALSE "" "")
+  if(SDL2_FOUND AND WIN32 AND NOT SDL2_BINARY)
+    # fix linking static SDL2 on windows
+    set(SDL2_LIBRARY ${SDL2_LIBRARY} winmm.lib imm32.lib version.lib)
+  endif()
 endif()

 #######################################################################


Add new search path for OpenGL libraries on Ubuntu 11.10

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -50,6 +50,8 @@
 # Set hardcoded path guesses for various platforms
 if (UNIX AND NOT OGRE_BUILD_PLATFORM_TEGRA2)
   set(OGRE_DEP_SEARCH_PATH ${OGRE_DEP_SEARCH_PATH} /usr/local)
+  # Ubuntu 11.10 has an inconvenient path to OpenGL libraries
+  set(OGRE_DEP_SEARCH_PATH ${OGRE_DEP_SEARCH_PATH} /usr/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
 endif ()

 if(OGRE_BUILD_PLATFORM_TEGRA2)


WIP: warn user during cmake configuration that USE_EXTERNAL_ITK and USE_EXTERNAL_LIBKML does not match (bug 879/896)

--- CMake/ImportLibKML.cmake
+++ CMake/ImportLibKML.cmake
@@ -5,6 +5,13 @@
   option(OTB_USE_EXTERNAL_LIBKML "Use external LibKML library." ON)
 else()
   option(OTB_USE_EXTERNAL_LIBKML "Use external LibKML library." OFF)
+
+  #Known issue in OTB which does not compile with external ITK and internal libkml
+  #Bugs 896: http://bugs.orfeo-toolbox.org/view.php?id=896
+  if (USE_EXTERNAL_ITK)
+    message(WARNING "There is a known issue which does not allow to use internal libKML with external ITK in OTB. You might consider using an external LibKML.")
+  endif()
+
   set(LIBKML_LIBRARIES otbkml)
   message(STATUS "Using LibKML internal version")
 endif()


Update CTK tag to include DCMTK XCode fix.

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -16,7 +16,7 @@
   IF(NOT DEFINED CTK_DIR)
     ExternalProject_Add(${proj}
       GIT_REPOSITORY git://github.com/commontk/CTK.git
-      GIT_TAG 1608ad8ac1e0e548e3cb
+      GIT_TAG f6c3e844ffedbac6f3139265fbdd19c979e44152
       BINARY_DIR ${proj}-build
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Use fixed version of CTK working with Qt 5.11.1

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 0c2a619a)
+    set(revision_tag fc06bedc) # Revision currently points to commit in https://github.com/kislinsk/CTK.git

     set(ctk_optional_cache_args )
     if(MITK_USE_Python)
@@ -57,7 +57,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 e1f94ba0199eccf335ec2c2b48e155da
+      URL_MD5 c500f54dd6d2ce2803d705cbb663d2f2
       # PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/CTK.patch
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""


ENH: Added #47 (IncredBuild support) to elastix (within SuperElastix-SuperBuild), which was enabled by https://github.com/SuperElastix/elastix/issues/8 (Project should be defined in the top-level CMakeLists.txt)

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -21,6 +21,8 @@

 set( ELASTIX_GIT_REPOSITORY https://github.com/SuperElastix/elastix )
 set( ELASTIX_GIT_TAG 5b554d4063888c44c27089d6d5836a89b23988f3 )
+
+UPDATE_SELX_SUPERBUILD_COMMAND(${proj})

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}
@@ -113,6 +115,7 @@
   -DUSE_ViolaWellsMutualInformationMetric:BOOL=ON
   -DUSE_WeightedCombinationTransformElastix:BOOL=ON
   DEPENDS ITK
+  BUILD_COMMAND ${SELX_SUPERBUILD_COMMAND}
 )

 ExternalProject_Get_Property( Elastix binary_dir )


not hardcoding release

not hardcoding release

--- Bela/crosscompile.cmake
+++ Bela/crosscompile.cmake
@@ -16,7 +16,6 @@
 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

-set(CMAKE_BUILD_TYPE "Release")

 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard -mfpu=neon")
 set(CMAKE_VERBOSE_MAKEFILE ON)


ENH: Bump SCIFIO to add wrapping.

ENH: Bump SCIFIO to add wrapping.

This bump to the SCIFIO remote adds wrapping support.

Change-Id: Ib49290d9fa3d6f1cf665134a07b58eb9f5bbc237

--- Modules/Remote/SCIFIO.remote.cmake
+++ Modules/Remote/SCIFIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(SCIFIO
   "SCIFIO (Bioformats) ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/scifio/scifio-imageio.git
-  GIT_TAG 19f2ca398d9565aef99ed739c14c7de1e3daacfa
+  GIT_TAG 48f72ed9781f0a8dc8e535e3bab704d39147f4c8
   )


fix valgrind

fix valgrind

--- cmaki.cmake
+++ cmaki.cmake
@@ -232,11 +232,10 @@
 				CONFIGURATIONS ${BUILD_TYPE}
 				)
 		else()
-			if (BUILD_TYPE STREQUAL "Release")
-				message("-- Launch ${_TEST_NAME}__ with valgrind")
+
+			if ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_BUILD_TYPE STREQUAL "Release"))
 				find_program(VALGRIND "valgrind")
 				if(VALGRIND)
-					# add_custom_target(${_TEST_NAME}_memcheck COMMAND "${VALGRIND}" --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes $<TARGET_FILE:${_TEST_NAME}>)
 					add_test(
 						NAME ${_TEST_NAME}_memcheck
 						COMMAND "${VALGRIND}" --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=20 --track-fds=yes $<TARGET_FILE:${_TEST_NAME}>
@@ -267,6 +266,8 @@
 						WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${BUILD_TYPE}
 						CONFIGURATIONS ${BUILD_TYPE}
 						)
+				else()
+					message(FATAL_ERROR "no valgrind detected")
 				endif()
 			else()
 				add_test(


cmake: allow dangling comb nodes and disable errors

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- xc7/make/arch_define.cmake
+++ xc7/make/arch_define.cmake
@@ -26,6 +26,8 @@
       --clustering_pin_feasibility_filter off
       --disable_check_route on
       --strict_checks off
+      --allow_dangling_combinational_nodes on
+      --disable_errors check_unbuffered_edges:check_route
     RR_PATCH_TOOL
       ${symbiflow-arch-defs_SOURCE_DIR}/xc7/utils/prjxray_routing_import.py
     RR_PATCH_CMD "${CMAKE_COMMAND} -E env \


STYLE: Remove outdated cmake version support

The minimum cmake version allowed is 2.8.6. Remove
conditional code to support cmake < 2.8.0.

Change-Id: Iad263d0aa141b415983875e4fa09b735ffaa463a

--- CMake/CppcheckTargets.cmake
+++ CMake/CppcheckTargets.cmake
@@ -119,28 +119,16 @@

     set( _cppcheck_compile_args ${_cppcheck_include} )

-    if("${CMAKE_VERSION}" VERSION_LESS "2.8.0")
-      # Older than CMake 2.8.0
-      itk_add_test(${_name}_cppcheck_test
+    itk_add_test(
+      NAME
+        ${_name}_cppcheck_test
+      COMMAND
         "${CPPCHECK_EXECUTABLE}"
         ${CPPCHECK_TEMPLATE_ARG}
         ${_cppcheck_args}
         ${_cppcheck_compile_args}
         ${_dir}
         )
-    else()
-      # CMake 2.8.0 and newer
-      itk_add_test(
-        NAME
-          ${_name}_cppcheck_test
-        COMMAND
-          "${CPPCHECK_EXECUTABLE}"
-          ${CPPCHECK_TEMPLATE_ARG}
-          ${_cppcheck_args}
-          ${_cppcheck_compile_args}
-          ${_dir}
-          )
-    endif()

   set_tests_properties(${_name}_cppcheck_test
     PROPERTIES
@@ -223,26 +211,15 @@
     # --------------------------------------------------------------
     set( _cppcheck_compile_args ${_cppcheck_include} ${_cppcheck_def} )

-    if("${CMAKE_VERSION}" VERSION_LESS "2.8.0")
-      # Older than CMake 2.8.0
-      itk_add_test(${_targetname}_cppcheck_test
+    itk_add_test(
+      NAME
+        ${_targetname}_cppcheck_test
+      COMMAND
         "${CPPCHECK_EXECUTABLE}"
         ${CPPCHECK_TEMPLATE_ARG}
         ${_cppcheck_args}
         ${_cppcheck_compile_args}
         ${_files})
-    else()
-      # CMake 2.8.0 and newer
-      itk_add_test(
-        NAME
-          ${_targetname}_cppcheck_test
-        COMMAND
-          "${CPPCHECK_EXECUTABLE}"
-          ${CPPCHECK_TEMPLATE_ARG}
-          ${_cppcheck_args}
-          ${_cppcheck_compile_args}
-          ${_files})
-    endif()

   set_tests_properties(${_targetname}_cppcheck_test
     PROPERTIES
@@ -312,26 +289,15 @@
     # --------------------------------------------------------------
     set( _cppcheck_compile_args --check-config ${_cppcheck_include} ${_cppcheck_def} )

-    if("${CMAKE_VERSION}" VERSION_LESS "2.8.0")
-       # Older than CMake 2.8.0
-      itk_add_test(${_name}_cppcheck_test
+     itk_add_test(
+       NAME
+         ${_name}_cppcheck_test
+       COMMAND
          "${CPPCHECK_EXECUTABLE}"
          ${CPPCHECK_TEMPLATE_ARG}
          ${_cppcheck_args}
          ${_cppcheck_compile_args}
          ${_files})
-      else()
-        # CMake 2.8.0 and newer
-        itk_add_test(
-          NAME
-            ${_name}_cppcheck_test
-          COMMAND
-            "${CPPCHECK_EXECUTABLE}"
-            ${CPPCHECK_TEMPLATE_ARG}
-            ${_cppcheck_args}
-            ${_cppcheck_compile_args}
-            ${_files})
-      endif()

       set_tests_properties(${_name}_cppcheck_test
         PROPERTIES


Added Gentoo install location for Cg to the FindCg.cmake script

--- CMake/Packages/FindCg.cmake
+++ CMake/Packages/FindCg.cmake
@@ -26,7 +26,8 @@
 set(Cg_PREFIX_PATH ${Cg_HOME} ${ENV_Cg_HOME}
   ${OGRE_SOURCE}/Dependencies
   ${ENV_OGRE_SOURCE}/Dependencies
-  ${OGRE_HOME} ${ENV_OGRE_HOME})
+  ${OGRE_HOME} ${ENV_OGRE_HOME}
+  /opt/nvidia-cg-toolkit)
 create_search_paths(Cg)
 # redo search if prefix path changed
 clear_if_changed(Cg_PREFIX_PATH
@@ -49,4 +50,4 @@
 make_library_set(Cg_LIBRARY)

 findpkg_finish(Cg)
-add_parent_dir(Cg_INCLUDE_DIRS Cg_INCLUDE_DIR)+add_parent_dir(Cg_INCLUDE_DIRS Cg_INCLUDE_DIR)


ManageFile: Add absolute file support

ManageFile: Add absolute file support

--- Modules/ManageFile.cmake
+++ Modules/ManageFile.cmake
@@ -69,12 +69,13 @@

     MACRO(_MANAGE_FILE_INSTALL_FILE_OR_DIR)
 	FOREACH(_f ${_fileList})
-	    IF(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_f}")
+	    GET_FILENAME_COMPONENT(_a "${_f}" ABSOLUTE)
+	    IF(IS_DIRECTORY "${_a}")
 		INSTALL(DIRECTORY ${_f} DESTINATION "${_destDir}" ${_argList})
-	    ELSE(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_f}")
+	    ELSE(IS_DIRECTORY "${_a}")
 		INSTALL(FILES ${_f} DESTINATION "${_destDir}" ${_argList})

-	    ENDIF(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_f}")
+	    ENDIF(IS_DIRECTORY "${_a}")
 	ENDFOREACH(_f ${_fileList})
     ENDMACRO(_MANAGE_FILE_INSTALL_FILE_OR_DIR)


Do not pollute defines.h with superproject defines

--- CommonFindPackage.cmake
+++ CommonFindPackage.cmake
@@ -42,31 +42,6 @@
   "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}")

 option(COMMON_FIND_PACKAGE_QUIET "Use QUIET for common_find_package command" ON)
-
-if(WIN32)
-  set(__system Win32)
-endif()
-if(APPLE)
-  set(__system Darwin)
-endif()
-if(CMAKE_SYSTEM_NAME MATCHES "Linux")
-  set(__system Linux)
-endif()
-
-list(APPEND COMMON_FIND_PACKAGE_DEFINES ${__system})
-if(COMMON_USE_CXX03)
-  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_USE_CXX03)
-else()
-  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_USE_CXX11)
-endif()
-
-include(TestBigEndian)
-test_big_endian(BIGENDIAN)
-if(BIGENDIAN)
-  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_BIGENDIAN)
-else()
-  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_LITTLEENDIAN)
-endif()

 macro(common_find_package Package_Name)
   string(TOUPPER ${Package_Name} PACKAGE_NAME)
@@ -199,6 +174,31 @@
 endmacro()

 macro(common_find_package_post)
+  if(WIN32)
+    set(__system Win32)
+  endif()
+  if(APPLE)
+    set(__system Darwin)
+  endif()
+  if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+    set(__system Linux)
+  endif()
+
+  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${__system})
+  if(COMMON_USE_CXX03)
+    list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_USE_CXX03)
+  else()
+    list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_USE_CXX11)
+  endif()
+
+  include(TestBigEndian)
+  test_big_endian(BIGENDIAN)
+  if(BIGENDIAN)
+    list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_BIGENDIAN)
+  else()
+    list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_LITTLEENDIAN)
+  endif()
+
   # Write defines.h and options.cmake
   if(NOT PROJECT_INCLUDE_NAME)
     message(FATAL_ERROR "PROJECT_INCLUDE_NAME not set, old or missing Common.cmake?")


Change directory in prepare superbuild

Change directory in prepare superbuild

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -23,13 +23,6 @@

 set (ENV{LANG} "C") # Only ascii output
 get_filename_component(OTB_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} DIRECTORY)
-get_filename_component(CI_PROJ_DIR ${OTB_SOURCE_DIR} DIRECTORY)
-get_filename_component(CI_ROOT_DIR ${CI_PROJ_DIR} DIRECTORY)
-
-# In GitLab we have :
-#   OTB_SOURCE_DIR=/builds/{project_dir}/otb
-#   CI_PROJ_DIR=/builds/{project_dir}
-#   CI_ROOT_DIR=/builds

 set ( DEBUG "1" )

@@ -52,7 +45,7 @@
 # This is platform dependent, and the next step (build) also
 # depends on that, as some paths are hardcoded
 # This can be fixed with a packaging of OTB_DEPENDS
-set (CTEST_INSTALL_DIRECTORY "${CI_ROOT_DIR}/xdk/")
+set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/xdk/")

 # HACK
 # This is needed because when using return() function ctest is trying
@@ -116,8 +109,7 @@
   file(APPEND ${SB_TXT} "${sb_file}${CONTENTS}")
 endforeach(sb_file)
 file(READ "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" CMAKE_ORIG)
-string(REPLACE "${CI_PROJ_DIR}" "" CMAKE_UNIFIED ${CMAKE_ORIG})
-file(APPEND ${SB_TXT} "CMakeCache.txt${CMAKE_UNIFIED}")
+file(APPEND ${SB_TXT} "CMakeCache.txt${CMAKE_ORIG}")
 file ( MD5 "${SB_TXT}" SB_MD5)
 message ( "SB_MD5 = ${SB_MD5}" )
 file (REMOVE ${SB_TXT})
@@ -180,7 +172,6 @@
 # TODO right now we rely on ctest_build to know whether there has been an error
 # in build, whereas SuperBuild does not necessarily return an error if something
 # goes wrong
-set ( SB_ARTIFACT_GIT "${CI_PROJ_DIR}/superbuild-artifact" )

 # REPOSITORY_GIT_URL and REMOTE whould be the same. Right now there are
 # different because one is https and one is ssh. Both should be ssh.
@@ -190,8 +181,9 @@
 execute_process(
   COMMAND ${GIT} "clone" "${REPOSITORY_GIT_URL}"
   "--branch" "master" "--depth" "1" "superbuild-artifact"
-  WORKING_DIRECTORY "${CI_PROJ_DIR}"
-  )
+  WORKING_DIRECTORY "${OTB_SOURCE_DIR}"
+  )
+set ( SB_ARTIFACT_GIT "${OTB_SOURCE_DIR}/superbuild-artifact" )

 # setting up the repo
 # StrictHostKeyChecking so we don't have to add the host as a known key
@@ -260,24 +252,15 @@

 set ( SB_TAR_NAME "SuperBuild_Install.tar" )

-# create the tar
-# We need to create tar in its directory to avoid weird name in file
-# "tar: Removing leading `../../' from member names"
-# WARNING
-# We are creating a tar containing xdk/.., so when extracting the archive in
-# an other environment the output file will be xdk... Obvious isn't it?
-# Well... Not for everyone...
+# Creating the tar
 # May be for easier maintainability the tar name should be the same as the
 # file inside.
 execute_process(
-  COMMAND ${CMAKE_COMMAND} "-E" "tar" "cf" "${SB_TAR_NAME}"
+  COMMAND ${CMAKE_COMMAND} "-E" "tar" "cf" "${SB_ARTIFACT_GIT}/${SB_TAR_NAME}"
   -- "${CTEST_INSTALL_DIRECTORY}"
-  WORKING_DIRECTORY ${CI_ROOT_DIR}
-  )
-
-# We need to copy the tar file, as it is on a different partition in the gitlab
-# context
-file ( COPY "${CI_ROOT_DIR}/${SB_TAR_NAME}" DESTINATION "${SB_ARTIFACT_GIT}")
+  WORKING_DIRECTORY ${OTB_SOURCE_DIR}
+  )
+

 # In a near futur it might be nice to clean up the mess we made...


fixed 2212

fixed 2212

--- cmake/OpenCVDetectCXXCompiler.cmake
+++ cmake/OpenCVDetectCXXCompiler.cmake
@@ -64,9 +64,9 @@

     # Typical output in CMAKE_OPENCV_GCC_VERSION_FULL: "c+//0 (whatever) 4.2.3 (...)"
     # Look for the version number
-    string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
+    string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
     if(NOT CMAKE_GCC_REGEX_VERSION)
-      string(REGEX MATCH "[0-9]+.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
+      string(REGEX MATCH "[0-9]+\\.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
     endif()

     # Split the three parts:


warn if CPU family is not supported

warn if CPU family is not supported

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -178,7 +178,9 @@
          if(_cpu_model GREATER 2) # Not sure whether this must be 3 or even 4 instead
             list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
          endif(_cpu_model GREATER 2)
-      endif(_cpu_family EQUAL 6)
+      else()
+         message(WARNING "Your CPU family ${_cpu_family} (vendor ${_vendor_id} model ${_cpu_model}) is not supported by OptimizeForArchitecture.cmake.")
+      endif()
    elseif(_vendor_id STREQUAL "AuthenticAMD")
       if(_cpu_family EQUAL 23)
          set(TARGET_ARCHITECTURE "zen")
@@ -200,8 +202,10 @@
          if(_cpu_model GREATER 64) # I don't know the right number to put here. This is just a guess from the hardware I have access to
             set(TARGET_ARCHITECTURE "k8-sse3")
          endif(_cpu_model GREATER 64)
+      else()
+         message(WARNING "Your CPU family ${_cpu_family} (vendor ${_vendor_id} model ${_cpu_model}) is not supported by OptimizeForArchitecture.cmake.")
       endif()
-   endif(_vendor_id STREQUAL "GenuineIntel")
+   endif()
 endmacro()

 macro(OptimizeForArchitecture)


[cmake] move macro around

[cmake] move macro around

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -60,6 +60,17 @@
 "  HAS_STD_BEGIN_END
 )

+Macro(ADD_IF_SUPPORTED dest)
+  FOREACH(flag ${ARGN})
+    CHECK_CXX_ACCEPTS_FLAG("${flag}" has_${flag})
+    if(has_${flag})
+      Set(${dest} "${${dest}} ${flag}")
+    else(has_${flag})
+      Message("compiler doesn't support: ${flag}")
+    endif(has_${flag})
+  ENDFOREACH(flag ${ARGN})
+EndMacro(ADD_IF_SUPPORTED)
+
 include(CheckOverrideFinal)

 SET( CMAKE_EXPORT_COMPILE_COMMANDS "ON" )
@@ -157,16 +168,6 @@
   set(HAVE_TBB 0)
 endif(TBB_FOUND)

-Macro(ADD_IF_SUPPORTED dest)
-  FOREACH(flag ${ARGN})
-    CHECK_CXX_ACCEPTS_FLAG("${flag}" has_${flag})
-    if(has_${flag})
-      Set(${dest} "${${dest}} ${flag}")
-    else(has_${flag})
-      Message("compiler doesn't support: ${flag}")
-    endif(has_${flag})
-  ENDFOREACH(flag ${ARGN})
-EndMacro(ADD_IF_SUPPORTED)

 macro(add_analyze)
     find_program(ANALYZER clang-check)


changed windows compilation flags - this is a cherry-pick of PR-1135, but was done manually to preserve git history

--- cmake_includes/config_windows.cmake
+++ cmake_includes/config_windows.cmake
@@ -36,7 +36,7 @@
 set(LZ4_INCLUDE_PATH ${LZ4_DIR}/lib/)
 set(LZ4_LIB_PATH ${LZ4_DIR}/visual/VS2010/bin/x64_Release/)

-set(COMPILE_DEFINITIONS -Wall)
+set(COMPILE_DEFINITIONS /W3)
 set(OPENCV_VER 310)
 set(OPENGL_LIBS OpenGL32)
 set(GLFW_LIBS glfw3)


issue 111: properly enable parallel tests

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

--- suite/runsuite.cmake
+++ suite/runsuite.cmake
@@ -31,9 +31,10 @@
 # Unfinished features in i#66 (now under i#121):
 # * have a list of known failures and label w/ " (known: i#XX)"
 # * ssh support for running on remote machines: copy, disable pdbs, run
-# * i#111: use the features in the latest CTest: -W, -j

 cmake_minimum_required (VERSION 2.2)
+set(cmake_ver_string
+  "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_RELEASE_VERSION}")

 # arguments are a ;-separated list (must escape as \; from ctest_run_script())
 set(arg_nightly OFF)  # whether to report the results
@@ -149,9 +150,7 @@
 set(CTEST_PROJECT_NAME "DynamoRIO")
 find_program(MAKE_COMMAND make DOC "make command")
 set(CTEST_BUILD_COMMAND_BASE "${MAKE_COMMAND} -j5")
-# i#111: use -j if available to run tests in parallel.
-# Only CTest 2.8+ supports -j, but 2.6 just ignores unknown params.
-set(CTEST_COMMAND "${CTEST_EXECUTABLE_NAME} -j5")
+set(CTEST_COMMAND "${CTEST_EXECUTABLE_NAME}")

 if (UNIX)
   # For cross-arch execve tests we need to run from an install dir
@@ -278,7 +277,14 @@
   ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
   # to run a subset of tests add an INCLUDE regexp to ctest_test.  e.g.:
   #   INCLUDE broadfun
-  ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")
+  if ("${cmake_ver_string}" STRLESS "2.8.")
+    ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")
+  else ()
+    # i#111: run tests in parallel, supported on CTest 2.8.0+
+    # Note that adding -j to CMAKE_COMMAND does not work, though invoking
+    # this script with -j does work, but we want parallel by default.
+    ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 5)
+  endif ()
   if (DO_SUBMIT)
     # include any notes via set(CTEST_NOTES_FILES )?
     ctest_submit()


Uninstall: Add comment about directory order

--- cmake/ElektraUninstall.cmake
+++ cmake/ElektraUninstall.cmake
@@ -69,7 +69,8 @@

 remove_directories ("${DIRECTORIES}")

-# The following directories might be empty
+# The following directories might be empty. The order of the directories is important, since we remove them in the given order.
+# A directory that occurs later in the list might be empty, since we removed all its subdirectories before.
 set (REMOVAL_CANDIDATES
 	"/usr/local/bin"
 	"/usr/local/include"


make cmake fail if a guarded meta example does not exist

and clean up obsolete filenames

--- cmake/FindMetaExamples.cmake
+++ cmake/FindMetaExamples.cmake
@@ -24,16 +24,12 @@

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

 	IF(NOT USE_GPL_SHOGUN)
 		LIST(APPEND EXCLUDED_META_EXAMPLES
-			gaussian_processes/gaussian_process_regression.sg
-			gaussian_processes/gaussian_process_classifier.sg
-			multiclass_classifier/multiclass_logisticregression.sg
-            statistical_testing/linear_time_mmd.sg
-            statistical_testing/quadratic_time_mmd.sg
+			multiclass/logistic_regression.sg
 			)
 	ENDIF()

@@ -47,7 +43,7 @@
 	IF(NOT USE_SVMLIGHT)
 		LIST(APPEND EXCLUDED_META_EXAMPLES
 			regression/multiple_kernel_learning.sg
-			binary_classifier/multiple_kernel_learning.sg
+			binary/multiple_kernel_learning.sg
 		)
 	ENDIF()

@@ -62,7 +58,13 @@
     get_excluded_meta_examples()

     FOREACH(META_EXAMPLE ${EXCLUDED_META_EXAMPLES})
-        LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/${META_EXAMPLE})
+        SET(EXCLUDED_EXAMPLE_FNAME ${CMAKE_SOURCE_DIR}/examples/meta/src/${META_EXAMPLE})
+        LIST(FIND META_EXAMPLE_LISTINGS ${EXCLUDED_EXAMPLE_FNAME} HAS_EXAMPLE)
+
+        IF(HAS_EXAMPLE EQUAL -1)
+            MESSAGE(FATAL_ERROR "Guarded meta example ${META_EXAMPLE} does not exist.")
+        ENDIF()
+        LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${EXCLUDED_EXAMPLE_FNAME})
     ENDFOREACH()

 	SET(META_EXAMPLES ${META_EXAMPLE_LISTINGS} PARENT_SCOPE)


Avoid use of string(CONCAT) in FindPythonConfig.cmake

This feature is only present in CMake 3.0+, and there is a
straightforward, more compatible alternative.

--- cmake/FindPythonConfig.cmake
+++ cmake/FindPythonConfig.cmake
@@ -16,7 +16,7 @@

 find_package(PythonInterp)
 if(PYTHONINTERP_FOUND)
-  string(CONCAT _Python_config ${PYTHON_EXECUTABLE} "-config")
+  set(_Python_config "${PYTHON_EXECUTABLE}-config")
   execute_process(COMMAND ${_Python_config} "--includes" OUTPUT_VARIABLE PYTHON_COMPILE_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
   execute_process(COMMAND ${_Python_config} "--ldflags" OUTPUT_VARIABLE PYTHON_LINK_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
   string(CONCAT _Python_config_message ${PYTHON_COMPILE_FLAGS} "; " ${PYTHON_LINK_FLAGS})


build: Clean up the find-module for lksctp-tools

--- cmake/Findlksctp-tools.cmake
+++ cmake/Findlksctp-tools.cmake
@@ -20,32 +20,32 @@
 # Copyright (C) 2018 Scylladb, Ltd.
 #

+find_library (lksctp-tools_LIBRARY
+  NAMES sctp)
+
 find_path (lksctp-tools_INCLUDE_DIR
   NAMES netinet/sctp.h)

-find_library (lksctp-tools_LIBRARY
-  NAMES sctp)
-
-if (lksctp-tools_INCLUDE_DIR AND lksctp-tools_LIBRARY)
-  set (lksctp-tools_FOUND ON)
-  set (lksctp-tools_INCLUDE_DIRS ${lksctp-tools_INCLUDE_DIR})
-  set (lksctp-tools_LIBRARIES ${lksctp-tools_LIBRARY})
-endif ()
+mark_as_advanced (
+  lksctp-tools_LIBRARY
+  lksctp-tools_INCLUDE_DIR)

 include (FindPackageHandleStandardArgs)

 find_package_handle_standard_args (lksctp-tools
-  FOUND_VAR lksctp-tools_FOUND
   REQUIRED_VARS
-    lksctp-tools_INCLUDE_DIR
-    lksctp-tools_LIBRARY)
+    lksctp-tools_LIBRARY
+    lksctp-tools_INCLUDE_DIR)
+
+set (lksctp-tools_LIBRARIES ${lksctp-tools_LIBRARY})
+set (lksctp-tools_INCLUDE_DIRS ${lksctp-tools_INCLUDE_DIR})

 if (lksctp-tools_FOUND AND NOT (TARGET lksctp-tools::lksctp-tools))
   add_library (lksctp-tools::lksctp-tools UNKNOWN IMPORTED)

   set_target_properties (lksctp-tools::lksctp-tools
     PROPERTIES
-      IMPORTED_LOCATION ${lksctp-tools_LIBRARY}
+      IMPORTED_LOCATION ${lksctp-tools_LIBRARIES}
       INTERFACE_INCLUDE_DIRECTORIES ${lksctp-tools_INCLUDE_DIRS})
 endif ()


Fix warnings in LLDBWrapPython.cpp with gcc 4.9.

Summary:
I see a lot of following warnings in LLDBWrapPython.cpp while building with gcc 4.9 on Linux.
"warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]"

Is it ok to add -Wno-cast-qual for this file in cmake for gcc. This option seems to be already present
for autotool case.

Reviewers: zturner, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13719

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@250380 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -191,6 +191,6 @@
   if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
       NOT "${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
     set_property(SOURCE ${LLDB_WRAP_PYTHON}
-                 APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-sequence-point")
+                 APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual")
   endif ()
 endif()


fixed CC arch/pts for android (used sm_32)

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -90,12 +90,17 @@
   endif()

   if(NOT DEFINED __cuda_arch_bin)
-    if(${CUDA_VERSION} VERSION_LESS "5.0")
-      set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
-    else()
-      set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
-    endif()
-    set(__cuda_arch_ptx "3.0")
+    if(ANDROID)
+      set(__cuda_arch_bin "3.2")
+      set(__cuda_arch_ptx "")
+    else()
+      if(${CUDA_VERSION} VERSION_LESS "5.0")
+        set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0")
+      else()
+        set(__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1(2.0) 3.0 3.5")
+      endif()
+      set(__cuda_arch_ptx "3.0")
+    endif()
   endif()

   set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")


removed test plugin

removed test plugin

--- Plugins/PluginList.cmake
+++ Plugins/PluginList.cmake
@@ -46,5 +46,4 @@
   org.mitk.gui.qt.ugvisualization:OFF
   org.mitk.gui.qt.ultrasound:OFF
   org.mitk.gui.qt.volumevisualization:OFF
-  org.mitk.testOptitrack:ON
 )


cmake: use add_compile_definitions supported since 3.12

Now that the supported CMake version is >=3.16, this code can be
simplified.

--- tools/cmake/component.cmake
+++ tools/cmake/component.cmake
@@ -453,6 +453,7 @@
     # idf_build_process
     idf_build_get_property(include_directories INCLUDE_DIRECTORIES GENERATOR_EXPRESSION)
     idf_build_get_property(compile_options COMPILE_OPTIONS GENERATOR_EXPRESSION)
+    idf_build_get_property(compile_definitions COMPILE_DEFINITIONS GENERATOR_EXPRESSION)
     idf_build_get_property(c_compile_options C_COMPILE_OPTIONS GENERATOR_EXPRESSION)
     idf_build_get_property(cxx_compile_options CXX_COMPILE_OPTIONS GENERATOR_EXPRESSION)
     idf_build_get_property(asm_compile_options ASM_COMPILE_OPTIONS GENERATOR_EXPRESSION)
@@ -460,17 +461,10 @@

     include_directories("${include_directories}")
     add_compile_options("${compile_options}")
+    add_compile_definitions("${compile_definitions}")
     add_c_compile_options("${c_compile_options}")
     add_cxx_compile_options("${cxx_compile_options}")
     add_asm_compile_options("${asm_compile_options}")
-
-    # Unfortunately add_definitions() does not support generator expressions. A new command
-    # add_compile_definition() does but is only available on CMake 3.12 or newer. This uses
-    # add_compile_options(), which can add any option as the workaround.
-    #
-    # TODO: Use add_compile_definitions() once minimum supported version is 3.12 or newer.
-    idf_build_get_property(compile_definitions COMPILE_DEFINITIONS GENERATOR_EXPRESSION)
-    add_compile_options("${compile_definitions}")

     if(common_reqs) # check whether common_reqs exists, this may be the case in minimalistic host unit test builds
         list(REMOVE_ITEM common_reqs ${component_lib})


Updated Mac compile flags

Updated Mac compile flags

--- myCMakeFiles/FortranEnvironment.cmake
+++ myCMakeFiles/FortranEnvironment.cmake
@@ -56,8 +56,8 @@
   endif ()

   if (APPLE)
-    set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -qopenmp -axCORE-AVX2,CORE-AVX-I,AVX,SSE4.2,SSSE3 -ipo -no-prec-div -fp-model fast=2 -mkl")
-    set (CMAKE_Fortran_FLAGS_DEBUG "-Od -openmp -traceback -CB -fp-stack-check -gen-interfaces -warn interfaces -mkl")
+    set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -qopenmp -axCORE-AVX2,CORE-AVX-I,AVX,SSE4.2,SSSE3 -no-prec-div -fp-model fast=2")
+    set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -qopenmp -traceback -CB -fp-stack-check -gen-interfaces -warn interfaces")
   endif ()
 endif()


Remove unnecessary log messages

Remove unnecessary log messages

--- cmake-modules/FindMariaDB.cmake
+++ cmake-modules/FindMariaDB.cmake
@@ -9,7 +9,6 @@
   SET(PFILES $ENV{ProgramFiles})
 ENDIF()

-message("grut 0")
 IF (NOT MARIADB_INCLUDE_DIR)
   IF(WIN32)
     FIND_PATH(MARIADB_INCLUDE_DIR mysql.h
@@ -18,13 +17,10 @@
       $ENV{MARIADB_DIR}/include/mariadb
       ${PFILES}/MariaDB/*/include)
   ELSE()
-    message("grut 1")
     FIND_PATH(MARIADB_BIN_DIR mariadb_config
               $ENV{MARIADB_DIR}/bin
               ${MARIADB_DIR}/bin)
-    message("grut 2 ${MARIADB_BIN_DIR}")
     IF(MARIADB_BIN_DIR)
-    message("grut 3")
       EXEC_PROGRAM(${MARIADB_BIN_DIR}/mariadb_config
                    ARGS "--include"
                    OUTPUT_VARIABLE MARIADB_INCLUDE_DIR)


enable parallel compilation for windows build

style

--- cmake/EthCompilerSettings.cmake
+++ cmake/EthCompilerSettings.cmake
@@ -27,13 +27,14 @@

 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")

+	# enable parallel compilation
 	# specify Exception Handling Model in msvc
 	# disable unknown pragma warning (4068)
 	# disable unsafe function warning (4996)
 	# disable decorated name length exceeded, name was truncated (4503)
 	# disable warning C4535: calling _set_se_translator() requires /EHa (for boost tests)
 	# declare Windows XP requirement
-	add_compile_options(/EHsc /wd4068 /wd4996 /wd4503 -D_WIN32_WINNT=0x0501)
+	add_compile_options(/MP /EHsc /wd4068 /wd4996 /wd4503 -D_WIN32_WINNT=0x0501)
 	# disable empty object file warning
 	set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
 	# warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification


Improved version branching in cmake/OpenVDBHoudiniSetup.cmake

Signed-off-by: Nick Avramoussis <4c6772d20f21e1f087b814400acc0120202ec49e@dneg.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -245,8 +245,7 @@

 # Boost

-IF (( Houdini_VERSION_MAJOR LESS 16 ) OR
-  (( Houdini_VERSION_MAJOR EQUAL 16 ) AND ( Houdini_VERSION_MINOR LESS 5 )))
+IF ( Houdini_VERSION VERSION_LESS 16.5 )
   IF ( OPENVDB_BUILD_PYTHON_MODULE )
     # Prior to the introduction of HBoost (Houdini's namespaced and shipped Boost version from 16.5),
     # we built against Houdini's version of Boost which didn't include Boost.Python
@@ -265,8 +264,7 @@

 # OpenEXR and IlmBase

-IF (( Houdini_VERSION_MAJOR LESS 17 ) OR
-  (( Houdini_VERSION_MAJOR EQUAL 17 ) AND ( Houdini_VERSION_MINOR LESS 5 )))
+IF ( Houdini_VERSION VERSION_LESS 17.5 )
   # Prior to 17.5, we needed to use ilmbase and openexr shipped libs from Houdini

   # OpenEXR
@@ -296,10 +294,9 @@
 # Explicitly configure the OpenVDB ABI version depending on the Houdini
 # version.

-IF ( ( Houdini_VERSION_MAJOR LESS 16 ) OR
-     ( Houdini_VERSION_MAJOR EQUAL 16 ) AND ( Houdini_VERSION_MINOR LESS 5 ) )
+IF ( Houdini_VERSION VERSION_LESS 16.5 )
   SET ( OPENVDB_HOUDINI_ABI 3 )
-ELSEIF (Houdini_VERSION_MAJOR LESS 17)
+ELSEIF ( Houdini_VERSION VERSION_LESS 17 )
   SET ( OPENVDB_HOUDINI_ABI 4 )
 ELSE ()
   SET ( OPENVDB_HOUDINI_ABI 5 )


[CMake] Apple stage1 doesn't need to set libcxx options

LibCXX settings are configured in stage2 so we don't need them here.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@278729 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Apple-stage1.cmake
+++ cmake/caches/Apple-stage1.cmake
@@ -27,11 +27,6 @@
 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
 set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "")

-# LIBCXX Settings
-set(LIBCXX_INSTALL_LIBRARY OFF CACHE BOOL "")
-set(LIBCXX_INSTALL_HEADERS ON CACHE BOOL "")
-set(LIBCXX_OVERRIDE_DARWIN_INSTALL ON CACHE BOOL "")
-
 set(CLANG_BOOTSTRAP_TARGETS
   generate-order-file
   check-all


CMake: yaml-cpp is only libyaml-cppmd under MSVC.

--- cmake/modules/FindYamlCpp.cmake
+++ cmake/modules/FindYamlCpp.cmake
@@ -18,7 +18,7 @@
     set(YAMLCPP_STATIC_DEBUG libyaml-cpp-dbg.a)
 endif()

-if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")    ### Set Yaml libary name for Windows
+if(${MSVC})    ### Set Yaml libary name for Windows
   set(YAMLCPP_LIBNAME "libyaml-cppmd" CACHE STRING "Name of YAML library")
   set(YAMLCPP_LIBNAME optimized ${YAMLCPP_LIBNAME} debug ${YAMLCPP_LIBNAME}d)
 else()                      ### Set Yaml libary name for Unix, Linux, OS X, etc


Add TEST_URI_PATH to the testdriver module path.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -655,7 +655,7 @@
     ENDIF(WIN32)
     ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
       "--rbkt-src" "${TEST_DIR}"
-      "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${SECONDARY_MODULE_PATHS}"
+      "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${CMAKE_BINARY_DIR}/TEST_URI_PATH${PATHSEP}${SECONDARY_MODULE_PATHS}"
       "${TESTFILE}")

     MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)


Remove NSIS from set_tests_properties call

--- projects/win32/tomviz.bundle.cmake
+++ projects/win32/tomviz.bundle.cmake
@@ -61,8 +61,7 @@
         ${CMAKE_CPACK_COMMAND} -G ZIP
         WORKING_DIRECTORY ${Superbuild_BINARY_DIR})

-set_tests_properties(GenerateTomvizPackage-NSIS
-                     GenerateTomvizPackage-ZIP
+set_tests_properties(GenerateTomvizPackage-ZIP
                      GenerateTomvizPackage-WIX
                      PROPERTIES
                      TIMEOUT 1200)


[Config] Added support for Python 3.10

[Config] Added support for Python 3.10

--- config/FindPython/Support.cmake
+++ config/FindPython/Support.cmake
@@ -25,7 +25,7 @@
   message (FATAL_ERROR "FindPython: INTERNAL ERROR")
 endif()
 if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 3)
-  set(_${_PYTHON_PREFIX}_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+  set(_${_PYTHON_PREFIX}_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
 elseif (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 2)
   set(_${_PYTHON_PREFIX}_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
 else()


Removed auto find qt altogether

Removed auto find qt altogether

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -122,12 +122,11 @@
     SET(QT_MIN_VERSION "5.13")
   ENDIF()

-  IF(NOT UNIX)
-    IF(NOT IS_DIRECTORY ${Qt5_PATH})
-      MESSAGE(SEND_ERROR "Set Qt5_PATH to directory where Qt 5 is installed (containing lib and bin subdirectories) or set BUILD_HEADLESS to ON.")
-    ENDIF()
+  IF(IS_DIRECTORY ${Qt5_PATH})
+    FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} COMPONENTS Core Gui Widgets Network OpenGL Concurrent REQUIRED HINTS ${Qt5_PATH})
+  ELSE()
+    MESSAGE(SEND_ERROR "Set Qt5_PATH to directory where Qt 5 is installed (containing lib and bin subdirectories) or set BUILD_HEADLESS to ON.")
   ENDIF()
-  FIND_PACKAGE(Qt5 ${QT_MIN_VERSION} COMPONENTS Core Gui Widgets Network OpenGL Concurrent REQUIRED HINTS ${Qt5_PATH})

   IF(APPLE)
     SET(MACDEPLOYQT_OUTPUT_LEVEL 0 CACHE STRING "Set macdeployqt output level (0-3)")


Avoid tuning compiler for wrong cpu.

Avoid tuning compiler for wrong cpu.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -218,10 +218,12 @@
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${DEFAULT_CMAKE_SHARED_LINKER_FLAGS}" PARENT_SCOPE)
   endif()
   if(NOT DEFINED DEFAULT_VESPA_CPU_ARCH_FLAGS)
-    if(VESPA_OS_DISTRO STREQUAL "fedora" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-      set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-march=westmere -mtune=haswell")
-    else()
-      set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-mtune=intel")
+    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+      if(VESPA_OS_DISTRO STREQUAL "fedora" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+        set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-march=westmere -mtune=haswell")
+      else()
+        set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-mtune=intel")
+      endif()
     endif()
   endif()
   if(DEFINED DEFAULT_CMAKE_PREFIX_PATH)


CompileOptions.cmake : more warnings by default with CLang

      "-Wshadow "                    # Variable shadowing
      "-Winvalid-source-encoding "
      "-Wconditional-uninitialized " # Variable used when uninitialized
      "-Wnon-virtual-dtor"           # missing virtual dtor
      "-Winconsistent-missing-override "
      "-Wheader-hygiene "            # "using namespace" in a header
      "-Wunused-variable -Wunused-private-field"
      "-Wignored-qualifiers" # ignored "const" qualifiers
      "-Wunreachable-code-return"
      "-Wmissing-field-initializers"

      # conversion issues : those should be enabled later!
      # "-Wfloat-equal "
      #"-Wsign-conversion "
      #"-Wconversion "
  )

  # Those flags can safely be disabled
  set(CLANG_DISABLED_FLAGS_LEGIT
    # https://stackoverflow.com/questions/13905200/is-it-wise-to-ignore-gcc-clangs-wmissing-braces-warning/13905432
    "-Wno-missing-braces"
  )

  # Those flags should be activated later (they denote real issues)
  set(CLANG_DISABLED_FLAGS_DUBIOUS
    "-Wno-float-equal " # comparing floating point with == or != is unsafe [-Wfloat-equal]
    "-Wno-sign-conversion"
    "-Wno-conversion"

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -87,6 +87,7 @@
         /W4           # -> warning level 4
         # /WX         # -> treat warnings as errors
         /wd4251       # -> disable warning: 'identifier': class 'type' needs to have dll-interface to be used by clients of class 'type2'
+        /wd4275       # -> disable warning: non dll-interface struct '...' used as base for dll-interface class '...'
         /wd4592       # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
         # /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
         /wd4127       # -> disable warning: conditional expression is constant (caused by Qt)
@@ -97,7 +98,50 @@
         /bigobj       # (Increase Number of Sections in .Obj file)
     )
     string(REPLACE ";" " " WFLAGS "${WFLAGS}")
+    message("WFLAGS is ${WFLAGS}")
 endif ()
+
+# clang compiler options : add some very useful warnings by default
+
+if ( ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang") )
+  set(CLANG_ADDITIONAL_FLAGS
+    "${EXTRA_FLAGS} "
+      "-Wshadow "                    # Variable shadowing
+      "-Winvalid-source-encoding "
+      "-Wconditional-uninitialized " # Variable used when uninitialized
+      "-Wnon-virtual-dtor"           # missing virtual dtor
+      "-Winconsistent-missing-override "
+      "-Wheader-hygiene "            # "using namespace" in a header
+      "-Wunused-variable -Wunused-private-field"
+      "-Wignored-qualifiers" # ignored "const" qualifiers
+      "-Wunreachable-code-return"
+      "-Wmissing-field-initializers"
+
+      # conversion issues : those should be enabled later!
+      # "-Wfloat-equal "
+      #"-Wsign-conversion "
+      #"-Wconversion "
+  )
+
+  # Those flags can safely be disabled
+  set(CLANG_DISABLED_FLAGS_LEGIT
+    # https://stackoverflow.com/questions/13905200/is-it-wise-to-ignore-gcc-clangs-wmissing-braces-warning/13905432
+    "-Wno-missing-braces"
+  )
+
+  # Those flags should be activated later (they denote real issues)
+  set(CLANG_DISABLED_FLAGS_DUBIOUS
+    "-Wno-float-equal " # comparing floating point with == or != is unsafe [-Wfloat-equal]
+    "-Wno-sign-conversion"
+    "-Wno-conversion"
+  )
+
+  set(EXTRA_FLAGS ${CLANG_ADDITIONAL_FLAGS} ${CLANG_DISABLED_FLAGS_LEGIT} ${CLANG_DISABLED_FLAGS_DUBIOUS})
+  string(REPLACE ";" " " EXTRA_FLAGS "${EXTRA_FLAGS}")
+endif()
+
+
+# GCC compiler options

 # Add "-Werror" flag if requested
 if(OPTION_CXX_WARNINGS_AS_ERRORS)


warn if none of the variables of an exported dependency is defined

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -162,6 +162,9 @@
           if(NOT ${depend_name}_FOUND)
             message(FATAL_ERROR "catkin_package() DEPENDS on '${depend_name}' which must be find_package()-ed before. If it is a catkin package it can be declared as CATKIN_DEPENDS instead without find_package()-ing it.")
           endif()
+          if(NOT DEFINED ${depend_name}_INCLUDE_DIRS AND NOT DEFINED ${depend_name}_LIBRARIES)
+            message(WARNING "catkin_package() DEPENDS on '${depend_name}' but neither '${depend_name}_INCLUDE_DIRS' nor '${depend_name}_LIBRARIES' is defined.")
+          endif()
           list(APPEND PROJECT_DEPENDENCIES_INCLUDE_DIRS ${${depend_name}_INCLUDE_DIRS})
           list(APPEND PROJECT_DEPENDENCIES_LIBRARIES ${${depend_name}_LIBRARIES})
         endif()


added cmake-project specific output directory for binaries

--- cmake/catkin_project.cmake
+++ cmake/catkin_project.cmake
@@ -17,6 +17,9 @@
   if(PROJECT_DEFAULT_ARGS)
     message(FATAL_ERROR "catkin_project() called with unused arguments: ${PROJECT_DEFAULT_ARGS}")
   endif()
+
+  # set project specific output directory for binaries
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${catkin_BUILD_PREFIX}/lib/${PROJECT_NAME} PARENT_SCOPE)

   # stack version provided by stack.cmake/xml
   set(PROJECT_VERSION ${${CATKIN_CURRENT_STACK}_VERSION})


[CMake] Update GetSVN.cmake to use LLVM version control helper scripts.

This allows the logic to work with Git, and also uses the variable names
to match what Clang is actually looking for.

This is a re-application of r190556 and r190808. This changes the interface
of GetSVN.cmake. Clang change to follow.

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

--- cmake/modules/GetSVN.cmake
+++ cmake/modules/GetSVN.cmake
@@ -2,24 +2,44 @@
 #
 # Input variables:
 #   FIRST_SOURCE_DIR  - First source directory
-#   FIRST_REPOSITORY  - The macro to define to the first revision number.
-#   SECOND_SOURCE_DIR - Second source directory
-#   SECOND_REPOSITORY - The macro to define to the second revision number.
+#   FIRST_NAME        - The macro prefix for the first repository's info
+#   SECOND_SOURCE_DIR - Second source directory (opt)
+#   SECOND_NAME       - The macro prefix for the second repository's info (opt)
 #   HEADER_FILE       - The header file to write
-include(FindSubversion)
-if (Subversion_FOUND AND EXISTS "${FIRST_SOURCE_DIR}/.svn")
-  # Repository information for the first repository.
-  Subversion_WC_INFO(${FIRST_SOURCE_DIR} MY)
-  file(WRITE ${HEADER_FILE}.txt "#define ${FIRST_REPOSITORY} \"${MY_WC_REVISION}\"\n")
+#
+# The output header will contain macros FIRST_REPOSITORY and FIRST_REVISION,
+# and SECOND_REPOSITORY and SECOND_REVISION if requested, where "FIRST" and
+# "SECOND" are substituted with the names specified in the input variables.

-  # Repository information for the second repository.
-  if (EXISTS "${SECOND_SOURCE_DIR}/.svn")
-    Subversion_WC_INFO(${SECOND_SOURCE_DIR} MY)
-    file(APPEND ${HEADER_FILE}.txt
-      "#define ${SECOND_REPOSITORY} \"${MY_WC_REVISION}\"\n")
-  endif ()
+# Chop off cmake/modules/GetSVN.cmake
+get_filename_component(LLVM_DIR "${CMAKE_SCRIPT_MODE_FILE}" PATH)
+get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)
+get_filename_component(LLVM_DIR "${LLVM_DIR}" PATH)

-  # Copy the file only if it has changed.
-  execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
-    ${HEADER_FILE}.txt ${HEADER_FILE})
+# Handle strange terminals
+set(ENV{TERM} "dumb")
+
+function(append_info name path)
+  execute_process(COMMAND "${LLVM_DIR}/utils/GetSourceVersion" "${path}"
+    OUTPUT_VARIABLE revision)
+  string(STRIP "${revision}" revision)
+  execute_process(COMMAND "${LLVM_DIR}/utils/GetRepositoryPath" "${path}"
+    OUTPUT_VARIABLE repository
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(STRIP "${repository}" repository)
+  file(APPEND "${HEADER_FILE}.txt"
+    "#define ${name}_REVISION \"${revision}\"\n")
+  file(APPEND "${HEADER_FILE}.txt"
+    "#define ${name}_REPOSITORY \"${repository}\"\n")
+endfunction()
+
+append_info(${FIRST_NAME} "${FIRST_SOURCE_DIR}")
+if(DEFINED SECOND_SOURCE_DIR)
+  append_info(${SECOND_NAME} "${SECOND_SOURCE_DIR}")
 endif()
+
+# Copy the file only if it has changed.
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
+  "${HEADER_FILE}.txt" "${HEADER_FILE}")
+file(REMOVE "${HEADER_FILE}.txt")
+


Fix for case when octave include path does not have /octave.
Use NOT DEFINED logic to avoid 2^n problem seen by Hazen for n repeat
calls to ccmake.

svn path=/trunk/; revision=7099

--- cmake/modules/octave.cmake
+++ cmake/modules/octave.cmake
@@ -91,25 +91,29 @@
   )
   message(STATUS "OCTINTERP_LIBRARIES = ${OCTINTERP_LIBRARIES}")

-  if(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
-    #Must always have second octave include path which is identical
-    #to the first with trailing "/octave" trimmed off.
-    string(REGEX REPLACE "/octave$" ""
-    octave_include_path_trimmed
-    ${OCTAVE_INCLUDE_PATH}
-    )
-    set(OCTAVE_INCLUDE_PATH
-    ${octave_include_path_trimmed} ${OCTAVE_INCLUDE_PATH}
-    CACHE INTERNAL ""
-    )
-    message(STATUS
-    "(transformed) OCTAVE_INCLUDE_PATH = ${OCTAVE_INCLUDE_PATH}"
-    )
-  else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
-    message(STATUS "WARNING: "
-    "octave headers and/or library not found. Disabling octave bindings")
-    set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
-  endif(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
+  if(NOT DEFINED OCTAVE_INCLUDE_PATH_TRIMMED)
+    if(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
+      # If first octave include path has trailing /octave, then must have
+      # second include path without that trailing /octave.
+      string(REGEX REPLACE "/octave$" ""
+      OCTAVE_INCLUDE_PATH_TRIMMED
+      ${OCTAVE_INCLUDE_PATH}
+      )
+      if(NOT OCTAVE_INCLUDE_PATH_TRIMMED STREQUAL "${OCTAVE_INCLUDE_PATH}")
+        set(OCTAVE_INCLUDE_PATH
+	${OCTAVE_INCLUDE_PATH_TRIMMED} ${OCTAVE_INCLUDE_PATH}
+	CACHE INTERNAL ""
+	)
+	message(STATUS
+	"(transformed) OCTAVE_INCLUDE_PATH = ${OCTAVE_INCLUDE_PATH}"
+	)
+      endif(NOT OCTAVE_INCLUDE_PATH_TRIMMED STREQUAL "${OCTAVE_INCLUDE_PATH}")
+    else(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
+      message(STATUS "WARNING: "
+      "octave headers and/or library not found. Disabling octave bindings")
+      set(ENABLE_octave OFF CACHE BOOL "Enable Octave bindings" FORCE)
+    endif(OCTAVE_INCLUDE_PATH AND OCTAVE_LIBRARIES AND OCTINTERP_LIBRARIES)
+  endif(NOT DEFINED OCTAVE_INCLUDE_PATH_TRIMMED)
 endif(ENABLE_octave)

 if(ENABLE_octave)


Fix Boost dependencies (fixes #741)

Fix Boost dependencies (fixes #741)

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -29,9 +29,9 @@
 # Starting with Boost 1.50, boost_thread depends on chrono. As this is not
 # taken care of automatically on Windows, we add an explicit dependency as a
 # workaround.
-if(WIN32 AND Boost_VERSION VERSION_GREATER "1.49")
-  find_package(Boost 1.50.0 REQUIRED COMPONENTS chrono)
-endif(WIN32 AND Boost_VERSION VERSION_GREATER "1.49")
+if(WIN32 AND Boost_VERSION VERSION_GREATER "104900")
+  find_package(Boost 1.40.0 REQUIRED COMPONENTS chrono)
+endif(WIN32 AND Boost_VERSION VERSION_GREATER "104900")

 if(Boost_FOUND)
   set(BOOST_FOUND TRUE)


Make updated toolchain file backwards compatible

--- build/shared/Toolchain_ios.cmake
+++ build/shared/Toolchain_ios.cmake
@@ -28,12 +28,16 @@
 #  A macro used to find executable programs on the host system, not within the iOS environment.
 #  Thanks to the android-cmake project for providing the command

+# enforce build static libs on iOS
+set(XMP_BUILD_STATIC "ON")
+
 # Standard settings
 set (CMAKE_SYSTEM_NAME Darwin)
 set (CMAKE_SYSTEM_VERSION 1)
 set (UNIX True)
 set (APPLE True)
 set (IOS True)
+set (APPLE_IOS True)

 # Required as of cmake 2.8.10
 set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE)


Allow all sources, including non C or CXX sources to be checked.

This enables header files to be checked. What we were really trying
to filter out was ghost sources created by add_custom_target, which
we can do easily by just filtering out any source who's last
component matches the target name.

--- CPPCheck.cmake
+++ CPPCheck.cmake
@@ -965,26 +965,21 @@

 endfunction (cppcheck_sources)

-function (_get_target_c_or_cxx_sources RETURN_SOURCES TARGET)
+function (_strip_add_custom_target_sources RETURN_SOURCES TARGET)

     get_target_property (_sources ${TARGET} SOURCES)
-    set (_files_to_check)
-    foreach (_file ${_sources})
-
-        get_source_file_property (_lang ${_file} LANGUAGE)
-        get_source_file_property (_location ${_file} LOCATION)
-
-        if ("${_lang}" MATCHES "CXX" OR
-            "${_lang}" MATCHES "C")
-
-            list (APPEND _files_to_check ${_location})
-
-        endif ("${_lang}" MATCHES "CXX" OR
-               "${_lang}" MATCHES "C")
-
-    endforeach ()
-
-    set (${RETURN_SOURCES} ${_files_to_check} PARENT_SCOPE)
+    list (GET _sources 0 _first_source)
+    string (FIND "${_first_source}" "/" LAST_SLASH REVERSE)
+    math (EXPR LAST_SLASH "${LAST_SLASH} + 1")
+    string (SUBSTRING "${_first_source}" ${LAST_SLASH} -1 END_OF_SOURCE)
+
+    if (END_OF_SOURCE STREQUAL "${TARGET}")
+
+        list (REMOVE_AT _sources 0)
+
+    endif (END_OF_SOURCE STREQUAL "${TARGET}")
+
+    set (${RETURN_SOURCES} ${_sources} PARENT_SCOPE)

 endfunction ()

@@ -1009,7 +1004,7 @@
 #                              sources is definitely a C++ header file
 function (cppcheck_target_sources TARGET)

-    _get_target_c_or_cxx_sources (_files_to_check ${TARGET})
+    _strip_add_custom_target_sources (_files_to_check ${TARGET})

     set (EXTRA_OPTIONS)
     set (MULTIVALUE_OPTIONS INCLUDES)
@@ -1042,7 +1037,7 @@
 function (cppcheck_add_target_sources_to_unused_function_check TARGET
                                                                WHICH)

-    _get_target_c_or_cxx_sources (_files_to_check ${TARGET})
+    _strip_add_custom_target_sources (_files_to_check ${TARGET})

     cppcheck_add_to_unused_function_check (${WHICH}
                                            TARGETS ${TARGET}


FindHIP: Initial support for HIP_ADD_LIBRARY

Change-Id: Ic8b93c2a9daff2dddb3a94b62981d3a1f03afd5c

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -342,6 +342,24 @@
     HIP_PARSE_HIPCC_OPTIONS(HIP_HCC_FLAGS ${_hcc_options})
     HIP_PARSE_HIPCC_OPTIONS(HIP_NVCC_FLAGS ${_nvcc_options})

+    # Check if we are building shared library.
+    set(_hip_build_shared_libs FALSE)
+    list(FIND _hip_cmake_options SHARED _hip_found_SHARED)
+    list(FIND _hip_cmake_options MODULE _hip_found_MODULE)
+    if(_hip_found_SHARED GREATER -1 OR _hip_found_MODULE GREATER -1)
+        set(_hip_build_shared_libs TRUE)
+    endif()
+    list(FIND _hip_cmake_options STATIC _hip_found_STATIC)
+    if(_hip_found_STATIC GREATER -1)
+        set(_hip_build_shared_libs FALSE)
+    endif()
+
+    # If we are building a shared library, add extra flags to HIP_HIPCC_FLAGS
+    if(_hip_build_shared_libs)
+        list(APPEND HIP_HCC_FLAGS "-fPIC")
+        list(APPEND HIP_NVCC_FLAGS "--shared -Xcompiler '-fPIC'")
+    endif()
+
     # Set host compiler
     set(HIP_HOST_COMPILER "${CMAKE_${HIP_C_OR_CXX}_COMPILER}")

@@ -458,4 +476,15 @@
     set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE HIP)
 endmacro()

+###############################################################################
+# HIP_ADD_LIBRARY
+###############################################################################
+macro(HIP_ADD_LIBRARY hip_target)
+    # Separate the sources from the options
+    HIP_GET_SOURCES_AND_OPTIONS(_sources _cmake_options _hipcc_options _hcc_options _nvcc_options ${ARGN})
+    HIP_PREPARE_TARGET_COMMANDS(${hip_target} OBJ _generated_files ${_sources} ${_cmake_options} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options})
+    add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
+    set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX})
+endmacro()
+
 # vim: ts=4:sw=4:expandtab:smartindent


Print TBB version in FindTBB

Print TBB version in FindTBB

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -280,4 +280,5 @@
 	FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
 	STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
 	set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
+        message(STATUS "TBB interface version: ${TBB_INTERFACE_VERSION}")
 endif (TBB_FOUND)


Don't check the LOCATION property.

Don't check the LOCATION property.

Reading the LOCATION property is deprecated in newer versions of CMake.
Instead read the TYPE property in order to determine if this was a
target created by add_custom_target.

--- VeraPPUtilities.cmake
+++ VeraPPUtilities.cmake
@@ -290,18 +290,17 @@
              --warning)
     endif (MODE STREQUAL "ERROR")

-    get_property (TARGET_LOCATION_SET
+    get_property (TARGET_TYPE
                   TARGET ${TARGET}
-                  PROPERTY LOCATION
-                  SET)
-
-    set (WHEN PRE_BUILD)
-
-    if (TARGET_LOCATION_SET)
-
-        set (WHEN PRE_LINK)
-
-    endif (TARGET_LOCATION_SET)
+                  PROPERTY TYPE)
+
+    set (WHEN PRE_LINK)
+
+    if (TARGET_TYPE STREQUAL "UTILITY")
+
+        set (WHEN PRE_BUILD)
+
+    endif (TARGET_TYPE STREQUAL "UTILITY")

     # Double dereference SOURCES_VAR as SOURCES_VAR
     # just refers to the list name and not the list itself


Corrected case for tomviz

Corrected case for tomviz

--- cmake/DetermineTomVizVersion.cmake
+++ cmake/DetermineTomVizVersion.cmake
@@ -1,5 +1,5 @@
 # This needs to set a the following variables which are using in various
-# bundling codes to determine TomViz version.
+# bundling codes to determine tomviz version.
 #   tomviz_version_major
 #   tomviz_version_minor
 #   tomviz_version_patch
@@ -32,19 +32,19 @@

   # First, set the vars using the hard coded version if everything fails.
   _set_version_vars(${hardcoded_tomviz_version})
-  include("${TOMVIZ_SOURCE_DIR}/Utilities/Git/Git.cmake" OPTIONAL)
-  include("${TOMVIZ_SOURCE_DIR}/CMake/TomVizDetermineVersion.cmake" OPTIONAL
+  include("${TOMVIZ_SOURCE_DIR}/cmake/Git.cmake" OPTIONAL)
+  include("${TOMVIZ_SOURCE_DIR}/cmake/tomvizDetermineVersion.cmake" OPTIONAL
     RESULT_VARIABLE status)
   if (status)
-    message(STATUS "Using git-describe to determine TomViz version")
-    # the TomViz module was correctly imported.
+    message(STATUS "Using git-describe to determine tomviz version")
+    # the tomviz module was correctly imported.
     determine_version("${TOMVIZ_SOURCE_DIR}" "${GIT_EXECUTABLE}" "__TMP")
     if (__TMP_VERSION_FULL)
       _set_version_vars(${__TMP_VERSION_FULL})
     endif()
   endif()

-  # make the TomViz_VERSION variable internal to avoid confusion.
+  # make the TOMVIZ_VERSION variable internal to avoid confusion.
   set (TOMVIZ_VERSION "${hardcoded_tomviz_version}" CACHE INTERNAL "")
 else()
   # The user has to specify the version to use.
@@ -54,4 +54,4 @@
   _set_version_vars(${TOMVIZ_VERSION})
 endif()

-message(STATUS "Using TomViz Version: ${tomviz_version_long} (${tomviz_version_major}|${tomviz_version_minor}|${tomviz_version_patch}|${tomviz_version_suffix})")
+message(STATUS "Using tomviz Version: ${tomviz_version_long} (${tomviz_version_major}|${tomviz_version_minor}|${tomviz_version_patch}|${tomviz_version_suffix})")


Disable unudes argument warning

Disable unudes argument warning

--- cmake/EnableCompilerWarnings.cmake
+++ cmake/EnableCompilerWarnings.cmake
@@ -193,6 +193,8 @@
                 -Wweak-template-vtables
                 # -Wweak-vtables
                 -Wwrite-strings
+
+                -Wno-unused-command-line-argument
             )
         else()
             list(APPEND CMAKE_COMPILER_WARNINGS


CMake: Don't run 'git svn' if there is no .git/svn directory.

If the local checkout does not have 'git svn' references set up, don't try
to use 'git svn' for version information.

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

--- cmake/modules/VersionFromVCS.cmake
+++ cmake/modules/VersionFromVCS.cmake
@@ -20,49 +20,51 @@
   elseif( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git )
     set(result "${result}git")
     # Try to get a ref-id
-    find_program(git_executable NAMES git git.exe git.cmd)
-    if( git_executable )
-      set(is_git_svn_rev_exact false)
-      execute_process(COMMAND ${git_executable} svn log --limit=1 --oneline
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-                      TIMEOUT 5
-                      RESULT_VARIABLE git_result
-                      OUTPUT_VARIABLE git_output)
-      if( git_result EQUAL 0 )
-        string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
-        string(LENGTH "${git_svn_rev}" rev_length)
-        math(EXPR rev_length "${rev_length}-1")
-        string(SUBSTRING "${git_svn_rev}" 1 ${rev_length} git_svn_rev_number)
-        set(SVN_REVISION ${git_svn_rev_number} PARENT_SCOPE)
-        set(git_svn_rev "-svn-${git_svn_rev}")
+    if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/svn )
+      find_program(git_executable NAMES git git.exe git.cmd)
+      if( git_executable )
+        set(is_git_svn_rev_exact false)
+        execute_process(COMMAND ${git_executable} svn log --limit=1 --oneline
+          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+          TIMEOUT 5
+          RESULT_VARIABLE git_result
+          OUTPUT_VARIABLE git_output)
+        if( git_result EQUAL 0 )
+          string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
+          string(LENGTH "${git_svn_rev}" rev_length)
+          math(EXPR rev_length "${rev_length}-1")
+          string(SUBSTRING "${git_svn_rev}" 1 ${rev_length} git_svn_rev_number)
+          set(SVN_REVISION ${git_svn_rev_number} PARENT_SCOPE)
+          set(git_svn_rev "-svn-${git_svn_rev}")

-        # Determine if the HEAD points directly at a subversion revision.
-        execute_process(COMMAND ${git_executable} svn find-rev HEAD
-                        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-                        TIMEOUT 5
-                        RESULT_VARIABLE git_result
-                        OUTPUT_VARIABLE git_output)
-        if( git_result EQUAL 0 )
-          string(STRIP "${git_output}" git_head_svn_rev_number)
-          if( git_head_svn_rev_number EQUAL git_svn_rev_number )
-            set(is_git_svn_rev_exact true)
+          # Determine if the HEAD points directly at a subversion revision.
+          execute_process(COMMAND ${git_executable} svn find-rev HEAD
+            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+            TIMEOUT 5
+            RESULT_VARIABLE git_result
+            OUTPUT_VARIABLE git_output)
+          if( git_result EQUAL 0 )
+            string(STRIP "${git_output}" git_head_svn_rev_number)
+            if( git_head_svn_rev_number EQUAL git_svn_rev_number )
+              set(is_git_svn_rev_exact true)
+            endif()
           endif()
+        else()
+          set(git_svn_rev "")
         endif()
-      else()
-        set(git_svn_rev "")
-      endif()
-      execute_process(COMMAND
-                      ${git_executable} rev-parse --short HEAD
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-                      TIMEOUT 5
-                      RESULT_VARIABLE git_result
-                      OUTPUT_VARIABLE git_output)
-      if( git_result EQUAL 0 AND NOT is_git_svn_rev_exact )
-        string(STRIP "${git_output}" git_ref_id)
-        set(GIT_COMMIT ${git_ref_id} PARENT_SCOPE)
-        set(result "${result}${git_svn_rev}-${git_ref_id}")
-      else()
-        set(result "${result}${git_svn_rev}")
+        execute_process(COMMAND
+          ${git_executable} rev-parse --short HEAD
+          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+          TIMEOUT 5
+          RESULT_VARIABLE git_result
+          OUTPUT_VARIABLE git_output)
+        if( git_result EQUAL 0 AND NOT is_git_svn_rev_exact )
+          string(STRIP "${git_output}" git_ref_id)
+          set(GIT_COMMIT ${git_ref_id} PARENT_SCOPE)
+          set(result "${result}${git_svn_rev}-${git_ref_id}")
+        else()
+          set(result "${result}${git_svn_rev}")
+        endif()
       endif()
     endif()
   endif()


boards: px4_fmu-v5_optimized don't build all mags

--- boards/px4/fmu-v5/optimized.cmake
+++ boards/px4/fmu-v5/optimized.cmake
@@ -39,7 +39,8 @@
 		lights/rgbled
 		lights/rgbled_ncp5623c
 		#lights/rgbled_pwm
-		magnetometer # all available magnetometer drivers
+		#magnetometer # all available magnetometer drivers
+		magnetometer/ist8310
 		optical_flow # all available optical flow drivers
 		#pwm_input
 		pwm_out_sim


updated linux

updated linux

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -757,16 +757,17 @@

     if(WIN32)
       set(VTKM_CONT_LIB "lib/vtkm_cont-${VTKM_VER}.lib")
-      set(VTKM_FILTER_LIB "lib/vtkm_filter-${VTKM_VER}.lib")
+      #set(VTKM_FILTER_LIB "lib/vtkm_filter-${VTKM_VER}.lib")
       set(VTKM_RENDERER_LIB "lib/vtkm_rendering-${VTKM_VER}.lib")
-      set(VTKM_SOURCE_LIB "lib/vtkm_source-${VTKM_VER}.lib")
+      #set(VTKM_SOURCE_LIB "lib/vtkm_source-${VTKM_VER}.lib")
       set(VTKM_WORKLET_LIB "lib/vtkm_worklet-${VTKM_VER}.lib")
     else()
-      set(VTKM_CONT_LIB "lib/libvtkm_cont-${VTKM_VER}.so.${LIB_VER}")
-      #set(VTKM_FILTER_LIB "lib/libvtkm_filter-${VTKM_VER}.so.${LIB_VER}")
-      set(VTKM_RENDERER_LIB "lib/libvtkm_rendering-${VTKM_VER}.so.${LIB_VER}")
-      #set(VTKM_SOURCE_LIB "lib/libvtkm_source-${VTKM_VER}.so.${LIB_VER}")
-      set(VTKM_WORKLET_LIB "lib/libvtkm_worklet-${VTKM_VER}.so.${LIB_VER}")
+      include(GNUInstallDirs)
+      set(VTKM_CONT_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_cont-${VTKM_VER}.a")
+      #set(VTKM_FILTER_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_filter-${VTKM_VER}.a")
+      set(VTKM_RENDERER_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_rendering-${VTKM_VER}.a")
+      #set(VTKM_SOURCE_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_source-${VTKM_VER}.a")
+      set(VTKM_WORKLET_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_worklet-${VTKM_VER}.a")
     endif()

     option(vtkm_ENABLE_CUDA "Option to build vtkm with cuda enabled" OFF)


Don't use deprecated libsystemd-daemon.so, use libsystemd.so instead. #6075

Since systemd-209, systemd-daemon has been deprecated, and now in Fedora 25
they actually no longer ship that library.  Since RHEL7 ships with
systemd-219, and we don't support anything older than that running systemd
(ie who care about supporting ancient Fedoras).

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -551,7 +551,11 @@

     check_include_files("systemd/sd-daemon.h" HAVE_SD_DAEMON_H)
     if (HAVE_SD_DAEMON_H)
-        find_library(LIBSYSTEMD_DAEMON_PATH systemd-daemon)
+		# Since systemd-209, libsystemd-daemon.so has been deprecated
+		# and the symbols in that library now are in libsystemd.so.
+		# Since RHEL7 ships with systemd-219, it seems find for us to
+		# always use libsystemd and not worry about libsystemd-daemon.
+        find_library(LIBSYSTEMD_DAEMON_PATH systemd)
         find_so_name(LIBSYSTEMD_DAEMON_SO ${LIBSYSTEMD_DAEMON_PATH})
     endif()


Preparing for big sim on tetralith

Preparing for big sim on tetralith

Former-commit-id: 23e725655ac919720471f739e77274945fc3d740

--- cmake-modules/Fetch_HDF5_2.cmake
+++ cmake-modules/Fetch_HDF5_2.cmake
@@ -14,7 +14,7 @@
     #        list(APPEND HDF5_INCLUDE_DIR  $ENV{MPI_INCLUDE})
     #    endif()
 else()
-    # Try finding in system. While avoiding Python anaconda's version.
+    # Try finding in system.
     # Usually there is an executable present in system, "h5c++"

     find_file(HDF5_C_COMPILER_EXECUTABLE NAMES h5cc PATHS /usr/bin /usr/local/bin NO_DEFAULT_PATH)
@@ -31,15 +31,16 @@
     set(HDF5_CXX_LIBRARY       ${HDF5_CXX_LIBRARY_hdf5_cpp})
     set(HDF5_CXX_HL_LIBRARY    ${HDF5_CXX_LIBRARY_hdf5_hl_cpp})
     set(HDF5_LINKER_FLAGS       -Wl,--no-as-needed -ldl -lm -lz -Wl,--as-needed)
+    set(HDF5_EXTRA_LIBS        ${HDF5_CXX_LIBRARY_iomp5} ${HDF5_CXX_LIBRARY_sz})

 endif()

-if(HDF5_LIBRARIES MATCHES "anaconda")
-    message("Found anaconda version. Ignoring...")
-    set(HDF5_ANACONDA ON)
-endif()
+#if(HDF5_LIBRARIES MATCHES "anaconda")
+#    message("Found anaconda version. Ignoring...")
+#    set(HDF5_ANACONDA ON)
+#endif()

-if(HDF5_FOUND AND NOT HDF5_ANACONDA AND HDF5_CXX_HL_LIBRARY)
+if(HDF5_FOUND AND HDF5_CXX_HL_LIBRARY)
     # To print all variables, use the code below:
     #
     #    get_cmake_property(_variableNames VARIABLES)
@@ -64,6 +65,7 @@
     message(STATUS "   HDF5_CXX_HL_LIBRARY      : ${HDF5_CXX_HL_LIBRARY}")
     message(STATUS "   HDF5_INCLUDE_DIR         : ${HDF5_INCLUDE_DIR}")
     message(STATUS "   HDF5_LINKER_FLAGS        : ${HDF5_LINKER_FLAGS}")
+    message(STATUS "   HDF5_EXTRA_LIBS          : ${HDF5_EXTRA_LIBS}")

     # Add convenience libraries
@@ -119,7 +121,7 @@
 set(HDF5_LIBRARIES  ${HDF5_CXX_HL_LIBRARY} ${HDF5_CXX_LIBRARY} ${HDF5_C_HL_LIBRARY} ${HDF5_C_LIBRARY}  )

 set_target_properties(hdf5 PROPERTIES
-        INTERFACE_LINK_LIBRARIES        "${HDF5_LIBRARIES};${HDF5_LINKER_FLAGS};${PTHREAD_LIBRARY}"
+        INTERFACE_LINK_LIBRARIES        "${HDF5_LIBRARIES};${HDF5_EXTRA_LIBS};${HDF5_LINKER_FLAGS};${PTHREAD_LIBRARY}"
         INTERFACE_INCLUDE_DIRECTORIES   "${HDF5_INCLUDE_DIR}"
 #        INTERFACE_LINK_OPTIONS          "${HDF5_LINKER_FLAGS}"
         )


Reverted last change to findMSP that broke the build

--- cmake/CMakeModules/FindMSP.cmake
+++ cmake/CMakeModules/FindMSP.cmake
@@ -74,6 +74,7 @@
   FIND_MSP_LIBRARY(MSPImagingGeometryService LIBS_OK)
   FIND_MSP_LIBRARY(MSPjson LIBS_OK)
   FIND_MSP_LIBRARY(MSPmens LIBS_OK)
+  FIND_MSP_LIBRARY(MSPTerrainService LIBS_OK)
   FIND_MSP_LIBRARY(MSPMensurationService LIBS_OK)
   FIND_MSP_LIBRARY(MSPMensurationSessionRecordService LIBS_OK)
   FIND_MSP_LIBRARY(MSPwriteRsmNitf LIBS_OK)


CodeCoverage.cmake: don't drop '*/*Decoder*.*'

--- cmake/Modules/CodeCoverage.cmake
+++ cmake/Modules/CodeCoverage.cmake
@@ -98,7 +98,7 @@
   COMMAND ${LCOV_PATH} --directory ${CMAKE_BINARY_DIR} --capture --output-file ${coverage_info}
   # COMMAND ${LCOV_PATH} --remove ${coverage_info} 'test/*' '/usr/*' --output-file ${coverage_cleaned}
   COMMAND ${LCOV_PATH} --extract ${coverage_info} '*/librawspeed/*' --output-file ${coverage_cleaned}
-  COMMAND ${LCOV_PATH} --remove ${coverage_cleaned} '*/*Test.cpp' '*/*Decoder*.*' --output-file ${coverage_final}
+  COMMAND ${LCOV_PATH} --remove ${coverage_cleaned} '*/*Test.cpp' --output-file ${coverage_final}
   COMMAND ${GENHTML_PATH} --demangle-cpp --precision 2 -o coverage ${coverage_final}
   COMMAND ${CMAKE_COMMAND} -E remove ${coverage_info} ${coverage_cleaned} ${coverage_final}

@@ -153,7 +153,7 @@
 		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${coverage_info}
 		# COMMAND ${LCOV_PATH} --remove ${coverage_info} 'test/*' '/usr/*' --output-file ${coverage_cleaned}
 		COMMAND ${LCOV_PATH} --extract ${coverage_info} '*/librawspeed/*' --output-file ${coverage_cleaned}
-		COMMAND ${LCOV_PATH} --remove ${coverage_cleaned} '*/*Test.cpp' '*/*Decoder*.*' --output-file ${coverage_final}
+                COMMAND ${LCOV_PATH} --remove ${coverage_cleaned} '*/*Test.cpp' --output-file ${coverage_final}
 		COMMAND ${GENHTML_PATH} --demangle-cpp --precision 2 -o ${_outputname} ${coverage_final}
 		COMMAND ${CMAKE_COMMAND} -E remove ${coverage_info} ${coverage_cleaned} ${coverage_final}


DML EP fix training build error (#12461)

Fix onnxruntime_training.cmake missing linkage issue

--- cmake/onnxruntime_training.cmake
+++ cmake/onnxruntime_training.cmake
@@ -120,6 +120,7 @@
       onnxruntime_session
       ${onnxruntime_libs}
       ${PROVIDERS_MKLDNN}
+      ${PROVIDERS_DML}
       onnxruntime_optimizer
       onnxruntime_providers
       onnxruntime_util


Cleanup ZLIB/hunter.cmake

Cleanup ZLIB/hunter.cmake

--- cmake/projects/ZLIB/hunter.cmake
+++ cmake/projects/ZLIB/hunter.cmake
@@ -12,11 +12,22 @@
     PACKAGE_NAME
     ZLIB
     VERSION
-    "1.2.8-p3"
+    "1.2.8-hunter"
     URL
-    "https://github.com/hunter-packages/zlib/archive/v1.2.8-p3.tar.gz"
+    "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter.tar.gz"
     SHA1
-    573dc28474be47d0c7abc1475a14aa12f0dfcadc
+    75a05fcc928ed52e1eeb93f07a1c78a7890860c0
+)
+
+hunter_add_version(
+    PACKAGE_NAME
+    ZLIB
+    VERSION
+    "1.2.8-hunter-1"
+    URL
+    "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter-1.tar.gz"
+    SHA1
+    24c89e4b193a56bb411fa9878968002ebe2c6209
 )

 hunter_add_version(
@@ -34,29 +45,17 @@
     PACKAGE_NAME
     ZLIB
     VERSION
-    "1.2.8-hunter-1"
+    "1.2.8-p3"
     URL
-    "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter-1.tar.gz"
+    "https://github.com/hunter-packages/zlib/archive/v1.2.8-p3.tar.gz"
     SHA1
-    24c89e4b193a56bb411fa9878968002ebe2c6209
-)
-
-hunter_add_version(
-    PACKAGE_NAME
-    ZLIB
-    VERSION
-    "1.2.8-hunter"
-    URL
-    "https://github.com/hunter-packages/zlib/archive/v1.2.8-hunter.tar.gz"
-    SHA1
-    75a05fcc928ed52e1eeb93f07a1c78a7890860c0
+    573dc28474be47d0c7abc1475a14aa12f0dfcadc
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(ZLIB)
-hunter_download(PACKAGE_NAME ZLIB
+hunter_download(PACKAGE_NAME ZLIB
     PACKAGE_INTERNAL_DEPS_ID "1"
-    PACKAGE_UNRELOCATABLE_TEXT_FILES
+    PACKAGE_UNRELOCATABLE_TEXT_FILES
     "share/pkgconfig/zlib.pc"
 )
-


Updated PyBind11.

Updated PyBind11.

--- cmake/third_party/pybind11.cmake
+++ cmake/third_party/pybind11.cmake
@@ -1,8 +1,8 @@
 message("Fetching pybind11")
 FetchContent_Declare(
   pybind11
-  URL      https://github.com/pybind/pybind11/archive/refs/tags/v2.7.1.tar.gz
-  URL_HASH SHA256=616d1c42e4cf14fa27b2a4ff759d7d7b33006fdc5ad8fd603bb2c22622f27020
+  URL      https://github.com/pybind/pybind11/archive/refs/tags/v2.10.1.tar.gz
+  URL_HASH SHA256=111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad
 )

 FetchContent_GetProperties(pybind11)


Pass along arguments to python script in InvokePython.cmake.

--- cmake_modules/InvokePython.cmake
+++ cmake_modules/InvokePython.cmake
@@ -1,22 +1,23 @@
 # Invokes python on a given string with script name followed by args.

 function( INVOKEPYTHON )
-    message( STATUS "INVOKEPYTHON [${ARGV}]" )
+    # Consume the first argument from the list: script name
+    SET( PYSCRIPT "${ARGV0}" )
+    list(REMOVE_AT ARGV 0 )

-    # @TODO This was a pain to get to work and likely not the best solution...
     set (python_cmd "python")
-    message(STATUS "Invoking ${python_cmd} ${ARGV0}:" )
-    execute_process(COMMAND ${python_cmd} ${ARGV0}
+    message(STATUS "Invoking ${python_cmd} ${PYSCRIPT} ${ARGV}:" )
+    execute_process(COMMAND ${python_cmd} ${PYSCRIPT} ${ARGV}
         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
         RESULT_VARIABLE python_result
         OUTPUT_VARIABLE python_output)
-
+
     # @TODO check the output of the execute_process and check for success.
     # This was difficult to find the docs for the Windows version of this, which prints
     # "The system cannot find the file specified".
     message(STATUS "${python_output}" )
     message(STATUS "${python_result}" )
-
+
     if(python_result STREQUAL "0")
         message(STATUS "${python_arg} success." )
     else(python_result STREQUAL "0")


fix(flexisip.spec): do not export *.pc and *.so.*

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -177,8 +177,6 @@
 %{_docdir}
 %{_bindir}/*
 %{_libdir}/*.so
-%{_libdir}/*.so.*
-%{_libdir}/pkgconfig/*.pc

 %if @ENABLE_PRESENCE@
 %{_sysconfdir}/init.d/flexisip-presence


Added -pthread link flag

Added -pthread link flag

--- config/config.cmake
+++ config/config.cmake
@@ -94,7 +94,7 @@

 # Add the shared build flags, if necessary
 if (SHAREDSTATIC STREQUAL "SHARED")
-#  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -shared")
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
 else (SHAREDSTATIC STREQUAL "SHARED")
 endif (SHAREDSTATIC STREQUAL "SHARED")


appveyor

appveyor

--- cmake/Modules/FindLibevent2.cmake
+++ cmake/Modules/FindLibevent2.cmake
@@ -6,7 +6,7 @@
 	FIND_PATH(LIBEVENT2_INCLUDE_DIR event2/event.h)

 	if(CMAKE_CL_64)
-		FIND_LIBRARY(LIBEVENT2_LIBRARIES NAMES libevent-x64-v120-mt-gd-2_1_4_0 event libevent )
+		FIND_LIBRARY(LIBEVENT2_LIBRARIES NAMES libevent-x64-v120-mt-2_1_4_0 event libevent )
 	else()
 		FIND_LIBRARY(LIBEVENT2_LIBRARIES NAMES libevent-x86-v120-mt-2_1_4_0 event libevent )
 	endif()


cmake: support rpath-link linker option

cmake: support rpath-link linker option

- builds with CMAKE_SKIP_RPATH=ON should properly find project .so files from <build>/lib directory
- $ORIGIN doesn't work properly in cross-compilation mode

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -396,3 +396,23 @@
     add_definitions(-DOPENCV_ENABLE_MEMORY_SANITIZER=1)
   endif()
 endmacro()
+
+# adjust -Wl,-rpath-link
+if(CMAKE_SKIP_RPATH)
+  if((NOT CMAKE_CROSSCOMPILING OR OPENCV_ENABLE_LINKER_RPATH_LINK_ORIGIN) AND NOT OPENCV_SKIP_LINKER_RPATH_LINK_ORIGIN)
+    if(DEFINED CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN)
+      list(APPEND CMAKE_PLATFORM_RUNTIME_PATH "${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}")
+    else()
+      list(APPEND CMAKE_PLATFORM_RUNTIME_PATH "\$ORIGIN")
+    endif()
+  elseif(NOT OPENCV_SKIP_LINKER_RPATH_LINK_BINARY_LIB)
+    list(APPEND CMAKE_PLATFORM_RUNTIME_PATH "${LIBRARY_OUTPUT_PATH}")
+  endif()
+endif()
+if(OPENCV_EXTRA_RPATH_LINK_PATH)
+  string(REPLACE ":" ";" OPENCV_EXTRA_RPATH_LINK_PATH_ "${OPENCV_EXTRA_RPATH_LINK_PATH}")
+  list(APPEND CMAKE_PLATFORM_RUNTIME_PATH ${OPENCV_EXTRA_RPATH_LINK_PATH_})
+  if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
+    message(WARNING "OPENCV_EXTRA_RPATH_LINK_PATH may not work properly because CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG is not defined (not supported)")
+  endif()
+endif()


[CMake] Include clang-apply-replacements in Fuchsia toolchain

This is needed for run-clang-tidy.py.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@346827 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -156,6 +156,7 @@
   libclang
   lld
   LTO
+  clang-apply-replacements
   clang-format
   clang-headers
   clang-include-fixer


Additional fix for ROOT-8701

Additional fix for ROOT-8701

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -228,7 +228,9 @@

   #---Get the list of include directories------------------
   get_directory_property(incdirs INCLUDE_DIRECTORIES)
-
+  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc)
+    set(localinclude ${CMAKE_CURRENT_SOURCE_DIR}/inc)
+  endif()
   #---Get the list of header files-------------------------
   set(headerfiles)
   set(fullheaderfiles)
@@ -245,7 +247,7 @@
       list(APPEND headerfiles ${fp})
       list(APPEND fullheaderfiles ${fp})
     else()
-      find_file(headerFile ${fp} HINTS ${incdirs})
+      find_file(headerFile ${fp} HINTS ${localinclude} ${incdirs})
       list(APPEND headerfiles ${fp})
       if(headerFile)
         list(APPEND fullheaderfiles ${headerFile})


Add d2FH4- flag to cuda (#3105)

Add d2FH4- flag to cuda (#3105)

--- cmake/onnxruntime_providers.cmake
+++ cmake/onnxruntime_providers.cmake
@@ -146,6 +146,8 @@
             "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-Wno-reorder>")
     target_compile_options(onnxruntime_providers_cuda PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler -Wno-error=sign-compare>"
             "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-Wno-error=sign-compare>")
+  elseif(HAS_D2FH4)
+    target_compile_options(onnxruntime_providers_cuda PRIVATE "$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler /d2FH4->")
   endif()
   onnxruntime_add_include_to_target(onnxruntime_providers_cuda onnxruntime_common onnxruntime_framework onnx onnx_proto protobuf::libprotobuf)
   add_dependencies(onnxruntime_providers_cuda ${onnxruntime_EXTERNAL_DEPENDENCIES} ${onnxruntime_tvm_dependencies})


Handle interface targets differently

Handle interface targets differently

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -32,7 +32,12 @@
 	else()
 		if (NOT MSVC)
 			# Modern, clean way to do this:
-			target_compile_features(${_TARGET} PUBLIC cxx_std_17)
+			get_target_property(target_type ${_TARGET} TYPE)
+			if (${target_type} STREQUAL "INTERFACE_LIBRARY")
+				target_compile_features(${_TARGET} INTERFACE cxx_std_17)
+			else()
+				target_compile_features(${_TARGET} PUBLIC cxx_std_17)
+			endif()
 		else()
 			# At present (CMake 3.12 + MSVC 19.15.26732.1) it seems cxx_std_17
 			# does not enable C++17 in MSVC (!).


+ py-ext cmake: __init__.py template now may be customized

--- contrib/cmake/PyExtensions.cmake
+++ contrib/cmake/PyExtensions.cmake
@@ -33,6 +33,7 @@
 #                    [LINK_LIBS <lib1> <lib2> ...]
 #                    [WRAPPER_SOUCES <lstvariable_name>]
 #                    [SETUP_TEMPLATE <setup.py.in-path>]
+#                    [INIT_TEMPLATE <__init__.py.in>]
 #                    [NO_INIT_FILE] )
 # Please, note that one can specify Python_ADDITIONAL_VERSIONS to point out
 # desired versions of python to be used. Like that:
@@ -42,7 +43,7 @@
 function( goo_py_extensions )
     # Function signature:
     set( options NO_INIT_FILE )
-    set( oneValueArgs PKG_NAME WRAPPER_SOUCES SETUP_TEMPLATE )
+    set( oneValueArgs PKG_NAME WRAPPER_SOUCES SETUP_TEMPLATE INIT_TEMPLATE )
     set( multiValueArgs INTERFACES LINK_LIBS )
     cmake_parse_arguments( py_extensions
             "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -116,11 +117,20 @@
     # Form __all__ variable in __init__.py file according to
     # enabled targets
     if( NOT py_extensions_NO_INIT_FILE )
-        message( STATUS "__init__.py will be generated for ${PYPKGNM}" )
-        configure_file( ${THIS_MODULE_DIR}/PyExtensions_init-template.in
+        if( py_extensions_INIT_TEMPLATE )
+            set( INIT_PY_TEMPLATE ${py_extensions_INIT_TEMPLATE} )
+        else( py_extensions_INIT_TEMPLATE )
+            set( INIT_PY_TEMPLATE ${THIS_MODULE_DIR}/PyExtensions_init-template.in )
+        endif( py_extensions_INIT_TEMPLATE )
+        message( STATUS "__init__.py will be generated for ${PYPKGNM} from ${INIT_PY_TEMPLATE}" )
+        configure_file( ${INIT_PY_TEMPLATE}
                         ${CMAKE_CURRENT_BINARY_DIR}/__init__.py )
         #install( FILES ${CMAKE_CURRENT_BINARY_DIR}/__init__.py
         #DESTINATION ${PY_MODULES_INSTALL_DIR}/${PYPKGNM} )
+    else( NOT py_extensions_NO_INIT_FILE )
+        if( py_extensions_INIT_TEMPLATE )
+            message( FATAL_ERROR "INIT_TEMPLATE specified together with NO_INIT_FILE." )
+        endif( py_extensions_INIT_TEMPLATE )
     endif( NOT py_extensions_NO_INIT_FILE )

     if( py_extensions_SETUP_TEMPLATE )


Fix for ROOT-8429 - Error during dictionary creation of PyMVA on SuSe 13.1 and OpenSuSE Leap 42.1

--- cmake/modules/FindNumPy.cmake
+++ cmake/modules/FindNumPy.cmake
@@ -10,7 +10,7 @@
 #  NUMPY_VERSION_MINOR       - the minor version number of NumPy
 #  NUMPY_VERSION_PATCH       - the patch version number of NumPy
 #  NUMPY_VERSION_DECIMAL     - e.g. version 1.6.1 is 10601
-#  NUMPY_INCLUDE_DIRS        - path to the NumPy include files
+#  NUMPY_INCLUDE_DIRS        - path to the NumPy include files (non cached)

 #============================================================================
 # Copyright 2012 Continuum Analytics, Inc.
@@ -71,7 +71,7 @@
 string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES})
 # Just in case there is unexpected output from the Python command.
 list(GET _NUMPY_VALUES -2 NUMPY_VERSION)
-list(GET _NUMPY_VALUES -1 NUMPY_INCLUDE_DIRS)
+list(GET _NUMPY_VALUES -1 _numpy_include_path)

 string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" _VER_CHECK "${NUMPY_VERSION}")
 if("${_VER_CHECK}" STREQUAL "")
@@ -82,8 +82,10 @@
     return()
 endif()

-# Make sure all directory separators are '/'
-string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS})
+find_path(NUMPY_INCLUDE_DIR numpy/numpyconfig.h PATHS ${_numpy_include_path})
+if(NUMPY_INCLUDE_DIR)
+  set(NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIR})
+endif()

 # Get the major and minor version numbers
 string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION})
@@ -94,8 +96,8 @@
 math(EXPR NUMPY_VERSION_DECIMAL
     "(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}")

-find_package_message(NUMPY
-    "Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}"
-    "${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}")
+find_package_handle_standard_args(NUMPY
+                                  REQUIRED_VARS NUMPY_INCLUDE_DIR
+                                  VERSION_VAR NUMPY_VERSION)
+mark_as_advanced(NUMPY_INCLUDE_DIR)

-set(NUMPY_FOUND TRUE)


CMake: Remove forgotten debug output

CMake: Remove forgotten debug output

*blush*

--- cmake/modules/FindPETSC.cmake
+++ cmake/modules/FindPETSC.cmake
@@ -57,7 +57,6 @@
 MACRO(_petsc_feature_check _var _regex)
   FILE(STRINGS "${PETSC_PETSCCONF_H}" PETSC_${_var}_STRING
     REGEX "${_regex}")
-  MESSAGE(STATUS "PETSC_${_var}_STRING -- ${PETSC_${_var}_STRING}")
   IF("${PETSC_${_var}_STRING}" STREQUAL "")
     SET(PETSC_WITH_${_var} FALSE)
   ELSE()


try to fix

try to fix

--- cmakemodules/boost_external.cmake
+++ cmakemodules/boost_external.cmake
@@ -5,7 +5,7 @@
     UPDATE_COMMAND ""
     BUILD_IN_SOURCE 1
     CONFIGURE_COMMAND ./bootstrap.sh
-    BUILD_COMMAND ./b2 --prefix=<INSTALL_DIR> --without-python -s NO_BZIP2=1 install
+    BUILD_COMMAND ./b2 -s NO_BZIP2=1 --prefix=<INSTALL_DIR> --without-python install
     #BUILD_COMMAND ./b2 --show-libraries
     INSTALL_COMMAND ""
 )


Audio/Alure: Return error if the proper version is not available

--- audio/cmake/FindAlure.cmake
+++ audio/cmake/FindAlure.cmake
@@ -23,6 +23,33 @@
       /sw/include
   )

+IF(APPLE)
+    set(ALURE_INCLUDE_DIR_PREFIX "OpenAL")
+ELSEIF(UNIX)
+    set(ALURE_INCLUDE_DIR_PREFIX "AL")
+ELSEIF(WIN32)
+    set(ALURE_INCLUDE_DIR_PREFIX "AL")
+ELSE()
+    set(ALURE_INCLUDE_DIR_PREFIX "AL")
+ENDIF()
+
+IF (NOT ALURE_MIN_VERSION)
+  SET(ALURE_MIN_VERSION "1.1")
+ENDIF(NOT ALURE_MIN_VERSION)
+
+SET(ALURE_VERSION_OK TRUE)
+IF(ALURE_INCLUDE_DIR)
+    FILE(READ ${ALURE_INCLUDE_DIR}/alure.h ALURE_VERSION_CONTENT)
+    STRING (REGEX MATCH "ALURE_API.*.alureUpdateInterval" ALURE_VERSION_MATCH "${ALURE_VERSION_CONTENT}")
+    IF(ALURE_VERSION_MATCH)
+        SET(ALURE_VERSION "1.1")
+    ELSE(ALURE_VERSION_MATCH)
+        SET(ALURE_VERSION_OK FALSE)
+        MESSAGE(FATAL_ERROR "Can not find a recent enough version of Alure. Please install ${ALURE_MIN_VERSION} or newer.")
+    ENDIF(ALURE_VERSION_MATCH)
+ENDIF(ALURE_INCLUDE_DIR)
+
+
   find_library(ALURE_LIBRARY
     NAMES
       alure alure 32


Update a reference to buildsettings.h

Update a reference to buildsettings.h

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -149,7 +149,7 @@

   # determine configuration settings
   set(OGRE_CONFIG_HEADERS
-    ${OGRE_CONFIG_INCLUDE_DIR}/buildsettings.h
+    ${OGRE_CONFIG_INCLUDE_DIR}/OgreBuildSettings.h
     ${OGRE_CONFIG_INCLUDE_DIR}/config.h
     ${OGRE_CONFIG_INCLUDE_DIR}/OgreConfig.h
   )