cmake(python): fix model_builder build

cmake(python): fix model_builder build

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -166,7 +166,7 @@
 message(STATUS "Python project build path: ${PYTHON_PROJECT_DIR}")

 # Swig wrap all libraries
-foreach(SUBPROJECT IN ITEMS init algorithms graph linear_solver constraint_solver sat scheduling util)
+foreach(SUBPROJECT IN ITEMS init algorithms graph linear_solver model_builder constraint_solver sat scheduling util)
   add_subdirectory(ortools/${SUBPROJECT}/python)
 endforeach()


Update python.cmake

Update python.cmake

Add *.pyi file to archive if any...

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -115,12 +115,12 @@
   COMMAND ${CMAKE_COMMAND} -E echo "  packages=find_packages()," >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  package_data={" >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  'ortools':[$<$<NOT:$<PLATFORM_ID:Windows>>:'.libs/*', '../$<TARGET_SONAME_FILE_NAME:ortools>'>]," >> setup.py
-  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.constraint_solver':['$<TARGET_FILE_NAME:_pywrapcp>']," >> setup.py
-  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.linear_solver':['$<TARGET_FILE_NAME:_pywraplp>']," >> setup.py
-  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.sat':['$<TARGET_FILE_NAME:_pywrapsat>']," >> setup.py
+  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.constraint_solver':['$<TARGET_FILE_NAME:_pywrapcp>', '*.pyi']," >> setup.py
+  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.linear_solver':['$<TARGET_FILE_NAME:_pywraplp>', '*.pyi']," >> setup.py
+  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.sat':['$<TARGET_FILE_NAME:_pywrapsat>', '*.pyi']," >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.graph':['$<TARGET_FILE_NAME:_pywrapgraph>']," >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.algorithms':['$<TARGET_FILE_NAME:_pywrapknapsack_solver>']," >> setup.py
-  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.data':['$<TARGET_FILE_NAME:_pywraprcpsp>']," >> setup.py
+  COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.data':['$<TARGET_FILE_NAME:_pywraprcpsp>', '*.pyi']," >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  }," >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  include_package_data=True," >> setup.py
   COMMAND ${CMAKE_COMMAND} -E echo "  install_requires=[" >> setup.py


Android toolchain: added fixes/workarounds for NDK r8b and NDK r6 bugs

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -474,7 +474,7 @@
  set( BUILD_WITH_STANDALONE_TOOLCHAIN True )
 else()
  list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH)
- message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolcahin.
+ message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolchain.
     You should either set an environment variable:
       export ANDROID_NDK=~/my-android-ndk
     or
@@ -773,6 +773,27 @@
 " )
 endif()

