Fix tests in FindICONV.cmake when cross-compiling

Fix the tests that are performed when CMake is in cross-compiling mode.
Since much of FindICONV.cmake is ported from Gnulib (which uses Autoconf),
the "host" platform (the value of the '--host=' option argument to an
Autoconf-generated 'configure' script) was incorrectly presumed to be
equivalent to what CMake calls the "host" platform (resulting in the use of
the CMAKE_HOST_SYSTEM variable instead of CMAKE_SYSTEM). In reality, the
GNU Build System's "build" platform more closely corresponds to CMake's
"host", while GNU's "host" corresponds to CMake's "target".

--- cmake/FindICONV.cmake
+++ cmake/FindICONV.cmake
@@ -203,14 +203,14 @@
 " ICONV_WORKS)
     else()
       if(NOT DEFINED ICONV_WORKS)
-        # Guess value for ICONV_WORKS based on the name of the host system.
+        # Guess value for ICONV_WORKS based on the name of the target system.
         if(NOT ICONV_FIND_QUIETLY)
           message(STATUS "Performing Test ICONV_WORKS")
         endif()
-        if(CMAKE_HOST_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_HOST_SYSTEM_NAME STREQUAL "HP-UX")
-          set(ICONV_WORKS FALSE CACHE BOOL "Whether iconv() works on the host system (set to false for AIX and HP-UX by default).")
+        if(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "HP-UX")
+          set(ICONV_WORKS FALSE CACHE BOOL "Whether iconv() works on the target system (set to false for AIX and HP-UX by default).")
         else()
-          set(ICONV_WORKS TRUE CACHE BOOL "Whether iconv() works on the host system (set to true by default).")
+          set(ICONV_WORKS TRUE CACHE BOOL "Whether iconv() works on the target system (set to true by default).")
         endif()
         if(NOT ICONV_FIND_QUIETLY)
           if(ICONV_WORKS)
@@ -439,13 +439,13 @@
         if(NOT ICONV_FIND_QUIETLY)
           message(STATUS "Performing Test ICONV_SUPPORTS_UNICODE")
         endif()
-        if(HAVE_GNU_ICONV OR CMAKE_HOST_SYSTEM MATCHES "SunOS-(2\\.9|2\\.1[0-9])")
-          set(ICONV_SUPPORTS_UNICODE 1 CACHE INTERNAL "Whether iconv() supports conversion between UTF-8 and UTF-{16,32}{BE,LE} on the host system.")
+        if(HAVE_GNU_ICONV OR CMAKE_SYSTEM MATCHES "SunOS-(2\\.9|2\\.1[0-9])")
+          set(ICONV_SUPPORTS_UNICODE 1 CACHE INTERNAL "Whether iconv() supports conversion between UTF-8 and UTF-{16,32}{BE,LE} on the target system.")
           if(NOT ICONV_FIND_QUIETLY)
             message(STATUS "Performing Test ICONV_SUPPORTS_UNICODE - success")
           endif()
         else()
-          set(ICONV_SUPPORTS_UNICODE FALSE CACHE BOOL "Whether iconv() supports conversion between UTF-8 and UTF-{16,32}{BE,LE} on the host system (set to false by default).")
+          set(ICONV_SUPPORTS_UNICODE FALSE CACHE BOOL "Whether iconv() supports conversion between UTF-8 and UTF-{16,32}{BE,LE} on the target system (set to false by default).")
           if(NOT ICONV_FIND_QUIETLY)
             message(STATUS "Performing Test ICONV_SUPPORTS_UNICODE - failed (guessed)")
           endif()


Remove unnecessary dependency tracking for Cython files. Also remove "support" for compiling multiple Cython files at once since the Cython compiler doesn't even support that.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -73,108 +73,24 @@
 # Create a *.c or *.cxx file from a *.pyx file.
 # Input the generated file basename.  The generate files will put into the variable
 # placed in the "generated_files" argument. Finally all the *.py and *.pyx files.
-function( compile_pyx _name pyx_target_name generated_files )
+function( compile_pyx _name pyx_target_name generated_files pyx_file)
   # Default to assuming all files are C.
   set( cxx_arg "" )
   set( extension ${CYTHON_C_EXTENSION} )
   set( pyx_lang "C" )
   set( comment "Compiling Cython C source for ${_name}..." )

-  set( cython_include_directories "" )
-  set( pxd_dependencies "" )
-  set( c_header_dependencies "" )
-  set( pyx_locations "" )
+  get_filename_component( pyx_file_basename "${pyx_file}" NAME_WE )

-  foreach( pyx_file ${ARGN} )
-    get_filename_component( pyx_file_basename "${pyx_file}" NAME_WE )
-
-    # Determine if it is a C or C++ file.
-    get_source_file_property( property_is_cxx ${pyx_file} CYTHON_IS_CXX )
-    if( ${property_is_cxx} )
-      set( cxx_arg "--cplus" )
-      set( extension ${CYTHON_CXX_EXTENSION} )
-      set( pyx_lang "CXX" )
-      set( comment "Compiling Cython CXX source for ${_name}..." )
-    endif()
-
-    # Get the include directories.
-    get_source_file_property( pyx_location ${pyx_file} LOCATION )
-    #get_filename_component( pyx_path ${pyx_location} PATH )
-    # {pyx_path} is incompatible with putting the files in a subdirectory, so just using "." instead
-    #get_directory_property( cmake_include_directories DIRECTORY ${pyx_path} INCLUDE_DIRECTORIES )
-    get_directory_property( cmake_include_directories DIRECTORY "." INCLUDE_DIRECTORIES )
-    list( APPEND cython_include_directories ${cmake_include_directories} )
-    list( APPEND pyx_locations "${pyx_location}" )
-
-    # Determine dependencies.
-    # Add the pxd file will the same name as the given pyx file.
-    unset( corresponding_pxd_file CACHE )
-    find_file( corresponding_pxd_file ${pyx_file_basename}.pxd
-      PATHS "${pyx_path}" ${cmake_include_directories}
-      NO_DEFAULT_PATH )
-    if( corresponding_pxd_file )
-      list( APPEND pxd_dependencies "${corresponding_pxd_file}" )
-    endif()
-
-    # pxd files to check for additional dependencies.
-    set( pxds_to_check "${pyx_file}" "${pxd_dependencies}" )
-    set( pxds_checked "" )
-    set( number_pxds_to_check 1 )
-    while( ${number_pxds_to_check} GREATER 0 )
-      foreach( pxd ${pxds_to_check} )
-        list( APPEND pxds_checked "${pxd}" )
-        list( REMOVE_ITEM pxds_to_check "${pxd}" )
-
-        # check for C header dependencies
-        file( STRINGS "${pxd}" extern_from_statements
-          REGEX "cdef[ ]+extern[ ]+from.*$" )
-        foreach( statement ${extern_from_statements} )
-          # Had trouble getting the quote in the regex
-          string( REGEX REPLACE "cdef[ ]+extern[ ]+from[ ]+[\"]([^\"]+)[\"].*" "\\1" header "${statement}" )
-          unset( header_location CACHE )
-          find_file( header_location ${header} PATHS ${cmake_include_directories} )
-          if( header_location )
-            list( FIND c_header_dependencies "${header_location}" header_idx )
-            if( ${header_idx} LESS 0 )
-              list( APPEND c_header_dependencies "${header_location}" )
-            endif()
-          endif()
-        endforeach()
-
-        # check for pxd dependencies
-
-        # Look for cimport statements.
-        set( module_dependencies "" )
-        file( STRINGS "${pxd}" cimport_statements REGEX cimport )
-        foreach( statement ${cimport_statements} )
-          if( ${statement} MATCHES from )
-            string( REGEX REPLACE "from[ ]+([^ ]+).*" "\\1" module "${statement}" )
-          else()
-            string( REGEX REPLACE "cimport[ ]+([^ ]+).*" "\\1" module "${statement}" )
-          endif()
-          list( APPEND module_dependencies ${module} )
-        endforeach()
-        list( REMOVE_DUPLICATES module_dependencies )
-        # Add the module to the files to check, if appropriate.
-        foreach( module ${module_dependencies} )
-          unset( pxd_location CACHE )
-          find_file( pxd_location ${module}.pxd
-            PATHS "${pyx_path}" ${cmake_include_directories} NO_DEFAULT_PATH )
-          if( pxd_location )
-            list( FIND pxds_checked ${pxd_location} pxd_idx )
-            if( ${pxd_idx} LESS 0 )
-              list( FIND pxds_to_check ${pxd_location} pxd_idx )
-              if( ${pxd_idx} LESS 0 )
-                list( APPEND pxds_to_check ${pxd_location} )
-                list( APPEND pxd_dependencies ${pxd_location} )
-              endif() # if it is not already going to be checked
-            endif() # if it has not already been checked
-          endif() # if pxd file can be found
-        endforeach() # for each module dependency discovered
-      endforeach() # for each pxd file to check
-      list( LENGTH pxds_to_check number_pxds_to_check )
-    endwhile()
-  endforeach() # pyx_file
+  # Determine if it is a C or C++ file.
+  get_source_file_property( property_is_cxx ${pyx_file} CYTHON_IS_CXX )
+  if( ${property_is_cxx} )
+    set( cxx_arg "--cplus" )
+    set( extension ${CYTHON_CXX_EXTENSION} )
+    set( pyx_lang "CXX" )
+    set( comment "Compiling Cython CXX source for ${_name}..." )
+  endif()
+  get_source_file_property( pyx_location ${pyx_file} LOCATION )

   # Set additional flags.
   if( CYTHON_ANNOTATE )
@@ -192,27 +108,17 @@
       endif()
   endif()

-  # Include directory arguments.
-  list( REMOVE_DUPLICATES cython_include_directories )
-  set( include_directory_arg "" )
-  foreach( _include_dir ${cython_include_directories} )
-    set( include_directory_arg ${include_directory_arg} "-I" "${_include_dir}" )
-  endforeach()
-
   # Determining generated file name.
   set( _generated_files "${_name}.${extension}" )
   set_source_files_properties( ${_generated_files} PROPERTIES GENERATED TRUE )
   set( ${generated_files} ${_generated_files} PARENT_SCOPE )

-  list( REMOVE_DUPLICATES pxd_dependencies )
-  list( REMOVE_DUPLICATES c_header_dependencies )
-
   # Add the command to run the compiler.
   add_custom_target(${pyx_target_name}
     COMMAND ${CYTHON_EXECUTABLE} ${cxx_arg} ${include_directory_arg}
     ${annotate_arg} ${no_docstrings_arg} ${cython_debug_arg} ${CYTHON_FLAGS}
-    --output-file ${_generated_files} ${pyx_locations}
-    DEPENDS ${pyx_locations} ${pxd_dependencies} ${c_header_dependencies}
+    --output-file ${_generated_files} ${pyx_location}
+    DEPENDS ${pyx_location}
     # do not specify byproducts for now since they don't work with the older
     # version of cmake available in the apt repositories.
     #BYPRODUCTS ${_generated_files}


Much spelling. Wow.

Much spelling. Wow.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@226638 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -169,7 +169,7 @@
   set(${out_var} ${archs} PARENT_SCOPE)
 endfunction()

-# Arhcitectures supported by compiler-rt libraries.
+# Architectures supported by compiler-rt libraries.
 filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
   x86_64 i386 i686 powerpc64 powerpc64le arm aarch64 mips mips64 mipsel mips64el)
 filter_available_targets(ASAN_SUPPORTED_ARCH


Cleanup; we don't need -DHAVE_W32_SYSTEM, we check that we don't need it now, and refuse assuan otherwise.

svn path=/branches/work/kdab-post-4.0/kdepim/; revision=711137

--- kleopatra/ConfigureChecks.cmake
+++ kleopatra/ConfigureChecks.cmake
@@ -20,18 +20,16 @@
 endif( ASSUAN_FOUND )

 if ( USABLE_ASSUAN_FOUND )
-  # check if we don't have old assuan file which contains HAVE_W32_SYSTEM
-  # which is not define in .h file (old assuan.h)
+  # check if assuan.h can be compiled standalone (it couldn't, on
+  # Windows, until recently, because of a HAVE_W32_SYSTEM #ifdef in
+  # there)
   check_cxx_source_compiles( "
        #include <assuan.h>
        int main() {
            return 1;
        }
        "
-       HAVE_NEW_ASSUAN_FILE )
-   if( NOT HAVE_NEW_ASSUAN_FILE )
-     set(USABLE_ASSUAN_FOUND false)
-   endif( NOT HAVE_NEW_ASSUAN_FILE)
+       USABLE_ASSUAN_FOUND )
 endif( USABLE_ASSUAN_FOUND )

 if ( USABLE_ASSUAN_FOUND )
@@ -42,9 +40,7 @@
 endif( USABLE_ASSUAN_FOUND )

 if ( USABLE_ASSUAN_FOUND )
