Fix missing debug symbols on iOS and OSX

--- build.cmake
+++ build.cmake
@@ -5,6 +5,8 @@
 		set_target_properties(${library} PROPERTIES
 			XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++0x"
 			XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"
+			XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
+			XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO
 			)

 		if (PIXELBOOST_BUILD_PLATFORM_OSX)
@@ -157,7 +159,6 @@
 			MACOSX_BUNDLE TRUE
 			RESOURCE "${RESOURCES}"
 			XCODE_ATTRIBUTE_COMBINE_HIDPI_IMAGES YES
-			XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
 			XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS YES
 			XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
 			XCODE_ATTRIBUTE_SKIP_INSTALL "No"
@@ -172,13 +173,10 @@
 			RESOURCE "${RESOURCES}"
 			XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS YES
 			XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer"
-			XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
 			XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET 5.0
 			XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2" # Universal app
 			XCODE_ATTRIBUTE_INSTALL_PATH "$(LOCAL_APPS_DIR)"
 			XCODE_ATTRIBUTE_SKIP_INSTALL "No"
-			XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++0x"
-			XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++"
 		)
 	endif (PIXELBOOST_BUILD_PLATFORM_IOS)
 endmacro()


support debug or release with CMAKE_BUILD_TYPE

--- backends/cmake/project.cmake
+++ backends/cmake/project.cmake
@@ -4,10 +4,17 @@
 include(arm-none-eabi-gcc)

 #common compile flags
-set(COMMON_COMPILE_FLAGS "-O0 -g -Werror -Wno-error=cpp -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
+if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+	set(COMMON_COMPILE_FLAGS "-O0 -g -Werror -Wno-error=cpp -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
+else()
+	set(COMMON_COMPILE_FLAGS "-O3 -Werror -Wno-error=cpp -Wextra -Warray-bounds -ffunction-sections -fdata-sections -fno-toplevel-reorder")
+	add_definitions(-DNDEBUG)
+endif()
 #set(COMMON_COMPILE_FLAGS "-Os -Werror -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
 #-u _printf_float
 set(COMMON_LINK_FLAGS "-Wl,--gc-sections --specs=nano.specs -u _printf_float")
+
+

 #load all mcus
 include(mcus)
@@ -162,6 +169,8 @@
 	target_compile_definitions(${project_name} PUBLIC ${MCU_TEMPLATE})

 	add_custom_command (TARGET ${project_name} POST_BUILD COMMAND arm-none-eabi-size $<TARGET_FILE:${project_name}>)
+	add_custom_command (TARGET ${project_name} POST_BUILD COMMAND arm-none-eabi-objcopy $<TARGET_FILE:${project_name}> -O binary $<TARGET_FILE_DIR:${project_name}>/$<TARGET_FILE_NAME:${project_name}>.bin)
+	add_custom_command (TARGET ${project_name} POST_BUILD COMMAND arm-none-eabi-strip $<TARGET_FILE:${project_name}>)

 endfunction(build_project)


CMakeUnitRunner: Quote CACHE_LINES_FILE

CMakeUnitRunner: Quote CACHE_LINES_FILE

--- CMakeUnitRunner.cmake
+++ CMakeUnitRunner.cmake
@@ -448,7 +448,7 @@
          "include (\"${_RUNNER_LIST_FILE}\")\n"
          "_cmake_unit_invoke_command (COMMAND \"${CMAKE_COMMAND}\"\n"
          "                                    ${POLICY_CACHE_DEFS_SPACIFIED}\n"
-         "                                    -C${CACHE_LINES_FILE}\n"
+         "                                    \"-C${CACHE_LINES_FILE}\"\n"
          "                                    -P \"${DRIVER_SCRIPT}\"\n"
          "                                    ${TRACE_OPTION}\n"
          "                            OUTPUT_FILE \"${DRIVER_OUTPUT_LOG}\"\n"


Handle the case where both OUTPUT and ERROR are empty.

--- CMakeUnitRunner.cmake
+++ CMakeUnitRunner.cmake
@@ -78,7 +78,7 @@
          "                     OUTPUT_VARIABLE OUTPUT\n"
          "                     ERROR_VARIABLE ERROR)\n"
          "    if (RESULT EQUAL 0)\n"
-         "        message (\${OUTPUT} ${ERROR})\n"
+         "        message (\"Success: \${OUTPUT} \${ERROR}\")\n"
          "    else (RESULT EQUAL 0)\n"
          "        message (FATAL_ERROR \n"
          "                 \"The command \${\${COMMAND_VAR}}} failed with \"\n"
@@ -214,4 +214,4 @@
                          ${VERIFY})
     _define_test_for_driver (${TEST_NAME} ${TEST_DRIVER_SCRIPT})

-endfunction (add_cmake_build_test)+endfunction (add_cmake_build_test)


Revert "Add and fix some comments in ConfigureChecks.cmake."

This reverts commit fa6f33e552aa1d11a88f6432a54a34aa1d2dfa97.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -164,7 +164,7 @@
   endif()
 endif()

-# Check if your compiler supports some safer version of vsprintf.
+# Determine whether your compiler supports some safer version of vsprintf.

 check_cxx_source_compiles("
   #include <cstdio>
@@ -190,14 +190,16 @@
   " HAVE_VSPRINTF_S)
 endif()

-# Check if zlib is installed.
+# Check for libz using the cmake supplied FindZLIB.cmake

 if(NOT ZLIB_SOURCE)
   find_package(ZLIB)
-  set(HAVE_ZLIB ZLIB_FOUND)
-endif()
-
-# Check if CppUnit is installed.
+  if(ZLIB_FOUND)
+    set(HAVE_ZLIB 1)
+  else()
+    set(HAVE_ZLIB 0)
+  endif()
+endif()

 if(BUILD_TESTS)
   find_package(CppUnit)


Revert "Reorder CMake checks for sprintf() variants."

This reverts commit c69364d83115950b24e6baa6b9841a244d149d91.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -211,20 +211,20 @@
   #include <cstdio>
   int main() {
     char buf[20];
-    sprintf_s(buf, \"%d\", 1);
-    return 0;
-  }
-" HAVE_SPRINTF_S)
-
-if(NOT HAVE_SPRINTF_S)
+    snprintf(buf, 20, \"%d\", 1);
+    return 0;
+  }
+" HAVE_SNPRINTF)
+
+if(NOT HAVE_SNPRINTF)
   check_cxx_source_compiles("
     #include <cstdio>
     int main() {
       char buf[20];
-      snprintf(buf, 20, \"%d\", 1);
+      sprintf_s(buf, \"%d\", 1);
       return 0;
     }
-  " HAVE_SNPRINTF)
+  " HAVE_SPRINTF_S)
 endif()

 # Check for libz using the cmake supplied FindZLIB.cmake


fixed: set iterator_debug according to ms_secure for external projects

--- CMake/ExternalProjectHelper.cmake
+++ CMake/ExternalProjectHelper.cmake
@@ -26,6 +26,12 @@
   ELSE()
     SET(OSG_PLATFORM_32 1)
   ENDIF()
+
+  IF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
+    OPTION(OSG_DISABLE_MS_ITERATOR_DEBUGGING "" ON)
+  ELSE(OSG_DISABLE_MICROSOFT_SECURE_CXXX)
+    OPTION(OSG_DISABLE_MS_ITERATOR_DEBUGGING "" OFF)
+  ENDIF(OSG_DISABLE_MICROSOFT_SECURE_CXXX)

   #############
   #### OpenSG


Put PYTHON_INCLUDE_DIRS in the cache

Put PYTHON_INCLUDE_DIRS in the cache

This should fix builds that fail because they
can't find Python.h.


adds include path for boost library in libdvid config

--- libdvidcpp.cmake
+++ libdvidcpp.cmake
@@ -44,6 +44,7 @@
         -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
         -DCMAKE_EXE_LINKER_FLAGS=${BUILDEM_LDFLAGS}
         -DDEPENDENCY_SEARCH_PREFIX=${BUILDEM_DIR}
+        -DBoost_INCLUDE_DIR=${BUILDEM_DIR}/include
         -DCMAKE_CXX_FLAGS_RELEASE=-O3
         -DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}"
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)


MySQL:  fix MySQL 5.6 find mistake (#1268)

--- src/cmake/macros/FindMySQL.cmake
+++ src/cmake/macros/FindMySQL.cmake
@@ -117,6 +117,7 @@
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib/opt"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib"
+      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.6;Location]/lib/opt"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.7;Location]/lib"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.7;Location]/lib/opt"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.6;Location]/lib"


Fixed bug in cmake build template

Fixed bug in cmake build template

--- products/pgen/pgen_utils/.pgen_templates/build.cmake
+++ products/pgen/pgen_utils/.pgen_templates/build.cmake
@@ -1,14 +1,10 @@
-# This file contains compiler flags for different platforms
-if (WIN32)
-    if (MSVC)

-    else()
-        set(CMAKE_CXX_FLAGS_RELEASE "-g -Wl,--no-as-needed -std=c++11 -D_GLIBCXX_USE_CXX11_ABI=0")
-        set(CMAKE_CXX_FLAGS_DEBUG "-g -Wl,--no-as-needed -std=c++11  -D_GLIBCXX_USE_CXX11_ABI=0")
-    endif()
-
+if(CMAKE_BUILD_TYPE MATCHES Debug)
+        set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/debug")
+        set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/debug")
+        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/debug")
 else()
-    set(CMAKE_CXX_FLAGS_RELEASE "-g -Wl,--no-as-needed -std=c++11 -pthread -fPIC -ldl -D_GLIBCXX_USE_CXX11_ABI=0")
-    set(CMAKE_CXX_FLAGS_DEBUG "-g -Wl,--no-as-needed -std=c++11 -pthread -fPIC -ldl -D_GLIBCXX_USE_CXX11_ABI=0")
+        set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/release")
+        set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/release")
+        set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_ROOT}/bin/SourceGen/release")
 endif()
-


Fixed InstallDependencies in 1.8.1 for boost 1.50+

--HG--
branch : v1-8

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -180,7 +180,6 @@
       PATTERN "asio" EXCLUDE
       PATTERN "assign" EXCLUDE
       PATTERN "bimap" EXCLUDE
-      PATTERN "chrono" EXCLUDE
       PATTERN "circular_buffer" EXCLUDE
       PATTERN "compatibility" EXCLUDE
       PATTERN "concept_check" EXCLUDE
@@ -189,7 +188,6 @@
       PATTERN "filesystem" EXCLUDE
       PATTERN "flyweight" EXCLUDE
       PATTERN "format" EXCLUDE
-      PATTERN "functional" EXCLUDE
       PATTERN "fusion" EXCLUDE
       PATTERN "geometry" EXCLUDE
       PATTERN "gil" EXCLUDE
@@ -214,18 +212,15 @@
       PATTERN "ptr_container" EXCLUDE
       PATTERN "python" EXCLUDE
       PATTERN "random" EXCLUDE
-      PATTERN "ratio" EXCLUDE
       PATTERN "regex" EXCLUDE
       PATTERN "serialization" EXCLUDE
       PATTERN "signals" EXCLUDE
       PATTERN "signals2" EXCLUDE
       PATTERN "spirit" EXCLUDE
       PATTERN "statechart" EXCLUDE
-      PATTERN "system" EXCLUDE
       PATTERN "test" EXCLUDE
       PATTERN "timer" EXCLUDE
       PATTERN "tr1" EXCLUDE
-      PATTERN "typeof" EXCLUDE
       PATTERN "units" EXCLUDE
       PATTERN "unordered" EXCLUDE
       PATTERN "uuid" EXCLUDE


Apparently the tuple directory is needed to by some of the boost threading headers.  Don't exclude it when installing dependencies.

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401849

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -180,7 +180,6 @@
 		PATTERN "system" EXCLUDE
 		PATTERN "test" EXCLUDE
 		PATTERN "tr1" EXCLUDE
-		PATTERN "tuple" EXCLUDE
 		PATTERN "typeof" EXCLUDE
 		PATTERN "units" EXCLUDE
 		PATTERN "unordered" EXCLUDE


specify dependency of cfggen (configs) on codegen (messages/srvs)

--HG--
extra : convert_revision : svn%3Aeb33c2ac-9c88-4c90-87e0-44a10359b0c3/stacks/driver_common/trunk%4037131

--- dynamic_reconfigure/cmake/rosbuild2.cmake
+++ dynamic_reconfigure/cmake/rosbuild2.cmake
@@ -64,6 +64,13 @@
   add_dependencies(${PROJECT_NAME}_codegen
     ${PROJECT_NAME}_cfggen)

+  foreach(_dep ${${PROJECT_NAME}_RECURSIVE_DEPENDS})
+    add_dependencies(${PROJECT_NAME}_cfggen
+      ${_dep}_codegen)
+  endforeach()
+
+
+
   #add_custom_target(rospack_gencfg_real ALL)
   #add_dependencies(rospack_gencfg_real rospack_gencfg)
   #include_directories(${PROJECT_SOURCE_DIR}/cfg/cpp)


guard mkl example with USE_SVMLIGHT

guard mkl example with USE_SVMLIGHT

--- cmake/FindMetaExamples.cmake
+++ cmake/FindMetaExamples.cmake
@@ -47,7 +47,9 @@

 	IF(NOT USE_SVMLIGHT)
 		LIST(APPEND EXCLUDED_META_EXAMPLES
-			regression/multiple_kernel_learning.sg)
+			regression/multiple_kernel_learning.sg
+			binary_classifier/multiple_kernel_learning.sg
+		)
 	ENDIF()

     SET(EXCLUDED_META_EXAMPLES ${EXCLUDED_META_EXAMPLES} PARENT_SCOPE)


Try to allow skipping existing FindTargetLAPACK (trouble with clang CI and psi4 gcc omp flags)

--- cmake/FindTargetLAPACK.cmake
+++ cmake/FindTargetLAPACK.cmake
@@ -14,6 +14,12 @@
 #   LAPACK_FOUND
 #   LAPACK_LIBRARIES
 #
+# In order of decreasing precedence, this module returns in a target ``tgt::lapack``
+#  (1) the libraries passed through CMake variable LAPACK_LIBRARIES,
+#  (2) the libraries defined in a detectable TargetLAPACKConfig.cmake file
+#      (skip via CMAKE_DISABLE_FIND_PACKAGE_TargetLAPACK), or
+#  (3) the libraries detected by the usual FindLAPACK.cmake module.
+#

 set(PN TargetLAPACK)

@@ -27,7 +33,9 @@
     set_property (TARGET tgt::lapack PROPERTY INTERFACE_LINK_LIBRARIES ${LAPACK_LIBRARIES})
 else()
     # 2nd precedence - target already prepared and findable in TargetLAPACKConfig.cmake
-    find_package (TargetLAPACK QUIET CONFIG)
+    if (NOT ${CMAKE_DISABLE_FIND_PACKAGE_${PN}})
+        find_package (TargetLAPACK QUIET CONFIG)
+    endif()
     if (TARGET tgt::lapack)
         if (NOT ${PN}_FIND_QUIETLY)
             message (STATUS "TargetLAPACKConfig detected.")
@@ -38,14 +46,14 @@
         if (NOT ${PN}_FIND_QUIETLY)
             message (STATUS "LAPACK detected.")
         endif()
-
+
         add_library (tgt::lapack INTERFACE IMPORTED)
         set_property (TARGET tgt::lapack PROPERTY INTERFACE_LINK_LIBRARIES ${LAPACK_LIBRARIES})

         unset (LAPACK_FOUND)
         unset (LAPACK_LIBRARIES)
     endif()
-endif()
+endif()

 get_property (_ill TARGET tgt::lapack PROPERTY INTERFACE_LINK_LIBRARIES)
 set (${PN}_MESSAGE "Found LAPACK: ${_ill}")


Support non-standard SuSE path of krb5-config

--- cmake/Modules/FindKrb5.cmake
+++ cmake/Modules/FindKrb5.cmake
@@ -25,7 +25,7 @@
     NO_DEFAULT_PATH
     )
 ENDIF(KRB5_PREFIX)