+if( NOT _CMAKE_IN_TRY_COMPILE AND X86 AND ANDROID_STL MATCHES "gnustl" AND ANDROID_NDK_RELEASE STREQUAL "r6" )
+  message( WARNING  "The x86 system header file from NDK r6 has incorrect definition for ptrdiff_t. You are recommended to upgrade to a newer NDK release or manually patch the header:
+See https://android.googlesource.com/platform/development.git f907f4f9d4e56ccc8093df6fee54454b8bcab6c2
+  diff --git a/ndk/platforms/android-9/arch-x86/include/machine/_types.h b/ndk/platforms/android-9/arch-x86/include/machine/_types.h
+  index 5e28c64..65892a1 100644
+  --- a/ndk/platforms/android-9/arch-x86/include/machine/_types.h
+  +++ b/ndk/platforms/android-9/arch-x86/include/machine/_types.h
+  @@ -51,7 +51,11 @@ typedef long int       ssize_t;
+   #endif
+   #ifndef _PTRDIFF_T
+   #define _PTRDIFF_T
+  -typedef long           ptrdiff_t;
+  +#  ifdef __ANDROID__
+  +     typedef int            ptrdiff_t;
+  +#  else
+  +     typedef long           ptrdiff_t;
+  +#  endif
+   #endif
+" )
+endif()
+
 # setup paths and STL for NDK
 if( BUILD_WITH_ANDROID_NDK )
  set( ANDROID_TOOLCHAIN_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/prebuilt/${ANDROID_NDK_HOST_SYSTEM_NAME}" )
@@ -1048,6 +1069,11 @@
   set( CMAKE_CXX_CREATE_SHARED_MODULE  "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>" )
   set( CMAKE_CXX_LINK_EXECUTABLE       "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" )
  endif()
+ if ( X86 AND ANDROID_STL MATCHES "gnustl" AND ANDROID_NDK_RELEASE STREQUAL "r6" )
+  # workaround "undefined reference to `__dso_handle'" problem
+  set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" )
+  set( CMAKE_CXX_CREATE_SHARED_MODULE  "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${ANDROID_SYSROOT}/usr/lib/crtbegin_so.o\"" )
+ endif()
  if( EXISTS "${__libstl}" )
   set( CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} \"${__libstl}\"" )
   set( CMAKE_CXX_CREATE_SHARED_MODULE  "${CMAKE_CXX_CREATE_SHARED_MODULE} \"${__libstl}\"" )
@@ -1111,10 +1137,13 @@
  set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections" )
 endif()

-if( CMAKE_HOST_UNIX AND (ARMEABI_V7A OR X86) AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
- if( ANDROID_GOLD_LINKER )
-  set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
- endif()
+if( ANDROID_GOLD_LINKER AND CMAKE_HOST_UNIX AND (ARMEABI OR ARMEABI_V7A OR X86) AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
+ set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
+elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" AND NOT _CMAKE_IN_TRY_COMPILE )
+ message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
+  On Linux and OS X host platform you can workaround this problem using gold linker (default).
+  Rerun cmake with -DANDROID_GOLD_LINKER=ON option.
+" )
 endif()

 if( ANDROID_NOEXECSTACK )


Compile with pcap support by default

Compile with pcap support by default

This will permit to get pcap debugging out of the box

--- DefineOptions.cmake
+++ DefineOptions.cmake
@@ -6,4 +6,4 @@
 option(WITH_DEBUG_CRYPTO "Build with cryto debug output" OFF)
 option(WITH_DEBUG_CALLTRACE "Build with calltrace debug output" ON)
 option(WITH_GCRYPT "Compile against libgcrypt" OFF)
-option(WITH_PCAP "Compile with Pcap generation support" OFF)
+option(WITH_PCAP "Compile with Pcap generation support" ON)


Removed old stuff

Removed old stuff

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@176 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -369,17 +369,9 @@
     acg_set_target_props (${_target}Static)

     if (NOT APPLE)
-# todo : create correct so names
       set_target_properties (${_target}Static PROPERTIES
                              LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
                             )
-
-# todo : rename the lib to omit the static name extension
-      install (TARGETS ${_target}Static
-               RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
-               LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
-               ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR} )
-
     endif ()
   endif ()


Prevent msvc from using linting

Prevent msvc from using linting

--- cmake/ClangTidy.cmake
+++ cmake/ClangTidy.cmake
@@ -1,3 +1,7 @@
+if(MSVC)
+   return()
+endif()
+
 if(NOT CLANG_TIDY_COMMAND)
     set(CLANG_TIDY_COMMAND
         "clang-tidy-9"


Fix FindCuDNN.cmake to see CUDNN_ROOT_DIR env

so that we can specify for pip install -e .

--- cmake/FindCuDNN.cmake
+++ cmake/FindCuDNN.cmake
@@ -14,30 +14,34 @@

 include(FindPackageHandleStandardArgs)

-set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN")
+if(DEFINED ENV{CUDNN_ROOT_DIR})
+  set(CUDNN_ROOT_DIR $ENV{CUDNN_ROOT_DIR})
+else()
+  set(CUDNN_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA cuDNN")
+endif()

-if($ENV{CUDNN_INCLUDE_DIR})
-  SET(CUDNN_INCLUDE_DIR $ENV{CUDNN_INCLUDE_DIR})
-else($ENV{CUDNN_INCLUDE_DIR})
+if(DEFINED ENV{CUDNN_INCLUDE_DIR})
+  set(CUDNN_INCLUDE_DIR $ENV{CUDNN_INCLUDE_DIR})
+else()
   find_path(CUDNN_INCLUDE_DIR cudnn.h
     HINTS ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR}
     PATH_SUFFIXES cuda/include include)
-endif($ENV{CUDNN_INCLUDE_DIR})
+endif()

-IF ($ENV{USE_STATIC_CUDNN})
+if(DEFINED ENV{USE_STATIC_CUDNN})
   MESSAGE(STATUS "USE_STATIC_CUDNN detected. Linking against static CUDNN library")
-  SET(CUDNN_LIBNAME "libcudnn_static.a")
-ELSE()
-  SET(CUDNN_LIBNAME "cudnn")
-ENDIF()
+  set(CUDNN_LIBNAME "libcudnn_static.a")
+else()
+  set(CUDNN_LIBNAME "cudnn")
+endif()

-if($ENV{CUDNN_LIBRARY})
+if(DEFINED ENV{CUDNN_LIBRARY})
   SET(CUDNN_LIBRARY $ENV{CUDNN_LIBRARY})
-else($ENV{CUDNN_LIBRARY})
+else()
   find_library(CUDNN_LIBRARY ${CUDNN_LIBNAME}
     HINTS ${CUDNN_LIB_DIR} ${CUDNN_ROOT_DIR} ${CUDA_TOOLKIT_ROOT_DIR}
     PATH_SUFFIXES lib lib64 cuda/lib cuda/lib64 lib/x64)
-endif($ENV{CUDNN_LIBRARY})
+endif()

 if(CUDNN_INCLUDE_DIR AND CUDNN_LIBRARY)
 	# get cuDNN version


[cmake] MUMPS ordering on debian : add scotch+ptscotch

--- cmake/FindMUMPS.cmake
+++ cmake/FindMUMPS.cmake
@@ -32,18 +32,35 @@

 # Try to be smart and detect whether the MUMPS lib file has a "_seq" suffix. If yes, we add it to all the other library
 IF(IDONTWANTMPI AND MUMPS_LIBRARY MATCHES "dmumps_seq")
-  SET(__SUFFIX "_seq")
+  SET(__MUMPS_COMMON_NAMES mumps_common_seq mumps_common)
 ELSE()
-  SET(__SUFFIX "")
+  SET(__MUMPS_COMMON_NAMES mumps_common_ptscotch mumps_common_scotch mumps_common)
 ENDIF()

+IF(MUMPS_LIBRARY_DIRECTORY AND NOT _MUMPS_DEFAULT_SEARCH_DIR)
+  FIND_LIBRARY(MUMPS_COMMON_LIBRARY ${__MUMPS_COMMON_NAMES} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+ELSE()
+  FIND_LIBRARY(MUMPS_COMMON_LIBRARY ${__MUMPS_COMMON_NAMES})
+ENDIF()

+IF(MUMPS_LIBRARY_DIRECTORY)
+  FIND_LIBRARY(METIS_LIBRARY ptscotch PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+  IF(NOT METIS_LIBRARY)
+    FIND_LIBRARY(METIS_LIBRARY ptscotch)
+  ENDIF()
+ELSE(MUMPS_LIBRARY_DIRECTORY)
+  FIND_LIBRARY(METIS_LIBRARY ptscotch)
+ENDIF(MUMPS_LIBRARY_DIRECTORY)

-IF(MUMPS_LIBRARY_DIRECTORY AND NOT _MUMPS_DEFAULT_SEARCH_DIR)
-  FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common${__SUFFIX} PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
-ELSE()
-  FIND_LIBRARY(MUMPS_COMMON_LIBRARY mumps_common${__SUFFIX})
-ENDIF()
+IF(MUMPS_LIBRARY_DIRECTORY)
+  FIND_LIBRARY(METIS_LIBRARY scotch PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)
+  IF(NOT METIS_LIBRARY)
+    FIND_LIBRARY(METIS_LIBRARY scotch)
+  ENDIF()
+ELSE(MUMPS_LIBRARY_DIRECTORY)
+  FIND_LIBRARY(METIS_LIBRARY scotch)
+ENDIF(MUMPS_LIBRARY_DIRECTORY)
+

 IF(MUMPS_LIBRARY_DIRECTORY)
   FIND_LIBRARY(METIS_LIBRARY metis PATHS "${MUMPS_LIBRARY_DIRECTORY}" NO_DEFAULT_PATH)


add CLANG_LIBDIRS cmake build variable

add CLANG_LIBDIRS cmake build variable

Mirrors LLVM_LIBDIRS, tells cmake where to look for libclang libraries.

--- cmake/Findclang.cmake
+++ cmake/Findclang.cmake
@@ -5,6 +5,7 @@
 # CLANG_FOUND
 # CLANG_INCLUDE_DIRS
 # CLANG_LIBRARIES
+# CLANG_LIBDIRS

 if(MSVC)
   find_package(CLANG REQUIRED CONFIG)
@@ -34,6 +35,7 @@
       string(TOUPPER ${_libname_} _prettylibname_)
       find_library(CLANG_${_prettylibname_}_LIB NAMES ${_libname_}
           PATHS
+              ${CLANG_LIBDIRS}
               /usr/lib/llvm/6/lib
               /usr/lib/llvm-6.0/lib
               /mingw64/lib
@@ -60,4 +62,4 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(CLANG DEFAULT_MSG CLANG_LIBRARIES CLANG_INCLUDE_DIRS)

-mark_as_advanced(CLANG_INCLUDE_DIRS CLANG_LIBRARIES)
+mark_as_advanced(CLANG_INCLUDE_DIRS CLANG_LIBRARIES CLANG_LIBDIRS)


Document the limitation that there be only one pyx file. Update some variable naming accordingly.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -17,7 +17,9 @@
 # <pyx_target_name> is the desired name of the target that runs the Cython compiler
 # to generate the needed C or C++ files, <output_files> is a variable to hold the
 # files generated by Cython, and <src1> <src2> ... are source files
-# to be compiled into the module, e.g. *.pyx, *.py, *.c, *.cxx, etc.
+# to be compiled into the module, e.g. *.pyx, *.c, *.cxx, etc.
+# only one .pyx file may be present for each target
+# (this is an inherent limitation of Cython).
 #
 # The sample paths set with the CMake include_directories() command will be used
 # for include directories to search for *.pxd when running the Cython complire.
@@ -134,16 +136,16 @@
 # cython_add_module( <name> src1 src2 ... srcN )
 # Build the Cython Python module.
 function( cython_add_module _name pyx_target_name generated_files)
-  set( pyx_module_sources "" )
+  set( pyx_module_source "" )
   set( other_module_sources "" )
   foreach( _file ${ARGN} )
     if( ${_file} MATCHES ".*\\.py[x]?$" )
-      list( APPEND pyx_module_sources ${_file} )
+      list( APPEND pyx_module_source ${_file} )
     else()
       list( APPEND other_module_sources ${_file} )
     endif()
   endforeach()
-  compile_pyx( ${_name} ${pyx_target_name} _generated_files ${pyx_module_sources} )
+  compile_pyx( ${_name} ${pyx_target_name} _generated_files ${pyx_module_source} )
   set( ${generated_files} ${_generated_files} PARENT_SCOPE )
   include_directories( ${PYTHON_INCLUDE_DIRS} )
   python_add_module( ${_name} ${_generated_files} ${other_module_sources} )


Convert to v142

Convert to v142

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -2,7 +2,7 @@
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc)
 file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build)
 message("Generating project files...")
-execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -T v141_xp -A Win32
+execute_process(COMMAND ${CMAKE_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR} -T v142 -A Win32
   WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/msvc/build
   RESULT_VARIABLE success
 )


install documentation (if available)

install documentation (if available)

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@6030 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsInstall.cmake
+++ cmake/gsInstall.cmake
@@ -1,6 +1,13 @@
-## #################################################################
+######################################################################
+## gsIntall.cmake ---
+## This file is part of the G+Smo library.
+##
+## Author: Angelos Mantzaflaris
+## Author: Harald Weiner
+## Copyright (C) 2012-2015 - RICAM-Linz.
+######################################################################
 ## Installation
-## #################################################################
+######################################################################

 message ("  CMAKE_INSTALL_PREFIX    ${CMAKE_INSTALL_PREFIX}")

@@ -128,3 +135,25 @@
    message ("Configure with -DGISMO_BUILD_LIB=ON to compile the library")
 endif(GISMO_BUILD_LIB)

+# Install docs (if available)
+set(DOC_SRC_DIR "${PROJECT_BINARY_DIR}/doc/html/")
+#message("DOC_SRC_DIR='${DOC_SRC_DIR}'")
+
+set(TMP_VERSION "${gismo_VERSION}")
+string(REGEX REPLACE "[a-zA-Z]+" "" TMP_VERSION ${TMP_VERSION})
+#message("TMP_VERSION='${TMP_VERSION}'")
+set(DOC_INSTALL_DIR share/doc/gismo-${TMP_VERSION} CACHE PATH
+			"Installation directory for documentation")
+#message("DOC_INSTALL_DIR='${DOC_INSTALL_DIR}'")
+
+install(DIRECTORY "${DOC_SRC_DIR}"
+		DESTINATION "${DOC_INSTALL_DIR}/"
+		USE_SOURCE_PERMISSIONS
+		OPTIONAL
+		FILES_MATCHING
+			PATTERN "*.css"
+			PATTERN "*.html"
+			PATTERN "*.js"
+			PATTERN "*.jpg"
+			PATTERN "*.png"
+)


do not look for NSIS, let cpack find it

do not look for NSIS, let cpack find it

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

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -25,10 +25,7 @@

 # NSIS
 if(WIN32)
-  find_program(NSIS_PROGRAM makensis MakeNSIS)
-  if(EXISTS ${NSIS_PROGRAM})
-    list(APPEND CPACK_GENERATOR "NSIS")
-  endif(EXISTS ${NSIS_PROGRAM})
+  list(APPEND CPACK_GENERATOR "NSIS")
   if(CMAKE_CL_64)
     set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
     set(win_system_name win64)


publish to install folder

publish to install folder

--- cpack-config.cmake
+++ cpack-config.cmake
@@ -1,6 +1,8 @@
 INCLUDE(InstallRequiredSystemLibraries)
 SET(CPACK_PACKAGE_DESCRIPTION "Ride")
 SET(CPACK_PACKAGE_VENDOR "madeso")
+
+SET(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_INSTALL_PREFIX}")

 MESSAGE(STATUS "Setting cpack paths to ${PROJECT_SOURCE_DIR}/gfx/install/")
 SET(CPACK_DMG_BACKGROUND_IMAGE "${PROJECT_SOURCE_DIR}/gfx/install/install.png")


FindMKL.cmake: add support for oneapi mkl

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -94,6 +94,7 @@
   PATHS
     /opt/intel
     /opt/intel/mkl
+    /opt/intel/oneapi/mkl/latest
     $ENV{MKLROOT}
     /opt/intel/compilers_and_libraries/linux/mkl
     /usr/include/mkl
@@ -223,6 +224,8 @@
         /opt/intel/mkl/lib
         /opt/intel/tbb/lib
         /opt/intel/lib
+        /opt/intel/oneapi/mkl/latest/lib
+        /opt/intel/oneapi/lib
         $ENV{MKLROOT}/lib
         ${ENV_LIBRARY_PATHS}
         /opt/intel/compilers_and_libraries/linux/mkl/lib
@@ -251,6 +254,8 @@
         /opt/intel/mkl/lib
         /opt/intel/tbb/lib
         /opt/intel/lib
+        /opt/intel/oneapi/mkl/latest/lib
+        /opt/intel/oneapi/lib
         $ENV{MKLROOT}/lib
         ${ENV_LIBRARY_PATHS}
         /opt/intel/compilers_and_libraries/linux/mkl/lib


Fix MKL library path environment variable on Windows

On windows the compilevars.sh script sets the LIB variable to the
location of the *.lib files. This is LIBRARY_PATH on Linux

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -36,9 +36,8 @@
 #
 # ``MKL::Static``
 #   Target used to define and link all MKL libraries required by Intel's Link
-#   Line Advisor. This usually the only thing you need to link against unless
-#   you want to link against the single dynamic library version of MKL
-#   (libmkl_rt.so)
+#   Line Advisor for a static build. This will still link the threading libraries
+#   using dynamic linking as advised by the Intel Link Advisor
 #
 #  Optional:
 #
@@ -180,8 +179,6 @@
 #    MKL::${NAME}_STATIC
 #
 # Output Variables
-#    MKL_INCLUDE_DIR:                Include directory for MKL
-#    MKL_FFTW_INCLUDE_DIR:           Include directory for the MKL FFTW interface
 #    MKL_${NAME}_LINK_LIBRARY:        on Unix: *.so on Windows *.lib
 #    MKL_${NAME}_STATIC_LINK_LIBRARY: on Unix: *.a  on Windows *.lib
 #    MKL_${NAME}_DLL_LIBRARY:         on Unix: ""   on Windows *.dll
@@ -195,7 +192,11 @@
   add_library(MKL::${mkl_args_NAME}        SHARED IMPORTED)
   add_library(MKL::${mkl_args_NAME}_STATIC STATIC IMPORTED)

-  string(REGEX REPLACE ":" ";" ENV_LIBRARY_PATHS "$ENV{LIBRARY_PATH}")
+  if(WIN32)
+    set(ENV_LIBRARY_PATHS "$ENV{LIB}")
+  else()
+    string(REGEX REPLACE ":" ";" ENV_LIBRARY_PATHS "$ENV{LIBRARY_PATH}")
+  endif()

   if(NOT (WIN32 AND mkl_args_DLL_ONLY))
     find_library(MKL_${mkl_args_NAME}_LINK_LIBRARY
@@ -332,7 +333,7 @@
 mark_as_advanced(MKL_RUNTIME_KERNEL_LIBRARIES)

 find_package_handle_standard_args(MKL_Shared
-  FAIL_MESSAGE "Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. Looking in MKLROOT and LIBRARY_PATHS environment variables"
+  FAIL_MESSAGE "Could NOT find MKL: Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. This script searches for the libraries in MKLROOT, LIBRARY_PATHS(Linux), and LIB(Windows) environment variables"
   VERSION_VAR  MKL_VERSION_STRING
   REQUIRED_VARS MKL_INCLUDE_DIR
                 MKL_Core_LINK_LIBRARY
@@ -341,7 +342,7 @@
                 MKL_ThreadingLibrary_LINK_LIBRARY)

 find_package_handle_standard_args(MKL_Static
-  FAIL_MESSAGE "Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. Looking in MKLROOT and LIBRARY_PATHS environment variables"
+  FAIL_MESSAGE "Could NOT find MKL: Source the compilervars.sh or mklvars.sh scripts included with your installation of MKL. This script searches for the libraries in MKLROOT, LIBRARY_PATHS(Linux), and LIB(Windows) environment variables"
   VERSION_VAR   MKL_VERSION_STRING
   REQUIRED_VARS MKL_INCLUDE_DIR
                 MKL_Core_STATIC_LINK_LIBRARY


prefer libovr release version over debug version

--- CMakeModules/FindOVR.cmake
+++ CMakeModules/FindOVR.cmake
@@ -9,8 +9,8 @@
 #set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
 #set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Src" ${CMAKE_INCLUDE_PATH})

+set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Debug" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Release" ${CMAKE_LIBRARY_PATH})
-set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Debug" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Src" ${CMAKE_INCLUDE_PATH})


corrected the remote queue CMake script on Win to accept Windows paths for ZORBA_BUILD_DIR

--- test/remote/RunRemoteTest.cmake
+++ test/remote/RunRemoteTest.cmake
@@ -30,13 +30,16 @@
 if (NOT ZORBA_BUILD_DIR)
   set (ZORBA_BUILD_DIR "${srcdir}/build")
 endif (NOT ZORBA_BUILD_DIR)
-if (NOT IS_DIRECTORY "${ZORBA_BUILD_DIR}")
+
+file(TO_CMAKE_PATH "${ZORBA_BUILD_DIR}" CMAKE_ZORBA_BUILD_DIR)
+
+if (NOT IS_DIRECTORY "${CMAKE_ZORBA_BUILD_DIR}")
   message (FATAL_ERROR "Build directory ${builddir} does not exist! Specify with -DZORBA_BUILD_DIR='build dir'")
-endif (NOT IS_DIRECTORY "${ZORBA_BUILD_DIR}")
+endif (NOT IS_DIRECTORY "${CMAKE_ZORBA_BUILD_DIR}")

 # Package up local changes
 include ("${cwd}/SvnPackage.cmake")
-svn_package ("${srcdir}" "${ZORBA_BUILD_DIR}/remotequeue"
+svn_package ("${srcdir}" "${CMAKE_ZORBA_BUILD_DIR}/remotequeue"
              "${changelist}" changefile)

 # Copy the local changes to the remotequeue svn repository.  In
@@ -44,7 +47,7 @@
 # to run, etc.) with properties on the checkin.
 message ("Submitting job ${changefile}....")
 execute_process (COMMAND
-                 "${svn}" import "${ZORBA_BUILD_DIR}/remotequeue/${changefile}"
+                 "${svn}" import "${CMAKE_ZORBA_BUILD_DIR}/remotequeue/${changefile}"
                  "${svn_path}/workingsets/${changefile}"
                  TIMEOUT 300 RESULT_VARIABLE result)


Fix RHEL6 linux/in.h file detection (#24100)

On RHEL6, the build got broken by my recent fix of the in_pktinfo /
ip_mreqn detection fix. The reason is that on that platform, linux/in.h
cannot be included on its own, the sys/socket.h needs to be included
before that to provide definitions of some structures. In fact, Linux
doc states that the sys/socket.h should be included before the
linux/in.h. So I am fixing that by adding that include to the detection
code.

--- src/Native/Unix/configure.cmake
+++ src/Native/Unix/configure.cmake
@@ -29,7 +29,7 @@

 # in_pktinfo: Find whether this struct exists
 check_include_files(
-    linux/in.h
+    "sys/socket.h;linux/in.h"
     HAVE_LINUX_IN_H)

 if (HAVE_LINUX_IN_H)
@@ -40,6 +40,7 @@

 check_c_source_compiles(
     "
+    #include <sys/socket.h>
     #include <${SOCKET_INCLUDES}>
     int main()
     {
@@ -51,6 +52,7 @@

 check_c_source_compiles(
     "
+    #include <sys/socket.h>
     #include <${SOCKET_INCLUDES}>
     int main()
     {


PIC for fmt

PIC for fmt

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -679,7 +679,9 @@
       DEBUG_SUFFIX "d"
       CMAKE_ARGS
         -DFMT_DOC=OFF
-        -DFMT_TEST=OFF)
+        -DFMT_TEST=OFF
+        -DCMAKE_C_FLAGS=-fPIC
+        -DCMAKE_CXX_FLAGS=-fPIC)

     add_external_library(fmt
       LIBRARY ${FMT_LIB}


Show output of ctest runs

Show output of ctest runs

Needed to see what's going on with
https://bbpcode.epfl.ch/ci/job/viz.ISC.gerrit/342/build_type=Debug,platform=Ubuntu-14.04/console

Might revert later if it's too annoying.

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -121,9 +121,14 @@
   endif()
 endforeach()

+set(__CONSOLE)
+if(CMAKE_VERSION VERSION_GREATER 3.1.99)
+  set(__CONSOLE USES_TERMINAL)
+endif()
+
 if(NOT TARGET ${PROJECT_NAME}-cpptests)
-  add_custom_target(${PROJECT_NAME}-cpptests
-    COMMAND ${CMAKE_CTEST_COMMAND} -Q -T test --no-compress-output
+  add_custom_target(${PROJECT_NAME}-cpptests ${__CONSOLE}
+    COMMAND ${CMAKE_CTEST_COMMAND} -T test --no-compress-output
     --output-on-failure -L ${PROJECT_NAME}-unit -C $<CONFIGURATION> \${ARGS}
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
     COMMENT "Running ${PROJECT_NAME} unit tests")
@@ -132,8 +137,8 @@
   EXCLUDE_FROM_DEFAULT_BUILD ON FOLDER ${PROJECT_NAME}/tests)

 if(NOT TARGET ${PROJECT_NAME}-perftests)
-  add_custom_target(${PROJECT_NAME}-perftests
-    COMMAND ${CMAKE_CTEST_COMMAND} -Q -T test --no-compress-output
+  add_custom_target(${PROJECT_NAME}-perftests ${__CONSOLE}
+    COMMAND ${CMAKE_CTEST_COMMAND} -T test --no-compress-output
     --output-on-failure -L ${PROJECT_NAME}-perf -C $<CONFIGURATION> \${ARGS}
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
     COMMENT "Running ${PROJECT_NAME} performance tests")


Fixing gflags static link

Fixing gflags static link

Former-commit-id: 8a6ad19f16ec5f83c1af810b9e0be5ac22ac3ec6

--- cmake-modules/Fetch_Ceres.cmake
+++ cmake-modules/Fetch_Ceres.cmake
@@ -35,9 +35,10 @@
     if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" )
         set(FLAGS "${FLAGS} -Wno-implicit-fallthrough -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-enum-compare -Wno-unused-local-typedefs")
     elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-        set(FLAGS "${FLAGS}  --gcc-toolchain=${GCC_TOOLCHAIN}")
-        set(FLAGS "${FLAGS}  -stdlib=libstdc++ -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-invalid-partial-specialization -Wno-missing-braces -Wno-overloaded-virtual -Wno-uninitialized")
+        set(FLAGS "${FLAGS} --gcc-toolchain=${GCC_TOOLCHAIN}")
+        set(FLAGS "${FLAGS} -stdlib=libstdc++ -Wno-deprecated-declarations -Wno-ignored-attributes -Wno-invalid-partial-specialization -Wno-missing-braces -Wno-overloaded-virtual -Wno-uninitialized")
     endif()
+

@@ -67,6 +68,9 @@
             -DGFLAGS_LIBRARY:PATH=${GFLAGS_LIBRARIES}
             -DGLOG_INCLUDE_DIR:PATH=${GLOG_INCLUDE_DIR}
             -DGLOG_LIBRARY:PATH=${GLOG_LIBRARIES}
+            -DGLOG_LIBRARY_DIR_HINTS:PATH=${GLOG_LIBRARIES}
+            -DGLOG_INCLUDE_DIR_HINTS:PATH=${GLOG_INCLUDE_DIR}
+            -DGLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION:BOOL=FALSE
             -DLAPACK:BOOL=OFF
             -DEIGENSPARSE:BOOL=ON
             -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
@@ -80,6 +84,6 @@
     set(CERES_INCLUDE_DIR ${INSTALL_DIR}/include)
     add_dependencies(ceres external_CERES)
     add_dependencies(ceres glog gflags Eigen3::Eigen blas lapack lapacke)
-    target_link_libraries(ceres INTERFACE  ${CERES_LIBRARY} glog gflags Eigen3::Eigen blas lapack lapacke Threads::Threads )
+    target_link_libraries(ceres INTERFACE  ${CERES_LIBRARY} gflags glog  Eigen3::Eigen blas lapack lapacke Threads::Threads )
     target_include_directories(ceres INTERFACE ${CERES_INCLUDE_DIR})
 endif()


[cmake] fix a typo in llvm_config macro

[cmake] fix a typo in llvm_config macro

Summary:
The macro parses out the USE_SHARED option out of the argument list, but
then ignores it and accesses the variable with the same name instead. It
seems the intention here was to check the argument value.

Technically, this is NFC, because the only in-tree usage
(add_llvm_executable) of USE_SHARED sets both the variable and the
argument when calling llvm_config, but it makes the usage of this macro
for out-of-tree users more sensible.

Reviewers: mgorny, beanz

Reviewed By: mgorny

Subscribers: foutrelis, llvm-commits

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

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

--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -68,7 +68,7 @@
   cmake_parse_arguments(ARG "USE_SHARED" "" "" ${ARGN})
   set(link_components ${ARG_UNPARSED_ARGUMENTS})

-  if(USE_SHARED)
+  if(ARG_USE_SHARED)
     # If USE_SHARED is specified, then we link against libLLVM,
     # but also against the component libraries below. This is
     # done in case libLLVM does not contain all of the components


Cross-platform fixes for test utils

Cross-platform fixes for test utils

Use executable suffix to make test work on Windows and
specify explicit output directory for dump_sfont tool.

Uses a generator expression $<0:> to prevent VS and Xcode from
adding per-config subdirectories to the RUNTIME_OUTPUT_DIRECTORY

--- cmake_admin/FluidUnitTest.cmake
+++ cmake_admin/FluidUnitTest.cmake
@@ -33,6 +33,9 @@
     # only build this unit test when explicitly requested by "make check"
     set_target_properties(${_util} PROPERTIES EXCLUDE_FROM_ALL TRUE)

+    # append no-op generator expression to avoid VS or XCode from adding per-config subdirectories
+    set_target_properties(${_util} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/test/utils/$<0:>)
+
     # import necessary compile flags and dependency libraries
     if ( FLUID_CPPFLAGS )
         set_target_properties ( ${_util} PROPERTIES COMPILE_FLAGS ${FLUID_CPPFLAGS} )
@@ -62,7 +65,7 @@

     ADD_TEST(${_sfname}_dump_test
         ${CMAKE_COMMAND}
-        -Dtest_cmd=${CMAKE_BINARY_DIR}/test/dump_sfont
+        -Dtest_cmd=${CMAKE_BINARY_DIR}/test/utils/dump_sfont${CMAKE_EXECUTABLE_SUFFIX}
         -Dtest_args=${test_args}
         -Dtest_output=${_sfname}.yml
         -Dexpected_output=${CMAKE_SOURCE_DIR}/sf2/${_sfname}.yml


fixed find module for the c-client library in order to make it work on mac

--- cmake_modules/FindCClient.cmake
+++ cmake_modules/FindCClient.cmake
@@ -21,8 +21,8 @@
 # Look for the library.
 find_file(
   CCLIENT_LIBRARY
-  NAMES libc-client.a
-  PATHS ${CCLIENT_LIBRARY_DIRS}
+  NAMES libc-client.a libc-client4.a
+  PATHS ${CCLIENT_LIBRARY_DIRS} /opt/local/lib
   DOC "Library to link against for the email support")

 if (CCLIENT_LIBRARY)
@@ -43,9 +43,6 @@
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names")
   ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-fno-operator-names")

-  IF(NOT CMAKE_C_FLAGS MATCHES "-fno-operator-names")
-    SET(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names")
-  ENDIF(NOT CMAKE_C_FLAGS MATCHES "-fno-operator-names")
 else(CCLIENT_INCLUDE AND CCLIENT_LIBRARY)
   set(CCLIENT_FOUND 0)
   set(CCLIENT_LIBRARIES)


Fix per-project unique prefix dir

Fix per-project unique prefix dir

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -50,7 +50,7 @@
   "if(NOT _fail)\n"
 # setup VERSION, INCLUDE_DIRS and DEB_DEPENDENCIES
   "  set(${UPPER_PROJECT_NAME}_VERSION ${VERSION})\n"
-  "  set_and_check(${UPPER_PROJECT_NAME}_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")\n"
+  "  set_and_check(${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${CMAKE_PROJECT_NAME}_PREFIX_DIR}/include)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES \"${LOWER_PROJECT_NAME}${VERSION_ABI} (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_LIB_DEPENDENCY \"${LOWER_PROJECT_NAME}${VERSION_ABI}-lib (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEV_DEPENDENCY \"${LOWER_PROJECT_NAME}${VERSION_ABI}-dev (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"


Added ${CMAKE_PROJECT_NAME}_FOUND to FooConfig.cmake This avoids a warning produced by cmake when find_package finds a config file but it doesn't set Foo_FOUND with the same casing as the package name.

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -16,6 +16,7 @@
 # Output variables
 #   ${UPPER_PROJECT_NAME}_FOUND - Was the project and all of the specified
 #     components found?
+#   ${CMAKE_PROJECT_NAME}_FOUND - Same as above
 #
 #   ${UPPER_PROJECT_NAME}_VERSION - The version of the project which was found
 #   ${UPPER_PROJECT_NAME}_INCLUDE_DIRS - Where to find the headers
@@ -137,6 +138,7 @@
 # finally report about found or not found
   "if(_fail)\n"
   "  set(${UPPER_PROJECT_NAME}_FOUND)\n"
+  "  set(${CMAKE_PROJECT_NAME}_FOUND)\n"
   "  set(${UPPER_PROJECT_NAME}_VERSION)\n"
   "  set(${UPPER_PROJECT_NAME}_INCLUDE_DIRS)\n"
   "  set(${UPPER_PROJECT_NAME}_LIBRARIES)\n"
@@ -148,6 +150,7 @@
   "  endif()\n"
   "else()\n"
   "  set(${UPPER_PROJECT_NAME}_FOUND TRUE)\n"
+  "  set(${CMAKE_PROJECT_NAME}_FOUND TRUE)\n"
   "  set(${UPPER_PROJECT_NAME}_MODULE_FILENAME ${MODULE_FILENAME})\n"
   "  if(_out)\n"
   "    message(STATUS \"Found ${CMAKE_PROJECT_NAME} ${VERSION} \${${UPPER_PROJECT_NAME}_COMPONENTS} in \"\n"


Don't check for C headers we don't need.

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -25,13 +25,6 @@
 include(CMakeDetermineCompileFeatures)
 include(CheckCXXSourceCompiles)

-check_include_files("dlfcn.h" HAVE_DLFCN_H)
-check_include_files("inttypes.h" HAVE_INTTYPES_H)
-check_include_files("memory.h" HAVE_MEMORY_H)
-check_include_files("stdint.h" HAVE_STDINT_H)
-check_include_files("stdlib.h" HAVE_STDLIB_H)
-check_include_files("strings.h" HAVE_STRINGS_H)
-check_include_files("string.h" HAVE_STRING_H)
 check_include_files("sys/select.h" HAVE_SYS_SELECT_H)
 check_include_files("sys/stat.h" HAVE_SYS_STAT_H)
 check_include_files("sys/time.h" HAVE_SYS_TIME_H)


Backport from trunk: Bug #18593044 COMPILE FLAGS NOT PASSED TO DTRACE, BREAKS CROSS BUILD

--- cmake/dtrace.cmake
+++ cmake/dtrace.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -74,13 +74,6 @@
    ${CMAKE_BINARY_DIR}/include/probes_mysql_dtrace.h
    ${CMAKE_BINARY_DIR}/include/probes_mysql_nodtrace.h
   )
-  IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-   # Systemtap object
-   EXECUTE_PROCESS(
-     COMMAND ${DTRACE} -G -s ${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base
-     -o ${CMAKE_BINARY_DIR}/probes_mysql.o
-   )
-  ENDIF()
   ADD_CUSTOM_TARGET(gen_dtrace_header
   DEPENDS
   ${CMAKE_BINARY_DIR}/include/probes_mysql.d
@@ -99,12 +92,7 @@
   IF(ENABLE_DTRACE)
     ADD_DEPENDENCIES(${target} gen_dtrace_header)

-    IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-      TARGET_LINK_LIBRARIES(${target}  ${CMAKE_BINARY_DIR}/probes_mysql.o)
-    ENDIF()
-
-    # On Solaris, invoke dtrace -G to generate object file and
-    # link it together with target.
+    # Invoke dtrace to generate object file and link it together with target.
     IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
       SET(objdir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir)
       SET(outfile ${objdir}/${target}_dtrace.o)
@@ -121,6 +109,21 @@
           -P ${CMAKE_SOURCE_DIR}/cmake/dtrace_prelink.cmake
         WORKING_DIRECTORY ${objdir}
       )
+    ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+      # dtrace on Linux runs gcc and uses flags from environment
+      SET(CFLAGS_SAVED $ENV{CFLAGS})
+      SET(ENV{CFLAGS} ${CMAKE_C_FLAGS})
+      SET(outfile "${CMAKE_BINARY_DIR}/probes_mysql.o")
+      # Systemtap object
+      EXECUTE_PROCESS(
+        COMMAND ${DTRACE} -G -s ${CMAKE_SOURCE_DIR}/include/probes_mysql.d.base
+        -o ${outfile}
+        )
+      SET(ENV{CFLAGS} ${CFLAGS_SAVED})
+    ENDIF()
+
+    # Do not try to extend the library if we have not built the .o file
+    IF(outfile)
       # Add full  object path to linker flags
       GET_TARGET_PROPERTY(target_type ${target} TYPE)
       IF(NOT target_type MATCHES "STATIC")
@@ -132,12 +135,12 @@
         # but maybe one day this will be fixed.
         GET_TARGET_PROPERTY(target_location ${target} LOCATION)
         ADD_CUSTOM_COMMAND(
-         TARGET ${target} POST_BUILD
-         COMMAND ${CMAKE_AR} r  ${target_location} ${outfile}
-	 COMMAND ${CMAKE_RANLIB} ${target_location}
-        )
-       # Used in DTRACE_INSTRUMENT_WITH_STATIC_LIBS
-       SET(TARGET_OBJECT_DIRECTORY_${target}  ${objdir} CACHE INTERNAL "")
+          TARGET ${target} POST_BUILD
+          COMMAND ${CMAKE_AR} r  ${target_location} ${outfile}
+	  COMMAND ${CMAKE_RANLIB} ${target_location}
+          )
+        # Used in DTRACE_INSTRUMENT_WITH_STATIC_LIBS
+        SET(TARGET_OBJECT_DIRECTORY_${target}  ${objdir} CACHE INTERNAL "")
       ENDIF()
     ENDIF()
   ENDIF()


Testsuite: Also use '<>=,' as numdiff separators

This commit addresses issue #38: We have several tests in which numdiff
fails to recognize a number, because the output contains some unknown
delimiters, such as one of "<>=,".

--- tests/setup_testsubproject.cmake
+++ tests/setup_testsubproject.cmake
@@ -108,7 +108,7 @@
   #

   IF(NOT NUMDIFF_EXECUTABLE MATCHES "-NOTFOUND")
-    SET(TEST_DIFF ${NUMDIFF_EXECUTABLE} -a 1e-6 -r 1e-8 -s ' \\t\\n:')
+    SET(TEST_DIFF ${NUMDIFF_EXECUTABLE} -a 1e-6 -r 1e-8 -s ' \\t\\n:<>=,;')
     IF(DIFF_EXECUTABLE MATCHES "-NOTFOUND")
       SET(DIFF_EXECUTABLE ${NUMDIFF_EXECUTABLE})
     ENDIF()


CMake: Remove this little hack

CMake: Remove this little hack

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@29002 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_custom_targets.cmake
+++ deal.II/cmake/setup_custom_targets.cmake
@@ -15,16 +15,6 @@
 #
 # Setup some convenience custom targets for the build system:
 #
-
-#
-# Dump log files, configuration and system information to a convenient
-# place:
-#
-ADD_CUSTOM_TARGET(log
-  COMMAND ${CMAKE_COMMAND} --system-information ${CMAKE_BINARY_DIR}/cmake.log
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-  COMMENT "Create cmake.log"
-  )

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


remove boost.python from build

remove boost.python from build

issue https://github.com/smanders/externpro/issues/202

--- projects/boost.cmake
+++ projects/boost.cmake
@@ -175,38 +175,6 @@
   if(DEFINED bl_TARGETS)
     set(${bl_PRO}_DEPENDS ${${bl_TARGETS}})
   endif()
-  if(MSVC)
-    # Boost.Python build
-    # The python-config.jam installed by the boost.build target above, as of 1_49_0,
-    # (in xpbase/share/boost-build/tools/python-config.jam) looks for R 2.4 2.3 2.2
-    # As of this writing, python 2.7.5 is the latest on MSW, so we use cmake to find it.
-    find_package(PythonInterp)
-    find_package(PythonLibs)
-    if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND)
-      if(XP_BUILD_VERBOSE)
-        message(STATUS "PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
-        message(STATUS "PYTHON_VERSION_STRING: ${PYTHON_VERSION_STRING}")
-        message(STATUS "PYTHON_INCLUDE_DIRS: ${PYTHON_INCLUDE_DIRS}")
-        message(STATUS "PYTHON_LIBRARIES: ${PYTHON_LIBRARIES}")
-      endif()
-      get_property(base_DIR DIRECTORY PROPERTY "EP_BASE")
-      set(boostbld_DIR ${base_DIR}/bld.${bl_PRO})
-      get_filename_component(PYTHON_LIB_DIR ${PYTHON_LIBRARIES} PATH)
-      file(WRITE ${boostbld_DIR}/python-config.jam
-        "using python\n"
-        "  : ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}\n"
-        "  : ${PYTHON_EXECUTABLE}\n"
-        "  : ${PYTHON_INCLUDE_DIRS}\n"
-        "  : ${PYTHON_LIB_DIR}\n"
-        "  : <python-debugging>off ;\n"
-        )
-      set(boost_FLAGS "--user-config=${boostbld_DIR}/python-config.jam")
-    else()
-      set(boost_FLAGS "--without-python")
-    endif()
-  else()
-    set(boost_FLAGS)
-  endif()
   if(XP_BUILD_DEBUG_ALL AND XP_BUILD_RELEASE)
     set(boost_VARIANT "debug,release")
   elseif(XP_PRO_BOOST_BUILD_DBG AND XP_BUILD_RELEASE)
@@ -266,7 +234,9 @@
     address-model=${BUILD_PLATFORM} variant=${boost_VARIANT}
     runtime-link=${boost_RUNTIME_LINK} toolset=${boost_TOOLSET} ${boost_FLAGS}
     )
-  list(APPEND boost_BUILD --without-locale --without-mpi)
+  foreach(lib locale mpi python) # libraries with build issues
+    list(APPEND boost_BUILD --without-${lib})
+  endforeach()
   # TRICKY: need zlib, bzip2 include directories at cmake-time (before they're built)
   # so can't use xpGetPkgVar, xpFindPkg, etc - this complicates having multiple versions
   # of zlib and bzip2 (boost will have to choose a version here)


Use the correct FBX Visual Studio version.

--- FindFBX.cmake
+++ FindFBX.cmake
@@ -52,10 +52,22 @@
 endif()

 function(_fbx_find_library _name _lib _suffix)
+    if(MSVC12)
+        set(VS_PREFIX vs2013)
+    endif()
+    if(MSVC11)
+        set(VS_PREFIX vs2012)
+    endif()
+    if(MSVC10)
+        set(VS_PREFIX vs2010)
+    endif()
+    if(MSVC90)
+        set(VS_PREFIX vs2008)
+    endif()
     find_library(${_name}
         NAMES ${_lib}
         HINTS ${FBX_SEARCH_LOCATIONS}
-        PATH_SUFFIXES lib/${fbx_compiler}/ub/${_suffix} lib/vs2013/x64/${_suffix} lib/vs2012/x64/${_suffix} lib/vs2010/x64/${_suffix} lib/vs2008/x64/${_suffix}
+        PATH_SUFFIXES lib/${fbx_compiler}/ub/${_suffix} lib/${VS_PREFIX}/x64/${_suffix}
     )
     mark_as_advanced(${_name})
 endfunction()


Update GoogleTest to 1.8.0 release

Update GoogleTest to 1.8.0 release

Fix passing of arguments to GoogleTest project. Only build and install
GTest and not GMock.

Change-Id: I3b3d415a1b8c7a1ff6f3f9065fa6e5f0d8b2f630

--- SuperBuild/External_GTest.cmake
+++ SuperBuild/External_GTest.cmake
@@ -7,15 +7,15 @@

 set(proj GTest)

-set(GTEST_TARGET_VERSION 1.7.0)
-set(GTEST_DOWNLOAD_SOURCE_HASH "2d6ec8ccdf5c46b05ba54a9fd1d130d7")
+set(GTEST_TARGET_VERSION 1.8.0)
+set(GTEST_DOWNLOAD_SOURCE_HASH "16877098823401d1bf2ed7891d7dce36")

 # follow the standard EP_PREFIX locations
 set(GTEST_binary_dir ${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj}-build)
 set(GTEST_source_dir ${CMAKE_CURRENT_BINARY_DIR}/${proj}-prefix/src/${proj})
 set(GTEST_install_dir ${CMAKE_CURRENT_BINARY_DIR}/${proj})

-sitkSourceDownload(GTEST_URL "gtest-${GTEST_TARGET_VERSION}.zip" ${GTEST_DOWNLOAD_SOURCE_HASH})
+sitkSourceDownload(GTEST_URL "googletest-release-${GTEST_TARGET_VERSION}.tar.gz" ${GTEST_DOWNLOAD_SOURCE_HASH})

 file(WRITE "${GTEST_binary_dir}/CMakeCacheInit.txt" "${ep_common_cache}" )

@@ -49,13 +49,15 @@
     -C "${GTEST_binary_dir}/CMakeCacheInit.txt"
     ${ep_common_args}
     ${ep_extra_args}
-    -D BUILD_SHARED_LIBS:BOOL=OFF
-    -D CMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=<BINARY_DIR>/lib
-    -D gtest_disable_pthreads:BOOL=ON
+    -DBUILD_GMOCK:BOOL=OFF
+    -DBUILD_GTEST:BOOL=ON
+    -DBUILD_SHARED_LIBS:BOOL=OFF
+    -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=<BINARY_DIR>/lib
+    -Dgtest_disable_pthreads:BOOL=ON
   INSTALL_COMMAND
       ${CMAKE_COMMAND} -E copy_directory ${${proj}_ARCHIVE_OUTPUT_DIRECTORY} <INSTALL_DIR>/lib
     COMMAND
-      ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/include <INSTALL_DIR>/include
+      ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/googletest/include <INSTALL_DIR>/include
   ${External_Project_USES_TERMINAL}
 )


ENH: Update ITKv5 version

ENH: Update ITKv5 version

Update to fix ITK version for VTK builds

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -151,7 +151,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   # set(${proj}_REPOSITORY ${git_protocol}://github.com/stnava/ITK.git)
-  set(${proj}_GIT_TAG  bcd762e7bd743341c2dce84852ced49d8292f293)  # Type -> Enum
+  set(${proj}_GIT_TAG  1e708db2f586997e408cfdc2cea5114ae5575892)  # Type -> Enum  Update to ITKv5rc02 2020-03-18
   set(ITK_VERSION_ID ITK-5.1) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


Don't use the version of libheif that's known to be broken on Mac (#2847)

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -163,10 +163,16 @@
                       VERSION_MIN 4
                       RECOMMEND_MIN 5.0
                       RECOMMEND_MIN_REASON "for stability and thread safety")
+
 # For HEIF/HEIC/AVIF formats
 checked_find_package (Libheif VERSION_MIN 1.3
                       RECOMMEND_MIN 1.7
                       RECOMMEND_MIN_REASON "for AVIF support")
+if (APPLE AND LIBHEIF_VERSION VERSION_GREATER_EQUAL 1.10 AND LIBHEIF_VERSION VERSION_LESS 1.11)
+    message (WARNING "Libheif 1.10 on Apple is known to be broken, disabling libheif support")
+    set (Libheif_FOUND 0)
+endif ()
+
 checked_find_package (LibRaw
                       RECOMMEND_MIN 0.18
                       RECOMMEND_MIN_REASON "for ACES support and better camera metadata"


#52 Set CMAKE_BUILD_TYPE STRINGS only when cache entry exists

--- CMake/Settings.cmake
+++ CMake/Settings.cmake
@@ -46,12 +46,12 @@
 mark_as_advanced(BUILD_ALL_MODULES)

 # Choose build configuration from CMake list of common configuration types
-if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
-  set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: Release, MinSizeRel, Debug, RelWithDebInfo." FORCE)
-endif()
-if (CMAKE_CONFIGURATION_TYPES)
-  set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
+basis_is_cached(CACHED_CONFIGURATION_TYPES CMAKE_CONFIGURATION_TYPES)
+if (CACHED_CONFIGURATION_TYPES)
+  basis_is_cached(CACHED_BUILD_TYPE CMAKE_BUILD_TYPE)
+  if (CACHED_BUILD_TYPE AND CMAKE_CONFIGURATION_TYPES)
+    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES})
+  endif ()
   set_property(CACHE CMAKE_CONFIGURATION_TYPES PROPERTY TYPE INTERNAL)
 endif ()


COMP: removed obsolete option for Objective-C++ flags

Modern CMake now has such an option itself.

--- CMake/itkApple.cmake
+++ CMake/itkApple.cmake
@@ -1,12 +1,3 @@
-# Objective-C++ compile flags.
-# CMake has no equivalent of CMAKE_CXX_FLAGS for Objective-C++ (bug #4756)
-# so we provide this in case the user needs to specify flags specifically
-# for Objective-C++ source files.  For example, to build with garbage
-# collection support, the -fobjc-gc flag would be used.
-set(ITK_OBJCXX_FLAGS_DEFAULT "")
-set(ITK_REQUIRED_OBJCXX_FLAGS ${ITK_OBJCXX_FLAGS_DEFAULT} CACHE STRING "Extra flags for Objective-C++ compilation")
-mark_as_advanced(ITK_REQUIRED_OBJCXX_FLAGS)
-
 mark_as_advanced(
   CMAKE_OSX_ARCHITECTURES
   CMAKE_OSX_DEPLOYMENT_TARGET


COMP: run cxx11 check if cmake_cxx_flags changed

--- CMake/OTBCheckCpp11Keywords.cmake
+++ CMake/OTBCheckCpp11Keywords.cmake
@@ -1,6 +1,7 @@
 include(CheckCXXSourceCompiles)

-unset(OTB_HAS_CXX11 CACHE)
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS})
+
 CHECK_CXX_SOURCE_COMPILES("
 #ifdef _MSC_VER
   #if _MSC_VER <= 1700
@@ -20,7 +21,7 @@
 "
 OTB_HAS_CXX11 )

-unset(OTB_CXX_HAS_UNIQUE_PTR CACHE)
+
 CHECK_CXX_SOURCE_COMPILES("
 #include <memory>
 struct Foo
@@ -38,7 +39,6 @@
 "
 OTB_CXX_HAS_UNIQUE_PTR )

-unset(OTB_CXX_HAS_OVERRIDE_SPECIFIER CACHE)
 CHECK_CXX_SOURCE_COMPILES("
 struct A
 {
@@ -64,7 +64,6 @@
 "
 OTB_CXX_HAS_OVERRIDE_SPECIFIER )

-unset(OTB_CXX_HAS_NULLPTR CACHE)
 CHECK_CXX_SOURCE_COMPILES("
 #include <cstddef>
 int main(int argc, char *argv[])


Bug 536 - Freetype 2.4.10

Bug 536 - Freetype 2.4.10

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


FindOpenGLES2.cmake: added library name for NaCl.

--- modules/FindOpenGLES2.cmake
+++ modules/FindOpenGLES2.cmake
@@ -8,7 +8,9 @@
 #

 # Library
-find_library(OPENGLES2_LIBRARY GLESv2)
+find_library(OPENGLES2_LIBRARY NAMES
+    GLESv2
+    ppapi_gles2) # NaCl

 # Include dir
 find_path(OPENGLES2_INCLUDE_DIR


Fix namespace definition bug.

Fix namespace definition bug.

--- CPM.cmake
+++ CPM.cmake
@@ -421,7 +421,7 @@
   endif()

   # Build the appropriate definition for the module. We stored the unique ID
-  _cpm_build_preproc_name(name __CPM_TMP_VAR)
+  _cpm_build_preproc_name(${name} __CPM_TMP_VAR)
   if (DEFINED CPM_UNIQUE_ID)
     add_definitions("-D${__CPM_TMP_VAR}=${CPM_UNIQUE_ID}")
   else()


Get absolute directory path.

Get absolute directory path.

--- CPM.cmake
+++ CPM.cmake
@@ -752,9 +752,10 @@

   # Check to see if the source is stored locally.
   if (DEFINED _CPM_SOURCE_DIR)
-    set(__CPM_PATH_UNID ${_CPM_SOURCE_DIR})
+    get_filename_component(tmp_src_dir ${_CPM_SOURCE_DIR} ABSOLUTE)
+    set(__CPM_PATH_UNID ${tmp_src_dir})
     set(__CPM_PATH_UNID_VERSION "")
-    set(__CPM_MODULE_SOURCE_DIR "${_CPM_SOURCE_DIR}")
+    set(__CPM_MODULE_SOURCE_DIR "${tmp_src_dir}")
   endif()

   # Cunstruct full UNID


[FIX] raised minimal Windows version to Vista

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -67,9 +67,9 @@
 # ---------------------------------------------------------------------------

 # We need the /bigobj switch on windows (for 64 bit builds only actually).
-# Set target system to be Windows XP and later.
+# Set target system to be Windows XP SP 2 and later.
 if (MSVC)
-  add_definitions (/bigobj /D_WIN32_WINNT=0x0501 /DWINVER=0x0501)
+  add_definitions (/bigobj /D_WIN32_WINNT=0x0600 /DWINVER=0x0600)
 endif (MSVC)

 # ---------------------------------------------------------------------------


fixing if-clause for quiet operation

fixing if-clause for quiet operation

--- cmake/FindFFTW.cmake
+++ cmake/FindFFTW.cmake
@@ -250,7 +250,7 @@
 #  HANDLE_COMPONENTS
   )

-if(NOT FFTW_VERBOSE_FIND)
+if(NOT ${FFTW_FIND_QUIETLY})
   message("++ FindFFTW")
   message("++ FFTW_INCLUDES    : ${FFTW_INCLUDES}")
   message("++ FFTW_LIBRARIES   : ${FFTW_LIBRARIES}")


added ROOT_EXECUTABLE variable

added ROOT_EXECUTABLE variable

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -50,7 +50,12 @@
 # @author Jan Engels, DESY
 ###############################################################################

-# find root-config
+
+
+# ==============================================
+# ===        ROOT_CONFIG_EXECUTABLE          ===
+# ==============================================
+
 SET( ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND )
 MARK_AS_ADVANCED( ROOT_CONFIG_EXECUTABLE )
 FIND_PROGRAM( ROOT_CONFIG_EXECUTABLE root-config PATHS ${ROOT_DIR}/bin NO_DEFAULT_PATH )
@@ -58,38 +63,13 @@
     FIND_PROGRAM( ROOT_CONFIG_EXECUTABLE root-config )
 ENDIF()

-# find rootcint
-SET( ROOT_CINT_EXECUTABLE ROOT_CINT_EXECUTABLE-NOTFOUND )
-MARK_AS_ADVANCED( ROOT_CINT_EXECUTABLE )
-FIND_PROGRAM( ROOT_CINT_EXECUTABLE rootcint PATHS ${ROOT_DIR}/bin NO_DEFAULT_PATH )
-IF( NOT ROOT_DIR )
-    FIND_PROGRAM( ROOT_CINT_EXECUTABLE rootcint )
-ENDIF()

 IF( NOT ROOT_FIND_QUIETLY )
     MESSAGE( STATUS "Check for ROOT_CONFIG_EXECUTABLE: ${ROOT_CONFIG_EXECUTABLE}" )
-    MESSAGE( STATUS "Check for ROOT_CINT_EXECUTABLE: ${ROOT_CINT_EXECUTABLE}" )
 ENDIF()

 IF( ROOT_CONFIG_EXECUTABLE )
-
-    # ==============================================
-    # ===          ROOT_PREFIX                   ===
-    # ==============================================
-
-    # get root prefix from root-config output
-    EXECUTE_PROCESS( COMMAND "${ROOT_CONFIG_EXECUTABLE}" --prefix
-        OUTPUT_VARIABLE ROOT_ROOT
-        RESULT_VARIABLE _exit_code
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-    IF( NOT _exit_code EQUAL 0 )
-        # clear variable if root-config exits with error
-        # it might contain garbage
-        SET( ROOT_ROOT )
-    ENDIF()
-

     # ==============================================
@@ -118,6 +98,79 @@

     # ==============================================
+    # ===          ROOT_PREFIX                   ===
+    # ==============================================
+
+    # get root prefix from root-config output
+    EXECUTE_PROCESS( COMMAND "${ROOT_CONFIG_EXECUTABLE}" --prefix
+        OUTPUT_VARIABLE ROOT_PREFIX
+        RESULT_VARIABLE _exit_code
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    IF( NOT _exit_code EQUAL 0 )
+        # clear variable if root-config exits with error
+        # it might contain garbage
+        SET( ROOT_PREFIX )
+    ENDIF()
+
+    # PKG_ROOT variables are a cmake standard
+    # since this package is also called ROOT the variable name
+    # becomes ROOT_ROOT ...
+    SET( ROOT_ROOT ${ROOT_PREFIX} )
+
+
+
+    # ==============================================
+    # ===          ROOT_BIN_DIR                  ===
+    # ==============================================
+
+    # get bindir from root-config output
+    EXECUTE_PROCESS( COMMAND "${ROOT_CONFIG_EXECUTABLE}" --bindir
+        OUTPUT_VARIABLE ROOT_BIN_DIR
+        RESULT_VARIABLE _exit_code
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    IF( NOT _exit_code EQUAL 0 )
+        # clear variable if root-config exits with error
+        # it might contain garbage
+        SET( ROOT_BIN_DIR )
+    ENDIF()
+
+
+
+    # ==============================================
+    # ===          ROOT_EXECUTABLE               ===
+    # ==============================================
+
+
+    SET( ROOT_EXECUTABLE ROOT_EXECUTABLE-NOTFOUND )
+    MARK_AS_ADVANCED( ROOT_EXECUTABLE )
+    FIND_PROGRAM( ROOT_EXECUTABLE root PATHS ${ROOT_BIN_DIR} NO_DEFAULT_PATH )
+
+    IF( NOT ROOT_FIND_QUIETLY )
+        MESSAGE( STATUS "Check for ROOT_EXECUTABLE: ${ROOT_EXECUTABLE}" )
+    ENDIF()
+
+
+
+
+    # ==============================================
+    # ===          ROOT_CINT_EXECUTABLE          ===
+    # ==============================================
+
+
+    # find rootcint
+    SET( ROOT_CINT_EXECUTABLE ROOT_CINT_EXECUTABLE-NOTFOUND )
+    MARK_AS_ADVANCED( ROOT_CINT_EXECUTABLE )
+    FIND_PROGRAM( ROOT_CINT_EXECUTABLE rootcint PATHS ${ROOT_BIN_DIR} NO_DEFAULT_PATH )
+
+    IF( NOT ROOT_FIND_QUIETLY )
+        MESSAGE( STATUS "Check for ROOT_CINT_EXECUTABLE: ${ROOT_CINT_EXECUTABLE}" )
+    ENDIF()
+
+
+
+    # ==============================================
     # ===          ROOT_INCLUDE_DIR              ===
     # ==============================================

@@ -128,7 +181,7 @@
         OUTPUT_STRIP_TRAILING_WHITESPACE
     )
     IF( NOT _exit_code EQUAL 0 )
-        # clear _inc_dir if root-config exits with error
+        # clear variable if root-config exits with error
         # it might contain garbage
         SET( _inc_dir )
     ENDIF()
@@ -156,7 +209,7 @@
         OUTPUT_STRIP_TRAILING_WHITESPACE
     )
     IF( NOT _exit_code EQUAL 0 )
-        # clear ROOT_LIBRARY_DIR if root-config exits with error
+        # clear variable if root-config exits with error
         # it might contain garbage
         SET( ROOT_LIBRARY_DIR )
     ENDIF()


Adjust FindSDL2 to work properly on MinGW

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -2,9 +2,9 @@
 # Find the SDL2 headers and libraries
 #
 #  SDL2::SDL2 - Imported target to use for building a library
-#  SDL2::SDL2main - Imported target to use if you want SDL and SDLmain.
+#  SDL2::SDL2main - Imported interface target to use if you want SDL and SDLmain.
 #  SDL2_FOUND - True if SDL2 was found.
-#  SDL2_DYNAMIC - If we found a DLL version of SDL (meaning you might want to copy a DLL)
+#  SDL2_DYNAMIC - If we found a DLL version of SDL (meaning you might want to copy a DLL from SDL2::SDL2)
 #
 # Original Author:
 # 2015 Ryan Pavlik <ryan.pavlik@gmail.com> <abiryan@ryand.net>
@@ -98,6 +98,12 @@
 		PATH_SUFFIXES lib ${SDL2_LIB_PATH_SUFFIX})
 endif()

+
+if(MINGW AND NOT SDL2PC_FOUND)
+	find_library(SDL2_MINGW_LIBRARY mingw32)
+	find_library(SDL2_MWINDOWS_LIBRARY mwindows)
+endif()
+
 if(SDL2_PREFIX)
 	# Restore things the way they used to be.
 	set(CMAKE_PREFIX_PATH ${SDL2_ORIGPREFIXPATH})
@@ -130,15 +136,31 @@
 			INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}"
 		)
 	endif()
-	add_library(SDL2::SDL2main STATIC IMPORTED)
+	add_library(SDL2::SDL2main INTERFACE IMPORTED)
 	set(SDL2MAIN_LIBRARIES SDL2::SDL2)
 	if(SDL2_SDLMAIN_LIBRARY)
-		set_target_properties(SDL2::SDL2main
+		add_library(SDL2::SDL2main_real STATIC IMPORTED)
+		set_target_properties(SDL2::SDL2main_real
 			PROPERTIES
 			IMPORTED_LOCATION "${SDL2_SDLMAIN_LIBRARY}")
+		list(APPEND SDL2MAIN_LIBRARIES SDL2::SDL2main_real)
 	endif()
 	if(MINGW)
-		list(APPEND SDL2MAIN_LIBRARIES mingw32 mwindows)
+		# MinGW requires some additional libraries to appear earlier in the link line.
+		if(SDL2PC_LIBRARIES)
+			# Use pkgconfig-suggested extra libraries if available.
+			list(REMOVE_ITEM SDL2PC_LIBRARIES SDL2main SDL2)
+			set(SDL2MAIN_LIBRARIES ${SDL2PC_LIBRARIES} ${SDL2MAIN_LIBRARIES})
+		else()
+			# fall back to extra libraries specified in pkg-config in
+			# an official binary distro of SDL2 for MinGW I downloaded
+			if(SDL2_MINGW_LIBRARY)
+				set(SDL2MAIN_LIBRARIES ${SDL2_MINGW_LIBRARY} ${SDL2MAIN_LIBRARIES})
+			endif()
+			if(SDL2_MWINDOWS_LIBRARY)
+				set(SDL2MAIN_LIBRARIES ${SDL2_MWINDOWS_LIBRARY} ${SDL2MAIN_LIBRARIES})
+			endif()
+		endif()
 		set_target_properties(SDL2::SDL2main
 			PROPERTIES
 			INTERFACE_COMPILE_DEFINITIONS "main=SDL_main")
@@ -149,4 +171,9 @@
 	mark_as_advanced(SDL2_ROOT_DIR)
 endif()

-mark_as_advanced(SDL2_LIBRARY SDL2_RUNTIME_LIBRARY SDL2_INCLUDE_DIR SDL2_SDLMAIN_LIBRARY)
+mark_as_advanced(SDL2_LIBRARY
+	SDL2_RUNTIME_LIBRARY
+	SDL2_INCLUDE_DIR
+	SDL2_SDLMAIN_LIBRARY
+	SDL2_MINGW_LIBRARY
+	SDL2_MWINDOWS_LIBRARY)


[#63] log libclang download except in ci builds

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

     if(NOT EXISTS "${package_path}")
         message(STATUS "Downloading libclang ${SIPLASPLAS_LIBCLANG_VERSION} from \"${url}\"...")
-        if(SIPLASPLAS_VERBOSE_CONFIG)
+        if(NOT SIPLASPLAS_CI_BUILD)
             set(progress SHOW_PROGRESS)
         endif()


BUG: Fix itkFDFImageIOTest link error on windows

Update IOFDF remote module. Use correct main signature on test for
windows.

Change-Id: I468dbd131f9a79f3dd466172ec1ff4087a2a3ffb

--- Modules/Remote/IOFDF.remote.cmake
+++ Modules/Remote/IOFDF.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(IOFDF
   "FDFImageIO plugin for ITK. Authors Gleen Pierce/Nick Tustison/Kent Williams"
   GIT_REPOSITORY http://github.com/InsightSoftwareConsortium/itkFDFImageIO.git
-  GIT_TAG  eff61805983c8a92b7a2043b94272d7b865c5a06
+  GIT_TAG 145e6342bd340919574003e4e324b0b9ebf49d26
   )


Update getdate.cmake to be locale independent on windows

--- Superbuild/Projects/getdate.cmake
+++ Superbuild/Projects/getdate.cmake
@@ -63,14 +63,16 @@
     # May need adjustment in different locales or for custom date/time formats
     # set in the Windows Control Panel.
     #
-    set(${GD_PREFIX}CMD "cmd")
-    set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%")
+    set(${GD_PREFIX}CMD "wmic")
+    set(${GD_PREFIX}ARGS "os get localdatetime")
+	# This output the current date-time in following format:
+    #      YYYYMMDDhhmmss.ffffffSzzz
   else()
     #
-    # Match the format returned by default in US English Windows:
+    # Match the format returned by default in wmic:
     #
     set(${GD_PREFIX}CMD "date")
-    set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"")
+    set(${GD_PREFIX}ARGS "\"+%Y%m%d%H%M%S.000000\"")
   endif()

   exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}"
@@ -99,16 +101,15 @@
     # Extract eight individual components by matching a regex with paren groupings.
     # Use the replace functionality and \\1 thru \\8 to extract components.
     #
-    set(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)")
-
-    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}")
+    set(${GD_PREFIX}REGEX ".*([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])\\.(.*)")
+
     string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}")
     string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}")
-    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}")
-    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}")
-    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}")
-    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}")
-    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}")
+    string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}")

     #
     # Verify that extracted components don't have anything obviously