-  if(WIN32)
-    set( CMAKE_REQUIRED_DEFINITIONS "-DHAVE_W32_SYSTEM")
-  endif(WIN32)
+
   # check if assuan has assuan_fd_t
   check_cxx_source_compiles("
         #include <assuan.h>


More specific paths for old ceres

More specific paths for old ceres

Former-commit-id: fc12238eed1ae7ffcc7ca073344383d5b173926d

--- cmake-modules/Fetch_Ceres.cmake
+++ cmake-modules/Fetch_Ceres.cmake
@@ -39,9 +39,12 @@
     string (REPLACE ";" " " CERES_FLAGS "${CERES_FLAGS}")
     list(APPEND CERES_CMAKE_OPTIONS  -DCERES_FLAGS:STRING=${CERES_FLAGS})
     list(APPEND CERES_CMAKE_OPTIONS  -DCUSTOM_SUFFIX:STRING=${CUSTOM_SUFFIX})
+    list(APPEND CERES_CMAKE_OPTIONS  -DEigen3_DIR:PATH=${CMAKE_INSTALL_PREFIX}/Eigen3)
     list(APPEND CERES_CMAKE_OPTIONS  -DEIGEN3_INCLUDE_DIR:PATH=${EIGEN3_INCLUDE_DIR})
+    list(APPEND CERES_CMAKE_OPTIONS  -Dgflags_DIR:PATH=${CMAKE_INSTALL_PREFIX}/gflags)
     list(APPEND CERES_CMAKE_OPTIONS  -DGFLAGS_INCLUDE_DIR:PATH=${GFLAGS_INCLUDE_DIR})
     list(APPEND CERES_CMAKE_OPTIONS  -DGFLAGS_LIBRARIES:PATH=${GFLAGS_LIBRARIES})
+    list(APPEND CERES_CMAKE_OPTIONS  -Dglog_DIR:PATH=${CMAKE_INSTALL_PREFIX}/glog)
     list(APPEND CERES_CMAKE_OPTIONS  -DGLOG_INCLUDE_DIR:PATH=${GLOG_INCLUDE_DIR})
     list(APPEND CERES_CMAKE_OPTIONS  -DGLOG_LIBRARIES:PATH=${GLOG_LIBRARIES})


Squashed '3rdparty/github/cmake-utils/' changes from 890b1bb5..ee0bf6cc

ee0bf6cc Added STATIC keyword for package dependeny

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

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -1,6 +1,6 @@
 MACRO (MYPACKAGEDEPENDENCY packageDepend packageDependSourceDir)
   #
-  # Optional argument: TESTS, LIBS, EXES, SYSTEM, LOCAL
+  # Optional argument: TESTS, LIBS, EXES, SYSTEM, LOCAL (forces ALL_IN_ONE for this dependency), STATIC
   #
   IF (ALL_IN_ONE)
     SET (_ALL_IN_ONE TRUE)
@@ -11,6 +11,7 @@
   SET (_TESTS FALSE)
   SET (_LIBS FALSE)
   SET (_EXES FALSE)
+  SET (_STATIC FALSE)
   FOREACH (_var ${ARGN})
     IF (${_var} STREQUAL TESTS)
       IF (MYPACKAGE_DEBUG)
@@ -45,6 +46,12 @@
         MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} local mode")
       ENDIF ()
       SET (_ALL_IN_ONE TRUE)
+    ENDIF ()
+    IF (${_var} STREQUAL STATIC)
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} static mode")
+      ENDIF ()
+      SET (_STATIC TRUE)
     ENDIF ()
   ENDFOREACH ()
   IF (_ALL)
@@ -148,15 +155,30 @@
       MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Inspecting target candidate ${_target}")
     ENDIF ()
     IF (TARGET ${_target})
+      #
+      # Static mode ?
+      #
+      IF (_STATIC)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding -D${packageDepend}_static compile definition to target ${_target}")
+        ENDIF ()
+        TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC -D${packageDepend}_static)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency becomes ${packageDepend}_static for target ${_target}")
+        ENDIF ()
+        SET (realPackageDepend ${packageDepend}_static)
+      ELSE ()
+        SET (realPackageDepend ${packageDepend})
+      ENDIF ()
       IF (_ALL_IN_ONE)
         #
         # Dependency by target
         #
-        IF (TARGET ${packageDepend})
-          IF (MYPACKAGE_DEBUG)
-            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding target ${packageDepend} dependency to target ${_target}")
-          ENDIF ()
-          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${packageDepend})
+        IF (TARGET ${realPackageDepend})
+          IF (MYPACKAGE_DEBUG)
+            MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding target ${realPackageDepend} dependency to target ${_target}")
+          ENDIF ()
+          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${realPackageDepend})
           IF (_TESTS)
             #
             # A bit painful but the target locations are not known at this time.
@@ -164,17 +186,17 @@
             #
             GET_PROPERTY(_targets_for_test_set GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST)
             IF (NOT _targets_for_test_set)
-              SET (_targets_for_test ${packageDepend})
+              SET (_targets_for_test ${realPackageDepend})
               IF (MYPACKAGE_DEBUG)
-                MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initialized MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${packageDepend}")
+                MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Initialized MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${realPackageDepend}")
               ENDIF ()
               SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST ${_targets_for_test})
             ELSE ()
-              LIST (FIND _targets_for_test ${packageDepend} _targets_for_test_found)
+              LIST (FIND _targets_for_test ${realPackageDepend} _targets_for_test_found)
               IF (${_targets_for_test_found} EQUAL -1)
-                LIST (APPEND _targets_for_test ${packageDepend})
+                LIST (APPEND _targets_for_test ${realPackageDepend})
                 IF (MYPACKAGE_DEBUG)
-                  MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Appended MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${packageDepend}")
+                  MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Appended MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST with ${realPackageDepend}")
                 ENDIF ()
                 SET_PROPERTY(GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${PROJECT_NAME}_TARGETS_FOR_TEST ${_targets_for_test})
               ENDIF ()


cmake/MyPackageDependency.cmake: if STATIC, then ADD_SUBDIRECTORY uses EXCLUDE_FROM_ALL

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -116,7 +116,11 @@
     IF (_ALL_IN_ONE)
       GET_FILENAME_COMPONENT(packageDependSourceDirAbsolute ${packageDependSourceDir} ABSOLUTE)
       MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Adding subdirectory ${packageDependSourceDirAbsolute}")
-      ADD_SUBDIRECTORY(${packageDependSourceDirAbsolute})
+      IF (_STATIC)
+        ADD_SUBDIRECTORY(${packageDependSourceDirAbsolute} EXCLUDE_FROM_ALL)
+      ELSE ()
+        ADD_SUBDIRECTORY(${packageDependSourceDirAbsolute})
+      ENDIF ()
     ELSE ()
       MESSAGE(STATUS "[${PROJECT_NAME}-DEPEND-STATUS] Looking for ${packageDepend}")
       FIND_PACKAGE (${packageDepend})


[CMake] LLVM-Config.cmake: Split explicit_map_components_to_libraries and introduce llvm_map_components_to_libnames and llvm_expand_dependencies.

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

--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -74,8 +74,8 @@
   set( ${OUT_VAR} ${result} ${sys_result} PARENT_SCOPE )
 endfunction(llvm_map_components_to_libraries)

-
-function(explicit_map_components_to_libraries out_libs)
+# Map LINK_COMPONENTS to actual libnames.
+function(llvm_map_components_to_libnames out_libs)
   set( link_components ${ARGN} )
   get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
   string(TOUPPER "${llvm_libs}" capitalized_libs)
@@ -157,7 +157,13 @@
       endif( lib_idx LESS 0 )
     endif( NOT idx LESS 0 )
   endforeach(c)
-  # Expand dependencies while topologically sorting the list of libraries:
+
+  set(${out_libs} ${expanded_components} PARENT_SCOPE)
+endfunction()
+
+# Expand dependencies while topologically sorting the list of libraries:
+function(llvm_expand_dependencies out_libs)
+  set(expanded_components ${ARGN})
   list(LENGTH expanded_components lst_size)
   set(cursor 0)
   set(processed)
@@ -177,6 +183,13 @@
     list(LENGTH processed cursor)
     list(LENGTH expanded_components lst_size)
   endwhile( cursor LESS lst_size )
+  set(${out_libs} ${expanded_components} PARENT_SCOPE)
+endfunction()
+
+function(explicit_map_components_to_libraries out_libs)
+  llvm_map_components_to_libnames(link_libs ${ARGN})
+  llvm_expand_dependencies(expanded_components ${link_libs})
+  get_property(llvm_libs GLOBAL PROPERTY LLVM_LIBS)
   # Return just the libraries included in this build:
   set(result)
   foreach(c ${expanded_components})


Properly remove prefix from built module libs.

--- cmakemodules/PnMPIModules.cmake
+++ cmakemodules/PnMPIModules.cmake
@@ -28,8 +28,9 @@
     message(FATAL_ERROR "add_pnmpi_module() called with no source files!")
   endif()

-  # Add target and its dependency on the patcher
+  # Add a library for the module, and set it up to omit the 'lib' prefix
   add_library(${targetname} MODULE ${ARGN})
+  set_target_properties(${targetname} PROPERTIES PREFIX "")

   #For Apple set that undefined symbols should be looked up dynamically
   #(On linux this is already the default)


fix: Change order of gtest libraries in link dependencies list [CMake]

--- CMake/Modules/mirtkAddTest.cmake
+++ CMake/Modules/mirtkAddTest.cmake
@@ -44,7 +44,7 @@
   endforeach ()
   # Add test executable build target and CTest target
   if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test${target_name}.cc")