-FIND_PROGRAM(KRB5_C_CONFIG NAMES krb5-config)
+FIND_PROGRAM(KRB5_C_CONFIG NAMES krb5-config PATHS /usr/lib/mit/bin)

 MESSAGE(STATUS "found krb5-config here ${KRB5_C_CONFIG}")


FineNuke.cmake failed if LENGTH _nuke_ROOT_DIRS < 1

--- cmake/Modules/FindNuke.cmake
+++ cmake/Modules/FindNuke.cmake
@@ -16,7 +16,10 @@
     file(GLOB _nuke_ROOT_DIRS "/usr/local/Nuke*")
   endif()
   list(SORT _nuke_ROOT_DIRS)
-  list(GET _nuke_ROOT_DIRS 0 NUKE_ROOT)
+  list(LENGTH _nuke_ROOT_DIRS _nuke_ROOT_DIRS_LENGTH)
+  if(${_nuke_ROOT_DIRS_LENGTH} GREATER 1)
+    list(GET _nuke_ROOT_DIRS 0 NUKE_ROOT)
+  endif()
 endif()

 string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\v([0-9]+)" "\\0;\\1;\\2;\\3" _nuke_VERSION_LIST ${NUKE_ROOT})


"fix cuda9 error" (#10271)

"fix cuda9 error" (#10271)

* "fix cuda9 error"

* "change commit id"

* "remote git tag"

--- cmake/external/warpctc.cmake
+++ cmake/external/warpctc.cmake
@@ -38,8 +38,7 @@
 ExternalProject_Add(
     extern_warpctc
     ${EXTERNAL_PROJECT_LOG_ARGS}
-    GIT_REPOSITORY  "https://github.com/gangliao/warp-ctc.git"
-    GIT_TAG         b63a0644654a3e0ed624c85a1767bc8193aead09
+    GIT_REPOSITORY  "https://github.com/dzhwinter/warp-ctc.git"
     PREFIX          ${WARPCTC_SOURCES_DIR}
     UPDATE_COMMAND  ""
     CMAKE_ARGS      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}


[CMake] Updates based on post-merge feedback on PR4966

This update addresses feedback from gottesmm.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1199,8 +1199,6 @@

   if(NOT SWIFTLIB_TARGET_LIBRARY)
     set(SWIFTLIB_INSTALL_IN_COMPONENT dev)
-  elseif(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER AND NOT SWIFT_BUILT_STANDALONE)
-    list(APPEND SWIFTLIB_DEPENDS clang)
   endif()

   # If target SDKs are not specified, build for all known SDKs.
@@ -1258,6 +1256,10 @@
   endif()

   if(SWIFTLIB_TARGET_LIBRARY)
+    if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
+      list(APPEND SWIFTLIB_DEPENDS clang)
+    endif()
+
     # If we are building this library for targets, loop through the various
     # SDKs building the variants of this library.
     list_intersect(


[android] Link with static C++ ABI for Android.

Normally, the C++ shared library would have link against the C++ ABI
shared library, but the Android NDK does not distribute the later, so
one need to link manually against the static C++ ABI from the NDK.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -434,12 +434,14 @@
     # we need to add the math library, which is linked implicitly by libc++.
     list(APPEND result "-nostdlib++" "-lm")
     if("${LFLAGS_ARCH}" MATCHES armv7)
-      list(APPEND result "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so")
+      set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a")
     elseif("${LFLAGS_ARCH}" MATCHES aarch64)
-      list(APPEND result "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a/libc++_shared.so")
+      set(android_libcxx_path "${SWIFT_ANDROID_NDK_PATH}/sources/cxx-stl/llvm-libc++/libs/arm64-v8a")
     else()
       message(SEND_ERROR "unknown architecture (${LFLAGS_ARCH}) for android")
     endif()
+    list(APPEND link_libraries "${android_libcxx_path}/libc++abi.a")
+    list(APPEND link_libraries "${android_libcxx_path}/libc++_shared.so")
     swift_android_lib_for_arch(${LFLAGS_ARCH} ${LFLAGS_ARCH}_LIB)
     foreach(path IN LISTS ${LFLAGS_ARCH}_LIB)
       list(APPEND library_search_directories ${path})


build: spell parameter `-fuse-ld=` properly for Windows

We need to pass `-fuse-ld=` `gold.exe` on Windows when targeting
Android.  Given that we do not have a host toolchain for Linux on
Windows currently, do this unconditionally.  This is required for
cross-compiling from Windows to android.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -517,8 +517,12 @@
         NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WINDOWS"))
       list(APPEND result "-fuse-ld=lld")
     elseif(SWIFT_ENABLE_GOLD_LINKER AND
-       "${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
-      list(APPEND result "-fuse-ld=gold")
+        "${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
+      if(CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
+        list(APPEND result "-fuse-ld=gold.exe")
+      else()
+        list(APPEND result "-fuse-ld=gold")
+      endif()
     endif()
   endif()


Fix for building without VOLK

Fix for building without VOLK

--- cmake/modules/FindVolk.cmake
+++ cmake/modules/FindVolk.cmake
@@ -25,7 +25,7 @@
 )

 # Some functions are not defined in old volk versions
-SET(CMAKE_REQUIRED_LIBRARIES ${VOLK_LIBRARIES} m)
+SET(CMAKE_REQUIRED_LIBRARIES volk m)
 CHECK_FUNCTION_EXISTS_MATH(volk_32f_index_max_16u HAVE_VOLK_MAX_FUNCTION)
 CHECK_FUNCTION_EXISTS_MATH(volk_32f_accumulator_s32f HAVE_VOLK_ACC_FUNCTION)
 CHECK_FUNCTION_EXISTS_MATH(volk_32fc_s32fc_multiply_32fc HAVE_VOLK_MULT_FUNCTION)


Fixed #349

Fixed #349

--- cmake_modules/FindHDF5.cmake
+++ cmake_modules/FindHDF5.cmake
@@ -1,6 +1,24 @@
-FIND_PATH(HDF5_INCLUDE_DIR H5FDcore.h PATHS /usr/include /usr/local/include /opt/local/include)
-FIND_LIBRARY(HDF5 NAMES hdf5 PATHS /usr/lib /usr/local/lib /opt/local/lib)
-FIND_LIBRARY(HDF5_H1 NAMES hdf5_hl PATHS /usr/lib /usr/local/lib /opt/local/lib)
+# CMAKE module for locating HDF5.
+# Options: -DWITH_HDF5=<path to include root>
+# Example: -DWITH_HDF5=/usr/local
+
+MESSAGE(STATUS "WITH_HDF5=${WITH_HDF5}")
+
+SET(HDF5_ROOT ${WITH_HDF5})
+IF (HDF5_ROOT)
+    MESSAGE(STATUS "Looking for HDF5 in specified location: ${HDF5_ROOT}")
+    SET(HDF5_INC_ROOT "${HDF5_ROOT}/include")
+    SET(HDF5_LIB_ROOT "${HDF5_ROOT}/lib")
+    FIND_PATH(HDF5_INCLUDE_DIR H5FDcore.h PATHS ${HDF5_INC_ROOT} NO_DEFAULT_PATH)
+    FIND_LIBRARY(HDF5 NAMES hdf5 PATHS ${HDF5_LIB_ROOT} NO_DEFAULT_PATH)
+    FIND_LIBRARY(HDF5_H1 NAMES hdf5_hl PATHS ${HDF5_LIB_ROOT} NO_DEFAULT_PATH)
+ELSE()
+    SET(HDF5_INC_ROOT "/usr/local/include /opt/local/include /usr/include")
+    SET(HDF5_LIB_ROOT "/usr/local/lib /opt/local/lib /usr/lib")
+    FIND_PATH(HDF5_INCLUDE_DIR H5FDcore.h PATHS ${HDF5_INC_ROOT})
+    FIND_LIBRARY(HDF5 NAMES hdf5 PATHS ${HDF5_LIB_ROOT})
+    FIND_LIBRARY(HDF5_H1 NAMES hdf5_hl PATHS ${HDF5_LIB_ROOT})
+ENDIF()

 IF (HDF5 AND HDF5_H1)
    SET(HDF5_LIBRARIES ${HDF5} ${HDF5_H1})


Script extension assignment. Sets extension on installed script files. Enables .torsion file to be reconfigured after extension change. Prevents copy of main.tscript.in.

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -645,11 +645,13 @@
   endif()
 endif()

-if(NOT EXISTS "${projectOutDir}/${PROJECT_NAME}.torsion")
-    CONFIGURE_FILE("${cmakeDir}/template.torsion.in" "${projectOutDir}/${PROJECT_NAME}.torsion")
-endif()
-if(EXISTS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.${TORQUE_SCRIPT_EXTENSION}.in")
-    CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.${TORQUE_SCRIPT_EXTENSION}.in" "${projectOutDir}/main.${TORQUE_SCRIPT_EXTENSION}")
+CONFIGURE_FILE("${cmakeDir}/template.torsion.in" "${projectOutDir}/${PROJECT_NAME}.torsion")
+if(EXISTS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.tscript.in")
+    CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.tscript.in" "${projectOutDir}/main.${TORQUE_SCRIPT_EXTENSION}")
+else()
+    if(EXISTS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.${TORQUE_SCRIPT_EXTENSION}.in")
+        CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.${TORQUE_SCRIPT_EXTENSION}.in" "${projectOutDir}/main.${TORQUE_SCRIPT_EXTENSION}")
+    endif()
 endif()
 if(WIN32)
     if(NOT EXISTS "${projectSrcDir}/torque.rc")
@@ -919,11 +921,14 @@
     IF( NOT TORQUE_D3D11)
         list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/D3DCompiler_47.dll")
     ENDIF()
+    list(REMOVE_ITEM INSTALL_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/game/main.tscript.in")

     foreach(ITEM ${INSTALL_FILES_AND_DIRS})
         get_filename_component( dir ${ITEM} DIRECTORY )
+        get_filename_component( scriptName ${ITEM} NAME )
         STRING(REGEX REPLACE "${CMAKE_SOURCE_DIR}/Templates/${TORQUE_TEMPLATE}/" "${TORQUE_APP_DIR}/" INSTALL_DIR ${dir})
-        install( FILES ${ITEM} DESTINATION ${INSTALL_DIR} )
+        STRING(REGEX REPLACE ".tscript" ".${TORQUE_SCRIPT_EXTENSION}" newScriptName ${scriptName})
+        install( FILES ${ITEM} DESTINATION ${INSTALL_DIR} RENAME ${newScriptName} )
     endforeach()

     if(WIN32)


Travis: re-enable verbose options

Travis: re-enable verbose options

--- Testing/script/travis_script.cmake
+++ Testing/script/travis_script.cmake
@@ -88,13 +88,13 @@
   if(${MERCURY_MEMORYCHECK_TYPE} MATCHES "ThreadSanitizer")
     set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=thread -fno-omit-frame-pointer -fPIC -fuse-ld=gold -pthread")
     # Must add verbosity / Error in build if no memory output file is produced
-    # set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1")
+    set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1")
   endif()
   # Asan
   if(${MERCURY_MEMORYCHECK_TYPE} MATCHES "AddressSanitizer")
     set(MERCURY_MEMCHECK_FLAGS "-O1 -fsanitize=address -fno-omit-frame-pointer -fPIC -fuse-ld=gold -pthread")
     # Must add verbosity / Error in build if no memory output file is produced
-    # set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1")
+    set(CTEST_MEMORYCHECK_SANITIZER_OPTIONS "verbosity=1")
   endif()

   # needed by mercury_common.cmake


Fix some linking issues on g++, and fix a small apple ommission

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -328,14 +328,8 @@
             set_target_properties(${CEGUI_TARGET_NAME}_Static PROPERTIES LINK_FLAGS_DEBUG /NODEFAULTLIB:freeglut.lib)
         endif()

-        target_link_libraries(${CEGUI_TARGET_NAME}_Static
-            ${CEGUI_STATIC_XMLPARSER_MODULE}_Static
-            ${CEGUI_STATIC_IMAGECODEC_MODULE}_Static
-            ${CEGUI_FALAGARD_WR_LIBNAME}_Static
-        )
-
         if (APPLE)
-            cegui_apple_app_setup(${CEGUI_TARGET_NAME} TRUE)
+            cegui_apple_app_setup(${CEGUI_TARGET_NAME}_Static TRUE)
         endif()
     endif()

@@ -369,10 +363,22 @@
         cegui_apple_app_setup(${CEGUI_TARGET_NAME} FALSE)
     endif()

+
+    ###########################################################################
+    #                      LIBRARY LINK SETUP
+    ###########################################################################
     cegui_target_link_libraries(${CEGUI_TARGET_NAME}
         ${CEGUI_BASE_LIBNAME}
         ${CEGUI_SAMPLEHELPER_LIBNAME}
     )
+
+    if (CEGUI_BUILD_STATIC_CONFIGURATION)
+        target_link_libraries(${CEGUI_TARGET_NAME}_Static
+            ${CEGUI_STATIC_XMLPARSER_MODULE}_Static
+            ${CEGUI_STATIC_IMAGECODEC_MODULE}_Static
+            ${CEGUI_FALAGARD_WR_LIBNAME}_Static
+        )
+    endif()

     ###########################################################################
     #                           INSTALLATION


make ConanInline easier to use

make ConanInline easier to use

--- cmake/ConanInline.cmake
+++ cmake/ConanInline.cmake
@@ -27,3 +27,19 @@
   include(${CONAN_CMAKE_LIST_DIR}/conan.cmake)
   set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_BINARY_DIR})
 endmacro()
+
+function(conan_configure)
+    conan_cmake_generate_conanfile(OFF ${ARGV})
+endfunction()
+
+macro(conan_install)
+	conan_cmake_autodetect(settings)
+	if(CMAKE_CXX_STANDARD)
+		set(settings ${settings} compiler.cppstd=${CMAKE_CXX_STANDARD})
+	endif()
+	message("Conan settings are ${settings}")
+	conan_cmake_install(PATH_OR_REFERENCE .
+	                    BUILD missing
+	                    REMOTE conan-center
+	                    SETTINGS ${settings})
+endmacro()


Find FXC executable.

Find FXC executable.

--- cmake/FindDirectX.cmake
+++ cmake/FindDirectX.cmake
@@ -39,6 +39,7 @@
 	if (DirectX_ROOT_DIR)
 		set (DirectX_INC_SEARCH_PATH "${DirectX_ROOT_DIR}/Include")
 		set (DirectX_LIB_SEARCH_PATH "${DirectX_ROOT_DIR}/Lib/${DirectX_ARCHITECTURE}")
+		set (DirectX_BIN_SEARCH_PATH "${DirectX_ROOT_DIR}/Utilities/bin/x86")
 	endif ()

@@ -60,6 +61,7 @@
 		if (WIN8_SDK_ROOT_DIR)
 			set (DirectX_INC_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/Include/um" "${WIN8_SDK_ROOT_DIR}/Include/shared")
 			set (DirectX_LIB_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/Lib/Win8/um/${DirectX_ARCHITECTURE}")
+			set (DirectX_BIN_SEARCH_PATH "${WIN8_SDK_ROOT_DIR}/bin/x86")
 		endif ()
 	endif ()

@@ -204,6 +206,11 @@
 	if (DirectX_D3D11_1_INCLUDE_DIR AND DirectX_D3D11_LIBRARY)
 		set (DirectX_D3D11_1_FOUND 1)
 	endif ()
+
+
+	find_program (DirectX_FXC_EXECUTABLE fxc
+		PATHS ${DirectX_BIN_SEARCH_PATH}
+		DOC "Path to fxc.exe executable.")

 	mark_as_advanced (


Added command to append visglut path to hints list in cmake module

git-svn-id: 30eb7ec59a8a6686122b7fabd9f406f2bfa82068@253 6c50cc09-817d-0410-90cf-7b22d5ef511c

--- cmake/Findvisglut.cmake
+++ cmake/Findvisglut.cmake
@@ -29,6 +29,7 @@

 # setup of additional search hint paths
 set(hint_paths ${CMAKE_CURRENT_SOURCE_DIR})
+list(APPEND hint_paths ${visglut_DIR})
 # traverse file system up to the second-highest level
 get_filename_component(my_dir "${CMAKE_SOURCE_DIR}/.." ABSOLUTE)
 while (${my_dir} STRGREATER "/")


Fix SOURCE_DIR in HandleGTest.cmake (#705)

If benchmark added as cmake subproject, HandleGTest throws an error as  does return absolute source dir.
Change it to , so it will be refering to it's own source dir.

Also see PR #703.

--- cmake/HandleGTest.cmake
+++ cmake/HandleGTest.cmake
@@ -76,11 +76,11 @@
 endmacro(build_external_gtest)

 if (BENCHMARK_ENABLE_GTEST_TESTS)
-  if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/googletest)
-    set(GTEST_ROOT "${CMAKE_SOURCE_DIR}/googletest")
+  if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
+    set(GTEST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/googletest")
     set(INSTALL_GTEST OFF CACHE INTERNAL "")
     set(INSTALL_GMOCK OFF CACHE INTERNAL "")
-    add_subdirectory(${CMAKE_SOURCE_DIR}/googletest)
+    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/googletest)
     set(GTEST_BOTH_LIBRARIES gtest gmock gmock_main)
     foreach(HEADER test mock)
       # CMake 2.8 and older don't respect INTERFACE_INCLUDE_DIRECTORIES, so we


fixed F411 support

fixed F411 support

--- cmake/gcc_stm32f4.cmake
+++ cmake/gcc_stm32f4.cmake
@@ -6,7 +6,7 @@
 SET(CMAKE_MODULE_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "module linker flags")
 SET(CMAKE_SHARED_LINKER_FLAGS "-mthumb -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mabi=aapcs" CACHE INTERNAL "shared linker flags")
 SET(STM32_CHIP_TYPES 405xx 415xx 407xx 417xx 427xx 437xx 429xx 439xx 446xx 401xC 401xE 411xE CACHE INTERNAL "stm32f4 chip types")
-SET(STM32_CODES "405.." "415.." "407.." "417.." "427.." "437.." "429.." "439.." "446.." "401.[CB]" "401.[ED]" "411.[ED]")
+SET(STM32_CODES "405.." "415.." "407.." "417.." "427.." "437.." "429.." "439.." "446.." "401.[CB]" "401.[ED]" "411.[CE]")

 MACRO(STM32_GET_CHIP_TYPE CHIP CHIP_TYPE)
     STRING(REGEX REPLACE "^[sS][tT][mM]32[fF](4[01234][15679].[BCEGI]).*$" "\\1" STM32_CODE ${CHIP})


Change associated with removing "Ada 2007" stuff from Ada source.

svn path=/trunk/; revision=11096

--- cmake/modules/ada.cmake
+++ cmake/modules/ada.cmake
@@ -54,7 +54,7 @@
 endif(ENABLE_ada)

 # New stuff by Jerry for source modifications for Ada 2007 or not Ada 2007.
-option(HAVE_ADA_2007 "Ada 2007?" OFF)
+set(HAVE_ADA_2007 OFF CACHE BOOL "Ada 2007?" FORCE)

 if(HAVE_ADA_2007)
   set(Ada_Is_2007_With_and_Use_Numerics "    with Ada.Numerics.Long_Real_Arrays; use Ada.Numerics.Long_Real_Arrays;")


Tweak commentary.

Tweak commentary.

svn path=/trunk/; revision=6956

--- cmake/modules/gcw.cmake
+++ cmake/modules/gcw.cmake
@@ -27,6 +27,7 @@
 # gcw_TARGETS		  - list of targets which the gcw dynamic device
 # 			    depends on.
 # DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.
+# gcw_SOURCE		  - list of source files other than gcw.c
 if(PLD_gcw)
   if(NOT PKGCONFIG_EXECUTABLE)
     message(STATUS


Fixed typo in setup_cpack.

Fixed typo in setup_cpack.

--- cmake/setup_cpack.cmake
+++ cmake/setup_cpack.cmake
@@ -76,7 +76,7 @@
     )

   IF(NOT "${DEAL_II_CPACK_EXTERNAL_LIBS_TREE}" STREQUAL "")
-     INSTALL(DIRECTORY ${DEAL_II_EXTERNAL_LIBS_TREE}/
+     INSTALL(DIRECTORY ${DEAL_II_CPACK_EXTERNAL_LIBS_TREE}/
        DESTINATION opt
        USE_SOURCE_PERMISSIONS
        )


Properly handle (empty) cmake generator expression

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -265,7 +265,7 @@
 set(HIP_HIPCC_INCLUDE_ARGS_USER "")
 macro(HIP_INCLUDE_DIRECTORIES)
     foreach(dir ${ARGN})
-        list(APPEND HIP_HIPCC_INCLUDE_ARGS_USER -I${dir})
+        list(APPEND HIP_HIPCC_INCLUDE_ARGS_USER $<$<BOOL:${dir}>:-I${dir}>)
     endforeach()
 endmacro()

@@ -373,7 +373,7 @@
     list(REMOVE_DUPLICATES _hip_include_directories)
     if(_hip_include_directories)
         foreach(dir ${_hip_include_directories})
-            list(APPEND HIP_HIPCC_INCLUDE_ARGS -I${dir})
+            list(APPEND HIP_HIPCC_INCLUDE_ARGS $<$<BOOL:${dir}>:-I${dir}>)
         endforeach()
     endif()


ENH: Update git tag.

ENH: Update git tag.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -154,7 +154,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
   set(${proj}_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git")
-  set(${proj}_GIT_TAG 1d6fe27b6e7552f62f94b6c3cb64c4438bce3a86)
+  set(${proj}_GIT_TAG 63a970e3d607555a3315270e06c99d272c0a242f)
   set(ITK_VERSION_ID ITK-4.8) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


:bug: when looking for eggs

:bug: when looking for eggs

--- scripts/EnvironmentScript.cmake
+++ scripts/EnvironmentScript.cmake
@@ -42,7 +42,7 @@
 # Gets list of eggs in given directories
 function(_get_python_eggs OUTVAR)
     unset(patterns)
-    foreach(directory ${apeg_UNPARSED_ARGUMENTS})
+    foreach(directory ${ARGN})
         if(NOT "${directory}" MATCHES ".*egg")
             list(APPEND patterns "${directory}/*.egg")
         else()


improve detection upload errors

improve detection upload errors

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -130,8 +130,8 @@
 	set(depends_dir "${DEPENDS_PATH}")
 	set(depends_bin_package "${depends_dir}/${PACKAGE}-${VERSION}")
 	set(depends_package "${CMAKE_PREFIX_PATH}/${PACKAGE}-${VERSION}")
-	set(depends_package_platform "${CMAKE_PREFIX_PATH}/${PACKAGE}-${VERSION}/${CMAKI_PLATFORM}.cmake")
-	if(NOT EXISTS "${depends_package_platform}" OR "${NO_USE_CACHE_LOCAL}")
+	set(package_marker "${depends_bin_package}/${CMAKI_PLATFORM}.cache")
+	if(NOT EXISTS "${package_marker}" OR "${NO_USE_CACHE_LOCAL}")
 		# pido un paquete, en funcion de:
 		#		- paquete
 		#		- version
@@ -144,7 +144,6 @@
 		set(http_package_cmake_filename "${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename}")
 		# 4. descargo el fichero que se supone tienes los ficheros cmake
 		if(NOT "${NO_USE_CACHE_REMOTE}")
-			message("Downloading ${http_package_cmake_filename} ...")
 			cmaki_download_file("${http_package_cmake_filename}" "${package_uncompressed_file}")
 		endif()
 		# Si no puede descargar el artefacto ya hecho (es que necesito compilarlo y subirlo)
@@ -330,8 +329,8 @@
 	get_filename_component(package_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 	# ${package_name} en realidad es paquete + version (asyncply-0.0.0.0)
 	get_filename_component(package_name "${package_dir}" NAME)
-	set(package_cmake_filename ${package_name}-${CMAKI_PLATFORM}.tar.gz)
-	set(http_package_cmake_filename ${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename})
+	set(package_filename ${package_name}-${CMAKI_PLATFORM}.tar.gz)
+	set(http_package_filename ${CMAKI_REPOSITORY}/download.php?file=${package_filename})

 	# URL implicita
 	# strip implicito
@@ -352,10 +351,12 @@
 			file(READ "${package_compressed_md5}" md5sum )
 			string(REGEX MATCH "[0-9a-fA-F]*" md5sum "${md5sum}")
 			# TODO: use md5sum
-			# cmaki_download_file("${http_package_cmake_filename}" "${package_compessed}" "${md5sum}" )
-			cmaki_download_file("${http_package_cmake_filename}" "${package_compessed}")
+			# cmaki_download_file("${http_package_filename}" "${package_compessed}" "${md5sum}" )
+			message("downloading ${http_package_filename}")
+			cmaki_download_file("${http_package_filename}" "${package_compessed}")
 			if(NOT "${COPY_SUCCESFUL}")
 				file(REMOVE "${package_compessed}")
+				message(FATAL_ERROR "Error downloading ${http_package_filename}")
 			endif()
 		else()
 			MESSAGE("Checksum for ${package_name}-${CMAKI_PLATFORM}.tar.gz not found. Rejecting to download an untrustworthy file.")


works without artifacts server

works without artifacts server

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -97,6 +97,7 @@
 		list(GET RESULT_VERSION 2 VERSION)
 		set(FORCE_GENERATE_ARTIFACT FALSE)
 	else()
+		set(PACKAGE_MODE "EXACT")
 		set(VERSION ${VERSION_REQUEST})
 		set(FORCE_GENERATE_ARTIFACT TRUE)
 		message("-- need build package ${PACKAGE_NAME} can't get version: ${VERSION_REQUEST}, will be generated.")
@@ -104,7 +105,8 @@
 	#######################################################

 	# 3. si no tengo los ficheros de cmake, los intento descargar
-	set(depends_bin_package "${CMAKI_PATH}/../depends/${PACKAGE}-${VERSION}")
+	set(depends_dir "${CMAKI_PATH}/../depends")
+	set(depends_bin_package "${depends_dir}/${PACKAGE}-${VERSION}")
 	set(depends_package ${CMAKE_PREFIX_PATH}/${PACKAGE}-${VERSION})
 	if((NOT EXISTS "${depends_package}") OR ${FORCE_GENERATE_ARTIFACT})
 		# pido un paquete, en funcion de:
@@ -146,9 +148,14 @@
 				COMMAND python ${ARTIFACTS_PATH}/check_remote_version.py --server=${CMAKI_REPOSITORY} --artifacts=${CMAKE_PREFIX_PATH} --platform=${CMAKI_PLATFORM} --name=${PACKAGE}
 				WORKING_DIRECTORY "${ARTIFACTS_PATH}"
 				OUTPUT_VARIABLE RESULT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-			list(GET RESULT_VERSION 0 PACKAGE_MODE)
-			list(GET RESULT_VERSION 1 PACKAGE_NAME)
-			list(GET RESULT_VERSION 2 VERSION)
+			if(RESULT_VERSION)
+				list(GET RESULT_VERSION 0 PACKAGE_MODE)
+				list(GET RESULT_VERSION 1 PACKAGE_NAME)
+				list(GET RESULT_VERSION 2 VERSION)
+				set(FORCE_GENERATE_ARTIFACT FALSE)
+			else()
+				message(FATAL_ERROR "-- not found ${PACKAGE}.")
+			endif()
 			#######################################################

 			# 7. subo el artefacto y los ficheros de cmake
@@ -169,6 +176,21 @@
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
 				file(REMOVE_RECURSE "${package_uncompressed_file}")
+				file(REMOVE_RECURSE "${package_generated_file}")
+			endif()
+
+			# y tambien descomprimo el propio tar gz
+			execute_process(
+				COMMAND "${CMAKE_COMMAND}" -E tar zxf "${package_generated_file}"
+				WORKING_DIRECTORY "${depends_dir}/"
+				RESULT_VARIABLE uncompress_result2
+				)
+			if(uncompress_result2)
+				message(FATAL_ERROR "Extracting ${package_generated_file} failed! Error ${uncompress_result2}")
+				file(REMOVE_RECURSE "${depends_bin_package}")
+				file(REMOVE_RECURSE "${depends_package}")
+				file(REMOVE_RECURSE "${package_uncompressed_file}")
+				file(REMOVE_RECURSE "${package_generated_file}")
 			endif()

 			# 9. subir artefactos
@@ -180,10 +202,12 @@
 				RESULT_VARIABLE upload_result1
 				)
 			if(upload_result1)
-				message(FATAL_ERROR "error in upload ${package_generated_file})")
+				# upload not is fatal
+				message("error in upload ${package_generated_file})")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
 				file(REMOVE_RECURSE "${package_uncompressed_file}")
+				file(REMOVE_RECURSE "${package_generated_file}")
 			endif()
 			message("-- uploading ${package_cmake_generated_file}")
 			message("python ${ARTIFACTS_PATH}/upload_package.py --url=${CMAKI_REPOSITORY}/upload.php --filename=${package_cmake_generated_file}")
@@ -193,10 +217,12 @@
 				RESULT_VARIABLE upload_result2
 				)
 			if(upload_result2)
-				message(FATAL_ERROR "error in upload ${package_cmake_generated_file})")
+				# upload not is fatal
+				message("error in upload ${package_cmake_generated_file})")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
 				file(REMOVE_RECURSE "${package_uncompressed_file}")
+				file(REMOVE_RECURSE "${package_generated_file}")
 			endif()

 			# 10. borro los 2 tar gz


OpenCL paths on CUDA sytem

OpenCL paths on CUDA sytem

--- src/FindOpenCL.cmake
+++ src/FindOpenCL.cmake
@@ -56,6 +56,8 @@
     PATHS
         /usr/include
         /usr/local/include
+        /usr/local/cuda/include
+        /opt/cuda/include
     DOC "OpenCL header file path"
 )
 mark_as_advanced( OPENCL_INCLUDE_DIRS )
@@ -74,6 +76,8 @@
         PATH_SUFFIXES x86_64 x64
         PATHS
             /usr/lib
+            /usr/local/cuda/lib
+            /opt/cuda/lib
     )
 else( )
     find_library( OPENCL_LIBRARIES
@@ -86,6 +90,8 @@
         PATH_SUFFIXES x86 Win32
         PATHS
             /usr/lib
+            /usr/local/cuda/lib
+            /opt/cuda/lib
     )
 endif( )
 mark_as_advanced( OPENCL_LIBRARIES )


Make missing libunwind fatal on NetBSD

Make missing libunwind fatal on NetBSD

--- src/pal/src/configure.cmake
+++ src/pal/src/configure.cmake
@@ -951,7 +951,7 @@
 elseif(CMAKE_SYSTEM_NAME STREQUAL NetBSD)
   if(NOT HAVE_LIBUNWIND_H)
     unset(HAVE_LIBUNWIND_H CACHE)
-    message(WARNING "Cannot find libunwind. Try installing libunwind8 and libunwind8-dev (or the appropriate packages for your platform)")
+    message(FATAL_ERROR "Cannot find libunwind. Try installing libunwind8 and libunwind8-dev (or the appropriate packages for your platform)")
   endif()
   if(NOT HAVE_BSD_UUID_H)
     unset(HAVE_BSD_UUID_H CACHE)


MITK 2012.12.00 version update

MITK 2012.12.00 version update

--- CMake/mitkSetupVariables.cmake
+++ CMake/mitkSetupVariables.cmake
@@ -6,8 +6,8 @@

 # MITK_VERSION
 set(MITK_VERSION_MAJOR "2012")
-set(MITK_VERSION_MINOR "09")
-set(MITK_VERSION_PATCH "99")
+set(MITK_VERSION_MINOR "12")
+set(MITK_VERSION_PATCH "00")
 set(MITK_VERSION_STRING "${MITK_VERSION_MAJOR}.${MITK_VERSION_MINOR}.${MITK_VERSION_PATCH}")
 if(MITK_VERSION_PATCH STREQUAL "99")
   set(MITK_VERSION_STRING "${MITK_VERSION_STRING}-${MITK_REVISION_SHORTID}")


finish migration to new build macros -- check before linking debug libs

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1295 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ModuleSetup.cmake
+++ CMakeModules/ModuleSetup.cmake
@@ -127,7 +127,7 @@
 macro (link_package PREFIX)
     target_link_libraries (${TARGET_NAME} ${${PREFIX}_LIBRARIES})

-    if (MSVC)
+    if (MSVC AND ${PREFIX}_DEBUG_LIBRARIES)
         target_link_libraries (${TARGET_NAME} debug ${${PREFIX}_DEBUG_LIBRARIES})
     endif ()
 endmacro (link_package)


Fixing typo that prevented some header files from being installed

--- Code/MXA/Base/SourceList.cmake
+++ Code/MXA/Base/SourceList.cmake
@@ -38,4 +38,4 @@
         set (install_files "1")
     endif()
 endif()
-cmp_IDE_SOURCE_PROPERTIES( "MXA/Base" "${MXA_Base_SRCS}" "${MXA_Base_HEADERS}" ${install_files})
+cmp_IDE_SOURCE_PROPERTIES( "MXA/Base" "${MXA_Base_HEADERS}" "${MXA_Base_SRCS}" ${install_files})


nuttx_nxphlite update config for changes on master

--- cmake/configs/nuttx_nxphlite-v3_default.cmake
+++ cmake/configs/nuttx_nxphlite-v3_default.cmake
@@ -80,6 +80,7 @@
 	drivers/sf0x/sf0x_tests
 ### NOT Portable YET drivers/test_ppm
 	modules/commander/commander_tests
+	modules/mc_pos_control/mc_pos_control_tests
 	modules/controllib_test
 	modules/mavlink/mavlink_tests
 	modules/unit_test
@@ -90,6 +91,7 @@
 	# General system control
 	#
 	modules/commander
+	modules/events
 	modules/load_mon
 	modules/navigator
 	modules/mavlink
@@ -102,8 +104,8 @@
 	#
 	modules/attitude_estimator_q
 	modules/position_estimator_inav
+	modules/ekf2
 	modules/local_position_estimator
-	modules/ekf2

 	#
 	# Vehicle Control
@@ -118,7 +120,7 @@
 	#
 	# Logging
 	#
-#	modules/sdlog2
+	modules/sdlog2
 	modules/logger

 	#
@@ -182,7 +184,7 @@

 	# Tutorial code from
 	# https://px4.io/dev/example_fixedwing_control
-	#examples/fixedwing_control
+	examples/fixedwing_control

 	# Hardware test
 	#examples/hwtest


fix assert file exists message broken by code style change

--- ament_cmake_core/cmake/ament_execute_extensions.cmake
+++ ament_cmake_core/cmake/ament_execute_extensions.cmake
@@ -20,8 +20,7 @@
       list(GET _extension_list 1 _cmake_filename)
       set(_extension_file "${${_pkg_name}_DIR}/${_cmake_filename}")
       assert_file_exists("${_extension_file}"
-        "ament_execute_extensions(${extension_point}) registered extension "
-        "'${_extension_file}' does not exist")
+        "ament_execute_extensions(${extension_point}) registered extension '${_extension_file}' does not exist")
       include("${_extension_file}")
     endforeach()
   endif()


Path to git_info.h.in is no longer hardcoded

--- modules/git_info/git_info.cmake
+++ modules/git_info/git_info.cmake
@@ -10,6 +10,8 @@
 #   url_root: https://github.com/coderefinery/autocmake/raw/master/
 #   fetch:
 #     - "%(url_root)modules/git_info/git_info.h.in"
+
+get_filename_component(_current_dir ${CMAKE_CURRENT_LIST_FILE} PATH)

 function(generate_git_info_header)
   # _header_location: where the Git info header file should be generated
@@ -61,7 +63,7 @@
   endif()

   configure_file(
-    ${PROJECT_SOURCE_DIR}/cmake/downloaded/git_info.h.in
+    ${_current_dir}/git_info.h.in
     ${_header_location}/${_header_name}
     @ONLY
     )


project.properties file generation fixed for per-component installation. (cherry picked from commit 65b4d779597ffdfe909cb01f6163b1c404b040c2)

--- cmake/OpenCVDetectAndroidSDK.cmake
+++ cmake/OpenCVDetectAndroidSDK.cmake
@@ -365,7 +365,7 @@
       endif()
       install(CODE "EXECUTE_PROCESS(COMMAND ${ANDROID_EXECUTABLE} --silent update project --path . --target \"${android_proj_sdk_target}\" --name \"${target}\" ${inst_lib_opt}
                                     WORKING_DIRECTORY \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}\"
-                                   )"  COMPONENT dev)
+                                   )"  COMPONENT samples)
       #empty 'gen'
       install(CODE "MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/samples/${sample_dir}/gen\")" COMPONENT samples)
     endif()


BUG: add libOpenGL to the list of possible system dependencies in packaging

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -106,6 +106,7 @@
   libdrm.so.2
   libGL.so*
   libGLX.so*
+  libOpenGL.so*
   libGLU.so*
   libXrender.so*
   libSM.so*


Added libqcocoa.dylib to APPLE_SYSTEM_DLLS

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -144,6 +144,7 @@
   libgcc_s.*dylib
   libcups.*dylib
   libomp.dylib
+  libqcocoa.dylib
   )

 if(WIN32)


Removed vtkRenderingOpenGL as a dep now too!

We don't need it anymore, and we want to be mutually exclusive to it.

Change-Id: Iacbcf2bd4549788749ccc4bcef0f2c2eadc0e63e

--- Rendering/OpenGL2/module.cmake
+++ Rendering/OpenGL2/module.cmake
@@ -6,7 +6,6 @@
     vtkRenderingCore
   PRIVATE_DEPENDS
     vtksys
-    vtkRenderingOpenGL
   COMPILE_DEPENDS
     vtkUtilitiesEncodeString
   TEST_DEPENDS


elif causes problems in ConfigurePackages.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@2247 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -2,13 +2,11 @@
 # per-dependency configuration macros
 #
 # All per-dependency configuration (or hacks) should go here. All per-module
-# build instructions should go in <Module>/CMakeLists.txt. The rest should
+# build instructions should go in <Module>/CMakeLists.txt. The rest should
 # remain generic.

 macro (configure_boost)
-    if (MSVC)
-        set (Boost_USE_STATIC_LIBS ON)
-    elif (APPLE)
+    if (MSVC OR APPLE)
         set (Boost_USE_STATIC_LIBS ON)
     else ()
         set (Boost_USE_STATIC_LIBS OFF)


refs #5368 suppress extra warnings from xz code when using clang

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@48677 c7de825b-a66e-492c-adef-691d508d4ae1

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -216,4 +216,5 @@

 list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
   "xz-4.999.9beta/src/liblzma"              # don't complain about warnings in xz source
-  )
+  "clang: warning: unknown warning option"  # don't complain about clang missing warnings from xz code
+  )


importing h5pp spdlog properly

importing h5pp spdlog properly

Former-commit-id: c40aed6206a80697c54689037918d3f44fa47307

--- cmake-modules/Fetch_spdlog.cmake
+++ cmake-modules/Fetch_spdlog.cmake
@@ -1,8 +1,11 @@
 include(GNUInstallDirs)
 find_package(spdlog 1.3 NO_DEFAULT_PATH PATHS ${INSTALL_DIRECTORY}/spdlog/${CMAKE_INSTALL_LIBDIR}/spdlog/cmake ${spdlog_DIR} )
 if(spdlog_FOUND)
-    get_target_property(spdlog_lib     spdlog::spdlog   INTERFACE_LINK_LIBRARIES)
-    message(STATUS "SPDLOG FOUND IN SYSTEM: ${spdlog_lib}")
+    get_target_property(spdlog_LIBRARIES spdlog::spdlog   IMPORTED_LOCATION_RELEASE)
+    set_target_properties(spdlog::spdlog PROPERTIES INTERFACE_LINK_LIBRARIES "${spdlog_LIBRARIES}")
+    message(STATUS "SPDLOG FOUND IN SYSTEM: ${spdlog_LIBRARIES}")
+
+
 elseif (DOWNLOAD_SPDLOG OR DOWNLOAD_ALL)
     message(STATUS "Spdlog will be installed into ${INSTALL_DIRECTORY}/spdlog on first build.")
     include(ExternalProject)


Increase minimum required Ipopt version to 3.11.9

--- cmake/DARTFindDependencies.cmake
+++ cmake/DARTFindDependencies.cmake
@@ -124,8 +124,8 @@
 dart_check_optional_package(NLOPT "dart-optimizer-nlopt" "nlopt" "2.4.1")

 # IPOPT
-find_package(IPOPT 3.11.4 QUIET)
-dart_check_optional_package(IPOPT "dart-optimizer-ipopt" "ipopt" "3.11.4")
+find_package(IPOPT 3.11.9 QUIET)
+dart_check_optional_package(IPOPT "dart-optimizer-ipopt" "ipopt" "3.11.9")

 # Shark
 find_package(SHARK QUIET)


Really fix warnings about passing -std=gnu99 to MSVC

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

--- cmake/Modules/BuiltinTests.cmake
+++ cmake/Modules/BuiltinTests.cmake
@@ -50,12 +50,13 @@
   )

   CHECK_COMPILER_FLAG_COMMON_PATTERNS(_CheckCCompilerFlag_COMMON_PATTERNS)
+  set(ERRORS_FOUND OFF)
   foreach(var ${_CheckCCompilerFlag_COMMON_PATTERNS})
     if("${var}" STREQUAL "FAIL_REGEX")
       continue()
     endif()
-    if("${var}" MATCHES "${_CheckCCompilerFlag_COMMON_PATTERNS}")
-      set(ERRORS_FOUND True)
+    if("${TEST_ERROR}" MATCHES "${var}" OR "${TEST_OUTPUT}" MATCHES "${var}")
+      set(ERRORS_FOUND ON)
     endif()
   endforeach()


add first implementation of FindCppUTest using pkg_config

--- cmake/Modules/FindCppUTest.cmake
+++ cmake/Modules/FindCppUTest.cmake
@@ -1,40 +1,24 @@
-# - Find Geant4 library
-# This module sets up Geant4 information
+# - Find CPPUTest library
 # It defines:
-# GEANT4_FOUND               If the Geant4 is found
-# GEANT4_INCLUDE_DIR         PATH to the include directory
-# GEANT4_LIBRARY_DIR         PATH to the library directory
-# GEANT4_LIBRARIES           Most common libraries
-# GEANT4_LIBRARIES_WITH_VIS  Most common libraries with visualization
+# CPPUTEST_FOUND               If the CPPUTest is found
+# CPPUTEST_INCLUDE_DIRS        PATH to the include directory
+# CPPUTEST_LIBRARIES           libraries

-find_program(GEANT4_CONFIG NAMES geant4-config
-             PATHS $ENV{GEANT4_INSTALL}/bin
-                   ${GEANT4_INSTALL}/bin
-                   /usr/local/bin /opt/local/bin)
+find_package(PkgConfig)

-if(GEANT4_CONFIG)
-  set(GEANT4_FOUND TRUE)
+pkg_check_modules(PC_CPPUTEST cpputest>=3.7)

-  execute_process(COMMAND ${GEANT4_CONFIG} --prefix
-                  OUTPUT_VARIABLE GEANT4_PREFIX
-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
-  execute_process(COMMAND ${GEANT4_CONFIG} --version
-                  OUTPUT_VARIABLE GEANT4_VERSION
-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
+find_path(CPPUTEST_INCLUDE_DIR CppUTest/CppUTestConfig.h
+  HINTS ${PC_CPPUTEST_INCLUDEDIR} ${PC_CPPUTEST_INCLUDE_DIRS}
+)

-  message(STATUS "Found Geant4: ${GEANT4_PREFIX} (${GEANT4_VERSION})")
+find_library(CPPUTEST_LIBRARY NAMES CppUTest libCppUTest
+  HINTS ${PC_CPPUTEST_LIBDIR} ${PC_CPPUTEST_LIBRARY_DIRS}
+)

-else()
-  set(GEANT4_FOUND FALSE)
-  message(STATUS "NOT Found Geant4: set GEANT4_INSTALL env.")
+include(FindPackageHandleStandardArgs)

-endif()
+find_package_handle_standard_args(CppUTest DEFAULT_MSG
+  CPPUTEST_LIBRARY CPPUTEST_INCLUDE_DIR)

-set(GEANT4_INCLUDE_DIR ${GEANT4_PREFIX}/include/Geant4)
-set(GEANT4_LIBRARY_DIR ${GEANT4_PREFIX}/lib64)
-set(GEANT4_LIBRARIES  G4interfaces G4persistency G4analysis
-                      G4error_propagation G4readout G4physicslists
-                      G4run G4event G4tracking G4parmodels G4processes
-                      G4digits_hits G4track G4particles G4geometry
-                      G4materials G4graphics_reps G4intercoms
-                      G4global G4clhep)
+mark_as_advanced(CPPUTEST_INCLUDE_DIR CPPUTEST_LIBRARY)


cmake: avoid special case for category ALL

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -46,8 +46,7 @@

 		set (NOT_INCLUDED "")
 		list (FIND PLUGINS "${PLUGIN_SHORT_NAME}" FOUND_NAME)
-		list (FIND PLUGINS "ALL" FOUND_ALL)
-		if (FOUND_NAME EQUAL -1 AND FOUND_ALL EQUAL -1)
+		if (FOUND_NAME EQUAL -1)
 			set (NOT_INCLUDED "Not include Plugin ${PLUGIN_SHORT_NAME}")
 		endif ()

@@ -58,7 +57,7 @@

 		STRING (REGEX MATCH "- +infos/provides *= *([a-zA-Z0-9 ]*)" PROVIDES "${contents}")
 		STRING (REGEX REPLACE "- +infos/provides *= *([a-zA-Z0-9 ]*)" "\\1" PROVIDES "${PROVIDES}")
-		list (APPEND CATEGORIES ${PROVIDES})
+		list (APPEND CATEGORIES "ALL" "${PROVIDES}")
 		STRING (TOUPPER "${CATEGORIES}" CATEGORIES)
 		#message (STATUS "CATEGORIES ${CATEGORIES}")


Windows: Qt5::Core depends on Winmm

Windows: Qt5::Core depends on Winmm

--- cmake/Qt5Core_HunterPlugin.cmake
+++ cmake/Qt5Core_HunterPlugin.cmake
@@ -66,6 +66,12 @@

   # defined: '_WSAAsyncSelect'
   _qt_cmake_extra_helpers_add_interface(Qt5::Core ws2_32)
+
+  # defined: '_GetFileVersionInfoSizeW'
+  _qt_cmake_extra_helpers_add_interface(Qt5::Core Mincore)
+
+  # defined: '__imp__timeSetEvent'
+  _qt_cmake_extra_helpers_add_interface(Qt5::Core Winmm)
 elseif(MINGW)
   # defined: '_pcre16_compile2'
   _qt_cmake_extra_helpers_add_interface_release_debug(


fix bug: fix system default search path for protobuf

--- cmake/modules/FindProtobuf.cmake
+++ cmake/modules/FindProtobuf.cmake
@@ -13,7 +13,7 @@
 find_library(Protobuf_LIBRARIES
              NAMES protobuf
              PATHS ${Protobuf_PATHS}
-             PATH_SUFFIXES lib lib64 lib/x86_64 lib/x64 lib/x86
+             PATH_SUFFIXES lib lib64 lib/x86_64 lib/x86_64-linux-gnu lib/x64 lib/x86
              DOC "Protobuf library"
              NO_DEFAULT_PATH)


Add the -Zc:__cplusplus switch to get the updated value of the __cplusplus macro on Windows

--- cmake/modules/SetUpWindows.cmake
+++ cmake/modules/SetUpWindows.cmake
@@ -55,10 +55,10 @@
   math(EXPR VC_MINOR "${MSVC_VERSION} % 100")

   if(winrtdebug)
-    set(BLDCXXFLAGS "-MDd -GR")
+    set(BLDCXXFLAGS "-Zc:__cplusplus -MDd -GR")
     set(BLDCFLAGS   "-MDd")
   else()
-    set(BLDCXXFLAGS "-MD -GR")
+    set(BLDCXXFLAGS "-Zc:__cplusplus -MD -GR")
     set(BLDCFLAGS   "-MD")
   endif()


Update SwiftSupport.cmake to allow copying directory resources in the TestFoundation bundle.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -192,11 +192,20 @@
                        COMMAND
                          ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${target}/${resources_dir})
     foreach(resource ${AST_RESOURCES})
-      add_custom_command(TARGET
-                           ${target}
-                         POST_BUILD
-                         COMMAND
-                           ${CMAKE_COMMAND} -E copy ${resource} ${CMAKE_CURRENT_BINARY_DIR}/${target}/${resources_dir}/)
+      if(IS_DIRECTORY ${resource})
+        get_filename_component(resource_basename ${resource} NAME)
+        add_custom_command(TARGET
+                             ${target}
+                           POST_BUILD
+                           COMMAND
+                             ${CMAKE_COMMAND} -E copy_directory ${resource} ${CMAKE_CURRENT_BINARY_DIR}/${target}/${resources_dir}/${resource_basename})
+      else()
+        add_custom_command(TARGET
+                             ${target}
+                           POST_BUILD
+                           COMMAND
+                             ${CMAKE_COMMAND} -E copy ${resource} ${CMAKE_CURRENT_BINARY_DIR}/${target}/${resources_dir}/)
+      endif()
     endforeach()
   else()
     add_custom_command(TARGET


Add zlib dependency to awssdk

Add zlib dependency to awssdk

Building 'ep_awssdk' directly fails with './bootstrap --enable-s3':

CMake Error at cmake/external_dependencies.cmake:10 (message):
  Could not find zlib
Call Stack (most recent call first):
  CMakeLists.txt:110 (include)

This dependency is hidden when doing a top-level 'make' because zlib is built
before awssdk.

--- cmake/Modules/FindAWSSDK_EP.cmake
+++ cmake/Modules/FindAWSSDK_EP.cmake
@@ -65,6 +65,9 @@
     if (TARGET ep_openssl)
       list(APPEND DEPENDS ep_openssl)
     endif()
+    if (TARGET ep_zlib)
+      list(APPEND DEPENDS ep_zlib)
+    endif()

     ExternalProject_Add(ep_awssdk
       PREFIX "externals"
@@ -120,4 +123,4 @@
     endif()

   endforeach ()
-endif ()+endif ()


Fix some build errors I hit in VS2019

Fix some build errors I hit in VS2019

--- cmake/defaults/msvcdefaults.cmake
+++ cmake/defaults/msvcdefaults.cmake
@@ -26,7 +26,21 @@
 set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /EHsc")

 # Standards compliant.
-set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Zc:rvalueCast /Zc:strictStrings /Zc:inline")
+set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Zc:rvalueCast /Zc:strictStrings")
+
+# The /Zc:inline option strips out the "arch_ctor_<name>" symbols used for
+# library initialization by ARCH_CONSTRUCTOR starting in Visual Studio 2019,
+# causing release builds to fail. Disable the option for this and later
+# versions.
+#
+# For more details, see:
+# https://developercommunity.visualstudio.com/content/problem/914943/zcinline-removes-extern-symbols-inside-anonymous-n.html
+if (MSVC_VERSION GREATER_EQUAL 1920)
+    set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Zc:inline-")
+else()
+    set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /Zc:inline")
+endif()
+

 # Turn on all but informational warnings.
 set(_PXR_CXX_FLAGS "${_PXR_CXX_FLAGS} /W3")
@@ -108,3 +122,6 @@
 # with no symbols in it.  We do this a lot because of a pattern of having
 # a C++ source file for many header-only facilities, e.g. tf/bitUtils.cpp.
 set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
+
+# Prevents Python from defining this which is not needed since VS2015.
+_add_define("HAVE_SNPRINTF")


Separate out Linux and OSX code for finding OpenCL

--- cmake/findopencl/FindOpenCL.cmake
+++ cmake/findopencl/FindOpenCL.cmake
@@ -7,7 +7,10 @@

 include(FindPackageHandleStandardArgs)

-if (UNIX OR APPLE)
+if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+    ###########################################################################
+    # Linux
+    ###########################################################################
     find_library(OPENCL_LIBRARIES
                  NAMES OpenCL
                  DOC "Path to OpenCL library"
@@ -16,7 +19,7 @@
                 )

     find_path(OPENCL_INCLUDE_DIRS
-              NAMES CL/cl.h OpenCL/cl.h CL/cl.hpp OpenCL/cl.hpp
+              NAMES CL/cl.h CL/cl.hpp
              )

     if ( CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" )
@@ -31,8 +34,23 @@
             message(WARNING "ARM target detected but Mali library was not found.")
         endif()
     endif()
+elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    ###########################################################################
+    # OSX (Darwin)
+    ###########################################################################
+    find_library(OPENCL_LIBRARIES
+                 NAMES OpenCL
+                 DOC "Path to OpenCL library"
+                )
+
+    find_path(OPENCL_INCLUDE_DIRS
+              NAMES OpenCL/cl.h OpenCL/cl.hpp
+             )

 elseif (WIN32)
+    ###########################################################################
+    # Windows
+    ###########################################################################
     message(FATAL_ERROR "Windows support not implemented")
 else ()
     message(FATAL_ERROR "Unsupported platform")


Revert "Removed unnecesary dependencies from ROOT's object files."

This reverts commit c858e72804ab703c88b15504a8590cb902f584ec. This
commit broke the nightly builds as it suddenly couldn't find
VecCore headers anymore.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -580,43 +580,11 @@
                        DEPENDS bindexplib )
   else()
     #---Need to add a dummy source file if all sources are OBJECT libraries (Xcode, ...)
-    add_custom_command(OUTPUT dummy.cxx COMMAND ${CMAKE_COMMAND} -E touch dummy.cxx)
-    # We have two possible kind of inputs to this function. One are real source files
-    # like headers and source file and the others are object files that we don't need
-    # to compile. We now assign each source file into one of those groups.
-    # The motivation behind this is that we don't want to just use add_library() on all
-    # passed source files because then they all have the same dependencies as our library
-    # linking target (which is a safety measure by CMake). E.g. if we just call add_library
-    # on the input set, then the compilation of each .o files would depend on the rootcling
-    # invocation of this dictionary (which in turns depends on a lot of expensive targets
-    # like LLVM and clang ) even though we don't need any of those just for compiling our
-    # object files.
-    # So what we do below is taking all our 'real source files' that need to be compiled and
-    # compile them first into an CMake "Object library" (aka, just compiling them into
-    # object files) which has no unnecesary dependencies beside move_headers. Then we
-    # reference those object files from the final add_library call. Now those object files
-    # can be compiled in parallel to the rootcling/LLVM/clang path and are only blocking
-    # the compilation when we hit the linking step for the current library.
-    foreach(source_file ${lib_srcs})
-      if (source_file)
-        if("${source_file}" MATCHES "[.](o)$" OR "${source_file}" MATCHES "[$][<]" OR "${source_file}" MATCHES "^G__")
-            set(obj_sources "${obj_sources};${source_file}")
-        elseif ("${source_file}" MATCHES "[.](cc|cpp|cxx|hh|hpp|hxx|h|c|mm)$")
-            set(real_sources "${real_sources};${source_file}")
-        else()
-            message(AUTHOR_WARNING "Unknown file type: '${source_file}'")
-            # Let's add it to object sources which is the old way of handling this.
-            set(obj_sources "${obj_sources};${source_file}")
-        endif()
-      endif()
-    endforeach()
-    if (real_sources)
-      add_library(${library}_OBJS OBJECT ${real_sources})
-      add_dependencies(${library}_OBJS move_headers)
-      set(${library}_OBJS_LIST $<TARGET_OBJECTS:${library}_OBJS>)
-    endif()
-
-    add_library(${library} ${_all} ${ARG_TYPE} ${obj_sources} ${${library}_OBJS_LIST} dummy.cxx)
+    if(NOT lib_srcs MATCHES "(^|[;])[^$][^<]")
+      add_custom_command(OUTPUT dummy.cxx COMMAND ${CMAKE_COMMAND} -E touch dummy.cxx)
+      set(lib_srcs ${lib_srcs} dummy.cxx)
+    endif()
+    add_library( ${library} ${_all} ${ARG_TYPE} ${lib_srcs})
     if(ARG_TYPE STREQUAL SHARED)
       set_target_properties(${library} PROPERTIES  ${ROOT_LIBRARY_PROPERTIES} )
     endif()


- forget APU_INCLUDE_DIR for WIN32

- forget APU_INCLUDE_DIR for WIN32

--- cmakemodules/FindSubversion.cmake
+++ cmakemodules/FindSubversion.cmake
@@ -81,6 +81,10 @@
     "$ENV{ProgramFiles}/Subversion/include/apr"
   )

+  FIND_PATH(APU_INCLUDE_DIR apu.h
+    "$ENV{ProgramFiles}/Subversion/include/apr-util"
+  )
+
   # search for libraries
   FIND_LIBRARY(APR_LIB libapr
     "$ENV{ProgramFiles}/Subversion/lib/apr"
@@ -168,16 +172,6 @@

   SET(APR_EXTRA_LIBFLAGS )
   SET(APU_EXTRA_LIBFLAGS )
-
-
-  FIND_PATH (SUBVERSION_INCLUDE_DIR
-    svn_client.h
-    "$ENV{ProgramFiles}/Subversion/include"
-  )
-
-  FIND_PATH(APR_INCLUDE_DIR apr.h
-    "$ENV{ProgramFiles}/Subversion/include/apr"
-  )

   # check found libraries


Simplify flag list construction

Simplify flag list construction

--- templates/CMake/cpp.cmake
+++ templates/CMake/cpp.cmake
@@ -67,16 +67,16 @@

 if(MSVC OR CYGWIN OR MINGW OR MSYS)
-  list(APPEND DEFINES "WIN32_LEAN_AND_MEAN;NOMINMAX")
+  list(APPEND DEFINES "WIN32_LEAN_AND_MEAN" "NOMINMAX")
 endif()
 if(MSVC)
-  list(APPEND DEFINES "_USE_MATH_DEFINES;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS")
+  list(APPEND DEFINES "_USE_MATH_DEFINES" "_CRT_NONSTDC_NO_WARNINGS" "_CRT_SECURE_NO_WARNINGS")
   list(APPEND DEFINES_DEBUG "_DEBUG")
   list(APPEND DEFINES_RELWITHDEBINFO "_DEBUG")
 else()
   list(APPEND DEFINES_RELEASE "NDEBUG")
   list(APPEND DEFINES_MINSIZEREL "NDEBUG")
-  list(APPEND DEFINES_DEBUG "_FORTIFY_SOURCE=2;_GLIBCXX_DEBUG")
+  list(APPEND DEFINES_DEBUG "_FORTIFY_SOURCE=2" "_GLIBCXX_DEBUG")
 endif()

 if(MSVC)
@@ -95,93 +95,83 @@
     string(REGEX REPLACE "/W[0-4]" "/W4" ${TARGET_FLAG} "${${TARGET_FLAG}}")
   endforeach(TARGET_FLAG)

-  list(APPEND C_FLAGS_DEBUG "/Oi;/Oy")
-  list(APPEND C_FLAGS_RELEASE "/Ob2;/Oi;/Ot;/Ox;/Oy;/GL")
+  list(APPEND C_FLAGS_DEBUG "/Oi" "/Oy")
+  list(APPEND C_FLAGS_RELEASE "/Ob2" "/Oi" "/Ot" "/Ox" "/Oy" "/GL")
   list(APPEND C_FLAGS_MINSIZEREL "/Os")

-  list(APPEND CXX_FLAGS_DEBUG "/Oi;/Oy")
-  list(APPEND CXX_FLAGS_RELEASE "/Ob2;/Oi;/Ot;/Ox;/Oy;/GL")
+  list(APPEND CXX_FLAGS_DEBUG "/Oi" "/Oy")
+  list(APPEND CXX_FLAGS_RELEASE "/Ob2" "/Oi" "/Ot" "/Ox" "/Oy" "/GL")
   list(APPEND CXX_FLAGS_MINSIZEREL "/Os")

   list(APPEND EXE_LINKER_FLAGS_RELEASE "/LTCG")
 else()
-  foreach(WARNING_FLAG
-      -Wall
-      -Wextra
-      -Wabi
-      -Wcast-align
-      -Wcast-qual
-      -Wconversion
-      -Wdisabled-optimization
-      -Wfloat-equal
-      -Wformat=2
-      -Winit-self
-      -Winvalid-pch
-      -Wmissing-declarations
-      -Wpointer-arith
-      -Wredundant-decls
-      -Wstack-protector
-      -Wstrict-aliasing=2
-      -Wstrict-overflow=5
-      -Wswitch-enum
-      -Wswitch-default
-      -Wunknown-pragmas
-      -Wunreachable-code
-      -Wwrite-strings
-      -pedantic)
-    list(APPEND GNU_CLANG_COMMON_WARNING_FLAGS ${WARNING_FLAG})
-  endforeach(WARNING_FLAG)
+  set(GNU_CLANG_COMMON_WARNING_FLAGS
+    "-Wall"
+    "-Wextra"
+    "-Wabi"
+    "-Wcast-align"
+    "-Wcast-qual"
+    "-Wconversion"
+    "-Wdisabled-optimization"
+    "-Wfloat-equal"
+    "-Wformat=2"
+    "-Winit-self"
+    "-Winvalid-pch"
+    "-Wmissing-declarations"
+    "-Wpointer-arith"
+    "-Wredundant-decls"
+    "-Wstack-protector"
+    "-Wstrict-aliasing=2"
+    "-Wstrict-overflow=5"
+    "-Wswitch-enum"
+    "-Wswitch-default"
+    "-Wunknown-pragmas"
+    "-Wunreachable-code"
+    "-Wwrite-strings"
+    "-pedantic")

   option(ENABLE_ADDITIONAL_WARNING_FLAGS "Enable additional warning flags." OFF)
   if(ENABLE_ADDITIONAL_WARNING_FLAGS)
-    list(APPEND GNU_CLANG_COMMON_WARNING_FLAGS "-Winline;-Wsign-conversion")
-  endif()
-
-  list(APPEND GNU_COMMON_WARNING_FLAGS "-Wlogical-op")
+    list(APPEND GNU_CLANG_COMMON_WARNING_FLAGS "-Winline" "-Wsign-conversion")
+  endif()
+
+  set(GNU_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS}" "-Wlogical-op")
   if(ENABLE_ADDITIONAL_WARNING_FLAGS)
     list(APPEND GNU_COMMON_WARNING_FLAGS "-Wunsafe-loop-optimizations")
   endif()

-  list(APPEND CLANG_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS};-Wsign-promo")
+  set(CLANG_COMMON_WARNING_FLAGS "${GNU_CLANG_COMMON_WARNING_FLAGS}" "-Wsign-promo")

   if(CMAKE_COMPILER_IS_GNUCC)
-    set(C_WARNING_FLAGS ${GNU_COMMON_WARNING_FLAGS})
-    foreach(WARNING_FLAG
-        -Wc++-compat
-        -Wbad-function-cast
-        -Wmissing-prototypes
-        -Wnested-externs
-        -Wold-style-definition
-        -Wstrict-prototypes)
-      list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-    endforeach(WARNING_FLAG)
+    set(C_WARNING_FLAGS
+      "${GNU_COMMON_WARNING_FLAGS}"
+      "-Wc++-compat"
+      "-Wbad-function-cast"
+      "-Wmissing-prototypes"
+      "-Wnested-externs"
+      "-Wold-style-definition"
+      "-Wstrict-prototypes")

     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
       message(STATUS "Add warning flags implemented in gcc 4.5")
-      foreach(WARNING_FLAG
-          -Wjump-misses-init
-          -Wunsuffixed-float-constants)
-        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND C_WARNING_FLAGS
+        "-Wjump-misses-init"
+        "-Wunsuffixed-float-constants")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6)
       message(STATUS "Add warning flags implemented in gcc 4.6")
-      foreach(WARNING_FLAG
-          -Wdouble-promotion
-          -Wsuggest-attribute=const
-          -Wsuggest-attribute=noreturn
-          -Wsuggest-attribute=pure
-          -Wtrampolines)
-        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND C_WARNING_FLAGS
+        "-Wdouble-promotion"
+        "-Wsuggest-attribute=const"
+        "-Wsuggest-attribute=noreturn"
+        "-Wsuggest-attribute=pure"
+        "-Wtrampolines")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.7)
       message(STATUS "Add warning flags implemented in gcc 4.7")
-      foreach(WARNING_FLAG
-          -Wno-return-local-addr
-          -Wvector-operation-performance)
-        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND C_WARNING_FLAGS
+        "-Wno-return-local-addr"
+        "-Wvector-operation-performance")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
       message(STATUS "Add warning flags implemented in gcc 4.8")
