Solving svd segfault again

Solving svd segfault again

Former-commit-id: 0b2cc0e47affc1f1566a89c63097b43fb78d8e77

--- cmake-modules/Fetch_Eigen3.cmake
+++ cmake-modules/Fetch_Eigen3.cmake
@@ -21,13 +21,13 @@
         list(APPEND EIGEN3_COMPILER_FLAGS -Wno-unused-but-set-variable)
     endif()
     if(TARGET mkl)
-#        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_MKL_ALL)
-#        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_LAPACKE_STRICT)
+        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_MKL_ALL)
+        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_LAPACKE_STRICT)
         list(APPEND EIGEN3_INCLUDE_DIR ${MKL_INCLUDE_DIR})
         message(STATUS "Eigen3 will use MKL")
     else ()
-#        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_BLAS)
-#        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_LAPACKE_STRICT)
+        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_BLAS)
+        list(APPEND EIGEN3_COMPILER_FLAGS -DEIGEN_USE_LAPACKE_STRICT)
         message(STATUS "Eigen3 will use BLAS and LAPACKE")
     endif()
 endif()


added missing patch (thanks Mourad!), per #85

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

--- cmake/Modules/FindCMinpack.cmake
+++ cmake/Modules/FindCMinpack.cmake
@@ -28,5 +28,12 @@

 if(CMINPACK_FOUND)
   message(STATUS "CMinPack found (include: ${CMINPACK_INCLUDE_DIRS}, lib: ${CMINPACK_LIBRARY})")
+  if(WIN32)
+    option(CMINPACK_IS_STATIC "Set to ON if you use static cminpack library." OFF)
+    mark_as_advanced(CMINPACK_IS_STATIC)
+    if(CMINPACK_IS_STATIC)
+      add_definitions(-DCMINPACK_NO_DLL)
+    endif(CMINPACK_IS_STATIC)
+  endif(WIN32)
 endif(CMINPACK_FOUND)


CMake: improve FindHeeksCAD module

CMake: improve FindHeeksCAD module

  * Use a cleaner method to find from multiple paths
  * Add "/usr/local/share/heekscad" to searched paths: HeeksCAD now install its sources there (with default prefix: /usr/local)
  * Add "/usr/share/heekscad" to searched paths: HeeksCAD now install its sources there (with most linux distributions prefix: /usr)

--- cmake/Modules/FindHeeksCAD.cmake
+++ cmake/Modules/FindHeeksCAD.cmake
@@ -9,19 +9,18 @@
 #

 IF(NOT HeeksCAD_FOUND)
-   # Will try to find at standard locations
-   FIND_PATH(HeeksCAD_SRC_DIR src/Geom.h PATH_SUFFIXES heekscad)
+  SET( SEARCH_PATHS
+    "/usr/local/share/heekscad"
+    "/usr/share/heekscad"
+    "${CMAKE_SOURCE_DIR}/heekscad"
+    "${CMAKE_SOURCE_DIR}/.."
+    "${CMAKE_SOURCE_DIR}/../heekscad"
+  )
+
+  FIND_PATH( HeeksCAD_SRC_DIR interface/Geom.cpp PATHS ${SEARCH_PATHS} DOC "Path to HeeksCAD includes" )
+  IF( NOT HeeksCAD_SRC_DIR )
+      MESSAGE( FATAL_ERROR "Cannot find HeeksCAD sources dir." )
+  ENDIF( NOT HeeksCAD_SRC_DIR )
+
+  MESSAGE( STATUS "HeeksCAD_SRC_DIR:     " ${HeeksCAD_SRC_DIR} )
 ENDIF(NOT HeeksCAD_FOUND)
-
-MESSAGE( STATUS "HeeksCAD_SRC_DIR:     " ${HeeksCAD_SRC_DIR} )
-
-IF( HeeksCAD_SRC_DIR STREQUAL HeeksCAD_SRC_DIR-NOTFOUND )
-  # try to find at heekscad/ location then ../
-  FIND_PATH( HeeksCAD_SRC_DIR src/Geom.h PATHS "${CMAKE_SOURCE_DIR}/heekscad" "${CMAKE_SOURCE_DIR}/.." "${CMAKE_SOURCE_DIR}/../heekscad"DOC "Path to HeeksCAD includes" )
-  #FIND_PATH( HeeksCAD_SRC_DIR src/Geom.h PATHS "${CMAKE_SOURCE_DIR}/heekscad" DOC "Path to HeeksCAD includes" )
-  IF( HeeksCAD_SRC_DIR STREQUAL Geom.h-NOTFOUND )
-    MESSAGE( FATAL_ERROR "Cannot find HeeksCAD sources dir." )
-   ENDIF( HeeksCAD_SRC_DIR STREQUAL Geom.h-NOTFOUND )
-ENDIF(HeeksCAD_SRC_DIR STREQUAL HeeksCAD_SRC_DIR-NOTFOUND )
-
-MESSAGE( STATUS "HeeksCAD_SRC_DIR:     " ${HeeksCAD_SRC_DIR} )


fix the clang CUDA fast-math and show register options

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -254,11 +254,6 @@
             SET(ALPAKA_ACC_GPU_CUDA_ENABLE OFF CACHE BOOL "Enable the CUDA GPU accelerator" FORCE)

         ELSE()
-            IF(${ALPAKA_DEBUG} GREATER 1)
-                SET(CUDA_VERBOSE_BUILD ON)
-            ENDIF()
-            SET(CUDA_PROPAGATE_HOST_FLAGS ON)
-
             SET(ALPAKA_CUDA_ARCH sm_20 CACHE STRING "GPU architecture")
             STRING(COMPARE EQUAL "${ALPAKA_CUDA_ARCH}" "sm_10" IS_CUDA_ARCH_UNSUPPORTED)
             STRING(COMPARE EQUAL "${ALPAKA_CUDA_ARCH}" "sm_11" IS_CUDA_ARCH_UNSUPPORTED)
@@ -289,11 +284,12 @@
                 LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-Wno-unused-local-typedef")

                 IF(ALPAKA_CUDA_FAST_MATH)
-                    LIST(APPEND CUDA_NVCC_FLAGS "-ffp-contract=fast -ffast_math")
+                    # -ffp-contract=fast enables the usage of FMA
+                    LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-ffast-math" "-ffp-contract=fast")
                 ENDIF()

                 IF(ALPAKA_CUDA_SHOW_REGISTER)
-                    LIST(APPEND CUDA_NVCC_FLAGS "-Xcuda-ptxas=-v")
+                    LIST(APPEND _ALPAKA_COMPILE_OPTIONS_PUBLIC "-Xcuda-ptxas=-v")
                 ENDIF()

                 IF(ALPAKA_CUDA_KEEP_FILES)
@@ -301,6 +297,12 @@
                 ENDIF()

             ELSE()
+                IF(${ALPAKA_DEBUG} GREATER 1)
+                    SET(CUDA_VERBOSE_BUILD ON)
+                ENDIF()
+
+                SET(CUDA_PROPAGATE_HOST_FLAGS ON)
+
                 LIST(APPEND CUDA_NVCC_FLAGS "-arch=${ALPAKA_CUDA_ARCH}")

                 IF(NOT MSVC)


Use correct library for asan with clang

Use correct library for asan with clang

--- cmake/Saiga_compiler_flags.cmake
+++ cmake/Saiga_compiler_flags.cmake
@@ -108,7 +108,12 @@

 if(SAIGA_DEBUG_ASAN)
     if(SAIGA_CXX_CLANG OR SAIGA_CXX_GNU)
-        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -static-libasan -fno-omit-frame-pointer -g")
+        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -g")
+        if(SAIGA_CXX_CLANG)
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libsan")
+        else()
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libasan")
+        endif()
     else()
         message(FATAL_ERROR "ASAN not supported for your compiler.")
     endif()


cosmetic fixes

cosmetic fixes

tabs to spaces

--- cmake/UseDOImageProcessing.cmake
+++ cmake/UseDOImageProcessing.cmake
@@ -15,29 +15,29 @@
   set(DO_ImageProcessing_HEADER_FILES
       ${DO_ImageProcessing_MASTER_HEADER}
       ${DO_ImageProcessing_HEADER_FILES})
-
-	# Custom library project organization.
-	source_group("0. Master Header File" FILES
-							 ${DO_ImageProcessing_MASTER_HEADER})
-	source_group("1. Linear Filtering" FILES
-							 ${DO_ImageProcessing_SOURCE_DIR}/LinearFiltering.hpp)
-	source_group("2. Deriche IIR Filters" FILES
-							 ${DO_ImageProcessing_SOURCE_DIR}/Deriche.hpp)
-	source_group("3. Differential Calculus, ..." FILES
-							 ${DO_ImageProcessing_SOURCE_DIR}/Differential.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/Determinant.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/Norm.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/Orientation.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/SecondMomentMatrix.hpp)
-	source_group("4. Interpolation" FILES
-							 ${DO_ImageProcessing_SOURCE_DIR}/Interpolation.hpp)
-	source_group("5. Reduce, Enlarge, Warp..." FILES
-							 ${DO_ImageProcessing_SOURCE_DIR}/Scaling.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/Warp.hpp)
-	source_group("6. Gaussian Scale-Space" FILES
-							 ${DO_ImageProcessing_SOURCE_DIR}/ImagePyramid.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/DoG.hpp
-							 ${DO_ImageProcessing_SOURCE_DIR}/Extrema.hpp)
+
+  # Custom library project organization.
+  source_group("0. Master Header File" FILES
+               ${DO_ImageProcessing_MASTER_HEADER})
+  source_group("1. Linear Filtering" FILES
+               ${DO_ImageProcessing_SOURCE_DIR}/LinearFiltering.hpp)
+  source_group("2. Deriche IIR Filters" FILES
+               ${DO_ImageProcessing_SOURCE_DIR}/Deriche.hpp)
+  source_group("3. Differential Calculus, ..." FILES
+               ${DO_ImageProcessing_SOURCE_DIR}/Differential.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/Determinant.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/Norm.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/Orientation.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/SecondMomentMatrix.hpp)
+  source_group("4. Interpolation" FILES
+               ${DO_ImageProcessing_SOURCE_DIR}/Interpolation.hpp)
+  source_group("5. Reduce, Enlarge, Warp..." FILES
+               ${DO_ImageProcessing_SOURCE_DIR}/Scaling.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/Warp.hpp)
+  source_group("6. Gaussian Scale-Space" FILES
+               ${DO_ImageProcessing_SOURCE_DIR}/ImagePyramid.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/DoG.hpp
+               ${DO_ImageProcessing_SOURCE_DIR}/Extrema.hpp)
 endmacro (do_list_imageprocessing_source_files)

 macro (do_load_packages_for_imageprocessing_library)