Revert "cmake: add zephyr_cc_option_nocheck"

This reverts commit a01f2de734cbda02fa0eb262840f11df9fe6c5f4.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -100,12 +100,6 @@
 function(zephyr_cc_option)
   foreach(arg ${ARGV})
     target_cc_option(zephyr_interface INTERFACE ${arg})
-  endforeach()
-endfunction()
-
-function(zephyr_cc_option_nocheck)
-  foreach(arg ${ARGV})
-    target_compile_options(zephyr_interface INTERFACE ${arg})
   endforeach()
 endfunction()


[windows] fix handling of OSPL_HOME env variable

--- opensplice_cmake_module/cmake/Modules/FindOpenSplice.cmake
+++ opensplice_cmake_module/cmake/Modules/FindOpenSplice.cmake
@@ -28,7 +28,7 @@
 set(OpenSplice_FOUND FALSE)

 # check if provided OSPL_HOME is from an "official" binary package
-set(_ospl_home "$ENV{OSPL_HOME}")
+file(TO_CMAKE_PATH "$ENV{OSPL_HOME}" _ospl_home)
 if(WIN32)
   set(_ospl_release_file release.bat)
 else()
@@ -40,11 +40,11 @@

 if(NOT "${_ospl_home} " STREQUAL " ")
   # look inside of OSPL_HOME if defined