@@ -189,34 +179,28 @@
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1)
       message(STATUS "Add warning flags implemented in gcc 5.1")
-      foreach(WARNING_FLAG
-          -Wformat-signedness
-          -Wsuggest-final-methods
-          -Wsuggest-final-types)
-        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND C_WARNING_FLAGS
+        "-Wformat-signedness"
+        "-Wsuggest-final-methods"
+        "-Wsuggest-final-types")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
       message(STATUS "Add warning flags implemented in gcc 6.0")
-      foreach(WARNING_FLAG
-          -Wduplicated-cond
-          -Wshift-overflow=2)
-        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND C_WARNING_FLAGS
+        "-Wduplicated-cond"
+        "-Wshift-overflow=2")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
       message(STATUS "Add warning flags implemented in gcc 7.0")
       string(REGEX REPLACE "-Wabi" "-Wabi=11" C_WARNING_FLAGS "${C_WARNING_FLAGS}")
-      foreach(WARNING_FLAG
-          -Walloc-zero
-          -Wduplicated-branches
-          -Wformat-overflow=2
-          -Wformat-truncation=2
-          -Wrestrict
-          -Wshadow-local
-          -Wstringop-overflow=4)
-        list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND C_WARNING_FLAGS
+        "-Walloc-zero"
+        "-Wduplicated-branches"
+        "-Wformat-overflow=2"
+        "-Wformat-truncation=2"
+        "-Wrestrict"
+        "-Wshadow-local"
+        "-Wstringop-overflow=4")
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
       message(STATUS "Add warning flags implemented in gcc 8.0")