-    set(GTEST_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
+    set(GTEST_LIBRARIES ${GTEST_MAIN_LIBRARY} ${GTEST_LIBRARY})
     if (UNIX AND NOT GTest_NO_PTHREADS AND CMAKE_USE_PTHREADS_INIT)
       list(APPEND GTEST_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
     endif ()


From Andy Skinner, added support for ot-soversion-OpenThreads.dll dll naming under Windows

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@7425 16af8721-9629-0410-8352-f15c8da7e697

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -277,6 +277,7 @@

 ENDMACRO(SETUP_COMMANDLINE_EXAMPLE)

+# Takes two optional arguments -- osg prefix and osg version
 MACRO(HANDLE_MSVC_DLL)
 	#this is a hack... the build place is set to lib/<debug or release> by LIBARARY_OUTPUT_PATH equal to OUTPUT_LIBDIR
 	#the .lib will be crated in ../ so going straight in lib by the IMPORT_PREFIX property
@@ -284,7 +285,24 @@
 	#it is hardcoded, we should compute OUTPUT_BINDIR position relative to OUTPUT_LIBDIR ... to be implemented
 	#changing bin to something else breaks this hack
 	#the dll are versioned by prefixing the name with osg${OPENSCENEGRAPH_SOVERSION}-
+
+        # LIB_PREFIX: use "osg" by default, else whatever we've been given.
+        IF(${ARGC} GREATER 0)
+                SET(LIB_PREFIX ${ARGV0})
+        ELSE(${ARGC} GREATER 0)
+                SET(LIB_PREFIX osg)
+        ENDIF(${ARGC} GREATER 0)
+
+        # LIB_SOVERSION: use OSG's soversion by default, else whatever we've been given
+        IF(${ARGC} GREATER 1)
+                SET(LIB_SOVERSION ${ARGV1})
+        ELSE(${ARGC} GREATER 1)
+                SET(LIB_SOVERSION ${OPENSCENEGRAPH_SOVERSION})
+        ENDIF(${ARGC} GREATER 1)

-	 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
-	 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
+        SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/${LIB_PREFIX}${LIB_SOVERSION}-")
+        SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
+
+#	 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES PREFIX "../../bin/osg${OPENSCENEGRAPH_SOVERSION}-")
+#	 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES IMPORT_PREFIX "../")
 ENDMACRO(HANDLE_MSVC_DLL)


[C++, CMake] fix clang format invocation

Change-Id: I8ea4ad56e8b58bc0287f849e9ab54a7bb9314778

--- cpp/CMake/AddClangFormat.cmake
+++ cpp/CMake/AddClangFormat.cmake
@@ -40,7 +40,7 @@
         set(FORMAT_TARGET "format-${TARGET}")
         add_custom_target(
             ${FORMAT_TARGET}
-            COMMAND "${CLANG_FORMAT_PATH}" -i ${FILTERED_TARGET_SOURCES}
+            COMMAND "${CLANG_FORMAT_PATH}" -i ${TARGET_SOURCES}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
             VERBATIM
             COMMENT "${COMMENT}"


ice40: add  for VPR args

ice40: add  for VPR args

Signed-off-by: Elms <23ce84ca7a7de9dc17ad8e8b0bbd717d4f9f9884@freshred.net>

--- ice40/icestorm.cmake
+++ ice40/icestorm.cmake
@@ -30,7 +30,7 @@
     DEPENDS ${PYTHON3} ${PYTHON3_TARGET}
     )

-  get_target_property(FASM_TARGET env FASM_TARGET)
+  get_target_property_required(FASM_TARGET env FASM_TARGET)

   set(FASM2ASC ${symbiflow-arch-defs_SOURCE_DIR}/ice40/utils/fasm_icebox/fasm2asc.py)
   add_custom_target(
@@ -38,7 +38,7 @@
     DEPENDS numpy ${FASM_TARGET} ${FASM2ASC} ${PYTHON3} ${PYTHON3_TARGET}
     )

-  get_target_property(SDF_TIMING_TARGET env SDF_TIMING_TARGET)
+  get_target_property_required(SDF_TIMING_TARGET env SDF_TIMING_TARGET)
   add_custom_target(
     ice40_import_timing_deps
     DEPENDS ${ICE40_IMPORT_TIMING} ${SDF_TIMING_TARGET} ${PYTHON3} ${PYTHON3_TARGET}
@@ -83,6 +83,7 @@
       --allow_unrelated_clustering off
       --target_ext_pin_util 0.7
       --router_init_wirelength_abort_threshold 2
+      --congested_routing_iteration_threshold 0.8
     RR_PATCH_TOOL
       ${symbiflow-arch-defs_SOURCE_DIR}/ice40/utils/ice40_import_routing_from_icebox.py
     RR_PATCH_CMD "\${QUIET_CMD} \${CMAKE_COMMAND} -E env ${PYPATH_ARG} \


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -1,51 +1,6 @@
 [Desktop Entry]
 Name=Instant Messaging
-Name[ca]=Missatgeria instantània
-Name[cs]=Instant Messaging
-Name[da]=Instant messaging
-Name[de]=Instant-Messaging
-Name[es]=Mensajería instantánea
-Name[fi]=Pikaviestintä
-Name[fr]=Messagerie instantanée
-Name[it]=Messaggistica istantanea
-Name[nb]=Lynmelding
-Name[nl]=Instant Messaging
-Name[pt]=Mensagens Instantâneas
-Name[pt_BR]=Mensagens instantâneas
-Name[sk]=Priama komunikácia
-Name[sl]=Hipno sporočanje
-Name[sr]=Брзо гласништво
-Name[sr@ijekavian]=Брзо гласништво
-Name[sr@ijekavianlatin]=Brzo glasništvo
-Name[sr@latin]=Brzo glasništvo
-Name[sv]=Direktmeddelandekontakter
-Name[ug]=مۇڭداشقۇ
-Name[uk]=Миттєвий обмін повідомленнями
-Name[x-test]=xxInstant Messagingxx
-Name[zh_TW]=即時訊息
 Comment=Start a chat with any of your IM contacts or change your IM status
-Comment[ca]=Inicia un xat amb qualsevol dels vostres contactes de MI o canvia el vostre estat de MI
-Comment[cs]=Začít rozhovor s kterýmkoliv vaším kontaktem v IM nebo změnit stav na IM
-Comment[da]=Start chat med en af dine IM-kontakter eller skift din IM-status
-Comment[de]=Chats mit ihren Kontakten starten oder Ihren IM-Status ändern
-Comment[es]=Iniciar una conversación con cualquiera de sus contactos de MI o cambiar su estado de MI
-Comment[fi]=Aloita keskustelu muun pikaviestinkäyttäjän kanssa tai vaihda pikaviestintilaasi
-Comment[fr]=Démarre une discussion avec n'importe lequel de vos contacts de messagerie instantanée ou change l'état de celle-ci
-Comment[it]=Avvia una chat con un tuo contatto di MI oppure cambia il tuo stato di MI
-Comment[nb]=Start en prat med en av dine LM-kontakter eller endre din LM-status
-Comment[nl]=Begin een chat met een van uw IM-contactpersonen of wijzig uw IM-status
-Comment[pt]=Iniciar uma conversa com qualquer um dos seus contactos MI ou mudar o seu estado
-Comment[pt_BR]=Inicia um bate-papo com um dos seus contatos de MI ou altera o seu status
-Comment[sk]=Spustiť rozhovor s nejakým z vašich IM kontaktov alebo zmeniť váš IM stav
-Comment[sl]=Začnite klepet s katerimkoli izmed vaših stikov hipnega sporočanja ali spremenite vaše stanje
-Comment[sr]=Започните ћаскање преко ИМ контакта или измените своје ИМ стање
-Comment[sr@ijekavian]=Започните ћаскање преко ИМ контакта или измените своје ИМ стање
-Comment[sr@ijekavianlatin]=Započnite ćaskanje preko IM kontakta ili izmenite svoje IM stanje
-Comment[sr@latin]=Započnite ćaskanje preko IM kontakta ili izmenite svoje IM stanje
-Comment[sv]=Börja chatta med någon direktmeddelandekontakt eller ändra din direktmeddelandestatus
-Comment[uk]=Почати спілкування з будь-яким з ваших контактів або змінити ваш запис стану у системах обміну повідомленнями
-Comment[x-test]=xxStart a chat with any of your IM contacts or change your IM statusxx
-Comment[zh_TW]=與您的即時訊息聯絡人開始聊天，或是變更您的即時訊息狀態
 Icon=user-online

 X-KDE-ServiceTypes=Plasma/Runner


Also copy libGLESv2 on linux

Also copy libGLESv2 on linux

--- native/cmake/copyQt-linux.cmake
+++ native/cmake/copyQt-linux.cmake
@@ -41,7 +41,25 @@
     add_custom_command(
             TARGET CopyQtDependencies PRE_BUILD
             COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_IN_FILE}" "${_OUT_DIR}/${_EGL_NAME}"
-            COMMENT "[COPY EGL] ${_IN_FILE} to ${_OUT_DIR}"
+            COMMENT "[COPY OPENGL] ${_IN_FILE} to ${_OUT_DIR}"
+    )
+else ()
+    message(FATAL_ERROR "Could not find EGL library file")
+endif ()
+
+find_library(_GLES
+        NAMES "GLESv2" "libGLESv2" "libGLESv2.so" "libGLESv2.so.2"
+        PATHS "${Qt_LibrariesPath}" "${Qt_BinariesPath}"
+        "/usr/lib" "/usr/local/lib" "/usr/lib/x86_64-linux-gnu/"
+        PATH_SUFFIXES "mesa-egl")
+if (_GLES)
+    get_filename_component(_GLES_NAME ${_GLES} NAME)
+    set(_IN_FILE "${_GLES}")
+    set(_OUT_DIR "${OUTPUT_DIR}/lib")
+    add_custom_command(
+            TARGET CopyQtDependencies PRE_BUILD
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_IN_FILE}" "${_OUT_DIR}/${_GLES_NAME}"
+            COMMENT "[COPY OPENGL] ${_IN_FILE} to ${_OUT_DIR}"
     )
 else ()
     message(FATAL_ERROR "Could not find EGL library file")


Removed -Wno-missing-filed-initializers compiler flag as it is not supported in g++ 3.4.

--- gtest/cmake/internal_utils.cmake
+++ gtest/cmake/internal_utils.cmake
@@ -80,7 +80,7 @@
     # explicitly.
     set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
     set(cxx_strict_flags
-      "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
+      "-Wextra -Wno-unused-parameter")
   elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
     set(cxx_exception_flags "-features=except")
     # Sun Pro doesn't provide macros to indicate whether exceptions and


CMake: greentea: Remove call to deprecated function

mbed_greentea::mbed_greentea_add_test was calling the deprecated
`mbed_configure_app_target` function, which is currently a no-op.

--- tools/cmake/mbed_greentea.cmake
+++ tools/cmake/mbed_greentea.cmake
@@ -42,8 +42,6 @@
     # Explicitly enable BUILD_TESTING until CTest is added to the Greentea client
     set(BUILD_TESTING ON)

-    mbed_configure_app_target(${MBED_GREENTEA_TEST_NAME})
-
     target_include_directories(${MBED_GREENTEA_TEST_NAME}
         PRIVATE
             .


fixed: add OPENEXR_USE_DLL option in all support libs cases if openexr was found

--- CMake/ConfigurePackages.cmake
+++ CMake/ConfigurePackages.cmake
@@ -343,8 +343,6 @@
         OSG_FIND_PACKAGE(OpenEXR)

         IF(OPENEXR_FOUND)
-          OSG_OPTION(OPENEXR_USE_DLL "" OFF)
-
           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_IMF)
           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_ILMTHREAD)
           OSG_ADD_IMPORT_LIB(OSG_OPENEXR_TARGETS OPENEXR_LIBRARY_IEX)
@@ -353,6 +351,10 @@
           SET(OPENEXR_LIBRARIES ${OSG_OPENEXR_TARGETS} CACHE STRING "" FORCE)
         ENDIF(OPENEXR_FOUND)
     ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT OPENEXR_FOUND)
+
+    IF(OPENEXR_FOUND)
+      OSG_OPTION(OPENEXR_USE_DLL "" OFF)
+    ENDIF(OPENEXR_FOUND)

 ENDMACRO(OSG_CONFIGURE_OPENEXR)


No comment.

No comment.

--- msvc/Custom-vs.cmake
+++ msvc/Custom-vs.cmake
@@ -11,7 +11,7 @@
 # find_package(VSTSDK2X)

 set(CMAKE_VERBOSE_MAKEFILE ON)
-set(Eigen3_DIR "D:\\msys64\\home\\restore\\vcpkg\\packages\\eigen3_x64-windows\\share\\eigen3")
+# set(Eigen3_DIR "D:\\msys64\\home\\restore\\vcpkg\\packages\\eigen3_x64-windows\\share\\eigen3")
 find_package (Eigen3 3.3 REQUIRED NO_MODULE)

 # Csound build options for MSVC


Change in Jenkins cmake file

Change in Jenkins cmake file

--- CTestJenkins.cmake
+++ CTestJenkins.cmake
@@ -43,7 +43,7 @@
 set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} -DCMAKE_BUILD_TYPE=${CTEST_BUILD_CONFIGURATION}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_BUILD_OPTIONS}")
-if(CTEST_COVERAGE_COMMAND)
+if(CTEST_COVERAGE_COMMAND AND NOT DISABLE_CTEST_COVERAGE)
     set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_CXX_FLAGS}\"")
     set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_EXE_LD_FLAGS}\"")
     set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_COVERAGE_SHARED_LD_FLAGS}\"")
@@ -57,10 +57,10 @@
 ctest_build(RETURN_VALUE BUILDING_RET_VALUE ${QUIET_})
 ctest_test(${QUIET_})
 ctest_submit(${QUIET_})
-if(CTEST_COVERAGE_COMMAND)
+if(CTEST_COVERAGE_COMMAND AND NOT DISABLE_CTEST_COVERAGE)
     ctest_coverage(${QUIET_})
 endif()
-if(CTEST_MEMORYCHECK_COMMAND)
+if(CTEST_MEMORYCHECK_COMMAND AND NOT DISABLE_CTEST_MEMORYCHECK)
     ctest_memcheck(EXCLUDE_LABEL NoMemoryCheck ${QUIET_})
 endif()
 ctest_submit(${QUIET_})


Adjusted library_variant() CMake macro to be usable in non-GG builds.

--- cmake/Util.cmake
+++ cmake/Util.cmake
@@ -238,8 +238,9 @@
     string(TOUPPER COMPONENT_${PROJECT_NAME} LIB_COMPONENT)

     # Installation of this library variant
-    if (THIS_LIB_IS_STATIC AND NOT RUNTIME_ONLY_PACKAGE OR
-        NOT THIS_LIB_IS_STATIC AND NOT DEVEL_ONLY_PACKAGE)
+    if ((THIS_LIB_IS_STATIC AND NOT RUNTIME_ONLY_PACKAGE OR
+         NOT THIS_LIB_IS_STATIC AND NOT DEVEL_ONLY_PACKAGE) AND
+        COMMAND package_compatible)
         package_compatible(ok_to_install ${LIBNAME})
         if (ok_to_install)
             install(


WEBP_DEP_LIBRARIES: use Threads::Threads

Signed-off-by: Christopher Degawa <3962a0508f18a69b6a96dda4efebf2513ae1e396@randomderp.com>
Change-Id: Icfec8fba117cbf5668c6f4c7d46d05cbb17e3dea

--- cmake/deps.cmake
+++ cmake/deps.cmake
@@ -45,7 +45,7 @@
         }
       " FLAG_HAVE_PTHREAD_PRIO_INHERIT)
     set(HAVE_PTHREAD_PRIO_INHERIT ${FLAG_HAVE_PTHREAD_PRIO_INHERIT})
