common_library() : add an option to omit install (useful for test libs)

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -20,6 +20,7 @@
 # * NAME_NAMESPACE for api.h and version.h
 # * NAME_OMIT_CHECK_TARGETS do not create cppcheck targets
 # * NAME_OMIT_EXPORT do not export target in CommonPackageConfig.cmake
+# * NAME_OMIT_INSTALL do not install, for example a library for unit tests
 # * VERSION for the API version
 # * VERSION_ABI for the ABI version
 # * Optional Qt support:
@@ -177,34 +178,38 @@
       add_library(${PROJECT_NAME}_ALIAS ALIAS ${LibName})
     endif()

-    # add target to export set if not excluded, written by
-    # CommonPackageConfig.cmake
-    if(${NAME}_OMIT_EXPORT)
-      install(TARGETS ${LibName}
-        ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT dev
-        RUNTIME DESTINATION bin COMPONENT lib
-        LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT lib
-        INCLUDES DESTINATION include)
-    else()
-      install(TARGETS ${LibName}
-        EXPORT ${PROJECT_NAME}Targets
-        ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT dev
-        RUNTIME DESTINATION bin COMPONENT lib
-        LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT lib
-        INCLUDES DESTINATION include)
+    if(NOT ${NAME}_OMIT_INSTALL)
+      # add target to export set if not excluded, written by
+      # CommonPackageConfig.cmake
+      if(${NAME}_OMIT_EXPORT)
+        install(TARGETS ${LibName}
+          ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT dev
+          RUNTIME DESTINATION bin COMPONENT lib
+          LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT lib
+          INCLUDES DESTINATION include)
+      else()
+        install(TARGETS ${LibName}
+          EXPORT ${PROJECT_NAME}Targets
+          ARCHIVE DESTINATION ${LIBRARY_DIR} COMPONENT dev
+          RUNTIME DESTINATION bin COMPONENT lib
+          LIBRARY DESTINATION ${LIBRARY_DIR} COMPONENT lib
+          INCLUDES DESTINATION include)
+      endif()
     endif()
   endforeach()

-  if(MSVC AND "${${NAME}_LIBRARY_TYPE}" MATCHES "SHARED")
-    install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/${Name}${CMAKE_DEBUG_POSTFIX}.pdb
-      DESTINATION bin COMPONENT lib CONFIGURATIONS Debug)
-    install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/RelWithDebInfo/${Name}.pdb
-      DESTINATION bin COMPONENT lib CONFIGURATIONS RelWithDebInfo)
-  endif()
-
-  # install(TARGETS ... PUBLIC_HEADER ...) flattens directories
-  install_files(include/${INCLUDE_NAME} FILES ${PUBLIC_HEADERS}
-    COMPONENT dev BASE ${OUTPUT_INCLUDE_DIR}/${INCLUDE_NAME})
+  if(NOT ${NAME}_OMIT_INSTALL)
+    if(MSVC AND "${${NAME}_LIBRARY_TYPE}" MATCHES "SHARED")
+      install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/${Name}${CMAKE_DEBUG_POSTFIX}.pdb
+        DESTINATION bin COMPONENT lib CONFIGURATIONS Debug)
+      install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/RelWithDebInfo/${Name}.pdb
+        DESTINATION bin COMPONENT lib CONFIGURATIONS RelWithDebInfo)
+    endif()
+
+    # install(TARGETS ... PUBLIC_HEADER ...) flattens directories
+    install_files(include/${INCLUDE_NAME} FILES ${PUBLIC_HEADERS}
+      COMPONENT dev BASE ${OUTPUT_INCLUDE_DIR}/${INCLUDE_NAME})
+  endif()
 endfunction()

 macro(generate_library_header NAME)


ENH: Ensure external module examples get added to current build tree

When built externally, ensure that executables from a module's examples get
added to the current build tree instead of ITK's build tree. The default
CMAKE_RUNTIME_OUTPUT_DIRECTORY is "${ITK_DIR}/bin". Set it to the current
project binary directory + /bin instead if it was the default.

Change-Id: I825c0b6987caef7227ad0b7f8f705da34a354378

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -341,6 +341,12 @@
       # If configuration is done from within ITK,
       # point to internal ITKConfig.cmake
       set(ITK_DIR ${ITK_BINARY_DIR}/CMakeTmp)
+    else()
+      # Ensure that executables get added to the current build tree instead of
+      # ITK's build tree when building as an external module.
+      if(CMAKE_RUNTIME_OUTPUT_DIRECTORY STREQUAL "${ITK_DIR}/bin")
+        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
+      endif()
     endif()
     # Adds example subdirectory
     add_subdirectory( examples )


Removed patch that is not necessary anymore

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -68,8 +68,6 @@
       LIST_SEPARATOR ${sep}
       URL ${opencv_url}
       URL_MD5 ${opencv_url_md5}
-      # Related bug: http://bugs.mitk.org/show_bug.cgi?id=5912
-      PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/OpenCV.patch
       CMAKE_GENERATOR ${gen}
       CMAKE_ARGS
         ${ep_common_args}


From Jose Delport, added support for finding and using GDAL 1.5