@@ -224,75 +208,71 @@
       list(APPEND C_WARNING_FLAGS "-Wsuggest-attribute=malloc")
     endif()

-    set(C_FLAGS "-pipe;${C_WARNING_FLAGS}")
-    set(C_FLAGS_DEBUG "-g3;-O0;-ftrapv -fstack-protector-all")
+    set(C_FLAGS "-pipe" "${C_WARNING_FLAGS}")
+    set(C_FLAGS_DEBUG "-g3" "-O0" "-ftrapv -fstack-protector-all")
+    set(C_FLAGS_RELEASE "-O3")
+    set(C_FLAGS_MINSIZEREL "-Os")
+    if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
+      list(APPEND C_FLAGS_RELEASE "-mtune=native" "-march=native")
+      set(C_FLAGS_MINSIZEREL "${C_FLAGS_MINSIZEREL}" "-mtune=native" "-march=native")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
+      set(C_FLAGS_RELWITHDEBINFO "-g" "-O2")
+    else()
+      set(C_FLAGS_RELWITHDEBINFO "-g" "-Og")
+    endif()
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+    set(C_WARNING_FLAGS
+      "${CLANG_COMMON_WARNING_FLAGS}"
+      "-Wc++-compat"
+      "-Wbad-function-cast"
+      "-Wmissing-prototypes")
+
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
+      message(STATUS "Add warning flags implemented in clang 3.5")
+      list(APPEND C_WARNING_FLAGS "-Wc++14-compat")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8)
+      message(STATUS "Add warning flags implemented in clang 3.8")
+      list(APPEND C_WARNING_FLAGS "-Wdouble-promotion")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
+      message(STATUS "Add warning flags implemented in clang 5.0")
+      list(APPEND C_WARNING_FLAGS "-Wzero-as-null-pointer-constant")
+    endif()
+
+    set(C_FLAGS "${CMAKE_C_FLAGS}" "-pipe" "${C_WARNING_FLAGS}")
+    set(C_FLAGS_DEBUG "-g3" "-O0" "-ftrapv" "-fstack-protector-all")
     set(C_FLAGS_RELEASE "-O3")
     set(C_FLAGS_MINSIZEREL "-s")
     if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      list(APPEND C_FLAGS_RELEASE "-mtune=native;-march=native")