-    list(APPEND WEBP_DEP_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+    list(APPEND WEBP_DEP_LIBRARIES Threads::Threads)
   endif()
   set(WEBP_USE_THREAD ${Threads_FOUND})
 endif()


modules: updated FindCorrade.cmake.

modules: updated FindCorrade.cmake.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -86,6 +86,8 @@
 #  CORRADE_TARGET_ANDROID       - Defined if compiled for Android
 #  CORRADE_TESTSUITE_TARGET_XCTEST - Defined if TestSuite is targetting Xcode
 #   XCTest
+#  CORRADE_UTILITY_USE_ANSI_COLORS - Defined if ANSI escape sequences are used
+#   for colored output with Utility::Debug on Windows
 #
 # Additionally these variables are defined for internal usage:
 #


removed External_CIL.cmake

removed External_CIL.cmake

--- SuperBuild/External_CIL.cmake
+++ SuperBuild/External_CIL.cmake
@@ -1,55 +0,0 @@
-#========================================================================
-# Author: Benjamin A Thomas
-# Author: Kris Thielemans
-# Author: Edoardo Pasca
-# Copyright 2017 University College London
-# Copyright 2017 STFC
-#
-# This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0.txt
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#=========================================================================
-
-#This needs to be unique globally
-set(proj CIL)
-
-# Set dependency list
-set(${proj}_DEPENDENCIES CCPi-Framework CCPi-RGL)
-
-# Include dependent projects if any
-ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES)
-
-# Set external name (same as internal for now)
-set(externalProjName ${proj})
-
-set(${proj}_SOURCE_DIR "${SOURCE_ROOT_DIR}/${proj}" )
-set(${proj}_BINARY_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/build" )
-set(${proj}_DOWNLOAD_DIR "${SUPERBUILD_WORK_DIR}/downloads/${proj}" )
-set(${proj}_STAMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/stamp" )
-set(${proj}_TMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/tmp" )
-
-  ExternalProject_Add_Empty(${proj} DEPENDS "${${proj}_DEPENDENCIES}"
-    SOURCE_DIR ${${proj}_SOURCE_DIR}
-    BINARY_DIR ${${proj}_BINARY_DIR}
-    DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR}
-    STAMP_DIR ${${proj}_STAMP_DIR}
-    TMP_DIR ${${proj}_TMP_DIR}
-  )
-
-  mark_as_superbuild(
-    VARS
-      ${externalProjName}_DIR:PATH
-    LABELS
-      "FIND_PACKAGE"
-  )


Update ITK superbuild along 4.13 release branch

This contains updates for ITK libtiff for mingw.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -52,7 +52,8 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-set(ITK_GIT_TAG "v4.13.1" CACHE STRING "Tag in ITK git repo")
+set(ITK_GIT_TAG "9cc3f955ca46d244b9043904a3094f7f9538cb95" CACHE
+  STRING "Tag in ITK git repo") # release-4.13
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


Update ITK superbuild version to 4.12.2

Update ITK superbuild version to 4.12.2

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -47,7 +47,7 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-set(ITK_GIT_TAG "v4.12.1" CACHE STRING "Tag in ITK git repo")
+set(ITK_GIT_TAG "v4.12.2" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


ENH: Update ITK ExternalProject to 4.9rc02.

Change-Id: Ie5e57af981f4cb5bed156b9ff9d3c6938edf488f

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -2,7 +2,7 @@
 # Get and build itk

 if( NOT ITK_TAG )
-  set( ITK_TAG "v4.8.0" )
+  set( ITK_TAG "v4.9rc02" )
 endif()

 set( _vtk_args )


Ensure Zorba actually works before packaging.

--- test/remote/SvnPackage.cmake
+++ test/remote/SvnPackage.cmake
@@ -39,6 +39,11 @@
   if (NOT EXISTS ${ZORBA_EXE_SCRIPT})
     message (FATAL_ERROR "Zorba is required; not found. Specify -DZORBA_BUILD_DIR to point to your build directory if necessary. (${ZORBA_EXE_SCRIPT})")
   endif (NOT EXISTS ${ZORBA_EXE_SCRIPT})
+  execute_process (COMMAND "${ZORBA_EXE_SCRIPT}" --omit-xml-declaration
+    --query "1+1" OUTPUT_VARIABLE ignored RESULT_VARIABLE result)
+  if (result)
+    message (FATAL_ERROR "Zorba is not functional. Specify -DZORBA_BUILD_DIR to point to your build directory if necessary. (${ZORBA_EXE_SCRIPT})")
+  endif (result)
 ENDMACRO (find_prereqs)


Allow boost 1.46 which is available on travis

--- etc/cmake/Setup.cmake
+++ etc/cmake/Setup.cmake
@@ -20,7 +20,7 @@
     set(Boost_USE_MULTITHREADED ON)
     set(Boost_ADDITIONAL_VERSIONS "1.48.0" "1.48")
     set(Boost_NO_SYSTEM_PATHS ON) # prevent mixing different Boost installations
-    find_package(Boost 1.48)
+    find_package(Boost 1.46)
     include_directories(${Boost_INCLUDE_DIR})
     MESSAGE(STATUS "Boost found at ${Boost_INCLUDE_DIR}")


Pin protobuf to particular revision to avoid breakages in continuous build.

--- cmake/external/protobuf.cmake
+++ cmake/external/protobuf.cmake
@@ -43,7 +43,7 @@
 ExternalProject_Add(${PROTOBUF_TARGET}
     PREFIX ${PROTOBUF_TARGET}
     GIT_REPOSITORY https://github.com/google/protobuf.git
-    GIT_TAG master
+    GIT_TAG 32886f1f
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_COMMAND} ${PROTOFUB_INSTALL_DIR}/src/${PROTOBUF_TARGET}/cmake
         -G${CMAKE_GENERATOR}


ExternalData: Replace MATCHES with STREQUAL where possible

Change-Id: I742f9a3451d93727f87b3d59691dff58ab43451a

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -410,7 +410,7 @@
       # Regular expression to match associated files.
       string(REGEX REPLACE "^REGEX:" "" regex "${opt}")
       list(APPEND associated_regex "${regex}")
-    elseif("x${opt}" MATCHES "^x:$")
+    elseif(opt STREQUAL ":")
       # Activate series matching.
       set(series_option "${opt}")
     elseif("x${opt}" MATCHES "^[^][:/*?]+$")


Switched from ITK 3.20.0 to 3.20.1 in ITK.cmake. Fixes #269

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

     if(NOT DEFINED ITK_DIR)

-      set(revision_tag "v3.20.0")
+      set(revision_tag "v3.20.1")
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


Disable installation of doc projects by default

--- Doxygit.cmake
+++ Doxygit.cmake
@@ -16,6 +16,7 @@
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/common/oss)

 find_package(Git REQUIRED)
+option(COMMON_INSTALL_DOCUMENTATION "Install documentation projects" OFF)

 include(CommonProcess)
 include(Maturity)
@@ -173,14 +174,13 @@
 execute_process(COMMAND "${GIT_EXECUTABLE}" add --all images ${Entries}
   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")

-# hack to detect that not invoked as script and not under CI
-if(VERSION_MAJOR)
-  if(NOT TRAVIS)
-    foreach(FOLDER ${GIT_DOCUMENTATION_INSTALL})
-      install(DIRECTORY ${FOLDER} DESTINATION share/${CMAKE_PROJECT_NAME}
-        CONFIGURATIONS Release)
-    endforeach()
-  endif()
-  install(FILES index.html DESTINATION share/${CMAKE_PROJECT_NAME}
-    CONFIGURATIONS Release)
+if(COMMON_INSTALL_DOCUMENTATION)
+  foreach(FOLDER ${GIT_DOCUMENTATION_INSTALL})
+    install(DIRECTORY ${FOLDER} DESTINATION share/${CMAKE_PROJECT_NAME}
+      CONFIGURATIONS Release)
+  endforeach()
 endif()
+
+# need at least one file for 'make install'
+install(FILES index.html DESTINATION share/${CMAKE_PROJECT_NAME}
+  CONFIGURATIONS Release)


cmake: use Git submodules via ExternalProject

--- cmake/install.cmake
+++ cmake/install.cmake
@@ -34,7 +34,7 @@
 set(CPACK_PACKAGE_VENDOR "Carsten Burstedde;Donna Calhoun")
 set(CPACK_PACKAGE_CONTACT "Carsten Burstedde;Donna Calhoun")
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
-set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
+set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
 set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/package")
 set(CPACK_PACKAGE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 string(TOLOWER ${CMAKE_SYSTEM_NAME} _sys)


Find dependencies for statically-linked libdw

BackwardConfig.cmake was not explicitly pulling in the
dependencies (libelf, libz, etc.) of libdw, which made it fail to link
when libdw was built as a static library (and therefore didn't
explicitly encode those dependencies).

--- BackwardConfig.cmake
+++ BackwardConfig.cmake
@@ -89,8 +89,21 @@
 	# find libdw
 	find_path(LIBDW_INCLUDE_DIR NAMES "elfutils/libdw.h" "elfutils/libdwfl.h")
 	find_library(LIBDW_LIBRARY dw)
+	# in case it's statically linked, look for all the possible dependencies
+	find_library(LIBELF_LIBRARY elf)
+	find_library(LIBPTHREAD_LIBRARY pthread)
+	find_library(LIBZ_LIBRARY z)
+	find_library(LIBBZ2_LIBRARY bz2)
+	find_library(LIBLZMA_LIBRARY lzma)
+	find_library(LIBZSTD_LIBRARY zstd)
 	set(LIBDW_INCLUDE_DIRS ${LIBDW_INCLUDE_DIR} )
-	set(LIBDW_LIBRARIES ${LIBDW_LIBRARY} )
+	set(LIBDW_LIBRARIES ${LIBDW_LIBRARY}
+		$<$<BOOL:${LIBELF_LIBRARY}>:${LIBELF_LIBRARY}>
+		$<$<BOOL:${LIBPTHREAD_LIBRARY}>:${LIBPTHREAD_LIBRARY}>
+		$<$<BOOL:${LIBZ_LIBRARY}>:${LIBZ_LIBRARY}>
+		$<$<BOOL:${LIBBZ2_LIBRARY}>:${LIBBZ2_LIBRARY}>
+		$<$<BOOL:${LIBLZMA_LIBRARY}>:${LIBLZMA_LIBRARY}>
+		$<$<BOOL:${LIBZSTD_LIBRARY}>:${LIBZSTD_LIBRARY}>)
 	find_package_handle_standard_args(libdw ${_name_mismatched_arg}
 		REQUIRED_VARS LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
 	mark_as_advanced(LIBDW_INCLUDE_DIR LIBDW_LIBRARY)


ENH: Update elastix version

ENH: Update elastix version

Fix an issue with compilation of ITK v4.8.1 on Mac OS X
Add CMakeLists.txt to root folder

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -1,7 +1,7 @@
 set( proj Elastix )

 set( ELASTIX_REPOSITORY git://github.com/mstaring/elastix.git )
-set( ELASTIX_TAG 6eb6fc7e0d86bafdfdffb1b8bbd125f2a56a486e )
+set( ELASTIX_TAG c35842cd0152d8fd2894e7c6706d2dd8396f0fed )

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_REPOSITORY}


sfml cmake

sfml cmake

--- CMake/FindSFML.cmake
+++ CMake/FindSFML.cmake
@@ -1,317 +1,32 @@
-# This script locates the SFML library
-# ------------------------------------
-#
-# Usage
-# -----
-#
-# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
-# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
-# example:
-#   find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
-#
-# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
-# If nothing is specified, the version won't be checked (ie. any version will be accepted).
-# example:
-#   find_package(SFML COMPONENTS ...)     // no specific version required
-#   find_package(SFML 2 COMPONENTS ...)   // any 2.x version
-#   find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
-#
-# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
-# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
-# Since you have to link yourself all the SFML dependencies when you link it statically, the following
-# additional variables are defined: SFML_XXX_DEPENDENCIES and SFML_DEPENDENCIES (see their detailed
-# description below).
-# In case of static linking, the SFML_STATIC macro will also be defined by this script.
-# example:
-#   set(SFML_STATIC_LIBRARIES TRUE)
-#   find_package(SFML 2 COMPONENTS network system)
-#
-# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
-# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
-# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
-# are available for both release and debug modes.
-#
-# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
-# to tell CMake where SFML is.
-#
-# Output
-# ------
-#
-# This script defines the following variables:
-# - For each specified module XXX (system, window, graphics, network, audio, main):
-#   - SFML_XXX_LIBRARY_DEBUG:   the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
-#   - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
-#   - SFML_XXX_LIBRARY:         the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
-#   - SFML_XXX_FOUND:           true if either the debug or release library of the xxx module is found
-#   - SFML_XXX_DEPENDENCIES:    the list of libraries the module depends on, in case of static linking
-# - SFML_LIBRARIES:    the list of all libraries corresponding to the required modules
-# - SFML_FOUND:        true if all the required modules are found
-# - SFML_INCLUDE_DIR:  the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
-# - SFML_DEPENDENCIES: the list of libraries SFML depends on, in case of static linking
-#
-# example:
-#   find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
-#   include_directories(${SFML_INCLUDE_DIR})
-#   add_executable(myapp ...)
-#   target_link_libraries(myapp ${SFML_LIBRARIES})
-
-# define the SFML_STATIC macro if static build was chosen
-if(SFML_STATIC_LIBRARIES)
-    add_definitions(-DSFML_STATIC)
-endif()
-
-# deduce the libraries suffix from the options
-set(FIND_SFML_LIB_SUFFIX "")
-if(SFML_STATIC_LIBRARIES)
-    set(FIND_SFML_LIB_SUFFIX "${FIND_SFML_LIB_SUFFIX}-s")
-endif()
-
-# define the list of search paths for headers and libraries
-set(FIND_SFML_PATHS
-    ${SFML_ROOT}
-    $ENV{SFML_ROOT}
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local
-    /usr
-    /sw
-    /opt/local
-    /opt/csw
-    /opt)
-
-# find the SFML include directory
-find_path(SFML_INCLUDE_DIR SFML/Config.hpp
-          PATH_SUFFIXES include
-          PATHS ${FIND_SFML_PATHS})
-
-# check the version number
-set(SFML_VERSION_OK TRUE)
-if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
-    # extract the major and minor version numbers from SFML/Config.hpp
-    # we have to handle framework a little bit differently :
-    if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
-        set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
-    else()
-        set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
-    endif()
-    FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
-    STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}")
-    STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
-    STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
-    math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10 + ${SFML_FIND_VERSION_MINOR}")
-
-    # if we could extract them, compare with the requested version number
-    if (SFML_VERSION_MAJOR)
-        # transform version numbers to an integer
-        math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10 + ${SFML_VERSION_MINOR}")
-
-        # compare them
-        if(SFML_VERSION LESS SFML_REQUESTED_VERSION)
-            set(SFML_VERSION_OK FALSE)
-        endif()
-    else()
-        # SFML version is < 2.0
-        if (SFML_REQUESTED_VERSION GREATER 19)
-            set(SFML_VERSION_OK FALSE)
-            set(SFML_VERSION_MAJOR 1)
-            set(SFML_VERSION_MINOR x)
-        endif()
-    endif()
-endif()
-
-# find the requested modules
-set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
-foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
-    string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
-    string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
-    set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER}${FIND_SFML_LIB_SUFFIX})
-
-    # no suffix for sfml-main, it is always a static library
-    if(FIND_SFML_COMPONENT_LOWER STREQUAL "main")
-        set(FIND_SFML_COMPONENT_NAME sfml-${FIND_SFML_COMPONENT_LOWER})
-    endif()
-
-    # debug library
-    find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG
-                 NAMES ${FIND_SFML_COMPONENT_NAME}-d
-                 PATH_SUFFIXES lib64 lib
-                 PATHS ${FIND_SFML_PATHS})
-
-    # release library
-    find_library(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
-                 NAMES ${FIND_SFML_COMPONENT_NAME}
-                 PATH_SUFFIXES lib64 lib
-                 PATHS ${FIND_SFML_PATHS})
-
-    if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
-        # library found
-        set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
-
-        # if both are found, set SFML_XXX_LIBRARY to contain both
-        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug     ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
-                                                          optimized ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
-        endif()
-
-        # if only one debug/release variant is found, set the other to be equal to the found one
-        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
-            # debug and not release
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY         ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG})
-        endif()
-        if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE AND NOT SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
-            # release and not debug
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
-            set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY       ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE})
-        endif()
-    else()
-        # library not found
-        set(SFML_FOUND FALSE)
-        set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND FALSE)
-        set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY "")
-        set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY")
-    endif()
-
-    # mark as advanced
-    MARK_AS_ADVANCED(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY
-                     SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE
-                     SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG)
-
-    # add to the global list of libraries
-    set(SFML_LIBRARIES ${SFML_LIBRARIES} "${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY}")
-endforeach()
-
-# in case of static linking, we must also define the list of all the dependencies of SFML libraries
-if(SFML_STATIC_LIBRARIES)
-
-    # detect the OS
-    if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
-        set(FIND_SFML_OS_WINDOWS 1)
-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-        set(FIND_SFML_OS_LINUX 1)
-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-        set(FIND_SFML_OS_FREEBSD 1)
-    elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-        set(FIND_SFML_OS_MACOSX 1)
-    endif()
-
-    # start with an empty list
-    set(SFML_DEPENDENCIES)
-    set(FIND_SFML_DEPENDENCIES_NOTFOUND)
-
-    # macro that searches for a 3rd-party library
-    macro(find_sfml_dependency output friendlyname)
-        find_library(${output} NAMES ${ARGN} PATHS ${FIND_SFML_PATHS} PATH_SUFFIXES lib)
-        if(${${output}} STREQUAL "${output}-NOTFOUND")
-            unset(output)
-            set(FIND_SFML_DEPENDENCIES_NOTFOUND "${FIND_SFML_DEPENDENCIES_NOTFOUND} ${friendlyname}")
-        endif()
-    endmacro()
-
-    # sfml-system
-    list(FIND SFML_FIND_COMPONENTS "system" FIND_SFML_SYSTEM_COMPONENT)
-    if(NOT ${FIND_SFML_SYSTEM_COMPONENT} EQUAL -1)
-
-        # update the list -- these are only system libraries, no need to find them
-        if(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD OR FIND_SFML_OS_MACOSX)
-            set(SFML_SYSTEM_DEPENDENCIES "pthread")
-        endif()
-        if(FIND_SFML_OS_LINUX)
-            set(SFML_SYSTEM_DEPENDENCIES "rt")
-        endif()
-        if(FIND_SFML_OS_WINDOWS)
-            set(SFML_SYSTEM_DEPENDENCIES "winmm")
-        endif()
-        set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_SYSTEM_DEPENDENCIES})
-    endif()
-
-    # sfml-network
-    list(FIND SFML_FIND_COMPONENTS "network" FIND_SFML_NETWORK_COMPONENT)
-    if(NOT ${FIND_SFML_NETWORK_COMPONENT} EQUAL -1)
-
-        # update the list -- these are only system libraries, no need to find them
-        if(FIND_SFML_OS_WINDOWS)
-            set(SFML_NETWORK_DEPENDENCIES "ws2_32")
-        endif()
-        set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_NETWORK_DEPENDENCIES})
-    endif()
-
-    # sfml-window
-    list(FIND SFML_FIND_COMPONENTS "window" FIND_SFML_WINDOW_COMPONENT)
-    if(NOT ${FIND_SFML_WINDOW_COMPONENT} EQUAL -1)
-
-        # find libraries
-        if(FIND_SFML_OS_LINUX)
-            find_sfml_dependency(X11_LIBRARY "X11" X11)
-            find_sfml_dependency(XRANDR_LIBRARY "Xrandr" Xrandr)
-        endif()
-
-        # update the list
-        if(FIND_SFML_OS_WINDOWS)
-            set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "opengl32" "winmm" "gdi32")
-        elseif(FIND_SFML_OS_LINUX OR FIND_SFML_OS_FREEBSD)
-            set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "GL" ${X11_LIBRARY} ${XRANDR_LIBRARY})
-            if(FIND_SFML_OS_FREEBSD)
-                set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "usbhid")
-            endif()
-        elseif(FIND_SFML_OS_MACOSX)
-            set(SFML_WINDOW_DEPENDENCIES ${SFML_WINDOW_DEPENDENCIES} "-framework OpenGL -framework Foundation -framework AppKit -framework IOKit -framework Carbon")
-        endif()
-        set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_WINDOW_DEPENDENCIES})
-    endif()
-
-    # sfml-graphics
-    list(FIND SFML_FIND_COMPONENTS "graphics" FIND_SFML_GRAPHICS_COMPONENT)
-    if(NOT ${FIND_SFML_GRAPHICS_COMPONENT} EQUAL -1)
-
-        # find libraries
-        find_sfml_dependency(FREETYPE_LIBRARY "FreeType" freetype)
-        find_sfml_dependency(GLEW_LIBRARY "GLEW" glew GLEW glew32 glew32s glew64 glew64s)
-        find_sfml_dependency(JPEG_LIBRARY "libjpeg" jpeg)
-
-        # update the list
-        set(SFML_GRAPHICS_DEPENDENCIES ${FREETYPE_LIBRARY} ${GLEW_LIBRARY} ${JPEG_LIBRARY})
-        set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_GRAPHICS_DEPENDENCIES})
-    endif()
-
-    # sfml-audio
-    list(FIND SFML_FIND_COMPONENTS "audio" FIND_SFML_AUDIO_COMPONENT)
-    if(NOT ${FIND_SFML_AUDIO_COMPONENT} EQUAL -1)
-
-        # find libraries
-        find_sfml_dependency(OPENAL_LIBRARY "OpenAL" openal openal32)
-        find_sfml_dependency(SNDFILE_LIBRARY "libsndfile" sndfile)
-
-        # update the list
-        set(SFML_AUDIO_DEPENDENCIES ${OPENAL_LIBRARY} ${SNDFILE_LIBRARY})
-        set(SFML_DEPENDENCIES ${SFML_DEPENDENCIES} ${SFML_AUDIO_DEPENDENCIES})
-    endif()
-
-endif()
-
-# handle errors
-if(NOT SFML_VERSION_OK)
-    # SFML version not ok
-    set(FIND_SFML_ERROR "SFML found but version too low (requested: ${SFML_FIND_VERSION}, found: ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR})")
-    set(SFML_FOUND FALSE)
-elseif(SFML_STATIC_LIBRARIES AND FIND_SFML_DEPENDENCIES_NOTFOUND)
-    set(FIND_SFML_ERROR "SFML found but some of its dependencies are missing (${FIND_SFML_DEPENDENCIES_NOTFOUND})")
-    set(SFML_FOUND FALSE)
-elseif(NOT SFML_FOUND)
-    # include directory or library not found
-    set(FIND_SFML_ERROR "Could NOT find SFML (missing: ${FIND_SFML_MISSING})")
-endif()
-if (NOT SFML_FOUND)
-    if(SFML_FIND_REQUIRED)
-        # fatal error
-        message(FATAL_ERROR ${FIND_SFML_ERROR})
-    elseif(NOT SFML_FIND_QUIETLY)
-        # error but continue
-        message("${FIND_SFML_ERROR}")
-    endif()
-endif()
-
-# handle success
-if(SFML_FOUND)
-    message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}")
-endif()
+# Try to find SFML library
+# Once done this will define
+#  SFML_FOUND - if system found SFML library
+#  SFML_INCLUDE_DIRS - The SFML include directories
+#  SFML_LIBRARS - The libraries needed to use SFML
+#  SFML_DEFINITIONS - Compiler switches required for using SFML
+
+
+find_path(SFML_INCLUDE_DIRS
+  NAMES SFML/Audio.hpp SFML/Graphics.hpp SFML/Network.hpp SFML/System.hpp SFML/Window.hpp SFML/OpenGL.hpp
+  PATH /usr/local/include
+  DOC "The SFML include directory")
+
+find_library(SFML_LIBRARIES
+  NAMES sfml-audio sfml-graphics sfml-network sfml-system sfml-window
+  PATHS /usr/local/lib
+  DOC "The SFML library")
+
+
+include(FindPackageHandleStandardArgs)
+# handle the QUIETLY and REQUIRED arguments and set LOGGING_FOUND to TRUE
+# if all listed variables are TRUE
+find_package_handle_standard_args(SFML DEFAULT_MSG SFML_INCLUDE_DIRS SFML_LIBRARIES)
+
+if (SFML_FOUND)
+  set(SFML_LIBRARIES ${SFML_LIBRARIES} )
+  set(SFML_INCLUDE_DIRS ${SFML_INCLUDE_DIRS} )
+  set(SFML_DEFINITIONS)
+endif()
+
+# Tell cmake GUIs to ignore the "local" variables.
+mark_as_advanced(SFML_INCLUDE_DIRS SFML_LIBRARIES)


