pw_protobuf_compiler/cmake: Use pw_add_library

Migates the CMake functions to use pw_add_library which is more
concise and has additional checks.

Change-Id: I4422e16fc5ef141fe9b53a91399d1645974160ec
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/118131
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>


rust: Remove a rogue duplicate rust.cmake file

This only serves to confuse the cmake build tools into using the wrong
definitions, instead of the ones used in apps/system/rust.cmake.

Change-Id: Iaed204a8f8a9ae5fc2233dc4f9147ba6cf6a9a25
GitOrigin-RevId: 290682ee7b8eb7ad00a52f72c0f6e3be08e88673

--- rust.cmake
+++ rust.cmake
@@ -1,60 +0,0 @@
-# Fork of tools/seL4/cmake-tool/helpers/rust.cmake.
-#
-# The differences are that a) xargo has been replaced with cargo +nightly, since
-# xargo was upstreamed into Rust proper after seL4 created rust.cmake, and b)
-# the Rust target is hard-coded to riscv32imc-unknown-none-elf to make this
-# file easier to read.
-
-#
-# Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
-#
-# SPDX-License-Identifier: BSD-2-Clause
-#
-
-cmake_minimum_required(VERSION 3.8.2)
-include_guard(GLOBAL)
-
-# add_library but for rust libraries. Invokes cargo in the SOURCE_DIR that is provided,
-# all build output is placed in BUILD_DIR or CMAKE_CURRENT_BINARY_DIR if BUILD_DIR isn't provided.
-# lib_name: Name of library that is created
-# SOURCE_DIR: source directory of cargo project
-# BUILD_DIR: directory for cargo build output
-# TARGET: custom target to use. See in ../rust_targets/ for list of available targets.
-# LIB_FILENAME: filename of library created by cargo
-# DEPENDS: And target or file dependencies that need to be run before cargo
-function(RustAddLibrary lib_name)
-    cmake_parse_arguments(PARSE_ARGV 1 RUST "" "SOURCE_DIR;BUILD_DIR;TARGET;LIB_FILENAME" "DEPENDS")
-    if(NOT "${RUST_UNPARSED_ARGUMENTS}" STREQUAL "")
-        message(FATAL_ERROR "Unknown arguments to RustAddLibrary ${RUST_UNPARSED_ARGUMENTS}")
-    endif()
-    if("${RUST_SOURCE_DIR}" STREQUAL "")
-        message(FATAL_ERROR "SOURCE_DIR must be set for RustAddLibrary")
-    endif()
-    if("${RUST_LIB_FILENAME}" STREQUAL "")
-        message(FATAL_ERROR "LIB_FILENAME must be set for RustAddLibrary")
-    endif()
-    if("${RUST_BUILD_DIR}" STREQUAL "")
-        set(RUST_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
-    endif()
-
-    add_custom_target(
-        ${libmain}_custom
-        BYPRODUCTS
-        ${RUST_BUILD_DIR}/${RUST_LIB_FILENAME}
-        ${USES_TERMINAL_DEBUG}
-        DEPENDS ${RUST_DEPENDS}
-        WORKING_DIRECTORY ${RUST_SOURCE_DIR}
-        COMMAND
-            ${CMAKE_COMMAND} -E env cargo +nightly build
-            --target riscv32imc-unknown-none-elf
-            --target-dir ${RUST_BUILD_DIR} -Z unstable-options
-            --out-dir ${RUST_BUILD_DIR}
-    )
-
-    add_library(${lib_name} STATIC IMPORTED GLOBAL)
-    set_property(
-        TARGET ${lib_name}
-        PROPERTY IMPORTED_LOCATION "${RUST_BUILD_DIR}/${RUST_LIB_FILENAME}"
-    )
-    add_dependencies(${lib_name} ${libmain}_custom)
-endfunction()


Add a bit more debugging info in cmke try-compile messages

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -196,10 +196,13 @@
   set(RANDOM_FILENAME "${CMAKE_BINARY_DIR}/compile_test_${RNDNAME}.${SUFFIX}")
   file(WRITE "${RANDOM_FILENAME}" "${SOURCE}")

+  math(EXPR LSIZE "${ARGC} - 4")
+
   execute_process(COMMAND "${COMPILER}" ${ARGN} "${RANDOM_FILENAME}" RESULT_VARIABLE ${RES_VAR} OUTPUT_VARIABLE OV ERROR_VARIABLE EV)
   if(${${RES_VAR}})
     message(STATUS " ########## The command: ")
     message(STATUS "${COMPILER} ${ARGN} ${RANDOM_FILENAME}")
+    message(STATUS " ########## ARGN size: ${LSIZE}")
     message(STATUS " ########## Exited with nonzero status: ${${RES_VAR}}")
     if(OV)
       message(STATUS "STDOUT: ${OV}")


:lipstick: changed messages(...) to messages(STATUS ...)

--- cmake/info.cmake
+++ cmake/info.cmake
@@ -22,12 +22,16 @@
     set(fl_FLOATING_POINT_TYPE_STR "double")
 endif(fl_FLOATING_POINT_TYPE STREQUAL "float")

-message("--${Esc}[3;35m ================================================= ${Esc}[m ")
-message("--${Esc}[3;35m == ${Esc}[3;34m Filtering Library ${Esc}[m")
-message("--${Esc}[3;35m == ${Esc}[3;34m Version${Esc}[1;34m ${PROJECT_VERSION} ${Esc}[m")
-message("--${Esc}[3;35m == ${Esc}[m")
-message("--${Esc}[3;35m == ${Esc}[1;34m Setup: ${Esc}[m")
-message("--${Esc}[3;35m == ${Esc}[m - Using Catkin: ${fl_USING_CATKIN_STR}")
-message("--${Esc}[3;35m == ${Esc}[m - Using random seeds: ${fl_USING_RANDOM_SEED_STR}")
-message("--${Esc}[3;35m == ${Esc}[m - Using fl::Real floating point type: ${fl_FLOATING_POINT_TYPE_STR}")
-message("--${Esc}[3;35m ================================================= ${Esc}[m ")
+set(fl_COLOR "${Esc}[3;35m")
+set(fl_COLOR_CLEAR "${Esc}[m")
+
+message(STATUS "${fl_COLOR} ================================================= ${fl_COLOR_CLEAR}")
+message(STATUS "${fl_COLOR} == ${Esc}[3;34m Filtering Library ${fl_COLOR_CLEAR}")
+message(STATUS "${fl_COLOR} == ${Esc}[3;34m Version${Esc}[1;34m ${PROJECT_VERSION} ${fl_COLOR_CLEAR}")
+message(STATUS "${fl_COLOR} == ${fl_COLOR_CLEAR}")
+message(STATUS "${fl_COLOR} == ${Esc}[1;34m Setup: ${fl_COLOR_CLEAR}")
+message(STATUS "${fl_COLOR} == ${fl_COLOR_CLEAR} - Using Catkin: ${fl_USING_CATKIN_STR}")
+message(STATUS "${fl_COLOR} == ${fl_COLOR_CLEAR} - Using random seeds: ${fl_USING_RANDOM_SEED_STR}")
+message(STATUS "${fl_COLOR} == ${fl_COLOR_CLEAR} - Using fl::Real floating point type: ${fl_FLOATING_POINT_TYPE_STR}")
+message(STATUS "${fl_COLOR} ================================================= ${fl_COLOR_CLEAR} ")
+


lost commit

lost commit

--- packages/pack-template.cmake
+++ packages/pack-template.cmake
@@ -9,6 +9,7 @@
         set(OPTION_PACK_GENERATOR "ZIP;NSIS" CACHE STRING "Package targets")
     else()
         set(OPTION_PACK_GENERATOR "ZIP;TGZ;DEB" CACHE STRING "Package targets")
+        set(CPACK_DEB_COMPONENT_INSTALL ON)
     endif()

@@ -39,9 +40,9 @@
     # Package information

     string(TOLOWER ${META_PROJECT_NAME} package_name)          # Package name
-    set(package_description     "${META_PROJECT_DESCRIPTION}") # Package description
-    set(package_vendor          "${META_AUTHOR_ORGANIZATION}") # Package vendor
-    set(package_maintainer      "${META_AUTHOR_MAINTAINER}")   # Package maintainer
+    set(package_description ${META_PROJECT_DESCRIPTION})
+    set(package_vendor      ${META_AUTHOR_ORGANIZATION})
+    set(package_maintainer  ${META_AUTHOR_MAINTAINER})

     # Package specific options


Remove no-op patch command

Remove no-op patch command

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -83,7 +83,6 @@
     LIST_SEPARATOR ${sep}
     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/VTK-8.0.0.tar.gz
     URL_MD5 8de89b8c7a729016ab7128da5e881cf4
-    PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/VTK.patch
     CMAKE_GENERATOR ${gen}
     CMAKE_ARGS
         ${ep_common_args}


PKG: parse dlls not listed in delay load dependencies section

--- SuperBuild/Packaging/PackageHelper.cmake
+++ SuperBuild/Packaging/PackageHelper.cmake
@@ -898,10 +898,11 @@
           endif()
           if(WIN32)
             if(MSVC)
-              string(REGEX MATCHALL "dependencies.(.*[Dd][Ll][Ll])" loader_ov "${loader_ov}")
-              string(REGEX REPLACE "dependencies.." "" loader_ov "${loader_ov}")
-              # take out string 'Image has the following'
-              string(REGEX REPLACE "Image.has.the.following" "" loader_ov "${loader_ov}")
+              #skip entries from section 'delay load dependencies'
+              string(REGEX MATCHALL
+              "Image.has.the.following.dependencies.(.*[Dd][Ll][Ll])" loader_ov "${loader_ov}")
+              string(REGEX REPLACE
+              "Image.has.the.following.dependencies.." "" loader_ov "${loader_ov}")
               #beware of .DLL and .dll
               string(REGEX REPLACE ".DLL" ".dll" loader_ov "${loader_ov}")
               #convert to cmake list
@@ -1127,7 +1128,7 @@
   odbc32.dll
   psapi.dll
   python...dll
-  delay.load
+  Image.has.the.following.delay.load
   )

 set(LINUX_SYSTEM_DLLS


Fix #150: simpify CppcheckTargets

Fix #150: simpify CppcheckTargets

--- CppcheckTargets.cmake
+++ CppcheckTargets.cmake
@@ -162,10 +162,8 @@

     list(FIND _input FAIL_ON_WARNINGS _fail_on_warn)
     if("${_fail_on_warn}" GREATER "-1")
-      list(APPEND
-        CPPCHECK_FAIL_REGULAR_EXPRESSION
+      list(APPEND CPPCHECK_FAIL_REGULAR_EXPRESSION
         ${CPPCHECK_WARN_REGULAR_EXPRESSION})
-      list(REMOVE_AT _input ${_unused_func})
     endif()

     list(FIND ARGN EXCLUDE_QT_MOC_FILES _exclude_moc_files)
@@ -187,23 +185,9 @@
       return()
     endif()

-    if("1.${CMAKE_VERSION}" VERSION_LESS "1.2.8.0")
-      # Older than CMake 2.8.0
-      add_test(${_name}_cppcheck_test
-        "${CPPCHECK_EXECUTABLE}"
-        ${CPPCHECK_TEMPLATE_ARG}
-        ${_cppcheck_args}
-        ${_files})
-    else()
-      # CMake 2.8.0 and newer
-      add_test(NAME
-        ${_name}_cppcheck_test
-        COMMAND
-        "${CPPCHECK_EXECUTABLE}"
-        ${CPPCHECK_TEMPLATE_ARG}
-        ${_cppcheck_args}
-        ${_files})
-    endif()
+    add_test(NAME ${_name}_cppcheck_test
+      COMMAND "${CPPCHECK_EXECUTABLE}" ${CPPCHECK_TEMPLATE_ARG}
+      ${_cppcheck_args} ${_files})

     set_tests_properties(${_name}_cppcheck_test
       PROPERTIES


only submit the update results if res is 0

--- test.cmake
+++ test.cmake
@@ -18,7 +18,9 @@
    set(res 0)
    if(NOT $ENV{ctest_model} STREQUAL "Experimental")
       CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
-      ctest_submit(PARTS Update Notes)
+      if(res EQUAL 0)
+         ctest_submit(PARTS Update Notes)
+      endif()
    endif()
    if(NOT $ENV{ctest_model} STREQUAL "Continuous" OR res GREATER 0)
       CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)


ctest: stderr should not get captured into the build name

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

--- test.cmake
+++ test.cmake
@@ -196,7 +196,7 @@
 if(target_architecture)
    set(tmp ${target_architecture})
 else()
-   execute_process(COMMAND cmake -Darch=${arch} -P ${CTEST_SOURCE_DIRECTORY}/print_target_architecture.cmake OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE tmp ERROR_VARIABLE tmp)
+   execute_process(COMMAND cmake -Darch=${arch} -P ${CTEST_SOURCE_DIRECTORY}/print_target_architecture.cmake OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE tmp)
 endif()
 if(build_type STREQUAL "Release")
    set(build_type_short "Rel")


apparently CTestCustom.cmake is not used from ctest - so include it explicitly

--- VCTest.cmake
+++ VCTest.cmake
@@ -5,6 +5,8 @@
 Set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
 Set(CTEST_PROJECT_NAME "VC")
 Set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY_ONCE TRUE)
+
+include(CTestCustom.cmake)

 Set(CTEST_CONFIGURE_COMMAND "${CMAKE_EXECUTABLE_NAME} ${CTEST_SOURCE_DIRECTORY} -DCMAKE_BUILD_TYPE=Release -DBUILD_BENCHMARKS=TRUE -DBUILD_EXAMPLES=TRUE")
 Set(BUILD_COMMAND "make")
@@ -30,7 +32,9 @@
 else($ENV{ctest_model} STREQUAL "Continuous")
    CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
    CTEST_START ($ENV{ctest_model})
-   CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
+   if(NOT $ENV{ctest_model} STREQUAL "Experimental")
+      CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
+   endif(NOT $ENV{ctest_model} STREQUAL "Experimental")
    CTEST_CONFIGURE (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
    CTEST_BUILD (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
    CTEST_TEST (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)


Fixed an miss-match error with build type

Fixed an error that occurred when the expected build type did not match the one that was found.

--- FindTBB.cmake
+++ FindTBB.cmake
@@ -243,15 +243,23 @@
     endif()
   endforeach()

-  set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
-
-  ##################################
-  # Set compile flags
+  ##################################
+  # Set compile flags and libraries
   ##################################

   set(TBB_DEFINITIONS_RELEASE "")
   set(TBB_DEFINITIONS_DEBUG "-DTBB_USE_DEBUG=1")
-  set(TBB_DEFINITIONS "${TBB_DEFINITIONS_${TBB_BUILD_TYPE}}")
+
+  if(TBB_LIBRARIES_${TBB_BUILD_TYPE})
+    set(TBB_DEFINITIONS "${TBB_DEFINITIONS_${TBB_BUILD_TYPE}}")
+    set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
+  elseif(TBB_LIBRARIES_RELEASE)
+    set(TBB_DEFINITIONS "${TBB_DEFINITIONS_RELEASE}")
+    set(TBB_LIBRARIES "${TBB_LIBRARIES_RELEASE}")
+  elseif(TBB_LIBRARIES_DEBUG)
+    set(TBB_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}")
+    set(TBB_LIBRARIES "${TBB_LIBRARIES_DEBUG}")
+  endif()

   find_package_handle_standard_args(TBB
       REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES


New version: 0.3.16

New version: 0.3.16

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "3")
-SET(HAWKEY_PATCH "15")
+SET(HAWKEY_PATCH "16")


Remote auto-config progress: * extend --eq-config with the ability to provide GPU-SD session name   (anything without .eqc ending) * Default --eq-config to 'local' * start implementing remote auto-config ** Discovery functional ** Configuration to be done

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- GPUSD.cmake
+++ GPUSD.cmake
@@ -1,6 +1,6 @@

 if(EXISTS "${CMAKE_SOURCE_DIR}/gpu-sd/CMakeLists.txt")
-  set(FOUND_GPUSD 1)
+  set(GPUSD_FOUND 1)
 endif()

 if(${EQ_REVISION} STREQUAL "")
@@ -16,4 +16,4 @@
   return()
 endif()

-set(FOUND_GPUSD 1)
+set(GPUSD_FOUND 1)


New version: 0.4.18

New version: 0.4.18

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


now putting sourcefiles in groups (filters) on WIN32.

--- WkBuild.cmake
+++ WkBuild.cmake
@@ -321,11 +321,35 @@
 		${${PROJECT_NAME}_${target_name}_SRC_DIR}/*.hh
 		${${PROJECT_NAME}_${target_name}_SRC_DIR}/*.hpp
 	)
+	#putting them in source groups. Very useful for VS.
+	if(WIN32)
+		foreach( header ${${PROJECT_NAME}_${target_name}_HEADERS} )
+			message(${header})
+			get_filename_component(folder ${header} DIRECTORY)
+			message(${folder})
+			string(REPLACE "/" "\\" folder ${folder})
+			message(${folder})
+			SOURCE_GROUP("${folder}" FILES ${header})
+		endforeach(header)
+	endif(WIN32)
+
 	FILE(GLOB_RECURSE ${PROJECT_NAME}_${target_name}_SOURCES RELATIVE "${PROJECT_SOURCE_DIR}"
 		${${PROJECT_NAME}_${target_name}_SRC_DIR}/*.c
 		${${PROJECT_NAME}_${target_name}_SRC_DIR}/*.cpp
 		${${PROJECT_NAME}_${target_name}_SRC_DIR}/*.cc
 	)
+	#putting them in source groups. Very useful for VS.
+	if(WIN32)
+		foreach( source ${${PROJECT_NAME}_${target_name}_SOURCES} )
+			message(${source})
+			get_filename_component(folder ${source} DIRECTORY)
+			message(${folder})
+			string(REPLACE "/" "\\" folder ${folder})
+			message(${folder})
+			SOURCE_GROUP("${folder}" FILES ${source})
+		endforeach(source)
+	endif(WIN32)
+
 	message ( STATUS "== Headers detected in ${${PROJECT_NAME}_INCLUDE_DIR}/${target_name} and ${${PROJECT_NAME}_${target_name}_SRC_DIR} : ${${PROJECT_NAME}_${target_name}_HEADERS}" )
 	message ( STATUS "== Sources detected in ${${PROJECT_NAME}_${target_name}_SRC_DIR} : ${${PROJECT_NAME}_${target_name}_SOURCES}" )


* check: disable check uuid library;

* check: disable check uuid library;

--- check.cmake
+++ check.cmake
@@ -123,5 +123,5 @@
 if (${EFI_ENABLE})
 	set(ENABLE_EFI 1)
 	# check uuid library
-	pkg_check_modules(UUID REQUIRED uuid>=2.25.0)
+	#pkg_check_modules(UUID REQUIRED uuid>=2.25.0)
 endif()


* check: add checking rt library;

* check: add checking rt library;

--- check.cmake
+++ check.cmake
@@ -68,6 +68,12 @@
 	message(FATAL_ERROR "*** Dynamic linking loader library not found ***")
 endif()

+# check rt
+CHECK_LIBRARY_EXISTS(rt mq_open "" RT_FOUND)
+if (NOT RT_FOUND)
+	message(FATAL_ERROR "*** POSIX RT library not found ***")
+endif()
+
 # dependencies
 find_package(PkgConfig REQUIRED)


Support MSVC toolset

Support MSVC toolset

--- conan.cmake
+++ conan.cmake
@@ -1,10 +1,21 @@
 include(CMakeParseArguments)

-function(_get_msvc_version result)
+function(_get_msvc_ide_version result)
     set(${result} "" PARENT_SCOPE)
-    string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
-    list(GET output 0 _msvc_version)
-    set(${result} ${_msvc_version} PARENT_SCOPE)
+    if (CMAKE_VS_PLATFORM_TOOLSET)
+        string(REGEX MATCHALL "[0-9]+" output "${CMAKE_VS_PLATFORM_TOOLSET}")
+        list(GET output 0 _toolset_version)
+        if ("${_toolset_version}" EQUAL "141")
+            set(_msvc_version "15")
+        else()
+            string(SUBSTRING ${_toolset_version} 0 2 _msvc_version)
+        endif()
+        set(${result} ${_msvc_version} PARENT_SCOPE)
+    else()
+        string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
+        list(GET output 0 _msvc_version)
+        set(${result} ${_msvc_version} PARENT_SCOPE)
+    endif()
 endfunction()

 function(conan_cmake_settings result)
@@ -70,7 +81,7 @@
       set(_SETTINGS ${_SETTINGS} -s compiler=clang -s compiler.version=${MAJOR}.${MINOR} -s compiler.libcxx=libstdc++)
   elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
       set(_VISUAL "Visual Studio")
-      _get_msvc_version(_VISUAL_VERSION)
+      _get_msvc_ide_version(_VISUAL_VERSION)
       if("${_VISUAL_VERSION}" STREQUAL "")
           message(FATAL_ERROR "Visual Studio not recognized")
       else()


improved FindVigra.cmake

improved FindVigra.cmake

--- cmake_extensions/FindVIGRA.cmake
+++ cmake_extensions/FindVIGRA.cmake
@@ -13,7 +13,10 @@
 GET_FILENAME_COMPONENT(VIGRA_IMPEX_LIBRARY_PATH ${VIGRA_IMPEX_LIBRARY} PATH)
 SET( VIGRA_IMPEX_LIBRARY_DIR ${VIGRA_IMPEX_LIBRARY_PATH} CACHE PATH "Path to Vigra impex library.")

-FIND_FILE(VIGRA_NUMPY_CORE_LIBRARY vigranumpycore.so PATHS ENV PYTHONPATH PATH_SUFFIXES vigra)
+EXECUTE_PROCESS ( COMMAND python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()" OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
+MESSAGE(${PYTHON_SITE_PACKAGES})
+FIND_FILE(VIGRA_NUMPY_CORE_LIBRARY vigranumpycore.so PATHS ${PYTHON_SITE_PACKAGES} ENV PYTHONPATH PATH_SUFFIXES vigra)
+

 # handle the QUIETLY and REQUIRED arguments and set VIGRA_FOUND to TRUE if
 # all listed variables are TRUE


ctest: skip GCC 4.7.x because of incomplete C++11

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

--- test.cmake
+++ test.cmake
@@ -221,7 +221,7 @@
       endif()
    endif()
    if(NOT ${dashboard_model} STREQUAL "Continuous" OR res GREATER 0)
-      if("${COMPILER_VERSION}" MATCHES "(g\\+\\+|GCC|Open64).*4\\.[0123456]\\.")
+      if("${COMPILER_VERSION}" MATCHES "(g\\+\\+|GCC|Open64).*4\\.[01234567]\\.")
          file(WRITE "${CTEST_BINARY_DIRECTORY}/abort_reason" "Compiler too old for C++11: ${COMPILER_VERSION}")
          list(APPEND CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/abort_reason")
          ctest_submit(PARTS Notes)


correctly determine mingw environment if CXX is not set

--- test.cmake
+++ test.cmake
@@ -63,13 +63,20 @@
       math(EXPR number_of_processors "1 + ${number_of_processors}")
    endif()
 elseif(arch MATCHES "mingw")
+   find_program(CL cl)
+   find_program(GXX "g++")
    if("$ENV{CXX}" MATCHES "g\\+\\+")
-      execute_process(COMMAND "$ENV{CXX}" --version OUTPUT_VARIABLE COMPILER_VERSION ERROR_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+      set(GXX "$ENV{CXX}")
+   endif()
+   if(GXX)
+      execute_process(COMMAND "${GXX}" --version OUTPUT_VARIABLE COMPILER_VERSION ERROR_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
       string(REPLACE "\n" ";" COMPILER_VERSION "${COMPILER_VERSION}")
       list(GET COMPILER_VERSION 0 COMPILER_VERSION)
-   else()
-      execute_process(COMMAND cl /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
+   elseif(CL)
+      execute_process(COMMAND ${CL} /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
       string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
+   else()
+      message(FATAL_ERROR "unknown compiler")
    endif()
    execute_process(COMMAND reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor" COMMAND grep -c CentralProcessor OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
 else()


build: Use absolute shared library paths for Boost

When Boost is compiled locally as part of a development environment, we
want to ensure that all shared libraries reference their dependencies on
other Boost shared libraries with absolute paths in the build tree. This
is because run-time dependencies of the libraries when linked to
executables need to reflect the local Boost and not the system-installed
one.

--- recipe/dev.cmake
+++ recipe/dev.cmake
@@ -151,7 +151,9 @@
       install
       variant=debug
       link=shared
-      threading=multi)
+      threading=multi
+      hardcode-dll-paths=true
+      dll-path=<INSTALL_DIR>/lib)

 cooking_ingredient (GnuTLS
   REQUIRES


Add support for Intel compiler

Add support for Intel compiler

--- cmake/DevBaseCompiler.cmake
+++ cmake/DevBaseCompiler.cmake
@@ -162,11 +162,11 @@
     # If the PEACOCK_PREFIX CMake variable is not set, but an environment
     # variable with that name is, then copy it to a CMake variable. This way
     # the CMake variable takes precedence.
-    if((NOT PEACOCK_PREFIX) AND (DEFINED ENV{PEACOCK_PREFIX}))
+    if((NOT DEFINED PEACOCK_PREFIX) AND (DEFINED ENV{PEACOCK_PREFIX}))
         set(PEACOCK_PREFIX $ENV{PEACOCK_PREFIX})
     endif()

-    if(PEACOCK_PREFIX)
+    if((DEFINED PEACOCK_PREFIX) AND PEACOCK_PREFIX)
         # PEACOCK_PREFIX takes precedence over all other paths.

         # # if cross compiling:


[cmake] propagate radium conf to sub process.

--- cmake/ExternalInclude.cmake
+++ cmake/ExternalInclude.cmake
@@ -9,13 +9,20 @@
 get_directory_property(EXTERNAL_FLAGS COMPILE_OPTIONS)
 set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTERNAL_FLAGS}")

+#if we are in a radium process, use radium specific option, else use cmake option.
+if(RADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE)
+    set(EXTERNAL_INSTALL_MESSAGE ${RADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE})
+else()
+    set(EXTERNAL_INSTALL_MESSAGE ${CMAKE_INSTALL_MESSAGE})
+endif()
+
 set(RADIUM_EXTERNAL_CMAKE_OPTIONS
     -DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}
     -DCMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}
     -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
     -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
     -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-    -DCMAKE_INSTALL_MESSAGE=${RADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE}
+    -DCMAKE_INSTALL_MESSAGE=${EXTERNAL_INSTALL_MESSAGE}
     -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
     -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
     -DCMAKE_CXX_FLAGS=${EXTERNAL_CMAKE_CXX_FLAGS}


dont allow cmake to find the wrong Version.h

--- cmake/Modules/FindTAO.cmake
+++ cmake/Modules/FindTAO.cmake
@@ -158,6 +158,7 @@
     PATHS ${TAO_INCLUDE_DIR}
     PATH_SUFFIXES tao
     DOC "TAO version file"
+    NO_DEFAULT_PATH
   )
   message( STATUS "TAO_VERSION_HEADER ${TAO_VERSION_HEADER}")
   if( EXISTS ${TAO_VERSION_HEADER} )


update mkldnn to 0.17.2 (#231)

update mkldnn to 0.17.2 (#231)

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -2,7 +2,7 @@

 set(MKLDNN_URL https://github.com/intel/mkl-dnn.git)
 # If MKLDNN_TAG is updated, check if MKLML_VERSION and platform.cmake.patch need to be updated.
-set(MKLDNN_TAG v0.17.1)
+set(MKLDNN_TAG v0.17.2)
 set(MKLML_VERSION 2019.0.1.20180928)

 if(WIN32)


Fix cmake/hnc_os_x-config.cmake

Fix cmake/hnc_os_x-config.cmake

--- cmake/hnc_os_x-config.cmake
+++ cmake/hnc_os_x-config.cmake
@@ -19,7 +19,7 @@
 # HNC_OS_X_MACRO - Macro to define

-set(HNC_UNIX_MACRO "hnc_os_x")
+set(HNC_OS_X_MACRO "hnc_os_x")

 if (APPLE AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")


find_path looks in /usr/local/include before /usr/include to be consistent
with the remainder of our find_path usage.

svn path=/trunk/; revision=8305

--- cmake/modules/FindAGG.cmake
+++ cmake/modules/FindAGG.cmake
@@ -27,8 +27,8 @@

   FIND_PATH(AGG_INCLUDE_DIR agg2/agg_pixfmt_gray.h
     ${_AGGIncDir}
+    /usr/local/include
     /usr/include
-    /usr/local/include
   )

   # Prefer _pic variant of library name for shared libraries case, and


precache some more system checks on Windows

--- cmake/os/WindowsCache.cmake
+++ cmake/os/WindowsCache.cmake
@@ -360,4 +360,6 @@
 SET(HAVE_PTHREAD_RWLOCKATTR_SETKIND_NP CACHE INTERNAL "")
 SET(HAVE_SOCKADDR_IN_SIN_LEN CACHE INTERNAL "")
 SET(HAVE_SOCKADDR_IN6_SIN6_LEN CACHE INTERNAL "")
+SET(HAVE_VALGRIND CACHE INTERNAL "")
+SET(HAVE_EVENT_H CACHE INTERNAL "")
 ENDIF()


add include

add include

--- cmaki.cmake
+++ cmaki.cmake
@@ -15,6 +15,7 @@
 		conan_basic_setup()
 	endif()
 	include_directories(.)
+	include_directories(..)
 	include_directories(node_modules)
 endmacro()


* check: add checking bash-completion module;

--- check.cmake
+++ check.cmake
@@ -86,6 +86,9 @@
 # dependencies
 find_package(PkgConfig REQUIRED)

+# check bash-completion
+pkg_check_modules(BASH_COMPL bash-completion)
+
 # check libudev
 pkg_check_modules(LIBUDEV libudev)


[WIP] Refactoring ManageReleaseOnFedora

[WIP] Refactoring ManageReleaseOnFedora

--- Modules/ManageReleaseOnFedora.cmake
+++ Modules/ManageReleaseOnFedora.cmake
@@ -15,7 +15,7 @@
 #   FEDORA_RAWHIDE_TAG: Koji tags for rawhide
 #   FEDORA_CURRENT_RELEASE_TAGS: Current tags of fedora releases.
 # Defines following macros:
-#   RELEASE_ON_FEDORA(srpm [NORAWHIDE] [tag1 [tag2 ...])
+#   RELEASE_ON_FEDORA(srpm [NORAWHIDE] [TAGS [tag1 [tag2 ...]])
 #   - This call USE_FEDPKG and USE_BODHI and set the corresponding
 #     dependencies. This macro is recommended than calling USE_FEDPKG and
 #     USE_BODHI directly.
@@ -24,7 +24,7 @@
 #       such as making source file tarballs, source rpms, build with fedpkg
 #       and upload to bodhi.
 #
-#   USE_FEDPKG(srpm [NORAWHIDE] [NOKOJI_SCRATCH_BUILD] [tag1 [tag2 ...])
+#   USE_FEDPKG(srpm [NORAWHIDE] [NOKOJI_SCRATCH_BUILD] [TAGS [tag1 [tag2 ...]])
 #   - Use fedpkg targets if ~/.fedora-upload-ca.cert exists.
 #     If ~/.fedora-upload-ca.cert does not exists, this marcos run as an empty
 #     macro.
@@ -48,6 +48,7 @@
 #     + fedpkg_build: Perform build with fedpkg.
 #     + fedpkg_update: Update with fedpkg.
 #     + koji_scratch_build: Sent srpm to Koji for scratch build
+#
 #   USE_BODHI([TAGS [tag1 [tag2 ...]] [KARMA karmaValue] )
 #   - Use bodhi targets with bodhi command line client.
 #     Argument:
@@ -70,11 +71,18 @@
     SET(FEDORA_CURRENT_RELEASE_TAGS f15 f14)
     SET(FEDORA_EPEL_RELEASE_TAGS el6 el5)
     SET(FEDORA_RAWHIDE_TAG f16)
-    IF(NOT DEFINED FEDPKG_DIR)
-	SET(FEDPKG_DIR "FedPkg")
-    ELSEIF (FEDPKG_DIR STREQUAL "")
+    IF("${FEDPKG_DIR}" STREQUAL "")
 	SET(FEDPKG_DIR "FedPkg")
     ENDIF(NOT DEFINED FEDPKG_DIR)
+
+    IF(NOT DEFINED FEDORA_KOJI_TAG_POSTFIX_PREFERRED)
+	SET(FEDORA_KOJI_TAG_POSTFIX "")
+    ENDIF(NOT DEFINED FEDORA_KOJI_TAG_POSTFIX)
+
+    IF(NOT DEFINED EPEL_KOJI_TAG_POSTFIX)
+	SET(EPEL_KOJI_TAG_POSTFIX "-testing-candidate")
+    ENDIF(NOT DEFINED EPEL_KOJI_TAG_POSTFIX)
+
     SET(_bodhi_template_file "bodhi.NO_PACK.template")
     SET(PACK_SOURCE_IGNORE_FILES ${PACK_SOURCE_IGNORE_FILES} "/${FEDPKG_DIR}/")

@@ -82,51 +90,116 @@
     INCLUDE(ManageSourceVersionControl)
     INCLUDE(ManageMessage)

-    MACRO(_use_koji_make_targets srpm)
-	SET(_tags ${ARGN})
-	#commit
-	IF(DEFINED CHANGE_SUMMARY)
-	    SET (COMMIT_MSG  "-m \"${CHANGE_SUMMARY}\"")
-	ELSE(DEFINED CHANGE_SUMMARY)
-	    SET (COMMIT_MSG  "")
-	ENDIF(DEFINED CHANGE_SUMMARY)
-	SET(_first_branch "")
-	FOREACH(_tag ${_tags})
-	    SET(_branch ${_tag})
-	    IF(_tag MATCHES "^el")
-		STRING(REGEX REPLACE "el\([0-9]+\)"
-		    "\\1E-epel-testing-candidate"  _branch
-		    "${_tag}")
-	    ENDIF(_tag MATCHES "^el")
-
-	    ADD_CUSTOM_TARGET(koji_scratch_build_${_tag}
-		COMMAND ${KOJI} build --scratch dist-${_branch} ${srpm}
-		DEPENDS ${srpm}
-		COMMENT "koji scratch build on ${_tag} with ${srpm}"
-		)
-
-	    SET_TARGET_PROPERTIES(koji_scratch_build_${_tag}
-		PROPERTIES EXISTS "true")
-	    ADD_DEPENDENCIES(koji_scratch_build_${_tag} rpmlint)
-	    ADD_DEPENDENCIES(koji_scratch_build koji_scratch_build_${_tag})
-	ENDFOREACH(_tag ${_tags})
-    ENDMACRO(_use_koji_make_targets srpm)
+    SET(_FEDORA_DIST_TAGS "")
+
+    MACRO(_manange_release_on_fedora_dist_convert_to_koji_target
+	    var dist)
+	IF(dist MATCHES "^el")
+	    STRING(REGEX REPLACE "el\([0-9]+\)"
+		"dist-\\1E-epel${EPEL_KOJI_TAG_POSTFIX}" ${var}  "${dist}")
+	ELSE(dist MATCHES "^el")
+	    # Fedora dists
+	    STRING(REGEX REPLACE "f[c-]\([0-9]+\)" _relver "${dist}")
+	    IF(_relver GREATER 15)
+		SET(${var} "f${_relver}${FEDORA_KOJI_TAG_POSTFIX}")
+	    ELSE(_relver GREATER 15)
+		SET(${var} "dist-f${_relver}${FEDORA_KOJI_TAG_POSTFIX}")
+	    ENDIF(_relver GREATER 15)
+
+	ENDIF(dist MATCHES "^el")
+    ENDMACRO(_manange_release_on_fedora_dist_convert_to_koji_target
+	kojiTarget dist)
+
+    MACRO(_manange_release_on_fedora_parse_args)
+	SET(_FEDORA_RAWHIDE 1)
+	SET(_FEDORA_DIST_TAGS "")
+	SET(_stage "")
+	FOREACH(_arg ${ARGN})
+	    IF ("${_arg}" STREQUAL "NORAWHIDE")
+		SET(_FEDORA_RAWHIDE 0)
+	    ELSEIF("${_arg}" STREQUAL "NOKOJI_SCRATCH_BUILD")
+		SET(_FEDORA_KOJI_SCRATCH 0)
+	    ELSEIF("${_arg}" STREQUAL "TAGS")
+		# No need to further parsing TAGS, as FEDORA_RELEASE_TAGS
+		# override whatever specified after TAGS
+		IF(NOT FEDORA_RELEASE_TAGS STREQUAL "")
+		    BREAK()
+		ENDIF(NOT FEDORA_RELEASE_TAGS STREQUAL "")
+		SET(_stage "TAGS")
+	    ELSE("${_arg}" STREQUAL "NORAWHIDE")
+		IF(_stage STREQUAL "TAGS")
+		    LIST(APPEND _FEDORA_DIST_TAGS ${_arg})
+		ELSE(_stage STREQUAL "TAGS")
+		    SET(_FEDORA_SRPM ${_arg})
+		ENDIF(_stage STREQUAL "TAGS")
+   	    ENDIF("${_arg}" STREQUAL "NORAWHIDE")
+	ENDFOREACH(_arg ${ARGN})
+	IF(NOT FEDORA_RELEASE_TAGS STREQUAL "")
+	    LIST(APPEND _FEDORA_DIST_TAGS ${FEDORA_RELEASE_TAGS})
+	ELSEIF(_FEDORA_DIST_TAGS STREQUAL "")
+	    LIST(APPEND _FEDORA_DIST_TAGS ${FEDORA_CURRENT_RELEASE_TAGS})
+	ENDIF(NOT FEDORA_RELEASE_TAGS STREQUAL "")
+
+	IF(_FEDORA_RAWHIDE EQUAL 1)
+	    LIST(INSERT ${_tags} 0 ${FEDORA_RAWHIDE_TAG})
+	ENDIF(_FEDORA_RAWHIDE EQUAL 1)
+	LIST(REMOVE_DUPLICATES ${_FEDORA_DIST_TAGS})
+
+	MESSAGE("_FEDORA_RAWHIDE=${_FEDORA_RAWHIDE}")
+	MESSAGE("_FEDORA_KOJI_SCRATCH=${_FEDORA_KOJI_SCRATCH}")
+	MESSAGE("_FEDORA_DIST_TAGS=${_FEDORA_DIST_TAGS}")
+    ENDMACRO(_manange_release_on_fedora_parse_args)
+
+    MACRO(USE_KOJI srpm)
+	SET(_dependencies_missing 0)
+	FIND_PROGRAM(KOJI koji)
+	IF(KOJI STREQUAL "KOJI-NOTFOUND")
+	    M_MSG(${M_OFF} "Program koji is not found! Koji support disabled.")
+	    SET(_dependencies_missing 1)
+	ENDIF(KOJI STREQUAL "KOJI-NOTFOUND")
+
+	IF(_dependencies_missing EQUAL 0)
+	    IF(_FEDORA_DIST_TAGS STREQUAL "")
+		_manange_release_on_fedora_parse_args(${ARGN})
+	    ENDIF(_FEDORA_DIST_TAGS STREQUAL "")
+
+	    IF(_FEDORA_KOJI_SCRATCH EQUAL 1)
+		ADD_CUSTOM_TARGET(koji_scratch_build
+		    COMMENT "koji scratch builds"
+		    )
+
+		# Ensure package build in koji before tag
+		ADD_DEPENDENCIES(tag koji_scratch_build)
+	    ENDIF(_FEDORA_KOJI_SCRATCH EQUAL 1)
+
+	    FOREACH(_tag ${_FEDORA_DIST_TAGS})
+		_manange_release_on_fedora_dist_convert_to_koji_target(_branch ${_tag})
+		IF(_FEDORA_KOJI_SCRATCH EQUAL 1)
+		    ADD_CUSTOM_TARGET(koji_scratch_build_${_tag}
+			COMMAND ${KOJI} build --scratch dist-${_branch} ${srpm}
+			COMMENT "koji scratch build on ${_tag} with ${srpm}"
+			)
+		    ADD_DEPENDENCIES(koji_scratch_build_${_tag} rpmlint)
+		    ADD_DEPENDENCIES(koji_scratch_build koji_scratch_build_${_tag})
+		ENDIF(_FEDORA_KOJI_SCRATCH EQUAL 1)
+	    ENDFOREACH(_tag ${_FEDORA_DIST_TAGS})
+	ENDIF(_dependencies_missing EQUAL 0)
+    ENDMACRO(USE_KOJI srpm)

     MACRO(_use_fedpkg_make_targets srpm)
-	SET(_tags ${ARGN})
-	#MESSAGE("_tags=${_tags}")
-	#commit
+	#MESSAGE("_FEDORA_DIST_TAGS=${_FEDORA_DIST_TAGS}")
+	#Commit summary
 	IF (DEFINED CHANGE_SUMMARY)
 	    SET (COMMIT_MSG  "-m \"${CHANGE_SUMMARY}\"")
 	ELSE(DEFINED CHANGE_SUMMARY)
 	    SET (COMMIT_MSG  "")
 	ENDIF(DEFINED CHANGE_SUMMARY)
-	SET(_first_branch "")
+
 	ADD_CUSTOM_TARGET(fedpkg_scratch_build
 	    COMMENT "fedpkg scratch build"
 	    )
-	ADD_CUSTOM_TARGET(fedpkg_commit
-	    COMMENT "fedpkg commit"
+	ADD_CUSTOM_TARGET(fedpkg_import
+	    COMMENT "fedpkg import"
 	    )
 	ADD_CUSTOM_TARGET(fedpkg_build
 	    COMMENT "fedpkg build"
@@ -137,74 +210,73 @@
 	    COMMENT "fedpkg update"
 	    )

-	## Know the tag file path
-	LIST(GET _tags 0 _first_tag)
-	# bodhi tags is used as tag file name
-	_use_bodhi_convert_tag(_first_bodhi_tag ${_first_tag})
-	SET(_first_tag_name ${PROJECT_NAME}-${PRJ_VER}-${PRJ_RELEASE_NO}.${_first_bodhi_tag})
-	SET(_first_tag_relative_path  .git/refs/tags/${_first_tag_name})
-	SET(_first_tag_path  ${FEDPKG_DIR}/${PROJECT_NAME}/${_first_tag_relative_path})
-	# MESSAGE("_first_tag_path=${_first_tag_path}")
-
-	FOREACH(_tag ${_tags})
+	SET(_fedpkg_tag_path_abs_prefix
+	    "${FEDPKG_WORKDIR}/.git/refs/tags")
+	FOREACH(_tag ${_FEDORA_DIST_TAGS})
 	    IF(_tag STREQUAL "${FEDORA_RAWHIDE_TAG}")
 		SET(_branch "master")
 	    ELSE(_tag STREQUAL "${FEDORA_RAWHIDE_TAG}")
 		SET(_branch "${_tag}")
 	    ENDIF(_tag STREQUAL "${FEDORA_RAWHIDE_TAG}")
+	    SET(_fedpkg_tag_name_prefix "${PRJ_VER}-${PRJ_RELEASE_NO}.${_tag}")

 	    ADD_CUSTOM_TARGET(fedpkg_scratch_build_${_tag}
 		COMMAND ${FEDPKG} scratch-build --srpm ${srpm}
 		DEPENDS ${srpm}
-		WORKING_DIRECTORY ${FEDPKG_DIR}/${PROJECT_NAME}
+		WORKING_DIRECTORY ${FEDPKG_WORKDIR}
 		COMMENT "fedpkg scratch build on ${_branch} with ${srpm}"
 		)
 	    ADD_DEPENDENCIES(fedpkg_scratch_build_${_tag} rpmlint)
-	    ADD_DEPENDENCIES(fedpkg_scratch_build_${_tag} fedpkg_git_pull_${_tag})
 	    ADD_DEPENDENCIES(fedpkg_scratch_build fedpkg_scratch_build_${_tag})

-	    ## fedpkg commit
-	    IF(_first_branch STREQUAL "")
-		SET(_first_branch ${_branch})
-
-		# import primary branch
-		SET(_fedpkg_import_cmd "${FEDPKG} switch-branch ${_branch}"
-		    "git-pull"
-		    "if [ ! -e ${_first_tag_relative_path} ]"
-		    "then ${FEDPKG} import  ${srpm}"
-		    "${FEDPKG} commit -m 'Release version ${PRJ_VER}'"
-		    "git tag -a -m 'Release version ${PRJ_VER}' ${_first_tag_name}"
-		    "${FEDPKG} push"
-		    "fi")
-
-		ADD_CUSTOM_COMMAND(OUTPUT ${_first_tag_path}
-		    COMMAND eval "${_fedpkg_import_cmd}"
-		    WORKING_DIRECTORY ${FEDPKG_DIR}/${PROJECT_NAME}
-		    DEPENDS ${_MANAGE_SOURCE_VERSION_CONTROL_TAG_FILE}
-		    COMMENT "fedpkg import on ${_branch} with ${srpm}"
-		    VERBATIM
-		    )
-
-
-		ADD_CUSTOM_TARGET(fedpkg_commit_${_tag}
-		    DEPENDS ${_first_tag_path}
-		    COMMENT "fedpkg commit on ${_branch} with ${srpm}"
-		    )
-
-	    ELSE(_first_branch STREQUAL "")
-		ADD_CUSTOM_TARGET(fedpkg_commit_${_tag}
-		    COMMAND ${FEDPKG} switch-branch ${_branch}
-		    COMMAND git pull
-		    COMMAND git merge ${_first_branch}
-		    COMMAND ${FEDPKG} push
-		    DEPENDS ${_first_tag_path}
-		    WORKING_DIRECTORY ${FEDPKG_DIR}/${PROJECT_NAME}
-		    COMMENT "fedpkg commit on ${_branch} with ${srpm}"
-		    )
-
-		ADD_DEPENDENCIES(fedpkg_commit_${_tag} fedpkg_commit_${_first_tag})
-	    ENDIF(_first_branch STREQUAL "")
-	    GET_TARGET_PROPERTY(_target_exists koji_scratch_build_${_tag} EXISTS)
+	    ## fedpkg import
+	    SET(_import_opt "")
+	    IF(NOT ${_tag} STREQUAL ${FEDORA_RAWHIDE_TAG})
+		SET(_import_opt "-b ${_tag}")
+	    ENDIF(NOT ${_tag} STREQUAL ${FEDORA_RAWHIDE_TAG})
+
+	    SET(_fedpkg_tag_name_imported
+		"${_fedpkg_tag_name_prefix}.imported")
+	    ADD_CUSTOM_COMMAND(OUTPUT
+		${_fedpkg_tag_path_abs_prefix}/${_fedpkg_tag_name_imported}
+		COMMAND ${FEDPKG} ${_import_opt} import ${srpm}
+		COMMAND ${FEDPKG} switch-branch ${_branch}
+		COMMAND git tag -a -m "${PRJ_VER}-${PRJ_RELEASE_NO}.${_tag} imported"
+		${_fedpkg_tag_name_imported}
+		COMMAND git push --tags
+		WORKING_DIRECTORY ${FEDPKG_WORKDIR}
+		COMMENT "fedpkg import on ${_branch} with ${srpm}"
+		VERBATIM
+	    )
+
+	    ADD_CUSTOM_TARGET(fedpkg_import_${_tag}
+		DEPENDS ${_fedpkg_tag_path_abs_prefix}/${_fedpkg_tag_name_imported}
+		)
+	    ADD_DEPENDENCIES(fedpkg_import_${_tags} tag)
+	    ADD_DEPENDENCIES(fedpkg_import fedpkg_import_${_tags})
+
+	    ## fedpkg build
+	    SET(_fedpkg_tag_name_built
+		"${_fedpkg_tag_name_prefix}.built")
+	    ADD_CUSTOM_COMMAND(OUTPUT
+		${_fedpkg_tag_path_abs_prefix}/${_fedpkg_tag_name_built}
+		COMMAND ${FEDPKG} switch-branch ${_branch}
+		COMMAND ${FEDPKG} build
+		COMMAND git tag -a -m "${PRJ_VER}-${PRJ_RELEASE_NO}.${_tag} built"
+		${_fedpkg_tag_name_built}
+		COMMAND git push --tags
+		WORKING_DIRECTORY ${FEDPKG_WORKDIR}
+		COMMENT "fedpkg build on ${_branch}"
+		VERBATIM
+		)
+
+	    ADD_CUSTOM_TARGET(fedpkg_build_${_tag}
+		DEPENDS ${_fedpkg_tag_path_abs_prefix}/${_fedpkg_tag_name_built}
+		)
+
+	    ADD_DEPENDENCIES(fedpkg_build_${_tags} fedpkg_import_${_tag})
+	    ADD_DEPENDENCIES(fedpkg_build fedpkg_build_${_tags})
+
 	    IF("${_target_exists}" STREQUAL "true")
 		# Since tag depends on koji_scratch_build_ ${_tag}
 		# fedpkg_commit depends on tag should be sufficient.
@@ -230,86 +302,48 @@
 		)
 	    ADD_DEPENDENCIES(fedpkg_update_${_tag} fedpkg_build_${_tag})
 	    ADD_DEPENDENCIES(fedpkg_update fedpkg_update_${_tag})
-	ENDFOREACH(_tag ${_tags})
+	ENDFOREACH(_tag ${_FEDORA_DIST_TAGS})
     ENDMACRO(_use_fedpkg_make_targets srpm)

     MACRO(USE_FEDPKG srpm)
-	SET(_disabled 0)
-	IF(EXISTS $ENV{HOME}/.fedora-upload-ca.cert)
-	    FIND_PROGRAM(FEDPKG fedpkg)
-	    IF(FEDPKG STREQUAL "FEDPKG-NOTFOUND")
-		M_MSG(${M_OFF} "Program fedpkg is not found! fedpkg support disabled.")
-		SET(_disabled 1)
-	    ENDIF(FEDPKG STREQUAL "FEDPKG-NOTFOUND")
-	ELSE(EXISTS $ENV{HOME}/.fedora-upload-ca.cert)
+	SET(_dependencies_missing 0)
+
+	IF(NOT EXISTS $ENV{HOME}/.fedora-upload-ca.cert)
 	    M_MSG(${M_OFF}
 		"\$HOME/.fedora-upload-ca.cert not found, fedpkg support disabled")
-	    SET(_disabled 1)
-	ENDIF(EXISTS $ENV{HOME}/.fedora-upload-ca.cert)
-
-	IF(_disabled EQUAL 0)
-	    SET(_rawhide 1)
-	    SET(_koji_dist_tags "")
-	    SET(_stage "")
-	    SET(_no_koji_scratch_build 0)
-
-	    FOREACH(_arg ${ARGN})
-		IF ("${_arg}" STREQUAL "NORAWHIDE")
-		    SET(_rawhide 0)
-		ELSEIF("${_arg}" STREQUAL "NOKOJI_SCRATCH_BUILD")
-		    SET(_no_koji_scratch_build 1)
-		ELSEIF("${_arg}" STREQUAL "TAGS")
-		    SET(_stage "TAGS")
-		ELSE("${_arg}" STREQUAL "NORAWHIDE")
-		    IF(_stage STREQUAL "TAGS")
-			LIST(APPEND _koji_dist_tags ${_arg})
-		    ENDIF(_stage STREQUAL "TAGS")
-		ENDIF("${_arg}" STREQUAL "NORAWHIDE")
-	    ENDFOREACH(_arg)
-
-	    # Koji targets
-	    IF("${_koji_dist_tags}" STREQUAL "")
-		SET(_koji_dist_tags ${FEDORA_CURRENT_RELEASE_TAGS})
-	    ENDIF("${_koji_dist_tags}" STREQUAL "")
-	    IF(_rawhide EQUAL 1)
-		LIST(INSERT _koji_dist_tags 0 ${FEDORA_RAWHIDE_TAG})
-	    ENDIF(_rawhide EQUAL 1)
-	    LIST(REMOVE_DUPLICATES _koji_dist_tags)
-	    #MESSAGE("_koji_dist_tags=${_koji_dist_tags}")
-
-	    IF(_no_koji_scratch_build EQUAL 0)
-		FIND_PROGRAM(KOJI koji)
-		IF(KOJI STREQUAL "KOJI-NOTFOUND")
-		    M_MSG(${M_OFF} "Program koji is not found! Koji support disabled.")
-		ELSE(KOJI STREQUAL "KOJI-NOTFOUND")
-		    ## Make target commands for the released dist
-		    ADD_CUSTOM_TARGET(koji_scratch_build
-			COMMENT "Koji scratch build"
-			)
-		    _use_koji_make_targets("${srpm}" ${_koji_dist_tags})
-
-		    # Ensure package build in koji before tag
-		    ADD_DEPENDENCIES(tag koji_scratch_build)
-		ENDIF(KOJI STREQUAL "KOJI-NOTFOUND")
-	    ENDIF(_no_koji_scratch_build EQUAL 0)
-
-	    ADD_CUSTOM_COMMAND(OUTPUT ${FEDPKG_DIR}
-		COMMAND mkdir -p ${FEDPKG_DIR}
+	    SET(_dependencies_missing 1)
+	ENDIF(NOT EXISTS $ENV{HOME}/.fedora-upload-ca.cert)
+
+	FIND_PROGRAM(FEDPKG fedpkg)
+	IF(FEDPKG STREQUAL "FEDPKG-NOTFOUND")
+	    M_MSG(${M_OFF} "Program fedpkg is not found! fedpkg support disabled.")
+	    SET(_dependencies_missing 1)
+	ENDIF(FEDPKG STREQUAL "FEDPKG-NOTFOUND")
+
+	IF(_dependencies_missing EQUAL 0)
+	    IF(_FEDORA_DIST_TAGS STREQUAL "")
+		_manange_release_on_fedora_parse_args(${ARGN})
+	    ENDIF(_FEDORA_DIST_TAGS STREQUAL "")
+
+	    SET(FEDPKG_DIR_ABS ${CMAKE_BINARY_DIR}/${FEDPKG_DIR})
+	    SET(FEDPKG_WORKDIR ${FEDPKG_DIR_ABS}/${PROJECT_NAME})
+	    ADD_CUSTOM_COMMAND(OUTPUT ${FEDPKG_DIR_ABS}
+		COMMAND mkdir -p ${FEDPKG_DIR_ABS}
 		)

 	    ADD_CUSTOM_TARGET(fedpkg_clone
-		DEPENDS ${FEDPKG_DIR}/${PROJECT_NAME}
-		)
-
-	    ADD_CUSTOM_COMMAND(OUTPUT ${FEDPKG_DIR}/${PROJECT_NAME}
+		DEPENDS ${FEDPKG_WORKDIR}
+		)
+
+	    ADD_CUSTOM_COMMAND(OUTPUT $${FEDPKG_WORKDIR}
 		COMMAND ${FEDPKG} clone ${PROJECT_NAME}
-		DEPENDS ${FEDPKG_DIR}
-		WORKING_DIRECTORY ${FEDPKG_DIR}
+		DEPENDS ${FEDPKG_DIR_ABS}
+		WORKING_DIRECTORY ${FEDPKG_DIR_ABS}
 		)

 	    ## Make target commands for the released dist
-	    _use_fedpkg_make_targets("${srpm}" ${_koji_dist_tags})
-	ENDIF(_disabled EQUAL 0)
+	    _use_fedpkg_make_targets("${srpm}")
+	ENDIF(_dependencies_missing EQUAL 0)
     ENDMACRO(USE_FEDPKG srpm)

     MACRO(_use_bodhi_convert_tag tag_out tag_in)


Add additional library search paths for older versions of MKL

--- modules/FindMKL.cmake
+++ modules/FindMKL.cmake
@@ -289,9 +289,9 @@
           "${CMAKE_BINARY_DIR}"
           "${CMAKE_CURRENT_LIST_DIR}/arch/test_is_64bit.c")
   if (_MKL_IS_64BIT)
-    list(APPEND _MKL_LIBRARY_SEARCH_DIRS "${MKL_INCLUDE_DIR}/../lib/intel64")
-  else()
-    list(APPEND _MKL_LIBRARY_SEARCH_DIRS "${MKL_INCLUDE_DIR}/../lib/ia32")
+    list(APPEND _MKL_LIBRARY_SEARCH_DIRS "${MKL_INCLUDE_DIR}/../lib/intel64;${MKL_INCLUDE_DIR}/../../compiler/lib/intel64;${MKL_INCLUDE_DIR}/../../tbb/lib/intel64")
+  else()
+    list(APPEND _MKL_LIBRARY_SEARCH_DIRS "${MKL_INCLUDE_DIR}/../lib/ia32;${MKL_INCLUDE_DIR}/../../compiler/lib/ia32;${MKL_INCLUDE_DIR}/../../tbb/lib/intel64")
   endif()

   set(MKL_LIBRARIES "")


update supported os

update supported os

--- conan.cmake
+++ conan.cmake
@@ -103,7 +103,10 @@
         if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
             set(CONAN_SYSTEM_NAME Macos)
         endif()
-        set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD WindowsStore)
+        if(${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
+            set(CONAN_SYSTEM_NAME Neutrino)
+        endif()
+        set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD WindowsStore WindowsCE watchOS tvOS FreeBSD SunOS AIX Arduino Emscripten Neutrino)
         list (FIND CONAN_SUPPORTED_PLATFORMS "${CONAN_SYSTEM_NAME}" _index)
         if (${_index} GREATER -1)
             #check if the cmake system is a conan supported one


don't forget to find python

don't forget to find python

--- kitchen/kitchen.cmake
+++ kitchen/kitchen.cmake
@@ -1,6 +1,9 @@
 #
 # The ecto kitchen macro
 #
+
+find_package(PythonInterp)
+
 macro(init_ecto_kitchen)

   add_definitions(-Wall -Werror)


WIP: Hopefully fixed "fatal: Not a git repository (or any of the parent directories): .git" at https://stingray.researchlumc.nl/job/SuperElastix/job/SuperElastix/job/SELX-126-Make-compilation-logs-public/24/console (3rd attempt)

--- CTest.cmake
+++ CTest.cmake
@@ -17,9 +17,9 @@
 #
 #=========================================================================

-# Directories relative to the current directory (either src or build).
-set(CTEST_SOURCE_DIRECTORY "../src")
-set(CTEST_BINARY_DIRECTORY "../build")
+# Directories relative to the current directory.
+set(CTEST_SOURCE_DIRECTORY "src")
+set(CTEST_BINARY_DIRECTORY "build")

 set(CTEST_SITE "lkeb-selx01")


`exec-foo' target depends on 'foo' target.

	* build-aux/cmake/modules/Tools.cmake: Here.

--- build-aux/cmake/modules/Tools.cmake
+++ build-aux/cmake/modules/Tools.cmake
@@ -300,6 +300,7 @@
               ${CMAKE_CURRENT_BINARY_DIR}/exec-${target}-target.cmake
       COMMENT "Executing ${target}..."
       )
+    add_dependencies(exec-${target} ${target})
   endfunction(add_exec_target)

   # Put in _out_ the location of built file for the target _target_.


- Fixes to Macintosh toolchain

- Fixes to Macintosh toolchain

--- cmake/Toolchains/native-macintosh-generic.toolchain.cmake
+++ cmake/Toolchains/native-macintosh-generic.toolchain.cmake
@@ -1,9 +1,11 @@
 # Temporary workaround
-set ( CMAKE_CXX_COMPILER /usr/local/bin/clang++-3.8 )
-set ( CMAKE_C_COMPILER /usr/local/bin/clang-3.8  )
+set ( CLANG_PATH "/usr/local/opt/llvm38" )

-include_directories ( "/usr/local/opt/llvm38/lib/llvm-3.8/include/c++/v1" )
-link_directories("/usr/local/opt/llvm38/lib/llvm-3.8/lib")
+set ( CMAKE_CXX_COMPILER ${CLANG_PATH}/bin/clang++-3.8 )
+set ( CMAKE_C_COMPILER ${CLANG_PATH}/bin/clang-3.8  )
+
+include_directories ( "${CLANG_PATH}/lib/llvm-3.8/include/c++/v1" )
+link_directories("${CLANG_PATH}/lib/llvm-3.8/lib")
 # Forcing use of C++11 (or later) libc++
 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++11" CACHE STRING "" )
 # To prevent undefined symbol errors when creating OSX frameworks


Update Golang to 1.2 rc4

Update Golang to 1.2 rc4

--- golang.cmake
+++ golang.cmake
@@ -11,9 +11,9 @@
 include (BuildSupport)

 external_source (golang
-    1.1.2
-    go1.1.2.src.tar.gz
-    705feb2246c8ddaf820d7e171f1430c5
+    1.2
+    go1.2rc4.src.tar.gz
+    21df7d7d0e585299045203fd443ee2c5
     http://go.googlecode.com/files)

 message ("Installing ${golang_NAME} into build area: ${BUILDEM_DIR} ...")


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/puffin-stream/hunter.cmake
+++ cmake/projects/puffin-stream/hunter.cmake
@@ -5,6 +5,17 @@
 include(hunter_pick_scheme)

 # List of versions here...
+
+hunter_add_version(
+    PACKAGE_NAME
+    puffin-stream
+    VERSION
+    "0.2.1.0"
+    URL
+    "https://github.com/designerror/puffin-stream/archive/v0.2.1.0.tar.gz"
+    SHA1
+    ab2a948cc6af163b3e234b896311b3a889a87f09
+)

 hunter_add_version(
     PACKAGE_NAME


Change paraview subproject url from git to https for auth issues

--- Superbuild/versions.cmake
+++ Superbuild/versions.cmake
@@ -38,7 +38,7 @@

 set(PARAVIEW_VERSION 5.1)
 add_revision(paraview
-  GIT_REPOSITORY git@gitlab.kitware.com:bjacquet/paraview.git
+  GIT_REPOSITORY https://gitlab.kitware.com/bjacquet/paraview.git
   GIT_TAG origin/veloview)

 add_revision(veloview


Make directories for package file lists.

--- pkg/CMakeCommon.cmake
+++ pkg/CMakeCommon.cmake
@@ -45,6 +45,7 @@
         find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)

         # Output the list of files to be installed in the package
+        file(MAKE_DIRECTORY "${BUILD_DIR}/targets")
         file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_libs.txt"
              CONTENT "${PKG_INSTALL_LIBS_FILES}")
         file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_bins.txt"
@@ -83,6 +84,7 @@
         find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)

         # Output the list of files to be installed in the package
+        file(MAKE_DIRECTORY "${BUILD_DIR}/targets")
         file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_libs.txt"
              CONTENT "${PKG_INSTALL_LIBS_FILES}")
         file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_bins.txt"
@@ -116,6 +118,13 @@

     find_lib_files("${PKG_INSTALL_LIBS}" PKG_INSTALL_LIBS_FILES)
     find_bin_files("${PKG_INSTALL_BINS}" PKG_INSTALL_BINS_FILES)
+
+    # Output the list of files to be installed in the package
+    file(MAKE_DIRECTORY "${BUILD_DIR}/targets")
+    file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_libs.txt"
+         CONTENT "${PKG_INSTALL_LIBS_FILES}")
+    file(GENERATE OUTPUT "${BUILD_DIR}/targets/install_bins.txt"
+         CONTENT "${PKG_INSTALL_BINS_FILES}")

     configure_file(CMakeListsTgz.txt.in
                 ${BUILD_DIR}/CMakeLists.txt @ONLY)


FindDCMTK - Clean white spaces

FindDCMTK - Clean white spaces

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -201,15 +201,15 @@
     ${DCMTK_DIR}/dcmjpeg/lib${lib}/Debug
     NO_DEFAULT_PATH
     )
-
+
   mark_as_advanced(DCMTK_${lib}_LIBRARY_RELEASE)
   mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG)
-
+
   # Add libraries to variable according to build type
   if(DCMTK_${lib}_LIBRARY_RELEASE)
     list(APPEND DCMTK_LIBRARIES optimized ${DCMTK_${lib}_LIBRARY_RELEASE})
   endif()
-
+
   if(DCMTK_${lib}_LIBRARY_DEBUG)
     list(APPEND DCMTK_LIBRARIES debug ${DCMTK_${lib}_LIBRARY_DEBUG})
   endif()
@@ -344,4 +344,3 @@
 endif()

 message(STATUS "Trying to find DCMTK relying on FindDCMTK.cmake - ok")
-


Added support for cpp-netlib uri

Added support for cpp-netlib uri

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -172,6 +172,7 @@
 add_target(CLOSURE_COMPILER closure-compiler)
 add_target(CLOSURE_LIBRARY closure-library)
 add_target(COUNTRY_INFOS country_infos)
+add_target(CPP_NETLIB_URI cpp-netlib-uri)
 add_target(CURL_ASIO curl-asio)
 add_target(DIFF_MATCH_PATCH diff_match_patch)
 add_target(DLIB dlib)
@@ -332,6 +333,7 @@
 set_libraries(
     clang_static_analyzer_frontend ${CLANG_LIB_DIR} clangStaticAnalyzerFrontend)
 set_libraries(clang_tooling ${CLANG_LIB_DIR} clangTooling)
+set_libraries(cpp-netlib-uri ${CPP_NETLIB_URI_PREFIX}/lib network-uri)
 set_libraries(curl-asio ${CURL_ASIO_PREFIX}/lib curlasio)
 set_libraries(diff_match_patch ${DIFF_MATCH_PATCH_PREFIX}/lib diff_match_patch)
 set_libraries(dlib ${DLIB_PREFIX}/lib dlib)
@@ -559,6 +561,7 @@
 add_library_dependencies(
     boost_thread third_party.boost_atomic third_party.boost_system)
 add_library_dependencies(boost_iostreams ${BZ2_LIB})
+add_library_dependencies(cpp-netlib-uri third_party.boost_system)
 add_framework_dependencies(formatter_kit AddressBook AddressBookUI CoreLocation)
 add_library_dependencies(gtest pthread)
 add_library_dependencies(intel_pcm pthread)
@@ -669,6 +672,7 @@
 set_include_directories(boost ${BOOST_PREFIX}/include)
 set_include_directories(bzip2 ${BZIP2_PREFIX}/include)
 set_include_directories(clang ${CLANG_PREFIX}/include)
+set_include_directories(cpp-netlib-uri ${CPP_NETLIB_URI_PREFIX}/include)
 set_include_directories(curl-asio ${CURL_ASIO_PREFIX}/include)
 set_include_directories(diff_match_patch ${DIFF_MATCH_PATCH_PREFIX}/include)
 set_include_directories(dlib ${DLIB_PREFIX}/include)
@@ -735,6 +739,7 @@

 # Fixing implicit header dependencies. Again we must be careful to define a DAG.
 add_include_dependencies(arabica third_party.boost_headers third_party.libxml)
+add_include_dependencies(cpp-netlib-uri third_party.boost_headers)
 add_include_dependencies(curl-asio third_party.libcurl)

@@ -1243,6 +1248,31 @@
   BUILD_COMMAND ${NOP}
   INSTALL_COMMAND ${NOP})
 set(CLOSURE_LIBRARY ${CLOSURE_LIBRARY_PREFIX}/lib/closure-library)
+
+################################################################################
+# cpp-netlib-uri.
+add_external_project(
+  ${CPP_NETLIB_URI_TARGET}
+  PREFIX ${CPP_NETLIB_URI_PREFIX}
+  DOWNLOAD_COMMAND
+      ${GIT} clone --recursive --depth 1
+          git://github.com/QuentinFiard/uri.git
+          ${CPP_NETLIB_URI_TARGET}
+  CMAKE_ARGS
+      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+      -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
+      -DCMAKE_BUILD_TYPE=RELEASE
+      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS_WITH_ARCHS}
+      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS_WITH_ARCHS}
+      -DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
+      -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
+      -DCMAKE_OSX_ARCHITECTURES=${ARCHS}
+      -DCMAKE_INSTALL_PREFIX=${CPP_NETLIB_URI_PREFIX}
+
+      -DBOOST_ROOT=${BOOST_PREFIX}
+      -DCPP-NETLIB_BUILD_TESTS=NO)
+add_dependencies(${CPP_NETLIB_URI_TARGET} ${BOOST_TARGET})

 ################################################################################
 # Country Infos.


Bug fix: added NOP variable to disable steps in externalproject_add

Latest CMakes do not support disabling steps by specifying an empty command

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -46,6 +46,9 @@
     set(LINKER_AS_COMPILER_FLAGS "${LINKER_AS_COMPILER_FLAGS} -Wl,${FLAG}")
   endif ()
 endforeach ()
+
+# Required to disable steps in an external project.
+set(NOP echo "")

 # Required executables.
 find_program(ANT ant)
@@ -778,7 +781,7 @@
       cd <SOURCE_DIR> &&
       tar --strip-components 1 -xvf
           ${BZIP2_PREFIX}/download/bzip2-1.0.6.tar.gz
-  CONFIGURE_COMMAND ""
+  CONFIGURE_COMMAND ${NOP}
   BUILD_COMMAND make
   INSTALL_COMMAND make install PREFIX=${BZIP2_PREFIX}
   BUILD_IN_SOURCE 1)
@@ -1192,7 +1195,7 @@
       cd <SOURCE_DIR> &&
       tar --strip-components 1 -xvf
           ${HAPROXY_PREFIX}/download/haproxy-1.4.24.tar.gz
-  CONFIGURE_COMMAND ""
+  CONFIGURE_COMMAND ${NOP}
   BUILD_COMMAND make TARGET=osx CPU_CFLAGS=${CMAKE_C_FLAGS}
       USE_PCRE=1 USE_OPENSSL=1 USE_LIBCRYPT=
   INSTALL_COMMAND
@@ -1243,7 +1246,7 @@
       cd <SOURCE_DIR> &&
       tar --strip-components 1 -xvf
           ${IMAP_2007F_PREFIX}/download/imap-2007f.tar.gz
-  CONFIGURE_COMMAND ""
+  CONFIGURE_COMMAND ${NOP}
   BUILD_COMMAND make osx SSLTYPE=unix.nopwd EXTRACFLAGS=-fPIC
   INSTALL_COMMAND
       cd <SOURCE_DIR> &&
@@ -1373,9 +1376,9 @@
   PREFIX ${LIBCXX_PREFIX}
   DOWNLOAD_COMMAND
       ${SVN} export --force http://llvm.org/svn/llvm-project/libcxx/trunk ${LIBCXX_TARGET}
-  CONFIGURE_COMMAND ""
-  BUILD_COMMAND ""
-  INSTALL_COMMAND "")
+  CONFIGURE_COMMAND ${NOP}
+  BUILD_COMMAND ${NOP}
+  INSTALL_COMMAND ${NOP})

 ################################################################################
 # libcxx.
@@ -1383,7 +1386,7 @@
 add_external_project(
   ${LIBCXX_TARGET}
   PREFIX ${LIBCXX_PREFIX}
-  DOWNLOAD_COMMAND " "
+  DOWNLOAD_COMMAND ${NOP}
   CMAKE_ARGS
       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@@ -1415,12 +1418,12 @@
       ${SVN} export --force http://llvm.org/svn/llvm-project/libcxxabi/trunk <INSTALL_DIR>
   PATCH_COMMAND
     cd <INSTALL_DIR>/lib && patch -p0 < ${THIRD_PARTY_SOURCE_DIR}/libcxxabi.patch
-  CONFIGURE_COMMAND ""
+  CONFIGURE_COMMAND ${NOP}
   BUILD_COMMAND
     cd <INSTALL_DIR>/lib &&
     CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ./buildit &&
     ln -s libc++abi.1.0.dylib libc++abi.dylib
-  INSTALL_COMMAND "")
+  INSTALL_COMMAND ${NOP})
 add_external_project_step(${LIBCXXABI_TARGET} set_install_names
   COMMAND
       ${SET_INSTALL_NAMES} ${CMAKE_INSTALL_NAME_TOOL}
@@ -1570,7 +1573,7 @@
       cd <SOURCE_DIR> &&
       tar --strip-components 1 -xvf
           ${MAVEN_PREFIX}/download/apache-maven-3.1.1-src.tar.gz
-  CONFIGURE_COMMAND echo ""
+  CONFIGURE_COMMAND ${NOP}
   BUILD_COMMAND
       M2_HOME=${MAVEN_PREFIX}/build ${ANT}
   INSTALL_COMMAND
@@ -1638,8 +1641,8 @@
   PREFIX ${MILI_PREFIX}
   DOWNLOAD_COMMAND
       ${HG} clone https://code.google.com/p/mili ${MILI_TARGET}
-  CONFIGURE_COMMAND echo ""
-  BUILD_COMMAND echo ""
+  CONFIGURE_COMMAND ${NOP}
+  BUILD_COMMAND ${NOP}
   INSTALL_COMMAND find mili | cpio -dp <INSTALL_DIR>/include
   BUILD_IN_SOURCE 1)

@@ -1872,7 +1875,7 @@
       ${SVN} export --force http://llvm.org/svn/llvm-project/openmp/trunk openmp &&
       rm -rf <SOURCE_DIR> &&
       mv openmp/runtime <SOURCE_DIR>
-  CONFIGURE_COMMAND echo ""
+  CONFIGURE_COMMAND ${NOP}
   BUILD_COMMAND
       PATH=${GCC_PREFIX}/bin:$ENV{PATH}
           LIB_GCC=${GCC_PREFIX}/lib/libgcc_s.1${CMAKE_SHARED_LIBRARY_SUFFIX}
@@ -1920,8 +1923,8 @@
         cd <SOURCE_DIR> &&
         tar --strip-components 1 -xvf
             ${OPENSSL_PREFIX}/download/openssl-1.0.1e.tar.gz
-    CONFIGURE_COMMAND echo ""
-    BUILD_COMMAND echo ""
+    CONFIGURE_COMMAND ${NOP}
+    BUILD_COMMAND ${NOP}
     INSTALL_COMMAND
         ln -sf ${OPENSSL_PREFIX}/${FIRST_ARCH}/include
             ${OPENSSL_PREFIX}/${FIRST_ARCH}/ssl ${OPENSSL_PREFIX})
@@ -2222,7 +2225,7 @@
     DOWNLOAD_COMMAND
         ${GIT} clone --depth 1 https://github.com/soffes/sstoolkit.git
             ${SSTOOLKIT_TARGET}
-    CONFIGURE_COMMAND echo ""
+    CONFIGURE_COMMAND ${NOP}
     BUILD_COMMAND
         xcodebuild -project <SOURCE_DIR>/SSToolkit.xcodeproj
             -sdk ${SSTOOLKIT_SDK}


COMP: Bump SCIFIO to fix test build warnings

https://github.com/scifio/scifio-imageio/commit/789c08071bbcd4341eba76fda10582a8d5fb7626

Fixes the following warnings when the tests are built:
warning: typedef 'PixelType' locally defined but not used
warning: typedef 'ImageType' locally defined but not used

Change-Id: I5ef63e317cadc6c09fec10cb95a2abbaa3886e2c

--- Modules/Remote/SCIFIO.remote.cmake
+++ Modules/Remote/SCIFIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(SCIFIO
   "SCIFIO (Bioformats) ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/scifio/scifio-imageio.git
-  GIT_TAG 71a701054bdb6e19fb21d7195e5878fc01179be4
+  GIT_TAG 789c08071bbcd4341eba76fda10582a8d5fb7626
   )


Remove duplicate code, clarify logic around extracting the install directory from the relative path

--- standard/InstallHeaders.cmake
+++ standard/InstallHeaders.cmake
@@ -33,32 +33,31 @@
       continue()
     endif()

-    # Need to make the path absolute.  We first look in the source directory,
-    # then we look in the binary directory, but only if the path is relative.
-    if(NOT IS_ABSOLUTE ${src})
-      get_filename_component(src_src ${src} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-      get_filename_component(src_bin ${src} ABSOLUTE BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
-      if(EXISTS ${src_src})
-        set(src ${src_src})
-        file(RELATIVE_PATH src_rel ${CMAKE_CURRENT_SOURCE_DIR} ${src})
-        get_filename_component(src_rel ${src_rel} DIRECTORY)
-        set(actual_rel ${src_rel})
-      elseif(EXISTS ${src_bin})
-        set(src ${src_bin})
-        file(RELATIVE_PATH bin_rel ${CMAKE_CURRENT_BINARY_DIR} ${src})
-        get_filename_component(bin_rel ${bin_rel} DIRECTORY)
-        set(actual_rel ${bin_rel})
-      else()
-        message(FATAL_ERROR "Could not find input header file ${src}")
-      endif()
+    #When the path to the file is absolute, we don't know what we should be installing
+    #it relative to. Warn
+    if(IS_ABSOLUTE ${src})
+      message(WARNING "Not sure where to install file with absolute path ${src}")
+      continue()
     endif()

+    #Determine which path the file is relative to and use intermediate directories as the install path
+    foreach(_search_dir "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
+      get_filename_component(src_abs ${src} ABSOLUTE BASE_DIR ${_search_dir})
+      if(EXISTS ${src_abs})
+        set(src ${src_abs})
+        file(RELATIVE_PATH containing_dir ${_search_dir} ${src})
+        get_filename_component(containing_dir ${containing_dir} DIRECTORY)
+        break()
+      endif()
+    endforeach()

+    if(NOT EXISTS ${src_abs})
+      message(FATAL_ERROR "Could not find input header file ${src}")
+    endif()

-    get_filename_component(src_ext ${src} EXT)
     install(
       FILES ${src}
-      DESTINATION ${opt_DESTINATION}/${actual_rel}
+      DESTINATION ${opt_DESTINATION}/${containing_dir}
       ${opt_UNPARSED_ARGUMENTS}
     )
   endforeach()


fbcode_builder: use build interface generator expression for thrift include directories

Summary:
Fix an error about source directories being included in the include
path in add_thrift_cpp2_library. I don't know why this was failing for
fb303 and not for other projects, but adding a generation expression
appears to fix the issue.

Reviewed By: strager

Differential Revision: D15725024

fbshipit-source-id: 6c02fed6c6703733cf9e0b130c0f90b70e3ea300

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -105,8 +105,8 @@
   target_include_directories(
     ${LIB_NAME}
     PUBLIC
-      ${CMAKE_SOURCE_DIR}
-      ${CMAKE_BINARY_DIR}
+      $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+      $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
       ${FOLLY_INCLUDE_DIR}
       ${FBTHRIFT_INCLUDE_DIR}
   )


fbcode_builder: support installing thrift generated header files

Summary:
Update add_thrift_cpp2_library() to add a PUBLIC_HEADER property to the
generated library target, so that the generated headers can be installed using
an `install()` call.  Also add a `HEADER_INSTALL_DIR` property which indicates
the directory they should be installed into.  A `INCLUDE_DIR` argument was
added to customize the include installation path, should anyone care to do so.

This also removes code that was previously incorrectly installing the
generated headers into the source tree.

Reviewed By: wez

Differential Revision: D16853404

fbshipit-source-id: 6f640b2bd347c99804e074fca0209dda37c8a9cf

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -4,10 +4,26 @@

 include(FBCMakeParseArgs)

+# Generate a C++ library from a thrift file
+#
+# Parameters:
+# - SERVICES <svc1> [<svc2> ...]
+#   The names of the services defined in the thrift file.
+# - DEPENDS <dep1> [<dep2> ...]
+#   A list of other thrift C++ libraries that this library depends on.
+# - OPTIONS <opt1> [<opt2> ...]
+#   A list of options to pass to the thrift compiler.
+# - INCLUDE_DIR <path>
+#   The sub-directory where generated headers will be installed.
+#   Defaults to "include" if not specified.  The caller must still call
+#   install() to install the thrift library if desired.
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
+  set(one_value_args INCLUDE_DIR)
   set(multi_value_args SERVICES DEPENDS OPTIONS)
-  fb_cmake_parse_args(ARG "" "" "${multi_value_args}" "${ARGN}")
+  fb_cmake_parse_args(
+    ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
+  )

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -23,6 +39,9 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
   )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)
+  if(NOT DEFINED ARG_INCLUDE_DIR)
+    set(ARG_INCLUDE_DIR "include")
+  endif()

   if (NOT "${include_prefix}" STREQUAL "")
     list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
@@ -110,19 +129,11 @@
     ${generated_sources}
   )

-  install(
-    FILES ${generated_headers}
-    DESTINATION $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/gen-cpp2
-  )
-
   target_include_directories(
     "${LIB_NAME}"
-    PRIVATE
-      ${CMAKE_SOURCE_DIR}
-      ${CMAKE_BINARY_DIR}
     PUBLIC
-      ${FOLLY_INCLUDE_DIR}
-      ${FBTHRIFT_INCLUDE_DIR}
+      "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>"
+      "$<INSTALL_INTERFACE:${ARG_INCLUDE_DIR}>"
   )
   target_link_libraries(
     "${LIB_NAME}"
@@ -132,14 +143,27 @@
       Folly::folly
   )

+  # Add ${generated_headers} to the PUBLIC_HEADER property for ${LIB_NAME}
+  #
+  # This allows callers to install it using
+  # "install(TARGETS ${LIB_NAME} PUBLIC_HEADER)"
+  # However, note that CMake's PUBLIC_HEADER behavior is rather inflexible,
+  # and does have any way to preserve header directory structure.  Callers
+  # must be careful to use the correct PUBLIC_HEADER DESTINATION parameter
+  # when doing this, to put the files the correct directory themselves.
+  # We define a HEADER_INSTALL_DIR property with the include directory prefix,
+  # so typically callers should specify the PUBLIC_HEADER DESTINATION as
+  # "$<TARGET_PROPERTY:${LIB_NAME},HEADER_INSTALL_DIR>"
+  set_property(
+    TARGET "${LIB_NAME}"
+    PROPERTY PUBLIC_HEADER ${generated_headers}
+  )
+
   set_target_properties(
     "${LIB_NAME}"
     PROPERTIES
       EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
       THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      HEADER_INSTALL_DIR "${ARG_INCLUDE_DIR}/${include_prefix}/gen-cpp2"
   )
-
-  get_property(thrift_include_directory
-    TARGET "${LIB_NAME}"
-    PROPERTY THRIFT_INCLUDE_DIRECTORY)
 endfunction()


Include community board oxygen in select (#583)

--- CMake/Modules/CHIBIOS_STM32F4xx_sources.cmake
+++ CMake/Modules/CHIBIOS_STM32F4xx_sources.cmake
@@ -69,7 +69,8 @@
                ${CHIBIOS_BOARD} STREQUAL "ST_STM32F4_DISCOVERY" OR
                ${CHIBIOS_BOARD} STREQUAL "MBN_QUAIL" OR
                ${CHIBIOS_BOARD} STREQUAL "NETDUINO3_WIFI" OR
-               ${CHIBIOS_BOARD} STREQUAL "I2M_ELECTRON_NF")
+               ${CHIBIOS_BOARD} STREQUAL "I2M_ELECTRON_NF" OR
+               ${CHIBIOS_BOARD} STREQUAL "I2M_OXYGEN_NF")
                 ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv1
             else()
                 ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2
@@ -104,7 +105,8 @@
    ${CHIBIOS_BOARD} STREQUAL "ST_STM32F4_DISCOVERY" OR
    ${CHIBIOS_BOARD} STREQUAL "MBN_QUAIL" OR
    ${CHIBIOS_BOARD} STREQUAL "NETDUINO3_WIFI" OR
-   ${CHIBIOS_BOARD} STREQUAL "I2M_ELECTRON_NF")
+   ${CHIBIOS_BOARD} STREQUAL "I2M_ELECTRON_NF" OR
+   ${CHIBIOS_BOARD} STREQUAL "I2M_OXYGEN_NF")
     list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv1)
 else()
     list(APPEND CHIBIOS_INCLUDE_DIRS ${PROJECT_BINARY_DIR}/ChibiOS_Source/os/hal/ports/STM32/LLD/I2Cv2)


Do not limit number of link jobs on Azure

--- azure.cmake
+++ azure.cmake
@@ -81,8 +81,6 @@
     BUILD_EXAMPLES:BOOL=OFF
     BUILD_SHARED_LIBS:BOOL=OFF
     BUILD_TESTING:BOOL=ON
-    CMAKE_JOB_POOLS:STRING=link=1
-    CMAKE_JOB_POOL_LINK:STRING=link
     SimpleITK_EXPLICIT_INSTANTIATION:BOOL=OFF

     WRAP_DEFAULT:BOOL=OFF


Cleanup build script - support SCP_TO_TARGET build option consistently.

--- Source/CMake/Modules/Urho3D-CMake-magic.cmake
+++ Source/CMake/Modules/Urho3D-CMake-magic.cmake
@@ -451,7 +451,7 @@

     if (IOS)
         set_target_properties (${TARGET_NAME} PROPERTIES XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "1,2")
-    elseif (RASPI AND SCP_TO_TARGET)
+    elseif (CMAKE_CROSSCOMPILING AND NOT ANDROID AND SCP_TO_TARGET)
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND scp $<TARGET_FILE:${TARGET_NAME}> ${SCP_TO_TARGET} || exit 0)
     endif ()
     if (DEST_RUNTIME_DIR)


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -24,7 +24,7 @@

 # NOTE: no names with spaces!

-hunter_config(puffin-stream VERSION 0.1.0.2)
+hunter_config(puffin-stream VERSION 0.2.0.0)
 hunter_config(puffin-buffer VERSION 0.3.0.0)
 hunter_config(AllTheFlopsThreads VERSION 0.1-p0)
 hunter_config(Android-Apk VERSION 1.1.13)


deactivated unstable test (instability due to external api call

--- tests/web/http_put_test.cmake
+++ tests/web/http_put_test.cmake
@@ -1,5 +1,9 @@
 function(http_put_test)
+  ## is not a stable test because of external parameters.
+  ## deactivating...

+
+  return()


ENH: Follow develop for CIP

ENH: Follow develop for CIP

--- SuperBuild/External_CIP.cmake
+++ SuperBuild/External_CIP.cmake
@@ -25,7 +25,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/acil-bwh/ChestImagingPlatform.git"
-    GIT_TAG "2425a3327d1e6f6d159c66ba650e3ab39689c0b0" # Develop
+    GIT_TAG develop # Develop
     #DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E echo "Remove this line and uncomment GIT_REPOSITORY and GIT_TAG"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build


Update ITK Superbuild version to 4.11rc2

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -42,7 +42,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.11rc01 )# ITK 4.11 under development
+set(ITK_TAG_COMMAND GIT_TAG v4.11rc02 )# ITK 4.11 under development

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


COMP: Temporarily deactivate test.

COMP: Temporarily deactivate test.

--- Modules/ImageStatistics/Testing/files.cmake
+++ Modules/ImageStatistics/Testing/files.cmake
@@ -1,5 +1,5 @@
 SET(MODULE_TESTS
   mitkImageStatisticsCalculatorTest.cpp
   mitkPointSetStatisticsCalculatorTest.cpp
-  mitkPointSetDifferenceStatisticsCalculatorTest.cpp
+  #mitkPointSetDifferenceStatisticsCalculatorTest.cpp
 )


nuget project fixes

nuget project fixes

issue https://github.com/smanders/externpro/issues/189#issuecomment-404631380
nuget https://github.com/smanders/externpro/issues/201

--- projects/nuget.cmake
+++ projects/nuget.cmake
@@ -12,6 +12,13 @@
   DLMD5 ef16c016d7eb396c8f65888a53b69d78
   )
 ########################################
+function(patch_nuget)
+  # do nothing here
+  # don't want xpPatchProject(${PRO_NUGET}) called automatically
+  # because then an ExternalProject_Add(nuget) will try to extract the executable
+  # which doesn't make any sense...
+endfunction()
+########################################
 function(build_nuget)
   if(NOT (XP_DEFAULT OR XP_PRO_NUGET))
     return()
@@ -19,25 +26,30 @@
   if(NOT MSVC)
     return()
   endif()
-  xpDownloadProject(${PRO_NUGET}) # download_${fn} target
   xpGetArgValue(${PRO_NUGET} ARG DLURL VALUE dwnldUrl)
   get_filename_component(fn ${dwnldUrl} NAME)
+  if(NOT TARGET download_${fn})
+    xpDownloadProject(${PRO_NUGET}) # download_${fn} target
+    message(STATUS "target download_${fn}")
+  endif()
   set(tgtDep download_${fn})
   if(DEFINED XP_NUGET_COMPLETE_PKG)
     xpGetArgValue(${PRO_NUGET} ARG VER VALUE VER)
     configure_file(${PRO_DIR}/use/usexp-nuget-config.cmake ${STAGE_DIR}/share/cmake/
       @ONLY NEWLINE_STYLE LF
       )
-    ExternalProject_Add(nuget_bld DEPENDS ${tgtDep}
-      DOWNLOAD_COMMAND "" DOWNLOAD_DIR ${NULL_DIR} CONFIGURE_COMMAND ""
-      SOURCE_DIR ${NULL_DIR} BINARY_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
-      BUILD_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DWNLD_DIR}/${fn} ${STAGE_DIR}/bin/${fn}
-      INSTALL_COMMAND ""
-      )
-    set_property(TARGET nuget_bld PROPERTY FOLDER ${bld_folder})
+    if(NOT TARGET nuget_bld)
+      ExternalProject_Add(nuget_bld DEPENDS ${tgtDep}
+        DOWNLOAD_COMMAND "" DOWNLOAD_DIR ${NULL_DIR} CONFIGURE_COMMAND ""
+        SOURCE_DIR ${NULL_DIR} BINARY_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
+        BUILD_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DWNLD_DIR}/${fn} ${STAGE_DIR}/bin/${fn}
+        INSTALL_COMMAND ""
+        )
+      set_property(TARGET nuget_bld PROPERTY FOLDER ${bld_folder})
+      message(STATUS "target nuget_bld")
+    endif()
     set(tgtDep nuget_bld)
   endif()
-  message(STATUS "target ${tgtDep}")
   if(ARGN)
     set(${ARGN} ${tgtDep} PARENT_SCOPE)
     set(NUGET_EXE ${DWNLD_DIR}/${fn} PARENT_SCOPE)


Dennis: install for static versions

Dennis: install for static versions

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@177 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -448,6 +448,12 @@
                RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
                LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
                ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR})
+      if (_and_static)
+        install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${_target}Static.a
+                 DESTINATION ${ACG_PROJECT_LIBDIR}
+                 RENAME lib${_target}.a
+                 PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+      endif ()
     elseif (${_type} STREQUAL MODULE)
       install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_PLUGINDIR})
     endif ()


Make sure ADOLC is recent enough by searching for adtl.h

--- cmake/FindAdolc.cmake
+++ cmake/FindAdolc.cmake
@@ -5,7 +5,7 @@

 find_path(ADOLC_INCLUDES
   NAMES
-  adolc/adouble.h
+  adolc/adtl.h
   PATHS
   $ENV{ADOLCDIR}
   ${INCLUDE_INSTALL_DIR}


[cmake] Fix detecting terminfo library

[cmake] Fix detecting terminfo library

Copy the fix for determining the correct terminfo library from LLVM --
use distinct variables for check_library_exists() calls.  Otherwise,
the first check (for -ltinfo) populates the variable and no other checks
are performed.  Effectively, systems with other libraries than the first
one listed are presumed not to have terminfo routines at all.

Also sync the check order to include the NetBSD fix from r347156.

This partially fixes undefined symbols when linking XRay tests.  It's
probably not the best solution to the problem there but as long
as the terminfo check stays in config-ix, I thnk it's worth fixing.

Differential Revision: https://reviews.llvm.org/D54641

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -121,10 +121,12 @@

 # Look for terminfo library, used in unittests that depend on LLVMSupport.
 if(LLVM_ENABLE_TERMINFO)
-  foreach(library tinfo terminfo curses ncurses ncursesw)
+  foreach(library terminfo tinfo curses ncurses ncursesw)
+    string(TOUPPER ${library} library_suffix)
     check_library_exists(
-      ${library} setupterm "" COMPILER_RT_HAS_TERMINFO)
-    if(COMPILER_RT_HAS_TERMINFO)
+      ${library} setupterm "" COMPILER_RT_HAS_TERMINFO_${library_suffix})
+    if(COMPILER_RT_HAS_TERMINFO_${library_suffix})
+      set(COMPILER_RT_HAS_TERMINFO TRUE)
       set(COMPILER_RT_TERMINFO_LIB "${library}")
       break()
     endif()


[safestack] Remove Darwin from supported platforms

r339720 already disabled it in the driver

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -614,7 +614,7 @@
 endif()

 if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND
-    OS_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD")
+    OS_NAME MATCHES "Linux|FreeBSD|NetBSD")
   set(COMPILER_RT_HAS_SAFESTACK TRUE)
 else()
   set(COMPILER_RT_HAS_SAFESTACK FALSE)


support for memory sanitizer (if available)

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -25,6 +25,9 @@
 set(CMAKE_REQUIRED_FLAGS "-fsanitize=thread")
 CHECK_CXX_SOURCE_COMPILES("${NANOCV_TEST_PROGRAM}" COMPILER_SUPPORTS_SANITIZE_THREAD)

+set(CMAKE_REQUIRED_FLAGS "-fsanitize=memory")
+CHECK_CXX_SOURCE_COMPILES("${NANOCV_TEST_PROGRAM}" COMPILER_SUPPORTS_SANITIZE_MEMORY)
+
 # setup compiler
 if(CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
         message("Compiling with ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} ...")
@@ -38,24 +41,22 @@

         # set flags
         set(CMAKE_CXX_FLAGS                     "-std=c++14 -pedantic -march=native -mtune=native")
-        if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
-                set(CMAKE_CXX_FLAGS		"${CMAKE_CXX_FLAGS} -pthread")
-    	endif()
-        set(CMAKE_CXX_FLAGS			"${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion")
+        set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -pthread")
+        set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wreorder")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wsign-promo")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wsign-conversion")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fno-common")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-        set(CMAKE_CXX_FLAGS_DEBUG		"-g -fno-omit-frame-pointer")
-        set(CMAKE_CXX_FLAGS_RELEASE             "-O3 -DNDEBUG")         		# -DEIGEN_NO_DEBUG")
+        set(CMAKE_CXX_FLAGS_DEBUG               "-g -fno-omit-frame-pointer")
+        set(CMAKE_CXX_FLAGS_RELEASE             "-O3 -DNDEBUG")                         # -DEIGEN_NO_DEBUG")
         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO      "-O2 -g -fno-omit-frame-pointer")       # -DEIGEN_NO_DEBUG")
-        set(CMAKE_CXX_FLAGS_MINSIZEREL          "-Os -DNDEBUG")         		# -DEIGEN_NO_DEBUG")
+        set(CMAKE_CXX_FLAGS_MINSIZEREL          "-Os -DNDEBUG")                         # -DEIGEN_NO_DEBUG")
         set(CMAKE_EXE_LINKER_FLAGS              "-flto")

         # set address sanitizer
-	if(NANOCV_WITH_ASAN)
+        if(NANOCV_WITH_ASAN)
                 if(COMPILER_SUPPORTS_SANITIZE_ADDRESS)
                         set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=address")
                 endif()
@@ -69,16 +70,19 @@
                 if(COMPILER_SUPPORTS_SANITIZE_INTEGER)
                         set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=integer")
                 endif()
+                if(COMPILER_SUPPORTS_SANITIZE_MEMORY)
+                        set(CMAKE_CXX_FLAGS     "${CMAKE_CXX_FLAGS} -fsanitize=memory -fsanitize-memory-track-origins")
+                endif()

         # set thread sanitizer
-	elseif(NANOCV_WITH_TSAN)
+        elseif(NANOCV_WITH_TSAN)
                 if(COMPILER_SUPPORTS_SANITIZE_THREAD)
                         set(CMAKE_CXX_FLAGS_DEBUG       "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=thread")
                 endif()
-	endif()
+        endif()

 else()
-	message(WARNING "Compiling with an unsupported compiler ...")
+        message(WARNING "Compiling with an unsupported compiler ...")
 endif()

 # debug


- Add PPAPI_GLES2 library to BuildFunctions.cmake

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -290,6 +290,12 @@
         ${LIBRARIES}
         )

+    if(NACL)
+        target_link_libraries ( ${TARGET}
+                ppapi_gles2
+            )
+    endif()
+
     remove_definitions(
         -DCOFFEE_APPLICATION_NAME -DCOFFEE_ORGANIZATION_NAME
         -DCOFFEE_VERSION_CODE )


Bump ABI major version as further changes are going to break it

Change-Id: I7a478ca22319249ca219bf810efcbd34dba061bc
Reviewed-on: http://review.couchbase.org/100434
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Ellis Breen <9d8041ac7ead8d3e1f3217c04c7ed5e3098c2381@couchbase.com>

--- cmake/Modules/GetVersionInfo.cmake
+++ cmake/Modules/GetVersionInfo.cmake
@@ -42,13 +42,13 @@

 IF (NOT LCB_VERSION)
     SET(LCB_NOGITVERSION ON)
-    SET(LCB_VERSION "2.10.3")
+    SET(LCB_VERSION "3.0.0")
 ENDIF()
 IF (NOT LCB_VERSION_CHANGESET)
     SET(LCB_VERSION_CHANGESET "0xdeadbeef")
 ENDIF()
 IF (NOT LCB_VERSION_HEX)
-    SET(LCB_VERSION_HEX 0x021002)
+    SET(LCB_VERSION_HEX 0x030000)
 ENDIF()

 # Now parse the version string
@@ -59,11 +59,11 @@

 # Determine the SONAME for the library
 IF(APPLE)
+    SET(LCB_SONAME_MAJOR "4")
+ELSE()
     SET(LCB_SONAME_MAJOR "3")
-ELSE()
-    SET(LCB_SONAME_MAJOR "2")
 ENDIF()
-SET(LCB_SONAME_FULL "${LCB_SONAME_MAJOR}.0.65")
+SET(LCB_SONAME_FULL "${LCB_SONAME_MAJOR}.0.1")

 MESSAGE(STATUS
     "libcouchbase ${LCB_VERSION_MAJOR},${LCB_VERSION_MINOR},${LCB_VERSION_PATCH}")


Change target platform detection under MSVC.

$env:Platform may be undefined. This caused Visual Studio 2017 to fail
when CMake project was opened with an IDE. Target architecture can be also
infered from _MSVC_CXX_ARCHITECTURE_FAMILY and/or _MSVC_C_ARCHITECTURE_FAMILY.

--- conan.cmake
+++ conan.cmake
@@ -112,13 +112,24 @@
         endif()

         if(${CMAKE_GENERATOR} STREQUAL "Ninja")
-            if($ENV{Platform} STREQUAL "X64")
-                set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
-            elseif($ENV{Platform} STREQUAL "ARM")
-                message(STATUS "Conan: Using default ARM architecture from MSVC")
-                set(_SETTINGS ${_SETTINGS} -s arch=armv6)
+            if(DEFINED ENV{Platform})
+                if($ENV{Platform} STREQUAL "X64")
+                    set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
+                elseif($ENV{Platform} STREQUAL "ARM")
+                    message(STATUS "Conan: Using default ARM architecture from MSVC")
+                    set(_SETTINGS ${_SETTINGS} -s arch=armv6)
+                else()
+                    set(_SETTINGS ${_SETTINGS} -s arch=x86)
+                endif()
             else()
-                set(_SETTINGS ${_SETTINGS} -s arch=x86)
+                if(_MSVC_CXX_ARCHITECTURE_FAMILY STREQUAL "X64" OR _MSVC_C_ARCHITECTURE_FAMILY STREQUAL "X64")
+                    set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
+                elseif(_MSVC_CXX_ARCHITECTURE_FAMILY MATCHES "ARM" OR _MSVC_C_ARCHITECTURE_FAMILY MATCHES "ARM")
+                    message(STATUS "Conan: Using default ARM architecture from MSVC")
+                    set(_SETTINGS ${_SETTINGS} -s arch=armv6)
+                else()
+                    set(_SETTINGS ${_SETTINGS} -s arch=x86)
+                endif()
             endif()
         else()
             if(${CMAKE_GENERATOR} MATCHES "Win64")


add support for Visual Studio 16 (#139)

add support for Visual Studio 16 (#139)

--- conan.cmake
+++ conan.cmake
@@ -378,11 +378,11 @@
     execute_process(COMMAND ${conan_command} ${conan_args}
                      RESULT_VARIABLE return_code
                      OUTPUT_VARIABLE conan_output
-                     ERROR_VARIABLE conan_output
+                     ERROR_VARIABLE conan_output
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

     message(STATUS "${conan_output}")
-
+
     if(NOT "${return_code}" STREQUAL "0")
       message(FATAL_ERROR "Conan install failed='${return_code}'")
     endif()


Add new libuv file for new version

Add new libuv file for new version

--- deps/uv.cmake
+++ deps/uv.cmake
@@ -123,6 +123,11 @@
     ${LIBUVDIR}/src/unix/tty.c
     ${LIBUVDIR}/src/unix/udp.c
   )
+  if(APPLE)
+    set(SOURCES ${SOURCES}
+      ${LIBUVDIR}/src/unix/pthread-barrier.c
+    )
+  endif()
 endif()

 check_type_size("void*" SIZEOF_VOID_P)


[cmake] use only boost TARGETS

[cmake] use only boost TARGETS

--- cmake/BoostTestHelper.cmake
+++ cmake/BoostTestHelper.cmake
@@ -47,7 +47,7 @@
     endif()

     target_link_libraries(${TEST_EXECUTABLE_NAME}
-            ${param_LINK} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+            ${param_LINK} Boost::unit_test_framework)

     # test_case must be always contained in a test_suite
     file(READ "${param_SOURCE}" SOURCE_FILE_CONTENTS)
@@ -65,4 +65,4 @@
 #    add_test(NAME ${TEST_EXECUTABLE_NAME}
 #             COMMAND ${TEST_EXECUTABLE_NAME} --catch_system_error=yes)

-endfunction()+endfunction()


don't require config

don't require config

--- cmake/FindSuiteSparse.cmake
+++ cmake/FindSuiteSparse.cmake
@@ -495,10 +495,7 @@
     COLAMD_FOUND AND
     CCOLAMD_FOUND AND
     CHOLMOD_FOUND AND
-    SUITESPARSEQR_FOUND AND
-    (SUITESPARSE_CONFIG_FOUND OR UFCONFIG_FOUND) AND
-    BLAS_FOUND AND
-    LAPACK_FOUND)
+    SUITESPARSEQR_FOUND AND)
   SET(SUITESPARSE_FOUND TRUE)
   LIST(APPEND SUITESPARSE_INCLUDE_DIRS
     ${AMD_INCLUDE_DIR}


Add missing packages to the Debian conflict list

And refactor the code to make sure that the dev and runtime package lists are
in sync.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -115,15 +115,14 @@
   endif()
 endif()

-set(STD_OPENCV_LIBS opencv-data libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4
-    libopencv-features2d2.4 libopencv-flann2.4 libopencv-gpu2.4 libopencv-imgproc2.4
-    libopencv-ml2.4 libopencv-ocl2.4 libopencv-stitching2.4 libopencv-ts2.4 libopencv-videostab2.4)
-
-set(STD_OPENCV_DEV libopencv-calib3d-dev libopencv-contrib-dev libopencv-core-dev
-    libopencv-dev libopencv-features2d-dev libopencv-flann-dev libopencv-gpu-dev
-    libopencv-highgui-dev libopencv-imgproc-dev libopencv-legacy-dev libopencv-ml-dev
-    libopencv-objdetect-dev libopencv-ocl-dev libopencv-photo-dev libopencv-stitching-dev
-    libopencv-superres-dev libopencv-ts-dev libopencv-video-dev libopencv-videostab-dev)
+set(STD_OPENCV_LIBS opencv-data)
+set(STD_OPENCV_DEV libopencv-dev)
+
+foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy
+               ml objdetect ocl photo stitching superres ts video videostab)
+  list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4")
+  list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev")
+endforeach()

 string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}")
 string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_PROVIDES "${STD_OPENCV_LIBS}")


Copy shared Qt libraries to build binary directory when creating a package.

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@349 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/OpenMeshPackage.cmake
+++ cmake/OpenMeshPackage.cmake
@@ -96,6 +96,35 @@
   #     "Delete \\\"$SMPROGRAMS\\\\$MUI_TEMP\\\\OpenFlipper.lnk\\\""
   #    )

+  # Copy all shared Qt files to build binary dir
+  if ( NOT Q_WS_MAC)
+      if (DEFINED QT_QMAKE_EXECUTABLE)
+          SET (QTLIBLIST QtCore QtGui)
+
+          IF (MSVC)
+              set(TYPE "d")
+              FOREACH(qtlib ${QTLIBLIST})
+                IF (WIN32)
+                  GET_FILENAME_COMPONENT(QT_DLL_PATH_tmp ${QT_QMAKE_EXECUTABLE} PATH)
+                  file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug)
+                  file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Release)
+                  file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/MinSizeRel)
+                  file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/RelWithDebInfo)
+                  INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}${type}d4.dll
+                      DESTINATION ./
+                      CONFIGURATIONS Debug
+                      COMPONENT Applications)
+                  INSTALL(FILES ${QT_DLL_PATH_tmp}/${qtlib}4.dll
+                      DESTINATION ./
+                      CONFIGURATIONS Release
+                      COMPONENT Applications)
+                ENDIF (WIN32)
+              ENDFOREACH(qtlib)
+
+          endif()
+      endif(DEFINED QT_QMAKE_EXECUTABLE)
+  endif()
+
   # append dll's to installed package
   #if (EXISTS ${CMAKE_SOURCE_DIR}/WIN)
 	  #file (GLOB _files "${CMAKE_SOURCE_DIR}/WIN/DLLs/DLLs 32 debug/*.dll")


Moving clang omp support down to 3.5.0

Moving clang omp support down to 3.5.0

--- cmake/PVConfigProject.cmake
+++ cmake/PVConfigProject.cmake
@@ -95,7 +95,7 @@
       # Open source clang detected
       set(COMPILER_DETECTED ON)
       set(PV_NVCC_FLAGS ${CLANG_NVCC_FLAGS})
-      if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "3.5.0")
+      if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "3.5.0" OR ${CMAKE_CXX_COMPILER_VERSION} VERSION_EQUAL "3.5.0")
         # This is a clang that supports OpenMP. Note how Apple's clang has a version
         # number greater than this. What could go wrong?
         message(STATUS "Clang with OpenMP support detected")


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -24,6 +24,7 @@

 # NOTE: no names with spaces!

+hunter_config(gloox VERSION 1.0.20)
 hunter_config(wdc VERSION 1.0.1-hunter)
 hunter_config(pugixml VERSION 1.8.1)
 hunter_config(puffin-stream VERSION 0.2.2.0)


Revert r197682, "[CMake] Introduce LIT in add_lit_target."

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -322,18 +322,15 @@
 # A raw function to create a lit target. This is used to implement the testuite
 # management functions.
 function(add_lit_target target comment)
-  parse_arguments(ARG "LIT;PARAMS;DEPENDS;ARGS" "" ${ARGN})
+  parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
   set(LIT_ARGS "${ARG_ARGS} ${LLVM_LIT_ARGS}")
   separate_arguments(LIT_ARGS)
   if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
     list(APPEND LIT_ARGS --param build_mode=${CMAKE_CFG_INTDIR})
   endif ()
-  if(NOT EXISTS ${ARG_LIT})
-    set(ARG_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
-  endif()
   set(LIT_COMMAND
     ${PYTHON_EXECUTABLE}
-    ${ARG_LIT}
+    ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py
     ${LIT_ARGS}
     )
   foreach(param ${ARG_PARAMS})


Patch FindKCL. Forgotten to change with kcldetect. Thanks Mathias Krauss

--- cmake/modules/FindKCL.cmake
+++ cmake/modules/FindKCL.cmake
@@ -18,7 +18,7 @@

 find_path(KCL_INCLUDE_DIR
     NAMES
-    gluon/kcl/kclengine.h
+    gluon/kcl/kcldetect.h
     PATHS
     ${INCLUDE_INSTALL_DIR}
 )


FindQt5.cmake: remove hardcoded -fPIC flag

This was probably needed because the pkgconfig check for QtCore
was failing, so the code in CMakeLists.txt that adds -fPIC and -fPIE
in the flags was never executed.

Currently, -fPIC and -fPIE are added when 'reduce_relocations' is present
in the qt_config flags in Qt5Core.pc

Reviewed-by: Alexandr Akulich <ad71d6ef874ccc09e1a69fe0dd6443b72073e71a@gmail.com>

--- cmake/modules/FindQt5.cmake
+++ cmake/modules/FindQt5.cmake
@@ -127,8 +127,6 @@
     RESULT_VARIABLE _pkgconfig_failed)
 STRING(REPLACE " " ";" QT_CONFIG_FLAGS "${_pkgconfig_flags}")

-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
-
 INCLUDE(Qt5Macros)

 SET(QT_FOUND TRUE)


Also print out ENABLE_d option.

Also print out ENABLE_d option.

svn path=/trunk/; revision=8345

--- cmake/modules/summary.cmake
+++ cmake/modules/summary.cmake
@@ -116,7 +116,7 @@
 ENABLE_tk:		${ENABLE_tk}		ENABLE_itk:		${ENABLE_itk}
 ENABLE_pdl:		${ENABLE_pdl}		ENABLE_wxwidgets:	${ENABLE_wxwidgets}
 ENABLE_gnome2:		${ENABLE_gnome2}		ENABLE_pygcw:		${ENABLE_pygcw}
-ENABLE_ada:		${ENABLE_ada}
+ENABLE_ada:		${ENABLE_ada}		ENABLE_d:		${ENABLE_d}
 ")
 message("${_output_results}")
 endmacro(summary)


Changed mturk marketing name.

Changed mturk marketing name.

--- cmake/sdks.cmake
+++ cmake/sdks.cmake
@@ -76,7 +76,7 @@
 list(APPEND C2J_LIST "machinelearning:2014-12-12")
 list(APPEND C2J_LIST "marketplacecommerceanalytics:2015-07-01")
 list(APPEND C2J_LIST "meteringmarketplace:2016-01-14")
-list(APPEND C2J_LIST "mturk-requester:2017-01-17")
+list(APPEND C2J_LIST "mturk:2017-01-17")
 list(APPEND C2J_LIST "mobileanalytics:2014-06-05")
 list(APPEND C2J_LIST "monitoring:2010-08-01")
 list(APPEND C2J_LIST "opsworks:2013-02-18")


COMPILING EMSCRIPTEN WITH EMBIND SUPPORT

--- core/cmake/test.cmake
+++ core/cmake/test.cmake
@@ -191,7 +191,7 @@

     configure_file("${CROSS_ROOT}/cmake/emscripten/template.html.in" template.html)
     set(CMAKE_EXECUTABLE_SUFFIX .html)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 --emrun --shell-file template.html")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 --emrun --shell-file template.html --bind")

     if (RESOURCE_COUNT)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --preload-file ../../res")


[fixed] t123AddOptionalFortranTest

[fixed] t123AddOptionalFortranTest

--- src/t123/cmake/AddFortranTest.cmake
+++ src/t123/cmake/AddFortranTest.cmake
@@ -1,5 +1,5 @@
 # Optional fortran test.
-MACRO( T123_AddOptionalFortranTest )
+MACRO( t123AddOptionalFortranTest )
     IF(${PROJECT_NAME}_ENABLE_Fortran)
         t123AddFortranTest( ${ARGV} )
     ELSE()


always creating both Release and Debug folders instead of just the one we should need.

--- Shared/CMake/JamomaUtilFunctions.cmake
+++ Shared/CMake/JamomaUtilFunctions.cmake
@@ -48,11 +48,26 @@

 	if(APPLE)
 		if(BUILD_JAMOMAMAX)
+
+			# TODO there appears to be some ambiguity when building because some things are build into debug/release even though CMAKE_BUILD_TYPE is the other here... [tap]
+
+			# ADD_CUSTOM_COMMAND(
+			#   TARGET ${LIBNAME}
+			#   POST_BUILD
+			#   COMMAND ${CMAKE_COMMAND} -E make_directory
+			#    ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support
+			# )
 			ADD_CUSTOM_COMMAND(
 			  TARGET ${LIBNAME}
 			  POST_BUILD
 			  COMMAND ${CMAKE_COMMAND} -E make_directory
-			   ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}/support
+			   ${CMAKE_BINARY_DIR}/Debug/support
+			)
+			ADD_CUSTOM_COMMAND(
+			  TARGET ${LIBNAME}
+			  POST_BUILD
+			  COMMAND ${CMAKE_COMMAND} -E make_directory
+			   ${CMAKE_BINARY_DIR}/Release/support
 			)
 			ADD_CUSTOM_COMMAND(
 			  TARGET ${LIBNAME} #Jamoma::Foundation # for instance


fix pythonpath

fix pythonpath

--- bundle/PostInstall.cmake
+++ bundle/PostInstall.cmake
@@ -12,6 +12,7 @@
   message("SIR test succeded")
 endif()

+set(ENV{PYTHONPATH} "ENV{PYTHONPATH}:${CMAKE_INSTALL_PREFIX}/python")
 foreach(example ${examples})
   execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_INSTALL_PREFIX}/examples/python/${example}.py)
   execute_process(COMMAND diff ${CMAKE_INSTALL_PREFIX}/examples/python/data/${example}.cpp ${CMAKE_INSTALL_PREFIX}/examples/python/data/${example}_ref.cpp RESULT_VARIABLE res)


BUG: libkml base and uriparser dependency

--- SuperBuild/CMake/External_libkml.cmake
+++ SuperBuild/CMake/External_libkml.cmake
@@ -11,15 +11,15 @@
 else()
   SETUP_SUPERBUILD(PROJECT ${proj})
   message(STATUS "  Using libKML SuperBuild version")
-
+
   # declare dependencies
   ##set(${proj}_DEPENDENCIES EXPAT ZLIB BOOST)
   ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} EXPAT ZLIB BOOST)
-
+
   INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
   # set proj back to its original value
   set(proj LIBKML)
-
+
   ADD_SUPERBUILD_CMAKE_VAR(EXPAT_INCLUDE_DIR)
   ADD_SUPERBUILD_CMAKE_VAR(EXPAT_LIBRARY)
   ADD_SUPERBUILD_CMAKE_VAR(ZLIB_INCLUDE_DIR)
@@ -34,7 +34,7 @@
     INSTALL_DIR ${SB_INSTALL_PREFIX}
       DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
     DEPENDS ${${proj}_DEPENDENCIES}
-    PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory  ${CMAKE_SOURCE_DIR}/patches/${proj} ${LIBKML_SB_SRC}
+    PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory  ${CMAKE_SOURCE_DIR}/patches/${proj} ${LIBKML_SB_SRC}
     CMAKE_CACHE_ARGS
       -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
       -DCMAKE_BUILD_TYPE:STRING=Release
@@ -43,14 +43,17 @@
       ${LIBKML_SB_CONFIG}
     CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )
-
+
   set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
   if(WIN32)
+    list(APPEND _SB_${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlbase.lib)
     if(USE_SYSTEM_EXPAT)
-      set(_SB_${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlbase.lib;${EXPAT_LIBRARY})
+      list(APPEND _SB_${proj}_BASE_LIBRARY ${EXPAT_LIBRARY})
     else()
-      set(_SB_${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlbase.lib;${_SB_EXPAT_LIBRARY})
+      list(APPEND _SB_${proj}_BASE_LIBRARY ${_SB_EXPAT_LIBRARY})
     endif()
+    list(APPEND _SB_${proj}_BASE_LIBRARY ${SB_INSTALL_PREFIX}/lib/uriparser.lib)
+
     set(_SB_${proj}_CONVENIENCE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlconvenience.lib)
     set(_SB_${proj}_DOM_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmldom.lib)
     set(_SB_${proj}_ENGINE_LIBRARY ${SB_INSTALL_PREFIX}/lib/kmlengine.lib)
@@ -66,6 +69,6 @@
     set(_SB_${proj}_XSD_LIBRARY ${SB_INSTALL_PREFIX}/lib/libkmlxsd${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(_SB_${proj}_MINIZIP_LIBRARY ${SB_INSTALL_PREFIX}/lib/libminizip${CMAKE_SHARED_LIBRARY_SUFFIX})
   endif()
-
+
 endif()
 endif()


fix build with msvc

fix build with msvc

--- gtest.cmake
+++ gtest.cmake
@@ -13,18 +13,25 @@
     gtest-external
     URL http://googletest.googlecode.com/files/gtest-1.7.0.zip
     URL_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7
+    CMAKE_CACHE_ARGS
+      -Dgtest_force_shared_crt:BOOL=ON
     INSTALL_COMMAND "")
-
+
   ExternalProject_Get_Property(gtest-external binary_dir)
-  add_library(gtest IMPORTED STATIC)
-  set_target_properties(gtest PROPERTIES
-      IMPORTED_LOCATION ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
-  add_dependencies(gtest gtest-external)
-
-  add_library(gtest_main IMPORTED STATIC GLOBAL)
-  set_target_properties(gtest_main PROPERTIES
-      IMPORTED_LOCATION ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX})
-  add_dependencies(gtest_main gtest-external)
+  foreach(lib gtest gtest_main)
+    add_library(${lib} IMPORTED STATIC)
+    add_dependencies(${lib} gtest-external)
+    if(CMAKE_CONFIGURATION_TYPES)
+      foreach(type ${CMAKE_CONFIGURATION_TYPES})
+        string(TOUPPER ${type} TYPE)
+        set_target_properties(${lib} PROPERTIES
+          IMPORTED_LOCATION_${TYPE} ${binary_dir}/${type}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
+      endforeach()
+    else()
+      set_target_properties(${lib} PROPERTIES
+        IMPORTED_LOCATION ${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX})
+    endif()
+  endforeach()

   ExternalProject_Get_Property(gtest-external source_dir)
   set(GTEST_INCLUDE_DIRS ${source_dir}/include)


cmake: fixes cosmetic issue

cmake: fixes cosmetic issue

--- cmake/SetupC99.cmake
+++ cmake/SetupC99.cmake
@@ -5,16 +5,16 @@

     # --------------------------------------------------------------------------
     # Prepare default c99 compiler flags
-
+
     if( SIXTRACKL_DEFAULT_C99_FLAGS )
-        string( REPLACE " " ";" SIXTRL_C99_FLAGS
+        string( REPLACE " " ";" SIXTRL_C99_FLAGS
                 ${SIXTRACKL_DEFAULT_C99_FLAGS} )
-
+
         if( SIXTRL_C99_FLAGS )
-            set( SIXTRACKLIB_C99_FLAGS
+            set( SIXTRACKLIB_C99_FLAGS
                ${SIXTRACKLIB_C99_FLAGS} ${SIXTRL_C99_FLAGS} )
         endif()
-
+
     endif()

 endif()


use more recent openmp flag for ifort

use more recent openmp flag for ifort

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -3,7 +3,7 @@
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
   set(CMAKE_Fortran_FLAGS_INIT "-fopenmp -Wall -Wextra -Wconversion -std=f2008 -pedantic")
 elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
-  set(CMAKE_Fortran_FLAGS_INIT "-openmp -stand f08")
+  set(CMAKE_Fortran_FLAGS_INIT "-qopenmp -stand f08")
 endif()

 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")


manage CCRAM section for L4 devices

manage CCRAM section for L4 devices

--- cmake/stm32/l4.cmake
+++ cmake/stm32/l4.cmake
@@ -15,17 +15,19 @@

 set(STM32_L4_RAM_SIZES
      40K  40K  64K  64K  64K  64K
-     64K 160K 160K 160K 128K 128K
-    128K 128K 128K 320K 320K 320K
+     64K 160K 160K 160K  96K  96K
+     96K  96K  96K 320K 320K 320K
     320K 640K 640K 640K 640K 640K
     640K
 )
+# on devices where CCRAM is remapped to be contiguous with RAM it is included into RAM section
+# If you want to have dedicated section then you will need to use custom linker script
 set(STM32_L4_CCRAM_SIZES
-      8K   8K  16K  16K  16K  16K
-     16K  32K  32K  32K  32K  32K
-     32K  32K  32K  64K  64K  64K
-     64K  64K  64K  64K  64K  64K
-     64K
+      0K   0K   0K   0K   0K   0K
+      0K   0K   0K   0K  32K  32K
+     32K  32K  32K   0K   0K   0K
+      0K   0K   0K   0K   0K   0K
+      0K
 )

 stm32_util_create_family_targets(L4)