-  message(STATUS "Found PrismTech OpenSplice: $ENV{OSPL_HOME}")
+  message(STATUS "Found PrismTech OpenSplice: ${_ospl_home}")
   set(OpenSplice_INCLUDE_DIRS
-    "$ENV{OSPL_HOME}/include"
-    "$ENV{OSPL_HOME}/include/sys"
-    "$ENV{OSPL_HOME}/include/dcps/C++/SACPP")
+    "${_ospl_home}/include"
+    "${_ospl_home}/include/sys"
+    "${_ospl_home}/include/dcps/C++/SACPP")
   set(OpenSplice_LIBRARIES
     "cmxml"
     "commonserv"
@@ -64,10 +64,12 @@
     "spliced"
     "dcpsisocpp"
     "dcpssacpp")
-  list(APPEND OpenSplice_LIBRARIES "pthread" "dl")
-  set(OpenSplice_LIBRARY_DIRS "$ENV{OSPL_HOME}/lib")
+  if(NOT WIN32)
+    list(APPEND OpenSplice_LIBRARIES pthread dl)
+  endif()
+  set(OpenSplice_LIBRARY_DIRS "${_ospl_home}/lib")
   set(OpenSplice_DEFINITIONS "")
-  set(OpenSplice_IDLPP "$ENV{OSPL_HOME}/bin/idlpp")
+  set(OpenSplice_IDLPP "${_ospl_home}/bin/idlpp")
   set(OpenSplice_FOUND TRUE)
 else()
   # try to find_package() it