Bump version: 0.2.7

Bump version: 0.2.7

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "2")
-SET(HAWKEY_PATCH "6")
+SET(HAWKEY_PATCH "7")


New version: 0.4.1

New version: 0.4.1

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "0")
+SET(HAWKEY_PATCH "1")


only use internal hipcub on nvcc platform

--- CMake/hoomd/HOOMDHIPSetup.cmake
+++ CMake/hoomd/HOOMDHIPSetup.cmake
@@ -85,12 +85,16 @@
         set(HIP_NVCC_FLAGS "")
         set(HIP_PLATFORM "nvcc")
         set(CUB_INCLUDE_DIR "$<IF:$<STREQUAL:${CMAKE_PROJECT_NAME},HOOMD>,${CMAKE_CURRENT_SOURCE_DIR},${HOOMD_INSTALL_PREFIX}/${PYTHON_SITE_INSTALL_DIR}/include>/hoomd/extern/cub/")
+
+        # hipCUB
+        # funny enough, we require this only on NVIDA platforms due to issues with hipCUB's cmake build system
+        # on AMD platforms, it is an external dependency
+        set(HIPCUB_INCLUDE_DIR "$<IF:$<STREQUAL:${CMAKE_PROJECT_NAME},HOOMD>,${CMAKE_CURRENT_SOURCE_DIR},${HOOMD_INSTALL_PREFIX}/${PYTHON_SITE_INSTALL_DIR}/include>/hoomd/extern/hipCUB/hipcub/include/;${CUB_INCLUDE_DIR}")
+
+
     endif()

     ENABLE_LANGUAGE(CUDA)
-
-    # hipCUB
-    set(HIPCUB_INCLUDE_DIR "$<IF:$<STREQUAL:${CMAKE_PROJECT_NAME},HOOMD>,${CMAKE_CURRENT_SOURCE_DIR},${HOOMD_INSTALL_PREFIX}/${PYTHON_SITE_INSTALL_DIR}/include>/hoomd/extern/hipCUB/hipcub/include/;${CUB_INCLUDE_DIR}")

     if(NOT TARGET HIP::hip)
         add_library(HIP::hip INTERFACE IMPORTED)


changed CodeCoverage.cmake to support multiple projects

--- CMakeModules/CodeCoverage.cmake
+++ CMakeModules/CodeCoverage.cmake
@@ -136,7 +136,7 @@
         MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
     ENDIF() # NOT GENHTML_PATH

-    SET(coverage_info "${CMAKE_BINARY_DIR}/${_outputname}.info")
+    SET(coverage_info "${CMAKE_CURRENT_BINARY_DIR}/${_outputname}.info")
     SET(coverage_cleaned "${coverage_info}.cleaned")

     SEPARATE_ARGUMENTS(test_command UNIX_COMMAND "${_testrunner}")
@@ -151,12 +151,12 @@
             COMMAND ${test_command} ${ARGV3}

             # Capturing lcov counters and generating report
-            COMMAND ${LCOV_PATH} --directory . --capture --output-file ${coverage_info}
+            COMMAND ${LCOV_PATH} --directory ${PROJECT_BINARY_DIR} --capture --output-file ${coverage_info}
             COMMAND ${LCOV_PATH} --remove ${coverage_info} 'tests/*' '/usr/*' ${LCOV_REMOVE_EXTRA} --output-file ${coverage_cleaned}
             COMMAND ${GENHTML_PATH} -o ${_outputname} ${coverage_cleaned}
             COMMAND ${CMAKE_COMMAND} -E remove ${coverage_info} ${coverage_cleaned}

-            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
             COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
             )


Minor fix variable usage

Minor fix variable usage

Change-Id: Iddb933f5f23c1936706f9e66fe54a02810d1c78d

--- cmake/internal/functions.cmake
+++ cmake/internal/functions.cmake
@@ -785,7 +785,7 @@

 MACRO(INTERNAL_INSTALL_EXTERNAL_TARGETS)
 	# copy header files
-	IF(NOT "${GLOBAL_EXTERNAL_LIBRARIES_INSTALL_DIR}" STREQUAL ${CMAKE_INSTALL_PREFIX})
+	IF(NOT "${GLOBAL_EXTERNAL_LIBRARIES_INSTALL_DIR}" STREQUAL "${CMAKE_INSTALL_PREFIX}")
 		INSTALL(DIRECTORY "${GLOBAL_EXTERNAL_LIBRARIES_INSTALL_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}" PATTERN ".svn" EXCLUDE)
 	ENDIF()
 ENDMACRO(INTERNAL_INSTALL_EXTERNAL_TARGETS)


Fixed Qwt dependency for debian

Fixed Qwt dependency for debian

--- cmake/FindQwt.cmake
+++ cmake/FindQwt.cmake
@@ -37,7 +37,7 @@
       /usr/local/include/qwt
 )

-find_library( QWT_LIBRARIES qwt )
+find_library( QWT_LIBRARIES NAMES qwt qwt-qt5 )

 find_package_handle_standard_args(QWT REQUIRED_VARS QWT_LIBRARIES QWT_INCLUDE_DIRS)


Revert "Push cmake_install.cmake"

Revert "Push cmake_install.cmake"

This reverts commit 4c465d89c4b0b75bd333ffc93e58b699deadbb08.

