[FIX] Fixing CTD creation, should work again.

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

--- util/cmake/SeqAnCtdSetup.cmake
+++ util/cmake/SeqAnCtdSetup.cmake
@@ -74,7 +74,7 @@

 # We will create the contents of the payload directory temporarily within the
 # output directory.
-set (PAYLOAD_TMP_PATH ${WORKFLOW_PLUGIN_DIR}/payload.tmp)
+set (PAYLOAD_TMP_PATH ${CMAKE_BINARY_DIR}/CMakeFiles/payload.tmp)
 set (PAYLOAD_TMP_BIN_PATH ${PAYLOAD_TMP_PATH}/bin)

 # ============================================================================
@@ -90,7 +90,7 @@
                     DEPENDS ${WORKFLOW_PLUGIN_DIR})
 # Create directory: workflow_plugin_dir/descriptors
 add_custom_command (OUTPUT ${CTD_PATH}
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKFLOW_PLUGIN_DIR}
+                    COMMAND ${CMAKE_COMMAND} -E make_directory ${CTD_PATH}
                     DEPENDS ${WORKFLOW_PLUGIN_DIR})
 # Create directory: workflow_plugin_dir/payload
 add_custom_command (OUTPUT ${PAYLOAD_PATH}
@@ -183,6 +183,31 @@
 endforeach ()

 # ============================================================================
+# Eclipse Plugin Files.
+# ============================================================================
+
+# If possible, get latest change date from SeqAn SVN.
+find_package(Subversion)
+if (Subversion_FOUND)
+  file (TO_CMAKE_PATH "${CMAKE_SOURCE_DIR}" _SEQAN_SOURCE_DIR)
+  Subversion_WC_INFO (${_SEQAN_SOURCE_DIR} SEQAN)
+  string(REGEX REPLACE "^([0-9]+)-([0-9]+)-([0-9]+) ([0-9]+):([0-9]+).*"
+    "\\1\\2\\3\\4\\5" SEQAN_LAST_CHANGE_DATE "${SEQAN_WC_LAST_CHANGED_DATE}")
+  set (CF_SEQAN_VERSION ${SEQAN_VERSION_STRING}.${SEQAN_LAST_CHANGE_DATE})
+else ()
+  set (CF_SEQAN_VERSION "${SEQAN_VERSION_STRING}")
+endif ()
+
+# plugin.properties
+add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}/plugin.properties
+                    COMMAND ${CMAKE_COMMAND} "-DSEQAN_SOURCE_DIR=${CMAKE_SOURCE_DIR}"
+                                             "-DWORKFLOW_PLUGIN_DIR=${WORKFLOW_PLUGIN_DIR}"
+                                             "-DCF_SEQAN_VERSION=${CF_SEQAN_VERSION}"
+                                             -P "${CMAKE_SOURCE_DIR}/util/cmake/ctd/configure_profile_properties.cmake"
+                    DEPENDS ${WORKFLOW_PLUGIN_DIR}
+                            ${CMAKE_SOURCE_DIR}/util/cmake/ctd/plugin.properties.in)
+
+# ============================================================================
 # Static Files.
 # ============================================================================

@@ -199,7 +224,7 @@
 # Icon files.
 foreach (_FILE category.png splash.png)
   add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}/icons/${_FILE}
-                      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/util/cmake/ctd/icons/${FILE}
+                      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/util/cmake/ctd/icons/${_FILE}
                                                        ${WORKFLOW_PLUGIN_DIR}/icons/${_FILE}
                       DEPENDS ${WORKFLOW_PLUGIN_DIR}/icons
                               ${CMAKE_SOURCE_DIR}/util/cmake/ctd/icons/${FILE})
@@ -214,5 +239,6 @@
                    DEPENDS ${DESCRIPTOR_FILES}
                            ${STATIC_FILES}
                            ${ICON_FILES}
+                           ${WORKFLOW_PLUGIN_DIR}/plugin.properties
                            ${_ZIP_PATH}/${_ZIP_NAME})


STYLE: Fixed style

STYLE: Fixed style

--- vtkObject_EventFragments.cmake
+++ vtkObject_EventFragments.cmake
@@ -1,6 +1,6 @@
 # Everything except for "NoEvent" and "UserEvent"...
 #
-SET(vtkObject_EventFragments
+set(vtkObject_EventFragments
   AbortCheck
   AnimationCueTick
   Any


fix: don't try to remove the dir ""

fix: don't try to remove the dir ""

--- Modules/private/CakePkgClone.cmake
+++ Modules/private/CakePkgClone.cmake
@@ -1,6 +1,6 @@
 macro(_cake_remove_if_stale pk_var)
   cake_repo_db_get_field_by_pk(destination "${${pk_var}}")
-  if(NOT EXISTS "${ans}")
+  if(ans AND NOT EXISTS "${ans}")
     cake_repo_db_get_field_by_pk(shortcid "${${pk_var}}")
     set(_cris_shortcid "${ans}")
     cake_repo_db_erase_by_pk("${${pk_var}}")


Fix missing increment, causing infinite loop consuming all memory

--- src/utils/mime.h.cmake
+++ src/utils/mime.h.cmake
@@ -31,7 +31,7 @@
     QStringList list;
     int i = 0;
     while (c_strings[i])
-        list.append(QLatin1String(c_strings[i]));
+        list.append(QLatin1String(c_strings[i++]));
     return list;
 }


Commented out invalid installation of d3dcompiler

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -124,8 +124,8 @@
       install_release(OIS.dll)
       if (OGRE_BUILD_RENDERSYSTEM_D3D11 AND MSVC11)
         # Install d3dcompiler found in Windows SDK
-        install_debug()
-        install_release()
+        #install_debug()
+        #install_release()
       endif()
     endif()


try fix build

try fix build

--- CMake/hoomd/HOOMDHIPSetup.cmake
+++ CMake/hoomd/HOOMDHIPSetup.cmake
@@ -86,7 +86,7 @@
     ENABLE_LANGUAGE(CUDA)

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

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


try re-including pthread with correct options

--- CMake/hoomd/HOOMDMPISetup.cmake
+++ CMake/hoomd/HOOMDMPISetup.cmake
@@ -63,18 +63,27 @@
         endif(MPI_CUDA)
     endif (ENABLE_HIP AND NOT DEFINED ENABLE_MPI_CUDA)

-# backport CMake FindMPI fix
+# backport CMake FindMPI fix from 3.12 to earlier versions
 # https://gitlab.kitware.com/cmake/cmake/merge_requests/2529/diffs
-# additionally, since nvcc doesn't require -pthread (and hipcc doesn't like -Xcompiler), eliminate argument
-if (ENABLE_HIP)
-    string(REPLACE "-pthread" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-pthread>"
-      _MPI_C_COMPILE_OPTIONS "${MPI_C_COMPILE_OPTIONS}")
-    set_property(TARGET MPI::MPI_C PROPERTY INTERFACE_COMPILE_OPTIONS "${_MPI_C_COMPILE_OPTIONS}")
-    unset(_MPI_C_COMPILE_OPTIONS)

-    string(REPLACE "-pthread" "$<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:-pthread>"
+if (CMAKE_VERSION VERSION_LESS 3.12.0 AND ENABLE_HIP)
+    if(HIP_PLATFORM EQUALS "nvcc")
+    string(replace "-pthread" "$<$<AND:$<COMPILE_LANGUAGE:CUDA>,$<HIP_PLATFORM:nvcc>>:-Xcompiler>;-pthread"
+      _mpi_c_compile_options "${mpi_c_compile_options}")
+    set_property(target mpi::mpi_c property interface_compile_options "${_mpi_c_compile_options}")
+    else()
+    set_property(target mpi::mpi_c property interface_compile_options "${mpi_c_compile_options}")
+    endif()
+    unset(_mpi_c_compile_options)
+
+    if(HIP_PLATFORM EQUALS "nvcc")
+    string(REPLACE "-pthread" "$<$<AND:$<COMPILE_LANGUAGE:CUDA><$<HIP_PLATFORM:nvcc>>:-Xcompiler>;-pthread"
       _MPI_CXX_COMPILE_OPTIONS "${MPI_CXX_COMPILE_OPTIONS}")
     set_property(TARGET MPI::MPI_CXX PROPERTY INTERFACE_COMPILE_OPTIONS "${_MPI_CXX_COMPILE_OPTIONS}")
+    else()
+    set_property(TARGET MPI::MPI_CXX PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_CXX_COMPILE_OPTIONS}")
+    endif()
+    message(STATUS "_MPI_CXX_COMPILE_OPTIONS: ${_MPI_CXX_COMPILE_OPTIONS}")
     unset(_MPI_CXX_COMPILE_OPTIONS)
 endif()


Fix YACS detection with CMake

Fix YACS detection with CMake

Add suffix adm/cmake to the paths used to search Config files
in order to detect YACS properly

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -381,13 +381,13 @@
       IF(${englobPkg}_FIND_COMPONENTS)
         FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
               NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}
-              PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
+              PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake"
               NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
                 NO_SYSTEM_ENVIRONMENT_PATH)
       ELSE()
         FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
               NO_MODULE ${_tmp_quiet} ${_tmp_req}
-              PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
+              PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake"
               NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
                  NO_SYSTEM_ENVIRONMENT_PATH)
       ENDIF()


fixing precommit build on ubuntu-64 (now it takes OCL headers from non-default OCL SDK, but libs from default one)

--- cmake/OpenCVDetectOpenCL.cmake
+++ cmake/OpenCVDetectOpenCL.cmake
@@ -17,7 +17,8 @@
               NAMES OpenCL/cl.h CL/cl.h
               HINTS ${OPENCL_ROOT_DIR}
               PATH_SUFFIXES include include/nvidia-current
-              DOC "OpenCL include directory")
+              DOC "OpenCL include directory"
+              NO_DEFAULT_PATH)

     if (X86_64)
       set(OPENCL_POSSIBLE_LIB_SUFFIXES lib/Win64 lib/x86_64 lib/x64)
@@ -29,7 +30,8 @@
               NAMES OpenCL
               HINTS ${OPENCL_ROOT_DIR}
               PATH_SUFFIXES ${OPENCL_POSSIBLE_LIB_SUFFIXES}
-              DOC "OpenCL library")
+              DOC "OpenCL library"
+              NO_DEFAULT_PATH)

     mark_as_advanced(OPENCL_INCLUDE_DIR OPENCL_LIBRARY)
     include(FindPackageHandleStandardArgs)