[FIX] Disabling demo tests on Windows for now.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@14499 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/SeqAnBuildSystem.cmake
+++ util/cmake/SeqAnBuildSystem.cmake
@@ -434,12 +434,14 @@
         endif()

         # Add the test.
+        if (NOT MINGW AND NOT MSVC)  # disable on Windows for now
         find_package (PythonInterp)
         if (PYTHONINTERP_FOUND)
           add_test (NAME test_${EXECUTABLE}
                     COMMAND ${PYTHON_EXECUTABLE} ${CHECKER_PATH} ${ARGS})
           #message(STATUS "add_test (NAME test_${EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE} ${CHECKER_PATH} ${ARGS})")
         endif (PYTHONINTERP_FOUND)
+        endif (NOT MINGW AND NOT MSVC)
     endif ()
 endmacro (_seqan_setup_demo_test CPP_FILE)


[Build] Fix: CHECK_CXX_SOURCE_COMPILES ignores CMAKE_CXX_STANDARD This partly REVERTS 32dbcdb166ced3217566f171d862206cfab49300.

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -10,10 +10,6 @@
 SET(CXX_COMPILER_VERSION_MAJOR "0" CACHE INTERNAL "The C++ compiler major version")
 SET(CXX_COMPILER_VERSION_MINOR "0" CACHE INTERNAL "The C++ compiler minor version")
 SET(CXX_COMPILER_VERSION_MINOR_MINOR "0" CACHE INTERNAL "The C++ compiler minor minor version")