--- cmake_install.cmake
+++ cmake_install.cmake
@@ -1,44 +0,0 @@
-# Install script for directory: /home/linkdd/devel/cream-browser/doc
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-# Install shared libraries without execute permission?
-IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  SET(CMAKE_INSTALL_SO_NO_EXE "0")
-ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-
-IF(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-ELSE(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-ENDIF(CMAKE_INSTALL_COMPONENT)
-
-FILE(WRITE "/home/linkdd/devel/cream-browser/${CMAKE_INSTALL_MANIFEST}" "")
-FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/home/linkdd/devel/cream-browser/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-ENDFOREACH(file)


Default inline is GCC only

Default inline is GCC only


disable debug symbols

disable debug symbols

--- cmake/platform/unix/platform.cmake
+++ cmake/platform/unix/platform.cmake
@@ -1 +1 @@
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -ggdb -fPIC -msse -msse2 -msse3 -pthread")+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fPIC -msse -msse2 -msse3 -pthread")


#1854 Fixed Mac OS X build with Clang

#1854 Fixed Mac OS X build with Clang

--- cmake/OpenCVDetectCXXCompiler.cmake
+++ cmake/OpenCVDetectCXXCompiler.cmake
@@ -5,12 +5,15 @@
     set(MSVC64 1)
 endif()

-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-  set(CMAKE_COMPILER_IS_GNUCXX 1)
-endif()
-
-if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
-  set(CMAKE_COMPILER_IS_GNUC 1)
+if(NOT APPLE)
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    set(CMAKE_COMPILER_IS_GNUCXX 1)
+    unset(ENABLE_PRECOMPILED_HEADERS CACHE)
+  endif()
+  if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+    set(CMAKE_COMPILER_IS_GNUC 1)
+    unset(ENABLE_PRECOMPILED_HEADERS CACHE)
+  endif()
 endif()

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


Add -g flag for getting proper debug information

--- cmake/modules/CheckSanitizers.cmake
+++ cmake/modules/CheckSanitizers.cmake
@@ -60,7 +60,7 @@
 	endif ()

 	set (ASAN_DESCRIPTION "AddressSanitizer")
-	set (ASAN_FLAGS  "-fsanitize=address -fno-omit-frame-pointer")
+	set (ASAN_FLAGS  "-g -fsanitize=address -fno-omit-frame-pointer")
 	check_sanitizer_flags (${ASAN_DESCRIPTION} ${ASAN_FLAGS})
 endif ()

@@ -72,7 +72,7 @@
 	endif ()

 	set (TSAN_DESCRIPTION "ThreadSanitizer")
-	set (TSAN_FLAGS  "-fsanitize=thread -fPIE -pie")
+	set (TSAN_FLAGS  "-g -fsanitize=thread -fPIE -pie")
 	check_sanitizer_flags (${TSAN_DESCRIPTION} ${TSAN_FLAGS})
 endif ()

@@ -80,7 +80,7 @@
 # Check for Memory Sanitizer.
 if (MSAN)
 	set (MSAN_DESCRIPTION "MemorySanitizer")
-	set (MSAN_FLAGS  "-fsanitize=memory -fsanitize-memory-track-origins -fPIE -pie -fno-omit-frame-pointer")
+	set (MSAN_FLAGS  "-g -fsanitize=memory -fsanitize-memory-track-origins -fPIE -pie -fno-omit-frame-pointer")
 	check_sanitizer_flags (${MSAN_DESCRIPTION} ${MSAN_FLAGS})
 endif ()

@@ -88,6 +88,6 @@
 # Check for Undefined Behavior Sanitizer.
 if (UBSAN)
 	set (UBSAN_DESCRIPTION "UndefinedBehaviorSanitizer")
-	set (UBSAN_FLAGS  "-fsanitize=undefined -fno-omit-frame-pointer")
+	set (UBSAN_FLAGS  "-g -fsanitize=undefined -fno-omit-frame-pointer")
 	check_sanitizer_flags (${UBSAN_DESCRIPTION} ${UBSAN_FLAGS})
 endif ()


MDEV-9566 build mariabackup with libarchive for release

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -85,20 +85,24 @@
 OPTION(ENABLED_LOCAL_INFILE "" ON)
 SET(WITH_INNODB_SNAPPY OFF CACHE STRING "")
 IF(WIN32)
+  SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
 ELSEIF(RPM)
   SET(WITH_SSL system CACHE STRING "")
   SET(WITH_ZLIB system CACHE STRING "")
   SET(CHECKMODULE /usr/bin/checkmodule CACHE STRING "")
   SET(SEMODULE_PACKAGE /usr/bin/semodule_package CACHE STRING "")
+  SET(WITH_LIBARCHIVE ON CACHE STRING "")
 ELSEIF(DEB)
   SET(WITH_SSL system CACHE STRING "")
   SET(WITH_ZLIB system CACHE STRING "")
   SET(WITH_LIBWRAP ON)
   SET(HAVE_EMBEDDED_PRIVILEGE_CONTROL ON)
+  SET(WITH_LIBARCHIVE ON CACHE STRING "")
 ELSE()
   SET(WITH_SSL bundled CACHE STRING "")
   SET(WITH_ZLIB bundled CACHE STRING "")
   SET(WITH_JEMALLOC static CACHE STRING "")
+  SET(WITH_LIBARCHIVE STATIC CACHE STRING "")
 ENDIF()

 IF(NOT COMPILATION_COMMENT)


Ensure PhysicsFS gets built before Rainbow. (#166)

--- build/cmake/PhysicsFS.cmake
+++ build/cmake/PhysicsFS.cmake
@@ -49,6 +49,7 @@
     BUILD_BYPRODUCTS ${PHYSFS_BYPRODUCTS}  # Required by Ninja
     INSTALL_COMMAND ""
   )
+  add_dependencies(rainbow PhysicsFS)

   ExternalProject_Get_Property(PhysicsFS SOURCE_DIR)
   target_include_directories(rainbow PRIVATE ${SOURCE_DIR}/src)


Avoid one more warning with ICC.

Avoid one more warning with ICC.

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

--- deal.II/cmake/setup_compiler_flags_intel.cmake
+++ deal.II/cmake/setup_compiler_flags_intel.cmake
@@ -71,6 +71,15 @@
 #             friend struct Implementation;
 #           };)
 #   -w177  declared but not referenced
+#   -w193  zero used for undefined preprocessing identifier "..."
+#          This happens when using undefined preprocessor names in
+#          conditions such as
+#            #if (abc && def)
+#          instead of
+#            #if (defined(abc) && defined(def))
+#          The standard says that in such cases, the undefined symbol
+#          is assumed to be zero. The warning is in principle
+#          useful, but the pattern appears exceedingly often in the TBB
 #   -w279  controlling expression is constant
 #   -w327  NULL reference is not allowed
 #          (the compiler is correct here in that statements like
@@ -91,6 +100,7 @@
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd135")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd175")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd177")
+ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd193")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd279")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd327")
 ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-wd383")


debugging gcovr exclude

debugging gcovr exclude

--- cmake/CoverageReports.cmake
+++ cmake/CoverageReports.cmake
@@ -102,14 +102,14 @@
       add_custom_target(${target_base_name} DEPENDS ${target_base_name}_html)
     elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
       add_custom_target(${target_base_name}_xml
-        COMMAND ${COVERAGE_GCOVR_PATH} "--xml" "--exclude-unreachable-branches" "-s"
+        COMMAND ${COVERAGE_GCOVR_PATH} "-v"  "--xml" "--exclude-unreachable-branches" "-s"
         ${excl}
         "-r" "${source_dir}"
         "-o" "${output_path}/coverage.xml"
         "${bin_dir}"
         DEPENDS ${run_target})
       add_custom_target(${target_base_name}_html
-        COMMAND ${COVERAGE_GCOVR_PATH} "--html" "--html-details" "--exclude-unreachable-branches"
+        COMMAND ${COVERAGE_GCOVR_PATH} "-v" "--html" "--html-details" "--exclude-unreachable-branches"
         ${excl}
         "-r" "${source_dir}"
         "-o" "${output_path}/index.html"


changed message from fatal_error to send_error. It was forcing the autobuild to look for non existing libraries.

--- cmake/Modules/FindG3D.cmake
+++ cmake/Modules/FindG3D.cmake
@@ -302,22 +302,22 @@

 message(STATUS "JPEG_LIBRARIES is ${JPEG_LIBRARIES}")
 if (NOT JPEG_LIBRARIES)
-   message( FATAL_ERROR  "JPEG_LIBRARIES is not set" )
+   message( SEND_ERROR  "JPEG_LIBRARIES is not set" )
 endif()

 message(STATUS "ZLIB_LIBRARIES is ${ZLIB_LIBRARIES}")
 if (NOT ZLIB_LIBRARIES)
-   message( FATAL_ERROR  "ZLIB_LIBRARIES is not set" )
+   message( SEND_ERROR  "ZLIB_LIBRARIES is not set" )
 endif()

 message(STATUS "ZIP_LIBRARIES is ${ZIP_LIBRARIES}")
 if (NOT ZIP_LIBRARIES)
-   message( FATAL_ERROR  "ZIP_LIBRARIES is not set" )
-endif()
-
-message(STATUS "ZLIB_LIBRARIES is ${PNG_LIBRARIES}")
+   message( SEND_ERROR  "ZIP_LIBRARIES is not set" )
+endif()
+
+message(STATUS "PNG_LIBRARIES is ${PNG_LIBRARIES}")
 if (NOT PNG_LIBRARIES)
-   message( FATAL_ERROR  "PNG_LIBRARIES is not set" )
+   message( SEND_ERROR  "PNG_LIBRARIES is not set" )
 endif()

@@ -359,6 +359,7 @@
     G3D_INCLUDE_DIRS
     G3D_LIBRARIES
 	GLG3D_INCLUDE_DIR
+	JPEG_LIBRARIES
 )

 mark_as_advanced(


Fix a FIXME_CMAKE_SINGLETON

Fix a FIXME_CMAKE_SINGLETON

--- cmake/MyPackageRepair.cmake
+++ cmake/MyPackageRepair.cmake
@@ -9,6 +9,8 @@
     GET_FILENAME_COMPONENT(FIXME_CMAKE_ABSOLUTE ${FIXME_CMAKE} ABSOLUTE)
     FILE(WRITE ${FIXME_CMAKE} "# CMake settings to be propagated whenever you want - typically used for ExternalProject_Add\n")
     MARK_AS_ADVANCED (FIXME_CMAKE_ABSOLUTE)
+    SET (FIXME_CMAKE_SINGLETON TRUE CACHE BOOL "__fixme__.cmake singleton")
+    MARK_AS_ADVANCED (FIXME_CMAKE_SINGLETON)
   ENDIF ()
   IF (NOT HAVE_STDINT_H)
     GET_PROPERTY(source_dir_set GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR SET)
@@ -23,7 +25,7 @@
         CONFIGURE_FILE(${source_dir}/stdint.h.in ${MYPACKAGE_GENERATED_INCLUDE_DIR}/stdint.h)
         GET_FILENAME_COMPONENT(_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE ${MYPACKAGE_GENERATED_INCLUDE_DIR} ABSOLUTE)
         INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})
-        MESSAGE(STATUS "Appending for ${FIXME_CMAKE}: INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})")
+        MESSAGE(STATUS "Appending in ${FIXME_CMAKE}: INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})")
         FILE(APPEND ${FIXME_CMAKE} "INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})\n")
       ENDIF ()
       SET (STDINT_H_SINGLETON TRUE CACHE BOOL "C stdint.h repair singleton")


Added glfw to configs/default.cmake

Added glfw to configs/default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -105,6 +105,7 @@
 hunter_config(freetype VERSION 2.6.2)
 hunter_config(geos VERSION 3.4.2)
 hunter_config(glog VERSION 0.3.4-p1)
+hunter_config(glfw VERSION 3.2-p0)
 hunter_config(glproto VERSION 1.4.17)
 hunter_config(half VERSION 1.1.0-p0)
 hunter_config(hdf5 VERSION 1.8.15-p1)


quick fix anakin on 5117 cpu

quick fix anakin on 5117 cpu

--- cmake/external/anakin.cmake
+++ cmake/external/anakin.cmake
@@ -36,8 +36,9 @@
     extern_anakin
     ${EXTERNAL_PROJECT_LOG_ARGS}
     DEPENDS             ${MKLML_PROJECT}
-    GIT_REPOSITORY      "https://github.com/PaddlePaddle/Anakin"
-    GIT_TAG             "04256ba78fa3da0beb74e8036c8efd68c12824d6"
+    # Anakin codes error on Intel(R) Xeon(R) Gold 5117 CPU, temporary do not compile avx512 related code.
+    GIT_REPOSITORY      "https://github.com/luotao1/Anakin"
+    GIT_TAG             "bcf17aabe7921ceb7bce591244b4f9dce7dba5c8"
     PREFIX              ${ANAKIN_SOURCE_DIR}
     UPDATE_COMMAND      ""
     CMAKE_ARGS          -DUSE_GPU_PLACE=YES


Enable gtest SEH when building with clang-cl

Clang supports SEH well enough that this should work out of the box.  If
it doesn't, we'll hear about it.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -21,10 +21,6 @@
     elseif(MSVC)
       list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
       list(APPEND LLVM_COMPILE_FLAGS "/EHs-c-")
-    endif()
-    if (CLANG_CL)
-      # FIXME: Remove this once clang-cl supports SEH
-      list(APPEND LLVM_COMPILE_DEFINITIONS "GTEST_HAS_SEH=0")
     endif()
   endif()


Update FindLZ4.cmake

Update FindLZ4.cmake

--- cmake/modules/FindLZ4.cmake
+++ cmake/modules/FindLZ4.cmake
@@ -1,67 +1,63 @@
-# Find the LZ4 includes and library.
+#.rst:
+# FindLZ4
+# -------
 #
-# This module defines
-# LZ4_INCLUDE_DIR, where to locate LZ4 header files
-# LZ4_LIBRARIES, the libraries to link against to use LZ4
-# LZ4_FOUND.  If false, you cannot build anything that requires LZ4.
+# Find the LZ4 library header and define variables.
+#
+# Imported Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``LZ4::LZ4``,
+# if LZ4 has been found
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+#   LZ4_FOUND          - True if LZ4 is found.
+#   LZ4_INCLUDE_DIRS   - Where to find lz4.h
+#
+# ::
+#
+#   LZ4_VERSION        - The version of LZ4 found (x.y.z)
+#   LZ4_VERSION_MAJOR  - The major version of LZ4
+#   LZ4_VERSION_MINOR  - The minor version of LZ4
+#   LZ4_VERSION_PATCH  - The patch version of LZ4