-      set(C_FLAGS_MINSIZEREL "${C_FLAGS_MINSIZEREL};-mtune=native;-march=native")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
-      set(C_FLAGS_RELWITHDEBINFO "-g;-O2")
+      list(APPEND C_FLAGS_RELEASE "-mtune=native" "-march=native")
+      list(APPEND C_FLAGS_MINSIZEREL "-mtune=native" "-march=native")
+    endif()
+    if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
+      set(C_FLAGS_RELWITHDEBINFO "-g" "-O2")
     else()
-      set(C_FLAGS_RELWITHDEBINFO "-g;-Og")
-    endif()
-  elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
-    set(C_WARNING_FLAGS ${CLANG_COMMON_WARNING_FLAGS})
-    foreach(WARNING_FLAG
-        -Wc++-compat
-        -Wbad-function-cast
-        -Wmissing-prototypes)
-      list(APPEND C_WARNING_FLAGS ${WARNING_FLAG})
-    endforeach(WARNING_FLAG)
-
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
-      message(STATUS "Add warning flags implemented in clang 3.5")
-      list(APPEND C_WARNING_FLAGS "-Wc++14-compat")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8)
-      message(STATUS "Add warning flags implemented in clang 3.8")
-      list(APPEND C_WARNING_FLAGS "-Wdouble-promotion")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
-      message(STATUS "Add warning flags implemented in clang 5.0")
-      list(APPEND C_WARNING_FLAGS "-Wzero-as-null-pointer-constant")
-    endif()
-
-    set(C_FLAGS "${CMAKE_C_FLAGS};-pipe;${C_WARNING_FLAGS}")
-    set(C_FLAGS_DEBUG "-g3;-O0;-ftrapv;-fstack-protector-all")
-    set(C_FLAGS_RELEASE "-O3")
-    set(C_FLAGS_MINSIZEREL "-s")
-    if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      list(APPEND C_FLAGS_RELEASE "-mtune=native;-march=native")
-      list(APPEND C_FLAGS_MINSIZEREL "-mtune=native;-march=native")
-    endif()
-    if(CMAKE_C_COMPILER_VERSION VERSION_LESS 4.0)
-      set(C_FLAGS_RELWITHDEBINFO "-g;-O2")
-    else()
-      set(C_FLAGS_RELWITHDEBINFO "-g;-Og")
+      set(C_FLAGS_RELWITHDEBINFO "-g" "-Og")
     endif()
   else()