--- CMakeModules/FindGDAL.cmake
+++ CMakeModules/FindGDAL.cmake
@@ -56,20 +56,20 @@
 )

 FIND_LIBRARY(GDAL_LIBRARY
-  NAMES gdal gdal_i gdal1.4.0 gdal1.3.2 GDAL
+  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   PATHS
   $ENV{GDAL_DIR}
   NO_DEFAULT_PATH
   PATH_SUFFIXES lib64 lib
 )
 FIND_LIBRARY(GDAL_LIBRARY
-  NAMES gdal gdal_i gdal1.4.0 gdal1.3.2 GDAL
+  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
     NO_DEFAULT_PATH
     PATH_SUFFIXES lib64 lib
 )
 FIND_LIBRARY(GDAL_LIBRARY
-  NAMES gdal gdal_i gdal1.4.0 gdal1.3.2 GDAL
+  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   PATHS
     ~/Library/Frameworks
     /Library/Frameworks


Fix cmake typo

Fix cmake typo

--- src/cmake/compiler.cmake
+++ src/cmake/compiler.cmake
@@ -298,7 +298,7 @@
         set (CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY};-fix")
     endif ()
     set (CMAKE_CXX_CLANG_TIDY "${CMAKE_CXX_CLANG_TIDY};-checks=${CLANG_TIDY_CHECKS}")
-    message (STATUS, "clang-tidy command line is: ${CMAKE_CXX_CLANG_TIDY}")
+    message (STATUS "clang-tidy command line is: ${CMAKE_CXX_CLANG_TIDY}")
 endif ()

 if (EXTRA_CPP_ARGS)


h5py.cmake: Cython is a dependency.

h5py.cmake: Cython is a dependency.

--- h5py.cmake
+++ h5py.cmake
@@ -13,6 +13,7 @@
 include (python)
 include (hdf5)
 include (numpy)
+include (cython)

 external_source (h5py
     2.1.3
@@ -22,7 +23,7 @@

 message ("Installing ${h5py_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${h5py_NAME}
-    DEPENDS             ${python_NAME} ${hdf5_NAME} ${numpy_NAME}
+    DEPENDS             ${python_NAME} ${hdf5_NAME} ${numpy_NAME} ${cython_NAME}
     PREFIX              ${BUILDEM_DIR}
     URL                 ${h5py_URL}
     URL_MD5             ${h5py_MD5}


only build dataspaces when MPI is found

only build dataspaces when MPI is found

--- cmake/DetectOptions.cmake
+++ cmake/DetectOptions.cmake
@@ -255,13 +255,15 @@
 endif()

 # DataSpaces
-if(ADIOS2_USE_DataSpaces STREQUAL AUTO)
-  find_package(DataSpaces 2.1.1)
-elseif(ADIOS2_USE_DataSpaces)
-  find_package(DataSpaces 2.1.1 REQUIRED)
-endif()
-if(DATASPACES_FOUND)
-  set(ADIOS2_HAVE_DataSpaces TRUE)
+if(MPI_FOUND)
+    if(ADIOS2_USE_DataSpaces STREQUAL AUTO)
+        find_package(DataSpaces 2.1.1)
+    elseif(ADIOS2_USE_DataSpaces)
+        find_package(DataSpaces 2.1.1 REQUIRED)
+    endif()
+    if(DATASPACES_FOUND)
+        set(ADIOS2_HAVE_DataSpaces TRUE)
+    endif()
 endif()

 # HDF5


cmake: fixed standalone dynamic IPP detection under win32

--- cmake/OpenCVFindIPP.cmake
+++ cmake/OpenCVFindIPP.cmake
@@ -129,8 +129,13 @@
   macro(_ipp_add_library name)
     # dynamic linking is only supported for standalone version of IPP
     if (BUILD_WITH_DYNAMIC_IPP AND NOT HAVE_IPP_ICV_ONLY)
-      set(IPP_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
-      set(IPP_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
+      if (WIN32)
+        set(IPP_LIB_PREFIX ${CMAKE_IMPORT_LIBRARY_PREFIX})
+        set(IPP_LIB_SUFFIX ${CMAKE_IMPORT_LIBRARY_SUFFIX})
+      else (WIN32)
+        set(IPP_LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
+        set(IPP_LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
+      endif (WIN32)
     else ()
       set(IPP_LIB_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
       set(IPP_LIB_SUFFIX ${CMAKE_STATIC_LIBRARY_SUFFIX})


Make -j better

Make -j better

--- cmake/external/grpc.cmake
+++ cmake/external/grpc.cmake
@@ -23,10 +23,14 @@
 SET(GRPC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/grpc)
 SET(GRPC_INCLUDE_DIR "${GRPC_INSTALL_DIR}/include/" CACHE PATH "grpc include directory." FORCE)
 SET(GRPC_CPP_PLUGIN "${GRPC_INSTALL_DIR}/bin/grpc_cpp_plugin" CACHE FILEPATH "GRPC_CPP_PLUGIN" FORCE)
+
+include(ProcessorCount)
+ProcessorCount(NUM_OF_PROCESSOR)
+
 IF(APPLE)
-  SET(BUILD_CMD make -n HAS_SYSTEM_PROTOBUF=false -s -j static grpc_cpp_plugin | sed "s/-Werror//g" | sh)
+  SET(BUILD_CMD make -n HAS_SYSTEM_PROTOBUF=false -s -j ${NUM_OF_PROCESSOR} static grpc_cpp_plugin | sed "s/-Werror//g" | sh)
 ELSE()
-  SET(BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j static grpc_cpp_plugin)
+  SET(BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j ${NUM_OF_PROCESSOR} static grpc_cpp_plugin)
 ENDIF()

 ExternalProject_Add(


Fix PACKAGE to include cmake/Modules directory

Fix PACKAGE to include cmake/Modules directory.
New PCLConfig.cmake requires find modules.

--- cmake/pcl_pclconfig.cmake
+++ cmake/pcl_pclconfig.cmake
@@ -4,7 +4,7 @@

 file(GLOB PCLCONFIG_FIND_MODULES "${PCL_SOURCE_DIR}/cmake/Modules/*.cmake")
-install(FILES ${PCLCONFIG_FIND_MODULES} DESTINATION ${PCLCONFIG_INSTALL_DIR}/Modules)
+install(FILES ${PCLCONFIG_FIND_MODULES} COMPONENT pclconfig DESTINATION ${PCLCONFIG_INSTALL_DIR}/Modules)

 set(PCLCONFIG_AVAILABLE_COMPONENTS)
 set(PCLCONFIG_AVAILABLE_COMPONENTS_LIST)


qi_sanitize_compile_flags(): add /bigobj for MSVC 64 bit

Change-Id: I7fe464095dd726f9c2aec6d09b84571dfec7f2b8
Reviewed-on: http://gerrit.aldebaran.lan/59404
Tested-by: gerrit
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/flags.cmake
+++ cmake/qibuild/flags.cmake
@@ -51,6 +51,12 @@
     add_definitions("/W3")

     _qi_disable_warnings_msvc(4251 4275)
+
+    # Prevents error C1128 when building in 64b (x64 compiler needs more sections)
+    # https://msdn.microsoft.com/en-us/library/8578y171.aspx
+    if(CMAKE_CL_64)
+      add_definitions("/bigobj")
+    endif()

     if(QI_WERROR)
       add_definitions("/WX")


Be more explicit that MSVC != UNIX or MINGW

Change-Id: Id6ae1a8cca29bead2ebff841f9b1ebf934e001a7
Reviewed-on: http://gerrit.aldebaran.lan/66842
Tested-by: gerrit
Reviewed-by: vbarbaresi <371b46c96c99af52f4f920034e4fcb63ece5bdb5@aldebaran-robotics.com>

--- cmake/qibuild/flags.cmake
+++ cmake/qibuild/flags.cmake
@@ -61,10 +61,9 @@
     if(QI_WERROR)
       add_definitions("/WX")
     endif()
-  endif()

   # gcc or clang:
-  if(UNIX OR MINGW)
+  elseif(UNIX OR MINGW)
     # Use 'standard': c89 and c++98

     # doesn't work: bug #7215


DOC: Remove invalid wrapping example.

DOC: Remove invalid wrapping example.

itk_wrap_image_filter_USIGN_INT is no longer a valid macro.

Change-Id: Ibb0ced4f9826846272098d9eef90754943d88f8c

--- Wrapping/TypedefMacros.cmake
+++ Wrapping/TypedefMacros.cmake
@@ -559,12 +559,6 @@
 # string or just a set of separate parameters), or something of the form "n+"
 # (where n is a number) indicating that instantiations are allowed for dimension
 # n and above.
-#
-# E.g., if only ITK_WRAP_unsigned_char is selected and 2- and 3-dimensional images
-# are selected, then itk_wrap_image_filter_USIGN_INT(2)  will create instantiations for
-# filter<itk::Image<unsigned char, 2>, itk::Image<unsigned char, 2> >
-# and
-# filter<itk::Image<unsigned char, 3>, itk::Image<unsigned char, 3> >

 macro(itk_wrap_image_filter param_types param_count)
   # itk_wrap_image_filter is a more general macro for wrapping image filters that


TODO comments added

TODO comments added

--- WkCompilerSetup.cmake
+++ WkCompilerSetup.cmake
@@ -155,6 +155,7 @@
 	ENDIF ()
 endmacro(WkAddCXXDefinitions Build)

+#TODO : Change usage: All | Debug | Release might not alway be obvious to use...
 # Usage : WkSetExeLinkerFlags( Build [flags] )
 macro(WkSetExeLinkerFlags Build)
 	IF (${Build} STREQUAL All )


ilastik-gui.cmake: Fixed a typo in the cylemon dependency.

--- ilastik-gui.cmake
+++ ilastik-gui.cmake
@@ -26,7 +26,7 @@
 set (ilastik-gui_NAME ${ilastik_NAME}-gui)

 # Add a few dependencies to GUI ilastik build
-add_dependencies( ${ilastik_NAME} ${qt4_NAME} ${pyqt4_NAME} ${qimage2ndarray_NAME} ${vtk_NAME} ${chatty_NAME} $(cylemon_NAME) )
+add_dependencies( ${ilastik_NAME} ${qt4_NAME} ${pyqt4_NAME} ${qimage2ndarray_NAME} ${vtk_NAME} ${chatty_NAME} ${cylemon_NAME} )

 add_custom_target (${ilastik-gui_NAME} ALL
     DEPENDS     ${ilastik_NAME}


Use "TRUE" instead of "1" for consistency

--- library/cmake/Modules/FindPHP.cmake
+++ library/cmake/Modules/FindPHP.cmake
@@ -42,7 +42,7 @@
 if(PHP_FIND_COMPONENTS)
 	foreach(component ${PHP_FIND_COMPONENTS})
 		string(TOUPPER ${component} _COMPONENT)
-		set(PHP_USE_${_COMPONENT} 1)
+		set(PHP_USE_${_COMPONENT} TRUE)
 	endforeach()
 endif()


um: common.cmake update

um: common.cmake update

--- um/common.cmake
+++ um/common.cmake
@@ -1,6 +1,12 @@
+# Copyright (c) 2017 Egor Tensin <Egor.Tensin@gmail.com>
 # It's a CMake code snippet I use in all of my CMake projects.
 # It makes targets link the runtime statically by default + strips debug
 # symbols in release builds.
+# The latest version can be found at
+# https://gist.github.com/egor-tensin/cmake-common.
+# Distributed under the MIT License.
+
+# Version: 2017-05-19T13:51:22+00:00

 get_directory_property(parent_directory PARENT_DIRECTORY)
 set(is_root_project $<NOT:parent_directory>)


Specifiy archiver and ranlib to support link time optimization.

--- linux/clang.cmake
+++ linux/clang.cmake
@@ -1,6 +1,8 @@
 # this one is important
 SET(CMAKE_SYSTEM_NAME Linux)

-SET(CMAKE_C_COMPILER "clang")
-SET(CMAKE_CXX_COMPILER "clang++")
+SET(CMAKE_C_COMPILER clang)
+SET(CMAKE_CXX_COMPILER clang++)
+SET(CMAKE_AR ar)
+SET(CMAKE_RANLIB ranlib)


Remove checking for warning flags at the Superbuild level

Change-Id: Ic709c4c0f99ab7bbf0a5511f7c46d6bda6e4957c

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -111,8 +111,6 @@
 #-------------------------------------------------------------------------
 # augment compiler flags
 #-------------------------------------------------------------------------
-include(CompilerFlagSettings)
-

 # the hidden visibility for inline methods should be consistent between ITK and SimpleITK
 if(NOT WIN32 AND CMAKE_COMPILER_IS_GNUCXX AND BUILD_SHARED_LIBS)
@@ -360,7 +358,7 @@
     ${ep_simpleitk_args}
     ${ep_common_args}
     -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
-    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}\ ${CXX_ADDITIONAL_WARNING_FLAGS}
+    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=<BINARY_DIR>/lib
     -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=<BINARY_DIR>/lib


ctest: Use more strict label match

ctest: Use more strict label match

The label argument to ctest_test is a regex. Adding ^ and $ asks for an
exact match. Previously testing AVX would also call the AVX2 tests.

Solves gh-37

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -330,7 +330,7 @@
                   APPEND
                   RETURN_VALUE res
                   PARALLEL_LEVEL ${number_of_processors}
-                  INCLUDE_LABEL "${label}")
+                  INCLUDE_LABEL "^${label}$")
                ctest_submit(PARTS Test)
             endif()
          endforeach()


use CTEST_USE_LAUNCHERS correctly and use APPEND to fix the dashboard output

--- test.cmake
+++ test.cmake
@@ -9,7 +9,6 @@
 include(CTestConfig.cmake)
 set(CTEST_USE_LAUNCHERS 1) # much improved error/warning message logging

-Set(CTEST_CONFIGURE_COMMAND "${CMAKE_EXECUTABLE_NAME} ${CTEST_SOURCE_DIRECTORY} -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=TRUE")
 if(NOT CMAKE_MAKE_PROGRAM)
    set(CMAKE_MAKE_PROGRAM "make")
 endif()
@@ -24,7 +23,10 @@
       endif()
    endif()
    if(NOT $ENV{ctest_model} STREQUAL "Continuous" OR res GREATER 0)
-      CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+      CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}"
+         OPTIONS "-DCTEST_USE_LAUNCHERS=${CTEST_USE_LAUNCHERS} -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=TRUE"
+         APPEND
+         RETURN_VALUE res)
       ctest_submit(PARTS Configure)
       if(res EQUAL 0)
          foreach(subproject ${CTEST_PROJECT_SUBPROJECTS})
@@ -34,11 +36,13 @@
             set(CTEST_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM} -j$ENV{number_of_processors} -i ${CTEST_BUILD_TARGET}")
             ctest_build(
                BUILD "${CTEST_BINARY_DIRECTORY}"
+               APPEND
                RETURN_VALUE res)
             ctest_submit(PARTS Build)
             if(res EQUAL 0)
                ctest_test(
                   BUILD "${CTEST_BINARY_DIRECTORY}"
+                  APPEND
                   RETURN_VALUE res
                   PARALLEL_LEVEL $ENV{number_of_processors}
                   INCLUDE_LABEL "${subproject}")


Attempt to fix mono on mac, but that script is too messy

--- build/modules/FindMono.cmake
+++ build/modules/FindMono.cmake
@@ -75,14 +75,14 @@

     ENDIF()
   ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")  # OS X
-    SET(MONO_EXECUTABLE /Library/Frameworks/Mono.framework/Commands/mono)
-    SET(MCS_EXECUTABLE /Library/Frameworks/Mono.framework/Commands/mcs)
-    SET(GMCS_EXECUTABLE /Library/Frameworks/Mono.framework/Commands/gmcs)
-    SET(GACUTIL_EXECUTABLE /Library/Frameworks/Mono.framework/Commands/gacutil)
-    GET_FILENAME_COMPONENT(MONO_EXECUTABLE ${MONO_EXECUTABLE} ABSOLUTE)
-    GET_FILENAME_COMPONENT(MCS_EXECUTABLE ${MCS_EXECUTABLE} ABSOLUTE)
-    GET_FILENAME_COMPONENT(GMCS_EXECUTABLE ${GMCS_EXECUTABLE} ABSOLUTE)
-    GET_FILENAME_COMPONENT(GACUTIL_EXECUTABLE ${GACUTIL_EXECUTABLE} ABSOLUTE)
+    SET(MONO_EXECUTABLE_DIR /Library/Frameworks/Mono.framework/Commands/mono)
+    SET(MCS_EXECUTABLE_DIR /Library/Frameworks/Mono.framework/Commands/mcs)
+    SET(GMCS_EXECUTABLE_DIR /Library/Frameworks/Mono.framework/Commands/gmcs)
+    SET(GACUTIL_EXECUTABLE_DIR /Library/Frameworks/Mono.framework/Commands/gacutil)
+    GET_FILENAME_COMPONENT(MONO_EXECUTABLE ${MONO_EXECUTABLE_DIR} ABSOLUTE)
+    GET_FILENAME_COMPONENT(MCS_EXECUTABLE ${MCS_EXECUTABLE_DIR} ABSOLUTE)
+    GET_FILENAME_COMPONENT(GMCS_EXECUTABLE ${GMCS_EXECUTABLE_DIR} ABSOLUTE)
+    GET_FILENAME_COMPONENT(GACUTIL_EXECUTABLE ${GACUTIL_EXECUTABLE_DIR} ABSOLUTE)
   ENDIF()

   IF(MONO_EXECUTABLE AND MCS_EXECUTABLE AND GMCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
@@ -133,14 +133,13 @@
       # Save restore state
       SET(PKG_CONFIG_FOUND_BACKUP ${PKG_CONFIG_FOUND})
       SET(PKG_CONFIG_EXECUTABLE_BACKUP ${PKG_CONFIG_EXECUTABLE})
-      SET(MONO_FOUND TRUE)
       SET(PKG_CONFIG_FOUND FALSE)
       INCLUDE(CMakeFindFrameworks)
       CMAKE_FIND_FRAMEWORKS(Mono)
-      SET(Mono_FRAMEWORKS /Library/Frameworks/Mono.framework)
       IF(Mono_FRAMEWORKS)
         LIST(GET Mono_FRAMEWORKS 0 MONO_FRAMEWORK)
         SET(MONO_PKG_CONFIG ${MONO_FRAMEWORK}/Commands/pkg-config)
+        SET(MONO_FOUND TRUE)
         SET(PKG_CONFIG_EXECUTABLE ${MONO_PKG_CONFIG})
         SET(PKG_CONFIG_FOUND TRUE)
         #SET(MONO_INCLUDE_DIRS ${Mono_FRAMEWORKS}/Headers/mono-1.0


cmake: test if wine is available for mingw builds

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -64,6 +64,14 @@
 	execute_process (COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
 	if (WIN32)
 		message (STATUS "mingw detected")
+
+		# mingw builds need wine to be installed
+		find_program (WINE "wine")
+		if (WINE)
+			message (STATUS "wine detected")
+		else (WINE)
+			message (FATAL_ERROR "wine could not be found but is needed for mingw builds")
+		endif (WINE)
 	else (WIN32)

 		# not supported by icc:


* #244

* #244

--- cmake/Modules/AddIOWOW.cmake
+++ cmake/Modules/AddIOWOW.cmake
@@ -8,16 +8,15 @@
   set(IOWOW_URL https://github.com/Softmotions/iowow/archive/master.zip)
 endif()

-
 set(CMAKE_ARGS  -DOWNER_PROJECT_NAME=${PROJECT_NAME}
                 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                 -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
                 -DBUILD_SHARED_LIBS=OFF
                 -DBUILD_EXAMPLES=OFF)

-
-
-foreach(extra CMAKE_TOOLCHAIN_FILE ANDROID_PLATFORM ANDROID_ABI)
+foreach(extra CMAKE_TOOLCHAIN_FILE
+              ANDROID_PLATFORM
+              ANDROID_ABI)
   if(DEFINED ${extra})
     list(APPEND CMAKE_ARGS "-D${extra}=${${extra}}")
   endif()


* iOS integration

* iOS integration

--- cmake/Modules/AddIOWOW.cmake
+++ cmake/Modules/AddIOWOW.cmake
@@ -25,7 +25,12 @@
 foreach(extra CMAKE_TOOLCHAIN_FILE
               ANDROID_PLATFORM
               ANDROID_ABI
-              TEST_TOOL_CMD)
+              TEST_TOOL_CMD
+              ENABLE_BITCODE
+              ENABLE_ARC
+              ENABLE_VISIBILITY
+              ENABLE_STRICT_TRY_COMPILE
+              ARCHS)
   if(DEFINED ${extra})
     list(APPEND CMAKE_ARGS "-D${extra}=${${extra}}")
   endif()


build: remove `INCORPORATE_OBJECT_LIBRARIES` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -732,7 +732,6 @@
   set(SWIFTLIB_SINGLE_multiple_parameter_options
         FILE_DEPENDS
         GYB_SOURCES
-        INCORPORATE_OBJECT_LIBRARIES
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
         LLVM_LINK_COMPONENTS
         SWIFT_COMPILE_FLAGS)
@@ -872,21 +871,13 @@
     return()
   endif()

-  set(SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS)
-  foreach(object_library ${SWIFTLIB_SINGLE_INCORPORATE_OBJECT_LIBRARIES})
-    list(APPEND SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS
-        $<TARGET_OBJECTS:${object_library}${VARIANT_SUFFIX}>)
-  endforeach()
-
   set(SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY)
   foreach(object_library ${SWIFTLIB_SINGLE_INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY})
     list(APPEND SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY
         $<TARGET_OBJECTS:${object_library}${VARIANT_SUFFIX}>)
   endforeach()

-  set(SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES)
-
-  set(INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS ${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS})
+  set(INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS)
   if(${libkind} STREQUAL "SHARED")
     list(APPEND INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS
          ${SWIFTLIB_INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS_SHARED_ONLY})
@@ -895,8 +886,7 @@
   add_library("${target}" ${libkind}
               ${SWIFTLIB_SINGLE_SOURCES}
               ${SWIFTLIB_SINGLE_EXTERNAL_SOURCES}
-              ${INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS}
-              ${SWIFTLIB_SINGLE_XCODE_WORKAROUND_SOURCES})
+              ${INCORPORATED_OBJECT_LIBRARIES_EXPRESSIONS})
   _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")

   if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")


fix Qt5 mkspecs install dir

fix Qt5 mkspecs install dir

--- cmake/modules/QcaMacro.cmake
+++ cmake/modules/QcaMacro.cmake
@@ -19,7 +19,7 @@
     EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_HEADERS" OUTPUT_VARIABLE QT_INCLUDE_DIR )
     EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DOCS" OUTPUT_VARIABLE QT_DOC_DIR )
     EXEC_PROGRAM( ${QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_DATA" OUTPUT_VARIABLE QT_DATA_DIR )
-    SET( QT_MKSPECS_DIR ${QT_PREFIX_DIR}/mkspecs )
+    SET( QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs )
   ENDMACRO(SETUP_QT5_DIRS)
 ENDIF()


CMake: note that OpenMP support can only be enabled w/ pthreads presence.

I strongly suspect that i will be migrating everything to OpenMP,
and dropping *direct* dep on pthreads.

--- cmake/src-dependencies.cmake
+++ cmake/src-dependencies.cmake
@@ -42,6 +42,13 @@

 unset(HAVE_OPENMP)
 if(WITH_OPENMP)
+  if(NOT HAVE_PTHREAD)
+    message(SEND_ERROR "POSIX locking API is used, but the POSIX Threads "
+                       "weren't found, thus can not enable OpenMP support. "
+                       "Either make it find PThreads, or pass "
+                       "-DWITH_OPENMP=OFF to disable OpenMP support.")
+  endif()
+
   message(STATUS "Looking for OpenMP")
   find_package(OpenMP)


Add ability to find hdf4 in funny location that is standard for 64 bit fedora

--- cmake_include/FindHDF4.cmake
+++ cmake_include/FindHDF4.cmake
@@ -27,12 +27,17 @@

 set(HDF4_LIBRARIES df mfhdf)

-find_module(HDF4
-            LIB_NAMES ${HDF4_LIBRARIES}
-            HEADER_NAMES mfhdf.h
-            )
+find_library(HDF4_LIBRARIES NAMES df mfhdf PATH_SUFFIXES hdf)

-if(NOT HAVE_HDF4)
+find_library(_HDF4_DF_LIBRARY NAMES df PATH_SUFFIXES hdf)
+get_filename_component(HDF4_LIBRARY_DIRS ${_HDF4_DF_LIBRARY} PATH)
+
+find_path ( HDF4_INCLUDE_DIR mfhdf.h PATH /usr/include /usr/include/hdf)
+
+include ( FindPackageHandleStandardArgs )
+find_package_handle_standard_args( HDF4 DEFAULT_MSG HDF4_LIBRARIES HDF4_INCLUDE_DIR )
+
+if(NOT HDF4_FOUND)
     #the user has explicitely requested HDF4 support but the required libraries
     #could not be found
     message(FATAL_ERROR "User requested HDF4 not found!")
@@ -47,4 +52,5 @@
 # add libraries to the link list for NAPI
 #------------------------------------------------------------------------------
 list(APPEND NAPI_LINK_LIBS  df mfhdf jpeg)
-
+include_directories ( SYSTEM ${HDF4_INCLUDE_DIR} )
+link_directories(${HDF4_LIBRARY_DIRS})


GEODE-4337: Correct Path Searching in FindGeode module

- Function execution example includes a jar, so we need Geode to build the java code
- Geode find module problem was breaking build of examples. It was setting the 'hints' variable to the value of GEODE_ROOT, which only works if the 'paths' parameter to find_package_handle_standard_args is empty, but it was always setting paths. Switched it to set one or the other like the FindGeodeNative find module does, and all is better.

Co-authored-by: Matthew Reddington <5d5fb91969c42352c6dd64b674cfc1f16fed1b39@pivotal.io>

--- cmake/FindGeode.cmake
+++ cmake/FindGeode.cmake
@@ -35,20 +35,20 @@
 set(_GEODE_HINTS)
 if(_GEODE_ROOT)
   set(_GEODE_HINTS ${_GEODE_ROOT}/bin)
+else()
+  set(_GEODE_PATHS
+    /geode/bin
+    /apache-geode/bin
+    /usr/geode/bin
+    /usr/apache-geode/bin
+    /usr/local/geode/bin
+    /usr/local/apache-geode/bin
+    /opt/geode/bin
+    /opt/apache-geode/bin
+    /opt/local/geode/bin
+    /opt/local/apache-geode/bin
+  )
 endif()
-
-set(_GEODE_PATHS
-  /geode/bin
-  /apache-geode/bin
-  /usr/geode/bin
-  /usr/apache-geode/bin
-  /usr/local/geode/bin
-  /usr/local/apache-geode/bin
-  /opt/geode/bin
-  /opt/apache-geode/bin
-  /opt/local/geode/bin
-  /opt/local/apache-geode/bin
-)

 if(WIN32)
   set(_GEODE_NAMES gfsh.bat)


fix for windows

fix for windows

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

--- cmake/gsLibrary.cmake
+++ cmake/gsLibrary.cmake
@@ -17,6 +17,10 @@
 #message("Using ${${PROJECT_NAME}_SOURCES}")

 if(GISMO_BUILD_LIB)
+
+#if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+#  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-implicit-templates")
+#endif()

 if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
  set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
@@ -83,6 +87,10 @@

   if (GISMO_WITH_PSOLID)
     target_link_libraries(${PROJECT_NAME} ${PARASOLID_LIBRARY})
+  endif()
+
+  if (GISMO_WITH_ONURBS AND MSVC)
+    target_link_libraries(${PROJECT_NAME} Rpcrt4)
   endif()

   if (GISMO_WITH_SUPERLU)


Revert: r519 partially: don't configure 3rdparty/*/*.in

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

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -7,51 +7,23 @@
 find_program(RPM_PROGRAM rpm)
 if(EXISTS ${RPM_PROGRAM})
   list(APPEND CPACK_GENERATOR "RPM")
-  list(APPEND PACKAGE_EXTENSION ".rpm")
 endif(EXISTS ${RPM_PROGRAM})
 # DEB
 find_program(DPKG_PROGRAM dpkg)
 if(EXISTS ${DPKG_PROGRAM})
   list(APPEND CPACK_GENERATOR "DEB")
-  list(APPEND PACKAGE_EXTENSION ".deb")
 endif(EXISTS ${DPKG_PROGRAM})
 # NSIS
 find_program(NSIS_PROGRAM makensis MakeNSIS)
 if(EXISTS ${NSIS_PROGRAM})
   list(APPEND CPACK_GENERATOR "NSIS")
-  list(APPEND PACKAGE_EXTENSION ".exe;")
 endif(EXISTS ${NSIS_PROGRAM})
 # dpkg
 find_program(PACKAGE_MAKER_PROGRAM PackageMaker
 	    HINTS /Developer/Applications/Utilities)
 if(EXISTS ${PACKAGE_MAKER_PROGRAM})
   list(APPEND CPACK_GENERATOR "PackageMaker")
-  list(APPEND PACKAGE_EXTENSION ".dmg;")
 endif(EXISTS ${PACKAGE_MAKER_PROGRAM})
-
-list(LENGTH PACKAGE_EXTENSION nb_extensions)
-if(nb_extensions GREATER 0)
-  list(GET PACKAGE_EXTENSION 0 ext)
-  set(COPY_PACKAGE_COMMAND "cp *${ext} ../../")
-  math(EXPR before_last "${nb_extensions} - 1")
-  if(${before_last} GREATER 0)
-    foreach(ext RANGE 1 ${before_last})
-      list(GET PACKAGE_EXTENSION ${ext} ext_name)
-      set(COPY_PACKAGE_COMMAND "${COPY_PACKAGE_COMMAND} && \\
-  cp *${ext_name} ../../")
-    endforeach(ext)
-  endif(${before_last} GREATER 0)
-
-  #now configure all the 3rdpaty Makefile
-  file(GLOB parties ${PCL_SOURCE_DIR}/3rdparty/*)
-  foreach(party ${parties})
-    if(EXISTS ${party}/Makefile.in)
-      configure_file(${party}/Makefile.in ${party}/Makefile @ONLY)
-      configure_file(${party}/cpack.patch.in ${party}/cpack.patch @ONLY)
-    endif(EXISTS ${party}/Makefile.in)
-  endforeach(party)
-endif(nb_extensions GREATER 0)
-

 include(InstallRequiredSystemLibraries)


cmake: fix typo in qt_qtdbus module

cmake: fix typo in qt_qtdbus module

Change-Id: I60fac559417c3d1bdb35016bf44acb537477c6f1
Reviewed-on: http://gerrit.aldebaran.lan:8080/17358
Tested-by: gerrit
Reviewed-by: jmassot <635e755e31f4898906fa675e06ba806b9a909933@aldebaran-robotics.com>
Tested-by: jmassot <635e755e31f4898906fa675e06ba806b9a909933@aldebaran-robotics.com>

--- cmake/qibuild/modules/qt_qtdbus-config.cmake
+++ cmake/qibuild/modules/qt_qtdbus-config.cmake
@@ -6,7 +6,7 @@
 include("${_ROOT_DIR}/qtutils.cmake")

 set(_suffix "QTDBUS")
-set(_libame "QtDbus")
+set(_libame "QtDBus")

 qt_flib(${_suffix} ${_libame})
 if(UNIX AND NOT APPLE)


should fix problem of run libraries ( dlls ) not propagated to other projects on Windows.

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -137,7 +137,7 @@
 set(${PROJECT_NAME}_INCLUDE_DIRS \"\${${PROJECT_NAME}_INCLUDE_DIRS}\" CACHE PATH \"${PROJECT_NAME} Headers\" )
 set(${PROJECT_NAME}_LIBRARIES \"\${${PROJECT_NAME}_LIBRARIES}\" CACHE FILEPATH \"${PROJECT_NAME} Libraries\")
 if ( WIN32 )
-	set(${PROJECT_NAME}_RUN_LIBRARIES CACHE FILEPATH \"${PROJECT_NAME} DLLs\" )
+	set(${PROJECT_NAME}_RUN_LIBRARIES \"\${${PROJECT_NAME}_RUN_LIBRARIES}\" CACHE FILEPATH \"${PROJECT_NAME} DLLs\" )
 endif ( WIN32 )

 CMAKE_POLICY(POP)


Split off 8.2.18

Split off 8.2.18

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

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


Bump version to 2.2.1

Bump version to 2.2.1

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 # set project version
 set(ALVAR_VERSION_MAJOR 2)
 set(ALVAR_VERSION_MINOR 2)
-set(ALVAR_VERSION_PATCH 0)
+set(ALVAR_VERSION_PATCH 1)

 # denote special version tag
 # examples: a1, a2, a3, b1, b2, b3, rc1, rc2, rc3


Split off 7.8.76

Split off 7.8.76

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

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


Split off 8.2.26

Split off 8.2.26

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

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


core module lib location change

core module lib location change

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -69,7 +69,7 @@
 	FOREACH( MODULE ${ARGN} )
 		INCLUDE_SYS_DIR( ${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE} )
 		LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/lib/.libs )
-		FILE( GLOB_RECURSE tmp_header "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/dune/${MODULE}/*.hh" )
+		FILE( GLOB_RECURSE tmp_header "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/${MODULE}/*.hh" )
 		LIST( APPEND DUNE_HEADERS ${tmp_header} )
 	ENDFOREACH(MODULE)
 ENDMACRO( ADD_DUNE_MODULES )
@@ -138,7 +138,10 @@
 FIND_PACKAGE( PkgConfig )
 pkg_check_modules( CCGNU REQUIRED libccgnu2 )
 ADD_CXX_FLAGS( "${CCGNU_CFLAGS}")
+<<<<<<< HEAD
 ADD_CXX_FLAGS( "-DHAVE_GRIDTYPE" )
+=======
+>>>>>>> core module lib location change
 INCLUDE_SYS_DIR(${Boost_INCLUDE_DIR})

 #try to enable link-time-optimisation


[cmake] bugfix: creating paths.cmake out of dependencies.cmake did not work

--- cmake/axl_cmake.cmake
+++ cmake/axl_cmake.cmake
@@ -2,6 +2,113 @@
 # your project directory and include it in master CMakeLists.txt like this:

 # include (axl_cmake.cmake NO_POLICY_SCOPE)
+
+#..............................................................................
+
+# excerpt from axl_utils.cmake
+
+macro (
+axl_calc_max_string_length
+	_RESULT
+	# ...
+	)
+
+	set (_STRING_LIST ${ARGN})
+
+	set (_MAX_LENGTH 0)
+	foreach (_STRING ${_STRING_LIST})
+		string (LENGTH ${_STRING} _LENGTH)
+		if (${_LENGTH} GREATER ${_MAX_LENGTH})
+			set (_MAX_LENGTH ${_LENGTH})
+		endif ()
+	endforeach ()
+
+	set (${_RESULT} ${_MAX_LENGTH})
+endmacro ()
+
+macro (
+axl_create_space_padding
+	_RESULT
+	_STRING
+	_MAX_LENGTH
+	)
+
+	string (LENGTH ${_STRING} _LENGTH)
+	math (EXPR _PADDING_LENGTH "${_MAX_LENGTH} - ${_LENGTH} + 1")
+	string (RANDOM LENGTH ${_PADDING_LENGTH} ALPHABET " " ${_RESULT})
+endmacro ()
+
+macro (
+	axl_create_empty_setting_file
+	_FILE_NAME
+	# ...
+	)
+
+	set (_SETTING_LIST ${ARGN})
+
+	axl_calc_max_string_length (_MAX_LENGTH ${_SETTING_LIST})
+
+	set (_CONTENTS "#\n")
+	set (_CONTENTS "${_CONTENTS}# This is an auto-generated setting file\n")
+	set (_CONTENTS "${_CONTENTS}# Fill it by hand with proper settings\n")
+	set (_CONTENTS "${_CONTENTS}#\n\n")
+
+	foreach (_SETTING ${_SETTING_LIST})
+		axl_create_space_padding (_PADDING ${_SETTING} ${_MAX_LENGTH})
+		set (_CONTENTS "${_CONTENTS}set (${_SETTING}${_PADDING}${_SETTING}-NOTFOUND)\n")
+	endforeach ()
+
+	file (WRITE ${_FILE_NAME} ${_CONTENTS})
+endmacro ()
+
+macro (
+axl_find_file
+	_RESULT
+	_FILE_NAME
+	# ...
+	)
+
+	set (_DIR_LIST ${ARGN})
+
+	set (_FILE_PATH ${_FILE_NAME}-NOTFOUND)
+
+	foreach (_DIR ${_DIR_LIST})
+		if (EXISTS ${_DIR}/${_FILE_NAME})
+			set (_FILE_PATH ${_DIR}/${_FILE_NAME})
+			break ()
+		endif ()
+	endforeach ()
+
+	set (${_RESULT} ${_FILE_PATH})
+endmacro ()
+
+macro (
+axl_find_file_recurse_parent_dirs
+	_RESULT
+	_FILE_NAME
+	_START_DIR
+	)
+
+	set (_DIR ${_START_DIR})
+
+	while (TRUE)
+		if (EXISTS ${_DIR}/${_FILE_NAME})
+			set (_FILE_PATH ${_DIR}/${_FILE_NAME})
+			break ()
+		endif ()
+
+		get_filename_component (_PARENT_DIR "${_DIR}/.." ABSOLUTE)
+
+		if (${_DIR} STREQUAL ${_PARENT_DIR})
+			set (_FILE_PATH ${_FILE_NAME}-NOTFOUND)
+			break ()
+		endif ()
+
+		set (_DIR ${_PARENT_DIR})
+	endwhile ()
+
+	set (${_RESULT} ${_FILE_PATH})
+endmacro ()

 #..............................................................................

@@ -11,26 +118,9 @@
 	message (FATAL_ERROR "dependencies.cmake not found (must be in the root dir)")
 endif ()

-# find paths.cmake in this directory or above
+# find paths.cmake; if not found, generate a new one based on AXL_PATH_LIST from dependencies.cmake

-set (_DIR ${CMAKE_CURRENT_LIST_DIR})
-
-while (TRUE)
-	if (EXISTS ${_DIR}/paths.cmake)
-		set (_PATHS_CMAKE ${_DIR}/paths.cmake)
-		break ()
-	endif ()
-
-	get_filename_component (_PARENT_DIR "${_DIR}/.." ABSOLUTE)
-	if (${_DIR} STREQUAL ${_PARENT_DIR})
-		set (_PATHS_CMAKE paths.cmake-NOTFOUND)
-		break ()
-	endif ()
-
-	set (_DIR ${_PARENT_DIR})
-endwhile ()
-
-# if not found, generate a new one based on AXL_PATH_LIST from dependencies.cmake
+axl_find_file_recurse_parent_dirs (_PATHS_CMAKE paths.cmake ${CMAKE_CURRENT_LIST_DIR})

 if (NOT _PATHS_CMAKE)
 	include (${CMAKE_SOURCE_DIR}/dependencies.cmake)
@@ -43,40 +133,25 @@
 	message (FATAL_ERROR "please fill the newly generated ${CMAKE_SOURCE_DIR}/paths.cmake")
 endif ()

-# include paths.cmake to get AXL_CMAKE_DIR
+# include paths.cmake to get AXL_CMAKE_DIR; then find and include axl_init.cmake

 include (${_PATHS_CMAKE})
-
-# find and include axl_init.cmake

 if (NOT AXL_CMAKE_DIR)
 	message (FATAL_ERROR "AXL_CMAKE_DIR not found (check your paths.cmake)")
 endif ()

-set (_AXL_INIT_CMAKE axl_init.cmake-NOTFOUND)
-
-foreach (_DIR ${AXL_CMAKE_DIR})
-	if (EXISTS ${_DIR}/axl_init.cmake)
-		set (_AXL_INIT_CMAKE ${_DIR}/axl_init.cmake)
-		break ()
-	endif ()
-endforeach ()
+axl_find_file (_AXL_INIT_CMAKE axl_init.cmake ${AXL_CMAKE_DIR})

 if (NOT _AXL_INIT_CMAKE)
 	message (FATAL_ERROR "axl_init.cmake not found (check AXL_CMAKE_DIR in your paths.cmake)")
 endif ()

-include (
-	${_AXL_INIT_CMAKE}
-	NO_POLICY_SCOPE
-	)
-
-# include paths again, this time ${CONFIGURATION_SUFFIX} is defined
+# include axl_init.cmake, paths.cmake, and dependencies.cmake
+# this time ${CONFIGURATION_SUFFIX} and all the other settings are defined

+include (${_AXL_INIT_CMAKE} NO_POLICY_SCOPE)
 include (${_PATHS_CMAKE})
-
-# include dependecies.cmake, now all the settings are defined
-
 include (${CMAKE_SOURCE_DIR}/dependencies.cmake)

 # diagnostic printing


MDEV-409 : /etc/my.cnf config file overwritten during RPM installation

Fix : use attribute %config(noreplace)  for /etc/my.cnf , instead of (automatically generated) %config

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -65,6 +65,7 @@
 SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common")

 SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d")
+SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf")

 SET(CPACK_RPM_client_PACKAGE_OBSOLETES "mysql-client MySQL-client MySQL-OurDelta-client")
 SET(CPACK_RPM_client_PACKAGE_PROVIDES "MariaDB-client MySQL-client mysql-client")


Appended "/pcl" to project-wide include install dir

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

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -167,7 +167,7 @@
         set(LIB_INSTALL_DIR "lib")
     endif(OS_IS_64BIT)
     set(INCLUDE_INSTALL_DIR
-        "include/${PROJECT_NAME_LOWER}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}")
+        "include/${PROJECT_NAME_LOWER}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}/pcl")
     set(BIN_INSTALL_DIR "bin")
     set(PKGCFG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig")
 endmacro(SET_INSTALL_DIRS)


Reintroduce default build packages from Buildyard

--- SubProject.cmake
+++ SubProject.cmake
@@ -56,12 +56,21 @@
 file(MAKE_DIRECTORY ${__common_source_dir})

 function(subproject_install_packages file name)
-  if(NOT EXISTS ${file} OR NOT INSTALL_PACKAGES)
+  if(NOT INSTALL_PACKAGES)
     return()
   endif()

-  include(${file})
+  if(EXISTS ${file})
+    include(${file})
+  endif()
+
   string(TOUPPER ${name} NAME)
+  list(APPEND ${NAME}_DEB_DEPENDS pkg-config git subversion cmake autoconf
+    automake git-review doxygen ${OPTIONAL_DEBS})
+  set(${NAME}_BUILD_DEBS ${NAME}_DEB_DEPENDS)
+  list(APPEND ${NAME}_DEB_DEPENDS ninja-build lcov cppcheck git-svn clang
+    clang-format-3.5) # optional deb packages, not added to build spec
+  list(APPEND ${NAME}_PORT_DEPENDS cppcheck)

   if(${NAME}_DEB_DEPENDS AND CMAKE_SYSTEM_NAME MATCHES "Linux" )
     list(SORT ${NAME}_DEB_DEPENDS)


Use Module mode for find_package in subprojects if Config mode fails.

This is needed to correctly detect subprojects that can be system level installed
but provide no <project>Config.cmake files.

--- SubProject.cmake
+++ SubProject.cmake
@@ -145,7 +145,11 @@
     if(NOT ${NAME}_FOUND)
       get_property(__included GLOBAL PROPERTY ${name}_IS_SUBPROJECT)
       if(NOT EXISTS ${CMAKE_SOURCE_DIR}/${name})
+        # Always try first using Config mode, then Module mode.
         find_package(${name} QUIET CONFIG)
+        if(NOT ${name}_FOUND)
+          find_package(${name} QUIET MODULE)
+        endif()
       elseif(__included) # already used as a sub project, just find it:
         find_package(${name} QUIET CONFIG HINTS ${CMAKE_BINARY_DIR}/${NAME})
       endif()


Remove use of DOWNLOAD_NAME and rename deps directory (fix #1)

CMake 2.8.7 doesn't provide DOWNLOAD_NAME, it wasn't needed anyway.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -1,14 +1,13 @@
 include (ExternalProject)

-set_property (DIRECTORY PROPERTY EP_BASE dependencies)
+set_property (DIRECTORY PROPERTY EP_BASE Dependencies)

 set (DEPENDENCIES)
 set (EXTRA_CMAKE_ARGS)

-# Use static linking to avoid issues with the system-wide installation of Boost.
+# Use static linking to avoid issues with system-wide installations of Boost.
 list (APPEND DEPENDENCIES ep_boost)
 ExternalProject_Add (ep_boost
-  DOWNLOAD_NAME boost_1_55_0.tar.bz2
   URL http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.bz2/download
   URL_MD5 d6eef4b4cacb2183f2bf265a5a03a354
   CONFIGURE_COMMAND ./bootstrap.sh --with-libraries=atomic,date_time,filesystem,program_options,system,thread
@@ -17,7 +16,7 @@
   INSTALL_COMMAND ""
   )
 list (APPEND EXTRA_CMAKE_ARGS
-  -DBOOST_ROOT=${CMAKE_CURRENT_BINARY_DIR}/dependencies/Source/ep_boost
+  -DBOOST_ROOT=${CMAKE_CURRENT_BINARY_DIR}/Dependencies/Source/ep_boost
   -DBoost_NO_SYSTEM_PATHS=ON)

 # FIXME add to default target "all"?
@@ -27,6 +26,3 @@
   CMAKE_ARGS -DUSE_SUPERBUILD=OFF ${EXTRA_CMAKE_ARGS}
   INSTALL_COMMAND ""
   BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/blah)
-
-
-message (STATUS "ARGS: ${CMAKE_ARGS}, OPTIONS: ${CMAKE_OPTIONS}")


testing: build qs extension

testing: build qs extension


STYLE: Consistently reference *_BINARY_DIR CMake variable for extension project

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -75,7 +75,7 @@
     -DMIDAS_PACKAGE_API_KEY:STRING=${MIDAS_PACKAGE_API_KEY}
     # Superbuild
     -D${LOCAL_PROJECT_NAME}_SUPERBUILD:BOOL=OFF
-    -DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${EXTENSION_NAME}_BINARY_DIR}
+    -DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${LOCAL_PROJECT_NAME}_BINARY_DIR}
   INSTALL_COMMAND ""
   DEPENDS
     ${${LOCAL_PROJECT_NAME}_DEPENDS}


add option to build STIR with OpenMP

add option to build STIR with OpenMP

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -108,6 +108,7 @@
 #option(USE_SYSTEM_Gadgetron "Build using an external version of Gadgetron" OFF)
 option(USE_SYSTEM_SIRF "Build using an external version of SIRF" OFF)
 option(USE_SYSTEM_GTest "Build using an external version of GTest" OFF)
+option(BUILD_STIR_WITH_OPENMP "Build STIR with OpenMP acceleration" OFF)

 # ITK
 option(USE_ITK "Use ITK" OFF)


Generate list of CTK dependencies instead of explicitly using <EP>_DEPENDS

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -126,6 +126,9 @@
 # The item of this list should have the following form: -D<EP>_DIR:PATH=${<EP>_DIR}
 # where '<EP>' is an external project name.
 SET(CTK_SUPERBUILD_EP_ARGS)
+
+# This variable will contain the list of external project that CTK depends on.
+SET(CTK_DEPENDS)

 # Include external projects
 SET(dependency_args )
@@ -148,36 +151,15 @@
            -D${${p}_enabling_variable}_FIND_PACKAGE_CMD:STRING=${${${p}_enabling_variable}_FIND_PACKAGE_CMD})
     ENDIF()
   ENDIF()
+  LIST(APPEND CTK_DEPENDS ${${p}_DEPENDS})
 ENDFOREACH()

 #MESSAGE("Superbuild args: ${dependency_args}")
-
-#-----------------------------------------------------------------------------
-# CTK Utilities
-#
-set(proj CTK-Utilities)
-ExternalProject_Add(${proj}
-  DOWNLOAD_COMMAND ""
-  CONFIGURE_COMMAND ""
-  BUILD_COMMAND ""
-  INSTALL_COMMAND ""
-  DEPENDS
-    # Mandatory dependencies
-    ${Log4Qt_DEPENDS}
-    # Optionnal dependencies
-    ${CTKData_DEPENDS}
-    ${QtMobility_DEPENDS}
-    ${QtSOAP_DEPENDS}
-    ${kwstyle_DEPENDS}
-    ${DCMTK_DEPENDS}
-    ${PythonQt_DEPENDS}
-    ${PythonQtGenerator_DEPENDS}
-    ${ZMQ_DEPENDS}
-    ${OpenIGTLink_DEPENDS}
-    ${VTK_DEPENDS}
-    ${XIP_DEPENDS}
-    ${ITK_DEPENDS}
-)
+
+# MESSAGE("CTK_DEPENDS:")
+# FOREACH(dep ${CTK_DEPENDS})
+#   MESSAGE("  ${dep}")
+# ENDFOREACH()

 #-----------------------------------------------------------------------------
 # Generate cmake variable name corresponding to Libs, Plugins and Applications
@@ -260,7 +242,7 @@
   BUILD_COMMAND ""
   INSTALL_COMMAND ""
   DEPENDS
-    "CTK-Utilities"
+    ${CTK_DEPENDS}
   )


Fix failure regex to include when plays are run on 0 hosts because of mismatching hosts

--- devops/ansible_vagrant.cmake
+++ devops/ansible_vagrant.cmake
@@ -21,7 +21,7 @@
     ENVIRONMENT "${VAGRANT_ENV_VARS}"
     # This happens in the case where vagrant up fails, failing to generate a valid host file.
     # Without this, ansible would return a valid exit status since it provisioned 0 hosts correctly.
-    FAIL_REGULAR_EXPRESSION "Host file not found"
+    FAIL_REGULAR_EXPRESSION "Host file not found;no hosts matched"
     LABELS girder_ansible_client)
   set_property(GLOBAL APPEND PROPERTY vagrant_tests "${name}")
 endfunction()


Generate a file with generated js project name

Change-Id: I706cfa139b0666f08d0249a624899e797870ba05

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -544,6 +544,10 @@
   if (${GENERATE_JS_CLIENT_PROJECT})
     find_package(Npm REQUIRED)

+    get_values_from_model(PREFIX VALUE MODELS ${PARAM_MODELS} KEYS code.api.js.node.name)
+
+    file(WRITE ${CMAKE_BINARY_DIR}/js_project_name "${VALUE_CODE_API_JS_NODE_NAME}")
+
     execute_process(
       COMMAND ${KTOOL_ROM_PROCESSOR_EXECUTABLE} -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -c ${CMAKE_BINARY_DIR}/js -it npm
     )


Do not overwrite stub files if they are already created

Change-Id: I1acd89eca8574563a5d51fefbc35011dc437663c

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -28,6 +28,11 @@
 #
 #)
 function (generate_sources)
+
+  set (OPTION_PARAMS
+    NO_OVERWRITE
+  )
+
   set (ONE_VALUE_PARAMS
     GEN_FILES_DIR
     SOURCE_FILES_OUTPUT
@@ -46,7 +51,7 @@
     HEADER_FILES_OUTPUT
   )

-  cmake_parse_arguments("PARAM" "" "${ONE_VALUE_PARAMS}" "${MULTI_VALUE_PARAMS}" ${ARGN})
+  cmake_parse_arguments("PARAM" "${OPTION_PARAMS}" "${ONE_VALUE_PARAMS}" "${MULTI_VALUE_PARAMS}" ${ARGN})

   foreach (REQUIRED_PARAM ${REQUIRED_PARAMS})
     if (NOT DEFINED PARAM_${REQUIRED_PARAM})
@@ -62,6 +67,10 @@
     set (COMMAND_LINE ${COMMAND_LINE} -it ${PARAM_INTERNAL_TEMPLATES_DIR})
   else()
     message (FATAL_ERROR "Missing templates you have to set TEMPLATES_DIR INTERNAL_TEMPLATES_DIR")
+  endif()
+
+  if (PARAM_NO_OVERWRITE)
+    set (COMMAND_LINE ${COMMAND_LINE} -n)
   endif()

   foreach (MODEL ${PARAM_MODELS})
@@ -377,7 +386,6 @@

   set(MODULE_GEN_FILES_DIR ${CMAKE_CURRENT_BINARY_DIR}/implementation/generated-cpp)

-  # Generate stub files
   generate_sources (
     MODELS ${PARAM_MODELS}
     GEN_FILES_DIR ${MODULE_GEN_FILES_DIR}
@@ -388,14 +396,14 @@

   set(SERVER_GEN_FILES_DIR ${PARAM_SERVER_STUB_DESTINATION})

-  # Generate public server files
-  # TODO: Add an option to not delete the code if already exists
+  # Generate stub files
   generate_sources (
     MODELS ${PARAM_MODELS}
     GEN_FILES_DIR ${SERVER_GEN_FILES_DIR}
     INTERNAL_TEMPLATES_DIR cpp_server
     SOURCE_FILES_OUTPUT SERVER_GENERATED_SOURCES
     HEADER_FILES_OUTPUT SERVER_GENERATED_HEADERS
+    NO_OVERWRITE
   )

   add_library (${VALUE_CODE_IMPLEMENTATION_LIB}impl SHARED


BUG: fix zlib download url

BUG: fix zlib download url

--- CMake/External_zlib.cmake
+++ CMake/External_zlib.cmake
@@ -19,7 +19,7 @@
       # Try official release 1.2.8
       ExternalProject_Add(${proj}
         PREFIX ${proj}
-        URL "http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz"
+        URL "http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz/download"
         URL_MD5 44d667c142d7cda120332623eab69f40
         BINARY_DIR ${ZLIB_SB_BUILD_DIR}
         INSTALL_DIR ${CMAKE_INSTALL_PREFIX}


Fix indent

Fix indent

--- CMake/VisomicsCPack.cmake
+++ CMake/VisomicsCPack.cmake
@@ -5,7 +5,7 @@

 SET(QT_INSTALL_LIB_DIR ${Visomics_INSTALL_LIB_DIR})

-SET (QTLIBLIST QTCORE QTGUI QTNETWORK QTXML QTTEST QTSQL QTOPENGL QTWEBKIT PHONON QTXMLPATTERNS QTSCRIPT)
+SET(QTLIBLIST QTCORE QTGUI QTNETWORK QTXML QTTEST QTSQL QTOPENGL QTWEBKIT PHONON QTXMLPATTERNS QTSCRIPT)
 IF(UNIX OR APPLE)
   LIST(APPEND QTLIBLIST QTDBUS)
 ENDIF()


Combine vtk_wrap_python and vtk_wrap_python3.

The vtk_wrap_python macro was a copy-paste of vtk_wrap_python3, and this
commit reformulates it so that it calls vtk_wrap_python3 instead. Removing
vtk_wrap_python3 is not possible because it is the only way to wrap code
that does not belong to a VTK module, and it is used by external packages.

--- CMake/vtkWrapPython.cmake
+++ CMake/vtkWrapPython.cmake
@@ -12,7 +12,7 @@
       set(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit)
     else()
       message(SEND_ERROR
-        "VTK_WRAP_PYTHON_INIT_EXE not specified when calling VTK_WRAP_PYTHON3")
+        "VTK_WRAP_PYTHON_INIT_EXE not specified when calling vtk_wrap_python")
     endif()
   endif()
   if(NOT VTK_WRAP_PYTHON_EXE)
@@ -20,7 +20,7 @@
       set(VTK_WRAP_PYTHON_EXE vtkWrapPython)
     else()
       message(SEND_ERROR
-        "VTK_WRAP_PYTHON_EXE not specified when calling VTK_WRAP_PYTHON3")
+        "VTK_WRAP_PYTHON_EXE not specified when calling vtk_wrap_python")
     endif()
   endif()

@@ -56,10 +56,16 @@
 ")
   else()
     # all the include directories
-    if(VTK_WRAP_INCLUDE_DIRS)
+    string(REGEX REPLACE "Python\$" "" module "${TARGET}")
+    if(${module}_INCLUDE_DIRS)
+      set(TMP_INCLUDE_DIRS ${${module}_INCLUDE_DIRS})
+    elseif(VTK_WRAP_INCLUDE_DIRS)
       set(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS})
     else()
       set(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
+    endif()
+    if(EXTRA_PYTHON_INCLUDE_DIRS)
+      list(APPEND TMP_INCLUDE_DIRS ${EXTRA_PYTHON_INCLUDE_DIRS})
     endif()
     foreach(INCLUDE_DIR ${TMP_INCLUDE_DIRS})
       set(_common_args "${_common_args}-I\"${INCLUDE_DIR}\"\n")
@@ -101,8 +107,7 @@
         "${VTK_WRAPPER_INIT_DATA}\n${TMP_FILENAME}")

       # new source file is namePython.cxx, add to resulting list
-      set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}}
-        ${TMP_FILENAME}Python.cxx)
+      list(APPEND ${SRC_LIST_NAME} ${TMP_FILENAME}Python.cxx)

       # add custom command to output
       add_custom_command(
@@ -134,6 +139,8 @@
           set(VTK_WRAP_PYTHON_CUSTOM_COUNT)
         endif()
       endif()
+    else()
+      # message("${TMP_FILENAME} will not be wrapped.")
     endif()
   endforeach()

@@ -215,66 +222,8 @@

 # Macro that just takes the name of the module, figure the rest out from there.
 macro(vtk_wrap_python TARGET SRC_LIST_NAME module)
-  if(NOT VTK_WRAP_PYTHON_INIT_EXE)
-    if(TARGET vtkWrapPythonInit)
-      set(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit)
-    else()
-      message(SEND_ERROR
-        "VTK_WRAP_PYTHON_INIT_EXE not specified when calling VTK_WRAP_PYTHON3")
-    endif()
-  endif()
-  if(NOT VTK_WRAP_PYTHON_EXE)
-    if(TARGET vtkWrapPython)
-      set(VTK_WRAP_PYTHON_EXE vtkWrapPython)
-    else()
-      message(SEND_ERROR
-        "VTK_WRAP_PYTHON_EXE not specified when calling vtk_wrap_python")
-    endif()
-  endif()
-
-  # Initialize the custom target counter.
-  if(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS)
-    set(VTK_WRAP_PYTHON_CUSTOM_COUNT "")
-    set(VTK_WRAP_PYTHON_CUSTOM_NAME ${TARGET})
-    set(VTK_WRAP_PYTHON_CUSTOM_LIST)
-  endif()
-
-  # start writing the input file for the init file
-  set(VTK_WRAPPER_INIT_DATA "${TARGET}")
-
-  # all the include directories
-  if(${module}_INCLUDE_DIRS)
-    set(TMP_INCLUDE_DIRS ${${module}_INCLUDE_DIRS})
-  elseif(VTK_WRAP_INCLUDE_DIRS)
-    set(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS})
-  else()
-    set(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
-  endif()
-  if(EXTRA_PYTHON_INCLUDE_DIRS)
-    list(APPEND TMP_INCLUDE_DIRS ${EXTRA_PYTHON_INCLUDE_DIRS})
-  endif()
-
-  # collect the common wrapper-tool arguments
-  set(_common_args)
-  get_directory_property(_def_list DEFINITION COMPILE_DEFINITIONS)
-  foreach(TMP_DEF ${_def_list})
-    set(_common_args "${_common_args}-D${TMP_DEF}\n")
-  endforeach()
-  foreach(INCLUDE_DIR ${TMP_INCLUDE_DIRS})
-    set(_common_args "${_common_args}-I\"${INCLUDE_DIR}\"\n")
-  endforeach()
-  if(VTK_WRAP_HINTS)
-    set(_common_args "${_common_args}--hints \"${VTK_WRAP_HINTS}\"\n")
-  endif()
-  if(KIT_HIERARCHY_FILE)
-    set(_common_args "${_common_args}--types \"${KIT_HIERARCHY_FILE}\"\n")
-  endif()
-
-  # write wrapper-tool arguments to a file
-  string(STRIP "${_common_args}" CMAKE_CONFIGURABLE_FILE_CONTENT)
-  set(_args_file ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.args)
-  configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
-                 ${_args_file} @ONLY)
+  # List of all headers to wrap.
+  set(headers_to_wrap)

   # Decide what to do for each header.
   foreach(header ${${module}_HEADERS})
@@ -287,69 +236,11 @@
         message(FATAL_ERROR "Could not find ${header}.h for Python wrapping!")
       endif()

-      # add the info to the init file
-      set(VTK_WRAPPER_INIT_DATA
-        "${VTK_WRAPPER_INIT_DATA}\n${header}")
-
-      # new source file is namePython.cxx, add to resulting list
-      set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${header}Python.cxx)
-
-      # add custom command to output
-      add_custom_command(
-        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${header}Python.cxx
-        DEPENDS ${VTK_WRAP_PYTHON_EXE}
-                ${VTK_WRAP_HINTS}
-                ${class_header_path}
-                ${_args_file}
-                ${KIT_HIERARCHY_FILE}
-        COMMAND ${VTK_WRAP_PYTHON_EXE}
-                @${_args_file}
-                -o ${CMAKE_CURRENT_BINARY_DIR}/${header}Python.cxx
-                ${class_header_path}
-        COMMENT "Python Wrapping - generating ${header}Python.cxx"
-        VERBATIM
-        )
-
-      # Add this output to a custom target if needed.
-      if(VTK_WRAP_PYTHON_NEED_CUSTOM_TARGETS)
-        set(VTK_WRAP_PYTHON_CUSTOM_LIST ${VTK_WRAP_PYTHON_CUSTOM_LIST}
-          ${CMAKE_CURRENT_BINARY_DIR}/${header}Python.cxx)
-        set(VTK_WRAP_PYTHON_CUSTOM_COUNT ${VTK_WRAP_PYTHON_CUSTOM_COUNT}x)
-        if(VTK_WRAP_PYTHON_CUSTOM_COUNT MATCHES "^${VTK_WRAP_PYTHON_CUSTOM_LIMIT}$")
-          set(VTK_WRAP_PYTHON_CUSTOM_NAME ${VTK_WRAP_PYTHON_CUSTOM_NAME}Hack)
-          add_custom_target(${VTK_WRAP_PYTHON_CUSTOM_NAME}
-            DEPENDS ${VTK_WRAP_PYTHON_CUSTOM_LIST})
-          set(KIT_PYTHON_DEPS ${VTK_WRAP_PYTHON_CUSTOM_NAME})
-          set(VTK_WRAP_PYTHON_CUSTOM_LIST)
-          set(VTK_WRAP_PYTHON_CUSTOM_COUNT)
-        endif()
-      endif()
-    else()
-      # message("${header} will not be wrapped.")
+      # The new list of headers has the full path to each file.
+      list(APPEND headers_to_wrap ${class_header_path})
     endif()
   endforeach()

-  # finish the data file for the init file
-  configure_file(
-    ${VTK_CMAKE_DIR}/vtkWrapperInit.data.in
-    ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
-    @ONLY
-    )
-
-  add_custom_command(
-    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx
-           ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}InitImpl.cxx
-    DEPENDS ${VTK_WRAP_PYTHON_INIT_EXE}
-            ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
-    COMMAND ${VTK_WRAP_PYTHON_INIT_EXE}
-            ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
-            ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx
-            ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}InitImpl.cxx
-    COMMENT "Python Wrapping - generating ${TARGET}Init.cxx"
-    VERBATIM
-    )
-
-  # Create the Init File
-  set(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TARGET}InitImpl.cxx)
-
-endmacro()
+  # Delegate to vtk_wrap_python3
+  vtk_wrap_python3(${TARGET} ${SRC_LIST_NAME} "${headers_to_wrap}")
+endmacro()


use correct project name

use correct project name

--- CMakeExternals/GLUT.cmake
+++ CMakeExternals/GLUT.cmake
@@ -21,7 +21,7 @@
       mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")
       get_filename_component(GLUT_DIR ${GLUT_LIBRARY} PATH)
     else()
-      set(patch_cmd ${CMAKE_COMMAND} -Dproj:STRING=${proj} -Dproj_target:STRING=GLUT -P ${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake)
+      set(patch_cmd ${CMAKE_COMMAND} -Dproj:STRING=${proj} -Dproj_target:STRING=freeglut -P ${CMAKE_CURRENT_LIST_DIR}/GenerateDefaultCMakeBuildSystem.cmake)

       ExternalProject_Add(${proj}
          SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src


update cotire to 1.8.0

update cotire to 1.8.0

--- CMakeModules/cotire.cmake
+++ CMakeModules/cotire.cmake
@@ -3,7 +3,7 @@
 # See the cotire manual for usage hints.
 #
 #=============================================================================
-# Copyright 2012-2016 Sascha Kratky
+# Copyright 2012-2018 Sascha Kratky
 #
 # Permission is hereby granted, free of charge, to any person
 # obtaining a copy of this software and associated documentation
@@ -43,7 +43,7 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")
+set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")

 # activate select policies
 if (POLICY CMP0025)
@@ -104,6 +104,11 @@
 if (POLICY CMP0054)
 	# only interpret if() arguments as variables or keywords when unquoted
 	cmake_policy(SET CMP0054 NEW)
+endif()
+
+if (POLICY CMP0055)
+	# strict checking for break() command
+	cmake_policy(SET CMP0055 NEW)
 endif()

 include(CMakeParseArguments)
@@ -234,7 +239,13 @@
 				# add to excluded sources, if file has custom compile flags
 				list (APPEND _excludedSourceFiles "${_sourceFile}")
 			else()
-				list (APPEND _sourceFiles "${_sourceFile}")
+				get_source_file_property(_sourceCompileOptions "${_sourceFile}" COMPILE_OPTIONS)
+				if (_sourceCompileOptions)
+					# add to excluded sources, if file has list of custom compile options
+					list (APPEND _excludedSourceFiles "${_sourceFile}")
+				else()
+					list (APPEND _sourceFiles "${_sourceFile}")
+				endif()
 			endif()
 		endif()
 	endforeach()
@@ -293,7 +304,7 @@
 	set (${_valuesVar} ${_values} PARENT_SCOPE)
 endfunction()

-function (cotire_resolve_config_properites _configurations _propertiesVar)
+function (cotire_resolve_config_properties _configurations _propertiesVar)
 	set (_properties "")
 	foreach (_property ${ARGN})
 		if ("${_property}" MATCHES "<CONFIG>")
@@ -309,8 +320,8 @@
 	set (${_propertiesVar} ${_properties} PARENT_SCOPE)
 endfunction()

-function (cotire_copy_set_properites _configurations _type _source _target)
-	cotire_resolve_config_properites("${_configurations}" _properties ${ARGN})
+function (cotire_copy_set_properties _configurations _type _source _target)
+	cotire_resolve_config_properties("${_configurations}" _properties ${ARGN})
 	foreach (_property ${_properties})
 		get_property(_isSet ${_type} ${_source} PROPERTY ${_property} SET)
 		if (_isSet)
@@ -320,13 +331,18 @@
 	endforeach()
 endfunction()

-function (cotire_get_target_usage_requirements _target _targetRequirementsVar)
+function (cotire_get_target_usage_requirements _target _config _targetRequirementsVar)
 	set (_targetRequirements "")
 	get_target_property(_librariesToProcess ${_target} LINK_LIBRARIES)
 	while (_librariesToProcess)
 		# remove from head
 		list (GET _librariesToProcess 0 _library)
 		list (REMOVE_AT _librariesToProcess 0)
+		if (_library MATCHES "^\\$<\\$<CONFIG:${_config}>:([A-Za-z0-9_:-]+)>$")
+			set (_library "${CMAKE_MATCH_1}")
+		elseif (_config STREQUAL "None" AND _library MATCHES "^\\$<\\$<CONFIG:>:([A-Za-z0-9_:-]+)>$")
+			set (_library "${CMAKE_MATCH_1}")
+		endif()
 		if (TARGET ${_library})
 			list (FIND _targetRequirements ${_library} _index)
 			if (_index LESS 0)
@@ -441,7 +457,7 @@
 	# interface compile options from linked library targets
 	if (_target)
 		set (_linkedTargets "")
-		cotire_get_target_usage_requirements(${_target} _linkedTargets)
+		cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
 		foreach (_linkedTarget ${_linkedTargets})
 			get_target_property(_targetOptions ${_linkedTarget} INTERFACE_COMPILE_OPTIONS)
 			if (_targetOptions)
@@ -573,7 +589,7 @@
 	# interface include directories from linked library targets
 	if (_target)
 		set (_linkedTargets "")
-		cotire_get_target_usage_requirements(${_target} _linkedTargets)
+		cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
 		foreach (_linkedTarget ${_linkedTargets})
 			get_target_property(_linkedTargetType ${_linkedTarget} TYPE)
 			if (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE AND NOT CMAKE_VERSION VERSION_LESS "3.4.0" AND
@@ -627,7 +643,7 @@
 	if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
 		list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
 	endif()
-	if (WIN32)
+	if (WIN32 AND NOT MINGW)
 		# convert Windows paths in include directories to CMake paths
 		if (_includeDirs)
 			set (_paths "")
@@ -703,7 +719,7 @@
 	endif()
 	# interface compile definitions from linked library targets
 	set (_linkedTargets "")
-	cotire_get_target_usage_requirements(${_target} _linkedTargets)
+	cotire_get_target_usage_requirements(${_target} ${_config} _linkedTargets)
 	foreach (_linkedTarget ${_linkedTargets})
 		get_target_property(_definitions ${_linkedTarget} INTERFACE_COMPILE_DEFINITIONS)
 		if (_definitions)
@@ -711,7 +727,7 @@
 		endif()
 	endforeach()
 	# parse additional compile definitions from target compile flags
-	# and don't look at directory compile definitions, which we already handled
+	# and do not look at directory compile definitions, which we already handled
 	set (_targetFlags "")
 	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
 	cotire_filter_compile_flags("${_language}" "D" _definitions _ignore ${_targetFlags})
@@ -859,6 +875,9 @@
 		list (APPEND ${_cmdVar} "--warn-uninitialized")
 	endif()
 	list (APPEND ${_cmdVar} "-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>")
+	if (XCODE)
+		list (APPEND ${_cmdVar} "-DXCODE:BOOL=TRUE")
+	endif()
 	if (COTIRE_VERBOSE)
 		list (APPEND ${_cmdVar} "-DCOTIRE_VERBOSE:BOOL=ON")
 	elseif("${CMAKE_GENERATOR}" MATCHES "Makefiles")
@@ -875,6 +894,9 @@
 	endif()
 	if (NOT _compilerArg1)
 		set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
+	endif()
+	if (WIN32)
+		file (TO_NATIVE_PATH "${_compilerExe}" _compilerExe)
 	endif()
 	string (STRIP "${_compilerArg1}" _compilerArg1)
 	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
@@ -902,16 +924,16 @@
 		foreach (_include ${_includeDirs})
 			if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
 				file (TO_NATIVE_PATH "${_include}" _include)
-				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+				list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 			else()
 				set (_index -1)
 				if ("${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" MATCHES ".+")
 					list (FIND ${_systemIncludesVar} "${_include}" _index)
 				endif()
 				if (_index GREATER -1)
-					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${_include}")
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 				else()
-					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_SEP_${_language}}${_include}")
 				endif()
 			endif()
 		endforeach()
@@ -1070,12 +1092,11 @@

 macro (cotire_parse_line _line _headerFileVar _headerDepthVar)
 	if (MSVC)
-		# cl.exe /showIncludes output looks different depending on the language pack used, e.g.:
+		# cl.exe /showIncludes produces different output, depending on the language pack used, e.g.:
 		# English: "Note: including file:   C:\directory\file"
 		# German: "Hinweis: Einlesen der Datei:   C:\directory\file"
 		# We use a very general regular expression, relying on the presence of the : characters
 		if (_line MATCHES "( +)([a-zA-Z]:[^:]+)$")
-			# Visual Studio compiler output
 			string (LENGTH "${CMAKE_MATCH_1}" ${_headerDepthVar})
 			get_filename_component(${_headerFileVar} "${CMAKE_MATCH_2}" ABSOLUTE)
 		else()
@@ -1233,11 +1254,19 @@
 		set (${_includesVar} "" PARENT_SCOPE)
 		return()
 	endif()
-	list (APPEND _cmd ${_existingSourceFiles})
+	# add source files to be scanned
+	if (WIN32)
+		foreach (_sourceFile ${_existingSourceFiles})
+			file (TO_NATIVE_PATH "${_sourceFile}" _sourceFileNative)
+			list (APPEND _cmd "${_sourceFileNative}")
+		endforeach()
+	else()
+		list (APPEND _cmd ${_existingSourceFiles})
+	endif()
 	if (COTIRE_VERBOSE)
 		message (STATUS "execute_process: ${_cmd}")
 	endif()
-	if (_option_COMPILER_ID MATCHES "MSVC")
+	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
 		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
 		unset (ENV{VS_UNICODE_OUTPUT})
 	endif()
@@ -1473,11 +1502,16 @@
 	if (_unparsedLines)
 		if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
 			list (LENGTH _unparsedLines _skippedLineCount)
-			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
+			if (WIN32)
+				file (TO_NATIVE_PATH "${_unparsedLinesFile}" _unparsedLinesLogPath)
+			else()
+				set (_unparsedLinesLogPath "${_unparsedLinesFile}")
+			endif()
+			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesLogPath}")
 		endif()
 		string (REPLACE ";" "\n" _unparsedLines "${_unparsedLines}")
 	endif()
-	file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}")
+	file (WRITE "${_unparsedLinesFile}" "${_unparsedLines}\n")
 endfunction()

 function (cotire_add_makedep_flags _language _compilerID _compilerVersion _flagsVar)
@@ -1507,7 +1541,7 @@
 			# append to list
 			list (APPEND _flags -H -E)
 			if (NOT "${_compilerVersion}" VERSION_LESS "4.3.0")
-				list (APPEND _flags "-fdirectives-only")
+				list (APPEND _flags -fdirectives-only)
 			endif()
 		else()
 			# return as a flag string
@@ -1517,16 +1551,36 @@
 			endif()
 		endif()
 	elseif (_compilerID MATCHES "Clang")
-		# Clang options used
-		# -H print the name of each header file used
-		# -E invoke preprocessor
-		# -fno-color-diagnostics don't prints diagnostics in color
-		if (_flags)
-			# append to list
-			list (APPEND _flags -H -E -fno-color-diagnostics)
-		else()
-			# return as a flag string
-			set (_flags "-H -E -fno-color-diagnostics")
+		if (UNIX)
+			# Clang options used
+			# -H print the name of each header file used
+			# -E invoke preprocessor
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			if (_flags)
+				# append to list
+				list (APPEND _flags -H -E -fno-color-diagnostics -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "-H -E -fno-color-diagnostics -Xclang -Eonly")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			# /EP preprocess to stdout without #line directives
+			# -H print the name of each header file used
+			# -fno-color-diagnostics do not print diagnostics in color
+			# -Eonly just run preprocessor, no output
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}" /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly)
+			else()
+				# return as a flag string
+				set (_flags "${_sourceFileType${_language}} /EP -fno-color-diagnostics -Xclang -H -Xclang -Eonly")
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1600,8 +1654,8 @@
 				set (_flags "${_flags} /Zm${COTIRE_PCH_MEMORY_SCALING_FACTOR}")
 			endif()
 		endif()
-	elseif (_compilerID MATCHES "GNU|Clang")
-		# GCC / Clang options used
+	elseif (_compilerID MATCHES "GNU")
+		# GCC options used
 		# -x specify the source language
 		# -c compile but do not link
 		# -o place output in file
@@ -1611,10 +1665,51 @@
 		set (_xLanguage_CXX "c++-header")
 		if (_flags)
 			# append to list
-			list (APPEND _flags "-x" "${_xLanguage_${_language}}" "-c" "${_prefixFile}" -o "${_pchFile}")
+			list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
 		else()
 			# return as a flag string
 			set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+		endif()
+	elseif (_compilerID MATCHES "Clang")
+		if (UNIX)
+			# Clang options used
+			# -x specify the source language
+			# -c compile but do not link
+			# -o place output in file
+			# -fno-pch-timestamp disable inclusion of timestamp in precompiled headers (clang 4.0.0+)
+			set (_xLanguage_C "c-header")
+			set (_xLanguage_CXX "c++-header")
+			if (_flags)
+				# append to list
+				list (APPEND _flags -x "${_xLanguage_${_language}}" -c "${_prefixFile}" -o "${_pchFile}")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					list (APPEND _flags -Xclang -fno-pch-timestamp)
+				endif()
+			else()
+				# return as a flag string
+				set (_flags "-x ${_xLanguage_${_language}} -c \"${_prefixFile}\" -o \"${_pchFile}\"")
+				if (NOT "${_compilerVersion}" VERSION_LESS "4.0.0")
+					set (_flags "${_flags} -Xclang -fno-pch-timestamp")
+				endif()
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /Yc creates a precompiled header file
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			# /Zs syntax check only
+			# /TC treat all files named on the command line as C source files
+			# /TP treat all files named on the command line as C++ source files
+			set (_sourceFileTypeC "/TC")
+			set (_sourceFileTypeCXX "/TP")
+			if (_flags)
+				# append to list
+				list (APPEND _flags "${_sourceFileType${_language}}"
+						"/Yc${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}" /Zs "${_hostFile}")
+			else()
+				# return as a flag string
+				set (_flags "/Yc\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1657,20 +1752,28 @@
 			get_filename_component(_pchName "${_pchFile}" NAME)
 			set (_xLanguage_C "c-header")
 			set (_xLanguage_CXX "c++-header")
+			set (_pchSuppressMessages FALSE)
+			if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+				set(_pchSuppressMessages TRUE)
+			endif()
 			if (_flags)
 				# append to list
 				if ("${_language}" STREQUAL "CXX")
 					list (APPEND _flags -Kc++)
 				endif()
-				list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-create" "${_pchName}" "-fsyntax-only" "${_hostFile}")
+				list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-create "${_pchName}" -fsyntax-only "${_hostFile}")
 				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-					list (APPEND _flags "-Wpch-messages")
+					if (NOT _pchSuppressMessages)
+						list (APPEND _flags -Wpch-messages)
+					endif()
 				endif()
 			else()
 				# return as a flag string
 				set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-create \"${_pchName}\"")
 				if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-					set (_flags "${_flags} -Wpch-messages")
+					if (NOT _pchSuppressMessages)
+						set (_flags "${_flags} -Wpch-messages")
+					endif()
 				endif()
 			endif()
 		endif()
@@ -1721,23 +1824,46 @@
 		# note: ccache requires the -include flag to be used in order to process precompiled header correctly
 		if (_flags)
 			# append to list
-			list (APPEND _flags "-Winvalid-pch" "-include" "${_prefixFile}")
+			list (APPEND _flags -Winvalid-pch -include "${_prefixFile}")
 		else()
 			# return as a flag string
 			set (_flags "-Winvalid-pch -include \"${_prefixFile}\"")
 		endif()
 	elseif (_compilerID MATCHES "Clang")
-		# Clang options used
-		# -include process include file as the first line of the primary source file
-		# -include-pch include precompiled header file
-		# -Qunused-arguments don't emit warning for unused driver arguments
-		# note: ccache requires the -include flag to be used in order to process precompiled header correctly
-		if (_flags)
-			# append to list
-			list (APPEND _flags "-Qunused-arguments" "-include" "${_prefixFile}")
-		else()
-			# return as a flag string
-			set (_flags "-Qunused-arguments -include \"${_prefixFile}\"")
+		if (UNIX)
+			# Clang options used
+			# -include process include file as the first line of the primary source file
+			# note: ccache requires the -include flag to be used in order to process precompiled header correctly
+			if (_flags)
+				# append to list
+				list (APPEND _flags -include "${_prefixFile}")
+			else()
+				# return as a flag string
+				set (_flags "-include \"${_prefixFile}\"")
+			endif()
+		elseif (WIN32)
+			# Clang-cl.exe options used
+			# /Yu uses a precompiled header file during build
+			# /Fp specifies precompiled header binary file name
+			# /FI forces inclusion of file
+			if (_pchFile)
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/Yu${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "/Yu\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+				endif()
+			else()
+				# no precompiled header, force inclusion of prefix header
+				if (_flags)
+					# append to list
+					list (APPEND _flags "/FI${_prefixFile}")
+				else()
+					# return as a flag string
+					set (_flags "/FI\"${_prefixFile}\"")
+				endif()
+			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
 		if (WIN32)
@@ -1781,24 +1907,32 @@
 			if (_pchFile)
 				get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
 				get_filename_component(_pchName "${_pchFile}" NAME)
+				set (_pchSuppressMessages FALSE)
+				if ("${CMAKE_${_language}_FLAGS}" MATCHES ".*-Wno-pch-messages.*")
+					set(_pchSuppressMessages TRUE)
+				endif()
 				if (_flags)
 					# append to list
-					list (APPEND _flags "-include" "${_prefixFile}" "-pch-dir" "${_pchDir}" "-pch-use" "${_pchName}")
+					list (APPEND _flags -include "${_prefixFile}" -pch-dir "${_pchDir}" -pch-use "${_pchName}")
 					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-						list (APPEND _flags "-Wpch-messages")
+						if (NOT _pchSuppressMessages)
+							list (APPEND _flags -Wpch-messages)
+						endif()
 					endif()
 				else()
 					# return as a flag string
 					set (_flags "-include \"${_prefixFile}\" -pch-dir \"${_pchDir}\" -pch-use \"${_pchName}\"")
 					if (NOT "${_compilerVersion}" VERSION_LESS "13.1.0")
-						set (_flags "${_flags} -Wpch-messages")
+						if (NOT _pchSuppressMessages)
+							set (_flags "${_flags} -Wpch-messages")
+						endif()
 					endif()
 				endif()
 			else()
 				# no precompiled header, force inclusion of prefix header
 				if (_flags)
 					# append to list
-					list (APPEND _flags "-include" "${_prefixFile}")
+					list (APPEND _flags -include "${_prefixFile}")
 				else()
 					# return as a flag string
 					set (_flags "-include \"${_prefixFile}\"")
@@ -1836,9 +1970,17 @@
 	if (COTIRE_VERBOSE)
 		message (STATUS "execute_process: ${_cmd}")
 	endif()
-	if (_option_COMPILER_ID MATCHES "MSVC")
+	if (MSVC_IDE OR _option_COMPILER_ID MATCHES "MSVC")
 		# cl.exe messes with the output streams unless the environment variable VS_UNICODE_OUTPUT is cleared
 		unset (ENV{VS_UNICODE_OUTPUT})
+	elseif (_option_COMPILER_ID MATCHES "Clang" AND _option_COMPILER_VERSION VERSION_LESS "4.0.0")
+		if (_option_COMPILER_LAUNCHER MATCHES "ccache" OR
+			_option_COMPILER_EXECUTABLE MATCHES "ccache")
+			# Newer versions of Clang embed a compilation timestamp into the precompiled header binary,
+			# which results in "file has been modified since the precompiled header was built" errors if ccache is used.
+			# We work around the problem by disabling ccache upon pre-compiling the prefix header.
+			set (ENV{CCACHE_DISABLE} "true")
+		endif()
 	endif()
 	execute_process(
 		COMMAND ${_cmd}
@@ -1853,7 +1995,7 @@
 	set (_unsupportedCompiler
 		"Precompiled headers not supported for ${_language} compiler ${CMAKE_${_language}_COMPILER_ID}")
 	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC")
-		# supported since Visual Studio C++ 6.0
+		# PCH supported since Visual Studio C++ 6.0
 		# and CMake does not support an earlier version
 		set (${_msgVar} "" PARENT_SCOPE)
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "GNU")
@@ -1864,8 +2006,16 @@
 			set (${_msgVar} "" PARENT_SCOPE)
 		endif()
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Clang")
-		# all Clang versions have PCH support
-		set (${_msgVar} "" PARENT_SCOPE)
+		if (UNIX)
+			# all Unix Clang versions have PCH support
+			set (${_msgVar} "" PARENT_SCOPE)
+		elseif (WIN32)
+			# only clang-cl is supported under Windows
+			get_filename_component(_compilerName "${CMAKE_${_language}_COMPILER}" NAME_WE)
+			if (NOT _compilerName MATCHES "cl$")
+				set (${_msgVar} "${_unsupportedCompiler} version ${CMAKE_${_language}_COMPILER_VERSION}. Use clang-cl instead." PARENT_SCOPE)
+			endif()
+		endif()
 	elseif (CMAKE_${_language}_COMPILER_ID MATCHES "Intel")
 		# Intel PCH support requires version >= 8.0.0
 		if ("${CMAKE_${_language}_COMPILER_VERSION}" VERSION_LESS "8.0.0")
@@ -1876,19 +2026,25 @@
 	else()
 		set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
 	endif()
+	# check if ccache is used as a compiler launcher
 	get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
-	if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+	if (_realCompilerExe MATCHES "ccache" OR _launcher MATCHES "ccache")
+		# verify that ccache configuration is compatible with precompiled headers
+		# always check environment variable CCACHE_SLOPPINESS, because earlier versions of ccache
+		# do not report the "sloppiness" setting correctly upon printing ccache configuration
 		if (DEFINED ENV{CCACHE_SLOPPINESS})
-			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
+			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR
+				NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
 				set (${_msgVar}
 					"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
 					PARENT_SCOPE)
 			endif()
 		else()
-			if (_launcher MATCHES "ccache")
-				get_filename_component(_ccacheExe "${_launcher}" REALPATH)
+			if (_realCompilerExe MATCHES "ccache")
+				set (_ccacheExe "${_realCompilerExe}")
 			else()
-				get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+				set (_ccacheExe "${_launcher}")
 			endif()
 			execute_process(
 				COMMAND "${_ccacheExe}" "--print-config"
@@ -1896,9 +2052,10 @@
 				RESULT_VARIABLE _result
 				OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
 				ERROR_QUIET)
-			if (_result OR NOT
-				_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
-				_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
+			if (_result)
+				set (${_msgVar} "ccache configuration cannot be determined." PARENT_SCOPE)
+			elseif (NOT _ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR
+				NOT _ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
 				set (${_msgVar}
 					"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
 					PARENT_SCOPE)
@@ -2191,7 +2348,7 @@
 		XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
 		CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
 		CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
-		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
+		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_SEP_${_language}
 		CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
 		CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
 		CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
@@ -2224,8 +2381,9 @@

 function (cotire_setup_pch_file_compilation _language _target _targetScript _prefixFile _pchFile _hostFile)
 	set (_sourceFiles ${ARGN})
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-		# for Visual Studio and Intel, we attach the precompiled header compilation to the host file
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and Clang-cl, we attach the precompiled header compilation to the host file
 		# the remaining files include the precompiled header, see cotire_setup_pch_file_inclusion
 		if (_sourceFiles)
 			set (_flags "")
@@ -2270,8 +2428,9 @@
 endfunction()

 function (cotire_setup_pch_file_inclusion _language _target _wholeTarget _prefixFile _pchFile _hostFile)
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-		# for Visual Studio and Intel, we include the precompiled header in all but the host file
+	if (CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" OR
+		(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+		# for MSVC, Intel and clang-cl, we include the precompiled header in all but the host file
 		# the host file does the precompiled header compilation, see cotire_setup_pch_file_compilation
 		set (_sourceFiles ${ARGN})
 		list (LENGTH _sourceFiles _numberOfSourceFiles)
@@ -2417,9 +2576,10 @@
 		# if this is a single-language target without any excluded files
 		if (_wholeTarget)
 			set (_language "${_languages}")
-			# for Visual Studio and Intel, precompiled header inclusion is always done on the source file level
+			# for MSVC, Intel and clang-cl, precompiled header inclusion is always done on the source file level
 			# see cotire_setup_pch_file_inclusion
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
 				get_property(_prefixFile TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER)
 				if (_prefixFile)
 					get_property(_pchFile TARGET ${_target} PROPERTY COTIRE_${_language}_PRECOMPILED_HEADER)
@@ -2454,7 +2614,8 @@
 			set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_objectDependsPaths})
 		endif()
 		if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-			# unity file compilation results in potentially huge object file, thus use /bigobj by default unter MSVC and Windows Intel
+			# unity file compilation results in potentially huge object file,
+			# thus use /bigobj by default unter cl.exe and Windows Intel
 			set_property (SOURCE "${_unityFile}" APPEND_STRING PROPERTY COMPILE_FLAGS "/bigobj")
 		endif()
 		cotire_set_cmd_to_prologue(_unityCmd)
@@ -2659,6 +2820,9 @@
 			set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build ${_excludedStr}.")
 		else()
 			set (_targetMsg "${_languagesStr} target ${_target} cotired without unity build.")
+		endif()
+		if (_disableMsg)
+			set (_targetMsg "${_targetMsg} ${_disableMsg}")
 		endif()
 	else()
 		if (_excludedStr)
@@ -2749,6 +2913,20 @@
 			set (_targetUsePCH FALSE)
 		endif()
 	endif()
+	if (_targetAddSCU)
+		# disable unity builds if automatic Qt processing is used
+		get_target_property(_targetAutoMoc ${_target} AUTOMOC)
+		get_target_property(_targetAutoUic ${_target} AUTOUIC)
+		get_target_property(_targetAutoRcc ${_target} AUTORCC)
+		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+			if (_disableMsg)
+				set (_disableMsg "${_disableMsg} Target uses automatic CMake Qt processing.")
+			else()
+				set (_disableMsg "Target uses automatic CMake Qt processing.")
+			endif()
+			set (_targetAddSCU FALSE)
+		endif()
+	endif()
 	set_property(TARGET ${_target} PROPERTY COTIRE_ENABLE_PRECOMPILED_HEADER ${_targetUsePCH})
 	set_property(TARGET ${_target} PROPERTY COTIRE_ADD_UNITY_BUILD ${_targetAddSCU})
 	cotire_make_target_message(${_target} "${_targetLanguages}" "${_disableMsg}" _targetMsg ${_allExcludedSourceFiles})
@@ -2776,7 +2954,11 @@
 	set (_sourceFiles ${ARGN})
 	get_target_property(_maxIncludes ${_target} COTIRE_UNITY_SOURCE_MAXIMUM_NUMBER_OF_INCLUDES)
 	if (_maxIncludes MATCHES "(-j|--parallel|--jobs) ?([0-9]*)")
-		set (_numberOfThreads "${CMAKE_MATCH_2}")
+		if (DEFINED CMAKE_MATCH_2)
+			set (_numberOfThreads "${CMAKE_MATCH_2}")
+		else()
+			set (_numberOfThreads "")
+		endif()
 		if (NOT _numberOfThreads)
 			# use all available cores
 			ProcessorCount(_numberOfThreads)
@@ -2889,8 +3071,9 @@
 		set (_dependsFiles "")
 		foreach (_language ${_languages})
 			set (_props COTIRE_${_language}_PREFIX_HEADER COTIRE_${_language}_UNITY_SOURCE)
-			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-				# Visual Studio and Intel only create precompiled header as a side effect
+			if (NOT CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel" AND NOT
+				(WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "Clang"))
+				# MSVC, Intel and clang-cl only create precompiled header as a side effect
 				list (INSERT _props 0 COTIRE_${_language}_PRECOMPILED_HEADER)
 			endif()
 			cotire_get_first_set_property_value(_dependsFile TARGET ${_target} ${_props})
@@ -2938,6 +3121,7 @@
 			list (APPEND _unityTargetSources ${_unityFiles})
 		endif()
 	endforeach()
+	# handle object libraries which are part of the target's sources
 	get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
 	if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
 		cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
@@ -2982,16 +3166,6 @@
 	# determine unity target sources
 	set (_unityTargetSources "")
 	cotire_collect_unity_target_sources(${_target} "${_languages}" _unityTargetSources)
-	# handle automatic Qt processing
-	get_target_property(_targetAutoMoc ${_target} AUTOMOC)
-	get_target_property(_targetAutoUic ${_target} AUTOUIC)
-	get_target_property(_targetAutoRcc ${_target} AUTORCC)
-	if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-		# if the original target sources are subject to CMake's automatic Qt processing,
-		# also include implicitly generated <targetname>_automoc.cpp file
-		list (APPEND _unityTargetSources "${_target}_automoc.cpp")
-		set_property (SOURCE "${_target}_automoc.cpp" PROPERTY GENERATED TRUE)
-	endif()
 	# prevent AUTOMOC, AUTOUIC and AUTORCC properties from being set when the unity target is created
 	set (CMAKE_AUTOMOC OFF)
 	set (CMAKE_AUTOUIC OFF)
@@ -3004,17 +3178,6 @@
 		add_executable(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
 	else()
 		add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
-	endif()
-	if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
-		# depend on original target's automoc target, if it exists
-		if (TARGET ${_target}_automoc)
-			add_dependencies(${_unityTargetName} ${_target}_automoc)
-		endif()
-	else()
-		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-			# depend on the original target's implicity generated <targetname>_automoc target
-			add_dependencies(${_unityTargetName} ${_target}_automoc)
-		endif()
 	endif()
 	# copy output location properties
 	set (_outputDirProperties
@@ -3027,8 +3190,8 @@
 			set (_outputDir "${COTIRE_UNITY_OUTPUT_DIRECTORY}")
 		else()
 			# append relative COTIRE_UNITY_OUTPUT_DIRECTORY to target's actual output directory
-			cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
-			cotire_resolve_config_properites("${_configurations}" _properties ${_outputDirProperties})
+			cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName} ${_outputDirProperties})
+			cotire_resolve_config_properties("${_configurations}" _properties ${_outputDirProperties})
 			foreach (_property ${_properties})
 				get_property(_outputDir TARGET ${_target} PROPERTY ${_property})
 				if (_outputDir)
@@ -3048,11 +3211,11 @@
 				RUNTIME_OUTPUT_DIRECTORY "${_outputDir}")
 		endif()
 	else()
-		cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 			${_outputDirProperties})
 	endif()
 	# copy output name
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_<CONFIG>
 		LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_<CONFIG>
 		OUTPUT_NAME OUTPUT_NAME_<CONFIG>
@@ -3060,7 +3223,7 @@
 		PREFIX <CONFIG>_POSTFIX SUFFIX
 		IMPORT_PREFIX IMPORT_SUFFIX)
 	# copy compile stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		COMPILE_DEFINITIONS COMPILE_DEFINITIONS_<CONFIG>
 		COMPILE_FLAGS COMPILE_OPTIONS
 		Fortran_FORMAT Fortran_MODULE_DIRECTORY
@@ -3072,12 +3235,12 @@
 		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
 		C_CLANG_TIDY CXX_CLANG_TIDY)
 	# copy compile features
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
 		CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED
 		COMPILE_FEATURES)
 	# copy interface stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN
 		COMPATIBLE_INTERFACE_STRING
 		INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS
@@ -3085,8 +3248,9 @@
 		INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
 		INTERFACE_AUTOUIC_OPTIONS NO_SYSTEM_FROM_IMPORTED)
 	# copy link stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
-		BUILD_WITH_INSTALL_RPATH INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		BUILD_WITH_INSTALL_RPATH BUILD_WITH_INSTALL_NAME_DIR
+		INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH SKIP_BUILD_RPATH
 		LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED
 		LINK_FLAGS LINK_FLAGS_<CONFIG>
 		LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_<CONFIG>
@@ -3094,18 +3258,18 @@
 		LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
 		STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
 		NO_SONAME SOVERSION VERSION
-		LINK_WHAT_YOU_USE)
+		LINK_WHAT_YOU_USE BUILD_RPATH)
 	# copy cmake stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
 	# copy Apple platform specific stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		BUNDLE BUNDLE_EXTENSION FRAMEWORK FRAMEWORK_VERSION INSTALL_NAME_DIR
 		MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_RPATH
 		OSX_ARCHITECTURES OSX_ARCHITECTURES_<CONFIG> PRIVATE_HEADER PUBLIC_HEADER RESOURCE XCTEST
-		IOS_INSTALL_COMBINED)
+		IOS_INSTALL_COMBINED XCODE_EXPLICIT_FILE_TYPE XCODE_PRODUCT_TYPE)
 	# copy Windows platform specific stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		GNUtoMS
 		COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
 		COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
@@ -3119,15 +3283,19 @@
 		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
 		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
 		DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
-		VS_SDK_REFERENCES)
+		VS_SDK_REFERENCES VS_USER_PROPS VS_DEBUGGER_WORKING_DIRECTORY)
 	# copy Android platform specific stuff
-	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		ANDROID_API ANDROID_API_MIN ANDROID_GUI
 		ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES
 		ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR
 		ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES
 		ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH
 		ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE)
+	# copy CUDA platform specific stuff
+	cotire_copy_set_properties("${_configurations}" TARGET ${_target} ${_unityTargetName}
+		CUDA_PTX_COMPILATION CUDA_SEPARABLE_COMPILATION CUDA_RESOLVE_DEVICE_SYMBOLS
+		CUDA_EXTENSIONS CUDA_STANDARD CUDA_STANDARD_REQUIRED)
 	# use output name from original target
 	get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
 	if (NOT _targetOutputName)
@@ -3139,6 +3307,13 @@
 		set_property(TARGET ${_unityTargetName} PROPERTY DEFINE_SYMBOL "${_defineSymbol}")
 		if ("${_targetType}" STREQUAL "EXECUTABLE")
 			set_property(TARGET ${_unityTargetName} PROPERTY ENABLE_EXPORTS TRUE)
+		endif()
+	endif()
+	# enable parallel compilation for MSVC
+	if (MSVC AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+		list (LENGTH _unityTargetSources _numberOfUnityTargetSources)
+		if (_numberOfUnityTargetSources GREATER 1)
+			set_property(TARGET ${_unityTargetName} APPEND PROPERTY COMPILE_OPTIONS "/MP")
 		endif()
 	endif()
 	cotire_init_target(${_unityTargetName})
@@ -3297,6 +3472,13 @@
 				set_target_properties(${_unityTargetName} PROPERTIES INTERFACE_LINK_LIBRARIES "${_unityLinkInterfaceLibraries}")
 				if (COTIRE_DEBUG)
 					message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
+				endif()
+			endif()
+			get_target_property(_manualDependencies ${_target} MANUALLY_ADDED_DEPENDENCIES)
+			if (_manualDependencies)
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityManualDependencies ${_manualDependencies})
+				if (_unityManualDependencies)
+					add_dependencies("${_unityTargetName}" ${_unityManualDependencies})
 				endif()
 			endif()
 		endif()
@@ -3595,7 +3777,7 @@
 	set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm" CACHE STRING
 		"Ignore sources with the listed file extensions from the generated unity source.")

-	set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "3" CACHE STRING
+	set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2" CACHE STRING
 		"Minimum number of sources in target required to enable use of precompiled header.")

 	if (NOT DEFINED COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES_INIT)
@@ -3694,7 +3876,7 @@
 		FULL_DOCS
 			"The variable can be set to an integer > 0."
 			"If a target contains less than that number of source files, cotire will not enable the use of the precompiled header for the target."
-			"If not defined, defaults to 3."
+			"If not defined, defaults to 2."
 	)

 	define_property(


Don't prepend path, we should assume that the paths are fully-qualified

--- VeraPPUtilities.cmake
+++ VeraPPUtilities.cmake
@@ -287,7 +287,7 @@
     foreach (_verapp_target_source
              ${_verapp_profile_check_target_sources})
         list (APPEND _verapp_profile_check_target_sources_paths
-              ${CMAKE_CURRENT_SOURCE_DIR}/${_verapp_target_source})
+              ${_verapp_target_source})
     endforeach (_verapp_target_source)

     # Convert from a CMake list to a set of files


Updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -85,6 +85,31 @@
 # DLL is not found, fatal error message is printed.
 #

+#
+#   This file is part of Corrade.
+#
+#   Copyright © 2007, 2008, 2009, 2010, 2011, 2012, 2013
+#             Vladimír Vondruš <mosra@centrum.cz>
+#
+#   Permission is hereby granted, free of charge, to any person obtaining a
+#   copy of this software and associated documentation files (the "Software"),
+#   to deal in the Software without restriction, including without limitation
+#   the rights to use, copy, modify, merge, publish, distribute, sublicense,
+#   and/or sell copies of the Software, and to permit persons to whom the
+#   Software is furnished to do so, subject to the following conditions:
+#
+#   The above copyright notice and this permission notice shall be included
+#   in all copies or substantial portions of the Software.
+#
+#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+#   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+#   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+#   DEALINGS IN THE SOFTWARE.
+#
+
 # Libraries
 find_library(CORRADE_INTERCONNECT_LIBRARY CorradeInterconnect)
 find_library(CORRADE_UTILITY_LIBRARY CorradeUtility)


Merging skipped test catch for MSVC

Merging skipped test catch for MSVC

--- cmake_modules/yolo/YOLOProjectAddTestCase.cmake
+++ cmake_modules/yolo/YOLOProjectAddTestCase.cmake
@@ -2,6 +2,7 @@

 # TODO: remove this: all tests shoulld be run, if some are omitted, a warning/error should at least be printed
 if (TUDAT_SKIP_JSON_TESTS)
+    # https://github.com/tudat-team/tudat/issues/8
     set(TEST_TO_BE_SKIPPED
             test_json_Acceleration
             test_json_Aerodynamics
@@ -22,6 +23,20 @@
 else ()
     set(TEST_TO_BE_SKIPPED
             )
+endif ()
+
+if (TUDAT_SKIP_BROKEN_MSVC_CLANG_PRECISION_TESTS)
+    # https://github.com/tudat-team/tudat/issues/7
+    set(TEST_TO_BE_SKIPPED ${TEST_TO_BE_SKIPPED}
+            test_basic_astro_OrbitalElementConversions
+            test_basic_astro_TimeConversions
+            test_basic_astro_SphericalOrbitStateConversions
+            test_shape_based_HodographicShaping
+            test_orbit_determination_EstimationInput
+            test_orbit_determination_HybridArcStateEstimation
+            test_propagators_VariationalEquations
+            test_basics_TimeTypes
+            test_io_MultiArrayReader)
 endif ()