-if(LZ4_CONFIG_EXECUTABLE)
-  set(LZ4_FIND_QUIETLY 1)
+find_path(LZ4_INCLUDE_DIR NAME lz4.h PATH_SUFFIXES include)
+
+if(NOT LZ4_LIBRARY)
+  find_library(LZ4_LIBRARY NAMES lz4 PATH_SUFFIXES lib)
 endif()
-set(LZ4_FOUND 0)

-find_path(LZ4_INCLUDE_DIR NAMES lz4.h PATHS
-  $ENV{LZ4_DIR}/include
-  /usr/include
-  /usr/local/include
-  /opt/lz4/include
-  DOC "Specify the directory containing lz4.h"
-)
+mark_as_advanced(LZ4_INCLUDE_DIR)

-# Checking for xxhash library includes (part of https://github.com/lz4/lz4.git,
-# but not provided in .deb and .rpm packages)
-find_path(XXHASH_INCLUDE_DIR NAMES xxhash.h PATHS
-  /usr/include
-  /usr/local/include
-  /opt/xxhash/include
-  DOC "Specify the directory containing xxhash.h"
-)
+if(LZ4_INCLUDE_DIR AND EXISTS "${LZ4_INCLUDE_DIR}/lz4.h")
+  file(STRINGS "${LZ4_INCLUDE_DIR}/lz4.h" LZ4_H REGEX "^#define LZ4_VERSION_[A-Z]+[ ]+[0-9]+.*$")
+  string(REGEX REPLACE ".+LZ4_VERSION_MAJOR[ ]+([0-9]+).*$"   "\\1" LZ4_VERSION_MAJOR "${LZ4_H}")
+  string(REGEX REPLACE ".+LZ4_VERSION_MINOR[ ]+([0-9]+).*$"   "\\1" LZ4_VERSION_MINOR "${LZ4_H}")
+  string(REGEX REPLACE ".+LZ4_VERSION_RELEASE[ ]+([0-9]+).*$" "\\1" LZ4_VERSION_PATCH "${LZ4_H}")
+  set(LZ4_VERSION "${LZ4_VERSION_MAJOR}.${LZ4_VERSION_MINOR}.${LZ4_VERSION_PATCH}")
+endif()

-find_library(LZ4_LIBRARY NAMES lz4 PATHS
-  $ENV{LZ4_DIR}/lib
-  /usr/local/lz4/lib
-  /usr/local/lib
-  /usr/lib/lz4
-  /usr/local/lib/lz4
-  /usr/lz4/lib /usr/lib
-  /usr/lz4 /usr/local/lz4
-  /opt/lz4 /opt/lz4/lib
-  DOC "Specify the lz4 library here."
-)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LZ4
+  REQUIRED_VARS LZ4_LIBRARY LZ4_INCLUDE_DIR VERSION_VAR LZ4_VERSION)

-# Checking for xxhash library, in case it was built separately from
-# https://github.com/Cyan4973/xxHash.git
-find_library(XXHASH_LIBRARY NAMES xxhash PATHS
-  /usr/local/lib
-  /usr/lib
-  DOC "Specify the xxhash library here."
-)
+if(LZ4_FOUND)
+  set(LZ4_INCLUDE_DIRS "${LZ4_INCLUDE_DIR}")

-if(LZ4_INCLUDE_DIR AND LZ4_LIBRARY AND XXHASH_INCLUDE_DIR)
-  set(LZ4_FOUND 1)
-  if(NOT LZ4_FIND_QUIETLY)
-     message(STATUS "Found LZ4 includes at ${LZ4_INCLUDE_DIR}")
-     message(STATUS "Found LZ4 library at ${LZ4_LIBRARY}")
-     message(STATUS "Found xxhash include at ${XXHASH_INCLUDE_DIR}")
+  if(NOT LZ4_LIBRARIES)
+    set(LZ4_LIBRARIES ${LZ4_LIBRARY})
+  endif()
+
+  if(NOT TARGET LZ4::LZ4)
+    add_library(LZ4::LZ4 UNKNOWN IMPORTED)
+    set_target_properties(LZ4::LZ4 PROPERTIES
+      IMPORTED_LOCATION "${LZ4_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIRS}")
   endif()
 endif()
-
-set(LZ4_LIBRARIES ${LZ4_LIBRARY})
-if(XXHASH_LIBRARY)
-  list(APPEND LZ4_LIBRARIES ${XXHASH_LIBRARY})
-endif()
-if(NOT("${XXHASH_INCLUDE_DIR}" MATCHES ${LZ4_INCLUDE_DIR}))
-  list(APPEND LZ4_INCLUDE_DIR ${XXHASH_INCLUDE_DIR})
-endif()
-
-mark_as_advanced(LZ4_FOUND LZ4_LIBRARY LZ4_INCLUDE_DIR XXHASH_INCLUDE_DIR)


fix app directory

fix app directory

--- cmake/packages/bundle.cmake
+++ cmake/packages/bundle.cmake
@@ -20,7 +20,7 @@
 set(CPACK_ARANGO_LOG_DIR "${INST_USR_LIBDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALSTATEDIR}/log/arangodb3")
 set(CPACK_ARANGO_STATE_DIR "${INST_USR_LIBDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALSTATEDIR}")

-set(CPACK_ARANGO_DATA_DIR "${INST_USR_LIBDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALSTATEDIR}/lib/arangodb3-apps")
+set(CPACK_ARANGODB_APPS_DIRECTORY "${INST_USR_LIBDIR}${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LOCALSTATEDIR}/lib/arangodb3-apps")

 to_native_path("CPACK_ARANGODB_APPS_DIRECTORY")
 to_native_path("CMAKE_INSTALL_DATAROOTDIR_ARANGO")


Fixed build

Fixed build

--- src/cmake/public-headers.cmake
+++ src/cmake/public-headers.cmake
@@ -6,6 +6,7 @@
 core/basetypes/MCBaseTypes.h
 core/basetypes/MCAutoreleasePool.h
 core/basetypes/MCObject.h
+core/basetypes/MCUtils.h
 core/basetypes/MCValue.h
 core/basetypes/MCString.h
 core/basetypes/MCRange.h
@@ -21,7 +22,6 @@
 core/basetypes/MCHash.h
 core/basetypes/MCLog.h
 core/basetypes/MCAssert.h
-core/basetypes/MCUtils.h
 core/basetypes/MCIndexSet.h
 core/basetypes/MCOperation.h
 core/basetypes/MCOperationQueue.h
@@ -88,6 +88,7 @@
 async/imap/MCIMAPFetchContentOperation.h
 async/imap/MCIMAPFetchParsedContentOperation.h
 async/imap/MCIMAPIdleOperation.h
+async/imap/MCIMAPFolderInfo.h
 async/imap/MCIMAPFolderInfoOperation.h
 async/imap/MCIMAPFolderStatusOperation.h
 async/imap/MCIMAPSearchOperation.h


FIX (#1963): Mistake in files.cmake fixed


BUG: Correcting errouneous CMake Python configuration variables

--- CMake/SITKLanguageOptions.cmake
+++ CMake/SITKLanguageOptions.cmake
@@ -32,12 +32,12 @@
   set( WRAP_PYTHON_DEFAULT OFF )
 endif ( ${PYTHONLIBS_FOUND} AND ${PYTHONINTERP_FOUND} )
 list( APPEND SITK_LANGUAGES_VARS
+  PYTHON_DEBUG_LIBRARY
   PYTHON_EXECUTABLE
-  PYTHON_LIBRARIES
   PYTHON_LIBRARY
+  PYTHON_INCLUDE_DIR
 #  PYTHON_INCLUDE_PATH ( depricated )
-  PYTHON_INCLUDE_DIRS
-  PYTHON_DEBUG_LIBRARIES )
+   )
 check_PIC_flag ( Python )
 option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )


Use lowercase for a few cmake macros to keep capitalization normalized.

--- CMake/Utils/FindPkgMacros.cmake
+++ CMake/Utils/FindPkgMacros.cmake
@@ -124,16 +124,15 @@

 # Slightly customised framework finder
-MACRO(findpkg_framework fwk)
-  IF(APPLE)
-    SET(${fwk}_FRAMEWORK_PATH
+macro(findpkg_framework fwk)
+  if(APPLE)
+    set(${fwk}_FRAMEWORK_PATH
       ${${fwk}_FRAMEWORK_SEARCH_PATH}
       ${CMAKE_FRAMEWORK_PATH}
       ~/Library/Frameworks
       /Library/Frameworks
       /System/Library/Frameworks
       /Network/Library/Frameworks
-      /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/System/Library/Frameworks/
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
     )
@@ -146,16 +145,16 @@
       set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
     endforeach(i)

-    FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
-      SET(fwkpath ${dir}/${fwk}.framework)
-      IF(EXISTS ${fwkpath})
-        SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
+    foreach(dir ${${fwk}_FRAMEWORK_PATH})
+      set(fwkpath ${dir}/${fwk}.framework)
+      if(EXISTS ${fwkpath})
+        set(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
           ${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
-        SET(${fwk}_FRAMEWORK_PATH ${dir})
+        set(${fwk}_FRAMEWORK_PATH ${dir})
         if (NOT ${fwk}_LIBRARY_FWK)
-          SET(${fwk}_LIBRARY_FWK "-framework ${fwk}")
+          set(${fwk}_LIBRARY_FWK "-framework ${fwk}")
         endif ()
-      ENDIF(EXISTS ${fwkpath})
-    ENDFOREACH(dir)
-  ENDIF(APPLE)
-ENDMACRO(findpkg_framework)
+      endif(EXISTS ${fwkpath})
+    endforeach(dir)
+  endif(APPLE)
+endmacro(findpkg_framework)


Bump to 1.7.5

Bump to 1.7.5

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
 SET(LIBREPO_MINOR "7")
-SET(LIBREPO_PATCH "4")
+SET(LIBREPO_PATCH "5")


New version: 0.5.1

New version: 0.5.1

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "5")
-SET(HAWKEY_PATCH "0")
+SET(HAWKEY_PATCH "1")


added possibility to skip tests of external libs

--- VigraAddTest.cmake
+++ VigraAddTest.cmake
@@ -42,6 +42,11 @@
 ENDMACRO(VIGRA_NATIVE_PATH)

 FUNCTION(vigra_add_test target)
+
+    if(SKIP_TESTS)
+        return()
+    endif()
+
     # parse the args
     # Parse the options.
     set(MultiValueArgs SOURCES LIBRARIES)


fix: Add warning disable C4273

fix: Add warning disable C4273

- 'torch::jit::tracer::addInputs': inconsistent dll linkage

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -91,6 +91,7 @@
 		/wd4458       # -> disable warning: declaration of 'pyobj' hides class member (caused by Torch)
 		/wd4305       # -> disable warning: 'initializing': truncation from 'double' to 'float' (caused by Torch)
 		/wd4018       # -> disable warning: '>': signed/unsigned mismatch (caused by Torch)
+		/wd4273       # -> disable warning: 'torch::jit::tracer::addInputs': inconsistent dll linkage (caused by Torch)

 		#$<$<CONFIG:Debug>:
 		#/RTCc        # -> value is assigned to a smaller data type and results in a data loss


rename OGRE_SOURCE -> OGRE_SOURCE_DIR to avoid conflict with Ogre 1.9

--- CMake/Packages/FindOGRE_Old.cmake
+++ CMake/Packages/FindOGRE_Old.cmake
@@ -26,22 +26,22 @@
 	else()

 		if(WIN32 OR APPLE)
-			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OGRE_SOURCE}/CMake ${OGRE_SOURCE}/CMake/Packages)
+			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OGRE_SOURCE_DIR}/CMake ${OGRE_SOURCE_DIR}/CMake/Packages)
 		else()
 			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/local/lib/OGRE/cmake)
 		endif()

-		IF (NOT OGRE_SOURCE)
-			set(OGRE_SOURCE "" CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
+		IF (NOT OGRE_SOURCE_DIR)
+			set(OGRE_SOURCE_DIR "" CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
 		ENDIF ()

 		if (NOT OGRE_BUILD)
-			set(OGRE_BUILD ${OGRE_SOURCE} CACHE PATH "Path to Ogre build directory (same as OGRE_SOURCE by default)")
+			set(OGRE_BUILD ${OGRE_SOURCE_DIR} CACHE PATH "Path to Ogre build directory (same as OGRE_SOURCE_DIR by default)")
 		endif ()

-		if (EXISTS ${OGRE_SOURCE}/CMake)
+		if (EXISTS ${OGRE_SOURCE_DIR}/CMake)
 			MESSAGE(STATUS "Original FindOGRE.cmake found, trying to use it")
-			set (OGRE_HOME ${OGRE_SOURCE})
+			set (OGRE_HOME ${OGRE_SOURCE_DIR})
 			FIND_PACKAGE(OGRE)
 		endif()

@@ -55,9 +55,9 @@
 				set (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
 				set (OGRE_LIB_DIR ${OGRE_LIB_DIR} ${Boost_LIBRARY_DIRS} ${BOOST_LIBRARYDIR})
 			else()
-				# trying to get boost from OGRE_SOURCE
-				set (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} ${OGRE_SOURCE}/boost)
-				set (OGRE_LIB_DIR ${OGRE_LIB_DIR} ${OGRE_SOURCE}/boost/lib)
+				# trying to get boost from OGRE_SOURCE_DIR
+				set (OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} ${OGRE_SOURCE_DIR}/boost)
+				set (OGRE_LIB_DIR ${OGRE_LIB_DIR} ${OGRE_SOURCE_DIR}/boost/lib)
 			endif()

 			add_definitions("-DBOOST_ALL_NO_LIB")
@@ -76,28 +76,28 @@
 			MESSAGE(STATUS "Looking for OGRE")
 			SET(OGRESDK $ENV{OGRE_HOME})
 			SET(OGRESOURCE $ENV{OGRE_SRC})
-			IF (OGRE_SOURCE)
+			IF (OGRE_SOURCE_DIR)
 				MESSAGE(STATUS "Using OGRE built from source (from specified path)")
-				SET(OGRE_INCLUDE_DIR ${OGRE_SOURCE}/OgreMain/include ${OGRE_SOURCE}/include)
-				SET(OGRE_LIB_DIR ${OGRE_SOURCE}/lib)
+				SET(OGRE_INCLUDE_DIR ${OGRE_SOURCE_DIR}/OgreMain/include ${OGRE_SOURCE_DIR}/include)
+				SET(OGRE_LIB_DIR ${OGRE_SOURCE_DIR}/lib)
 			ELSEIF (OGRESDK)
 				MESSAGE(STATUS "Using OGRE SDK")
 				STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}")
 				SET(OGRE_INCLUDE_DIR ${OGRESDK}/include/OGRE ${OGRESDK}/include)
 				SET(OGRE_LIB_DIR ${OGRESDK}/lib)