-
-SET(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "C++ ISO standard")
-SET(CMAKE_CXX_STANDARD_REQUIRED ON CACHE INTERNAL "Enforce C++11")
-SET(CMAKE_CXX_EXTENSIONS OFF CACHE INTERNAL "Disable C++ extensions")

 IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")

@@ -49,6 +45,8 @@
 	IF (MT_ENABLE_CUDA)
 		SET(USE_PEDANTIC OFF)
 	ENDIF()
+
+	ADD_BALL_DEFINITIONS("-std=c++0x")

 	# Added -Wno-deprecated-declarations as Eigen3 currently uses binder2nd
 	# which spams the compiler output.
@@ -88,6 +86,7 @@
 		ADD_BALL_DEFINITIONS(-pedantic)
 	ENDIF()

+	ADD_BALL_DEFINITIONS("-std=c++0x")
 ELSEIF(MSVC)

 	SET(CXX_COMPILER_ID "MSVC")
@@ -170,4 +169,6 @@
 		CXX_COMPILER_VERSION_MINOR ${CXX_COMPILER_VERSION})

 	SET(CXX_COMPILER_VERSION "${CXX_COMPILER_VERSION_MAJOR}.${CXX_COMPILER_VERSION_MINOR}")
+	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+	SET(CF_BALL_ADDCXX_FLAGS "-std=c++11" ${CF_BALL_ADDCXX_FLAGS})
 ENDIF()


The pedantic switch just uses one "-" sign

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -83,7 +83,7 @@
 	ADD_DEFINITIONS(-Wall -Wextra -Wno-long-long)

 	IF(USE_PEDANTIC)
-		ADD_DEFINITIONS(--pedantic)
+		ADD_DEFINITIONS(-pedantic)
 	ENDIF()

 ELSEIF(MSVC)


[cmake] Semi-parametrize manpage location.

On OpenBSD, man pages go in $CMAKE_INSTALL_PATH/man. This requires
changing the default to something with a parameter when installing
on this platform.

--- cmake/modules/SwiftManpage.cmake
+++ cmake/modules/SwiftManpage.cmake
@@ -39,8 +39,12 @@
       ALL)

   add_dependencies(${MP_INSTALL_IN_COMPONENT} ${manpage_target})
+  set(MANPAGE_DEST "share/")
+  if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "OPENBSD")
+    set(MANPAGE_DEST "")
+  endif()
   swift_install_in_component(FILES "${output_file_name}"
-                             DESTINATION "share/man/man${MP_MAN_SECTION}"
+                             DESTINATION "${MANPAGE_DEST}man/man${MP_MAN_SECTION}"
                              COMPONENT "${MP_INSTALL_IN_COMPONENT}")
 endfunction()


Find vigra on Windows with buildem system