-    set(C_FLAGS ${CMAKE_C_FLAGS})
-    set(C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
-    set(C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE})
-    set(C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL})
-    set(C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO})
+    set(C_FLAGS "${CMAKE_C_FLAGS}")
+    set(C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
+    set(C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
+    set(C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}")
+    set(C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")
   endif()

   if(CMAKE_COMPILER_IS_GNUCXX)
-    set(CXX_WARNING_FLAGS ${GNU_COMMON_WARNING_FLAGS})
-    foreach(WARNING_FLAG
-        -Weffc++
-        -Wctor-dtor-privacy
-        -Wnon-virtual-dtor
-        -Wold-style-cast
-        -Woverloaded-virtual
-        -Wreorder
-        -Wsign-promo
-        -Wstrict-null-sentinel)
-      list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-    endforeach(WARNING_FLAG)
+    set(CXX_WARNING_FLAGS
+      "${GNU_COMMON_WARNING_FLAGS}"
+      "-Weffc++"
+      "-Wctor-dtor-privacy"
+      "-Wnon-virtual-dtor"
+      "-Wold-style-cast"
+      "-Woverloaded-virtual"
+      "-Wreorder"
+      "-Wsign-promo"
+      "-Wstrict-null-sentinel")

     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
       message(STATUS "Add warning flags implemented in g++ 4.3")
@@ -300,34 +280,28 @@
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6)
       message(STATUS "Add warning flags implemented in g++ 4.6")
-      foreach(WARNING_FLAG
-          -Wdouble-promotion
-          -Wnoexcept
-          -Wsuggest-attribute=const
-          -Wsuggest-attribute=noreturn
-          -Wsuggest-attribute=pure
-          -Wtrampolines)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wdouble-promotion"
+        "-Wnoexcept"
+        "-Wsuggest-attribute=const"
+        "-Wsuggest-attribute=noreturn"
+        "-Wsuggest-attribute=pure"
+        "-Wtrampolines")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.7)
       message(STATUS "Add warning flags implemented in g++ 4.7")
       string(REGEX REPLACE "-Wc\\+\\+0x-compat" "-Wc++11-compat" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
-      foreach(WARNING_FLAG
-          -Wdelete-non-virtual-dtor
-          -Wvector-operation-performance
-          -Wno-return-local-addr
-          -Wzero-as-null-pointer-constant)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wdelete-non-virtual-dtor"
+        "-Wvector-operation-performance"
+        "-Wno-return-local-addr"
+        "-Wzero-as-null-pointer-constant")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
       message(STATUS "Add warning flags implemented in g++ 4.8")