px4_impl_nuttx:PX4 does not used compressed defconfigs nor configure.sh

   The new upstream nuttx defconfig format is compressed. This
   will not work well for board configs that are out of the
   upstream NuttX tree.

   The reconstitution step will not replace all the non default
   settings. I.E. CONFIG_ARCH_BOARD_PX4xxxx and will remove
   setting that are not defined from the config/KConfig. Like
   CONFIG_ARCH_BOARD_PX4xxxx=y.

   Also the configure script will fail if run without
   and intervening make distclean

   The only 2 steps from configure that re needed are
   Copying the defconfig to .config and Make.defs

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -319,7 +319,8 @@
 	add_custom_command(OUTPUT ${nuttx_configure_stamp} ${nuttx_build_src}/nuttx/.config
 		COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/*.mk ${nuttx_build_src}/nuttx/
 		COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_build_src}/nuttx/configs
-		COMMAND cd ${nuttx_build_src}/nuttx/tools && sh configure.sh ${CONFIG}/${config_nuttx_config}
+		COMMAND ${CP} ${nuttx_build_src}/nuttx/configs/${CONFIG}/${config_nuttx_config}/defconfig ${nuttx_build_src}/nuttx/.config
+		COMMAND ${CP} ${nuttx_build_src}/nuttx/configs/${CONFIG}/${config_nuttx_config}/Make.defs ${nuttx_build_src}/nuttx/
 		COMMAND cmake -E touch ${nuttx_configure_stamp}
 		DEPENDS nuttx_patch_${CONFIG} ${nuttx-configs}
 		WORKING_DIRECTORY ${PX4_BINARY_DIR}


reverted an accidental commit to the FindGraphviz cmake module

--- cmake_modules/FindGraphviz.cmake
+++ cmake_modules/FindGraphviz.cmake
@@ -65,8 +65,6 @@
 IF (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY)
    SET(GRAPHVIZ_FOUND TRUE)
    SET(GRAPHVIZ_LIBRARIES "${GRAPHVIZ_LIBRARY}" "${GVC_LIBRARY}" "${CDT_LIBRARY}" "${PATHPLAN_LIBRARY}")
-   IF(Z_LIBRARY)
-   ENDIF(Z_LIBRARY)

    SET(GRAPHVIZ_INCLUDE_DIRS "${GRAPHVIZ_INCLUDE}")
 ELSE (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY)
@@ -74,16 +72,21 @@
 ENDIF (GRAPHVIZ_INCLUDE AND GRAPHVIZ_LIBRARY AND GVC_LIBRARY AND CDT_LIBRARY AND PATHPLAN_LIBRARY)

 IF (GRAPHVIZ_FOUND)
-  IF (EXPAT_LIBRARY OR WIN32)
+  IF (EXPAT_LIBRARY)
     LIST(APPEND GRAPHVIZ_LIBRARIES "${EXPAT_LIBRARY}")
-  ELSE (EXPAT_LIBRARY OR WIN32)
-    SET(GRAPHVIZ_FOUND FALSE)
-  ENDIF (EXPAT_LIBRARY OR WIN32)
-  IF (EXPAT_LIBRARY OR WIN32)
+  ELSE (EXPAT_LIBRARY)
+    IF(NOT WIN32)
+      SET(GRAPHVIZ_FOUND FALSE)
+    ENDIF(NOT WIN32)
+  ENDIF (EXPAT_LIBRARY)
+
+  IF (Z_LIBRARY)
      LIST(APPEND GRAPHVIZ_LIBRARIES "${Z_LIBRARY}")
-  ELSE (EXPAT_LIBRARY OR WIN32)
-    SET(GRAPHVIZ_FOUND FALSE)
-  ENDIF (EXPAT_LIBRARY OR WIN32)
+  ELSE (Z_LIBRARY)
+    IF(NOT WIN32)
+      SET(GRAPHVIZ_FOUND FALSE)
+    ENDIF(NOT WIN32)
+  ENDIF (Z_LIBRARY)
 ENDIF (GRAPHVIZ_FOUND)

 IF(GRAPHVIZ_FOUND)


GCC Cross compile: check for required variables

--- compiler/gcc-cross-compile.cmake
+++ compiler/gcc-cross-compile.cmake
@@ -10,8 +10,6 @@
 #   CROSS_COMPILE_SYSROOT=/path/to/sysroot [optional]
 # ------------------------------------------------------------------------------

-cmake_minimum_required( VERSION 2.8 )
-
 if(DEFINED POLLY_COMPILER_GCC_CROSS_COMPILE)
   return()
 else()
@@ -22,12 +20,37 @@
   # touch toolchain variable to suppress "unused variable" warning
 endif()

+string(COMPARE EQUAL
+    "${CROSS_COMPILE_TOOLCHAIN_PATH}"
+    ""
+    _is_empty_cross_compile_toolchain_path
+)
+if(_is_empty_cross_compile_toolchain_path)
+  poly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PATH not set. Set it to the absolute path of the \"bin\" directory for the toolchain")
+endif()
+
+string(COMPARE EQUAL
+    "${CROSS_COMPILE_TOOLCHAIN_PREFIX}"
+    ""
+    _is_empty_cross_compile_toolchain_prefix
+)
+if(_is_empty_cross_compile_toolchain_prefix)
+  poly_fatal_error("CROSS_COMPILE_TOOLCHAIN_PREFIX not set. Set it to the triplet of the toolchain")
+endif()
+
+
 #Check for if sysroot exists, optional, since it could be hardcoded in the compiler
 string(COMPARE NOTEQUAL "${CROSS_COMPILE_SYSROOT}" "" _has_sysroot)
 if (_has_sysroot)
   set(SYSROOT_COMPILE_FLAG "--sysroot=${CROSS_COMPILE_SYSROOT}")
-  set(CMAKE_C_FLAGS        "${CMAKE_C_FLAGS} ${SYSROOT_COMPILE_FLAG}")
-  set(CMAKE_CXX_FLAGS      "${CMAKE_CXX_FLAGS} ${SYSROOT_COMPILE_FLAG}")
+  polly_add_cache_flag(
+      CMAKE_C_FLAGS
+      "${CMAKE_C_FLAGS} ${SYSROOT_COMPILE_FLAG}"
+  )
+  polly_add_cache_flag(
+      CMAKE_CXX_FLAGS
+      "${CMAKE_CXX_FLAGS} ${SYSROOT_COMPILE_FLAG}"
+  )
 endif()

 # The (...)_PREFIX variable name refers to the Cross Compiler Triplet


CMake: AndroidMacros: correct library variables

--- CMake/Utils/AndroidMacros.cmake
+++ CMake/Utils/AndroidMacros.cmake
@@ -59,7 +59,7 @@
 	endif()

 	if(OGRE_CONFIG_ENABLE_FREEIMAGE)
-	    add_static_libs_from_paths(${FreeImage_LIBRARY_REL})
+	    add_static_libs_from_paths(${FreeImage_LIBRARIES})
     endif()

     if(OGRE_USE_BOOST)
@@ -67,7 +67,7 @@
 	   add_static_libs_from_paths(${Boost_LIBRARIES})
     endif()

-    add_static_libs_from_paths(${OIS_LIBRARY_REL} ${FREETYPE_LIBRARY_REL} ${ZZip_LIBRARY_REL})
+    add_static_libs_from_paths(${OIS_LIBRARIES} ${FREETYPE_LIBRARIES} ${ZZip_LIBRARIES})

     if(APPLE OR WIN32)
       SET(ANDROID_EXECUTABLE "android")


ENH: Temporary hack for access to zlib.h.

--- GenerateVTKConfig.cmake
+++ GenerateVTKConfig.cmake
@@ -85,7 +85,8 @@
   ${VTK_SOURCE_DIR}/Imaging
   ${VTK_SOURCE_DIR}/Graphics
   ${VTK_SOURCE_DIR}/Filtering
-  ${VTK_SOURCE_DIR}/Common)
+  ${VTK_SOURCE_DIR}/Common
+  ${VTK_SOURCE_DIR}/Utilities/zlib)

 # Add the system include directories last.
 SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})


Update win32 toolchain

Update win32 toolchain

--- toolchains/win32.cmake
+++ toolchains/win32.cmake
@@ -7,7 +7,6 @@
 set(ENV{PKG_CONFIG_PATH} ${toolchain_lib_dir}/pkgconfig:${toolchain_dir}/share/pkgconfig)
 set(CMAKE_PREFIX_PATH ${toolchain_dir})

-set(inc_flags "-I/usr/local/i686-w64-mingw32/include -B/usr/local/lib/gcc/i686-w64-mingw32/4.9.3 -I${toolchain_dir}/usr/include")
 set(link_flags "-static-libgcc -static-libstdc++ -Bstatic -L${toolchain_dir}/plugins/platforms -L${toolchain_dir}/plugins/audio")

 set(CMAKE_SYSTEM_NAME Windows CACHE INTERNAL "system name")
@@ -19,6 +18,7 @@
 set(CMAKE_RC_COMPILER ${cross_prefix}windres)
 set(CMAKE_LINKER ${cross_prefix}ld)

+add_definitions(-DEPOXY_STATIC_LIB)
 set(CMAKE_EXE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "exe link flags")
 set(CMAKE_MODULE_LINKER_FLAGS ${link_flags} CACHE INTERNAL "module link flags")
 set(CMAKE_SHARED_LINKER_FLAGS "${link_flags} -Wl,--export-all-symbols" CACHE INTERNAL "shared link flags")


Use headers from libc++.

Use headers from libc++.

--- tests/Makefile.cmake
+++ tests/Makefile.cmake
@@ -3,7 +3,7 @@
 COMPILER       ?= $(HIPACC_DIR)/bin/hipacc
 COMMON_INC     ?= -I@OpenCV_INCLUDE_DIRS@ \
                   -I$(TEST_CASE)
-COMPILER_INC   ?= -std=c++11 $(COMMON_INC) \
+COMPILER_INC   ?= -std=c++11 -stdlib=libc++ $(COMMON_INC) \
                   -I`@Clang_llvm_config_EXECUTABLE@ --includedir` \
                   -I`@Clang_llvm_config_EXECUTABLE@ --includedir`/c++/v1 \
                   -I`@Clang_EXECUTABLE@ -print-file-name=include` \


Update arm-gcc.cmake

Update arm-gcc.cmake

--- toolchain/arm-gcc.cmake
+++ toolchain/arm-gcc.cmake
@@ -10,7 +10,6 @@
 set(CMAKE_SYSTEM_PROCESSOR arm)

 # Override compiler
-set(CMAKE_SYSTEM_NAME Generic)
 SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
 set(CMAKE_C_COMPILER arm-none-eabi-gcc)
 set(CMAKE_CXX_COMPILER arm-none-eabi-g++)


use of cmake find package for glfw includes

--- toolchains/darwin.cmake
+++ toolchains/darwin.cmake
@@ -4,9 +4,6 @@
 set(EXECUTABLE_NAME "tangram")

 add_definitions(-DPLATFORM_OSX)
-
-# include headers from homebrew-installed libraries
-# include_directories(/usr/local/include/GLFW)

 # load core library
 add_subdirectory(${PROJECT_SOURCE_DIR}/core)
@@ -36,7 +33,14 @@
     find_library(GLFW glfw3)

     find_package(GLFW REQUIRED)
-    include_directories(${GLFW_INCLUDE_DIRS})
+
+    if(NOT GLFW_FOUND)
+        message(SEND_ERROR "GLFW not found")
+        return()
+    else()
+        include_directories(${GLFW_INCLUDE_DIRS})
+        message(STATUS "Found GLFW ${GLFW_INCLUDE_DIRS}")
+    endif()

     list(APPEND GLFW_LIBRARIES
         ${OPENGL_FRAMEWORK}


dup libpng.lib for Qt depenedency

dup libpng.lib for Qt depenedency

--- CMake/External_libpng.cmake
+++ CMake/External_libpng.cmake
@@ -39,9 +39,26 @@
       CMAKE_CACHE_ARGS
         -DCMAKE_BUILD_TYPE:STRING=Release
         -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
-        ${PNG_SB_ZLIB_CONFIG}
+        -DSKIP_INSTALL_EXECUTABLES:BOOL=OFF
+        -DPNG_STATIC:BOOL=OFF
+        -DPNG_SHARED:BOOL=ON
+        -DPNG_TESTS:BOOL=OFF
+        ${PNG_SB_ZLIB_CONFIG}
       CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )
-
+    #having -DPNGLIB_NAME:STRING=libpng in CMAKE_CACHE_ARGS doesnt work
+    #libpng library built in the name libpng16.lib and other libs (Qt4)
+    #reports libpng.lib is not found As Qt is strict on the name of libpng
+    #below we copy the libpng16.lib to libpng.lib.
+    #modifying CMakeLists.txt in libpng is another way but then whole
+    #CMakeLists.txt must be kept in superbuild repository.
+    if(MSVC)
+      ExternalProject_Add_Step(${proj} duplicate_pnglib
+        COMMAND ${CMAKE_COMMAND} -E copy
+        ${CMAKE_INSTALL_PREFIX}/lib/libpng16.lib ${CMAKE_INSTALL_PREFIX}/lib/libpng.lib
+        DEPENDEES install
+    )
+    endif()
+
   message(STATUS "  Using libpng SuperBuild version")
 endif()


COMP: Do not use ExternalData symlinks with WASI builds

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -43,7 +43,7 @@
 endif()

 # Emscripten currently has difficulty reading symlinks.
-if(EMSCRIPTEN)
+if(EMSCRIPTEN OR WASI)
   set(ExternalData_NO_SYMLINKS 1)
 endif()


COMP: Usage requirements should include language standard

Resolves: #3168

This warning should not be possible when using ITK's targets:

ITK-5.3/itkConfigure.h:59:6: warning:
\#warning "WARNING:  The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK" [-Wcpp]

The CMake targets indicate that at least the same language standard
conformance is required.

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -471,16 +471,7 @@
     set(_LIBRARY_BUILD_TYPE)
   endif()
   add_library(${_name} ${_LIBRARY_BUILD_TYPE} ${ARGN})
-  target_compile_features(${_name} PUBLIC cxx_nullptr
-                                          cxx_override
-                                          cxx_constexpr
-                                          cxx_range_for
-                                          cxx_rvalue_references
-                                          cxx_static_assert
-                                          cxx_strong_enums
-                                          cxx_lambdas
-                                          cxx_noexcept
-                                          cxx_alias_templates )
+  target_compile_features(${_name} PUBLIC cxx_std_${CMAKE_CXX_STANDARD})
   itk_module_link_dependencies()
   itk_module_target(${_name})
 endmacro()


These should be appending the WRAP_HINTS to the vars

The previous version would have caused bugs when there was a custom
hints file and some CMake code to export.

Change-Id: Ie33b73be4505c0f483f4f2d9727cce744fee1005

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -158,9 +158,9 @@
   set(vtk-module-EXPORT_CODE-install "${_code}${${vtk-module}_EXPORT_CODE_INSTALL}")
   if(${vtk-module}_WRAP_HINTS)
     set(vtk-module-EXPORT_CODE-build
-      "${_code}set(${vtk-module}_WRAP_HINTS \"${${vtk-module}_WRAP_HINTS}\")\n")
+      "${vtk-module-EXPORT_CODE-build}set(${vtk-module}_WRAP_HINTS \"${${vtk-module}_WRAP_HINTS}\")\n")
     set(vtk-module-EXPORT_CODE-install
-      "${_code}set(${vtk-module}_WRAP_HINTS \"\${CMAKE_CURRENT_LIST_DIR}/${vtk-module}_hints\")\n")
+      "${vtk-module-EXPORT_CODE-install}set(${vtk-module}_WRAP_HINTS \"\${CMAKE_CURRENT_LIST_DIR}/${vtk-module}_hints\")\n")
   endif()

   set(vtk-module-DEPENDS "${${vtk-module}_DEPENDS}")


Cavium OcteonTX: cache line fix

Cavium OcteonTX: cache line fix

According to Nitin Saxena ThunderX2 machine has 64B cache line whilst
all others are 128B. According to Damjan, Nitin's previous patch broke
compilation for all non-Cavium machines. This patch should make
everything happy again.

Change-Id: I8c5c2661f9f2f9c3e9b0965a277712f9a1eefa5f
Signed-off-by: Marco Varlese <a9ee8e267a5232c6e20784faabf46e21d99abe79@suse.com>

--- src/cmake/cpu.cmake
+++ src/cmake/cpu.cmake
@@ -25,17 +25,21 @@
     string(STRIP ${value} value)
     if(${name} STREQUAL "CPU implementer")
       set(CPU_IMPLEMENTER ${value})
-     endif()
+    endif()
     if(${name} STREQUAL "CPU part")
       set(CPU_PART ${value})
-     endif()
+    endif()
   endforeach()
   # Implementer 0x43 - Cavium
   #  Part 0x0af - ThunderX2 is 64B, rest all are 128B
-  if (${CPU_IMPLEMENTER} STREQUAL "0x43" AND ${CPU_PART} STREQUAL "0x0af")
-    set(VPP_LOG2_CACHE_LINE_SIZE 6)
+  if (${CPU_IMPLEMENTER} STREQUAL "0x43")
+    if (${CPU_PART} STREQUAL "0x0af")
+      set(VPP_LOG2_CACHE_LINE_SIZE 6)
+    else()
+      set(VPP_LOG2_CACHE_LINE_SIZE 7)
+    endif()
   else()
-    set(VPP_LOG2_CACHE_LINE_SIZE 7)
+      set(VPP_LOG2_CACHE_LINE_SIZE 6)
   endif()
   math(EXPR VPP_CACHE_LINE_SIZE "1 << ${VPP_LOG2_CACHE_LINE_SIZE}")
   message(STATUS "ARM AArch64 CPU implementer ${CPU_IMPLEMENTER} part ${CPU_PART} cacheline size ${VPP_CACHE_LINE_SIZE}")


LIBRARY_DIR fix

LIBRARY_DIR fix

--- Common.cmake
+++ Common.cmake
@@ -73,8 +73,8 @@
   if(REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
     set(LIB_SUFFIX 64 CACHE STRING "Library directory suffix")
   endif()
-  set(LIBRARY_DIR lib${LIB_SUFFIX})
 endif()
+set(LIBRARY_DIR lib${LIB_SUFFIX})

 if(APPLE)
   if(_CMAKE_OSX_MACHINE MATCHES "ppc")


Allow overriding of MITK_BUILD_ALL_APPS for CDash clients.

--- CMake/MITKDashboardSetup.cmake
+++ CMake/MITKDashboardSetup.cmake
@@ -81,11 +81,15 @@
   set(MITK_USE_OpenCV 1)
 endif()

+if(NOT DEFINED MITK_BUILD_ALL_APPS)
+  set(MITK_BUILD_ALL_APPS TRUE)
+endif()
+
 set(INITIAL_CMAKECACHE_OPTIONS "
 BLUEBERRY_BUILD_TESTING:BOOL=TRUE
 BLUEBERRY_BUILD_ALL_PLUGINS:BOOL=TRUE
 MITK_BUILD_ALL_PLUGINS:BOOL=TRUE
-MITK_BUILD_ALL_APPS:BOOL=TRUE
+MITK_BUILD_ALL_APPS:BOOL=${MITK_BUILD_ALL_APPS}
 MITK_BUILD_EXAMPLES:BOOL=TRUE
 SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:BOOL=TRUE
 MITK_USE_Boost:BOOL=${MITK_USE_Boost}


Fixed to work in new windows build environment.

--- CMakeModules/FindCLAPACK.cmake
+++ CMakeModules/FindCLAPACK.cmake
@@ -7,6 +7,8 @@
 # Properties, Inc., University of Heidelberg, and The University
 # of Manchester.
 # All rights reserved.
+
+

 # Try to find the CLAPACK library
 # Once done this will define
@@ -90,11 +92,9 @@
       endif ()
     else ()
       if (COPASI_BUILD_TYPE EQUAL "32bit")
-        set(LAPACK_LIBRARIES "mkl_intel_c.lib mkl_core.lib mkl_sequential.lib")
-        set(LAPACK_LINKER_FLAGS "-LIBPATH:\"$ENV{MKLROOT}/lib/ia32\"")
+        set(LAPACK_LIBRARIES "$ENV{MKLROOT}/lib/ia32/mkl_intel_c.lib" "$ENV{MKLROOT}/lib/ia32/mkl_core.lib" "$ENV{MKLROOT}/lib/ia32/mkl_sequential.lib")
       elseif (COPASI_BUILD_TYPE EQUAL "64bit")
-        set(LAPACK_LIBRARIES "mkl_intel_lp64.lib mkl_core.lib mkl_sequential.lib")
-        set(LAPACK_LINKER_FLAGS "-LIBPATH:\"$ENV{MKLROOT}/lib/intel64\"")
+        set(LAPACK_LIBRARIES "$ENV{MKLROOT}/lib/intel64/mkl_intel_lp64.lib" "$ENV{MKLROOT}/lib/intel64/mkl_core.lib" "$ENV{MKLROOT}/lib/intel64/mkl_sequential.lib")
       endif ()
     endif ()


cmake: warn if libgmx seems to be double, but GMX_DOUBLE=OFF

--- CMakeModules/FindGROMACS.cmake
+++ CMakeModules/FindGROMACS.cmake
@@ -81,7 +81,7 @@
   include(CheckLibraryExists)
   check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" GromacsVersion "" FOUND_GROMACS_VERSION)
   if(NOT FOUND_GROMACS_VERSION)
-    message(FATAL_ERROR "Could not find GromacsVersion in ${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GROMACS_LIBRARY and GROMACS_DEP_LIBRARY by hand which sets the gromacs lib and it's depencies (i.e. -DGROMACS_LIBRARY='/path/to/libgmx.so' -DGROMACS_DEP_LIBRARIES='/path/to/libblas.so;/path/to/libm.so') !")
+    message(FATAL_ERROR "Could not find GromacsVersion in ${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set GROMACS_LIBRARY and GROMACS_DEP_LIBRARY by hand which sets the gromacs lib and it's depencies (i.e. -DGROMACS_LIBRARY='/path/to/libgmx.so' -DGROMACS_DEP_LIBRARIES='/path/to/libblas.so;/path/to/libm.so') ! For double precision gromacs please use -DGMX_DOUBLE=ON additionally.")
   endif(NOT FOUND_GROMACS_VERSION)
   check_library_exists("${GROMACS_LIBRARY};${GROMACS_DEP_LIBRARIES}" init_mtop "" FOUND_GROMACS_INIT_MTOP)
   if(NOT FOUND_GROMACS_INIT_MTOP)
@@ -97,6 +97,11 @@
     set(GMX_VERSION 50)
   endif(FOUND_GROMACS_INIT_DOMDEC_VSITES)
   set(GROMACS_VERSION ${GMX_VERSION} CACHE STRING "Gromacs lib interface version")
+
+  #if(${GROMACS_LIBRARY} MATCHES ".*lib[^/.]_d\\.[^.]*$" AND NOT GMX_DOUBLE)
+  if(${GROMACS_LIBRARY} MATCHES "lib[^/]*_d\\.[^.]*$" AND NOT GMX_DOUBLE)
+    message(WARNING "You are using ${GROMACS_LIBRARY}, which seems to be a double precision library. If this is not the case ignore this warning otherwise enable compling against double precision gromacs using -DGMX_DOUBLE=ON")
+  endif()
 else(GROMACS_LIBRARY)
   set(GMX_VERSION 45)
 endif (GROMACS_LIBRARY)


Build Forge Docs if building ArrayFire documentation

--- CMakeModules/build_forge.cmake
+++ CMakeModules/build_forge.cmake
@@ -58,6 +58,7 @@
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DBUILD_EXAMPLES:BOOL=OFF
+    -DBUILD_DOCUMENTATION:BOOL=${BUILD_DOCS}
     -DUSE_SYSTEM_GLBINDING:BOOL=TRUE
     -Dglbinding_DIR:STRING=${glbinding_DIR}
     -DGLFW_ROOT_DIR:STRING=${GLFW_ROOT_DIR}


Add message of included autogenerated cmake

Change-Id: I1b6212f0f9de57bbd288c139ef6cf21cd2cf93f8

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -297,6 +297,7 @@
       string(REPLACE ${PROCESSED_PREFIX} "" _FILE ${_FILE})
       string(REGEX REPLACE "\t.*" "" _FILE ${_FILE})
       if (${_FILE} MATCHES ".*cmake")
+        message (STATUS "Including generated cmake ${_FILE}")
         include (${CMAKE_CURRENT_BINARY_DIR}/${_FILE})
       else()
         message (WARNING "Unexpected file generated ${_FILE}")


Fix typo pour compile linux

Fix typo pour compile linux

--- CMake/ConfigXsilium.cmake
+++ CMake/ConfigXsilium.cmake
@@ -268,7 +268,7 @@
 		include(TemplateCompiler)
 	endif()

-	set(XSILIUM_FREETYPE_INCLUDE ${XSILIUM_DEP_DIR}/FreeType/include)
+	set(XSILIUM_FREETYPE_INCLUDE ${XSILIUM_DEP_DIR}/freetype/include)
 	set(XSILIUM_ZZIP_INCLUDE ${XSILIUM_DEP_DIR}/zziplib)
 	set(XSILIUM_OIS_INCLUDE ${XSILIUM_DEP_DIR}/ois/includes)
 	set(XSILIUM_OGRE_INCLUDE ${OGREPATH}/OgreMain/include ${OGREPATH}/Components/Terrain/include ${XSILIUM_BINARY_DIR}/include ${XSILIUM_PLATFORM})


MSVC: download binaries from gisinternals

--- CMake/External_GDAL.cmake
+++ CMake/External_GDAL.cmake
@@ -87,10 +87,7 @@
     list(APPEND ${proj}_DEPENDENCIES LIBKML)
   endif()

-  if(WIN32)
-    # TODO : use nmake
-  else()
-
+  if(UNIX)
     ExternalProject_Add(${proj}
       PREFIX ${proj}
       URL "http://download.osgeo.org/gdal/1.11.0/gdal-1.11.0.tar.gz"
@@ -113,21 +110,62 @@
         ${GDAL_SB_GEOS_CONFIG}
         ${GDAL_SB_EXPAT_CONFIG}
         ${GDAL_SB_LIBKML_CONFIG}
-      BUILD_COMMAND $(MAKE)
-      INSTALL_COMMAND $(MAKE) install
-      DEPENDS ${${proj}_DEPENDENCIES}
-      PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
-      )
+        BUILD_COMMAND $(MAKE)
+        INSTALL_COMMAND $(MAKE) install
+        DEPENDS ${${proj}_DEPENDENCIES}
+        PATCH_COMMAND ${CMAKE_COMMAND} -E touch ${GDAL_SB_SRC}/config.rpath
+    )

     ExternalProject_Add_Step(${proj} copy_source
-      COMMAND ${CMAKE_COMMAND} -E copy_directory
+        COMMAND ${CMAKE_COMMAND} -E copy_directory
         ${GDAL_SB_SRC} ${GDAL_SB_BUILD_DIR}
-      DEPENDEES patch update
-      DEPENDERS configure
-      )
+        DEPENDEES patch update
+        DEPENDERS configure
+    )

+  else(WIN32)
+    if(MSVC10)
+        set(URL_PREFIX "release-1600")
+        set(GDAL_LIBS_URL_HASH 2a3e4db48c68d490e3101b5ca98a4bce)
+        set(GDAL_DLL_URL_HASH cc5f45081ec0d0a7604816fabf5f2588)
+    else(MSVC80)
+         set(URL_PREFIX "release-1500")
+    else(CMAKE_COMPILER_2005)
+        set(URL_PREFIX "release-1400")
+    endif()
+
+    set(GDAL_LIBS_URL "http://download.gisinternals.com/sdk/downloads/${URL_PREFIX}-gdal-1-11-1-mapserver-6-4-1-libs.zip")
+    set(GDAL_DLL_URL "http://download.gisinternals.com/sdk/downloads/${URL_PREFIX}-gdal-1-11-1-mapserver-6-4-1.zip")
+
+    #TODO: find hash for archives properly
+    set(GDAL_LIBS_URL_HASH 2a3e4db48c68d490e3101b5ca98a4bce)
+    set(GDAL_DLL_URL_HASH cc5f45081ec0d0a7604816fabf5f2588)
+
+    ExternalProject_Add(${proj}_BIN
+        PREFIX ${proj}/_BIN
+        URL ${GDAL_DLL_URL}
+        URL_MD5 ${GDAL_DLL_URL_HASH}
+        SOURCE_DIR ${GDAL_SB_SRC}
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${GDAL_SB_SRC} ${CMAKE_INSTALL_PREFIX}
+     )
+
+    ExternalProject_Add(${proj}
+        PREFIX ${proj}
+        URL ${GDAL_LIBS_URL}
+        URL_MD5 ${GDAL_LIBS_URL_HASH}
+        SOURCE_DIR ${GDAL_SB_SRC}
+        DEPENDS ${proj}_BIN
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ""
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory  ${GDAL_SB_SRC} ${CMAKE_INSTALL_PREFIX}
+    )
+
   endif()

+  list(APPEND OTB_DEPS ${proj})
+  message(STATUS "  Using GDAL SuperBuild version")

-  message(STATUS "  Using GDAL SuperBuild version")
+
 endif()


update common_utils external

update common_utils external

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -64,7 +64,7 @@
 set(occ-map_depends libbot opencv)

 set(common_utils_url https://github.com/openhumanoids/common_utils.git)
-set(common_utils_revision 90df348c8acb7fde57920f4bd3edeb903ac42667)
+set(common_utils_revision 1221d2fa533a213e8e895da3716fb069df423b1a)
 set(common_utils_depends Eigen_pod libbot occ-map octomap)

 set(frsm_url ssh://git@github.com/openhumanoids/frsm.git)
@@ -251,6 +251,7 @@
   pcl
   octomap
   occ-map
+  common_utils
   frsm
   fovis
   estimate-pose
@@ -287,7 +288,6 @@
   # These modules only compile on linux. Some have strict requirements on
   # linux, others could be fixed up to support mac osx builds.
   list(APPEND externals
-    common_utils
     libmultisense
     multisense-lcm
     microstrain


Update Eigen version. Includes ugly hack.

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -3,8 +3,8 @@
 set(libbot-drc_revision 8325)
 set(libbot-drc_depends)

-set(Eigen_pod_url https://svn.csail.mit.edu/Eigen_pod)
-set(Eigen_pod_revision 13)
+set(Eigen_pod_url https://github.com/RobotLocomotion/eigen-pod.git)
+set(Eigen_pod_revision 0f940b6e763369fc04f52c1f2affd7c8cb5f8db1)
 set(Eigen_pod_depends)

 set(opencv-drc_url https://svn.csail.mit.edu/drc/trunk/software/externals/opencv-drc)
@@ -122,7 +122,6 @@

 set(externals
   libbot-drc
-  Eigen_pod
   opencv-drc
   pcl_dep
   pcl_drc
@@ -147,6 +146,7 @@
   )

 set(git-externals
+  #Eigen_pod
   bullet
   spotless
   snopt
@@ -189,6 +189,8 @@
     )
 endmacro()

+add_git_external(Eigen_pod)
+
 foreach(external ${externals})
   add_svn_external(${external})
 endforeach()


Remove unused build args

Remove unused build args

--- firmware/cmake/greatfet-common.cmake
+++ firmware/cmake/greatfet-common.cmake
@@ -64,7 +64,7 @@
 	set(SRC_M0 "${PATH_GREATFET_FIRMWARE_COMMON}/m0_sleep.c")
 endif(NOT DEFINED SRC_M0)

-SET(GREATFET_OPTS "-D${BOARD} -DLPC43XX -D${MCU_PARTNO} -DTX_ENABLE -D'VERSION_STRING=\"git-${VERSION}\"' -DRUN_FROM=${RUN_FROM}")
+SET(GREATFET_OPTS "-D${BOARD} -DLPC43XX -D${MCU_PARTNO} -D'VERSION_STRING=\"git-${VERSION}\"'")

 SET(LDSCRIPT_M4 "-T${PATH_GREATFET_FIRMWARE_COMMON}/${MCU_PARTNO}_M4_memory.ld -Tlibopencm3_lpc43xx_rom_to_ram.ld -T${PATH_GREATFET_FIRMWARE_COMMON}/LPC43xx_M4_M0_image_from_text.ld")

@@ -195,7 +195,6 @@
 	)

 	# Program / flash targets
-	# Make programming easier but also force build of both .dfu and .bin files
 	add_custom_target(
 		${PROJECT_NAME}-flash
 		DEPENDS ${PROJECT_NAME}.bin


python3: Fix HAVE_READV and HAVE_WRITEV configuration check on MacOSX

As documented in [1] and [2], "sys/uio.h" is required to use "readv" and
"writev".

[1] https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/readv.2.html
[2] https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/writev.2.html

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -607,6 +607,7 @@
 add_cond(CFG_HEADERS HAVE_SYS_LOCK_H sys/lock.h)
 add_cond(CFG_HEADERS HAVE_SYS_TIMEB_H sys/timeb.h)
 add_cond(CFG_HEADERS HAVE_SYS_TIMES_H sys/times.h)
+add_cond(CFG_HEADERS HAVE_SYS_UIO_H sys/uio.h)
 add_cond(CFG_HEADERS HAVE_SYS_UTSNAME_H sys/utsname.h)
 add_cond(CFG_HEADERS HAVE_SYS_MMAN_H sys/mman.h)
 add_cond(CFG_HEADERS HAVE_SYS_SOCKET_H sys/socket.h)


minimum qt version explicitly set to 5.4, fixes #1419

--- cmake/EthDependencies.cmake
+++ cmake/EthDependencies.cmake
@@ -117,14 +117,17 @@
 # find all of the Qt packages
 # remember to use 'Qt' instead of 'QT', cause unix is case sensitive
 # TODO make headless client optional
-	find_package (Qt5Core REQUIRED)
-	find_package (Qt5Gui REQUIRED)
-	find_package (Qt5Quick REQUIRED)
-	find_package (Qt5Qml REQUIRED)
-	find_package (Qt5Network REQUIRED)
-	find_package (Qt5Widgets REQUIRED)
-	find_package (Qt5WebEngine REQUIRED)
-	find_package (Qt5WebEngineWidgets REQUIRED)
+
+	set (ETH_QT_VERSION 5.4)
+
+	find_package (Qt5Core ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5Gui ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5Quick ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5Qml ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5Network ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5Widgets ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5WebEngine ${ETH_QT_VERSION} REQUIRED)
+	find_package (Qt5WebEngineWidgets ${ETH_QT_VERSION} REQUIRED)

 	# we need to find path to macdeployqt on mac
 	if (APPLE)


CMake: Compatibility fixes for CMake 3.4.0

CMake 3.4.0 no longer exports MPI_<LANGUAGE>_COMPILER as cached variable.
Therefore, we also have to make sure to unset ordinary variables (in
addition to cached variables) for our "retry" pass.

--- cmake/modules/FindMPI.cmake
+++ cmake/modules/FindMPI.cmake
@@ -80,6 +80,9 @@
     )
   # Clear variables so that FIND_PACKAGE runs again:
   SET(MPI_FOUND)
+  SET(MPI_CXX_COMPILER)
+  SET(MPI_C_COMPILER)
+  SET(MPI_Fortran_COMPILER)
   UNSET(MPI_CXX_COMPILER CACHE)
   UNSET(MPI_C_COMPILER CACHE)
   UNSET(MPI_Fortran_COMPILER CACHE)


Put F95_MOD_DIR variable in the cache so that it can be modified by the user.

svn path=/trunk/; revision=10554

--- cmake/modules/fortran.cmake
+++ cmake/modules/fortran.cmake
@@ -63,7 +63,9 @@
   endif(ENABLE_f95 AND NOT CMAKE_Fortran_COMPILER_SUPPORTS_F90)

   # Set installation location for f95 modules.
-  set(F95_MOD_DIR ${LIB_DIR}/fortran/modules/${PACKAGE})
+  set(F95_MOD_DIR ${LIB_DIR}/fortran/modules/${PACKAGE}
+    CACHE PATH "installation location for f95 modules"
+    )

   # Check if f77/f95 style command line parsing is possible
   include(TestF77CmdLine)


Remove build of OTB for test

Remove build of OTB for test

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -133,30 +133,30 @@
     CAPTURE_CMAKE_ERROR _configure_error
     )

-if ( NOT _configure_rv EQUAL 0 )
-  ctest_submit()
-  message( SEND_ERROR "An error occurs during ctest_configure.")
-endif()
-
-ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
-            RETURN_VALUE _build_rv
-            CAPTURE_CMAKE_ERROR _build_error
-            )
-
-if ( NOT _build_rv EQUAL 0 )
-  ctest_submit()
-  message( SEND_ERROR "An error occurs during ctest_build.")
-endif()
-
-# Uncomment when ready for test
-# ctest_test(PARALLEL_LEVEL 8
-#            RETURN_VALUE _test_rv
-#            CAPTURE_CMAKE_ERROR _test_error
-#            )
-
-# if ( NOT _test_rv EQUAL 0 )
+# if ( NOT _configure_rv EQUAL 0 )
 #   ctest_submit()
-#   message( SEND_ERROR "An error occurs during ctest_test.")
+#   message( SEND_ERROR "An error occurs during ctest_configure.")
 # endif()

-ctest_submit()
+# ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
+#             RETURN_VALUE _build_rv
+#             CAPTURE_CMAKE_ERROR _build_error
+#             )
+
+# if ( NOT _build_rv EQUAL 0 )
+#   ctest_submit()
+#   message( SEND_ERROR "An error occurs during ctest_build.")
+# endif()
+
+# # Uncomment when ready for test
+# # ctest_test(PARALLEL_LEVEL 8
+# #            RETURN_VALUE _test_rv
+# #            CAPTURE_CMAKE_ERROR _test_error
+# #            )
+
+# # if ( NOT _test_rv EQUAL 0 )
+# #   ctest_submit()
+# #   message( SEND_ERROR "An error occurs during ctest_test.")
+# # endif()
+
+# ctest_submit()


ENH: be less verbose about mapnik 0.7, it works...

--- CMake/ImportMapnik.cmake
+++ CMake/ImportMapnik.cmake
@@ -75,8 +75,8 @@
           MESSAGE(STATUS "  Testing if Mapnik2     -- yes")
         ELSE(OTB_MAPNIK_SUPPORTS_API20)
           MESSAGE(STATUS "  Testing if Mapnik2     -- no")
-          MESSAGE(STATUS "Does not support mapnik2 interface: ${OUTPUT}")
-          MESSAGE(STATUS "Assuming mapnik 0.7")
+          #MESSAGE(STATUS "Does not support mapnik2 interface: ${OUTPUT}")
+          MESSAGE(STATUS "  Assuming mapnik 0.7")
           # This should be dropped when we don't want to support this any more
           # Estimated date: 02/2013.
           ADD_DEFINITIONS(-DOTB_MAPNIK_COMPATIBILITY_API07)


COMP: Remove obsolete CMake file

COMP: Remove obsolete CMake file

--- CMake/elxWinConfig.cmake
+++ CMake/elxWinConfig.cmake
@@ -1,18 +0,0 @@
-# Visual Studio complains if paths are too long
-string( LENGTH "${CMAKE_CURRENT_SOURCE_DIR}" n )
-if( n GREATER 50 )
-message(
-  FATAL_ERROR
-    "Source code directory path length is too long for MSVC (${n} > 50)."
-    "Please move the source code directory to a directory with a shorter path."
-  )
-endif()
-
-string( LENGTH "${CMAKE_CURRENT_BINARY_DIR}" n )
-if( n GREATER 50 )
-message(
-  FATAL_ERROR
-    "Build directory path length is too long for MSVC (${n} > 50)."
-    "Please move the build directory to a directory with a shorter path."
-  )
-endif()


Fix for systems that only configure once

Fix for systems that only configure once. They were using an old default
value for the backend hack.

--- CMake/vtkModuleTop.cmake
+++ CMake/vtkModuleTop.cmake
@@ -28,7 +28,13 @@
 # in for the first CMake invocation for modules that depend on the backend
 # chosen.
 if(NOT DEFINED VTK_RENDERING_BACKEND)
-  set(VTK_RENDERING_BACKEND "OpenGL")
+  # has the application defined a desired default for the backend?
+  # if not, use VTKs default of OpenGL
+  if(DEFINED VTK_RENDERING_BACKEND_DEFAULT)
+    set(VTK_RENDERING_BACKEND ${VTK_RENDERING_BACKEND_DEFAULT})
+  else()
+    set(VTK_RENDERING_BACKEND "OpenGL2")
+  endif()
   set(_backend_set_for_first_cmake TRUE)
 endif()


Do not elide find_package() if MONGO_USE_CCACHE is set (#1031)

* Do not elide find_program() if MONGO_USE_CCACHE is set

* Fix undesirable variable expansion in if condition

--- build/cmake/CCache.cmake
+++ build/cmake/CCache.cmake
@@ -8,41 +8,40 @@
     ON or OFF.
 ]]

-# Find and enable ccache for compiling if not already found.
-if (NOT DEFINED MONGO_USE_CCACHE)
-    find_program (CCACHE_EXECUTABLE ccache)
-    if (CCACHE_EXECUTABLE)
-        message (STATUS "Found ccache: ${CCACHE_EXECUTABLE}")
+find_program (CCACHE_EXECUTABLE ccache)

-        execute_process (
-            COMMAND ${CCACHE_EXECUTABLE} --version | perl -ne "print $1 if /^ccache version (.+)$/"
-            OUTPUT_VARIABLE CCACHE_VERSION
-            OUTPUT_STRIP_TRAILING_WHITESPACE
-        )
+# Enable ccache for compiling if not already configured.
+if (CCACHE_EXECUTABLE AND NOT DEFINED MONGO_USE_CCACHE)
+    message (STATUS "Found ccache: ${CCACHE_EXECUTABLE}")

-        # Assume `ccache --version` mentions a simple version string, e.g. "1.2.3".
-        # Permit patch number to be omitted, e.g. "1.2".
-        set (SIMPLE_SEMVER_REGEX "([0-9]+)\.([0-9]+)(\.([0-9]+))?")
-        string (REGEX MATCH "${SIMPLE_SEMVER_REGEX}" CCACHE_VERSION ${CCACHE_VERSION})
+    execute_process (
+        COMMAND ${CCACHE_EXECUTABLE} --version | perl -ne "print $1 if /^ccache version (.+)$/"
+        OUTPUT_VARIABLE CCACHE_VERSION
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )

-        if (CCACHE_VERSION)
-            message (STATUS "Detected ccache version: ${CCACHE_VERSION}")
-        else ()
-            message (WARNING "Could not obtain ccache version from `ccache --version`. Defaulting to 0.1.0.")
-            set (CCACHE_VERSION 0.1.0)
-        endif ()
+    # Assume `ccache --version` mentions a simple version string, e.g. "1.2.3".
+    # Permit patch number to be omitted, e.g. "1.2".
+    set (SIMPLE_SEMVER_REGEX "([0-9]+)\.([0-9]+)(\.([0-9]+))?")
+    string (REGEX MATCH "${SIMPLE_SEMVER_REGEX}" CCACHE_VERSION ${CCACHE_VERSION})

-        # Avoid spurious "ccache.conf: No such file or directory" errors due to ccache being invoked in parallel, which was patched in ccache version 3.4.3.
-        if (${CCACHE_VERSION} VERSION_LESS 3.4.3)
-            message (STATUS "Detected ccache version ${CCACHE_VERSION} is less than 3.4.3, which may lead to spurious failures when run in parallel. See https://github.com/ccache/ccache/issues/260 for more information.")
-            message (STATUS "Compiling with CCache disabled. Enable by setting MONGO_USE_CCACHE to ON")
-            option (MONGO_USE_CCACHE "Use CCache when compiling" OFF)
-        else ()
-            message (STATUS "Compiling with CCache enabled. Disable by setting MONGO_USE_CCACHE to OFF")
-            option (MONGO_USE_CCACHE "Use CCache when compiling" ON)
-        endif ()
-    endif (CCACHE_EXECUTABLE)
-endif (NOT DEFINED MONGO_USE_CCACHE)
+    if (CCACHE_VERSION)
+        message (STATUS "Detected ccache version: ${CCACHE_VERSION}")
+    else ()
+        message (WARNING "Could not obtain ccache version from `ccache --version`. Defaulting to 0.1.0.")
+        set (CCACHE_VERSION 0.1.0)
+    endif ()
+
+    # Avoid spurious "ccache.conf: No such file or directory" errors due to ccache being invoked in parallel, which was patched in ccache version 3.4.3.
+    if (CCACHE_VERSION VERSION_LESS "3.4.3")
+        message (STATUS "Detected ccache version ${CCACHE_VERSION} is less than 3.4.3, which may lead to spurious failures when run in parallel. See https://github.com/ccache/ccache/issues/260 for more information.")
+        message (STATUS "Compiling with CCache disabled. Enable by setting MONGO_USE_CCACHE to ON")
+        option (MONGO_USE_CCACHE "Use CCache when compiling" OFF)
+    else ()
+        message (STATUS "Compiling with CCache enabled. Disable by setting MONGO_USE_CCACHE to OFF")
+        option (MONGO_USE_CCACHE "Use CCache when compiling" ON)
+    endif ()
+endif (CCACHE_EXECUTABLE AND NOT DEFINED MONGO_USE_CCACHE)

 if (MONGO_USE_CCACHE)
     set (CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_EXECUTABLE}")


COMP: Added cpp files to cmake

COMP: Added cpp files to cmake

--- Modules/GraphAlgorithms/files.cmake
+++ Modules/GraphAlgorithms/files.cmake
@@ -1,5 +1,8 @@
 SET(CPP_FILES
   itkShortestPathNode.cpp
+  itkShortestPathCostFunction.cpp
+  itkShortestPathCostFunctionTbss.cpp
+  itkShortestPathNode.cpp
 )

 SET(H_FILES


Update ITK to RecursiveGaussian use in ITKRegistrationMethod

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -148,7 +148,7 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
-  set(${proj}_GIT_TAG 34c54c7929154df3bd40d5188b859731c54b8627) ##
+  set(${proj}_GIT_TAG d4294f8b8afed4656d724672d1ada6da2f059d13 ) ##
   set(ITK_VERSION_ID ITK-5.0) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


fptu-cmake: fix DLL-PATH to running tests under Windows.

--- cmake.fptu/testing.cmake
+++ cmake.fptu/testing.cmake
@@ -114,6 +114,17 @@
       COMMAND ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --test-action memcheck
       COMMAND ${CAT} "${CMAKE_BINARY_DIR}/Testing/Temporary/MemoryChecker.*.log")
   endif()
+  if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+    # Windows don't have RPATH feature,
+    # therefore we should prepare PATH or copy DLL(s)
+    set(UT_NEED_DLLCRUTCH "Crutch for ${CMAKE_SYSTEM_NAME}")
+    if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_VERSION VERSION_LESS 3.0)
+      # will use LOCATION property to compose DLLPATH
+      cmake_policy(SET CMP0026 OLD)
+    endif()
+  else()
+    set(UT_NEED_DLLCRUTCH FALSE)
+  endif()
 else()
   set(UT_INCLUDE_DIRECTORIES "")
   set(UT_LIBRARIES "")
@@ -141,6 +152,7 @@

     set(target "${params_PREFIX}${name}")
     add_executable(${target} ${params_SOURCE})
+    set_target_properties(${target} PROPERTIES SKIP_BUILD_RPATH FALSE)

     if(params_DEPEND)
       add_dependencies(${target} ${params_DEPEND})
@@ -152,20 +164,51 @@
       target_link_libraries(${target} ${params_LIBRARY})
     endif()

-    foreach(dep IN LISTS params_LIBRARY GTEST_BOTH_LIBRARIES)
-      get_target_property(type ${dep} TYPE)
-      if(${type} STREQUAL "SHARED_LIBRARY")
-        get_target_property(filename ${dep} IMPORTED_LOCATION)
-        if(NOT filename)
-          set(dir $<TARGET_FILE_DIR:${dep}>)
-          #get_target_property(filename ${dep} LOCATION)
-          #get_filename_component(dir ${filename} DIRECTORY)
-        else()
-          get_filename_component(dir ${filename} DIRECTORY)
-        endif()
-        list(APPEND params_DLLPATH ${dir})
-      endif()
-    endforeach(dep)
+    if(UT_NEED_DLLCRUTCH)
+      string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_UPPERCASE)
+      foreach(dep IN LISTS params_LIBRARY GTEST_BOTH_LIBRARIES)
+        get_target_property(type ${dep} TYPE)
+        if(NOT ${type} STREQUAL "STATIC_LIBRARY")
+          # Windows don't have RPATH feature,
+          # therefore we should prepare PATH or copy DLL(s)...
+          if(CMAKE_CONFIGURATION_TYPES)
+            # Could not provide static ENVIRONMENT property with configuration-depended path
+            set(dir FALSE)
+          else(CMAKE_CONFIGURATION_TYPES)
+            get_target_property(filename ${dep} IMPORTED_LOCATION_${CMAKE_BUILD_TYPE_UPPERCASE})
+            if(NOT filename)
+              get_target_property(filename ${dep} IMPORTED_LOCATION)
+            endif()
+            get_target_property(filename ${dep} LOCATION_${CMAKE_BUILD_TYPE_UPPERCASE})
+            if(NOT filename)
+              get_target_property(filename ${dep} LOCATION)
+            endif()
+            if(filename)
+              get_filename_component(dir ${filename} DIRECTORY)
+            else(filename)
+              get_target_property(dir ${dep} LIBRARY_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE_UPPERCASE})
+              if(NOT dir)
+                get_target_property(dir ${dep} RUNTIME_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE_UPPERCASE})
+              endif()
+              if(NOT dir)
+                get_target_property(dir ${dep} LIBRARY_OUTPUT_DIRECTORY)
+              endif()
+              if(NOT dir)
+                get_target_property(dir ${dep} RUNTIME_OUTPUT_DIRECTORY)
+              endif()
+            endif(filename)
+          endif(CMAKE_CONFIGURATION_TYPES)
+          if(dir)
+            list(APPEND params_DLLPATH ${dir})
+          else(dir)
+            # Path is configuration-depended or not available, should copy dll
+            add_custom_command(TARGET ${target} POST_BUILD
+              COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>"
+              COMMENT "${UT_NEED_DLLCRUTCH}: Copy shared library ${dep} for test ${target}")
+          endif(dir)
+        endif()
+      endforeach(dep)
+    endif(UT_NEED_DLLCRUTCH)

     if(params_INCLUDE_DIRECTORY)
       set_target_properties(${target} PROPERTIES INCLUDE_DIRECTORIES ${params_INCLUDE_DIRECTORY})
@@ -182,8 +225,20 @@
         set_tests_properties(${name} PROPERTIES TIMEOUT ${params_TIMEOUT})
       endif()
       if(params_DLLPATH)
-        list(REMOVE_DUPLICATES params_DLLPATH)
-        set_tests_properties(${name} PROPERTIES ENVIRONMENT "PATH=${params_DLLPATH};$ENV{PATH}")
+        # Compose DLL's path in the ENVIRONMENT property
+        if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+          set(params_DLLPATH_ENV "${params_DLLPATH};$ENV{PATH}")
+        else()
+          set(params_DLLPATH_ENV "${params_DLLPATH}:$ENV{PATH}")
+          string(REPLACE ":" ";" params_DLLPATH_ENV "${params_DLLPATH_ENV}")
+        endif()
+        list(REMOVE_DUPLICATES params_DLLPATH_ENV)
+        if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+          string(REPLACE ";" "\\;" params_DLLPATH_ENV "${params_DLLPATH_ENV}")
+        else()
+          string(REPLACE ";" ":" params_DLLPATH_ENV "${params_DLLPATH_ENV}")
+        endif()
+        set_tests_properties(${name} PROPERTIES ENVIRONMENT "PATH=${params_DLLPATH_ENV}")
       endif()
     endif()
   endif()


python version

python version

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -4,7 +4,7 @@
 # ---[ Boost
 find_package(Boost 1.46 REQUIRED COMPONENTS system thread filesystem iostreams)
 include_directories(SYSTEM ${Boost_INCLUDE_DIR})
-list(APPEND Caffe_LINKER_LIBS ${Boost_LIBRARIES} python2.6)
+list(APPEND Caffe_LINKER_LIBS ${Boost_LIBRARIES} python2.7)

 # ---[ Threads
 find_package(Threads REQUIRED)


Corrected typo.

Corrected typo.

--- cmake/FindDocutils.cmake
+++ cmake/FindDocutils.cmake
@@ -29,7 +29,7 @@
 #
 #  DOCUTILS_FOUND - System has Docutils
 #
-#  RST2HTML_EXECUTALE
+#  RST2HTML_EXECUTABLE

 find_package(PackageHandleStandardArgs)


Tentative CMake fix.

Tentative CMake fix.

--- cmake/FindQuadmath.cmake
+++ cmake/FindQuadmath.cmake
@@ -50,8 +50,8 @@
     Quadmath_USE_DIRECTLY)
     cmake_pop_check_state()
     if (Quadmath_USE_DIRECTLY)
-        set(Quadmath_INCLUDE_DIR "unused")
-        set(Quadmath_LIBRARY "quadmath")
+        set(Quadmath_INCLUDE_DIR "unused" CACHE PATH "" FORCE)
+        set(Quadmath_LIBRARY "quadmath" CACHE FILEPATH "" FORCE)
     endif()
 endif()

@@ -65,6 +65,7 @@

 # NOTE: this has been adapted from CMake's FindPNG.cmake.
 if(Quadmath_FOUND AND NOT TARGET Quadmath::quadmath)
+    message(STATUS "Creating the 'Quadmath::quadmath' imported target.")
     if(Quadmath_USE_DIRECTLY)
         # If we are using it directly, we must define an interface library,
         # as we do not have the full path to the shared library.


expand variable

expand variable

--- cmake/InstallGTest.cmake
+++ cmake/InstallGTest.cmake
@@ -30,15 +30,15 @@
 SET (GTEST_STATIC_LIBRIRES GTEST_LIBRARY_PATH GTEST_MAIN_LIBRARY_PATH GMOCK_LIBRARY_PATH GMOCK_MAIN_LIBRARY_PATH)

 find_package_handle_standard_args(google-test
-    REQUIRED_ARGS   GTEST_SHARED_LIBRIRES GTEST_STATIC_LIBRIRES GTEST_INCLUDE_DIRS
+    REQUIRED_ARGS   ${GTEST_SHARED_LIBRIRES} ${GTEST_STATIC_LIBRIRES} GTEST_INCLUDE_DIRS
 )

-foreach (lib GTEST_SHARED_LIBRIRES)
+foreach (lib ${GTEST_SHARED_LIBRIRES})
     add_library(${lib} SHARED IMPORTED)
     add_dependencies(${lib} google-test)
 endforeach ()

-foreach (lib GTEST_STATIC_LIBRIRES)
+foreach (lib ${GTEST_STATIC_LIBRIRES})
     add_library(${lib} STATIC IMPORTED)
     add_dependencies(${lib} google-test)
 endforeach ()


Fix the name of perf tests' precompiled header.

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -648,7 +648,7 @@
         set(OPENCV_PERF_${the_module}_SOURCES ${perf_srcs} ${perf_hdrs})
       endif()

-      get_native_precompiled_header(${the_target} test_precomp.hpp)
+      get_native_precompiled_header(${the_target} perf_precomp.hpp)

       add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
       target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})


update fifechan dep

update fifechan dep

--- cmake/get-fifechan.cmake
+++ cmake/get-fifechan.cmake
@@ -5,7 +5,7 @@

 include(ExternalProject)

-set(FIFECHAN_VERSION "0.2.0")
+set(FIFECHAN_VERSION "0.1.3")

 # For Windows it's faster to download the pre-compiled development binaries.
 if (WIN32)
@@ -35,8 +35,8 @@
       PREFIX              ${DEPENDENCY_EXTRACT_DIR}
       DOWNLOAD_DIR        ${DEPENDENCY_DOWNLOAD_DIR}
       #URL                 https://github.com/fifengine/fifechan/releases/tag/${FIFECHAN_VERSION}/fifechan-v${FIFECHAN_VERSION}-VC14.zip
-      URL                 https://ci.appveyor.com/api/buildjobs/lel0aaieaa4cgnmv/artifacts/fifechan-shared-VC14.zip
-      URL_MD5             3bc2c39b9c0842b4bcc6eaddf84d4525
+      URL                 https://ci.appveyor.com/api/buildjobs/4e4twah8hdloktcc/artifacts/fifechan-shared-VC14-x86.zip
+      URL_MD5             def0aaa2fcddf67e85fa8f6987d9932f
       CONFIGURE_COMMAND   ""
       BUILD_COMMAND       ""
       INSTALL_COMMAND


CMake: minor change use ivw_message

CMake: minor change use ivw_message

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -308,11 +308,11 @@
   elseif(COMPILER_SUPPORTS_CXX0X)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
   else()
-    message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+    ivw_message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
   endif()
 else()
   if( MSVC_VERSION LESS 1700 )       # VC10-/VS2010-
-    message(FATAL_ERROR "Inviwo requires C++11 features. "
+    ivw_message(FATAL_ERROR "Inviwo requires C++11 features. "
                         "You need at least Visual Studio 11 (Microsoft Visual Studio 2012), "
                         "with Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012).")
   elseif( MSVC_VERSION EQUAL 1700 )  # VC11/VS2012


Update SP download URL (4.4.3)

Update SP download URL (4.4.3)

--- checkGetSuiteSparse.cmake
+++ checkGetSuiteSparse.cmake
@@ -62,7 +62,7 @@

 if(SUITESPARSE_DL_LAST)
 	# JL says: It seems the "current" symlink in the server is no longer available... we'll have to update this manually :-(
-	set(SUITESPARSE_URL "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.4.1.tar.gz")
+	set(SUITESPARSE_URL "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.4.3.tar.gz")
 	set(SUITESPARSE_ZIP "${CMAKE_SOURCE_DIR}/SuiteSparse.tar.gz")
 	if(SUITESPARSE_URL AND SUITESPARSE_ZIP)


STYLE: CMake doc line suffix -> prefix.

STYLE: CMake doc line suffix -> prefix.

--- CMake/KitCommonPythonWrapBlock.cmake
+++ CMake/KitCommonPythonWrapBlock.cmake
@@ -74,14 +74,13 @@
   # Make sure that no prefix is set on the library
   SET_TARGET_PROPERTIES(vtk${KIT}Python PROPERTIES PREFIX "")

-  # Compatibility for projects that still expect the "lib" suffix
+  # Compatibility for projects that still expect the "lib" prefix
   IF(CYGWIN OR NOT WIN32)
     SET(suf ${CMAKE_SHARED_MODULE_SUFFIX})
     SET(src vtk${KIT}Python${suf})
     SET(tgt ${LIBRARY_OUTPUT_PATH}/libvtk${KIT}Python${suf})
     ADD_CUSTOM_COMMAND(TARGET vtk${KIT}Python POST_BUILD
-                       COMMAND ln -sf ${src} ${tgt}
-                       DEPENDS vtk${KIT}Python)
+                       COMMAND ln -sf ${src} ${tgt})
   ENDIF(CYGWIN OR NOT WIN32)

   # The python modules are installed by a setup.py script which does


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -9,7 +9,7 @@
     ELSEIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
         SET(32BIT_MODE OFF)
     ELSE()
-        MESSAGE(FATAL_ERROR "Sorry, but OpenCOR can only be built in 32-bit or 64-bit...")
+        MESSAGE(FATAL_ERROR "Sorry, but OpenCOR can only be built in 32-bit or 64-bit mode...")
     ENDIF()

     # Required packages


Update cotire to version 1.7.8

Update cotire to version 1.7.8

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

+set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
+set (COTIRE_CMAKE_MODULE_VERSION "1.7.8")
+
 # activate select policies
+if (POLICY CMP0025)
+	# Compiler id for Apple Clang is now AppleClang
+	cmake_policy(SET CMP0025 NEW)
+endif()
+
+if (POLICY CMP0026)
+	# disallow use of the LOCATION target property
+	cmake_policy(SET CMP0026 NEW)
+endif()
+
 if (POLICY CMP0038)
 	# targets may not link directly to themselves
 	cmake_policy(SET CMP0038 NEW)
@@ -92,9 +105,6 @@
 	# only interpret if() arguments as variables or keywords when unquoted
 	cmake_policy(SET CMP0054 NEW)
 endif()
-
-set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.3")

 include(CMakeParseArguments)
 include(ProcessorCount)
@@ -321,7 +331,7 @@
 			list (FIND _targetRequirements ${_library} _index)
 			if (_index LESS 0)
 				list (APPEND _targetRequirements ${_library})
-				# process transitive libraries
+				# BFS traversal of transitive libraries
 				get_target_property(_libraries ${_library} INTERFACE_LINK_LIBRARIES)
 				if (_libraries)
 					list (APPEND _librariesToProcess ${_libraries})
@@ -379,6 +389,24 @@
 	set (${_unmatchedOptionsVar} ${_unmatchedOptions} PARENT_SCOPE)
 endfunction()

+function (cotire_is_target_supported _target _isSupportedVar)
+	if (NOT TARGET "${_target}")
+		set (${_isSupportedVar} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	get_target_property(_imported ${_target} IMPORTED)
+	if (_imported)
+		set (${_isSupportedVar} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	get_target_property(_targetType ${_target} TYPE)
+	if (NOT _targetType MATCHES "EXECUTABLE|(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+		set (${_isSupportedVar} FALSE PARENT_SCOPE)
+		return()
+	endif()
+	set (${_isSupportedVar} TRUE PARENT_SCOPE)
+endfunction()
+
 function (cotire_get_target_compile_flags _config _language _target _flagsVar)
 	string (TOUPPER "${_config}" _upperConfig)
 	# collect options from CMake language variables
@@ -454,6 +482,17 @@
 			endif()
 		endif()
 	endif()
+	# handle visibility target properties
+	if (_target)
+		get_target_property(_targetVisibility ${_target} ${_language}_VISIBILITY_PRESET)
+		if (_targetVisibility AND CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY)
+			list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY}${_targetVisibility}")
+		endif()
+		get_target_property(_targetVisibilityInlines ${_target} VISIBILITY_INLINES_HIDDEN)
+		if (_targetVisibilityInlines AND CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN)
+			list (APPEND _compileFlags "${CMAKE_${_language}_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN}")
+		endif()
+	endif()
 	# platform specific flags
 	if (APPLE)
 		get_target_property(_architectures ${_target} OSX_ARCHITECTURES_${_upperConfig})
@@ -494,12 +533,31 @@
 		list (APPEND _includeDirs "${CMAKE_CURRENT_BINARY_DIR}")
 		list (APPEND _includeDirs "${CMAKE_CURRENT_SOURCE_DIR}")
 	endif()
-	# parse additional include directories from target compile flags
 	set (_targetFlags "")
 	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
-	cotire_filter_compile_flags("${_language}" "I" _dirs _ignore ${_targetFlags})
-	if (_dirs)
-		list (APPEND _includeDirs ${_dirs})
+	# parse additional include directories from target compile flags
+	if (CMAKE_INCLUDE_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_dirs "")
+			cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+			if (_dirs)
+				list (APPEND _includeDirs ${_dirs})
+			endif()
+		endif()
+	endif()
+	# parse additional system include directories from target compile flags
+	if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_dirs "")
+			cotire_filter_compile_flags("${_language}" "${_includeFlag}" _dirs _ignore ${_targetFlags})
+			if (_dirs)
+				list (APPEND _systemIncludeDirs ${_dirs})
+			endif()
+		endif()
 	endif()
 	# target include directories
 	get_directory_property(_dirs DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" INCLUDE_DIRECTORIES)
@@ -518,6 +576,21 @@
 		set (_linkedTargets "")
 		cotire_get_target_usage_requirements(${_target} _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
+				_linkedTargetType MATCHES "(STATIC|SHARED|MODULE|OBJECT)_LIBRARY")
+				# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE refers to CMAKE_CURRENT_BINARY_DIR and CMAKE_CURRENT_SOURCE_DIR
+				# at the time, when the target was created. These correspond to the target properties BINARY_DIR and SOURCE_DIR
+				# which are only available with CMake 3.4 or later.
+				get_target_property(_targetDirs ${_linkedTarget} BINARY_DIR)
+				if (_targetDirs)
+					list (APPEND _dirs ${_targetDirs})
+				endif()
+				get_target_property(_targetDirs ${_linkedTarget} SOURCE_DIR)
+				if (_targetDirs)
+					list (APPEND _dirs ${_targetDirs})
+				endif()
+			endif()
 			get_target_property(_targetDirs ${_linkedTarget} INTERFACE_INCLUDE_DIRECTORIES)
 			if (_targetDirs)
 				list (APPEND _dirs ${_targetDirs})
@@ -638,8 +711,23 @@
 	# parse target compile flags omitting compile definitions and include directives
 	set (_targetFlags "")
 	cotire_get_target_compile_flags("${_config}" "${_language}" "${_target}" _targetFlags)
+	set (_flagFilter "D")
+	if (CMAKE_INCLUDE_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_flagFilter "${_flagFilter}|${_includeFlag}")
+		endif()
+	endif()
+	if (CMAKE_INCLUDE_SYSTEM_FLAG_${_language})
+		string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" _includeFlag)
+		string (REGEX REPLACE "^[-/]+" "" _includeFlag "${_includeFlag}")
+		if (_includeFlag)
+			set (_flagFilter "${_flagFilter}|${_includeFlag}")
+		endif()
+	endif()
 	set (_compilerFlags "")
-	cotire_filter_compile_flags("${_language}" "[ID]" _ignore _compilerFlags ${_targetFlags})
+	cotire_filter_compile_flags("${_language}" "${_flagFilter}" _ignore _compilerFlags ${_targetFlags})
 	if (COTIRE_DEBUG AND _compilerFlags)
 		message (STATUS "Target ${_target} compiler flags: ${_compilerFlags}")
 	endif()
@@ -760,7 +848,10 @@
 	endif()
 endmacro()

-function (cotire_init_compile_cmd _cmdVar _language _compilerExe _compilerArg1)
+function (cotire_init_compile_cmd _cmdVar _language _compilerLauncher _compilerExe _compilerArg1)
+	if (NOT _compilerLauncher)
+		set (_compilerLauncher ${CMAKE_${_language}_COMPILER_LAUNCHER})
+	endif()
 	if (NOT _compilerExe)
 		set (_compilerExe "${CMAKE_${_language}_COMPILER}")
 	endif()
@@ -768,7 +859,12 @@
 		set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
 	endif()
 	string (STRIP "${_compilerArg1}" _compilerArg1)
-	set (${_cmdVar} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		# compiler launcher is only supported for Makefile and Ninja
+		set (${_cmdVar} ${_compilerLauncher} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	else()
+		set (${_cmdVar} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	endif()
 endfunction()

 macro (cotire_add_definitions_to_cmd _cmdVar _language)
@@ -781,39 +877,66 @@
 	endforeach()
 endmacro()

-macro (cotire_add_includes_to_cmd _cmdVar _language _includeSystemFlag _includesVar _systemIncludesVar)
-	foreach (_include ${${_includesVar}})
-		if (WIN32 AND CMAKE_${_language}_COMPILER_ID MATCHES "MSVC|Intel")
-			file (TO_NATIVE_PATH "${_include}" _include)
-			list (APPEND ${_cmdVar} "/I${_include}")
-		else()
-			list (FIND ${_systemIncludesVar} ${_include} _index)
-			if(_index GREATER -1 AND NOT "${_includeSystemFlag}" STREQUAL "")
-				list (APPEND ${_cmdVar} "${_includeSystemFlag}${_include}")
+function (cotire_add_includes_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
+	set (_includeDirs ${${_includesVar}} ${${_systemIncludesVar}})
+	if (_includeDirs)
+		list (REMOVE_DUPLICATES _includeDirs)
+		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}")
 			else()
-				list (APPEND ${_cmdVar} "-I${_include}")
-			endif()
-		endif()
-	endforeach()
-endmacro()
-
-macro (cotire_add_frameworks_to_cmd _cmdVar _language)
+				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}")
+				else()
+					list (APPEND ${_cmdVar} "${CMAKE_INCLUDE_FLAG_${_language}}${CMAKE_INCLUDE_FLAG_${_language}_SEP}${_include}")
+				endif()
+			endif()
+		endforeach()
+	endif()
+	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()
+
+function (cotire_add_frameworks_to_cmd _cmdVar _language _includesVar _systemIncludesVar)
 	if (APPLE)
-		set (_frameWorkDirs "")
-		foreach (_include ${ARGN})
+		set (_frameworkDirs "")
+		foreach (_include ${${_includesVar}})
 			if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
-				get_filename_component(_frameWorkDir "${_include}" PATH)
-				list (APPEND _frameWorkDirs "${_frameWorkDir}")
+				get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+				list (APPEND _frameworkDirs "${_frameworkDir}")
 			endif()
 		endforeach()
-		if (_frameWorkDirs)
-			list (REMOVE_DUPLICATES _frameWorkDirs)
-			foreach (_frameWorkDir ${_frameWorkDirs})
-				list (APPEND ${_cmdVar} "-F${_frameWorkDir}")
+		set (_systemFrameworkDirs "")
+		foreach (_include ${${_systemIncludesVar}})
+			if (IS_ABSOLUTE "${_include}" AND _include MATCHES "\\.framework$")
+				get_filename_component(_frameworkDir "${_include}" DIRECTORY)
+				list (APPEND _systemFrameworkDirs "${_frameworkDir}")
+			endif()
+		endforeach()
+		if (_systemFrameworkDirs)
+			list (APPEND _frameworkDirs ${_systemFrameworkDirs})
+		endif()
+		if (_frameworkDirs)
+			list (REMOVE_DUPLICATES _frameworkDirs)
+			foreach (_frameworkDir ${_frameworkDirs})
+				set (_index -1)
+				if ("${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}" MATCHES ".+")
+					list (FIND _systemFrameworkDirs "${_frameworkDir}" _index)
+				endif()
+				if (_index GREATER -1)
+					list (APPEND ${_cmdVar} "${CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+				else()
+					list (APPEND ${_cmdVar} "${CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG}${_frameworkDir}")
+				endif()
 			endforeach()
 		endif()
 	endif()
-endmacro()
+	set (${_cmdVar} ${${_cmdVar}} PARENT_SCOPE)
+endfunction()

 macro (cotire_add_compile_flags_to_cmd _cmdVar)
 	foreach (_flag ${ARGN})
@@ -1061,9 +1184,9 @@

 function (cotire_scan_includes _includesVar)
 	set(_options "")
-	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_VERSION INCLUDE_SYSTEM_FLAG LANGUAGE UNPARSED_LINES)
+	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES)
 	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES
-		IGNORE_PATH INCLUDE_PATH IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH)
+		IGNORE_PATH INCLUDE_PATH IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
 	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
 	set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
 	if (NOT _option_LANGUAGE)
@@ -1075,12 +1198,11 @@
 	if (NOT _option_COMPILER_VERSION)
 		set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
 	endif()
-	set (_cmd "${_option_COMPILER_EXECUTABLE}" ${_option_COMPILER_ARG1})
-	cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
+	cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_LAUNCHER}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
 	cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
 	cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
-	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" "${_option_INCLUDE_SYSTEM_FLAG}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
-	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_INCLUDE_DIRECTORIES})
+	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
 	cotire_add_makedep_flags("${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}" _cmd)
 	# only consider existing source files for scanning
 	set (_existingSourceFiles "")
@@ -1273,10 +1395,10 @@

 function (cotire_generate_prefix_header _prefixFile)
 	set(_options "")
-	set(_oneValueArgs LANGUAGE COMPILER_EXECUTABLE COMPILER_ID COMPILER_VERSION INCLUDE_SYSTEM_FLAG)
+	set(_oneValueArgs LANGUAGE COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_ID COMPILER_VERSION)
 	set(_multiValueArgs DEPENDS COMPILE_DEFINITIONS COMPILE_FLAGS
 		INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES IGNORE_PATH INCLUDE_PATH
-		IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH)
+		IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
 	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
 	if (NOT _option_COMPILER_ID)
 		set (_option_COMPILER_ID "${CMAKE_${_option_LANGUAGE}_ID}")
@@ -1309,13 +1431,14 @@
 	set (_sourceFiles ${_option_UNPARSED_ARGUMENTS})
 	cotire_scan_includes(_selectedHeaders ${_sourceFiles}
 		LANGUAGE "${_option_LANGUAGE}"
+		COMPILER_LAUNCHER "${_option_COMPILER_LAUNCHER}"
 		COMPILER_EXECUTABLE "${_option_COMPILER_EXECUTABLE}"
+		COMPILER_ARG1 "${_option_COMPILER_ARG1}"
 		COMPILER_ID "${_option_COMPILER_ID}"
 		COMPILER_VERSION "${_option_COMPILER_VERSION}"
 		COMPILE_DEFINITIONS ${_option_COMPILE_DEFINITIONS}
 		COMPILE_FLAGS ${_option_COMPILE_FLAGS}
 		INCLUDE_DIRECTORIES ${_option_INCLUDE_DIRECTORIES}
-		INCLUDE_SYSTEM_FLAG ${_option_INCLUDE_SYSTEM_FLAG}
 		SYSTEM_INCLUDE_DIRECTORIES ${_option_SYSTEM_INCLUDE_DIRECTORIES}
 		IGNORE_PATH ${_option_IGNORE_PATH}
 		INCLUDE_PATH ${_option_INCLUDE_PATH}
@@ -1508,7 +1631,7 @@
 			# -Kc++ process all source or unrecognized file types as C++ source files
 			# -fsyntax-only check only for correct syntax
 			# -Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
-			get_filename_component(_pchDir "${_pchFile}" PATH)
+			get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
 			get_filename_component(_pchName "${_pchFile}" NAME)
 			set (_xLanguage_C "c-header")
 			set (_xLanguage_CXX "c++-header")
@@ -1634,7 +1757,7 @@
 			# -include process include file as the first line of the primary source file
 			# -Wpch-messages enable diagnostics related to pre-compiled headers (requires Intel XE 2013 Update 2)
 			if (_pchFile)
-				get_filename_component(_pchDir "${_pchFile}" PATH)
+				get_filename_component(_pchDir "${_pchFile}" DIRECTORY)
 				get_filename_component(_pchName "${_pchFile}" NAME)
 				if (_flags)
 					# append to list
@@ -1668,8 +1791,8 @@

 function (cotire_precompile_prefix_header _prefixFile _pchFile _hostFile)
 	set(_options "")
-	set(_oneValueArgs COMPILER_EXECUTABLE COMPILER_ID COMPILER_VERSION INCLUDE_SYSTEM_FLAG LANGUAGE)
-	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES SYS)
+	set(_oneValueArgs COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_ID COMPILER_VERSION LANGUAGE)
+	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES SYS COMPILER_LAUNCHER)
 	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
 	if (NOT _option_LANGUAGE)
 		set (_option_LANGUAGE "CXX")
@@ -1680,11 +1803,11 @@
 	if (NOT _option_COMPILER_VERSION)
 		set (_option_COMPILER_VERSION "${CMAKE_${_option_LANGUAGE}_COMPILER_VERSION}")
 	endif()
-	cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
+	cotire_init_compile_cmd(_cmd "${_option_LANGUAGE}" "${_option_COMPILER_LAUNCHER}" "${_option_COMPILER_EXECUTABLE}" "${_option_COMPILER_ARG1}")
 	cotire_add_definitions_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_COMPILE_DEFINITIONS})
 	cotire_add_compile_flags_to_cmd(_cmd ${_option_COMPILE_FLAGS})
-	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" "${_option_INCLUDE_SYSTEM_FLAG}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
-	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" ${_option_INCLUDE_DIRECTORIES})
+	cotire_add_includes_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
+	cotire_add_frameworks_to_cmd(_cmd "${_option_LANGUAGE}" _option_INCLUDE_DIRECTORIES _option_SYSTEM_INCLUDE_DIRECTORIES)
 	cotire_add_pch_compilation_flags(
 		"${_option_LANGUAGE}" "${_option_COMPILER_ID}" "${_option_COMPILER_VERSION}"
 		"${_prefixFile}" "${_pchFile}" "${_hostFile}" _cmd)
@@ -1731,7 +1854,8 @@
 	else()
 		set (${_msgVar} "${_unsupportedCompiler}." PARENT_SCOPE)
 	endif()
-	if (CMAKE_${_language}_COMPILER MATCHES "ccache")
+	get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
+	if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
 		if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros|pch_defines")
 			set (${_msgVar}
 				"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
@@ -1961,14 +2085,6 @@
 	# depend on target source files marked with custom COTIRE_DEPENDENCY property
 	get_target_property(_targetSourceFiles ${_target} SOURCES)
 	cotire_get_objects_with_property_on(_dependencySources COTIRE_DEPENDENCY SOURCE ${_targetSourceFiles})
-	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
-		# GCC and clang raise a fatal error if a file is not found during preprocessing
-		# thus we depend on target's generated source files for prefix header generation
-		cotire_get_objects_with_property_on(_generatedSources GENERATED SOURCE ${_targetSourceFiles})
-		if (_generatedSources)
-			list (APPEND _dependencySources ${_generatedSources})
-		endif()
-	endif()
 	if (COTIRE_DEBUG AND _dependencySources)
 		message (STATUS "${_language} ${_target} prefix header dependencies: ${_dependencySources}")
 	endif()
@@ -1991,7 +2107,6 @@
 	get_target_property(COTIRE_TARGET_INCLUDE_PRIORITY_PATH ${_target} COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH)
 	cotire_get_source_files_undefs(COTIRE_UNITY_SOURCE_PRE_UNDEFS COTIRE_TARGET_SOURCES_PRE_UNDEFS ${_targetSources})
 	cotire_get_source_files_undefs(COTIRE_UNITY_SOURCE_POST_UNDEFS COTIRE_TARGET_SOURCES_POST_UNDEFS ${_targetSources})
-	string (STRIP "${CMAKE_INCLUDE_SYSTEM_FLAG_${_language}}" COTIRE_INCLUDE_SYSTEM_FLAG)
 	set (COTIRE_TARGET_CONFIGURATION_TYPES "${_configurations}")
 	foreach (_config ${_configurations})
 		string (TOUPPER "${_config}" _upperConfig)
@@ -2004,6 +2119,7 @@
 		cotire_get_source_files_compile_definitions(
 			"${_config}" "${_language}" COTIRE_TARGET_SOURCES_COMPILE_DEFINITIONS_${_upperConfig} ${_targetSources})
 	endforeach()
+	get_target_property(COTIRE_TARGET_${_language}_COMPILER_LAUNCHER ${_target} ${_language}_COMPILER_LAUNCHER)
 	# set up COTIRE_TARGET_SOURCES
 	set (COTIRE_TARGET_SOURCES "")
 	foreach (_sourceFile ${_targetSources})
@@ -2019,14 +2135,23 @@
 	# copy variable definitions to cotire target script
 	get_cmake_property(_vars VARIABLES)
 	string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+" _matchVars "${_vars}")
-	# remove COTIRE_VERBOSE which is passed as a CMake define on command line
+	# omit COTIRE_*_INIT variables
+	string (REGEX MATCHALL "COTIRE_[A-Za-z0-9_]+_INIT" _initVars "${_matchVars}")
+	if (_initVars)
+		list (REMOVE_ITEM _matchVars ${_initVars})
+	endif()
+	# omit COTIRE_VERBOSE which is passed as a CMake define on command line
 	list (REMOVE_ITEM _matchVars COTIRE_VERBOSE)
 	set (_contents "")
 	set (_contentsHasGeneratorExpressions FALSE)
 	foreach (_var IN LISTS _matchVars ITEMS
 		XCODE MSVC CMAKE_GENERATOR CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES
 		CMAKE_${_language}_COMPILER_ID CMAKE_${_language}_COMPILER_VERSION
-		CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
+		CMAKE_${_language}_COMPILER_LAUNCHER CMAKE_${_language}_COMPILER CMAKE_${_language}_COMPILER_ARG1
+		CMAKE_INCLUDE_FLAG_${_language} CMAKE_INCLUDE_FLAG_${_language}_SEP
+		CMAKE_INCLUDE_SYSTEM_FLAG_${_language}
+		CMAKE_${_language}_FRAMEWORK_SEARCH_FLAG
+		CMAKE_${_language}_SYSTEM_FRAMEWORK_SEARCH_FLAG
 		CMAKE_${_language}_SOURCE_FILE_EXTENSIONS)
 		if (DEFINED ${_var})
 			string (REPLACE "\"" "\\\"" _value "${${_var}}")
@@ -2076,7 +2201,11 @@
 		if (_targetScript)
 			cotire_set_cmd_to_prologue(_cmds)
 			list (APPEND _cmds -P "${COTIRE_CMAKE_MODULE_FILE}" "precompile" "${_targetScript}" "${_prefixFile}" "${_pchFile}" "${_hostFile}")
-			file (RELATIVE_PATH _pchFileRelPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
+			if (MSVC_IDE)
+				file (TO_NATIVE_PATH "${_pchFile}" _pchFileLogPath)
+			else()
+				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
+			endif()
 			if (COTIRE_DEBUG)
 				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
 			endif()
@@ -2087,7 +2216,7 @@
 				DEPENDS "${_prefixFile}"
 				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
 				WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
-				COMMENT "Building ${_language} precompiled header ${_pchFileRelPath}"
+				COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"
 				VERBATIM)
 		endif()
 	endif()
@@ -2172,19 +2301,23 @@
 		message (STATUS "add_custom_command: OUTPUT ${_joinedFile} COMMAND ${_prefixCmd} DEPENDS ${_files}")
 	endif()
 	set_property (SOURCE "${_joinedFile}" PROPERTY GENERATED TRUE)
-	file (RELATIVE_PATH _joinedFileRelPath "${CMAKE_BINARY_DIR}" "${_joinedFile}")
+	if (MSVC_IDE)
+		file (TO_NATIVE_PATH "${_joinedFile}" _joinedFileLogPath)
+	else()
+		file (RELATIVE_PATH _joinedFileLogPath "${CMAKE_BINARY_DIR}" "${_joinedFile}")
+	endif()
 	get_filename_component(_joinedFileBaseName "${_joinedFile}" NAME_WE)
 	get_filename_component(_joinedFileExt "${_joinedFile}" EXT)
 	if (_language AND _joinedFileBaseName MATCHES "${COTIRE_UNITY_SOURCE_FILENAME_SUFFIX}$")
-		set (_comment "Generating ${_language} unity source ${_joinedFileRelPath}")
+		set (_comment "Generating ${_language} unity source ${_joinedFileLogPath}")
 	elseif (_language AND _joinedFileBaseName MATCHES "${COTIRE_PREFIX_HEADER_FILENAME_SUFFIX}$")
 		if (_joinedFileExt MATCHES "^\\.c")
-			set (_comment "Generating ${_language} prefix source ${_joinedFileRelPath}")
-		else()
-			set (_comment "Generating ${_language} prefix header ${_joinedFileRelPath}")
+			set (_comment "Generating ${_language} prefix source ${_joinedFileLogPath}")
+		else()
+			set (_comment "Generating ${_language} prefix header ${_joinedFileLogPath}")
 		endif()
 	else()
-		set (_comment "Generating ${_joinedFileRelPath}")
+		set (_comment "Generating ${_joinedFileLogPath}")
 	endif()
 	add_custom_command(
 		OUTPUT "${_joinedFile}"
@@ -2285,7 +2418,11 @@
 			# CMake 3.1.0 supports generator expressions in arguments to DEPENDS
 			set (_unityCmdDepends "${_targetConfigScript}")
 		endif()
-		file (RELATIVE_PATH _unityFileRelPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
+		if (MSVC_IDE)
+			file (TO_NATIVE_PATH "${_unityFile}" _unityFileLogPath)
+		else()
+			file (RELATIVE_PATH _unityFileLogPath "${CMAKE_BINARY_DIR}" "${_unityFile}")
+		endif()
 		if (COTIRE_DEBUG)
 			message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_unityCmdDepends}")
 		endif()
@@ -2293,41 +2430,55 @@
 			OUTPUT "${_unityFile}"
 			COMMAND ${_unityCmd}
 			DEPENDS ${_unityCmdDepends}
-			COMMENT "Generating ${_language} unity source ${_unityFileRelPath}"
+			COMMENT "Generating ${_language} unity source ${_unityFileLogPath}"
 			WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 			VERBATIM)
 		list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
 	endforeach()
-	list (LENGTH _unityFiles _numberOfUnityFiles)
-	if (_numberOfUnityFiles GREATER 1)
-		# create a joint unity file from all unity file segments
-		cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
-		cotire_setup_combine_command(${_language} "${_targetConfigScript}" "${_unityFile}" ${_cmdsVar} ${_unityFiles})
-	endif()
 	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
 endfunction()

-function (cotire_setup_prefix_generation_command _language _target _targetScript _prefixFile _unityFile _cmdsVar)
+function (cotire_setup_prefix_generation_command _language _target _targetScript _prefixFile _unityFiles _cmdsVar)
 	set (_sourceFiles ${ARGN})
 	set (_dependencySources "")
 	cotire_get_prefix_header_dependencies(${_language} ${_target} _dependencySources ${_sourceFiles})
 	cotire_set_cmd_to_prologue(_prefixCmd)
-	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" "${_unityFile}")
+	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
 	set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
 	if (COTIRE_DEBUG)
 		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
 	endif()
-	file (RELATIVE_PATH _prefixFileRelPath "${CMAKE_BINARY_DIR}" "${_prefixFile}")
+	if (MSVC_IDE)
+		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
+	else()
+		file (RELATIVE_PATH _prefixFileLogPath "${CMAKE_BINARY_DIR}" "${_prefixFile}")
+	endif()
 	get_filename_component(_prefixFileExt "${_prefixFile}" EXT)
 	if (_prefixFileExt MATCHES "^\\.c")
-		set (_comment "Generating ${_language} prefix source ${_prefixFileRelPath}")
+		set (_comment "Generating ${_language} prefix source ${_prefixFileLogPath}")
 	else()
-		set (_comment "Generating ${_language} prefix header ${_prefixFileRelPath}")
+		set (_comment "Generating ${_language} prefix header ${_prefixFileLogPath}")
+	endif()
+	# prevent pre-processing errors upon generating the prefix header when a target's generated include file does not yet exist
+	# we do not add a file-level dependency for the target's generated files though, because we only want to depend on their existence
+	# thus we make the prefix header generation depend on a custom helper target which triggers the generation of the files
+	set (_preTargetName "${_target}${COTIRE_PCH_TARGET_SUFFIX}_pre")
+	if (TARGET ${_preTargetName})
+		# custom helper target has already been generated while processing a different language
+		list (APPEND _dependencySources ${_preTargetName})
+	else()
+		get_target_property(_targetSourceFiles ${_target} SOURCES)
+		cotire_get_objects_with_property_on(_generatedSources GENERATED SOURCE ${_targetSourceFiles})
+		if (_generatedSources)
+			add_custom_target("${_preTargetName}" DEPENDS ${_generatedSources})
+			cotire_init_target("${_preTargetName}")
+			list (APPEND _dependencySources ${_preTargetName})
+		endif()
 	endif()
 	add_custom_command(
 		OUTPUT "${_prefixFile}" "${_prefixFile}.log"
 		COMMAND ${_prefixCmd}
-		DEPENDS "${_unityFile}" ${_dependencySources}
+		DEPENDS ${_unityFiles} ${_dependencySources}
 		COMMENT "${_comment}"
 		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 		VERBATIM)
@@ -2343,17 +2494,9 @@
 	else()
 		set (_prefixSourceFile "${_prefixFile}")
 	endif()
-	list (LENGTH _unityFiles _numberOfUnityFiles)
-	if (_numberOfUnityFiles GREATER 1)
-		cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
-		cotire_setup_prefix_generation_command(
-			${_language} ${_target} "${_targetScript}"
-			"${_prefixSourceFile}" "${_unityFile}" ${_cmdsVar} ${_sourceFiles})
-	else()
-		cotire_setup_prefix_generation_command(
-			${_language} ${_target} "${_targetScript}"
-			"${_prefixSourceFile}" "${_unityFiles}" ${_cmdsVar} ${_sourceFiles})
-	endif()
+	cotire_setup_prefix_generation_command(
+		${_language} ${_target} "${_targetScript}"
+		"${_prefixSourceFile}" "${_unityFiles}" ${_cmdsVar} ${_sourceFiles})
 	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
 		# set up generation of a prefix source file which includes the prefix header
 		cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixFile}" _cmds ${_prefixSourceFile})
@@ -2496,7 +2639,7 @@
 			set (${_targetLanguagesVar} "" PARENT_SCOPE)
 			return()
 		endif()
-		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$")
+		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND NOT "${CMAKE_${_language}_COMPILER_ID}" STREQUAL "")
 			cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
 			if (_disableMsg)
 				set (_targetUsePCH FALSE)
@@ -2614,14 +2757,22 @@
 	endif()
 	cotire_generate_target_script(
 		${_language} "${_configurations}" ${_target} _targetScript _targetConfigScript ${_unitySourceFiles})
+	# set up unity files for parallel compilation
 	cotire_compute_unity_max_number_of_includes(${_target} _maxIncludes ${_unitySourceFiles})
 	cotire_make_unity_source_file_paths(${_language} ${_target} ${_maxIncludes} _unityFiles ${_unitySourceFiles})
-	if (NOT _unityFiles)
+	list (LENGTH _unityFiles _numberOfUnityFiles)
+	if (_numberOfUnityFiles EQUAL 0)
 		return()
-	endif()
+	elseif (_numberOfUnityFiles GREATER 1)
+		cotire_setup_unity_generation_commands(
+			${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+	endif()
+	# set up single unity file for prefix header generation
+	cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
 	cotire_setup_unity_generation_commands(
-		${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+		${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFile}" _cmds ${_unitySourceFiles})
 	cotire_make_prefix_file_path(${_language} ${_target} _prefixFile)
+	# set up prefix header
 	if (_prefixFile)
 		# check for user provided prefix header files
 		get_property(_prefixHeaderFiles TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER_INIT)
@@ -2630,7 +2781,7 @@
 				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" _cmds ${_prefixHeaderFiles})
 		else()
 			cotire_setup_prefix_generation_from_unity_command(
-				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_unityFile}" _cmds ${_unitySourceFiles})
 		endif()
 		# check if selected language has enough sources at all
 		list (LENGTH _sourceFiles _numberOfSources)
@@ -2837,6 +2988,8 @@
 		INCLUDE_DIRECTORIES
 		INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_<CONFIG>
 		POSITION_INDEPENDENT_CODE
+		C_COMPILER_LAUNCHER CXX_COMPILER_LAUNCHER
+		C_INCLUDE_WHAT_YOU_USE CXX_INCLUDE_WHAT_YOU_USE
 		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN)
 	# copy compile features
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
@@ -2866,22 +3019,32 @@
 		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}
-		BUNDLE BUNDLE_EXTENSION FRAMEWORK 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)
+		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)
 	# copy Windows platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		GNUtoMS
 		COMPILE_PDB_NAME COMPILE_PDB_NAME_<CONFIG>
 		COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG>
 		PDB_NAME PDB_NAME_<CONFIG> PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_<CONFIG>
-		VS_DOTNET_REFERENCES VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE
-		VS_KEYWORD VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
-		VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES VS_WINRT_COMPONENT
-		VS_DOTNET_TARGET_FRAMEWORK_VERSION WIN32_EXECUTABLE)
+		VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION
+		VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE
+		VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK
+		VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION
+		VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
+		VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
+		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
+		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS)
 	# copy Android platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
-		ANDROID_API ANDROID_API_MIN ANDROID_GUI)
+		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)
 	# use output name from original target
 	get_target_property(_targetOutputName ${_unityTargetName} OUTPUT_NAME)
 	if (NOT _targetOutputName)
@@ -2911,10 +3074,16 @@
 	if (NOT _option_CONFIGURATIONS)
 		cotire_get_configuration_types(_option_CONFIGURATIONS)
 	endif()
-	# trivial checks
-	get_target_property(_imported ${_target} IMPORTED)
-	if (_imported)
-		message (WARNING "cotire: imported target ${_target} cannot be cotired.")
+	# check if cotire can be applied to target at all
+	cotire_is_target_supported(${_target} _isSupported)
+	if (NOT _isSupported)
+		get_target_property(_imported ${_target} IMPORTED)
+		get_target_property(_targetType ${_target} TYPE)
+		if (_imported)
+			message (WARNING "cotire: imported ${_targetType} target ${_target} cannot be cotired.")
+		else()
+			message (STATUS "cotire: ${_targetType} target ${_target} cannot be cotired.")
+		endif()
 		return()
 	endif()
 	# resolve alias
@@ -2979,11 +3148,27 @@
 function (cotire_map_libraries _strategy _mappedLibrariesVar)
 	set (_mappedLibraries "")
 	foreach (_library ${ARGN})
-		if (TARGET "${_library}" AND "${_strategy}" MATCHES "COPY_UNITY")
-			# use target's corresponding unity target, if available
-			get_target_property(_libraryUnityTargetName ${_library} COTIRE_UNITY_TARGET_NAME)
-			if (TARGET "${_libraryUnityTargetName}")
-				list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
+		if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$")
+			set (_libraryName "${CMAKE_MATCH_1}")
+			set (_linkOnly TRUE)
+		else()
+			set (_libraryName "${_library}")
+			set (_linkOnly FALSE)
+		endif()
+		if ("${_strategy}" MATCHES "COPY_UNITY")
+			cotire_is_target_supported(${_libraryName} _isSupported)
+			if (_isSupported)
+				# use target's corresponding unity target, if available
+				get_target_property(_libraryUnityTargetName ${_libraryName} COTIRE_UNITY_TARGET_NAME)
+				if (TARGET "${_libraryUnityTargetName}")
+					if (_linkOnly)
+						list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>")
+					else()
+						list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
+					endif()
+				else()
+					list (APPEND _mappedLibraries "${_library}")
+				endif()
 			else()
 				list (APPEND _mappedLibraries "${_library}")
 			endif()
@@ -2996,6 +3181,10 @@
 endfunction()

 function (cotire_target_link_libraries _target)
+	cotire_is_target_supported(${_target} _isSupported)
+	if (NOT _isSupported)
+		return()
+	endif()
 	get_target_property(_unityTargetName ${_target} COTIRE_UNITY_TARGET_NAME)
 	if (TARGET "${_unityTargetName}")
 		get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
@@ -3003,21 +3192,21 @@
 			message (STATUS "unity target ${_unityTargetName} link strategy: ${_linkLibrariesStrategy}")
 		endif()
 		if ("${_linkLibrariesStrategy}" MATCHES "^(COPY|COPY_UNITY)$")
-			set (_unityLinkLibraries "")
 			get_target_property(_linkLibraries ${_target} LINK_LIBRARIES)
 			if (_linkLibraries)
-				list (APPEND _unityLinkLibraries ${_linkLibraries})
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkLibraries ${_linkLibraries})
+				set_target_properties(${_unityTargetName} PROPERTIES LINK_LIBRARIES "${_unityLinkLibraries}")
+				if (COTIRE_DEBUG)
+					message (STATUS "unity target ${_unityTargetName} link libraries: ${_unityLinkLibraries}")
+				endif()
 			endif()
 			get_target_property(_interfaceLinkLibraries ${_target} INTERFACE_LINK_LIBRARIES)
 			if (_interfaceLinkLibraries)
-				list (APPEND _unityLinkLibraries ${_interfaceLinkLibraries})
-			endif()
-			cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkLibraries ${_unityLinkLibraries})
-			if (COTIRE_DEBUG)
-				message (STATUS "unity target ${_unityTargetName} libraries: ${_unityLinkLibraries}")
-			endif()
-			if (_unityLinkLibraries)
-				target_link_libraries(${_unityTargetName} ${_unityLinkLibraries})
+				cotire_map_libraries("${_linkLibrariesStrategy}" _unityLinkInterfaceLibraries ${_interfaceLinkLibraries})
+				set_target_properties(${_unityTargetName} PROPERTIES INTERFACE_LINK_LIBRARIES "${_unityLinkInterfaceLibraries}")
+				if (COTIRE_DEBUG)
+					message (STATUS "unity target ${_unityTargetName} interface link libraries: ${_unityLinkInterfaceLibraries}")
+				endif()
 			endif()
 		endif()
 	endif()
@@ -3032,7 +3221,7 @@
 	# filter files in intermediate directory
 	set (_filesToRemove "")
 	foreach (_file ${_cotireFiles})
-		get_filename_component(_dir "${_file}" PATH)
+		get_filename_component(_dir "${_file}" DIRECTORY)
 		get_filename_component(_dirName "${_dir}" NAME)
 		if ("${_dirName}" STREQUAL "${_cotireIntermediateDirName}")
 			list (APPEND _filesToRemove "${_file}")
@@ -3156,7 +3345,6 @@
 			message (STATUS "COTIRE_BUILD_TYPE=${COTIRE_BUILD_TYPE} not cotired (${COTIRE_TARGET_CONFIGURATION_TYPES})")
 		endif()
 		set (_sources "")
-		set (_sourceLocations "")
 		set (_sourcesDefinitions "")
 	endif()
 	set (_targetPreUndefs ${COTIRE_TARGET_PRE_UNDEFS})
@@ -3205,6 +3393,7 @@

 		cotire_generate_prefix_header(
 			"${COTIRE_ARGV3}" ${_files}
+			COMPILER_LAUNCHER "${COTIRE_TARGET_${COTIRE_TARGET_LANGUAGE}_COMPILER_LAUNCHER}"
 			COMPILER_EXECUTABLE "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER}"
 			COMPILER_ARG1 ${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ARG1}
 			COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
@@ -3214,7 +3403,6 @@
 			INCLUDE_PATH ${COTIRE_TARGET_INCLUDE_PATH}
 			IGNORE_EXTENSIONS "${CMAKE_${COTIRE_TARGET_LANGUAGE}_SOURCE_FILE_EXTENSIONS};${COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS}"
 			INCLUDE_PRIORITY_PATH ${COTIRE_TARGET_INCLUDE_PRIORITY_PATH}
-			INCLUDE_SYSTEM_FLAG "${COTIRE_INCLUDE_SYSTEM_FLAG}"
 			INCLUDE_DIRECTORIES ${_includeDirs}
 			SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
 			COMPILE_DEFINITIONS ${_compileDefinitions}
@@ -3232,12 +3420,12 @@

 		cotire_precompile_prefix_header(
 			"${COTIRE_ARGV3}" "${COTIRE_ARGV4}" "${COTIRE_ARGV5}"
+			COMPILER_LAUNCHER "${COTIRE_TARGET_${COTIRE_TARGET_LANGUAGE}_COMPILER_LAUNCHER}"
 			COMPILER_EXECUTABLE "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER}"
 			COMPILER_ARG1 ${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ARG1}
 			COMPILER_ID "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_ID}"
 			COMPILER_VERSION "${CMAKE_${COTIRE_TARGET_LANGUAGE}_COMPILER_VERSION}"
 			LANGUAGE "${COTIRE_TARGET_LANGUAGE}"
-			INCLUDE_SYSTEM_FLAG "${COTIRE_INCLUDE_SYSTEM_FLAG}"
 			INCLUDE_DIRECTORIES ${_includeDirs}
 			SYSTEM_INCLUDE_DIRECTORIES ${_systemIncludeDirs}
 			COMPILE_DEFINITIONS ${_compileDefinitions}
@@ -3358,9 +3546,9 @@
 	endif()
 	if (MSVC)
 		# MSVC default PCH memory scaling factor of 100 percent (75 MB) is too small for template heavy C++ code
-		# use a bigger default factor of 140 percent (105 MB)
+		# use a bigger default factor of 170 percent (128 MB)
 		if (NOT DEFINED COTIRE_PCH_MEMORY_SCALING_FACTOR)
-			set (COTIRE_PCH_MEMORY_SCALING_FACTOR "140")
+			set (COTIRE_PCH_MEMORY_SCALING_FACTOR "170")
 		endif()
 	endif()
 	if (NOT COTIRE_UNITY_BUILD_TARGET_SUFFIX)