fixed OpenCL detection in Linux (patch #2261)

--- cmake/OpenCVDetectOpenCL.cmake
+++ cmake/OpenCVDetectOpenCL.cmake
@@ -56,7 +56,7 @@
         if(OPENCL_LIB_SEARCH_PATH)
             find_library(OPENCL_LIBRARY NAMES OpenCL PATHS ${OPENCL_LIB_SEARCH_PATH} NO_DEFAULT_PATH)
         else()
-            find_library(OPENCL_LIBRARY NAMES OpenCL PATHS ${OPENCL_LIB_SEARCH_PATH} NO_DEFAULT_PATH)
+            find_library(OPENCL_LIBRARY NAMES OpenCL)
         endif()

         include(FindPackageHandleStandardArgs)


specify python 2

specify python 2

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@7792 662fdd30-d327-0410-a531-f549c87e1e9e

--- cmake/TestForPythonEmbed.cmake
+++ cmake/TestForPythonEmbed.cmake
@@ -3,6 +3,7 @@
 #
 #  PYTHON_EMBEDABLE - True if embedable

+set(PythonLibs_FIND_VERSION "2")
 find_package(PythonLibs)
 if(UNIX OR LINUX)
     # Some systems require these libs to be added explicitly


Removed fatal message from python test

Removed fatal message from python test

--- cmake/TestForPythonEmbed.cmake
+++ cmake/TestForPythonEmbed.cmake
@@ -11,7 +11,7 @@
 	    MESSAGE(STATUS "Python is embedable")
             SET(PYTHON_EMBEDABLE TRUE)
 	ELSE(NOT BUILD_RUN_RETURN)
-	    MESSAGE(FATAL_ERROR "Python is not embedable")
+	    MESSAGE(STATUS "Python is not embedable")
 	ENDIF(NOT BUILD_RUN_RETURN)
 ELSE(PYTHONLIBS_FOUND)
     MESSAGE(STATUS "Python is not embedable")


change: manual --std compilation flag settings replaced with cmake_cxx_standard variable

--- cmake/clang/cpp-standard.cmake
+++ cmake/clang/cpp-standard.cmake
@@ -5,18 +5,20 @@
 set(CLANG_CPP_STANDARD_INCLUDED true)
 #######################

-set(CPP_STANDARD "C++11" CACHE STRING "C++ standard, choose from C++03, C++11, C++14 and C++17")
+set(CMAKE_CXX_EXTENSIONS OFF)

-if(CPP_STANDARD STREQUAL "C++03")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++03")
+set(CPP_STANDARD "C++11" CACHE STRING "C++ standard, choose from C++98, C++11, C++14 and C++17")
+
+if(CPP_STANDARD STREQUAL "C++98")
+    set(CMAKE_CXX_STANDARD 98)
 elseif(CPP_STANDARD STREQUAL "C++11")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+    set(CMAKE_CXX_STANDARD 11)
 elseif(CPP_STANDARD STREQUAL "C++14")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+    set(CMAKE_CXX_STANDARD 14)
 elseif(CPP_STANDARD STREQUAL "C++17")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z")
 else()
-    message(FATAL_ERROR "Wrong C++ Standard. Choose from C++03, C++11, C++14 and C++17")
+    message(FATAL_ERROR "Wrong C++ Standard. Choose from C++98, C++11, C++14 and C++17")
 endif()

-message(STATUS "C++ standard is ${CPP_STANDARD}")
+message(STATUS "C++ standard is set to: ${CPP_STANDARD}")


Fix-up Python CMake detection

Fix-up Python CMake detection

Comparison here was incorrect in that it referenced VIGRA when it
shouldn't. So drop the VIGRA reference.

--- cmake/modules/FindPYTHON.cmake
+++ cmake/modules/FindPYTHON.cmake
@@ -2,7 +2,7 @@

 # See if PYTHON_EXECUTABLE was set externally, if so use it.
-if (("${PYTHON_EXECUTABLE}" STREQUAL "") OR ("${PYTHON_EXECUTABLE}" STREQUAL "VIGRA_ROOT-NOTFOUND"))
+if (("${PYTHON_EXECUTABLE}" STREQUAL "") OR ("${PYTHON_EXECUTABLE}" STREQUAL "PYTHON_EXECUTABLE-NOTFOUND"))
     if (NOT "$ENV{PYTHON_EXECUTABLE}" STREQUAL "")
         set(PYTHON_EXECUTABLE $ENV{PYTHON_EXECUTABLE})
     endif()


Fix LLDBConfig.cmake to enable python enabled build for all 64 bit lldb targets

Differential revision: https://reviews.llvm.org/D22771

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

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -167,12 +167,6 @@
 endfunction(find_python_libs_windows)

 if (NOT LLDB_DISABLE_PYTHON)
-  if(UNIX)
-    # This is necessary for crosscompile on Ubuntu 14.04 64bit. Need a proper fix.
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-      set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu")
-    endif()
-  endif()

   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
     find_python_libs_windows()


Fix pc_transform_link_flags to correctly handle blank input strings.

svn path=/trunk/; revision=7754

--- cmake/modules/pkg-config.cmake
+++ cmake/modules/pkg-config.cmake
@@ -121,7 +121,7 @@
     string(
     REGEX REPLACE "(/[^ ]*)/lib([^ ]*)\\${suffix}" "-L\\1 -l\\2"
     ${_link_flags_out}
-    ${${_link_flags_out}}
+    "${${_link_flags_out}}"
     )
     #message("(${suffix}) ${_link_flags_out} = ${${_link_flags_out}}")
   endforeach(suffix ${suffix_list})


hunter_pack_git_submodule: Use HUNTER_GIT_EXECUTABLE

--- cmake/modules/hunter_pack_git_submodule.cmake
+++ cmake/modules/hunter_pack_git_submodule.cmake
@@ -33,7 +33,31 @@
     hunter_internal_error("GIT_SUBMODULE is empty")
   endif()

-  find_package(Git REQUIRED)
+  string(COMPARE EQUAL "$ENV{HUNTER_GIT_EXECUTABLE}" "" is_empty)
+
+  if(is_empty)
+    find_package(Git REQUIRED)
+  else()
+    set(GIT_EXECUTABLE "$ENV{HUNTER_GIT_EXECUTABLE}")
+    execute_process(
+        COMMAND
+        ${GIT_EXECUTABLE} --version
+        RESULT_VARIABLE result
+        OUTPUT_VARIABLE output
+        ERROR_VARIABLE output
+        OUTPUT_STRIP_TRAILING_WHITESPACES
+        ERROR_STRIP_TRAILING_WHITESPACES
+    )
+    if(result EQUAL "0")
+      if(output MATCHES "^git version [0-9]")
+        string(REPLACE "git version " "" GIT_VERSION_STRING "${output}")
+      else()
+        hunter_internal_error("Unexpected output: ${output}")
+      endif()
+    else()
+      hunter_internal_error("Can't get Git version: ${result} ${output}")
+    endif()
+  endif()
   hunter_status_debug("Using git executable: ${GIT_EXECUTABLE}")

   # For '--git-path':


added support for precompiled headers

added support for precompiled headers

--- pch.cmake
+++ pch.cmake
@@ -1,10 +1,226 @@
-################################################################################
-#
-# T|N.U.N. Build PCH support
-#
-# Copyright (c) 2016. Domagoj saric. All rights reserved.
-#
-################################################################################
-
-#...todo...
-# http://clang.llvm.org/docs/PCHInternals.html+# Macro for setting up precompiled headers. Usage:
+#
+#   add_precompiled_header(target header.h [FORCEINCLUDE] [header_on_which_pch_depends header_on_which_pch_depends ...] )
+#
+# MSVC: A source file with the same name as the header must exist and
+# be included in the target (E.g. header.cpp).
+#
+# MSVC: Add FORCEINCLUDE to automatically include the precompiled
+# header file from every source file.
+#
+# GCC: The precompiled header is always automatically included from
+# every header file.
+#
+# Copyright (C) 2009-2013 Lars Christensen <larsch@belunktum.dk>
+# Copyright (C) 2013-2016 Nenad Mikša <nenad.miksa@microblink.com>
+#
+# Permission is hereby granted, free of charge, to any person
+# obtaining a copy of this software and associated documentation files
+# (the ‘Software’), to deal in the Software without restriction,
+# including without limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of the Software,
+# and to permit persons to whom the Software is furnished to do so,
+# subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+macro(get_all_compile_flags target compileFlags visited)
+    get_target_property(dependencies ${target} INTERFACE_LINK_LIBRARIES)
+    foreach(dep ${dependencies})
+        if(TARGET ${dep} )
+            # check if we already processed this dependency
+            list(FIND ${visited} ${dep} pos)
+
+            if(${pos} EQUAL -1)
+                get_target_property(flags ${dep} INTERFACE_COMPILE_OPTIONS)
+                if(flags)
+                    list(APPEND ${compileFlags} ${flags})
+                endif()
+
+                get_target_property(def ${dep} INTERFACE_COMPILE_DEFINITIONS)
+                if(def)
+                    foreach(d ${def})
+                        string(FIND ${d} "\$<" POS)
+                        if(POS EQUAL -1)
+                            list(APPEND ${compileFlags} "-D${d}")
+                        endif()
+                    endforeach()
+                endif()
+
+                get_target_property(inc ${dep} INTERFACE_INCLUDE_DIRECTORIES)
+                if(inc)
+                    foreach(i ${inc})
+                        string(FIND ${i} "\$<" POS)
+                        if(POS EQUAL -1)
+                            list(APPEND ${compileFlags} "-I${i}")
+                        endif()
+                    endforeach()
+                endif()
+
+                get_target_property(incSys ${dep} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
+                if(incSys)
+                    foreach(i ${incSys})
+                        list(APPEND ${compileFlags} "-isystem ${i}")
+                    endforeach()
+                endif()
+
+                list(APPEND ${visited} ${dep})
+
+                get_all_compile_flags(${dep} ${compileFlags} ${visited})
+            endif()
+
+        endif()
+    endforeach()
+
+endmacro()
+
+MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
+  GET_FILENAME_COMPONENT(_inputWe ${_input} NAME_WE)
+  SET(pch_source ${_inputWe}.cpp)
+
+  set( PCH_LOCAL_DEPENDS "")
+  SET(FORCEINCLUDE OFF)
+
+  FOREACH(arg ${ARGN})
+    IF(arg MATCHES FORCEINCLUDE)
+      SET(FORCEINCLUDE ON)
+    ELSE()
+      LIST(APPEND PCH_LOCAL_DEPENDS ${arg})
+    ENDIF()
+  ENDFOREACH(arg)
+
+  IF(MSVC)
+    GET_TARGET_PROPERTY(sources ${_targetName} SOURCES)
+	GET_FILENAME_COMPONENT(PCH_NAME ${_input} NAME)
+    SET(_sourceFound FALSE)
+    FOREACH(_source ${sources})
+      SET(PCH_COMPILE_FLAGS "")
+      IF(_source MATCHES \\.\(cc|cxx|cpp\)$)
+	GET_FILENAME_COMPONENT(_sourceWe ${_source} NAME_WE)
+	IF(_sourceWe STREQUAL ${_inputWe})
+	  SET(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /Yc${PCH_NAME}")
+	  SET(_sourceFound TRUE)
+	ELSE(_sourceWe STREQUAL ${_inputWe})
+	  SET(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /Yu${PCH_NAME}")
+	  IF(FORCEINCLUDE)
+	    SET(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /FI${PCH_NAME}")
+	  ENDIF(FORCEINCLUDE)
+	ENDIF(_sourceWe STREQUAL ${_inputWe})
+	SET_SOURCE_FILES_PROPERTIES(${_source} PROPERTIES COMPILE_FLAGS "${PCH_COMPILE_FLAGS}")
+      ENDIF(_source MATCHES \\.\(cc|cxx|cpp\)$)
+    ENDFOREACH()
+    IF(NOT _sourceFound)
+      MESSAGE(FATAL_ERROR "A source file for ${_input} was not found. Required for MSVC builds.")
+    ENDIF(NOT _sourceFound)
+  ENDIF(MSVC)
+
+  IF(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+    if(${CMAKE_GENERATOR} STREQUAL "Xcode")
+        set_target_properties(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER ${_input} XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "Yes")
+    else()
+        GET_FILENAME_COMPONENT(_name ${_input} NAME)
+        SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
+    #    SET(_output "${CMAKE_BINARY_DIR}/${_name}.gch")
+
+        string(REGEX REPLACE "[^a-zA-Z0-9]" "" OutputName ${_output})
+
+        if(NOT DEFINED ${OutputName}_CREATED)
+            # obtain optimization flags
+            STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
+            SET(_compiler_FLAGS ${${_flags_var_name}})
+            # obtain all other flags
+            list(APPEND _compiler_FLAGS ${CMAKE_CXX_FLAGS})
+            # Obtain target specific flags (recursively)
+            set(visited "")
+            set(targetCompileFlags "")
+            get_all_compile_flags(${_targetName} targetCompileFlags visited)
+    #        message("Additional compile flags for ${_targetName}: ${targetCompileFlags}")
+            list(APPEND _compiler_FLAGS ${targetCompileFlags})
+
+            GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
+            FOREACH(item ${_directory_flags})
+              LIST(APPEND _compiler_FLAGS "-I${item}")
+            ENDFOREACH(item)
+
+            GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS)
+
+            foreach( def ${_directory_flags} )
+                list( APPEND _compiler_FLAGS "-D${def}" )
+            endforeach()
+
+            GET_DIRECTORY_PROPERTY(_compile_options COMPILE_OPTIONS)
+            foreach(option ${_compile_options})
+                # COMPILE_LANGUAGE generator expression cannot be evaluated in this context
+                set(append_option true)
+                if(${option} MATCHES ".*COMPILE_LANGUAGE.*")
+                    if( ${option} MATCHES ".*\\\$<\\\$<COMPILE_LANGUAGE:CXX>.*")
+                        string( REPLACE ":" ";" option ${option} )
+                        list( GET option 2 option ) # 0 is COMPILE_LANGUAGE, 1 is CXX, 2 is value
+                        string( REPLACE ">" "" option ${option} )
+                    else()
+                        set(append_option false)
+                    endif()
+                endif()
+                # Adding CONFIG:DEBUG flags in Release and vice versa produces empty quotes to compiler command line
+                # which confuses GCC.
+                if(
+                    ( ${option} MATCHES ".*CONFIG:RELEASE.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) OR
+                    ( ${option} MATCHES ".*CONFIG:DEBUG.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
+                )
+                    set(append_option false)
+                endif()
+
+                if( ${append_option} )
+                    list(APPEND _compiler_FLAGS ${option})
+                endif()
+            endforeach()
+
+            if( ANDROID )
+                list( APPEND _compiler_FLAGS "--sysroot=${CMAKE_SYSROOT}" )
+                foreach( sid ${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES} )
+                    list( APPEND _compiler_FLAGS "-isystem ${sid}" )
+                endforeach()
+                list( APPEND _compiler_FLAGS "-target ${CMAKE_CXX_COMPILER_TARGET} " )
+            endif()
+
+            if( APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET )
+                list(APPEND _compiler_FLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+            endif()
+
+            set(COMPILER ${CMAKE_CXX_COMPILER})
+            if(${COMPILER} MATCHES "ccache")
+    #            message("CCache will not give any boost when precompiled headers are used")
+                string(STRIP ${CMAKE_CXX_COMPILER_ARG1} CARG1)
+                set( COMPILER ${CMAKE_CXX_COMPILER} ${CARG1} )
+            endif()
+            if( CMAKE_CXX_COMPILER_LAUNCHER )
+                set( COMPILER ${CMAKE_CXX_COMPILER_LAUNCHER} ${COMPILER} )
+            endif()
+            SEPARATE_ARGUMENTS(_compiler_FLAGS)
+
+            ADD_CUSTOM_COMMAND(
+              OUTPUT ${_output}
+              COMMAND ${CMAKE_COMMAND} -E remove ${_output}
+              COMMAND ${COMPILER} -x c++-header ${_compiler_FLAGS} -o ${_output} ${_input}
+              DEPENDS ${_input} ${PCH_LOCAL_DEPENDS}
+              COMMENT "Building precompiled header for ${_targetName}"
+              VERBATIM)
+            set(${OutputName}_CREATED true)
+            # set(${OutputName}_CREATED true PARENT_SCOPE)
+        endif()
+        add_custom_target(${_targetName}_PCH DEPENDS ${_output} SOURCES ${_input})
+        target_compile_options( ${_targetName} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-include ${CMAKE_CURRENT_BINARY_DIR}/${PCH_NAME}.h -Winvalid-pch> )
+        ADD_DEPENDENCIES(${_targetName} ${_targetName}_PCH)
+    endif()
+  ENDIF(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+ENDMACRO()


bug-5919-CorrespondencePointSetsWidget

removing CorrespondencePointSetsWidget again to remove dashboard errors

--- Modules/QmitkExt/files.cmake
+++ Modules/QmitkExt/files.cmake
@@ -97,9 +97,9 @@
  QmitkPointListView.cpp
  QmitkPointListWidget.cpp
  QmitkPointListViewWidget.cpp
- QmitkCorrespondingPointSetsView.cpp
- QmitkCorrespondingPointSetsModel.cpp
- QmitkCorrespondingPointSetsWidget.cpp
+ #QmitkCorrespondingPointSetsView.cpp
+ #QmitkCorrespondingPointSetsModel.cpp
+ #QmitkCorrespondingPointSetsWidget.cpp
  QmitkVideoBackground.cpp
  QmitkHotkeyLineEdit.cpp
  QmitkErodeToolGUI.cpp
@@ -195,9 +195,9 @@
  QmitkPointListView.h
  QmitkPointListWidget.h
  QmitkPointListViewWidget.h
- QmitkCorrespondingPointSetsView.h
- QmitkCorrespondingPointSetsModel.h
- QmitkCorrespondingPointSetsWidget.h
+ #QmitkCorrespondingPointSetsView.h
+ #QmitkCorrespondingPointSetsModel.h
+ #QmitkCorrespondingPointSetsWidget.h
  QmitkHistogramWidget.h
  QmitkVideoBackground.h
  QmitkFileChooser.h


FIX (#2933): Disable classes/bundles using vtkQtChart* for VTK < 5.4.0

--- Modules/QmitkExt/files.cmake
+++ Modules/QmitkExt/files.cmake
@@ -86,7 +86,6 @@

  QmitkHistogram.cpp
  QmitkHistogramWidget.cpp
- QmitkVtkHistogramWidget.cpp

  QmitkPlotWidget.cpp
  QmitkPlotDialog.cpp
@@ -95,6 +94,14 @@
  QmitkPointListWidget.cpp
  QmitkVideoBackground.cpp
 )
+
+IF ( NOT ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} VERSION_LESS 5.4.0 )
+  SET(MOC_H_FILES
+    ${MOC_H_FILES}
+    QmitkVtkHistogramWidget.cpp
+  )
+ENDIF()
+

 QT4_ADD_RESOURCES(CPP_FILES resources/QmitkResources.qrc)

@@ -156,9 +163,15 @@
  QmitkPointListView.h
  QmitkPointListWidget.h
  QmitkHistogramWidget.h
- QmitkVtkHistogramWidget.h
  QmitkVideoBackground.h
 )
+
+IF ( NOT ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} VERSION_LESS 5.4.0 )
+  SET(CPP_FILES
+    ${CPP_FILES}
+    QmitkVtkHistogramWidget.h
+  )
+ENDIF()

 SET(UI_FILES
   QmitkSliderNavigator.ui


PKG: WIP: update generate xdk for OTB+Monteverdi

--- SuperBuild/CMake/GenerateXDK.cmake
+++ SuperBuild/CMake/GenerateXDK.cmake
@@ -39,12 +39,17 @@
        set(SETUP_SCRIPT_SRC ${CMAKE_SOURCE_DIR}/CMake/pkgsetup.in)
        set(WITH_OTBGUI OFF)
        set(MAKE_XDK ON)
-       include(${CMAKE_SOURCE_DIR}/CMake/External_pkgtools.cmake)
-       include(${CMAKE_SOURCE_DIR}/CMake/Package_Macro.cmake)
+       set(PACKAGE_SUPPORT_FILES_DIR \"${CMAKE_SOURCE_DIR}/Packaging\")
+       set(Monteverdi_SOURCE_DIR \"${CMAKE_BINARY_DIR}/MVD/src/MVD\")
+       set(Monteverdi_BINARY_DIR \"${CMAKE_BINARY_DIR}/MVD/build\")
+       set(OTB_INSTALL_DIR \"${CMAKE_BINARY_DIR}/OTB/build\")
+       set(QT_PLUGINS_DIR \"${SB_INSTALL_PREFIX}/plugins\")
+       set(QT_TRANSLATIONS_DIR \"${QT_TRANSLATIONS_DIR}\")
+       set(ITK_VERSION_STRING \"${ITK_SB_VERSION}\")
+       include(\"${CMAKE_SOURCE_DIR}/CMake/Package_Macro.cmake\")
+       include(\"${CMAKE_SOURCE_DIR}/CMake/PackageHelper.cmake\")
        superbuild_package(
-       OUTDIR \"${ARCHIVE_NAME}\"
-       INSTALLDIR \"${SB_INSTALL_PREFIX}\"
-       PEFILES \"${PEFILES}\"
+       STAGE_DIR \"${ARCHIVE_NAME}\"
        SEARCHDIRS \"\")")

   add_custom_target(GENERATE-XDK-configure


[INTERNAL] unset Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES

--- util/cmake/FindSeqAn.cmake
+++ util/cmake/FindSeqAn.cmake
@@ -379,6 +379,9 @@
   if (COMPILER_CLANG AND STDLIB_VS)
     message (STATUS "The boost library (at least until 1.53) doesn't support the clang/c2 compiler on windows (version 3.7 and 3.8), yet!")
     set (Boost_FOUND FALSE)
+    unset(Boost_INCLUDE_DIRS)
+    unset(Boost_LIBRARY_DIRS)
+    unset(Boost_LIBRARIES)
   endif()
 endif()


Look for tags in `${CMAKE_BINARY_DIR}` as well

--- MunkeiTags.cmake
+++ MunkeiTags.cmake
@@ -50,7 +50,7 @@

     message( STATUS "[MunkeiTags] Adding target ‘TAGS’" )
     add_custom_target( TAGS
-      COMMAND           ${ctags} -R .
+      COMMAND           ${ctags} -R . ${CMAKE_BINARY_DIR}
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
     )
   elseif( ARGS_REQUIRED )


Update protobuf.cmake to b04e5cba356212e4e8c66c61bbe0c3a20537c5b9 (#13893)

This fix tries to address the issue raised in 8187 where
protobuf.cmake used different version as bazel.

The reason for discrepancy was due to the fact that a customerized
protobuf was needed with Windows patch. Since the patch has been
merged in (https://github.com/google/protobuf/pull/2203),
it makes sense to update protobuf.cmake so that the same version
of cmake is used.

This fix fixes 8187.

Signed-off-by: Yong Tang <765086fe2e0c1f980161f127fec596800f327f62@outlook.com>

--- tensorflow/contrib/cmake/external/protobuf.cmake
+++ tensorflow/contrib/cmake/external/protobuf.cmake
@@ -15,8 +15,8 @@
 include (ExternalProject)

 set(PROTOBUF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src)
-set(PROTOBUF_URL https://github.com/mrry/protobuf.git)  # Includes MSVC fix.
-set(PROTOBUF_TAG 1d2c7b6c7376f396c8c7dd9b6afd2d4f83f3cb05)
+set(PROTOBUF_URL https://github.com/google/protobuf.git)
+set(PROTOBUF_TAG b04e5cba356212e4e8c66c61bbe0c3a20537c5b9)

 if(WIN32)
   set(protobuf_STATIC_LIBRARIES


Update ios.toolchain.cmake

Update ios.toolchain.cmake

Make the readme more clear that the combined builds include simulator support.

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -58,15 +58,15 @@
 # PLATFORM: (default "OS64")
 #    OS = Build for iPhoneOS.
 #    OS64 = Build for arm64 iphoneOS.
-#    OS64COMBINED = Build for arm64 x86_64 iphoneOS. Combined into FAT STATIC lib (supported on 3.14+ of CMakewith "-G Xcode" argument ONLY)
+#    OS64COMBINED = Build for arm64 x86_64 iphoneOS + iphoneOS Simulator. Combined into FAT STATIC lib (only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step)
 #    SIMULATOR = Build for x86 i386 iphoneOS Simulator.
 #    SIMULATOR64 = Build for x86_64 iphoneOS Simulator.
 #    SIMULATORARM64 = Build for arm64 iphoneOS Simulator.
 #    TVOS = Build for arm64 tvOS.
-#    TVOSCOMBINED = Build for arm64 x86_64 tvOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
+#    TVOSCOMBINED = Build for arm64 x86_64 tvOS + tvOS Simulator. Combined into FAT STATIC lib (only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step)
 #    SIMULATOR_TVOS = Build for x86_64 tvOS Simulator.
 #    WATCHOS = Build for armv7k arm64_32 for watchOS.
-#    WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS. Combined into FAT STATIC lib (supported on 3.14+ of CMake with "-G Xcode" argument ONLY)
+#    WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS + watchOS Simulator. Combined into FAT STATIC lib (only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step)
 #    SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator.
 #    MAC = Build for x86_64 macOS.
 #    MAC_ARM64 = Build for Apple Silicon macOS.


Added a macro to streamline linking to external libraries.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -26,7 +26,6 @@
   if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
     string(LENGTH "${CMAKE_SOURCE_DIR}" string_length)
     math(EXPR string_length "${string_length} + 1")
-    message("test ${CMAKE_CURRENT_SOURCE_DIR}")
     string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${string_length} -1 current_path)
     get_filename_component(current_path ${current_path} DIRECTORY)
     if (NOT ANDROID)
@@ -201,4 +200,47 @@

 macro(add_sources)
   target_sources(${CURRENT_TARGET} PUBLIC ${ARGN})
-endmacro()+endmacro()
+
+function(set_lib_prefix varname)
+  string(SUBSTRING "${${varname}}" 0 3 libprefix)
+#  message(WARNING "substring ${libprefix} ${libname}")
+  if (NOT libprefix STREQUAL "lib")
+    set(${varname} "lib${${varname}}" PARENT_SCOPE)
+  endif ()
+endfunction()
+
+macro(link_external path)
+#  message(WARNING "args... ${ARGV0} ${ARGV1}")
+  set(libname "${ARGV1}")
+  if (NOT libname)
+#    message(WARNING "args 2")
+    set(libname ${path})
+  endif ()
+
+  set(dllname "${ARGV2}")
+  if (NOT dllname)
+    set(dllname ${libname})
+  endif ()
+
+  if (MINGW)
+    set(libname "${libname}.dll.a")
+
+    set_lib_prefix(libname)
+    set_lib_prefix(dllname)
+#    string(SUBSTRING "${libname}" 0 3 libprefix)
+#    message(WARNING "substring ${libprefix} ${libname}")
+#    if (NOT libprefix STREQUAL "lib")
+#      set(libname "lib${libname}")
+#    endif ()
+
+  elseif (MSVC)
+    set(libname "${libname}.lib")
+  endif ()
+
+  target_link_libraries(${CURRENT_TARGET} ${MYTHIC_DEPENDENCIES}/${path}/lib/${libname})
+
+  add_custom_command(TARGET ${CURRENT_TARGET} POST_BUILD
+    COMMAND ${CMAKE_COMMAND} -E copy ${MYTHIC_DEPENDENCIES}/${path}/bin/${dllname}.dll $<TARGET_FILE_DIR:${CURRENT_TARGET}>
+    )
+endmacro()


Motion correction class was added to paa module via cmake file

--- Modules/PhotoacousticsAlgorithms/files.cmake
+++ Modules/PhotoacousticsAlgorithms/files.cmake
@@ -1,9 +1,11 @@
+
 file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")

 set(CPP_FILES
   source/mitkPhotoacousticImage.cpp
   source/mitkPhotoacousticBeamformingFilter.cpp
   source/OpenCLFilter/mitkPhotoacousticBModeFilter.cpp
+  source/mitkPhotoacousticMotionCorrectionFilter.cpp
 )

 IF(MITK_USE_OpenCL)


cmake:PYVER

cmake:PYVER

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -57,13 +57,18 @@
 )

 # Attempt to make Python settings consistent
-find_package(PythonInterp)
+set(PYVER 0 CACHE STRING "Python version")
+if(PYVER EQUAL 0)
+  find_package(PythonInterp)
+else()
+  find_package(PythonInterp ${PYVER})
+endif()
 if (PYTHONINTERP_FOUND)
   set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_STRING})
   message(STATUS "Found PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}")
   message(STATUS "Python version ${PYTHON_VERSION_STRING}")
 endif()
-FIND_PACKAGE(PythonLibs)
+find_package(PythonLibs ${PYTHON_VERSION_STRING})
 if (PYTHONLIBS_FOUND)
   message(STATUS "Found PYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS}")
   message(STATUS "Found PYTHON_LIBRARIES=${PYTHON_LIBRARIES}")


ENH: Specifying the 3.20 tag for ITK and putting source_dir in quotes so that spaces in paths will work.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -25,7 +25,8 @@
   set(proj Insight)
   ExternalProject_Add(${proj}
     GIT_REPOSITORY "http://itk.org/ITK.git"
-    SOURCE_DIR ${CMAKE_BINARY_DIR}/Insight
+    GIT_TAG v3.20.0
+    SOURCE_DIR "${CMAKE_BINARY_DIR}/Insight"
     BINARY_DIR Insight-Build
     CMAKE_GENERATOR ${gen}
     CMAKE_ARGS
@@ -177,7 +178,7 @@
   set(proj CTK)
   ExternalProject_Add(CTK
     GIT_REPOSITORY "http://github.com/commontk/CTK.git"
-    SOURCE_DIR ${CMAKE_BINARY_DIR}/CTK
+    SOURCE_DIR "${CMAKE_BINARY_DIR}/CTK"
     BINARY_DIR CTK-Build
     CMAKE_GENERATOR ${gen}
     CMAKE_ARGS
@@ -209,7 +210,7 @@
 set(proj TubeTK)
 ExternalProject_Add(${proj}
   DOWNLOAD_COMMAND ""
-  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
   BINARY_DIR TubeTK-Build
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS


CMake: Fix link interface for p4est

CMake: Fix link interface for p4est

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

--- deal.II/cmake/modules/FindP4EST.cmake
+++ deal.II/cmake/modules/FindP4EST.cmake
@@ -92,6 +92,7 @@
   SET(P4EST_LIBRARIES
     ${P4EST_LIBRARY}
     ${SC_LIBRARY}
+    ${MPI_CXX_LIBRARIES} # for good measure
     )
   SET(P4EST_INCLUDE_DIRS
     ${P4EST_INCLUDE_DIR}


COMP: Added git reset, before applying patch, to fix another error, "patch does not apply". W/ Floris.

--- SuperBuild/ExternalITK.cmake
+++ SuperBuild/ExternalITK.cmake
@@ -25,7 +25,7 @@
   GIT_REPOSITORY ${ITK_REPOSITORY}
   GIT_TAG ${ITK_TAG}
   UPDATE_COMMAND ""
-  PATCH_COMMAND "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/itk_png_mangle_get_uint_31.patch"
+  PATCH_COMMAND "${GIT_EXECUTABLE}" reset --hard && "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/itk_png_mangle_get_uint_31.patch"
   SOURCE_DIR ${proj}
   BINARY_DIR ${proj}-build
   CMAKE_ARGS


Disable manually setting the sdk for Qt on OSX

On OSX lesser than 10.10, with newer Xcode, setting the 10.11 sdk
makes corewlan failing to build within bearer plugin (fails to link to opennssl).
Not setting it manually resolves the issue.
For similar issue see:
https://gitlab.kitware.com/dcthomp/cmb-superbuild/commit/31dd44d61b6813685137d732bfe04925d41cb397

--- Superbuild/Projects/qt.cmake
+++ Superbuild/Projects/qt.cmake
@@ -16,8 +16,9 @@
     message(FATAL "CMAKE_OSX_SYSROOT or CMAKE_OSX_ARCHITECTURES are not configured")
   endif()
   list (APPEND qt_options
-              -sdk ${CMAKE_OSX_SYSROOT}
+              #-sdk ${CMAKE_OSX_SYSROOT} #corewlan is failing on 10.9 with 10.11 sdk
               -arch ${CMAKE_OSX_ARCHITECTURES}
+              -platform unsupported/macx-clang-libc++
               -qt-libpng
               -system-zlib
               )


Fix wrong endif in doxygen.cmake

Fix wrong endif in doxygen.cmake

--- build-aux/doxygen.cmake
+++ build-aux/doxygen.cmake
@@ -607,13 +607,9 @@
     if (iter MATCHES "pdf")
       set(file "${install_from}/${DOXYGEN_REL_PDF_FILE}")
       set(inst "${install_to}/${DOXYGEN_REL_LATEX_DIR}")
-      if (DOXYGEN_CMAKE_VERBOSE)
-        message("pdf:\n  from: ${file}\n  to: ${inst}")
-      endif()

       if (rebuild)
         add_custom_target(depend_${doxygen_target}_pdf ALL DEPENDS "${DOXYGEN_PDF_FILE}")
-        endif()
       endif()

       install(


Sync common cmake files

Sync common cmake files

Former-commit-id: f5939ba97c660fc2327603a3fd3800f71c01a81a

--- src/gop/cmake/LStoreCommon.cmake
+++ src/gop/cmake/LStoreCommon.cmake
@@ -104,7 +104,14 @@
 set(LSTORE_PROJECT_OBJS ${LSTORE_PROJECT_OBJS} ${LSTORE_PROJECT_NAME}_version.c)

 add_library(library SHARED ${LSTORE_PROJECT_OBJS})
-set_target_properties(library PROPERTIES OUTPUT_NAME "${LSTORE_PROJECT_NAME}")
+
+# Possibly override the library filename
+if(DEFINED LSTORE_LIBRARY_NAME)
+    set_target_properties(library PROPERTIES OUTPUT_NAME "${LSTORE_LIBRARY_NAME}")
+else()
+    set_target_properties(library PROPERTIES OUTPUT_NAME "${LSTORE_PROJECT_NAME}")
+endif(DEFINED LSTORE_LIBRARY_NAME)
+
 set_target_properties(library PROPERTIES CLEAN_DIRECT_OUTPUT 1)
 if(WANT_STATIC)
     message(STATUS "Building a static library")
@@ -112,6 +119,11 @@
     set_target_properties(library-static PROPERTIES OUTPUT_NAME "${LSTORE_PROJECT_NAME}")
     set_target_properties(library-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
     SET(library_lib library-static)
+    if(DEFINED LSTORE_LIBRARY_NAME)
+        set_target_properties(library-static PROPERTIES OUTPUT_NAME "${LSTORE_LIBRARY_NAME}")
+    else()
+        set_target_properties(library-static PROPERTIES OUTPUT_NAME "${LSTORE_PROJECT_NAME}")
+    endif(DEFINED LSTORE_LIBRARY_NAME)
 else()
     message(STATUS "NOT building a static library")
     SET(library_lib library)


zephyr: Enable -Werror=sometimes-uninitialized

On the clang compiler, enable -Werror=sometimes-uninitialized, which is
similar to maybe-uninitalized on gcc, but not completely the same.

This won't catch the most recent breakage, but might catch something.

BRANCH=None
BUG=None
TEST=zmake testall

Signed-off-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@google.com>
Change-Id: I7353b14c15126c97d84d54fe6e9fbd0c720bc777
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3298885
Commit-Queue: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Commit-Queue: Aaron Massey <79529a820df71f45023239a3663736629646cc34@google.com>
Tested-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Auto-Submit: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>
Reviewed-by: Aaron Massey <79529a820df71f45023239a3663736629646cc34@google.com>

--- zephyr/cmake/compiler/clang/compiler_flags.cmake
+++ zephyr/cmake/compiler/clang/compiler_flags.cmake
@@ -7,4 +7,6 @@
 # Disable -fno-freestanding.
 set_compiler_property(PROPERTY hosted)

-check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable -Werror=unused-variable -Werror=missing-braces)
+check_set_compiler_property(APPEND PROPERTY warning_extended -Wunused-variable
+	-Werror=unused-variable -Werror=missing-braces
+	-Werror=sometimes-uninitialized)


FastJet: improved handling of the CGAL library

If a custom CGAL library was used, the CGAL prefix can be now passed to CMake
with -DCGAL. If system's CGAL was used, no -DCGAL is required. If no CGAL was
used for building FastJet, proceed but issue a warning.

--- cmake/FindFASTJET.cmake
+++ cmake/FindFASTJET.cmake
@@ -100,6 +100,29 @@
             list(APPEND FASTJET_LIBS ${fjlib})
         endforeach()

+        # CGAL for FastJet
+        list(FIND FASTJET_LIBS "CGAL" fastjetcgal)
+        if(fastjetcgal GREATER -1)
+            message(STATUS "FastJet was compiled with CGAL")
+            # FastJet was compiled with CGAL. We need CGAL.
+            if(CGAL)
+                find_library(CGAL_LIB "CGAL" "${CGAL}/lib" NO_DEFAULT_PATH)
+                if(NOT CGAL_LIB)
+                    message(FATAL_ERROR "CGAL not found under the given location")
+                endif()
+                message(STATUS "CGAL found in ${CGAL}")
+                list(APPEND FASTJET_LIBS_DIR ${CGAL}/lib)
+            else(CGAL)
+                # Attempt to use system's CGAL
+                find_library(CGAL_LIB "CGAL")
+                if(NOT CGAL_LIB)
+                    message(FATAL_ERROR "CGAL not installed: install it or specify a custom one with -DCGAL")
+                endif()
+            endif(CGAL)
+        else()
+            message(WARNING "FastJet was compiled witouth CGAL")
+        endif(fastjetcgal GREATER -1)
+
         # Extract library paths used by FastJet to find needed libs: (LIST)
         string(REGEX MATCHALL "(^| )-L[^ ]+" fjlibdirs ${FASTJET_CONFIGLIBS})
         foreach(fjlibdir ${fjlibdirs})


MOD: Reimplement FindFribidi in terms of new uber-macro: THIS NEEDS TESTING!

--- cmake/FindFribidi.cmake
+++ cmake/FindFribidi.cmake
@@ -1,40 +1,7 @@
 ################################################################################
 # Custom cmake module for CEGUI to find the fribidi library & header
 ################################################################################
-include(FindPackageHandleStandardArgs)
+include(CEGUIFindHelpers)

-find_path(FRIBIDI_H_PATH NAMES fribidi.h PATH_SUFFIXES fribidi)
-find_library(FRIBIDI_LIB NAMES fribidi libfribidi PATH_SUFFIXES dynamic)
-find_library(FRIBIDI_LIB_DBG NAMES fribidi_d libfribidi_d PATH_SUFFIXES dynamic)
-mark_as_advanced(FRIBIDI_H_PATH FRIBIDI_LIB FRIBIDI_LIB_DBG)
+cegui_find_package(FRIBIDI fribidi fribidi.h fribidi fribidi)

-if (WIN32 OR APPLE)
-    find_library(FRIBIDI_LIB_STATIC NAMES fribidi libfribidi PATH_SUFFIXES static)
-    find_library(FRIBIDI_LIB_STATIC_DBG NAMES fribidi_d libfribidi_d PATH_SUFFIXES static)
-    mark_as_advanced(FRIBIDI_LIB_STATIC FRIBIDI_LIB_STATIC_DBG)
-endif()
-
-cegui_find_package_handle_standard_args(FRIBIDI FRIBIDI_LIB FRIBIDI_H_PATH)
-
-
-# set up output vars
-if (FRIBIDI_FOUND)
-    set (FRIBIDI_INCLUDE_DIR ${FRIBIDI_H_PATH})
-    set (FRIBIDI_LIBRARIES ${FRIBIDI_LIB})
-    if (FRIBIDI_LIB_DBG)
-        set (FRIBIDI_LIBRARIES_DBG ${FRIBIDI_LIB_DBG})
-    endif()
-    if (FRIBIDI_LIB_STATIC)
-        set (FRIBIDI_LIBRARIES_STATIC ${FRIBIDI_LIB_STATIC})
-    endif()
-    if (FRIBIDI_LIB_STATIC_DBG)
-        set (FRIBIDI_LIBRARIES_STATIC_DBG ${FRIBIDI_LIB_STATIC_DBG})
-    endif()
-else()
-    set (FRIBIDI_INCLUDE_DIR)
-    set (FRIBIDI_LIBRARIES)
-    set (FRIBIDI_LIBRARIES_DBG)
-    set (FRIBIDI_LIBRARIES_STATIC)
-    set (FRIBIDI_LIBRARIES_STATIC_DBG)
-endif()
-


Trivial commit.

Trivial commit.

--- cmake/TbagProject.cmake
+++ cmake/TbagProject.cmake
@@ -188,6 +188,8 @@

     # Find all project.
     file (GLOB_RECURSE __find_project_list RELATIVE "${__root_dir}" "${TBAG_PROJECT_FILE_NAME}")
+
+    tbag_debug_list (tbag_project__find/find_project_list ${__find_project_list})

     # Find library project.
     tbag_utils__list_of_regex (__find_lib_proj "${__library_glob}" ${__find_project_list})


[VTA] Infinite recursive device_api.ext_dev call fix. (#3843)

Issue
when try vta on fpga board, would see a Infinite recursive
device_api.ext_dev issue that cause stack overflow and vta
failed.

Analysis:
device_api.ext_dev function in rpc_server.py is use to load
vta library, once vta library get load, device_api.ext_dev would
get replaced with vta function by vta library, vta device_api.cc
did such work, but because a logic issue in VTA.cmake, the said file
not get compiled, then vta would keep failing on rpc_server.py.

Solution:
fix the logic issue in VTA.cmake.

--- cmake/modules/VTA.cmake
+++ cmake/modules/VTA.cmake
@@ -84,7 +84,7 @@
     # Rules for Zynq-class FPGAs with pynq OS support (see pynq.io)
     if(${VTA_TARGET} STREQUAL "pynq" OR
        ${VTA_TARGET} STREQUAL "ultra96")
-      file(GLOB FPGA_RUNTIME_SRCS vta/src/pynq/pynq_driver.cc)
+      list(APPEND FPGA_RUNTIME_SRCS vta/src/pynq/pynq_driver.cc)
     endif()
     # Target lib: vta
     add_library(vta SHARED ${FPGA_RUNTIME_SRCS})


Re-enable ada bindings now plshade / pllegend updates have been made.

svn path=/trunk/; revision=12339

--- cmake/modules/ada.cmake
+++ cmake/modules/ada.cmake
@@ -22,7 +22,7 @@
 if(DEFAULT_NO_BINDINGS)
   option(ENABLE_ada "Enable Ada bindings" OFF)
 else(DEFAULT_NO_BINDINGS)
-  option(ENABLE_ada "Enable Ada bindings" OFF)
+  option(ENABLE_ada "Enable Ada bindings" ON)
 endif(DEFAULT_NO_BINDINGS)

 if(ENABLE_ada AND NOT PLPLOT_Ada_COMPILER_WORKS)


gtest 1.5 fix

gtest 1.5 fix

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@725 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -134,17 +134,19 @@
     cmake_parse_arguments(PCL_ADD_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
     add_executable(${_exename} ${PCL_ADD_TEST_FILES})
     PCL_ADD_OPENMP_FLAGS(${_exename})
+    target_link_libraries(${_exename} ${GTEST_BOTH_LIBRARIES} ${PCL_ADD_TEST_LINK_WITH})
     # must link explicitly against boost only on Windows
     target_link_libraries(${_exename} ${Boost_LIBRARIES})
     #
     # Only link if needed
     if(UNIX)
       SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)
+      # GTest >= 1.5 requires pthread and CMake's 2.8.4 FindGTest is broken
+      target_link_libraries(${_exename} pthread)
     elseif(WIN32)
       SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS /OPT:REF)
     endif()
     #
-    target_link_libraries(${_exename} ${GTEST_BOTH_LIBRARIES} ${PCL_ADD_TEST_LINK_WITH})
     PCL_LINK_OPENMP(${_exename})

     if(${CMAKE_VERSION} VERSION_LESS 2.8.4)


no pthread on Android

no pthread on Android

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@2961 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -179,11 +179,11 @@
 macro(PCL_ADD_EXECUTABLE _name _component)
     add_executable(${_name} ${ARGN})
     # must link explicitly against boost.
-    if(UNIX)
+    if(UNIX AND NOT ANDROID_NDK)
       target_link_libraries(${_name} ${Boost_LIBRARIES} pthread)
-    else(UNIX)
+    else()
       target_link_libraries(${_name} ${Boost_LIBRARIES})
-    endif(UNIX)
+    endif()
     #
     # Only link if needed
     if(WIN32 AND MSVC)
@@ -255,7 +255,7 @@
     if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
       set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl)
       target_link_libraries(${_exename} pthread)
-    elseif(UNIX)
+    elseif(UNIX AND NOT ANDROID_NDK)
       set_target_properties(${_exename} PROPERTIES LINK_FLAGS -Wl,--as-needed)
       # GTest >= 1.5 requires pthread and CMake's 2.8.4 FindGTest is broken
       target_link_libraries(${_exename} pthread)


BUG:  CMake no comprende 5.1.1

BUG:  CMake no comprende 5.1.1

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -153,7 +153,7 @@
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   # set(${proj}_REPOSITORY ${git_protocol}://github.com/stnava/ITK.git)
   set(${proj}_GIT_TAG e21a56d1227c5433066237060368cb4532b8a9d2)  # Adaptive denoising module 10/2/2020
-  set(ITK_VERSION_ID ITK-5.1.1) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID
+  set(ITK_VERSION_ID ITK-5.1) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


corrected issue in cmake file

corrected issue in cmake file

--- CMake/FindZZIP.cmake
+++ CMake/FindZZIP.cmake
@@ -20,7 +20,6 @@
         set (ZZIP_LIBRARIES_DBG ${ZZIP_LIB_DBG})
     endif()
 else()
-  unset
     set (ZZIP_INCLUDE_DIR)
     set (ZZIP_LIBRARIES)
     set (ZZIP_LIBRARIES_DBG)


Update sdl to 2.0.5

Update sdl to 2.0.5

--- CMake/get-sdl2.cmake
+++ CMake/get-sdl2.cmake
@@ -5,7 +5,7 @@

 include(ExternalProject)

-set(SDL2_VERSION "2.0.4")
+set(SDL2_VERSION "2.0.5")

 # For Windows it's faster to download the pre-compiled development binaries.
 if (WIN32)
@@ -65,4 +65,4 @@
     CMAKE_ARGS ${SDL2_CMAKE_ARGS}
   )

-endif()+endif()


for consistency remove -std=c++11 from default; fixes #198

--- compilers/GNU.CXX.cmake
+++ compilers/GNU.CXX.cmake
@@ -1,6 +1,6 @@
 if(NOT DEFINED ENV{CXXFLAGS})
     if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
         set(CMAKE_CXX_FLAGS_RELEASE "-O3")
         set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
     endif()


CMake build procedure improvements: - Doxygen staff

--- salome_adm/cmake_files/FindSalomeDoxygen.cmake
+++ salome_adm/cmake_files/FindSalomeDoxygen.cmake
@@ -23,6 +23,18 @@
 #
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
+# Additional variables:
+#
+# DOXYGEN_SUPPORT_STL (string) [advanced] : set to YES if doxygen properly manages STL files
+#                     or to NO otherwise (version 1.4.4 or older); see description of
+#                     BUILTIN_STL_SUPPORT configuration variable in the doxygen documentation

 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Doxygen DOXYGEN_EXECUTABLE 2)
-#MARK_AS_ADVANCED()
+IF(DOXYGEN_FOUND)
+  IF(DOXYGEN_VERSION VERSION_LESS "1.4.5")
+    SET(DOXYGEN_SUPPORT_STL NO)
+  ELSE()
+    SET(DOXYGEN_SUPPORT_STL YES)
+  ENDIF()
+ENDIF()
+MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL)


Add -Wno-variadic-macros to warning list

We effectively require a C++ compiler anyway, and the warnings originate
from the few C modules we have remaining

Change-Id: Ibb449e5d513cb8c791c06c77a15276c0ec66e193
Reviewed-on: http://review.couchbase.org/71612
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>

--- cmake/Modules/GetLibcouchbaseFlags.cmake
+++ cmake/Modules/GetLibcouchbaseFlags.cmake
@@ -22,7 +22,8 @@

 LIST(APPEND LCB_GNUC_CPP_WARNINGS
     -Wall -pedantic -Wshadow -fdiagnostics-show-option -Wformat
-    -Wno-strict-aliasing -Wextra -Winit-self -Wno-missing-field-initializers)
+    -Wno-strict-aliasing -Wextra -Winit-self -Wno-missing-field-initializers
+    -Wno-variadic-macros)

 IF("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
     LIST(APPEND LCB_GNUC_CPP_WARNINGS -Wno-cast-align -Wno-dollar-in-identifier-extension)


Sort .desktop translations. Fix typos in the comments. Remove local dir artifact.

--- cmake/modules/LXQtTranslateDesktop.cmake
+++ cmake/modules/LXQtTranslateDesktop.cmake
@@ -1,6 +1,6 @@
 #=============================================================================
-# The lxqt_translate_desktop() function was copied from the the
-# LXQt LxQtTranste.cmake
+# The lxqt_translate_desktop() function was copied from the
+# LXQt LxQtTranslate.cmake
 #
 # Original Author: Alexander Sokolov <sokoloff.a@gmail.com>
 #
@@ -34,7 +34,7 @@
     if (NOT ${_UNPARSED_ARGS} STREQUAL "")
         MESSAGE(FATAL_ERROR
           "Unknown arguments '${_UNPARSED_ARGS}'.\n"
-          "See lxqt_translate_desktop() documenation for more information.\n"
+          "See lxqt_translate_desktop() documentation for more information.\n"
         )
     endif()

@@ -65,11 +65,11 @@

         file(GLOB _translations
             ${_translationDir}/${_fileName}_*${_fileExt}
-            ${_translationDir}/local/${_fileName}_*${_fileExt}
         )

         set(_pattern "'\\[.*]\\s*='")
         if (_translations)
+            list(SORT _translations)
             add_custom_command(OUTPUT ${_outFile}
                 COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
                 COMMAND grep -h ${_pattern} ${_translations} >> ${_outFile}


get oidn source via git clone in superbuild for submodules

--- scripts/superbuild/dependencies/dep_oidn.cmake
+++ scripts/superbuild/dependencies/dep_oidn.cmake
@@ -29,7 +29,8 @@
     SOURCE_DIR ${COMPONENT_NAME}/src
     BINARY_DIR ${COMPONENT_NAME}/build
     LIST_SEPARATOR | # Use the alternate list separator
-    URL "https://github.com/OpenImageDenoise/oidn/archive/${BUILD_OIDN_VERSION}.zip"
+    GIT_REPOSITORY "https://github.com/OpenImageDenoise/oidn.git"
+    GIT_SHALLOW ON
     CMAKE_ARGS
       -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}
       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}


Include CMakeCache to md5sum

Include CMakeCache to md5sum


Newlineboi

Newlineboi

--- 3rdparty/3rdparty.cmake
+++ 3rdparty/3rdparty.cmake
@@ -109,4 +109,4 @@
 set_property(TARGET spirv-cross-hlsl PROPERTY EXCLUDE_FROM_ALL True)
 set_property(TARGET spirv-cross-msl PROPERTY EXCLUDE_FROM_ALL True)
 set_property(TARGET spirv-cross-reflect PROPERTY EXCLUDE_FROM_ALL True)
-set_property(TARGET spirv-cross-util PROPERTY EXCLUDE_FROM_ALL True)+set_property(TARGET spirv-cross-util PROPERTY EXCLUDE_FROM_ALL True)


DOC: MITK_CREATE_MODULE_CONF documentation added

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -137,6 +137,17 @@

 INCLUDE(MacroParseArguments)

+
+###################################################################
+#
+# MITK_CREATE_MODULE_CONF
+#
+# This can be called in a similar way like MITK_CREATE_MODULE
+# but it just creates the module configuration files without
+# actually building it. It is used for integration of legacy libraries
+# into the MITK module build system
+#
+##################################################################
 MACRO(MITK_CREATE_MODULE_CONF MODULE_NAME_IN)
   MACRO_PARSE_ARGUMENTS(MODULE "INCLUDE_DIRS;DEPENDS;PROVIDES" "QT_MODULE" ${ARGN})
   SET(MODULE_NAME ${MODULE_NAME_IN})


Check for cmake version

Check for cmake version

To get the semicolon to pass through the layers of function calls,
we use slashes.  The number of slashes require depends on the cmake
version.  For cmake 3.5, 7 slashes are needed.  For old version,
11 seem to be the number required.

Change-Id: I2a17e9421e105340825f203dd63ed76dfe11cc74

--- CMake/sitkAddTest.cmake
+++ CMake/sitkAddTest.cmake
@@ -165,9 +165,14 @@
   if(WIN32)
     set( _JAVA_LIBRARY_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIGURATION>" )
     # Note: on windows this is a semi-colon separated list
-    # Note 2: there are 7 backslashes before the semi-colon so that it
-    #         gets properly passed through 4 levels of function calls.
-    set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}\\\\\\\;${CMAKE_CURRENT_BINARY_DIR}" )
+    # Note 2: there are 7 or 11 backslashes (depending on the cmake version)
+    #         before the semi-colon so that it gets properly passed through
+    #         4 levels of function calls.
+    if (${CMAKE_VERSION} VERSION_LESS "3.5")
+      set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}\\\\\\\\\\\;${CMAKE_CURRENT_BINARY_DIR}" )
+    else()
+      set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}\\\\\\\;${CMAKE_CURRENT_BINARY_DIR}" )
+    endif()

   else(WIN32)
     set( _JAVA_LIBRARY_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" )


STYLE: some formatting

STYLE: some formatting

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -1,10 +1,3 @@
-#
-# Create a core library (Algorithms, DataStructures etc.)
-#
-# No parameters. Expects files.cmake in the same directory and CMake
-# variables LIBPOSTFIX and KITNAME to be set correctly
-#
-
 MACRO(ORGANIZE_SOURCES)

   # this macro gets a filelist as input and looks
@@ -172,7 +165,8 @@
 #     [PROVIDES <library name which is built>]
 #     [PACKAGE_DEPENDS <packages we need, like ITK, VTK, QT>]
 #     [EXPORT_DEFINE <declspec macro name for dll exports>]
-
+#
+##################################################################
 MACRO(MITK_CREATE_MODULE MODULE_NAME_IN)
   MACRO_PARSE_ARGUMENTS(MODULE "INCLUDE_DIRS;INTERNAL_INCLUDE_DIRS;DEPENDS;DEPENDS_INTERNAL;PROVIDES;PACKAGE_DEPENDS;EXPORT_DEFINE;ADDITIONAL_LIBS;GENERATED_CPP" "QT_MODULE;FORCE_STATIC;HEADERS_ONLY" ${ARGN})
   SET(MODULE_NAME ${MODULE_NAME_IN})


FIX (#6482): install Qt plugins with complete symlinks

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -514,13 +514,13 @@
       INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"
         DESTINATION ${${_target_location}_qt_plugins_install_dir}
           CONFIGURATIONS Release
-          FILES_MATCHING REGEX "[^d]4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}$"
+          FILES_MATCHING REGEX "[^d]4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}"
           )

       INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"
         DESTINATION ${${_target_location}_qt_plugins_install_dir}
           CONFIGURATIONS Debug
-          FILES_MATCHING REGEX "d4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}$"
+          FILES_MATCHING REGEX "d4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}"
           )

   ENDIF(QT_PLUGINS_DIR)
@@ -635,13 +635,13 @@
         INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"
           DESTINATION ${${_target_location}_qt_plugins_install_dir}
             CONFIGURATIONS Release
-            FILES_MATCHING REGEX "[^d]4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}$"
+            FILES_MATCHING REGEX "[^d]4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}"
             )

         INSTALL(DIRECTORY "${QT_PLUGINS_DIR}"
           DESTINATION ${${_target_location}_qt_plugins_install_dir}
             CONFIGURATIONS Debug
-            FILES_MATCHING REGEX "d4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}$"
+            FILES_MATCHING REGEX "d4?\\${CMAKE_SHARED_LIBRARY_SUFFIX}"
             )

     ENDIF(QT_PLUGINS_DIR)


ENH: new macro INCREASE_MSVC_HEAP()

ENH: new macro INCREASE_MSVC_HEAP()

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -34,3 +34,12 @@
   SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${VTK_REQUIRED_SHARED_LINKER_FLAGS}")
   SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${VTK_REQUIRED_MODULE_LINKER_FLAGS}")
 ENDMACRO(APPLY_VTK_FLAGS)
+
+# increase heap limit for MSVC70. Assumes /Zm1000 is set by ITK
+MACRO(INCREASE_MSVC_HEAP_LIMIT)
+IF(MSVC70)
+ STRING(REPLACE /Zm1000 /Zm1200 CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+ENDIF(MSVC70)
+ENDMACRO(INCREASE_MSVC_HEAP_LIMIT)
+
+


Set FUSE_DEVEL_PACKAGE to void if FUSE is not found this allows to build an RPM without FUSE if FUSE was not found on the system.

--- make/FindFUSE.cmake
+++ make/FindFUSE.cmake
@@ -44,10 +44,11 @@

   IF(FUSE_INCLUDE_DIR AND XATTR_INCLUDE_DIR AND FUSE_LIBRARY)
     SET(FUSE_FOUND "YES")
+    SET(FUSE_DEVEL_PACKAGE fuse-devel)
   ELSE(FUSE_INCLUDE_DIR AND XATTR_INCLUDE_DIR AND FUSE_LIBRARY)
     SET(FUSE_FOUND "NO")
+    SET(FUSE_DEVEL_PACKAGE "")
   ENDIF(FUSE_INCLUDE_DIR AND XATTR_INCLUDE_DIR AND FUSE_LIBRARY)
-  SET(FUSE_DEVEL_PACKAGE fuse-devel)
 ENDIF (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")

 MARK_AS_ADVANCED(


added several more targets to examples.cmake to correspond with the make build system;

--- Examples/Examples.cmake
+++ Examples/Examples.cmake
@@ -25,6 +25,7 @@
   -D "CMAKE_INSTALL_COMPONENT=exe"
   -P "${MTF_BINARY_DIR}/cmake_install.cmake"
   )
+add_custom_target(exe DEPENDS runMTF)
 add_custom_target(mtfe DEPENDS runMTF install_exe)

 add_executable(trackUAVTrajectory Examples/src/trackUAVTrajectory.cc)
@@ -37,6 +38,7 @@
   -D "CMAKE_INSTALL_COMPONENT=uav"
   -P "${MTF_BINARY_DIR}/cmake_install.cmake"
   )
+add_custom_target(uav DEPENDS trackUAVTrajectory)
 add_custom_target(mtfu DEPENDS trackUAVTrajectory install_uav)

 add_executable(extractPatch Examples/src/extractPatch.cc)
@@ -49,7 +51,7 @@
   -D "CMAKE_INSTALL_COMPONENT=patch"
   -P "${MTF_BINARY_DIR}/cmake_install.cmake"
   )
-
+
 add_executable(generateSyntheticSeq Examples/src/generateSyntheticSeq.cc)
 target_compile_options(generateSyntheticSeq PUBLIC ${MTF_RUNTIME_FLAGS})
 target_include_directories(generateSyntheticSeq PUBLIC  Examples/include ${MTF_INCLUDE_DIRS} ${MTF_EXT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
@@ -60,6 +62,7 @@
   -D "CMAKE_INSTALL_COMPONENT=syn"
   -P "${MTF_BINARY_DIR}/cmake_install.cmake"
   )
+add_custom_target(syn DEPENDS generateSyntheticSeq)
 add_custom_target(mtfw DEPENDS generateSyntheticSeq install_syn)

 add_executable(createMosaic Examples/src/createMosaic.cc)
@@ -72,6 +75,7 @@
   -D "CMAKE_INSTALL_COMPONENT=mos"
   -P "${MTF_BINARY_DIR}/cmake_install.cmake"
   )
+add_custom_target(mos DEPENDS createMosaic)
 add_custom_target(mtfm DEPENDS createMosaic install_mos)

 find_package(PythonLibs 2.7)
@@ -84,6 +88,7 @@
 		target_include_directories(pyMTF PUBLIC Examples/include ${MTF_INCLUDE_DIRS} ${MTF_EXT_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
 		target_link_libraries(pyMTF mtf ${MTF_LIBS} ${PYTHON_LIBRARIES} ${PYTHON_LIBS} ${Boost_LIBRARIES})
 		install(TARGETS pyMTF LIBRARY DESTINATION ${MTF_PY_INSTALL_DIR} COMPONENT py)
+		add_custom_target(py DEPENDS pyMTF)
 		add_custom_target(install_py
 		  ${CMAKE_COMMAND}
 		  -D "CMAKE_INSTALL_COMPONENT=py"
@@ -102,9 +107,12 @@
 target_include_directories(testMTF PUBLIC Examples/include ${MTF_INCLUDE_DIRS} ${MTF_EXT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
 target_link_libraries(testMTF mtf_test mtf ${MTF_LIBS} ${Boost_LIBRARIES})
 install(TARGETS testMTF RUNTIME DESTINATION ${MTF_EXEC_INSTALL_DIR} COMPONENT test_exe)
-add_custom_target(install_test_exe
+add_custom_target(test DEPENDS testMTF)
+add_custom_target(install_test
   ${CMAKE_COMMAND}
   -D "CMAKE_INSTALL_COMPONENT=test_exe"
   -P "${MTF_BINARY_DIR}/cmake_install.cmake"
   )
-
+
+add_custom_target(all DEPENDS runMTF createMosaic generateSyntheticSeq trackUAVTrajectory)
+add_custom_target(install_all DEPENDS install_exe install_mos install_syn install_uav)


correct dependencies list and deactivate ossim-apps

--- CMake/External_ossim.cmake
+++ CMake/External_ossim.cmake
@@ -72,7 +72,7 @@
     list(APPEND ${proj}_DEPENDENCIES OPENTHREADS)
   endif()

-    ExternalProject_Add(ossim_cmakemodules
+  ExternalProject_Add(ossim_cmakemodules
     PREFIX ${proj}/_cmakemodules
     SVN_REPOSITORY "http://svn.osgeo.org/ossim/trunk/ossim_package_support/cmake/CMakeModules"
     SVN_REVISION -r 23087
@@ -80,33 +80,23 @@
     BUILD_COMMAND ""
     INSTALL_COMMAND "")

-    set(${proj}_DEPENDENCIES ossim_cmakemodules)
-
+  list(APPEND ${proj}_DEPENDENCIES ossim_cmakemodules)
+
   set(OSSIM_CXX_FLAGS  -D__STDC_CONSTANT_MACROS)
- list(APPEND ${proj}_DEPENDENCIES ossim_cmakemodules)

   if(MSVC)
-    #checkout cmakeModules
-     set(${proj}_DEPENDENCIES ossim_cmakemodules)
-     list(APPEND ${proj}_DEPENDENCIES OPENTHREADS)
-     list(APPEND ${proj}_DEPENDENCIES GEOTIFF)
-    #cmake flags for exception handling in c++
     set(OSSIM_CXX_FLAGS /EHsc)
-    #clear all dependent library settings except GEOTIFF as we link with gdal_i.
-    #This is because of gisinternals built with internal geotiff
     set(OSSIM_SB_TIFF_CONFIG)
     set(OSSIM_SB_GEOS_CONFIG)
     set(OSSIM_SB_JPEG_CONFIG)
     set(OSSIM_SB_OPENTHREADS_CONFIG)
     set(OSSIM_SB_GEOTIFF_CONFIG)
-    #build geotiff and use it
-    #set(OSSIM_SB_GEOTIFF_CONFIG -DGEOTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/gdal_i.lib)
   endif()

   ExternalProject_Add(${proj}
     PREFIX ${proj}
     SVN_REPOSITORY "http://svn.osgeo.org/ossim/trunk/ossim/"
-    SVN_REVISION -r 23087
+    SVN_REVISION -r 23092
     BINARY_DIR ${OSSIM_SB_BUILD_DIR}
     INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
     CMAKE_CACHE_ARGS
@@ -120,6 +110,7 @@
       ${OSSIM_SB_JPEG_CONFIG}
       ${OSSIM_SB_OPENTHREADS_CONFIG}
       -DBUILD_OSSIM_MPI_SUPPORT:BOOL=OFF
+      -DBUILD_OSSIM_APPS:BOOL=OFF
     DEPENDS ${${proj}_DEPENDENCIES}
     CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )


Improved FindCyclusCore to use environment variables.

--- CMake/FindCyclusCore.cmake
+++ CMake/FindCyclusCore.cmake
@@ -4,23 +4,28 @@

 # Look for the header files
 FIND_PATH(CYCLUS_CORE_INCLUDE_DIR suffix.h
-  HINTS /usr/local/cyclus /opt/local/cyclus
+  HINTS /usr/local/cyclus /opt/local/cyclus "$ENV{CYCLUS_ROOT_DIR}/cyclus"
+  "$ENV{CYCLUS_ROOT_DIR}"
   PATH_SUFFIXES cyclus/include)

 # Look for the header files
 FIND_PATH(CYCLUS_CORE_SHARE_DIR cyclus.rng.in
-  HINTS /usr/local/cyclus /opt/local/cyclus
+  HINTS /usr/local/cyclus /opt/local/cyclus "$ENV{CYCLUS_ROOT_DIR}/cyclus"
+  "$ENV{CYCLUS_ROOT_DIR}"
   PATH_SUFFIXES cyclus/share)

 # Look for the library
 FIND_LIBRARY(CYCLUS_CORE_LIBRARY NAMES cycluscore
   HINTS /usr/local/cyclus/lib /usr/local/cyclus
-  /opt/local/lib /opt/local/cyclus/lib)
+  "$ENV{CYCLUS_ROOT_DIR}/lib"
+  /opt/local/lib /opt/local/cyclus/lib "$ENV{CYCLUS_ROOT_DIR}/cyclus/lib")

 # Look for the library
 FIND_LIBRARY(CYCLUS_GTEST_LIBRARY NAMES gtest
   HINTS /usr/local/cyclus/lib /usr/local/cyclus
-  /opt/local/lib /opt/local/cyclus/lib)
+  /opt/local/lib /opt/local/cyclus/lib "$ENV{CYCLUS_ROOT_DIR}/cyclus/lib"
+  "$ENV{CYCLUS_ROOT_DIR}/lib"
+  )

 # Copy the results to the output variables.
 IF (CYCLUS_CORE_INCLUDE_DIR AND CYCLUS_CORE_LIBRARY AND CYCLUS_GTEST_LIBRARY AND CYCLUS_CORE_SHARE_DIR)


Revert back to -03

Revert back to -03

--- build_settings.cmake
+++ build_settings.cmake
@@ -20,7 +20,7 @@
 set(WARN_OPTS "-Wuninitialized -Werror -Wall -W -Wchar-subscripts -Wcomment -Wformat -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings")

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Og ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -Wnon-virtual-dtor -fvisibility-inlines-hidden -fdiagnostics-color=auto")


include existing source directories before setting them in dtkBuild

--- cmake/dtkBuild.cmake
+++ cmake/dtkBuild.cmake
@@ -62,7 +62,6 @@
 ## #################################################################
 ## Configure path
 ## #################################################################
-
 include_directories(${PROJECT_SOURCE_DIR}/src)
 include_directories(${PROJECT_BINARY_DIR})

@@ -80,7 +79,7 @@
 set(RUNTIME_INSTALL_OUTPUT_PATH    ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_RUNTIME_OUTPUT_DIRECTORY})
 set(EXECUTABLE_INSTALL_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_RUNTIME_OUTPUT_DIRECTORY})

-set(${PROJECT_NAME}_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/src)
+set(${PROJECT_NAME}_INCLUDE_DIRS ${${PROJECT_NAME}_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src)
 set(${PROJECT_NAME}_LIBRARY_DIRS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
 set(${PROJECT_NAME}_RUNTIME_DIRS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
 set(${PROJECT_NAME}_CMAKE_DIRS ${PROJECT_SOURCE_DIR}/cmake)


Update CompilerWarnings to include permissive-

Added flag for standards conforming code in CompilerWarnings on Windows MSVC builds.

--- cmake/CompilerWarnings.cmake
+++ cmake/CompilerWarnings.cmake
@@ -37,6 +37,7 @@
       /w14906 # string literal cast to 'LPWSTR'
       /w14928 # illegal copy-initialization; more than one user-defined
               # conversion has been implicitly applied
+      /permissive- # standards conformance mode for MSVC compiler.
   )

   set(CLANG_WARNINGS


- Fixed avrdude flags handling (was broken) - Added missing documentation - Removed debug/uneeded statements

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -273,7 +273,7 @@
     setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD} "${ALL_SRCS}" "${ALL_LIBS}" "-I${INPUT_SKETCH} ${LIB_DEP_INCLUDES}" "")

     if(INPUT_PORT)
-        setup_arduino_upload(${INPUT_BOARD} ${INPUT_NAME} ${INPUT_PORT})
+        setup_arduino_upload(${INPUT_BOARD} ${INPUT_NAME} ${INPUT_PORT} "${INPUT_PROGRAMMER}" "${INPUT_AFLAGS}")
     endif()

     if(INPUT_SERIAL)
@@ -290,6 +290,7 @@
 # see documentation at top
 #=============================================================================#
 function(GENERATE_ARDUINO_EXAMPLE LIBRARY_NAME EXAMPLE_NAME BOARD_ID)
+    #TODO: Add support for options like generate_arduino_*

     set(TARGET_NAME "example-${LIBRARY_NAME}-${EXAMPLE_NAME}")

@@ -322,7 +323,8 @@
     setup_arduino_target(${TARGET_NAME} "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "")

     if(INPUT_PORT)
-        setup_arduino_upload(${BOARD_ID} ${TARGET_NAME} ${INPUT_PORT})
+        #TODO fill in options (PROGRAMMER_ID and AFLAGS)
+        setup_arduino_upload(${BOARD_ID} ${TARGET_NAME} ${INPUT_PORT} "" "")
     endif()

     if(INPUT_SERIAL)
@@ -349,9 +351,6 @@
 #
 #=============================================================================#
 macro(PARSE_GENERATOR_ARGUMENTS TARGET_NAME PREFIX OPTIONS ARGS MULTI_ARGS)
-    #CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
-    #cmake_parse_arguments(INPUT "NO_AUTOLIBS" "BOARD;PORT;SKETCH;SERIAL;PROGRAMMER" "SRCS;HDRS;LIBS;AFLAGS" ${ARGN})
-
     cmake_parse_arguments(${PREFIX} "${OPTIONS}" "${ARGS}" "${MULTI_ARGS}" ${ARGN})
     error_for_unparsed(${PREFIX})
     load_generator_settings(${TARGET_NAME} ${PREFIX} ${OPTIONS} ${ARGS} ${MULTI_ARGS})
@@ -705,17 +704,19 @@
 #        BOARD_ID    - Arduino board id
 #        TARGET_NAME - Target name
 #        PORT        - Serial port for upload
+#        PROGRAMMER_ID - Programmer ID
+#        AVRDUDE_FLAGS - avrdude flags
 #
 # Create an upload target (${TARGET_NAME}-upload) for the specified Arduino target.
 #
 #=============================================================================#
-function(setup_arduino_upload BOARD_ID TARGET_NAME PORT)
-    setup_arduino_bootloader_upload(${TARGET_NAME} ${BOARD_ID} ${PORT})
+function(setup_arduino_upload BOARD_ID TARGET_NAME PORT PROGRAMMER_ID AVRDUDE_FLAGS)
+    setup_arduino_bootloader_upload(${TARGET_NAME} ${BOARD_ID} ${PORT} "${AVRDUDE_FLAGS}")

     # Add programmer support if defined
-    if(${TARGET_NAME}_PROGRAMMER AND ${${TARGET_NAME}_PROGRAMMER}.protocol)
-        setup_arduino_programmer_burn(${TARGET_NAME} ${BOARD_ID} ${${TARGET_NAME}_PROGRAMMER} ${PORT})
-        setup_arduino_bootloader_burn(${TARGET_NAME} ${BOARD_ID} ${${TARGET_NAME}_PROGRAMMER} ${PORT})
+    if(PROGRAMMER_ID AND ${PROGRAMMER_ID}.protocol)
+        setup_arduino_programmer_burn(${TARGET_NAME} ${BOARD_ID} ${PROGRAMMER_ID} ${PORT} "${AVRDUDE_FLAGS}")
+        setup_arduino_bootloader_burn(${TARGET_NAME} ${BOARD_ID} ${PROGRAMMER_ID} ${PORT} "${AVRDUDE_FLAGS}")
     endif()
 endfunction()

@@ -734,11 +735,11 @@
 # The target for uploading the firmware is ${TARGET_NAME}-upload .
 #
 #=============================================================================#
-function(setup_arduino_bootloader_upload TARGET_NAME BOARD_ID PORT)
+function(setup_arduino_bootloader_upload TARGET_NAME BOARD_ID PORT AVRDUDE_FLAGS)
     set(UPLOAD_TARGET ${TARGET_NAME}-upload)
     set(AVRDUDE_ARGS)

-    setup_arduino_bootloader_args(${BOARD_ID} ${TARGET_NAME} ${PORT} AVRDUDE_ARGS)
+    setup_arduino_bootloader_args(${BOARD_ID} ${TARGET_NAME} ${PORT} "${AVRDUDE_FLAGS}" AVRDUDE_ARGS)

     if(NOT AVRDUDE_ARGS)
         message("Could not generate default avrdude bootloader args, aborting!")
@@ -748,7 +749,7 @@
     list(APPEND AVRDUDE_ARGS "-Uflash:w:${TARGET_NAME}.hex")
     add_custom_target(${UPLOAD_TARGET}
                      ${ARDUINO_AVRDUDE_PROGRAM}
-                        ${AVRDUDE_ARGS}
+                     ${AVRDUDE_ARGS}
                      DEPENDS ${TARGET_NAME})
 endfunction()

@@ -766,12 +767,12 @@
 # The target for burning the firmware is ${TARGET_NAME}-burn .
 #
 #=============================================================================#
-function(setup_arduino_programmer_burn TARGET_NAME BOARD_ID PROGRAMMER)
+function(setup_arduino_programmer_burn TARGET_NAME BOARD_ID PROGRAMMER PORT AVRDUDE_FLAGS)
     set(PROGRAMMER_TARGET ${TARGET_NAME}-burn)

     set(AVRDUDE_ARGS)

-    setup_arduino_programmer_args(${BOARD_ID} ${PROGRAMMER} ${TARGET_NAME} ${PORT} AVRDUDE_ARGS)
+    setup_arduino_programmer_args(${BOARD_ID} ${PROGRAMMER} ${TARGET_NAME} ${PORT} "${AVRDUDE_FLAGS}" AVRDUDE_ARGS)

     if(NOT AVRDUDE_ARGS)
         message("Could not generate default avrdude programmer args, aborting!")
@@ -782,7 +783,7 @@

     add_custom_target(${PROGRAMMER_TARGET}
                      ${ARDUINO_AVRDUDE_PROGRAM}
-                        ${AVRDUDE_ARGS}
+                     ${AVRDUDE_ARGS}
                      DEPENDS ${TARGET_NAME})
 endfunction()

@@ -800,12 +801,12 @@
 # The target for burning the bootloader is ${TARGET_NAME}-burn-bootloader
 #
 #=============================================================================#
-function(setup_arduino_bootloader_burn TARGET_NAME BOARD_ID PROGRAMMER PORT)
+function(setup_arduino_bootloader_burn TARGET_NAME BOARD_ID PROGRAMMER PORT AVRDUDE_FLAGS)
     set(BOOTLOADER_TARGET ${TARGET_NAME}-burn-bootloader)

     set(AVRDUDE_ARGS)

-    setup_arduino_programmer_args(${BOARD_ID} ${PROGRAMMER} ${TARGET_NAME} ${PORT} AVRDUDE_ARGS)
+    setup_arduino_programmer_args(${BOARD_ID} ${PROGRAMMER} ${TARGET_NAME} ${PORT} "${AVRDUDE_FLAGS}" AVRDUDE_ARGS)

     if(NOT AVRDUDE_ARGS)
         message("Could not generate default avrdude programmer args, aborting!")
@@ -862,12 +863,11 @@
 #
 # Sets up default avrdude settings for burning firmware via a programmer.
 #=============================================================================#
-function(setup_arduino_programmer_args BOARD_ID PROGRAMMER TARGET_NAME PORT OUTPUT_VAR)
+function(setup_arduino_programmer_args BOARD_ID PROGRAMMER TARGET_NAME PORT AVRDUDE_FLAGS OUTPUT_VAR)
     set(AVRDUDE_ARGS ${${OUTPUT_VAR}})

-    set(AVRDUDE_FLAGS ${ARDUINO_AVRDUDE_FLAGS})
-    if(DEFINED ${TARGET_NAME}_AFLAGS)
-        set(AVRDUDE_FLAGS ${${TARGET_NAME}_AFLAGS})
+    if(NOT AVRDUDE_FLAGS)
+        set(AVRDUDE_FLAGS ${ARDUINO_AVRDUDE_FLAGS})
     endif()

     list(APPEND AVRDUDE_ARGS "-C${ARDUINO_AVRDUDE_CONFIG_PATH}")
@@ -915,12 +915,11 @@
 #
 # Sets up default avrdude settings for uploading firmware via the bootloader.
 #=============================================================================#
-function(setup_arduino_bootloader_args BOARD_ID TARGET_NAME PORT OUTPUT_VAR)
+function(setup_arduino_bootloader_args BOARD_ID TARGET_NAME PORT AVRDUDE_FLAGS OUTPUT_VAR)
     set(AVRDUDE_ARGS ${${OUTPUT_VAR}})

-    set(AVRDUDE_FLAGS ${ARDUINO_AVRDUDE_FLAGS})
-    if(DEFINED ${TARGET_NAME}_AFLAGS)
-        set(AVRDUDE_FLAGS ${${TARGET_NAME}_AFLAGS})
+    if(NOT AVRDUDE_FLAGS)
+        set(AVRDUDE_FLAGS ${ARDUINO_AVRDUDE_FLAGS})
     endif()

     list(APPEND AVRDUDE_ARGS
@@ -1185,7 +1184,15 @@
 endfunction()

 #=============================================================================#
-# setup_arduino_example()
+# [PRIVATE/INTERNAL]
+#
+# setup_arduino_example(LIBRARY_NAME EXAMPLE_NAME OUTPUT_VAR)
+#
+#      LIBRARY_NAME - Library name
+#      EXAMPLE_NAME - Example name
+#      OUTPUT_VAR   - Variable name to save sketch path.
+#
+# Creates a Arduino example from a the specified library.
 #=============================================================================#
 function(SETUP_ARDUINO_EXAMPLE LIBRARY_NAME EXAMPLE_NAME OUTPUT_VAR)
     set(EXAMPLE_SKETCH_PATH )
@@ -1429,6 +1436,7 @@
 #        SRC_VAR - variable holding sources
 #        OUT_VAR - variable holding sources with no comments
 #
+# Removes all comments from the source code.
 #=============================================================================#
 function(REMOVE_COMMENTS SRC_VAR OUT_VAR)
     string(REGEX REPLACE "[\\./\\\\]" "_" FILE "${NAME}")
@@ -1451,21 +1459,34 @@

 #=============================================================================#
 # [PRIVATE/INTERNAL]
-#=============================================================================#
-function(GET_NUM_LINES VAR NUM_LINES)
-    string(REGEX MATCHALL "[\n]" MATCH_LIST "${VAR}")
+#
+# get_num_lines(DOCUMENT OUTPUT_VAR)
+#
+#        DOCUMENT   - Document contents
+#        OUTPUT_VAR - Variable which will hold the line number count
+#
+# Counts the line number of the document.
+#=============================================================================#
+function(GET_NUM_LINES DOCUMENT OUTPUT_VAR)
+    string(REGEX MATCHALL "[\n]" MATCH_LIST "${DOCUMENT}")
     list(LENGTH MATCH_LIST NUM)
-    set(${NUM_LINES} ${NUM} PARENT_SCOPE)
-endfunction()
-
-#=============================================================================#
-# [PRIVATE/INTERNAL]
+    set(${OUTPUT_VAR} ${NUM} PARENT_SCOPE)
+endfunction()
+
+#=============================================================================#
+# [PRIVATE/INTERNAL]
+#
+# required_variables(MSG msg VARS var1 var2 .. varN)
+#
+#        MSG  - Message to be displayed in case of error
+#        VARS - List of variables names to check
+#
+# Ensure the specified variables are not empty, otherwise a fatal error is emmited.
 #=============================================================================#
 function(REQUIRED_VARIABLES)
     cmake_parse_arguments(INPUT "" "MSG" "VARS" ${ARGN})
     error_for_unparsed(INPUT)
     foreach(VAR ${INPUT_VARS})
-        #message(STATUS "processing: ${VAR}")
         if ("${${VAR}}" STREQUAL "")
             message(FATAL_ERROR "${VAR} not set: ${INPUT_MSG}")
         endif()
@@ -1473,7 +1494,13 @@
 endfunction()

 #=============================================================================#
-# error_for_unparsed()
+# [PRIVATE/INTERNAL]
+#
+# error_for_unparsed(PREFIX)
+#
+#        PREFIX - Prefix name
+#
+# Emit fatal error if there are unparsed argument from cmake_parse_arguments().
 #=============================================================================#
 function(ERROR_FOR_UNPARSED PREFIX)
     set(ARGS "${${PREFIX}_UNPARSED_ARGUMENTS}")
@@ -1481,6 +1508,11 @@
         message(FATAL_ERROR "unparsed argument: ${ARGS}")
     endif()
 endfunction()
+
+
+
+
+

 #=============================================================================#
 #                              C Flags


Fixed global upload target, got removed during refactoring

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -320,7 +320,6 @@
         setup_arduino_upload(${INPUT_BOARD} ${INPUT_NAME} ${INPUT_PORT} "${INPUT_PROGRAMMER}" "${INPUT_AFLAGS}")
     endif()

-    message("INPUT_SERIAL for ${INPUT_NAME}: ${INPUT_SERIAL}")
     if(INPUT_SERIAL)
         setup_serial_target(${INPUT_NAME} "${INPUT_SERIAL}")
     endif()
@@ -813,6 +812,13 @@
                      ${ARDUINO_AVRDUDE_PROGRAM}
                      ${AVRDUDE_ARGS}
                      DEPENDS ${TARGET_NAME})
+
+    # Global upload target
+    if(NOT TARGET upload)
+        add_custom_target(upload)
+    endif()
+
+    add_dependencies(upload ${UPLOAD_TARGET})
 endfunction()

 #=============================================================================#


OSX: make cmake/unix-makefiles  generating and compile reliable again

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -96,25 +96,40 @@
 		ENDIF(CMAKE_VERSION VERSION_LESS 2.8.1)
 	ENDIF(COMMAND cmake_policy)

+	########## OS and hardware detection ###########
+
+	if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode") # unix makefile generator does not fill XCODE_VERSION var !
+		execute_process(COMMAND xcodebuild -version OUTPUT_VARIABLE XCODE_VERS_BUILDNR )
+		STRING(SUBSTRING ${XCODE_VERS_BUILDNR} 6 3 XCODE_VERSION) # truncate away build-nr
+	endif()
+
 	set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
 	if(CMAKE_VERSION VERSION_LESS 2.8.1)
 		SET(CMAKE_OSX_ARCHITECTURES i386;x86_64)
 	else(CMAKE_VERSION VERSION_LESS 2.8.1)
 		SET(CMAKE_XCODE_ATTRIBUTE_ARCHS i386\ x86_64)
 	endif(CMAKE_VERSION VERSION_LESS 2.8.1)
-#	SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "assure config" FORCE) # moved to main cmakelist atm
 	if(${XCODE_VERSION} LESS 4.3)
 		SET(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
 	else()
 		SET(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk)
 	endif()
 #	INCLUDE_DIRECTORIES( ${OSX_DEPENDENCY_ROOT}/include )
+
+	### options
 	option(OSX_BUILD_LUXMARK "Compile LuxMark too" FALSE)
 	option(OSX_UPDATE_LUXRAYS_REPO "Copy LibLuxRays over to macos repo after compile" FALSE)
+
 	set(LUXRAYS_NO_DEFAULT_CONFIG true)
 	set(LUXRAYS_CUSTOM_CONFIG Config_OSX)

-	#OSX-flags by jensverwiebe
+	if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode") # will be set later in XCode
+#		SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "assure config" FORCE)
+		# Setup binaries output directory in Xcode manner
+		SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE} CACHE PATH "per configuration" FORCE)
+		SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE} CACHE PATH "per configuration" FORCE)
+	endif()
+	#### OSX-flags by jensverwiebe
 	set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Wall -fPIC -O3 -ftree-vectorize -msse -msse2 -msse3 -mssse3 -fvariable-expansion-in-unroller")

 	# Do not set "-cl-fast-relaxed-math -cl-mad-enable" as they change the precision and behaviour of floating point math!
@@ -130,7 +145,11 @@
 	ENDIF(CMAKE_VERSION VERSION_LESS 2.8.1)
 	MESSAGE(STATUS "OSX SDK SETTING : " ${CMAKE_OSX_SYSROOT})
 	MESSAGE(STATUS "XCODE_VERSION : " ${XCODE_VERSION})
-	MESSAGE(STATUS "BUILD_TYPE : " ${CMAKE_BUILD_TYPE})
+	if(${CMAKE_GENERATOR} MATCHES "Xcode")
+		MESSAGE(STATUS "BUILD_TYPE : Please set in Xcode ALL_BUILD target to aimed type")
+	else()
+		MESSAGE(STATUS "BUILD_TYPE : " ${CMAKE_BUILD_TYPE} " - compile with: make " )
+	endif()
 	MESSAGE(STATUS "UPDATE_LUXRAYS_IN_MACOS_REPO : " ${OSX_UPDATE_LUXRAYS_REPO})
 	MESSAGE(STATUS "BUILD_LUXMARK_OSX : " ${OSX_BUILD_LUXMARK})
 	MESSAGE(STATUS "")


cmake: Escape backslash characters

cmake: Escape backslash characters

--- cmake/VisibilityDetect.cmake
+++ cmake/VisibilityDetect.cmake
@@ -1,9 +1,9 @@
 function (plibsys_detect_visibility cflags ldflags)
         # Check GCC
         check_c_source_compiles ("int main () {
-                                        #if (__GNUC__ >= 4) && \
-                                            !defined(__sun)  && !defined(sun)  && \
-                                            !defined(__hpux) && !defined(hpux) && \
+                                        #if (__GNUC__ >= 4) && \\
+                                            !defined(__sun)  && !defined(sun)  && \\
+                                            !defined(__hpux) && !defined(hpux) && \\
                                             !defined(_AIX) && !defined(__CYGWIN__) && !defined(__MSYS__)
                                         return 0;
                                         #else
@@ -21,7 +21,7 @@

         # Check Sun Studio
         check_c_source_compiles ("int main () {
-                                        #if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) || \
+                                        #if (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) || \\
                                             (defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5110))
                                         return 0;
                                         #else
@@ -56,7 +56,7 @@

         # Check HP C/aC++
         check_c_source_compiles ("int main () {
-                                        #if (defined(__HP_cc)  && (__HP_cc >= 0x061500)) || \
+                                        #if (defined(__HP_cc)  && (__HP_cc >= 0x061500)) || \\
                                             (defined(__HP_aCC) && (__HP_aCC >= 0x061500))
                                         return 0;
                                         #else


[cmake] removed rpath direct modification via linker options (should be done via CMAKE_INSTALL_RPATH in actual projects)

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -109,21 +109,6 @@
 		set (CONFIGURATION     "${CMAKE_BUILD_TYPE}")
 		set (CONFIGURATION_MCG)
 		set (CONFIGURATION_SCG "${CMAKE_BUILD_TYPE}")
-
-		# TODO: remove this and apply directly where needed
-
-		if (UNIX)
-			if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
-				set (CMAKE_SKIP_RPATH TRUE)
-
-				if (APPLE)
-					set (
-						CMAKE_EXE_LINKER_FLAGS
-						"${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,'@loader_path/../Frameworks'"
-						)
-				endif ()
-			endif ()
-		endif ()
 	endif ()

 	# for backward compatibility (in paths.cmake, settings.cmake, etc)


make check-format output bit nicer

make check-format output bit nicer

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -25,9 +25,13 @@
         ${CLANG_FORMAT}
         -style=file
         -output-replacements-xml
-        ${CHECK_CXX_SOURCE_FILES} | tee ${CMAKE_BINARY_DIR}/check_format_file.txt
+        ${CHECK_CXX_SOURCE_FILES}
+        # print output
+        | tee ${CMAKE_BINARY_DIR}/check_format_file.txt | grep -c "replacement " |
+                tr -d "[:cntrl:]" && echo " replacements necessary"
         # WARNING: fix to stop with error if there are problems
-        COMMAND ! grep -c "replacement " ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null
+        COMMAND ! grep -c "replacement "
+                  ${CMAKE_BINARY_DIR}/check_format_file.txt > /dev/null
         COMMENT "Checking format compliance"
     )
 ENDIF()
@@ -72,7 +76,7 @@
             ${RUN_CLANG_TIDY} -header-filter=${CMAKE_SOURCE_DIR} -j${NPROC}
             | tee ${CMAKE_BINARY_DIR}/check_lint_file.txt
             # WARNING: fix to stop with error if there are problems
-            COMMAND ! grep -c ": error: " ${CMAKE_BINARY_DIR}/check_lint_file.txt > /dev/null
+            COMMAND ! grep -c ": error: " ${CMAKE_BINARY_DIR}/check_lint_file.txt > dev/null
             COMMENT "Checking for problems in source files"
         )
     ENDIF()


Update OpenSSL to 1.0.2k.

Update OpenSSL to 1.0.2k.

--- cmake/external/OpenSSL.cmake
+++ cmake/external/OpenSSL.cmake
@@ -1,7 +1,7 @@
 include(ExternalProject)

-set(OpenSSL_URL https://www.openssl.org/source/openssl-1.0.2j.tar.gz)
-set(OpenSSL_SHA256 e7aff292be21c259c6af26469c7a9b3ba26e9abaaffd325e3dccc9785256c431)
+set(OpenSSL_URL https://www.openssl.org/source/openssl-1.0.2k.tar.gz)
+set(OpenSSL_SHA256 6b3977c61f2aedf0f96367dcfb5c6e578cf37e7b8d913b4ecb6643c3cb88d8c0)
 set(OpenSSL_PREFIX ${CMAKE_INSTALL_PREFIX}/externals)

 if(CMAKE_SIZEOF_VOID_P EQUAL 8)


Update FindMPI to cmake/master

Update FindMPI to cmake/master

--- cmake/upstream/FindMPI.cmake
+++ cmake/upstream/FindMPI.cmake
@@ -480,38 +480,38 @@
   # Extract include paths from compile command line
   string(REGEX MATCHALL "(^| )[-/]I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")

+  # If extracting failed to work, we'll try using -showme:incdirs.
+  if (NOT MPI_ALL_INCLUDE_PATHS)
+    _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN)
+    if(MPI_INCDIRS_COMPILER_RETURN)
+      separate_arguments(MPI_INCLUDE_DIRS_WORK ${_MPI_COMMAND_TYPE} "${MPI_INCDIRS_CMDLINE}")
+    endif()
+  endif()
+
   foreach(_MPI_INCLUDE_PATH IN LISTS MPI_ALL_INCLUDE_PATHS)
     string(REGEX REPLACE "^ ?[-/]I" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}")
-    string(REPLACE "//" "/" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}")
+    string(REPLACE "\"" "" _MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}")
     get_filename_component(_MPI_INCLUDE_PATH "${_MPI_INCLUDE_PATH}" REALPATH)
     list(APPEND MPI_INCLUDE_DIRS_WORK "${_MPI_INCLUDE_PATH}")
   endforeach()

-  # If extracting failed to work, we'll try using -showme:incdirs.
-  if (NOT MPI_INCLUDE_DIRS_WORK)
-    _MPI_check_compiler(${LANG} "-showme:incdirs" MPI_INCDIRS_CMDLINE MPI_INCDIRS_COMPILER_RETURN)
-    if(MPI_INCDIRS_COMPILER_RETURN)
-      separate_arguments(MPI_INCLUDE_DIRS_WORK ${_MPI_COMMAND_TYPE} "${MPI_INCDIRS_CMDLINE}")
-    endif()
-  endif()
-
   # Extract linker paths from the link command line
   string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker |)(-L|[/-]LIBPATH:|[/-]libpath:)([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_PATHS "${MPI_LINK_CMDLINE}")

+  # If extracting failed to work, we'll try using -showme:libdirs.
+  if (NOT MPI_ALL_LINK_PATHS)
+    _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN)
+    if(MPI_LIBDIRS_COMPILER_RETURN)
+      separate_arguments(MPI_LINK_DIRECTORIES_WORK ${_MPI_COMMAND_TYPE} "${MPI_LIBDIRS_CMDLINE}")
+    endif()
+  endif()
+
   foreach(_MPI_LPATH IN LISTS MPI_ALL_LINK_PATHS)
     string(REGEX REPLACE "^ ?(-Wl,|-Xlinker )?(-L|[/-]LIBPATH:|[/-]libpath:)" "" _MPI_LPATH "${_MPI_LPATH}")
-    string(REPLACE "//" "/" _MPI_LPATH "${_MPI_LPATH}")
+    string(REPLACE "\"" "" _MPI_LPATH "${_MPI_LPATH}")
     get_filename_component(_MPI_LPATH "${_MPI_LPATH}" REALPATH)
     list(APPEND MPI_LINK_DIRECTORIES_WORK "${_MPI_LPATH}")
   endforeach()
-
-  # If extracting failed to work, we'll try using -showme:libdirs.
-  if (NOT MPI_LINK_DIRECTORIES_WORK)
-    _MPI_check_compiler(${LANG} "-showme:libdirs" MPI_LIBDIRS_CMDLINE MPI_LIBDIRS_COMPILER_RETURN)
-    if(MPI_LIBDIRS_COMPILER_RETURN)
-      separate_arguments(MPI_LINK_DIRECTORIES_WORK ${_MPI_COMMAND_TYPE} "${MPI_LIBDIRS_CMDLINE}")
-    endif()
-  endif()

   # Extract linker flags from the link command line
   string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
@@ -614,7 +614,7 @@
   # link it in that case. -lpthread is covered by the normal library treatment on the other hand.
   if("${MPI_COMPILE_CMDLINE}" MATCHES "-pthread")
     list(APPEND MPI_COMPILE_OPTIONS_WORK "-pthread")
-    if(MPI_COMPILE_OPTIONS_WORK)
+    if(MPI_LINK_FLAGS_WORK)
       string(APPEND MPI_LINK_FLAGS_WORK " -pthread")
     else()
       set(MPI_LINK_FLAGS_WORK "-pthread")


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -75,8 +75,11 @@
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libc++")
      elseif (NOT WIN32)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
-     else()
+     else()
+         # this implies clang on windows
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -Wno-unused-result /MD")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXFLAGS} -fexceptions")
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS}")
      endif ()
      set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
@@ -135,10 +138,6 @@
      # solution: https://stackoverflow.com/questions/1091662/vc-internal-compiler-error
      #     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /Ox /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /FC /Ox -D_SCL_SECURE_NO_WARNINGS")
-     if(CMAKE_COMPILER_ID MATCHES "Clang")
-          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXFLAGS} -fexceptions")
-          set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS}")
-     endif()
      if (TUDAT_FORCE_DYNAMIC_RUNTIME)
          # This is needed for conda builds, as the prebuilt libraries are MD.
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")


Switch TARGET_FLAGS to ARM_FLAGS.

Switch TARGET_FLAGS to ARM_FLAGS.


CMake: IWYU: iwyu_tool: also pass check_also

--- cmake/iwyu.cmake
+++ cmake/iwyu.cmake
@@ -12,7 +12,7 @@
   add_custom_command(
     OUTPUT "${CMAKE_BINARY_DIR}/iwyu.log"
     COMMAND "${iwyu_tool_path}" -v -p "${CMAKE_BINARY_DIR}"
-            -- --mapping_file=${IWYU_IMP} 2>
+            -- --mapping_file=${IWYU_IMP} --check_also=${CMAKE_SOURCE_DIR}/src/* --check_also=${CMAKE_SOURCE_DIR}/src/*/* --check_also=${CMAKE_SOURCE_DIR}/src/*/*/* --check_also=${CMAKE_SOURCE_DIR}/src/*/*/*/* 2>
             "${CMAKE_BINARY_DIR}/iwyu.log"
     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
     COMMENT "Running include-what-you-use tool"


cmake(java): Rework and Fix BYPRODUCTS

cmake(java): Rework and Fix BYPRODUCTS

--- cmake/java.cmake
+++ cmake/java.cmake
@@ -124,25 +124,17 @@
 #################################
 ##  Java Native Maven Package  ##
 #################################
+set(JAVA_NATIVE_PROJECT_PATH ${PROJECT_BINARY_DIR}/java/${JAVA_NATIVE_PROJECT})
+file(MAKE_DIRECTORY ${JAVA_NATIVE_PROJECT_PATH}/${JAVA_RESOURCES_PATH}/${NATIVE_IDENTIFIER})
+
 configure_file(
   ${PROJECT_SOURCE_DIR}/ortools/java/pom-native.xml.in
-  ${PROJECT_BINARY_DIR}/java/pom-native.xml.in
+  ${JAVA_NATIVE_PROJECT_PATH}/pom.xml
   @ONLY)
-
-add_custom_command(
-  OUTPUT java/${JAVA_NATIVE_PROJECT}/pom.xml
-  DEPENDS ${PROJECT_BINARY_DIR}/java/pom-native.xml.in
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${JAVA_NATIVE_PROJECT}
-  COMMAND ${CMAKE_COMMAND} -E copy ./pom-native.xml.in ${JAVA_NATIVE_PROJECT}/pom.xml
-  BYPRODUCTS
-  java/${JAVA_NATIVE_PROJECT}
-  WORKING_DIRECTORY java)

 add_custom_target(java_native_package
   DEPENDS
-  java/${JAVA_NATIVE_PROJECT}/pom.xml
-  COMMAND ${CMAKE_COMMAND} -E remove_directory src
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${JAVA_RESOURCES_PATH}/${NATIVE_IDENTIFIER}
+  ${JAVA_NATIVE_PROJECT_PATH}/pom.xml
   COMMAND ${CMAKE_COMMAND} -E copy
     $<TARGET_FILE:jniortools>
     $<$<NOT:$<PLATFORM_ID:Windows>>:$<TARGET_SONAME_FILE:${PROJECT_NAME}>>
@@ -150,34 +142,35 @@
   COMMAND ${MAVEN_EXECUTABLE} compile
   COMMAND ${MAVEN_EXECUTABLE} package
   COMMAND ${MAVEN_EXECUTABLE} install
-  WORKING_DIRECTORY java/${JAVA_NATIVE_PROJECT})
+  BYPRODUCTS
+    ${JAVA_NATIVE_PROJECT_PATH}/target
+  WORKING_DIRECTORY ${JAVA_NATIVE_PROJECT_PATH})

 ##########################
 ##  Java Maven Package  ##
 ##########################
+set(JAVA_PROJECT_PATH ${PROJECT_BINARY_DIR}/java/${JAVA_PROJECT})
+file(MAKE_DIRECTORY ${JAVA_PROJECT_PATH}/${JAVA_PACKAGE_PATH})
+
+file(COPY ${PROJECT_SOURCE_DIR}/ortools/java/com
+  DESTINATION ${JAVA_PROJECT_PATH}/src/main/java)
+file(COPY ${PROJECT_SOURCE_DIR}/ortools/java/Loader.java
+  DESTINATION ${JAVA_PROJECT_PATH}/${JAVA_PACKAGE_PATH})
+
 configure_file(
   ${PROJECT_SOURCE_DIR}/ortools/java/pom-local.xml.in
-  ${PROJECT_BINARY_DIR}/java/pom-local.xml.in
+  ${JAVA_PROJECT_PATH}/pom.xml
   @ONLY)
-
-add_custom_command(
-  OUTPUT java/${JAVA_PROJECT}/pom.xml
-  DEPENDS ${PROJECT_BINARY_DIR}/java/pom-local.xml.in
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${JAVA_PROJECT}
-  COMMAND ${CMAKE_COMMAND} -E copy ./pom-local.xml.in ${JAVA_PROJECT}/pom.xml
-  BYPRODUCTS
-  java/${JAVA_PROJECT}
-  WORKING_DIRECTORY java)

 add_custom_target(java_package ALL
   DEPENDS
-  java/${JAVA_PROJECT}/pom.xml
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/ortools/java/com src/main/java/com
-  COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/ortools/java/Loader.java ${JAVA_PACKAGE_PATH}/
+  ${JAVA_PROJECT_PATH}/pom.xml
   COMMAND ${MAVEN_EXECUTABLE} compile
   COMMAND ${MAVEN_EXECUTABLE} package
   COMMAND ${MAVEN_EXECUTABLE} install
-  WORKING_DIRECTORY java/${JAVA_PROJECT})
+  BYPRODUCTS
+    ${JAVA_PROJECT_PATH}/target
+  WORKING_DIRECTORY ${JAVA_PROJECT_PATH})
 add_dependencies(java_package java_native_package Java${PROJECT_NAME}_proto)

 #################
@@ -199,6 +192,8 @@
   add_custom_target(java_test_Test ALL
     DEPENDS ${TEST_PATH}/pom.xml
     COMMAND ${MAVEN_EXECUTABLE} compile
+    BYPRODUCTS
+      ${TEST_PATH}/target
     WORKING_DIRECTORY ${TEST_PATH})
   add_dependencies(java_test_Test java_package)

@@ -238,6 +233,8 @@
   add_custom_target(java_sample_${SAMPLE_NAME} ALL
     DEPENDS ${SAMPLE_PATH}/pom.xml
     COMMAND ${MAVEN_EXECUTABLE} compile
+    BYPRODUCTS
+      ${SAMPLE_PATH}/target
     WORKING_DIRECTORY ${SAMPLE_PATH})
   add_dependencies(java_sample_${SAMPLE_NAME} java_package)

@@ -279,6 +276,8 @@
   add_custom_target(java_example_${EXAMPLE_NAME} ALL
     DEPENDS ${EXAMPLE_PATH}/pom.xml
     COMMAND ${MAVEN_EXECUTABLE} compile
+    BYPRODUCTS
+      ${EXAMPLE_PATH}/target
     WORKING_DIRECTORY ${EXAMPLE_PATH})
   add_dependencies(java_example_${EXAMPLE_NAME} java_package)

@@ -318,6 +317,8 @@
   add_custom_target(java_test_${TEST_NAME} ALL
     DEPENDS ${TEST_PATH}/pom.xml
     COMMAND ${MAVEN_EXECUTABLE} compile
+    BYPRODUCTS
+      ${TEST_PATH}/target
     WORKING_DIRECTORY ${TEST_PATH})
   add_dependencies(java_test_${TEST_NAME} java_package)