-      foreach(WARNING_FLAG
-          -Wsuggest-attribute=format
-          -Wuseless-cast)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wsuggest-attribute=format"
+        "-Wuseless-cast")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 4.9)
       message(STATUS "Add warning flags implemented in g++ 4.9")
@@ -335,39 +309,33 @@
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1)
       message(STATUS "Add warning flags implemented in g++ 5.1")
-      foreach(WARNING_FLAG
-          -Wc++14-compat
-          -Wformat-signedness
-          -Wsuggest-final-methods
-          -Wsuggest-final-types
-          -Wsuggest-override)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wc++14-compat"
+        "-Wformat-signedness"
+        "-Wsuggest-final-methods"
+        "-Wsuggest-final-types"
+        "-Wsuggest-override")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
       message(STATUS "Add warning flags implemented in g++ 6.0")
-      foreach(WARNING_FLAG
-          -Wduplicated-cond
-          -Wplacement-new=2
-          -Wshift-overflow=2)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wduplicated-cond"
+        "-Wplacement-new=2"
+        "-Wshift-overflow=2")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
       message(STATUS "Add warning flags implemented in g++ 7.0")
       string(REGEX REPLACE "-Wabi" "-Wabi=11" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
-      foreach(WARNING_FLAG
-          -Wc++17-compat
-          -Walloc-zero
-          -Wduplicated-branches
-          -Wformat-overflow=2
-          -Wformat-truncation=2
-          -Wregister
-          -Wrestrict
-          -Wshadow-local
-          -Wstringop-overflow=4)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wc++17-compat"
+        "-Walloc-zero"
+        "-Wduplicated-branches"
+        "-Wformat-overflow=2"
+        "-Wformat-truncation=2"
+        "-Wregister"
+        "-Wrestrict"
+        "-Wshadow-local"
+        "-Wstringop-overflow=4")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
       message(STATUS "Add warning flags implemented in g++ 8.0")
@@ -375,32 +343,30 @@
       list(APPEND CXX_WARNING_FLAGS "-Wsuggest-attribute=malloc")
     endif()

-    set(CXX_FLAGS "${CMAKE_CXX_FLAGS};-pipe;${CXX_WARNING_FLAGS}")
-    set(CXX_FLAGS_DEBUG "-g3;-O0;-ftrapv;-fstack-protector-all")
+    set(CXX_FLAGS "${CMAKE_CXX_FLAGS}" "-pipe" "${CXX_WARNING_FLAGS}")
+    set(CXX_FLAGS_DEBUG "-g3" "-O0" "-ftrapv" "-fstack-protector-all")
     set(CXX_FLAGS_RELEASE "-O3")
-    set(CXX_FLAGS_MINSIZEREL "-s")
+    set(CXX_FLAGS_MINSIZEREL "-Os")
     if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      list(APPEND CXX_FLAGS_RELEASE "-mtune=native;-march=native")
-      list(APPEND CXX_FLAGS_MINSIZEREL "-mtune=native;-march=native")
+      list(APPEND CXX_FLAGS_RELEASE "-mtune=native" "-march=native")
+      list(APPEND CXX_FLAGS_MINSIZEREL "-mtune=native" "-march=native")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
-      set(CXX_FLAGS_RELWITHDEBINFO "-g;-O2")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g" "-O2")
     else()
-      set(CXX_FLAGS_RELWITHDEBINFO "-g;-Og")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g" "-Og")
     endif()
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-    set(CXX_WARNING_FLAGS ${CLANG_COMMON_WARNING_FLAGS})
-    foreach(WARNING_FLAG
-        -Wc++11-compat
-        -Weffc++
-        -Wctor-dtor-privacy
-        -Wdelete-non-virtual-dtor
-        -Wnon-virtual-dtor
-        -Wold-style-cast
-        -Woverloaded-virtual
-        -Wreorder)
-      list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-    endforeach(WARNING_FLAG)
+    set(CXX_WARNING_FLAGS "${CLANG_COMMON_WARNING_FLAGS}")
+    list(APPEND CXX_WARNING_FLAGS
+      "-Wc++11-compat"
+      "-Weffc++"
+      "-Wctor-dtor-privacy"
+      "-Wdelete-non-virtual-dtor"
+      "-Wnon-virtual-dtor"
+      "-Wold-style-cast"
+      "-Woverloaded-virtual"
+      "-Wreorder")

     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
       message(STATUS "Add warning flags implemented in clang++ 3.5")
@@ -408,11 +374,9 @@
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.8)
       message(STATUS "Add warning flags implemented in clang++ 3.8")
-      foreach(WARNING_FLAG
-          -Wc++1z-compat
-          -Wdouble-promotion)
-        list(APPEND CXX_WARNING_FLAGS ${WARNING_FLAG})
-      endforeach(WARNING_FLAG)
+      list(APPEND CXX_WARNING_FLAGS
+        "-Wc++1z-compat"
+        "-Wdouble-promotion")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
       message(STATUS "Add warning flags implemented in clang++ 5.0")
@@ -420,29 +384,29 @@
       list(CXX_WARNING_FLAGS "-Wzero-as-null-pointer-constant")
     endif()

-    set(CXX_FLAGS "${CMAKE_CXX_FLAGS};-pipe;${CXX_WARNING_FLAGS}")
-    set(CXX_FLAGS_DEBUG "-g3;-O0;-ftrapv;-fstack-protector-all")
+    set(CXX_FLAGS "${CMAKE_CXX_FLAGS}" "-pipe" "${CXX_WARNING_FLAGS}")
+    set(CXX_FLAGS_DEBUG "-g3" "-O0" "-ftrapv" "-fstack-protector-all")
     set(CXX_FLAGS_RELEASE "-O3")
     set(CXX_FLAGS_MINSIZEREL "-s")
     if(SYSTEM_PROCESSOR_IS_X86 OR SYSTEM_PROCESSOR_IS_X64)
-      list(APPEND CXX_FLAGS_RELEASE "-mtune=native;-march=native")
-      list(APPEND CXX_FLAGS_MINSIZEREL "-mtune=native;-march=native")
+      list(APPEND CXX_FLAGS_RELEASE "-mtune=native" "-march=native")
+      list(APPEND CXX_FLAGS_MINSIZEREL "-mtune=native" "-march=native")
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
-      set(CXX_FLAGS_RELWITHDEBINFO "-g;-O2")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g" "-O2")
     else()
-      set(CXX_FLAGS_RELWITHDEBINFO "-g;-Og")
+      set(CXX_FLAGS_RELWITHDEBINFO "-g" "-Og")
     endif()
   else()