-				IF (NOT OGRE_SOURCE)
-					set(OGRE_SOURCE $ENV{OGRE_HOME} CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
+				IF (NOT OGRE_SOURCE_DIR)
+					set(OGRE_SOURCE_DIR $ENV{OGRE_HOME} CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
 				ENDIF ()
 			ELSEIF (OGRESOURCE)
 				MESSAGE(STATUS "Using OGRE built from source")
-				SET(OGRE_INCLUDE_DIR $ENV{OGRE_SRC}/OgreMain/include ${OGRE_SOURCE}/include)
+				SET(OGRE_INCLUDE_DIR $ENV{OGRE_SRC}/OgreMain/include ${OGRE_SOURCE_DIR}/include)
 				SET(OGRE_LIB_DIR $ENV{OGRE_SRC}/lib)
-				IF (NOT OGRE_SOURCE)
-					set(OGRE_SOURCE $ENV{OGRE_SRC} CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
+				IF (NOT OGRE_SOURCE_DIR)
+					set(OGRE_SOURCE_DIR $ENV{OGRE_SRC} CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
 				ENDIF ()
 			ENDIF ()

-			IF (OGRESDK OR OGRESOURCE OR OGRE_SOURCE)
+			IF (OGRESDK OR OGRESOURCE OR OGRE_SOURCE_DIR)
 				SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)

 				SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
@@ -105,10 +105,10 @@
 				SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
 			ENDIF ()
 		ELSE (WIN32) #Unix
-			IF (OGRE_SOURCE)
+			IF (OGRE_SOURCE_DIR)
 				MESSAGE(STATUS "Using OGRE built from source (from specified path)")
-				SET(OGRE_INCLUDE_DIR ${OGRE_SOURCE}/OgreMain/include)
-				SET(OGRE_LIB_DIR ${OGRE_SOURCE}/lib)
+				SET(OGRE_INCLUDE_DIR ${OGRE_SOURCE_DIR}/OgreMain/include)
+				SET(OGRE_LIB_DIR ${OGRE_SOURCE_DIR}/lib)
 			ELSE ()
 				CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
 				FIND_PACKAGE(PkgConfig)


BUG: fix cmake variable name

BUG: fix cmake variable name

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -100,7 +100,7 @@

 IF(OTB_USE_EXTERNAL_TINYXML)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
-      ${TINYXML_INCLUDE_DIRS})
+      ${TINYXML_INCLUDE_DIR})
 ELSEIF(OTB_USE_EXTERNAL_TINYXML)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${OTB_SOURCE_DIR}/Utilities/tinyXMLlib)
@@ -365,7 +365,7 @@
 #For TinyXML header file
 IF(OTB_USE_EXTERNAL_TINYXML)
         SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
-                ${TINYXML_INCLUDE_DIRS})
+                ${TINYXML_INCLUDE_DIR})
 ELSE(OTB_USE_EXTERNAL_TINYXML)
         SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
                 Utilities/tinyXMLlib)


px4/fmu-v4/uavcanv1: remove non-existing tap_esc module & gyro_fft example

--- boards/px4/fmu-v4/uavcanv1.cmake
+++ boards/px4/fmu-v4/uavcanv1.cmake
@@ -50,7 +50,6 @@
 		rc_input
 		roboclaw
 		safety_button
-		tap_esc
 		telemetry # all available telemetry drivers
 		test_ppm
 		tone_alarm
@@ -125,7 +124,6 @@
 		fake_gyro
 		fake_magnetometer
 		fixedwing_control # Tutorial code from https://px4.io/dev/example_fixedwing_control
-		gyro_fft
 		hello
 		hwtest # Hardware test
 		#matlab_csv_serial


forgot 1 instance

forgot 1 instance

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

--- cmake/Modules/FindCMinpack.cmake
+++ cmake/Modules/FindCMinpack.cmake
@@ -14,7 +14,7 @@

 find_path(CMINPACK_INCLUDE_DIR cminpack.h
     HINTS ${PC_CMINPACK_INCLUDEDIR} ${PC_CMINPACK_INCLUDE_DIRS} "${CMINPACK_ROOT}" "$ENV{CMINPACK_ROOT}"
-    PATHS "$ENV{PROGRAMFILES}/CMINPACK 1.1.13" "$ENV{PROGRAMW6432}/CMINPACK 1.1.13"
+    PATHS "$ENV{PROGRAMFILES}/CMINPACK 1.1.3" "$ENV{PROGRAMW6432}/CMINPACK 1.1.3"
     PATH_SUFFIXES include/cminpack-1)

 find_library(CMINPACK_LIBRARY cminpack


Teach the build system to only re-generate the CMake commands to build a benchmark when necessary (i.e. when the ``spec.yml`` file changes). When we have many benchmarks this optimisation would likely incremental builds faster (without this optimisation re-configure would be slow).

--- cmake/add_svcomp_benchmark.cmake
+++ cmake/add_svcomp_benchmark.cmake
@@ -1,19 +1,21 @@
 macro(add_svcomp_benchmark BENCHMARK_DIR)
-  # FIXME: Check timestamp so we don't have to regenerate every file
-  # for incremental builds
   set(INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/${BENCHMARK_DIR}/spec.yml)
   set(OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/${BENCHMARK_DIR}_targets.cmake)
-  execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/svcb-emit-cmake-decls.py
-                          ${INPUT_FILE}
-                          --architecture ${SVCOMP_ARCHITECTURE}
-                          --output ${OUTPUT_FILE}
-                  RESULT_VARIABLE RESULT_CODE
-                 )
-  if (NOT ${RESULT_CODE} EQUAL 0)
-    message(FATAL_ERROR "Failed to process benchmark ${BENCHMARK_DIR}. With error ${RESULT_CODE}")
+  # Only re-generate the file if necessary so that re-configure is as fast as possible
+  if ("${INPUT_FILE}" IS_NEWER_THAN "${OUTPUT_FILE}")
+    message(STATUS "Generating \"${OUTPUT_FILE}\"")
+    execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/svcb-emit-cmake-decls.py
+                            ${INPUT_FILE}
+                            --architecture ${SVCOMP_ARCHITECTURE}
+                            --output ${OUTPUT_FILE}
+                    RESULT_VARIABLE RESULT_CODE
+                   )
+    if (NOT ${RESULT_CODE} EQUAL 0)
+      message(FATAL_ERROR "Failed to process benchmark ${BENCHMARK_DIR}. With error ${RESULT_CODE}")
+    endif()
   endif()
   # Include the generated file
   include(${OUTPUT_FILE})
   # Let CMake know that configuration depends on the benchmark specification file
-  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${INPUT_FILE})
+  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${INPUT_FILE}")
 endmacro()


build: copy static/shared library support from libdispatch

Update SwiftSupport.cmake from libdispatch for the shared/static library work
tht I did there.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -2,7 +2,7 @@
 include(CMakeParseArguments)

 function(add_swift_target target)
-  set(options LIBRARY)
+  set(options LIBRARY;SHARED;STATIC)
   set(single_value_options MODULE_NAME;MODULE_LINK_NAME;MODULE_PATH;MODULE_CACHE_PATH;OUTPUT;TARGET)
   set(multiple_value_options CFLAGS;DEPENDS;LINK_FLAGS;RESOURCES;SOURCES;SWIFT_FLAGS)

@@ -44,11 +44,33 @@
       list(APPEND link_flags ${flag})
     endforeach()
   endif()
+  if(AST_LIBRARY)
+    if(AST_STATIC AND AST_SHARED)
+      message(SEND_ERROR "add_swift_target asked to create library as STATIC and SHARED")
+    elseif(AST_STATIC OR NOT BUILD_SHARED_LIBS)
+      set(library_kind STATIC)
+    elseif(AST_SHARED OR BUILD_SHARED_LIBS)
+      set(library_kind SHARED)
+    endif()
+  else()
+    if(AST_STATIC OR AST_SHARED)
+      message(SEND_ERROR "add_swift_target asked to create executable as STATIC or SHARED")
+    endif()
+  endif()
   if(NOT AST_OUTPUT)
     if(AST_LIBRARY)
-      set(AST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+      if(AST_SHARED OR BUILD_SHARED_LIBS)
+        set(AST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+      else()
+        set(AST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${CMAKE_STATIC_LIBRARY_PREFIX}${target}${CMAKE_STATIC_LIBRARY_SUFFIX})
+      endif()
     else()
       set(AST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${target}${CMAKE_EXECUTABLE_SUFFIX})
+    endif()
+  endif()
+  if(CMAKE_SYSTEM_NAME STREQUAL Windows)
+    if(AST_SHARED OR BUILD_SHARED_LIBS)
+      set(IMPORT_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/${target}.dir/${CMAKE_IMPORT_LIBRARY_PREFIX}${target}${CMAKE_IMPORT_LIBRARY_SUFFIX})
     endif()
   endif()

@@ -113,19 +135,40 @@
   if(AST_LIBRARY)
     set(emit_library -emit-library)
   endif()
-  add_custom_command(OUTPUT
-                       ${AST_OUTPUT}
-                     DEPENDS
-                       ${objs}
-                       ${AST_DEPENDS}
-                     COMMAND
-                       ${CMAKE_SWIFT_COMPILER} ${emit_library} ${link_flags} -o ${AST_OUTPUT} ${objs})
-  add_custom_target(${target}
-                    ALL
-                    DEPENDS
-                       ${AST_OUTPUT}
-                       ${module}
-                       ${documentation})
+  if(NOT AST_LIBRARY OR library_kind STREQUAL SHARED)
+    add_custom_command(OUTPUT
+                         ${AST_OUTPUT}
+                       DEPENDS
+                         ${objs}
+                         ${AST_DEPENDS}
+                       COMMAND
+                         ${CMAKE_SWIFT_COMPILER} ${emit_library} ${link_flags} -o ${AST_OUTPUT} ${objs})
+    add_custom_target(${target}
+                      ALL
+                      DEPENDS
+                         ${AST_OUTPUT}
+                         ${module}
+                         ${documentation})
+  else()
+    add_library(${target}-static STATIC ${objs})
+    add_dependencies(${target}-static ${AST_DEPENDS})
+    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})
+    get_filename_component(ast_output_dn ${AST_OUTPUT} DIRECTORY)
+    set_target_properties(${target}-static
+                          PROPERTIES
+                            LINKER_LANGUAGE C
+                            ARCHIVE_OUTPUT_DIRECTORY ${ast_output_dn}
+                            OUTPUT_DIRECTORY ${ast_output_dn}
+                            OUTPUT_NAME ${ast_output_bn})
+    add_custom_target(${target}
+                      ALL
+                      DEPENDS
+                        ${target}-static
+                        ${module}
+                        ${documentation})
+  endif()

   if(AST_RESOURCES)
     add_custom_command(TARGET
@@ -150,6 +193,15 @@
                        POST_BUILD
                        COMMAND
                          ${CMAKE_COMMAND} -E copy ${AST_OUTPUT} ${CMAKE_CURRENT_BINARY_DIR})
+    if(CMAKE_SYSTEM_NAME STREQUAL Windows)
+      if(AST_SHARED OR BUILD_SHARED_LIBS)
+        add_custom_command(TARGET
+                             ${target}
+                           POST_BUILD
+                           COMMAND
+                             ${CMAKE_COMMAND} -E copy ${IMPORT_LIBRARY} ${CMAKE_CURRENT_BINARY_DIR})
+      endif()
+    endif()
   endif()
 endfunction()

@@ -189,6 +241,8 @@
     set("${result_var_name}" "itanium" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86")
     set("${result_var_name}" "i686" PARENT_SCOPE)
+  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+    set("${result_var_name}" "i686" PARENT_SCOPE)
   else()
     message(FATAL_ERROR "Unrecognized architecture on host system: ${CMAKE_SYSTEM_PROCESSOR}")
   endif()


Add support for Apple Silicon in SwiftSupport.cmake (#257)

This matches the behavior of [a similar `elseif` branch in the Swift toolchain itself](https://github.com/apple/swift/blob/b80e4bf8f866be26a4108bd92f97b2a182662642/CMakeLists.txt#L594).

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -9,6 +9,8 @@
   if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
     set("${result_var_name}" "x86_64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
+    set("${result_var_name}" "aarch64" PARENT_SCOPE)
+  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
     set("${result_var_name}" "aarch64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64")
     set("${result_var_name}" "powerpc64" PARENT_SCOPE)