--- cmake_extensions/FindVIGRA.cmake
+++ cmake_extensions/FindVIGRA.cmake
@@ -14,7 +14,12 @@
 SET( VIGRA_IMPEX_LIBRARY_DIR ${VIGRA_IMPEX_LIBRARY_PATH} CACHE PATH "Path to Vigra impex library.")

 EXECUTE_PROCESS ( COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
-FIND_FILE(VIGRA_NUMPY_CORE_LIBRARY vigranumpycore.so PATHS ${PYTHON_SITE_PACKAGES} ENV PYTHONPATH PATH_SUFFIXES vigra)
+FIND_FILE(VIGRA_NUMPY_CORE_LIBRARY
+          NAMES vigranumpycore.so vigranumpycore.pyd
+          PATHS ${PYTHON_SITE_PACKAGES}
+                ENV PYTHONPATH
+                ${CMAKE_PREFIX_PATH}/python/Lib/site-packages # Windows, buildem system
+          PATH_SUFFIXES vigra)

 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if


remove not needed ${SHARED_DIR}/include/*.h in runtime_lib.cmake (#338)

--- build-scripts/runtime_lib.cmake
+++ build-scripts/runtime_lib.cmake
@@ -91,7 +91,6 @@
 include_directories (${IWASM_DIR}/include)

 file (GLOB header
-    ${SHARED_DIR}/include/*.h
     ${IWASM_DIR}/include/*.h
 )
 LIST (APPEND RUNTIME_LIB_HEADER_LIST ${header})


CDRIVER-2396 build error if ENABLE_SRV=OFF

--- build/cmake/FindResSearch.cmake
+++ build/cmake/FindResSearch.cmake
@@ -1,7 +1,6 @@
 include(CheckSymbolExists)

 if (ENABLE_SRV STREQUAL ON OR ENABLE_SRV STREQUAL AUTO)
-include(CheckSymbolExists)
    if (WIN32)
       set (RESOLV_LIBS Dnsapi)
       set (MONGOC_HAVE_DNSAPI 1)
@@ -43,6 +42,13 @@
          endif()
       endif ()
    endif ()
+else()
+   # ENABLE_SRV disabled, set default values for defines.
+   set (MONGOC_HAVE_DNSAPI 0)
+   set (MONGOC_HAVE_RES_NSEARCH 0)
+   set (MONGOC_HAVE_RES_NDESTROY 0)
+   set (MONGOC_HAVE_RES_NCLOSE 0)
+   set (MONGOC_HAVE_RES_SEARCH 0)
 endif ()

 if (ENABLE_SRV STREQUAL ON AND NOT RESOLV_LIBS)


Remove path logging

Remove path logging


cmake: update path where man pages are generated

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -495,7 +495,7 @@
 			set (MDFILE ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.md)
 		endif ()

-		set (OUTFILE ${CMAKE_SOURCE_DIR}/doc/man/${NAME}.${SECTION})
+		set (OUTFILE ${CMAKE_SOURCE_DIR}/doc/man/man${SECTION}/${NAME}.${SECTION})

 		if (RONN_LOC)
 			add_custom_command (OUTPUT ${OUTFILE}


fixed C= detection script

fixed C= detection script

--- cmake/OpenCVDetectCStripes.cmake
+++ cmake/OpenCVDetectCStripes.cmake
@@ -5,7 +5,7 @@
     if(CSTRIPES_LIB_DIR)
         ocv_include_directories("${CSTRIPES_LIB_DIR}/..")
         link_directories("${CSTRIPES_LIB_DIR}")
-        set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} "С=")
+        set(OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} "C=")
         set(HAVE_CSTRIPES 1)
     endif()
 endif()


fix regression from a7f1632dcf8b23b1e937c5feb1718ae91b930083

--- cmake/catkin_add_env_hooks.cmake
+++ cmake/catkin_add_env_hooks.cmake
@@ -117,9 +117,9 @@
         install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace/${ENV_HOOK}
           DESTINATION etc/catkin/profile.d)
       endif()
-    elseif(EXISTS ${base}.in)
+    elseif(EXISTS ${base}.in OR EXISTS ${base}.installspace.in)
       # evaluate in template and install
-      if(EXISTS ${base}.installspace.in OR EXISTS ${base}.installspace.in)
+      if(EXISTS ${base}.installspace.in)
         set(in_template ${base}.installspace.in)
       else()
         set(in_template ${base}.in)


inside kdesupport the location for Automoc4Config.cmake has changed

svn path=/trunk/kdesupport/akonadi/; revision=834172

--- cmake/modules/FindAutomoc4.cmake
+++ cmake/modules/FindAutomoc4.cmake
@@ -20,7 +20,7 @@
 # check if we are inside KDESupport and automoc is enabled
 if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
    # when building this project as part of kdesupport
-   set(AUTOMOC4_CONFIG_FILE "${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake")
+   set(AUTOMOC4_CONFIG_FILE "${KDESupport_BINARY_DIR}/automoc/Automoc4Config.cmake")
 else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
    # when building this project outside kdesupport


[cmake] Skip regex when CMAKE_STATIC_LIBRARY_PREFIX is empty.

In platforms like Windows, there's no prefix for static libraries.
Interpolating it in the regex will end up with a regex "^", which seems
not to be valid. Since the regex was removing the prefix, we can simply
skip the operation and the result will be the same.

Also do the same for CMAKE_STATIC_LIBRARY_SUFFIX, even if in that case,
Windows will have a value (but if it is empty, it will fail trying to
create the regex).

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -155,8 +155,12 @@
       add_dependencies(${target}-static ${AST_DEPENDS})
     endif()
     get_filename_component(ast_output_bn ${AST_OUTPUT} NAME)
-    string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" ast_output_bn ${ast_output_bn})
-    string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" ast_output_bn ${ast_output_bn})
+    if(NOT CMAKE_STATIC_LIBRARY_PREFIX STREQUAL "")
+      string(REGEX REPLACE "^${CMAKE_STATIC_LIBRARY_PREFIX}" "" ast_output_bn ${ast_output_bn})
+    endif()
+    if(NOT CMAKE_STATIC_LIBRARY_SUFFIX STREQUAL "")
+      string(REGEX REPLACE "${CMAKE_STATIC_LIBRARY_SUFFIX}$" "" ast_output_bn ${ast_output_bn})
+    endif()
     get_filename_component(ast_output_dn ${AST_OUTPUT} DIRECTORY)
     set_target_properties(${target}-static
                           PROPERTIES


Disable svgqt by default since the results don't validate (!) and also show
text position errors for application versions that produce good text
positioning for -dev svgcairo and -dev svg.

svn path=/trunk/; revision=9736

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -91,7 +91,8 @@
 "pngqt:qt:ON"
 "ppmqt:qt:ON"
 "tiffqt:qt:ON"
-"svgqt:qt:ON"
+# Currently does not validate and has text positioning errors.
+"svgqt:qt:OFF"
 "gif:gd:ON"
 "jpeg:gd:ON"
 "png:gd:ON"


Fix for running bin/zorba tests on Windows when binaries are in the same dir.

--- cmake_modules/ZorbaAddTest.cmake
+++ cmake_modules/ZorbaAddTest.cmake
@@ -25,7 +25,8 @@
 MACRO(ZORBA_ADD_TEST_SIMPLE NAME TARGET ...)
   SET(ARGS ${ARGV2} ${ARGN})
 	IF(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
-		ADD_TEST("${NAME}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}" ${ARGS})
+		GET_TARGET_PROPERTY(TARGET_LOCATION "${TARGET}" LOCATION)
+		ADD_TEST("${NAME}" "${TARGET_LOCATION}" ${ARGS})
 	ELSE(ZORBA_WIN_PUT_ALL_BINARIES_IN_SAME_DIR)
 		GET_TARGET_PROPERTY(TARGET_LOCATION "${TARGET}" LOCATION)
 		IF(WIN32)


cmake: libgit

cmake: libgit

use new syntax of find_package_handle_standard_args
set FOUND_VAR correctly

--- cmake/Modules/FindLibGit2.cmake
+++ cmake/Modules/FindLibGit2.cmake
@@ -8,6 +8,9 @@
 find_library (LibGit2_LIBRARIES NAMES git2)

 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (LibGit2 DEFAULT_MSG LibGit2_LIBRARIES LibGit2_INCLUDE_DIR)
+find_package_handle_standard_args (LibGit2
+		FOUND_VAR LibGit2_FOUND
+		REQUIRED_VARS LibGit2_LIBRARIES LibGit2_INCLUDE_DIR
+		)

 mark_as_advanced (LibGit2_INCLUDE_DIR LibGit2_LIBRARIES)


cmake/MyPackageDependency.cmake and recursivity

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -73,116 +73,127 @@
     ENDIF ()
     SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend} "DONE")
     #
-    # Manage dependencies
+    # Remember all eventual packageDepend variables we depend upon
     #
-    SET (_test_candidates ${${PROJECT_NAME}_TEST_EXECUTABLE})
-    SET (_lib_candidates  ${PROJECT_NAME} ${PROJECT_NAME}_static)
-    SET (_exe_candidates  ${${PROJECT_NAME}_EXECUTABLE})
-    SET (_candidates)
-    IF (_TESTS)
-      LIST (APPEND _candidates ${_test_candidates})
-    ENDIF ()
-    IF (_LIBS)
-      LIST (APPEND _candidates ${_lib_candidates})
-    ENDIF ()
-    IF (_EXES)
-      LIST (APPEND _candidates ${_exe_candidates})
-    ENDIF ()
-    FOREACH (_target ${_candidates})
-      IF (TARGET ${_target})
-        IF (ALL_IN_ONE)
-          #
-          # Dependency by target
-          #
-          IF (TARGET ${packageDepend})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${packageDepend} dependency to ${_target}")
-            ENDIF ()
-            TARGET_LINK_LIBRARIES(${_target} ${packageDepend})
-          ELSE ()
-            #
-            # Bad luck, this target does not generate a library
-            #
-            FOREACH (_include_directory ${packageDependSourceDir}/output/include ${packageDependSourceDir}/include)
-              IF (MYPACKAGE_DEBUG)
-                MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
-              ENDIF ()
-              TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
-            ENDFOREACH ()
+    FOREACH (_what INCLUDE_DIRS LIBRARIES C_FLAGS_SHARED LINK_FLAGS)
+      SET (_val ${${_PACKAGEDEPEND}_${_what})
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Setting property MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} to ${_val}")
+      ENDIF ()
+      SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} ${_val})
+    ENDFOREACH ()
+  ENDIF ()
+
+  #
+  # Manage dependencies
+  #
+  SET (_test_candidates ${${PROJECT_NAME}_TEST_EXECUTABLE})
+  SET (_lib_candidates  ${PROJECT_NAME} ${PROJECT_NAME}_static)
+  SET (_exe_candidates  ${${PROJECT_NAME}_EXECUTABLE})
+  SET (_candidates)
+  IF (_TESTS)
+    LIST (APPEND _candidates ${_test_candidates})
+  ENDIF ()
+  IF (_LIBS)
+    LIST (APPEND _candidates ${_lib_candidates})
+  ENDIF ()
+  IF (_EXES)
+    LIST (APPEND _candidates ${_exe_candidates})
+  ENDIF ()
+  FOREACH (_target ${_candidates})
+    IF (TARGET ${_target})
+      IF (ALL_IN_ONE)
+        #
+        # Dependency by target
+        #
+        IF (TARGET ${packageDepend})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${packageDepend} dependency to ${_target}")
           ENDIF ()
+          TARGET_LINK_LIBRARIES(${_target} ${packageDepend})
         ELSE ()
           #
-          # Include dependency
+          # Bad luck, this target does not generate a library
           #
-          FOREACH (_include_directory ${${_PACKAGEDEPEND}_INCLUDE_DIRS})
+          FOREACH (_include_directory ${packageDependSourceDir}/output/include ${packageDependSourceDir}/include)
             IF (MYPACKAGE_DEBUG)
               MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
             ENDIF ()
             TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
           ENDFOREACH ()
-          #
-          # Library dependency
-          #
-          FOREACH (_library ${${_PACKAGEDEPEND}_LIBRARIES})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library dependency to ${_target}")
-            ENDIF ()
-            TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
-          ENDFOREACH ()
-          #
-          # Compile definitions
-          #
-          FOREACH (_flag ${${_PACKAGEDEPEND}_C_FLAGS_SHARED})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile definition dependency to ${_target}")
-            ENDIF ()
-            TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
-          ENDFOREACH ()
-          #
-          # Link flags
-          #
-          FOREACH (_flag ${${_PACKAGEDEPEND}_LINK_FLAGS})
-            IF (MYPACKAGE_DEBUG)
-              MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag dependency to ${_target}")
-            ENDIF ()
-            SET_TARGET_PROPERTIES(${_target}
-              PROPERTIES
-              LINK_FLAGS ${_flag}
-              )
-          ENDFOREACH ()
         ENDIF ()
+      ELSE ()
+        #
+        # Include dependency
+        #
+        FOREACH (_include_directory ${MYPACKAGE_DEPENDENCY_${packageDepend}_INCLUDE_DIRS})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} include dependency to ${_target}")
+          ENDIF ()
+          TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+        ENDFOREACH ()
+        #
+        # Library dependency
+        #
+        FOREACH (_library ${MYPACKAGE_DEPENDENCY_${packageDepend}_LIBRARIES})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library dependency to ${_target}")
+          ENDIF ()
+          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
+        ENDFOREACH ()
+        #
+        # Compile definitions
+        #
+        FOREACH (_flag ${MYPACKAGE_DEPENDENCY_${packageDepend}_C_FLAGS_SHARED})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile definition dependency to ${_target}")
+          ENDIF ()
+          TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
+        ENDFOREACH ()
+        #
+        # Link flags
+        #
+        FOREACH (_flag ${MYPACKAGE_DEPENDENCY_${packageDepend}_LINK_FLAGS})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag dependency to ${_target}")
+          ENDIF ()
+          SET_TARGET_PROPERTIES(${_target}
+            PROPERTIES
+            LINK_FLAGS ${_flag}
+            )
+        ENDFOREACH ()
       ENDIF ()
-    ENDFOREACH ()
-    #
-    # Test path management
-    #
-    GET_PROPERTY(_test_path_set GLOBAL PROPERTY MYPACKAGE_TEST_PATH SET)
-    IF (${_test_path_set})
-      GET_PROPERTY(_test_path GLOBAL PROPERTY MYPACKAGE_TEST_PATH)
-    ELSE ()
-      SET (_test_path "")
     ENDIF ()
+  ENDFOREACH ()
+  #
+  # Test path management
+  #
+  GET_PROPERTY(_test_path_set GLOBAL PROPERTY MYPACKAGE_TEST_PATH SET)
+  IF (${_test_path_set})
+    GET_PROPERTY(_test_path GLOBAL PROPERTY MYPACKAGE_TEST_PATH)
+  ELSE ()
+    SET (_test_path "")
+  ENDIF ()

-    SET (_dependLibraryRuntimeDirectory "${packageDependSourceDirAbsolute}/output/lib")
-    IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
-      STRING(REGEX REPLACE "/" "\\\\"  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
-    ELSE ()
-      STRING(REGEX REPLACE " " "\\\\ "  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
-    ENDIF ()
-    SET(${_PACKAGEDEPEND}_RUNTIME_DIRECTORY "${_dependLibraryRuntimeDirectory}")
-    IF ("${_test_path}" STREQUAL "")
-      MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initializing TEST_PATH with PATH")
-      SET (_test_path "$ENV{PATH}" )
-    ENDIF ()
-    IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
-      SET (SEP "\\;")
-    ELSE ()
-      SET (SEP ":")
-    ENDIF ()
-    SET (_test_path "${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY}${SEP}${_test_path}")
-    IF (MYPACKAGE_DEBUG)
-      MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Prepended ${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY} to TEST_PATH")
-    ENDIF ()
-    SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_TEST_PATH "${_test_path}")
+  SET (_dependLibraryRuntimeDirectory "${packageDependSourceDirAbsolute}/output/lib")
+  IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
+    STRING(REGEX REPLACE "/" "\\\\"  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
+  ELSE ()
+    STRING(REGEX REPLACE " " "\\\\ "  _dependLibraryRuntimeDirectory "${_dependLibraryRuntimeDirectory}")
   ENDIF ()
+  SET(${_PACKAGEDEPEND}_RUNTIME_DIRECTORY "${_dependLibraryRuntimeDirectory}")
+  IF ("${_test_path}" STREQUAL "")
+    MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initializing TEST_PATH with PATH")
+    SET (_test_path "$ENV{PATH}" )
+  ENDIF ()
+  IF ("${CMAKE_HOST_SYSTEM}" MATCHES ".*Windows.*")
+    SET (SEP "\\;")
+  ELSE ()
+    SET (SEP ":")
+  ENDIF ()
+  SET (_test_path "${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY}${SEP}${_test_path}")
+  IF (MYPACKAGE_DEBUG)
+    MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Prepended ${${_PACKAGEDEPEND}_RUNTIME_DIRECTORY} to TEST_PATH")
+  ENDIF ()
+  SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_TEST_PATH "${_test_path}")
 ENDMACRO()


Fixed support for H18.5 on Windows

Fixed support for H18.5 on Windows

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -137,10 +137,12 @@
 # Note that passing MINIMUM_HOUDINI_VERSION into find_package(Houdini) doesn't work
 if(NOT Houdini_FOUND)
   message(FATAL_ERROR "Unable to locate Houdini Installation.")
-elseif(Houdini_VERSION VERSION_LESS MINIMUM_HOUDINI_VERSION)
-  message(FATAL_ERROR "Unsupported Houdini Version ${Houdini_VERSION}. Minimum "
-    "supported is ${MINIMUM_HOUDINI_VERSION}."
-  )
+elseif(MINIMUM_HOUDINI_VERSION)
+  if(Houdini_VERSION VERSION_LESS MINIMUM_HOUDINI_VERSION)
+    message(FATAL_ERROR "Unsupported Houdini Version ${Houdini_VERSION}. Minimum "
+      "supported is ${MINIMUM_HOUDINI_VERSION}."
+    )
+  endif()
 endif()

 find_package(PackageHandleStandardArgs)
@@ -204,10 +206,17 @@
   )
 elseif(WIN32)
   #libRAY is already included by houdini for windows builds
-  list(APPEND _HOUDINI_EXTRA_LIBRARIES
-    ${HOUDINI_DSOLIB_DIR}/hboost_regex-mt.lib
-    ${HOUDINI_DSOLIB_DIR}/hboost_thread-mt.lib
-  )
+  if(Houdini_VERSION VERSION_LESS 18.5)
+    list(APPEND _HOUDINI_EXTRA_LIBRARIES
+      ${HOUDINI_DSOLIB_DIR}/hboost_regex-mt.lib
+      ${HOUDINI_DSOLIB_DIR}/hboost_thread-mt.lib
+    )
+  else()
+    list(APPEND _HOUDINI_EXTRA_LIBRARIES
+      ${HOUDINI_DSOLIB_DIR}/hboost_regex-mt-x64.lib
+      ${HOUDINI_DSOLIB_DIR}/hboost_thread-mt-x64.lib
+    )
+  endif()
   list(APPEND _HOUDINI_EXTRA_LIBRARY_NAMES
     hboost_regex
     hboost_thread


Minor bugfix with avrdude arguments, fixes issue #14

--- cmake/modules/FindArduino.cmake
+++ cmake/modules/FindArduino.cmake
@@ -584,7 +584,7 @@
 #
 # Sets up default avrdude settings for burning firmware via a programmer.
 function(setup_arduino_programmer_args BOARD_ID PROGRAMMER TARGET_NAME PORT OUTPUT_VAR)
-    set(AVRDUDE_ARGS ${OUTPUT_VAR})
+    set(AVRDUDE_ARGS ${${OUTPUT_VAR}})

     set(AVRDUDE_FLAGS ${ARDUINO_AVRDUDE_FLAGS})
     if(DEFINED ${TARGET_NAME}_AFLAGS)


Also look for Windows' naming of Xerces 3.

--- cmake_modules/FindXercesC.cmake
+++ cmake_modules/FindXercesC.cmake
@@ -19,7 +19,7 @@

 FIND_LIBRARY(
 	XERCESC_LIBRARY
-	NAMES xerces-c xerces-c_2
+	NAMES xerces-c xerces-c_2 xerces-c_3
 	PATHS ${XERCES_LIBRARY_DIR})

 IF (XERCESC_INCLUDE AND XERCESC_LIBRARY)


Improve "known-crashing test" list support in ADD_TEST_DIRECTORY(): only skip such tests on Win32, otherwise use EXPECTED_FAILURE(). Also raise an error if an unknown test is passed to this macro.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -629,41 +629,101 @@

 ENDMACRO(expected_failure)

-# Convenience macro for adding tests in a standard format.
+# Convenience macro for adding tests in a standard format. All test
+# cases (.xq files) in "Queries" subdirectory of the named directory
+# will be automatically added for CTest. Each test will be named
+# ${PROJECT_NAME}/<filename>, where <filename> is the path relative to
+# the Queries/ subdirectory.
+#
+# The optional second argument exists for Windows. Normally,
+# EXPECTED_FAILURE() can be used even for tests that crash
+# (segfault). However, on Windows, when a test crashes, it pops up a
+# dialog box. This prevents tests running unattended.  Since it is not
+# possible with CMake to remove a test once added,
+# ADD_TEST_DIRECTORY() needs to be told not to add the test at all on
+# Windows platforms. Therefore, after the directory name, you may
+# additional arguments in the form (testname bugnumber testname
+# bugnumber ...) to ADD_TEST_DIRECTORY().  On Windows, the named tests
+# will be skipped entirely. On other platforms, they will be passed to
+# EXPECTED_FAILURE() with the corresponding bug number.
+#
+# This second argument should only be used for test cases that are
+# currently *crashing* on Windows. If the test is simply failing, then
+# you should use EXPECTED_FAILURE() after calling ADD_TEST_DIRECTORY().
+#
 # Parameters:
 #   TEST_DIR - all the .xq files in this directory will be added as tests
-#   ARGV1    - if this is present, it will be interpreted as a list of
-#              exceptions. The list items will be removed from the list of
-#              files found in TEST_DIR.
+#   (additional args)  - expected crashing tests, as discussed above.
 MACRO (ADD_TEST_DIRECTORY TEST_DIR)
   # QQQ error-check: Queries directory exists, some tests found...
   FILE(GLOB_RECURSE TESTFILES FOLLOW_SYMLINKS
     RELATIVE "${TEST_DIR}/Queries" "${TEST_DIR}/Queries/*.xq")

-  FOREACH (EXCEPTION ${ARGV1})
-    LIST (REMOVE_ITEM TESTFILES ${EXCEPTION})
-  ENDFOREACH (EXCEPTION)
-
+  # Convert extra arguments to two lists: test names and bug IDs
+  SET (crash_tests)
+  SET (crash_bugids)
+  SET (known_crashes ${ARGN})
+  LIST (LENGTH known_crashes num_crashes)
+  WHILE (num_crashes GREATER 0)
+    LIST (GET known_crashes 0 _testcase)
+    LIST (APPEND crash_tests ${_testcase})
+    LIST (GET known_crashes 1 _bugid)
+    LIST (APPEND crash_bugids ${_bugid})
+    LIST (REMOVE_AT known_crashes 0 1)
+    MATH (EXPR num_crashes "${num_crashes} - 2")
+  ENDWHILE (num_crashes GREATER 0)
+
+  IF(WIN32)
+    SET(PATH_SEP ",")
+  ELSE(WIN32)
+    SET(PATH_SEP ":")
+  ENDIF(WIN32)
   SET(TESTCOUNTER 0)
   FOREACH(TESTFILE ${TESTFILES})
     SET(TESTNAME "${PROJECT_NAME}/${TESTFILE}")

-    IF(WIN32)
-      SET(PATH_SEP ",")
-    ELSE(WIN32)
-      SET(PATH_SEP ":")
-    ENDIF(WIN32)
-    ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
-      "--rbkt-src" "${TEST_DIR}"
-      "--module-path" "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${SECONDARY_MODULE_PATHS}"
-      "${TESTFILE}")
-
-    MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
-    MATH(EXPR TESTMOD "${TESTCOUNTER}%100")
-    IF (${TESTMOD} EQUAL 0)
-      MESSAGE(STATUS "Adding another 100 Tests")
-    ENDIF (${TESTMOD} EQUAL 0)
+    # See if this test is in the known-crashing list
+    SET (_crash_bugid)
+    LIST (FIND crash_tests ${TESTNAME} _crash_idx)
+    IF (${_crash_idx} GREATER -1)
+      # Get corresponding bug ID
+      LIST (GET crash_bugids ${_crash_idx} _crash_bugid)
+      # Remove from known-crashing list
+      LIST (REMOVE_AT crash_tests ${_crash_idx})
+    ENDIF (${_crash_idx} GREATER -1)
+
+    # On Windows, skip calling ADD_TEST() for any known crashing tests
+    IF (WIN32 AND (${_crash_idx} GREATER -1) )
+      MESSAGE (STATUS "WARNING: Skipping test case ${TESTNAME} which is expected to crash - bug ${_crash_bugid}")
+    ELSE (WIN32 AND (${_crash_idx} GREATER -1) )
+      ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
+	"--rbkt-src" "${TEST_DIR}"
+	"--module-path"
+	"${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${SECONDARY_MODULE_PATHS}"
+	"${TESTFILE}")
+
+      # On non-Windows, call EXPECTED_FAILURE() for known crashes
+      IF (${_crash_idx} GREATER -1)
+	MESSAGE (STATUS "Marking test case ${TESTNAME} as expected to crash - bug ${bugid}")
+	EXPECTED_FAILURE (${TESTNAME} ${_bugid})
+      ENDIF (${_crash_idx} GREATER -1)
+
+      MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
+      MATH(EXPR TESTMOD "${TESTCOUNTER}%100")
+      IF (${TESTMOD} EQUAL 0)
+	MESSAGE(STATUS "Adding another 100 Tests")
+      ENDIF (${TESTMOD} EQUAL 0)
+
+    ENDIF (WIN32 AND (${_crash_idx} GREATER -1) )
+
   ENDFOREACH(TESTFILE)
+
+  # Ensure that known-crashes list is empty - otherwise some tests were
+  # named that didn't exist
+  IF (NOT "${crash_tests}" STREQUAL "")
+    MESSAGE (FATAL_ERROR "The following non-existing test cases were passed to ADD_TEST_DIRECTORY(): ${crash_tests}")
+  ENDIF (NOT "${crash_tests}" STREQUAL "")
+
   MESSAGE(STATUS "Added ${TESTCOUNTER} tests in ${TEST_DIR}")
 ENDMACRO (ADD_TEST_DIRECTORY)


Switch for debug vs normal execution

Switch for debug vs normal execution

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -19,12 +19,21 @@
 endif()

 # Create intermediate representation in XcodeML Fortran format
-add_custom_command(
-  OUTPUT  ${OUTPUT_FILE}
-  COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --debug -J ${XMOD_DIR} --Wx-d -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
-  DEPENDS ${ORIGINAL_FILE}
-  COMMENT "Translating CLAW directive with ${CLAWFC}"
-)
+if(${TEST_DEBUG}) # with debug option
+  add_custom_command(
+    OUTPUT  ${OUTPUT_FILE}
+    COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} --debug -J ${XMOD_DIR} --Wx-d -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
+    DEPENDS ${ORIGINAL_FILE}
+    COMMENT "Translating CLAW directive with ${CLAWFC}"
+  )
+else() # without debug option
+  add_custom_command(
+    OUTPUT  ${OUTPUT_FILE}
+    COMMAND ${CLAWFC} ${OPTIONAL_FLAGS} -J ${XMOD_DIR} -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
+    DEPENDS ${ORIGINAL_FILE}
+    COMMENT "Translating CLAW directive with ${CLAWFC}"
+  )
+endif()

 add_custom_target(
   transform-${TEST_NAME}


git-svn-id: http://glfx.googlecode.com/svn/trunk@63 5595c9b7-382c-e053-034d-f28d15879402

--- glfx.pc.cmake
+++ glfx.pc.cmake
@@ -3,4 +3,4 @@
 Requires:
 Version: @GLFX_VERSION@
 Libs: -L@LIB_DESTINATION@ -lglfx
-Cflags:
+Cflags: -I@INCLUDE_INSTALL_DIR@


Some minor changes

Some minor changes

--- contrib/cmake/FindJRTPLIB.cmake
+++ contrib/cmake/FindJRTPLIB.cmake
@@ -50,12 +50,6 @@
 	endif()
 endif()

-message(STATUS "INCLUDE: ${JRTPLIB_INCLUDE_DIR}")
-message(STATUS "LIB: ${JRTPLIB_LIBRARY}")
-
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(JRTPLIB DEFAULT_MSG JRTPLIB_LIBRARY JRTPLIB_INCLUDE_DIR)
 MARK_AS_ADVANCED(JRTPLIB_LIBRARY_RELEASE JRTPLIB_LIBRARY_DEBUG)
-
-message(STATUS "JRTPLIB FOUND: ${JRTPLIB_FOUND}")
-


Replace custom GIT_IS_REPO() and GIT_WC_INFO() macros

- `git rev-list -1 HEAD` to check
  - if it is a git repository
  - retrieve the latest hash
- `git name-rev --name-only <hash>` to retrieve the revision name

Removed obsolete and undocumented result variables.
Added documentation for short id.

--- CMake/mitkFunctionGetVersion.cmake
+++ CMake/mitkFunctionGetVersion.cmake
@@ -2,15 +2,13 @@
 #!
 #! If the source_dir variable points to a git repository, this function
 #! extracts the current revision hash and branch/tag name.
-#!
-#! If the source_dir variable points to a subversion repository, this
-#! function extracts the current svn revision.
 #
 #! The information is provided in
 #! <ul>
-#!  <li> ${prefix}_REVISION_ID The git hash or svn revision value
+#!  <li> ${prefix}_REVISION_ID The git hash
+#!  <li> ${prefix}_REVISION_SHORTID The short git hash (8 digits)
 #!  <li> ${prefix}_REVISION_NAME The git branch/tag name or empty
-#!  <li> ${prefix}_WC_TYPE The working copy type, one of "local", "git", or "svn"
+#!  <li> ${prefix}_WC_TYPE The working copy type, one of "local", or "git"
 #! </ul>
 #!
 #! \param source_dir The directory containing a working copy
@@ -28,43 +26,27 @@
   set(_wc_id "")
   set(_wc_name "")

+  find_package(Git)

-  find_package(Git)
-  if(GIT_FOUND)
+  if(Git_FOUND)
+    execute_process(COMMAND ${GIT_EXECUTABLE} rev-list -1 HEAD
+      WORKING_DIRECTORY "${source_dir}"
+      RESULT_VARIABLE _result_var
+      OUTPUT_VARIABLE ${prefix}_WC_REVISION_HASH
+      OUTPUT_STRIP_TRAILING_SPACE
+      ERROR_QUIET)

-    GIT_IS_REPO(${source_dir} _is_git_repo)
-    if(_is_git_repo)
+    if(NOT _result_var)
       set(_wc_type "git")
-      GIT_WC_INFO(${source_dir} ${prefix})
+
+      execute_process(COMMAND ${GIT_EXECUTABLE} name-rev --name-only ${${prefix}_WC_REVISION_HASH}
+        WORKING_DIRECTORY "${source_dir}"
+        OUTPUT_VARIABLE ${prefix}_WC_REVISION_NAME
+        OUTPUT_STRIP_TRAILING_SPACE)

       set(_wc_id ${${prefix}_WC_REVISION_HASH})
-
-      string(REPLACE " " ";" hash_name ${${prefix}_WC_REVISION_NAME})
-      list(GET hash_name 1 name)
-      if(name)
-        set(_wc_name ${name})
-      endif()
+      set(_wc_name ${${prefix}_WC_REVISION_NAME})
     endif()
-  endif()
-
-  # test for svn working copy
-  if(_wc_type STREQUAL "local")
-
-    find_package(Subversion)
-    if(Subversion_FOUND)
-      execute_process(COMMAND ${Subversion_SVN_EXECUTABLE} info
-                      WORKING_DIRECTORY ${source_dir}
-                      RESULT_VARIABLE _subversion_result
-                      OUTPUT_QUIET
-                      ERROR_QUIET)
-
-      if(NOT _subversion_result)
-        set(_wc_type svn)
-        Subversion_WC_INFO(${source_dir} ${prefix})
-        set(_wc_id ${${prefix}_WC_REVISION})
-      endif()
-    endif()
-
   endif()

   set(${prefix}_WC_TYPE ${_wc_type} PARENT_SCOPE)
@@ -76,8 +58,4 @@
   set(${prefix}_REVISION_SHORTID ${_shortid} PARENT_SCOPE)
   set(${prefix}_REVISION_NAME ${_wc_name} PARENT_SCOPE)

-  # For backwards compatibility
-  set(${prefix}_WC_REVISION_HASH ${_wc_id} PARENT_SCOPE)
-  set(${prefix}_WC_REVISION_NAME ${_wc_name} PARENT_SCOPE)
-
 endfunction()


libclangはいらんかった

libclangはいらんかった

--- CMakeFiles/modules/FindClang.cmake
+++ CMakeFiles/modules/FindClang.cmake
@@ -13,7 +13,7 @@
 set(CLANG_INCLUDE_DIRS ${CLANG_INCLUDE_DIRS} ${LLVM_INCLUDE_DIR})
 set(CLANG_INCLUDE_DIRS ${CLANG_INCLUDE_DIRS} ${CLANG_INCLUDE_DIR})

-FIND_AND_ADD_CLANG_LIB(clang)
+#FIND_AND_ADD_CLANG_LIB(clang)
 FIND_AND_ADD_CLANG_LIB(clangARCMigrate)
 FIND_AND_ADD_CLANG_LIB(clangASTMatchers)
 FIND_AND_ADD_CLANG_LIB(clangAnalysis)


Remove unnecessary copy now that we build into drtile source directory

--- ilastik.cmake
+++ ilastik.cmake
@@ -44,7 +44,7 @@
         -DVIGRA_ROOT=${FLYEM_BUILD_DIR}
         ${ilastik_SRC_DIR}/lazyflow/lazyflow/drtile
     BUILD_COMMAND       ${FLYEM_ENV_STRING} make
-    INSTALL_COMMAND     ${CMAKE_COMMAND} -E copy drtile.so ${FLYEM_BUILD_DIR}/lib
+    INSTALL_COMMAND     ""
 )

 # Create script files


ilastik.cmake: Updated default git tag.

ilastik.cmake: Updated default git tag.

--- ilastik.cmake
+++ ilastik.cmake
@@ -31,7 +31,7 @@
 include (scikit-learn)

 # select the desired ilastik commit
-set(DEFAULT_ILASTIK_VERSION "flyem-20130702")
+set(DEFAULT_ILASTIK_VERSION "20131203")
 IF(NOT DEFINED ILASTIK_VERSION)
     SET(ILASTIK_VERSION "${DEFAULT_ILASTIK_VERSION}")
 ENDIF()


update condition to check x64 or x86

update condition to check x64 or x86

--- src/FindRTMaps.cmake
+++ src/FindRTMaps.cmake
@@ -1,10 +1,10 @@
-if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+if( CMAKE_CL_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8 )
 	set(ARCH_TYPE "x64")
 	message(STATUS "ARCH_TYPE = x64")
-else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+else( CMAKE_CL_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8 )
 	set(ARCH_TYPE "x86")
 	message(STATUS "ARCH_TYPE = x86")
-endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
+endif( CMAKE_CL_64 OR CMAKE_SIZEOF_VOID_P EQUAL 8 )

 SET(RTMAPS_DIR $ENV{RTMAPS_SDKDIR})
 message(STATUS "RTMAPS_DIR = ${RTMAPS_DIR}")


OSX: make Glut found in framework, not x11

--- cmake/SpecializedConfig/Config_OSX.cmake
+++ cmake/SpecializedConfig/Config_OSX.cmake
@@ -1,7 +1,7 @@

 ###########################################################################
 #
-# Configuration
+# Configuration ( Jens Verwiebe )
 #
 ###########################################################################

@@ -30,4 +30,7 @@
 find_library(GLEW_LIBRARY libGLEW.a PATHS ${OSX_SEARCH_PATH}//lib )
 set(GLEW_FOUND 1)

+set(GLUT_SEARCH_PATH          "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/glut.framework")
+set(GLUT_INCLUDE_PATH 		"${GLUT_SEARCH_PATH}/Headers")
+#set(GLUT_LIBRARYDIR           "${GLUT_SEARCH_PATH}")


tap: add the motor_test command to the build config

--- cmake/configs/nuttx_tap-v1_default.cmake
+++ cmake/configs/nuttx_tap-v1_default.cmake
@@ -32,6 +32,7 @@
 	systemcmds/param
 	systemcmds/perf
 	systemcmds/pwm
+	systemcmds/motor_test
 	systemcmds/reboot
 	systemcmds/top
 	systemcmds/config