-    set(CXX_FLAGS ${CMAKE_CXX_FLAGS})
-    set(CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
-    set(CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-    set(CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL})
-    set(CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
-  endif()
-
-  set(EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE};-s;-Wl,-O1")
-  set(EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL};-s")
+    set(CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+    set(CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
+    set(CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+    set(CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+    set(CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+  endif()
+
+  set(EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" "-s" "-Wl,-O1")
+  set(EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL}" "-s")

   install(TARGETS ${BUILD_TARGET}
     RUNTIME DESTINATION bin


silence rpath deprecation warning

silence rpath deprecation warning

--- toolchains/osx.toolchain.cmake
+++ toolchains/osx.toolchain.cmake
@@ -14,8 +14,8 @@
 # https://blog.kitware.com/upcoming-in-cmake-2-8-12-osx-rpath-support
 # https://cmake.org/Wiki/CMake_RPATH_handling
 # http://web.archive.org/web/20080602043910/http://people.debian.org/~che/personal/rpath-considered-harmful
-cmake_policy( SET CMP0042 OLD )
-set( CMAKE_MACOSX_RPATH 0 ) # even with the policy set CMake 3.5.2 still issues the warning?
+# cmake_policy( SET CMP0042 OLD )
+# set( CMAKE_MACOSX_RPATH 0 ) # even with the policy set CMake 3.5.2 still issues the warning?

 set( CMAKE_OSX_ARCHITECTURES           "$(ARCHS_STANDARD)" )
 set( CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS "$(ARCHS_STANDARD_32_64_BIT)" )


VTK url

VTK url

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -57,8 +57,8 @@
      )
   endif()

-  set(VTK_URL /home/christoph/dev/bugsquashing/vtk-6.0.0.tar.gz)
-  set(VTK_URL_MD5 72ede4812c90bdc55172702f0cad02bb)
+  set(VTK_URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/vtk-6.0.0.tar.gz)
+  set(VTK_URL_MD5 fa07fb55a905186f7d98807585efb20e)

   set(VTK_PATCH_COMMAND ${CMAKE_COMMAND} -DTEMPLATE_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/EmptyFileForPatching.dummy -DWIN32_OPENGL_RW_FILE:FILEPATH=${MITK_SOURCE_DIR}/CMakeExternals/vtkWin32OpenGLRenderWindow.cxx.vtk-5.10.patched -P ${MITK_SOURCE_DIR}/CMakeExternals/PatchVTK-5.10.cmake)


UPD: increase strictness of coding errors/warnings

--- CMakeLists.default.cmake
+++ CMakeLists.default.cmake
@@ -15,7 +15,7 @@
 endif(NOT CMAKE_BUILD_TYPE)

 if (CMAKE_COMPILER_IS_GNUCXX)
-	set(CMAKE_C_FLAGS "-Wall -Wshadow -Wconversion -Wno-sign-conversion -fstrict-aliasing -fstack-protector-all -std=c99 ${CMAKE_USER_C_FLAGS}" CACHE STRING
+	set(CMAKE_C_FLAGS "-Wall -Wshadow -Wconversion -Wno-sign-conversion -pedantic-errors -fstrict-aliasing -fstack-protector-all -std=c99 ${CMAKE_USER_C_FLAGS}" CACHE STRING
 		"Flags used by the compiler during all build types." FORCE
 	)


Revert 27286. Version checks are elsewhere.

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@27294 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/modules/FindPETSC.cmake
+++ deal.II/cmake/modules/FindPETSC.cmake
@@ -193,12 +193,6 @@

   SET(PETSC_VERSION "${PETSC_VERSION_MAJOR}.${PETSC_VERSION_MINOR}.${PETSC_VERSION_SUBMINOR}")

-  IF (${PETSC_VERSION_MAJOR} LESS 3)
-    MESSAGE (FATAL_ERROR "************************************************\n"
-                         "Only PETSc versions 3.0 and later are supported!\n"
-                         "************************************************\n")
-  ENDIF()
-
   MARK_AS_ADVANCED(
     PETSC_ARCH
     PETSC_DIR


cmake: fix extra component dir ordering

cmake: fix extra component dir ordering

--- tools/cmake/project.cmake
+++ tools/cmake/project.cmake
@@ -217,18 +217,18 @@
                     "but component manager is not enabled. Please set IDF_COMPONENT_MANAGER environment variable.")
         endif()

+        spaces2list(EXTRA_COMPONENT_DIRS)
+        foreach(component_dir ${EXTRA_COMPONENT_DIRS})
+            __project_component_dir("${component_dir}")
+        endforeach()
+
+        __project_component_dir("${CMAKE_CURRENT_LIST_DIR}/components")
+
         # Look for components in the usual places: CMAKE_CURRENT_LIST_DIR/main,
         # CMAKE_CURRENT_LIST_DIR/components, and the extra component dirs
         if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/main")
             __project_component_dir("${CMAKE_CURRENT_LIST_DIR}/main")
         endif()
-
-        __project_component_dir("${CMAKE_CURRENT_LIST_DIR}/components")
-
-        spaces2list(EXTRA_COMPONENT_DIRS)
-        foreach(component_dir ${EXTRA_COMPONENT_DIRS})
-            __project_component_dir("${component_dir}")
-        endforeach()
     endif()

     spaces2list(COMPONENTS)


[FIX] Improved contrib finding on Windows.

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

--- util/cmake/SeqAnContribs.cmake
+++ util/cmake/SeqAnContribs.cmake
@@ -38,29 +38,36 @@
     # The contrib version we look for.
 	set (_SEQAN_CONTRIB_VERSION D20111031)
 	set (_SEQAN_CONTRIB_DIR "seqan-contrib-${_SEQAN_CONTRIB_VERSION}")
+
+	# Determine architecture for the precompiled contribs.
+	if (CMAKE_GENERATOR MATCHES ".*Win64")
+		set (CONTRIB_ARCH "x64")
+	else ()
+		set (CONTRIB_ARCH "x86")
+	endif ()

 	# Try to figure out where the user installed the contrib.  We expect
 	# it to be either in C:\, or one of the Program Files dirs.
 	#
 	# First, look into Program Files on 64 bit.
 	if (DEFINED ENV{ProgramW6432})
-		if (IS_DIRECTORY "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-x64")
-			set (SEQAN_CONTRIB_BASE "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-x64")
-		endif (IS_DIRECTORY "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-x64")
+		if (IS_DIRECTORY "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+			set (SEQAN_CONTRIB_BASE "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+		endif (IS_DIRECTORY "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
 	endif (DEFINED ENV{ProgramW6432})
 	# Try out Program Files for 32bit Windows.
 	if (NOT DEFINED SEQAN_CONTRIB_BASE)
-		if (IS_DIRECTORY "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-x86")
-			set (SEQAN_CONTRIB_BASE "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-x86")
-		endif (IS_DIRECTORY "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-x86")
+		if (IS_DIRECTORY "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+			set (SEQAN_CONTRIB_BASE "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+		endif (IS_DIRECTORY "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
 	endif (NOT DEFINED SEQAN_CONTRIB_BASE)
 	# Try out on C:/.
 	if (NOT DEFINED SEQAN_CONTRIB_BASE)
-		if (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-x86")
-			set (SEQAN_CONTRIB_BASE "C:/${_SEQAN_CONTRIB_DIR}-x86")
-		elseif (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-x64")
-			set (SEQAN_CONTRIB_BASE "C:/${_SEQAN_CONTRIB_DIR}-x64")
-		endif (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-x86")
+		if (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+			set (SEQAN_CONTRIB_BASE "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+		elseif (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+			set (SEQAN_CONTRIB_BASE "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
+		endif (IS_DIRECTORY "C:/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
 	endif (NOT DEFINED SEQAN_CONTRIB_BASE)

 	# Debug help.


git-svn-id: svn://scm.gforge.inria.fr/svn/openvibe@1225 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- cmake-modules/FindThirdPartyDotSceneLoader.cmake
+++ cmake-modules/FindThirdPartyDotSceneLoader.cmake
@@ -29,10 +29,10 @@
 ENDIF(WIN32)

 IF(UNIX)
-	FIND_PATH(PATH_DotSceneLoader include/DotScene/dotSceneInterface.h PATHS $ENV{OMK_HOME} $ENV{OMK_BIN})
+	FIND_PATH(PATH_DotSceneLoader include/dotSceneInterface.h PATHS $ENV{OMK_HOME} $ENV{OMK_BIN})
 	IF(PATH_DotSceneLoader)
 		SET(DotSceneLoader_FOUND TRUE)
-		SET(DotSceneLoader_INCLUDE_DIRS ${PATH_DotSceneLoader}/include/DotScene)
+		SET(DotSceneLoader_INCLUDE_DIRS ${PATH_DotSceneLoader}/include)
 		SET(DotSceneLoader_LIBRARIES DotSceneInterface)
 		SET(DotSceneLoader_LIBRARY_DIRS ${PATH_DotSceneLoader}/lib )
 	ENDIF(PATH_DotSceneLoader)


CMake: Recognise Freetype version 239

CMake: Recognise Freetype version 239

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

-set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238)
+set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238 freetype239)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


Enable GSL tests (reverts part of changeset 88c50cd078dd).

--- cmake/FindGSL.cmake
+++ cmake/FindGSL.cmake
@@ -160,7 +160,6 @@
   ENDIF(UNIX)
 ENDIF(WIN32)

-set(GSL_LIBRARIES "")

 IF(GSL_LIBRARIES)
   IF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS)


fix MKL find module

fix MKL find module

* check the $MKLROOT env variable in addition to $MKL_HOME
* dont use relative paths to find the libdir. this breaks when $MKLROOT is a symlink
* the architecture dependent subdirs are called intel64 and ia32 on most systems
* mark the variables as advanced

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -1,33 +1,55 @@

-FIND_PATH(MKL_INCLUDE_DIR mkl_cblas.h /usr/include
-				      /usr/local/include
-				      /opt/intel/mkl/8.1.1/include
-                                      $ENV{MKL_HOME}/include)
+FIND_PATH(MKL_INCLUDE_DIR mkl_cblas.h
+    HINTS $ENV{MKL_HOME}/include $ENV{MKLROOT}/include
+)

 IF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
-  GET_FILENAME_COMPONENT(MKL_LIB_PATH ${MKL_INCLUDE_DIR}/../lib/64 ABSOLUTE)
+    SET(INTEL_LIBDIR "intel64")
 ELSE ( CMAKE_SYSTEM_PROCESSOR  STREQUAL "x86_64" )
-  GET_FILENAME_COMPONENT(MKL_LIB_PATH ${MKL_INCLUDE_DIR}/../lib/32 ABSOLUTE)
+    SET(INTEL_LIBDIR "ia32")
 ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )

-FIND_LIBRARY( MKL_LAPACK NAMES mkl_lapack PATHS ${MKL_LIB_PATH} )
+FIND_LIBRARY(MKL_LAPACK
+    NAMES mkl_lapack
+    HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+)
+

 IF ( MKL_LAPACK_FOUND )
-  # old MKL versions
-  IF ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
-     FIND_LIBRARY( MKL NAMES mkl_ia64 PATHS ${MKL_LIB_PATH} )
-  ELSE ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
-     FIND_LIBRARY( MKL NAMES mkl_ia32 PATHS ${MKL_LIB_PATH} )
-  ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
-  FIND_LIBRARY( MKL_GUIDE NAMES guide PATHS ${MKL_LIB_PATH} )
-  SET (MKL ${MKL} ${MKL_LAPACK} ${MKL_GUIDE} )
+    # old MKL versions
+    IF ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
+        FIND_LIBRARY(MKL
+            NAMES mkl_ia64
+            HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+        )
+    ELSE ( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
+        FIND_LIBRARY(MKL
+            NAMES mkl_ia32
+            HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+        )
+    ENDIF( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
+        FIND_LIBRARY(MKL_GUIDE
+            NAMES guide
+            HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+        )
+
+    SET (MKL ${MKL} ${MKL_LAPACK} ${MKL_GUIDE} )
 ELSE (MKL_LAPACK_FOUND )
-  # newer MKL version
-  SET (MKL_LAPACK "")
-  FIND_LIBRARY( MKL_INTEL NAMES mkl_intel_lp64 PATHS ${MKL_LIB_PATH} )
-  FIND_LIBRARY( MKL_SEQUENTIAL NAMES mkl_sequential PATHS ${MKL_LIB_PATH} )
-  FIND_LIBRARY( MKL_CORE NAMES mkl_core PATHS ${MKL_LIB_PATH} )
-  SET (MKL ${MKL_INTEL} ${MKL_SEQUENTIAL} ${MKL_CORE} )
+    # newer MKL version
+    SET (MKL_LAPACK "")
+    FIND_LIBRARY(MKL_INTEL
+        NAMES mkl_intel_lp64
+        HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+    )
+    FIND_LIBRARY(MKL_SEQUENTIAL
+        NAMES mkl_sequential
+        HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+    )
+    FIND_LIBRARY(MKL_CORE
+        NAMES mkl_core
+        HINTS $ENV{MKL_HOME}/lib/${INTEL_LIBDIR} $ENV{MKLROOT}/lib/${INTEL_LIBDIR}
+    )
+    SET (MKL ${MKL_INTEL} ${MKL_SEQUENTIAL} ${MKL_CORE} )
 ENDIF ( MKL_LAPACK_FOUND )

@@ -35,15 +57,23 @@
 SET( MKL_LAPACK_INCLUDE_FILE ${MKL_INCLUDE_DIR}/mkl_lapack.h )

 IF (MKL_INCLUDE_DIR)
-  SET(MKL_FOUND ON)
+    SET(MKL_FOUND ON)
 ENDIF (MKL_INCLUDE_DIR)

 IF (MKL_FOUND OR MKL_INTEL_FOUND )
-  IF (NOT MKL_FIND_QUIETLY)
-     MESSAGE(STATUS "Found MKL: ${MKL_INCLUDE_DIR}")
-  ENDIF (NOT MKL_FIND_QUIETLY)
+    IF (NOT MKL_FIND_QUIETLY)
+        MESSAGE(STATUS "Found MKL: ${MKL_INCLUDE_DIR}")
+    ENDIF (NOT MKL_FIND_QUIETLY)
 ELSE(MKL_FOUND OR MKL_INTEL_FOUND )
-  IF (MKL_FIND_REQUIRED)
-     MESSAGE(FATAL_ERROR "Could not find MKL")
-  ENDIF (MKL_FIND_REQUIRED)
+    IF (MKL_FIND_REQUIRED)
+        MESSAGE(FATAL_ERROR "Could not find MKL")
+    ENDIF (MKL_FIND_REQUIRED)
 ENDIF (MKL_FOUND OR MKL_INTEL_FOUND )
+
+MARK_AS_ADVANCED(MKL_INCLUDE_DIR)
+MARK_AS_ADVANCED(MKL_LAPACK)
+MARK_AS_ADVANCED(MKL)
+MARK_AS_ADVANCED(MKL_GUIDE)
+MARK_AS_ADVANCED(MKL_INTEL)
+MARK_AS_ADVANCED(MKL_SEQUENTIAL)
+MARK_AS_ADVANCED(MKL_CORE)


Fix typo: handle (#253)

Fix typo: handle (#253)

Signed-off-by: Thanh Ha <09ea4d3a79c8bee41a16519f6a431f6bc0fd8d6f@linuxfoundation.org>

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -100,7 +100,7 @@
 		SET ( TBB_PATH_SUFFIXES intel64/gcc4.4 )
 	  ENDIF ()
 	ELSE ()
-      MESSAGE ( FATAL_ERROR "Can't hanlde non-GCC compiler")
+      MESSAGE ( FATAL_ERROR "Can't handle non-GCC compiler")
 	ENDIF ()
 	FIND_LIBRARY ( TBB_LIBRARY_PATH tbb PATHS ${TBB_LIBRARYDIR} PATH_SUFFIXES ${TBB_PATH_SUFFIXES}
       NO_DEFAULT_PATH


stage1: Fix missing LLD library

stage1: Fix missing LLD library

--- cmake/Findlld.cmake
+++ cmake/Findlld.cmake
@@ -49,6 +49,7 @@
     FIND_AND_ADD_LLD_LIB(lldELF)
     FIND_AND_ADD_LLD_LIB(lldCOFF)
     FIND_AND_ADD_LLD_LIB(lldWasm)
+    FIND_AND_ADD_LLD_LIB(lldMachO)
     FIND_AND_ADD_LLD_LIB(lldReaderWriter)
     FIND_AND_ADD_LLD_LIB(lldCore)
     FIND_AND_ADD_LLD_LIB(lldYAML)