Simplify HalideGenerator.cmake a bit

Simplify HalideGenerator.cmake a bit

Remove support for PNacl-on-XCode; we’ve never really supported this
and never will at this point

Former-commit-id: fc3f0de3d6381580896d7a70cbe21c3ce7abce23

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -88,48 +88,36 @@
       WORKING_DIRECTORY "${SCRATCH_DIR}"
       )
   elseif(XCODE)
-    if (NOT target_is_pnacl)
-      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
-                                "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
-        DEPENDS "${args_GENERATOR_TARGET}"
+    add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
+                              "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
+      DEPENDS "${args_GENERATOR_TARGET}"

-        # The generator executable will be placed in a configuration specific
-        # directory, so the Xcode variable $(CONFIGURATION) is passed in the custom
-        # build script.
-        COMMAND "${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${generator_exec}" ${invoke_args}
+      # The generator executable will be placed in a configuration specific
+      # directory, so the Xcode variable $(CONFIGURATION) is passed in the custom
+      # build script.
+      COMMAND "${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${generator_exec}" ${invoke_args}

-        # If we are building an ordinary executable, use libtool to create the
-        # static library.
-        COMMAND libtool -static -o "${FILTER_LIB}" "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
-        WORKING_DIRECTORY "${SCRATCH_DIR}"
-        )
-    else()
-      # For pnacl targets, there is no libtool step
-      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
-        DEPENDS "${args_GENERATOR_TARGET}"
-        COMMAND "${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${generator_exec}" ${invoke_args}
-        WORKING_DIRECTORY "${SCRATCH_DIR}"
-        )
-    endif()
-
+      # If we are building an ordinary executable, use libtool to create the
+      # static library.
+      COMMAND libtool -static -o "${FILTER_LIB}" "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
+      WORKING_DIRECTORY "${SCRATCH_DIR}"
+      )
+  elseif(target_is_pnacl)
+    # No archive step for pnacl targets
+    add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
+      DEPENDS "${args_GENERATOR_TARGET}"
+      COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
+      WORKING_DIRECTORY "${SCRATCH_DIR}"
+      )
   else()
-    if (NOT target_is_pnacl)
-      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
-                                "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
-        DEPENDS "${args_GENERATOR_TARGET}"
-        COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
-        # Create an archive using ar (or similar)
-        COMMAND "${CMAKE_AR}" r "${FILTER_LIB}" "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
-        WORKING_DIRECTORY "${SCRATCH_DIR}"
-        )
-    else()
-      # No archive step for pnacl targets
-      add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
-        DEPENDS "${args_GENERATOR_TARGET}"
-        COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
-        WORKING_DIRECTORY "${SCRATCH_DIR}"
-        )
-    endif()
+    add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
+                              "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
+      DEPENDS "${args_GENERATOR_TARGET}"
+      COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
+      # Create an archive using ar (or similar)
+      COMMAND "${CMAKE_AR}" r "${FILTER_LIB}" "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
+      WORKING_DIRECTORY "${SCRATCH_DIR}"
+      )
   endif()

   # Use a custom target to force it to run the generator before the


CPP-616 - Handle libuv v1.20.4+ include file updates

--- cpp-driver/cmake/modules/CppDriver.cmake
+++ cpp-driver/cmake/modules/CppDriver.cmake
@@ -370,7 +370,9 @@
     LIBUV_LIBRARY
     LIBUV_INCLUDE_DIR)

-  if (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h")
+  if (EXISTS "${LIBUV_INCLUDE_DIR}/uv/version.h")
+    set(LIBUV_VERSION_HEADER_FILE "${LIBUV_INCLUDE_DIR}/uv/version.h")
+  elseif (EXISTS "${LIBUV_INCLUDE_DIR}/uv-version.h")
     set(LIBUV_VERSION_HEADER_FILE "${LIBUV_INCLUDE_DIR}/uv-version.h")
   else()
     set(LIBUV_VERSION_HEADER_FILE "${LIBUV_INCLUDE_DIR}/uv.h")


Define LCB_CC_STRING for MSVS 2017

Define LCB_CC_STRING for MSVS 2017

Change-Id: Ib36a672d2d3ee4d11ab3d5ad87d3f86129d7f03e
Reviewed-on: http://review.couchbase.org/101598
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

--- cmake/Modules/GetPlatformCCInfo.cmake
+++ cmake/Modules/GetPlatformCCInfo.cmake
@@ -23,6 +23,8 @@
         SET(LCB_CC_STRING "vc12")
     ELSEIF(MSVC_VERSION EQUAL 1900)
         SET(LCB_CC_STRING "vc14")
+    ELSEIF(DEFINED MSVC_TOOLSET_VERSION AND MSVC_TOOLSET_VERSION EQUAL 141)
+        SET(LCB_CC_STRING "vc15")
     ENDIF()
 ELSE()
     IF(UNIX)


removed unneeded boost library, that was added for testing

--- cmake/UbiTrackFindCoreLibraries.cmake
+++ cmake/UbiTrackFindCoreLibraries.cmake
@@ -57,7 +57,7 @@
 set(Boost_USE_STATIC_LIBS   OFF)
 set(Boost_USE_MULTITHREADED ON)
 set(Boost_USE_STATIC_RUNTIME OFF)
-find_package( Boost 1.49 COMPONENTS thread date_time system filesystem regex chrono locale serialization program_options python REQUIRED)
+find_package( Boost 1.49 COMPONENTS thread date_time system filesystem regex chrono locale serialization program_options REQUIRED)
 if(Boost_FOUND)
   add_definitions("-DBOOST_FILESYSTEM_VERSION=3")
   add_definitions(-DHAVE_BOOST)


Remove windows newlines.

Remove windows newlines.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -24,13 +24,13 @@
   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
     add_definitions( -UNDEBUG )
     # Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
-    set(REGEXP_NDEBUG "(^| )[/-]D *NDEBUG($| )")
-    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
-      CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
-      CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
-      CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
+    set(REGEXP_NDEBUG "(^| )[/-]D *NDEBUG($| )")
+    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
+      CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
+      CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+    string (REGEX REPLACE "${REGEXP_NDEBUG}" " "
+      CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
   endif()
 else()
   if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELEASE" )


Re-enabling a warning in MSVC mode now that r187292 fixed the only instance of the warning.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -176,7 +176,6 @@
     -wd4351 # Suppress 'new behavior: elements of array 'array' will be default initialized'
     -wd4355 # Suppress ''this' : used in base member initializer list'
     -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated'
-    -wd4551 # Suppress 'function call missing argument list'
     -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible'
     -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'


Give priority to CMAKE_ARGS set via config.cmake.

We were overriding all CMAKE_ARGS set for a package when calling `hunter_cmake_args`.  That meant that CMAKE_ARGS specified in config.cmake weren't being honoured.

This fixes that by changing `hunter_cmake_args` so that it prepends its arguments.  Because config.cmake (containing calls to `hunter_config`) is processed before the packages' hunter.cmake files (containing calls to `hunter_cmake_args`), config.cmake overrides hunter.cmake.

--- cmake/modules/hunter_cmake_args.cmake
+++ cmake/modules/hunter_cmake_args.cmake
@@ -25,7 +25,10 @@
   list(GET _hunter_c_UNPARSED_ARGUMENTS 0 _hunter_c_current_project)

   if(_hunter_c_CMAKE_ARGS)
-    set(HUNTER_${_hunter_c_current_project}_CMAKE_ARGS ${_hunter_c_CMAKE_ARGS})
+    list(
+      # Prepend to list so already-set variables have priority
+      INSERT HUNTER_${_hunter_c_current_project}_CMAKE_ARGS 0
+      ${_hunter_c_CMAKE_ARGS})
   else()
     hunter_fatal_error("Expected CMAKE_ARGS")
   endif()


whoops, fix a couple of typos

whoops, fix a couple of typos

--- lib/FindLibMemCached.cmake
+++ lib/FindLibMemCached.cmake
@@ -10,12 +10,12 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 # Look for the header file
-FIND_PATH(LIBMEMCACHE_INCLUDE_DIR memcached.h /usr/include /usr/include/libmemcached /usr/local/include /usr/local/include/libmemcached)
+FIND_PATH(LIBMEMCACHED_INCLUDE_DIR memcached.h /usr/include /usr/include/libmemcached /usr/local/include /usr/local/include/libmemcached)

 #MARK_AS_ADVANCED(LIBMEMCACHED_INCLUDE_DIR)

 # Look for the library
-FIND_LIBRARY(LIBMEMCACHE_LIBRARY NAMES memcached PATH /usr/lib /usr/local/lib)
+FIND_LIBRARY(LIBMEMCACHED_LIBRARY NAMES memcached PATH /usr/lib /usr/local/lib)
 #MARK_AS_ADVANCED(LIBMEMCACHED_LIBRARY)

 # Copy the results to the output variables.


Set CMP0074 in FindTbagSFML.cmake file.

Set CMP0074 in FindTbagSFML.cmake file.

--- cmake/TbagFindPackage/FindTbagSFML.cmake
+++ cmake/TbagFindPackage/FindTbagSFML.cmake
@@ -6,6 +6,13 @@
 #/// @remarks
 #///  The following variables are optionally searched for defaults:
 #///    - ${SFML_ROOT}
+
+cmake_policy (PUSH)
+
+# Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
+if (POLICY CMP0074)
+    cmake_policy (SET CMP0074 NEW)
+endif ()

 if (NOT DEFINED SFML_ROOT)
     if (IS_DIRECTORY "${THIRD_PREFIX}")
@@ -43,3 +50,5 @@
     message (STATUS "Found SFML: ${SFML_LIBRARIES}")
 endif ()

+cmake_policy (POP)
+


xpClassifiedRepo PATH_URL support

xpClassifiedRepo PATH_URL support

issue https://github.com/smanders/externpro/issues/337

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1551,33 +1551,52 @@

 function(xpClassifiedRepo)
   set(options VERBOSE)
-  set(oneValueArgs REPO HASH WORKING_TREE PATH_UNIX PATH_MSW)
+  set(oneValueArgs REPO HASH WORKING_TREE PATH_UNIX PATH_MSW PATH_URL)
   cmake_parse_arguments(P "${options}" "${oneValueArgs}" "" ${ARGN})
   if(NOT DEFINED P_REPO OR NOT DEFINED P_HASH OR NOT DEFINED P_WORKING_TREE)
     message(FATAL_ERROR "xpClassifiedRepo: REPO, HASH, and WORKING_TREE must be specified")
   endif()
-  if(WIN32 OR CYGWIN)
+  if(DEFINED P_PATH_URL)
+    set(repoPath git://${P_PATH_URL}/${P_REPO}.git)
+    xpGetPkgVar(cURL EXE) # sets CURL_EXE
+    if(DEFINED CURL_EXE)
+      get_target_property(curlExe ${CURL_EXE} IMPORTED_LOCATION_RELEASE)
+      execute_process(
+        COMMAND ${curlExe} -s -o /dev/null -w "%{http_code}" https://${P_PATH_URL}/${P_REPO}
+        OUTPUT_VARIABLE statusCode ERROR_QUIET
+        )
+      if(statusCode EQUAL 200)
+        set(repoFound TRUE)
+      endif()
+    endif()
+  elseif(WIN32 OR CYGWIN)
     if(NOT DEFINED P_PATH_MSW)
-      message(FATAL_ERROR "xpClassifiedRepo: PATH_MSW must be specified")
-    endif()
-    set(repoPath ${P_PATH_MSW})
+      message(FATAL_ERROR "xpClassifiedRepo: PATH_URL or PATH_MSW must be specified")
+    endif()
+    set(repoPath ${P_PATH_MSW}/${P_REPO}.git)
+    if(EXISTS ${repoPath} AND IS_DIRECTORY ${repoPath})
+      set(repoFound TRUE)
+    endif()
   else()
     if(NOT DEFINED P_PATH_UNIX)
-      message(FATAL_ERROR "xpClassifiedRepo: PATH_UNIX must be specified")
-    endif()
-    set(repoPath ${P_PATH_UNIX})
-  endif()
-  if(EXISTS ${repoPath}/${P_REPO} AND IS_DIRECTORY ${repoPath}/${P_REPO})
+      message(FATAL_ERROR "xpClassifiedRepo: PATH_URL or PATH_UNIX must be specified")
+    endif()
+    set(repoPath ${P_PATH_UNIX}/${P_REPO}.git)
+    if(EXISTS ${repoPath} AND IS_DIRECTORY ${repoPath})
+      set(repoFound TRUE)
+    endif()
+  endif()
+  if(repoFound)
     if(P_VERBOSE)
       message(STATUS "=====================================================================")
       message(STATUS " Classified repo found. Classified build configuration proceeding... ")
       message(STATUS "=====================================================================")
     endif()
-    xpGitCheckout(${repoPath}/${P_REPO} ${P_HASH} ${P_WORKING_TREE})
+    xpGitCheckout(${repoPath} ${P_HASH} ${P_WORKING_TREE})
     # make XP_CLAS_REPO available to xpClassifiedSrc and xpClassifiedSrcExc via PARENT_SCOPE
     set(XP_CLAS_REPO ${P_WORKING_TREE} PARENT_SCOPE)
   elseif(P_VERBOSE)
-    message(STATUS "Unclassified build, repo not accessible: ${repoPath}/${P_REPO}")
+    message(STATUS "Unclassified build, repo not accessible: ${repoPath}")
   endif()
 endfunction()


retrieve MSVC version from cl.exe instead of by compiling a test file

--- test.cmake
+++ test.cmake
@@ -180,8 +180,11 @@
 set(compiler)
 macro(extract_msvc_compiler_info CL)
    if(CL)
-      execute_process(COMMAND ${CL} /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
+      execute_process(COMMAND ${CL} OUTPUT_QUIET ERROR_VARIABLE COMPILER_VERSION)
+      string(REGEX MATCH "Version ([0-9\\.]+)" COMPILER_VERSION ${COMPILER_VERSION})
+      string(REPLACE "Version " "" COMPILER_VERSION "${COMPILER_VERSION}")
       string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
+      set(COMPILER_VERSION "MSVC ${COMPILER_VERSION}")
       if("${CL}" MATCHES "amd64")
          set(COMPILER_VERSION "${COMPILER_VERSION} amd64")
       elseif("${CL}" MATCHES "ia64")


[cmake] greatly improve the cppcheck target

now supports arbitray number of input files and passes all include flags to cppcheck

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -54,12 +54,16 @@
 MACRO( ADD_CPPCHECK )
 	find_program( CPPCHECK_BINARY NAMES cppcheck )
 	IF( EXISTS ${CPPCHECK_BINARY} )
+		SET(CPPINLINST ${CMAKE_CURRENT_BINARY_DIR}/cppcheck.files )
+		IF( EXISTS ${CPPINLINST} )
+			file(REMOVE  ${CPPINLINST} )
+		ENDIF()
 		FOREACH( SOURCEFILE ${ARGN} )
-			LIST( APPEND CHECKPATHS ${SOURCEFILE} )
+			FILE( APPEND  ${CPPINLINST}  "${SOURCEFILE}\n" )
 		ENDFOREACH( SOURCEFILE )
-		TO_LIST_SPACES( CPPCHECK_FLAGS CPPCHECK_FLAGS_SPLIT )
-		ADD_CUSTOM_TARGET(  cppcheck cppcheck "--xml" "--enable=all" "-f" "--quiet" "-j 3"
-							${CPPCHECK_FLAGS_SPLIT} ${CHECKPATHS} "2>cppcheck.xml" )
+		TO_LIST_SPACES( PLAIN_INCLUDE_DIRS CPPCHECK_FLAGS_SPLIT )
+		ADD_CUSTOM_TARGET(  cppcheck cppcheck --xml --enable=all -f --quiet --file-list=${CPPINLINST}
+				${CPPCHECK_FLAGS_SPLIT}  2>cppcheck.xml )
 	ELSE( EXISTS ${CPPCHECK_BINARY} )
 		MESSAGE( STATUS "Not adding cppcheck target because cppcheck executable not found" )
 	ENDIF( EXISTS ${CPPCHECK_BINARY} )


Fixed startup script selection

Fixed startup script selection

--- cmake/FindCMSIS.cmake
+++ cmake/FindCMSIS.cmake
@@ -232,10 +232,10 @@

         set(STARTUP_NAMES startup_stm32${TYPE_L}.s startup_stm32${TYPE_L}${CORE_Ucm}.s)
         if(${FAMILY} STREQUAL "MP1")
-            # There are stm32mp15?axx.s and stm32mp15?cxx.s files but no stm32mp15?dxx.s nor stm32mp15?fxx.s. No idea why.
-            # I think that stm32mp15xx.s should be compatible with all stm32mp15 devices anyway.
-            # This might need refinement if devices other stm32mp15 are released.
-            list(APPEND STARTUP_NAMES startup_stm32mp15xx.s)
+            # stm32mp15?dxx.s uses stm32mp15?axx.s
+            # stm32mp15?fxx.s uses stm32mp15?cxx.s
+            string(REPLACE "dxx" "axx" STARTUP_NAMES ${STARTUP_NAMES})
+            string(REPLACE "fxx" "cxx" STARTUP_NAMES ${STARTUP_NAMES})
         endif()

         find_file(CMSIS_${FAMILY}${CORE_U}_${TYPE}_STARTUP


fix find fatfs

fix find fatfs

--- cmake/FindFATFS.cmake
+++ cmake/FindFATFS.cmake
@@ -8,21 +8,26 @@
     ff.c
     ff_gen_drv.c
 )
-SET(FATFS_DIRVER_SOURCES
-    sd_diskio.c
-    sdram_diskio.c
-    sram_diskio.c
-    usbh_diskio.c
-)
-SET(FATFS_OPTION_SOURCES
-    cc932.c
-    cc936.c
-    cc949.c
-    cc950.c
-    ccsbcs.c
-    syscall.c
-    unicode.c
-)
+
+if(STORAGE_DRIVER EQUAL SDCARD)
+    SET(FATFS_DIRVER_SOURCES sd_diskio.c)
+elseif(STORAGE_DRIVER EQUAL SDRAM)
+    SET(FATFS_DIRVER_SOURCES sdram_diskio.c)
+elseif(STORAGE_DRIVER EQUAL SRAM)
+    SET(FATFS_DIRVER_SOURCES sram_diskio.c)
+elseif(STORAGE_DRIVER EQUAL USB)
+    SET(FATFS_DIRVER_SOURCES usbh_diskio.c)
+endif()
+
+SET(FATFS_OPTION_SOURCES syscall.c unicode.c)
+#if(CODE_PAGE EQUAL CP932)
+#list(APPEND FATFS_OPTION_SOURCES cc932.c)
+#(    cc936.c
+#    cc949.c
+#    cc950.c
+#    ccsbcs.c
+#    unicode.c
+#)

 SET(FATFS_COMMON_HEADERS
     diskio.h


Check GCC version on Ubuntu

Check GCC version on Ubuntu

Summary:
Thanks to feldim2425 we know that GCC 5 in Ubuntu 17.04 and later
doesn't define the macro _GLIBCXX_USE_C99 and by extension the
std::to_string, std::stoi, and std::stod functions (and probably
more). Instead of avoiding using these functions, we simply recommend
people to use GCC 6 or higher on the newer Ubuntu versions where GCC 5
doesn't work.

As a side note, CUDA 8.0 is compatible with GCC up to version 5. This
implies that compiling Caffe2 with CUDA on Ubuntu >= 17.10 implies
using CUDA >= 9.0. If you need to compile with CUDA 8.0 and are on
Ubuntu, you are stuck on version 16.04 or lower.

I verified this fix by running cmake on Ubuntu 17.10 with
-DCMAKE_CXX_COMPILER=/usr/bin/g++5 and observing the fatal error.

This closes #1633.
Closes https://github.com/caffe2/caffe2/pull/1645

Differential Revision: D6620812

Pulled By: pietern

fbshipit-source-id: 29af88cad9bede4fd952084c404c85db05baa9c4

--- cmake/MiscCheck.cmake
+++ cmake/MiscCheck.cmake
@@ -1,5 +1,32 @@
 include(CheckCXXSourceCompiles)
 include(CMakePushCheckState)
+
+# ---[ If running on Ubuntu, check system version and compiler version.
+if(EXISTS "/etc/os-release")
+  execute_process(COMMAND
+    "sed" "-ne" "s/^ID=\\([a-z]\\+\\)$/\\1/p" "/etc/os-release"
+    OUTPUT_VARIABLE OS_RELEASE_ID
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  execute_process(COMMAND
+    "sed" "-ne" "s/^VERSION_ID=\"\\([0-9\\.]\\+\\)\"$/\\1/p" "/etc/os-release"
+    OUTPUT_VARIABLE OS_RELEASE_VERSION_ID
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  if(OS_RELEASE_ID STREQUAL "ubuntu")
+    if(OS_RELEASE_VERSION_ID VERSION_GREATER "17.04")
+      if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+        if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0.0")
+          message(FATAL_ERROR
+            "Please use GCC 6 or higher on Ubuntu 17.04 and higher. "
+            "For more information, see: "
+            "https://github.com/caffe2/caffe2/issues/1633"
+            )
+        endif()
+      endif()
+    endif()
+  endif()
+endif()

 # ---[ Check if the data type long and int32_t/int64_t overlap.
 cmake_push_check_state(RESET)


[cmake] copy the latest axl_cmake.cmake dropper

--- cmake/axl_cmake.cmake
+++ cmake/axl_cmake.cmake
@@ -107,7 +107,7 @@
 		if (NOT _PATHS_CMAKE)
 			include (${AXL_CMAKE_ORIGIN_DIR}/dependencies.cmake)
 			string (REPLACE ";" " " _PATH_LIST "${AXL_PATH_LIST}")
-			message (FATAL_ERROR "please create paths.cmake and fill it with definitions for: ${_PATH_LIST}")
+			message (FATAL_ERROR "AXL_CMAKE_DIR not found, create paths.cmake and fill it with definitions for: ${_PATH_LIST}")
 		endif ()

 		include (${_PATHS_CMAKE})


no need for -pthread for AppleClang

no need for -pthread for AppleClang

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -41,7 +41,6 @@

         # set flags
         set(CMAKE_CXX_FLAGS                     "-std=c++14 -pedantic -march=native -mtune=native")
-        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")
@@ -54,6 +53,10 @@
         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_EXE_LINKER_FLAGS              "-flto")
+
+        if(NOT CMAKE_CXX_COMPILER_ID MATCHES AppleClang)
+                set(CMAKE_CXX_FLAGS             "${CMAKE_CXX_FLAGS} -pthread")
+        endif()

         # set address sanitizer
         if(NANOCV_WITH_ASAN)


MDEV-10954: MariaDB Galera: wsrep_sst_common: line 120: which: command not found

Add 'which' to REQUIRES list.

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -160,7 +160,7 @@
 IF(WITH_WSREP)
 SETA(CPACK_RPM_server_PACKAGE_REQUIRES
   "galera" "rsync" "lsof" "grep" "gawk" "iproute"
-  "coreutils" "findutils" "tar")
+  "coreutils" "findutils" "tar" "which")
 ENDIF()

 SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)


Added link flags for stripping of symbols for release builds and the generation of link map for all builds

--- cmake/gcc_stm32.cmake
+++ cmake/gcc_stm32.cmake
@@ -69,12 +69,12 @@
 SET(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c compiler flags debug")
 SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx compiler flags debug")
 SET(CMAKE_ASM_FLAGS_DEBUG "-g" CACHE INTERNAL "asm compiler flags debug")
-SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "linker flags debug")
+SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "-Xlinker -Map=output.map" CACHE INTERNAL "linker flags debug")

 SET(CMAKE_C_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "c compiler flags release")
 SET(CMAKE_CXX_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "cxx compiler flags release")
 SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm compiler flags release")
-SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto" CACHE INTERNAL "linker flags release")
+SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Xlinker -Map=output.map -s -flto" CACHE INTERNAL "linker flags release")

 SET(CMAKE_FIND_ROOT_PATH "${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET}" ${EXTRA_FIND_PATH})
 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)


Remove LOGF_EXISTS from CACHE

Remove LOGF_EXISTS from CACHE

--- tests/find_mkl.cmake
+++ tests/find_mkl.cmake
@@ -42,6 +42,7 @@
 CHECK_FUNCTION_EXISTS(logf LOGF_EXISTS)
 if(NOT LOGF_EXISTS)
   unset(LOGF_EXISTS)
+  unset(LOGF_EXISTS CACHE)
   list(APPEND CMAKE_REQUIRED_LIBRARIES m)
   CHECK_FUNCTION_EXISTS(logf LOGF_EXISTS)
   if(LOGF_EXISTS)


[GTest] remove unnecessary find of GTest

--- SuperBuild/External_Gadgetron.cmake
+++ SuperBuild/External_Gadgetron.cmake
@@ -26,9 +26,6 @@

 # Set dependency list
 set(${proj}_DEPENDENCIES "Boost;HDF5;ISMRMRD;FFTW3double;Armadillo;GTest")
-if(${USE_SYSTEM_GTest})
-  find_package(GTest)
-endif()

 # Include dependent projects if any
 ExternalProject_Include_Dependencies(${proj} DEPENDS_VAR ${proj}_DEPENDENCIES)


provided access credentials

provided access credentials

--- Superbuild/SCIRunDataExternal.cmake
+++ Superbuild/SCIRunDataExternal.cmake
@@ -31,6 +31,9 @@

 ExternalProject_Add(SCI_data_external
   SVN_REPOSITORY "${data_SVN_URL}"
+  SVN_TRUST_CERT 1
+  SVN_USERNAME "anonymous"
+  SVN_PASSWIRD ""
   DOWNLOAD_DIR "${sci_data_DIR}"
   PATCH_COMMAND ""
   INSTALL_DIR ""
@@ -38,7 +41,6 @@
   CONFIGURE_COMMAND ""
   CMAKE_COMMAND ""
   BUILD_COMMAND ""
-  SVN_TRUST_CERT 1
 )

 ExternalProject_Get_Property(SCI_data_external BINARY_DIR)


Updated ext/FindOpenCL.cmake with better formatting

--- ext/FindOpenCL.cmake
+++ ext/FindOpenCL.cmake
@@ -6,10 +6,35 @@
 # OPENCL_FOUND - if the library was successfully located

 if(WIN32)
+	find_path(OPENCL_INCLUDES CL/cl.h)

+    # The AMD SDK currently installs both x86 and x86_64 libraries
+    # This is only a hack to find out architecture
+    if( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
+    	set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
+		set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64")
+    else (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
+    	set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
+   		set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86")
+    endif( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
+
+    # find out if the user asked for a 64-bit build, and use the corresponding
+    # 64 or 32 bit NVIDIA library paths to the search:
+    STRING(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR})
+    if("${ISWIN64}" STREQUAL "Win64")
+    	find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64)
+    else("${ISWIN64}" STREQUAL "Win64")
+    	find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32)
+    endif("${ISWIN64}" STREQUAL "Win64")
+
+    GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
+
+    # On Win32 search relative to the library
+    find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
+    find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
 endif(WIN32)
-
 if (APPLE)
+	find_path(OPENCL_INCLUDES OpenCL/cl.h)
     find_library(FRAMEWORK_OpenCL
         NAMES OpenCL
         PATHS ${CMAKE_OSX_SYSROOT}/System/Library
@@ -18,7 +43,21 @@
     )
     set(OPENCL_LIBRARY ${FRAMEWORK_OpenCL})
 endif(APPLE)
+if(LINUX)
+	find_path( NAMES CL/cl.h OpenCL/cl.h
+	HINTS ENV OPENCL_DIR
+	PATHS 	"/usr/include"
+			"/usr/local/include")
+	find_library(	OPENCL_LIBRARY
+					NAMES OpenCL
+					HINTS ENV OPENCL_DIR
+					PATHS 	"/lib"
+							"/usr/lib"
+							"/usr/local/lib"
+	)
+endif(LINUX)

+MARK_AS_ADVANCED(OPENCL_INCLUDES OPENCL_LIBRARY)

 set(OPENCL_INCLUDE_DIRECTORIES ${OPENCL_INCLUDES})
 set(OPENCL_LIBRARIES ${OPENCL_LIBRARY} ${OPENCL_DEPENDENCIES})
@@ -27,4 +66,10 @@
 # handle the QUIETLY and REQUIRED arguments and set OPENCL_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(OpenCL  DEFAULT_MSG
-                                  OPENCL_LIBRARY)
+                                  OPENCL_LIBRARY OPENCL_INCLUDES)
+
+if(OpenCL_FOUND)
+    MESSAGE(STATUS "OpenCL found: ${OPENCL_INCLUDE_DIRECTORIES}/sgct.h")
+else()
+    MESSAGE(FATAL_ERROR "OpenCL not found!")
+endif(OpenCL_FOUND)


CMake: Bugfix: Also include 3rd party include directories in FindPETSC.conf

It is really necessary to use all exported include directories from a PETSc
installation.

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

--- deal.II/cmake/modules/FindPETSC.cmake
+++ deal.II/cmake/modules/FindPETSC.cmake
@@ -46,11 +46,47 @@
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

+#
+# Search for the first part of the includes:
+#
+
+FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h
+  HINTS
+    # petsc is special. Account for that
+    ${PETSC_DIR}
+    ${PETSC_DIR}/${PETSC_ARCH}
+    ${PETSC_INCLUDE_DIRS}
+  PATH_SUFFIXES petsc include include/petsc
+)
+
+#
+# Sometimes, this is not enough...
+# If petsc is not installed but in source tree layout, there will be
+#   ${PETSC_DIR}/${PETSC_ARCH}/include - which we should have found by now.
+#   ${PETSC_DIR}/include               - which we still have to find.
+#
+# Or it is installed in a non standard layout in the system (e.g. in
+# Gentoo), where there will be
+#   ${PETSC_DIR}/${PETSC_ARCH}/include
+#   /usr/include/petsc ...
+#
+# Either way, we must be able to find petscversion.h:
+#
+
+FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h
+  HINTS
+    ${PETSC_DIR}
+    ${PETSC_DIR}/${PETSC_ARCH}
+    ${PETSC_INCLUDE_DIRS}
+  PATH_SUFFIXES petsc include include/petsc
+)

 #
 # So, up to this point it was easy. Now, the tricky part. Search for
-# petscvariables and determine the link interface from that file:
-#
+# petscvariables and determine the includes and the link interface from
+# that file:
+#
+
 FIND_FILE(PETSC_PETSCVARIABLES
   NAMES petscvariables
   HINTS
@@ -60,12 +96,39 @@
   )

 IF(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
+
+  #
+  # Includes:
+  #
+
+  FILE(STRINGS "${PETSC_PETSCVARIABLES}" _external_includes
+    REGEX "^PETSC_CC_INCLUDES =.*")
+  SEPARATE_ARGUMENTS(_external_includes)
+
+  SET(_petsc_includes)
+  FOREACH(_token ${_external_includes}})
+    IF(_token MATCHES "^-I")
+      STRING(REGEX REPLACE "^-I" "" _token "${_token}")
+      LIST(APPEND _petsc_includes ${_token})
+    ENDIF()
+  ENDFOREACH()
+
+  # Remove petsc's own include directories:
+  IF(NOT "${_petsc_includes}" STREQUAL "")
+    LIST(REMOVE_ITEM _petsc_includes "${PETSC_INCLUDE_DIR_COMMON}")
+    LIST(REMOVE_ITEM _petsc_includes "${PETSC_INCLUDE_DIR_ARCH}")
+  ENDIF()
+
+  #
+  # Link line:
+  #

   FILE(STRINGS "${PETSC_PETSCVARIABLES}" _external_link_line
     REGEX "^PETSC_WITH_EXTERNAL_LIB =.*")
   SEPARATE_ARGUMENTS(_external_link_line)

   SET(_hints)
+  SET(_petsc_libraries)
   FOREACH(_token ${_external_link_line}})
     IF(_token MATCHES "^-L")
       # Build up hints with the help of all tokens passed with -L:
@@ -90,41 +153,10 @@
       ENDIF()
     ENDIF()
   ENDFOREACH()
+
 ENDIF()

-#
-# Search for the first part of the includes:
-#
-FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h
-  HINTS
-    # petsc is special. Account for that
-    ${PETSC_DIR}
-    ${PETSC_DIR}/${PETSC_ARCH}
-    ${PETSC_INCLUDE_DIRS}
-  PATH_SUFFIXES petsc include include/petsc
-)
-
-#
-# Sometimes, this is not enough...
-# If petsc is not installed but in source tree layout, there will be
-#   ${PETSC_DIR}/${PETSC_ARCH}/include - which we should have found by now.
-#   ${PETSC_DIR}/include               - which we still have to find.
-#
-# Or it is installed in a non standard layout in the system (e.g. in
-# Gentoo), where there will be
-#   ${PETSC_DIR}/${PETSC_ARCH}/include
-#   /usr/include/petsc ...
-#
-# Either way, we must be able to find petscversion.h:
-#
-FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h
-  HINTS
-    ${PETSC_DIR}
-    ${PETSC_DIR}/${PETSC_ARCH}
-    ${PETSC_INCLUDE_DIRS}
-  PATH_SUFFIXES petsc include include/petsc
-)

 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PETSC DEFAULT_MSG
   PETSC_LIBRARY
@@ -146,8 +178,9 @@
     ${_petsc_libraries}
     )
   SET(PETSC_INCLUDE_DIRS
+    ${PETSC_INCLUDE_DIR_COMMON}
     ${PETSC_INCLUDE_DIR_ARCH}
-    ${PETSC_INCLUDE_DIR_COMMON}
+    ${_petsc_includes}
     )

   SET(PETSC_PETSCCONF_H "${PETSC_INCLUDE_DIR_ARCH}/petscconf.h")


zlib.cmake: Use zlib's configure script instead of zlib's CMakeLists, because the CMakeLists script doesn't work on Mac.  Also, BUILD_IN_SOURCE because the configure script requires it.

--- zlib.cmake
+++ zlib.cmake
@@ -23,10 +23,14 @@
     URL_MD5             ${zlib_MD5}
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
-    CONFIGURE_COMMAND   ${FLYEM_ENV_STRING} ${CMAKE_COMMAND} ${zlib_SRC_DIR}
-        -DCMAKE_INSTALL_PREFIX=${FLYEM_BUILD_DIR}
-        -DCMAKE_PREFIX_PATH=${FLYEM_BUILD_DIR}
+    #CONFIGURE_COMMAND   ${FLYEM_ENV_STRING} ${CMAKE_COMMAND} ${zlib_SRC_DIR}
+    #    -DCMAKE_INSTALL_PREFIX=${FLYEM_BUILD_DIR}
+    #    -DCMAKE_PREFIX_PATH=${FLYEM_BUILD_DIR}
+    CONFIGURE_COMMAND ${FLYEM_ENV_STRING} ./configure
+        --prefix=${FLYEM_BUILD_DIR}
+        --64
     BUILD_COMMAND       ${FLYEM_ENV_STRING} make
+    BUILD_IN_SOURCE     1
     INSTALL_COMMAND     ${FLYEM_ENV_STRING} make install
 )


BUG: ADD missing include directories for expat

--- CMake/ImportExpat.cmake
+++ CMake/ImportExpat.cmake
@@ -25,8 +25,8 @@
     MESSAGE(STATUS "  Expat library  : ${EXPAT_LIBRARY}")
 ELSE(OTB_USE_EXTERNAL_EXPAT)
     ADD_DEFINITIONS(-DOTB_USE_INTERNAL_EXPAT)
-    #INCLUDE_DIRECTORIES(BEFORE "${OTB_SOURCE_DIR}/Utilities/otbexpat")
-    #INCLUDE_DIRECTORIES(BEFORE "${OTB_BINARY_DIR}/Utilities/otbexpat")
+    INCLUDE_DIRECTORIES(BEFORE "${OTB_SOURCE_DIR}/Utilities/otbexpat")
+    INCLUDE_DIRECTORIES(BEFORE "${OTB_BINARY_DIR}/Utilities/otbexpat")
     IF(NOT BUILD_SHARED_LIBS)
       ADD_DEFINITIONS(-DXML_STATIC)
     ENDIF(NOT BUILD_SHARED_LIBS)


ctest: disable the SubProject name

ctest: disable the SubProject name

SubProjects currently don't improve the overview but rather make the
dashboard more cumbersume to navigate

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

--- test.cmake
+++ test.cmake
@@ -210,7 +210,8 @@
 endif()

 macro(go)
-   set_property(GLOBAL PROPERTY SubProject "master: ${compiler}")
+   # SubProjects currently don't improve the overview but rather make the dashboard more cumbersume to navigate
+   #set_property(GLOBAL PROPERTY SubProject "master: ${compiler}")
    set_property(GLOBAL PROPERTY Label other)
    CTEST_START (${dashboard_model})
    set(res 0)


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -100,7 +100,7 @@
     # if we could extract them, compare with the requested version number
     if (SFML_VERSION_MAJOR)
         # transform version numbers to an integer
-		math(EXPR SFML_VERSION "2 * 10000 + 1 * 100" )
+		math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100")

         # compare them
         if(SFML_VERSION LESS SFML_REQUESTED_VERSION)


New version: 0.4.4

New version: 0.4.4

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


pw_build/cmake: Rename _pw_library_multi_value_args

Renames _pw_library_multi_value_args to
_pw_add_library_multi_value_args to directly match pw_add_library.

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

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -156,8 +156,8 @@
   endforeach()
 endfunction(pw_auto_add_module_tests)

-# Sets the provided variable to the common library arguments.
-macro(_pw_library_multi_value_args variable)
+# Sets the provided variable to the multi_value_keywords from pw_add_library.
+macro(_pw_add_library_multi_value_args variable)
   set("${variable}" SOURCES HEADERS
                     PUBLIC_DEPS PRIVATE_DEPS
                     PUBLIC_INCLUDES PRIVATE_INCLUDES
@@ -192,7 +192,7 @@
   set(num_positional_args 2)
   set(option_args)
   set(one_value_args)
-  _pw_library_multi_value_args(multi_value_args)
+  _pw_add_library_multi_value_args(multi_value_args)
   pw_parse_arguments_strict(
       pw_add_library "${num_positional_args}" "${option_args}"
       "${one_value_args}" "${multi_value_args}")
@@ -296,7 +296,7 @@
 #   PRIVATE_LINK_OPTIONS - private target_link_options arguments
 #
 function(pw_add_module_library NAME)
-  _pw_library_multi_value_args(multi_value_args IMPLEMENTS_FACADES)
+  _pw_add_library_multi_value_args(multi_value_args IMPLEMENTS_FACADES)
   pw_parse_arguments_strict(pw_add_module_library 1 "" "" "${multi_value_args}")

   # Check that the library's name is prefixed by the module name.
@@ -382,7 +382,7 @@
 #  DEFAULT_BACKEND - which backend to use by default
 #
 function(pw_add_facade NAME)
-  _pw_library_multi_value_args(list_args)
+  _pw_add_library_multi_value_args(list_args)
   pw_parse_arguments_strict(pw_add_facade 1 "" "DEFAULT_BACKEND" "${list_args}")

   # If no backend is set, a script that displays an error message is used


CTest: Merge improvments from datapar branch

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

--- test.cmake
+++ test.cmake
@@ -3,28 +3,48 @@
    get_filename_component(CTEST_SOURCE_DIRECTORY "${CMAKE_CURRENT_LIST_FILE}" PATH)
 endif()

+macro(read_argument name)
+   if(NOT ${name})
+      if(DEFINED ENV{${name}})
+         set(${name} "$ENV{${name}}")
+      elseif(${ARGC} GREATER 1)
+         set(${name} "${ARGV1}")
+      endif()
+   endif()
+   #message(STATUS "argument ${name}: '${${name}}'")
+endmacro()
+
 # Dashboard Model
 ################################################################################
-set(dashboard_model "$ENV{dashboard_model}")
-if(NOT dashboard_model)
-   set(dashboard_model "Experimental")
+read_argument(dashboard_model "Experimental")
+if(${dashboard_model} STREQUAL "Continuous")
+   set(is_continuous TRUE)
+elseif(${dashboard_model} STREQUAL "Experimental")
+   set(is_experimental TRUE)
+elseif(${dashboard_model} STREQUAL "Nightly")
+   set(is_nightly TRUE)
+else()
+   message(FATAL_ERROR "Unknown dashboard_model '${dashboard_model}'. Please use one of Experimental, Continuous, Nightly.")
 endif()

 # Set build variables from environment variables
 ################################################################################
-set(target_architecture "$ENV{target_architecture}")
-set(skip_tests "$ENV{skip_tests}")
+read_argument(target_architecture)
+read_argument(skip_tests FALSE)
+read_argument(subset)
+read_argument(CXXFLAGS "")
+set(ENV{CXXFLAGS} "${CXXFLAGS}")

 # Set CMAKE_BUILD_TYPE from environment variable
 ################################################################################
 set(appveyor $ENV{APPVEYOR})
 if(appveyor)
    set(build_type "$ENV{CONFIGURATION}")
-else()
-   set(build_type "$ENV{build_type}")
-endif()
-if(NOT build_type)
-   set(build_type "Release")
+   if(NOT build_type)
+      set(build_type "Release")
+   endif()
+else()
+   read_argument(build_type "Release")
 endif()

 # better make sure we get english output (this is vital for the implicit_type_conversion_failures tests)
@@ -87,7 +107,7 @@
    execute_process(COMMAND
       reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0" /v Identifier
       OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE processorId)
-   if("${processorId}" MATCHES "AMD64")
+   if("${processorId}" MATCHES "(Intel|AMD)64")
       set(chip "amd64")
    elseif("${processorId}" MATCHES "x86")
       set(chip "x86")
@@ -116,7 +136,7 @@

 # Determine the processor count (number_of_processors)
 ################################################################################
-set(number_of_processors "$ENV{NUMBER_OF_PROCESSORS}")
+read_argument(number_of_processors)
 if(NOT number_of_processors)
    if("${arch}" MATCHES "[Ww]indows" OR "${arch}" MATCHES "win7" OR "${arch}" MATCHES "mingw" OR "${arch}" MATCHES "msys")
       execute_process(COMMAND
@@ -221,7 +241,7 @@

 # Build the CTEST_BUILD_NAME string
 ################################################################################
-if(target_architecture)
+if(DEFINED 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)
@@ -240,11 +260,9 @@
 else()
    set(build_type_short "${build_type}")
 endif()
-string(STRIP "${git_branch} ${COMPILER_VERSION} $ENV{CXXFLAGS} ${build_type_short} ${tmp} ${chip} ${os_ident}" CTEST_BUILD_NAME)
-if("$ENV{subset}" STREQUAL "sse")
-   set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} sse")
-elseif("$ENV{subset}" STREQUAL "avx")
-   set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} avx")
+string(STRIP "${git_branch} ${COMPILER_VERSION} ${CXXFLAGS} ${build_type_short} ${tmp} ${chip} ${os_ident}" CTEST_BUILD_NAME)
+if(DEFINED subset)
+   set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} ${subset}")
 endif()

 string(REPLACE "  " " " CTEST_BUILD_NAME "${CTEST_BUILD_NAME}")
@@ -283,14 +301,19 @@

 if(WIN32)
    if("${compiler}" STREQUAL "MSVC")
+      find_program(NINJA ninja)
       find_program(JOM jom)
-      if(JOM)
-	 set(CTEST_CMAKE_GENERATOR "NMake Makefiles JOM")
-	 set(CMAKE_MAKE_PROGRAM "jom")
+      if(NINJA)
+         set(CTEST_CMAKE_GENERATOR "Ninja")
+         set(CMAKE_MAKE_PROGRAM "${NINJA}")
+         set(MAKE_ARGS "-k50")
+      elseif(JOM)
+         set(CTEST_CMAKE_GENERATOR "NMake Makefiles JOM")
+         set(CMAKE_MAKE_PROGRAM "${JOM}")
       else()
-	 set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
-	 set(CMAKE_MAKE_PROGRAM "nmake")
-	 set(MAKE_ARGS "-I")
+         set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
+         set(CMAKE_MAKE_PROGRAM "nmake")
+         set(MAKE_ARGS "-I")
       endif()
    elseif("${compiler}" STREQUAL "MinGW")
       set(CTEST_CMAKE_GENERATOR "MSYS Makefiles")
@@ -311,7 +334,7 @@
    list(APPEND configure_options "-DTEST_OPERATOR_FAILURES=TRUE")
 endif()
 list(APPEND configure_options "-DUSE_CCACHE=ON")
-if(target_architecture)
+if(DEFINED target_architecture)
    list(APPEND configure_options "-DTARGET_ARCHITECTURE=${target_architecture}")
 endif()

@@ -327,7 +350,7 @@
    set_property(GLOBAL PROPERTY Label other)
    CTEST_START (${dashboard_model})
    set(res 0)
-   if(NOT ${dashboard_model} STREQUAL "Experimental")
+   if(NOT is_experimental)
       CTEST_UPDATE (SOURCE "${CTEST_SOURCE_DIRECTORY}" RETURN_VALUE res)
       if(res GREATER 0)
          ctest_submit(PARTS Update)
@@ -362,9 +385,9 @@
                PARALLEL_LEVEL ${number_of_processors})
             ctest_submit(PARTS Test)
          else()
-            if("$ENV{subset}" STREQUAL "sse")
+            if("${subset}" STREQUAL "sse")
                set(label_list other Scalar SSE)
-            elseif("$ENV{subset}" STREQUAL "avx")
+            elseif("${subset}" STREQUAL "avx")
                set(label_list AVX AVX2 MIC)
             else()
                set(label_list other Scalar SSE AVX AVX2 MIC)
@@ -402,14 +425,11 @@
                endif()
             endforeach()
          endif()
-         if(NOT test_results EQUAL 0)
-            message(FATAL_ERROR "One or more tests failed.")
-         endif()
       endif()
    endif()
 endmacro()

-if(${dashboard_model} STREQUAL "Continuous")
+if(is_continuous)
    while(${CTEST_ELAPSED_TIME} LESS 64800)
       set(START_TIME ${CTEST_ELAPSED_TIME})
       go()
@@ -420,4 +440,7 @@
       CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
    endif()
    go()
-endif()
+   if(NOT test_results EQUAL 0)
+      message(FATAL_ERROR "One or more tests failed.")
+   endif()
+endif()


Allow additional common_application parameters, e.g,, MACOSX_BUNDLE

--- CommonApplication.cmake
+++ CommonApplication.cmake
@@ -3,10 +3,11 @@
 # Configures the build for a simple application:
 #   common_application(<Name>)
 #
-# Uses:
+# Input:
 # * NAME_SOURCES for all compilation units
 # * NAME_HEADERS for all internal header files
 # * NAME_LINK_LIBRARIES for dependencies of name
+# * ARGN for optional add_executable parameters
 #
 # Builds Name application and installs it.

@@ -19,7 +20,7 @@
   set(HEADERS ${${NAME}_HEADERS})
   set(LINK_LIBRARIES ${${NAME}_LINK_LIBRARIES})

-  add_executable(${Name} ${HEADERS} ${SOURCES})
+  add_executable(${Name} ${ARGN} ${HEADERS} ${SOURCES})
   target_link_libraries(${Name} ${LINK_LIBRARIES})
   install(TARGETS ${Name} DESTINATION bin COMPONENT apps)
 endfunction()


ENH: update internal FindOpenThreads

ENH: update internal FindOpenThreads

--- CMake/FindOpenThreads.cmake
+++ CMake/FindOpenThreads.cmake
@@ -16,6 +16,19 @@
 # used in building osg.
 #
 # Created by Eric Wing.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+#  License text for the above reference.)

 # Header files are presumed to be included like
 # #include <OpenThreads/Thread>
@@ -38,128 +51,73 @@
 # standard install paths.
 # Explicit -DVAR=value arguments should still be able to override everything.

-FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
+find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
+    HINTS
+        # enough environment variables?
+        $ENV{OPENTHREADS_INCLUDE_DIR}
+        $ENV{OPENTHREADS_DIR}
+        $ENV{OSG_INCLUDE_DIR}
+        $ENV{OSG_DIR}
+        $ENV{OSGDIR}
+        $ENV{OpenThreads_ROOT}
+        $ENV{OSG_ROOT}
     PATHS
-    $ENV{OPENTHREADS_INCLUDE_DIR}
-    $ENV{OPENTHREADS_DIR}/include
-    $ENV{OPENTHREADS_DIR}
-    $ENV{OSG_INCLUDE_DIR}
-    $ENV{OSG_DIR}/include
-    $ENV{OSG_DIR}
-    $ENV{OSGDIR}/include
-    $ENV{OSGDIR}
-    NO_DEFAULT_PATH
+        /sw # Fink
+        /opt/local # DarwinPorts
+        /opt/csw # Blastwave
+        /opt
+        /usr/freeware
+    PATH_SUFFIXES include
 )

-
-FIND_PATH(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include
-    /usr/include
-    /sw/include # Fink
-    /opt/local/include # DarwinPorts
-    /opt/csw/include # Blastwave
-    /opt/include
-    $ENV{OSGEO4W_ROOT}/include
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]/include
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
+find_library(OPENTHREADS_LIBRARY
+    NAMES OpenThreads OpenThreadsWin32
+    HINTS
+        $ENV{OPENTHREADS_LIBRARY_DIR}
+        $ENV{OPENTHREADS_DIR}
+        $ENV{OSG_LIBRARY_DIR}
+        $ENV{OSG_DIR}
+        $ENV{OSGDIR}
+        $ENV{OpenThreads_ROOT}
+        $ENV{OSG_ROOT}
+    PATHS
+        /sw
+        /opt/local
+        /opt/csw
+        /opt
+        /usr/freeware
+    PATH_SUFFIXES lib64 lib
 )

-
-FIND_LIBRARY(OPENTHREADS_LIBRARY
-    NAMES OpenThreads OpenThreadsWin32
+find_library(OPENTHREADS_LIBRARY_DEBUG
+    NAMES OpenThreadsd OpenThreadsWin32d
+    HINTS
+        $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
+        $ENV{OPENTHREADS_LIBRARY_DIR}
+        $ENV{OPENTHREADS_DIR}
+        $ENV{OSG_LIBRARY_DIR}
+        $ENV{OSG_DIR}
+        $ENV{OSGDIR}
+        $ENV{OpenThreads_ROOT}
+        $ENV{OSG_ROOT}
     PATHS
-    $ENV{OPENTHREADS_LIBRARY_DIR}
-    $ENV{OPENTHREADS_DIR}/lib64
-    $ENV{OPENTHREADS_DIR}/lib
-    $ENV{OPENTHREADS_DIR}
-    $ENV{OSG_LIBRARY_DIR}
-    $ENV{OSG_DIR}/lib64
-    $ENV{OSG_DIR}/lib
-    $ENV{OSG_DIR}
-    $ENV{OSGDIR}/lib64
-    $ENV{OSGDIR}/lib
-    $ENV{OSGDIR}
-    NO_DEFAULT_PATH
+        /sw
+        /opt/local
+        /opt/csw
+        /opt
+        /usr/freeware
+    PATH_SUFFIXES lib64 lib
 )

+if(OPENTHREADS_LIBRARY_DEBUG)
+    set(OPENTHREADS_LIBRARIES
+        optimized ${OPENTHREADS_LIBRARY}
+        debug ${OPENTHREADS_LIBRARY_DEBUG})
+else()
+    set(OPENTHREADS_LIBRARIES ${OPENTHREADS_LIBRARY})
+endif()

-
-FIND_LIBRARY(OPENTHREADS_LIBRARY
-    NAMES OpenThreads OpenThreadsWin32
-    PATHS
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/lib64
-    /usr/local/lib
-    /usr/lib64
-    /usr/lib
-    /sw/lib64
-    /sw/lib
-    /opt/local/lib64
-    /opt/local/lib
-    /opt/csw/lib64
-    /opt/csw/lib
-    /opt/lib64
-    /opt/lib
-    $ENV{OSGEO4W_ROOT}/lib
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]/lib
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
-)
-
-FIND_LIBRARY(OPENTHREADS_LIBRARY_DEBUG
-    NAMES OpenThreadsd OpenThreadsWin32d
-    PATHS
-    $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
-    $ENV{OPENTHREADS_LIBRARY_DIR}
-    $ENV{OPENTHREADS_DIR}/lib64
-    $ENV{OPENTHREADS_DIR}/lib
-    $ENV{OPENTHREADS_DIR}
-    $ENV{OSG_LIBRARY_DIR}
-    $ENV{OSG_DIR}/lib64
-    $ENV{OSG_DIR}/lib
-    $ENV{OSG_DIR}
-    $ENV{OSGDIR}/lib64
-    $ENV{OSGDIR}/lib
-    $ENV{OSGDIR}
-    NO_DEFAULT_PATH
-)
-
-
-
-FIND_LIBRARY(OPENTHREADS_LIBRARY_DEBUG
-    NAMES OpenThreadsd OpenThreadsWin32d
-    PATHS
-    /usr/local/lib64
-    /usr/local/lib
-    /usr/lib64
-    /usr/lib
-    /sw/lib64
-    /sw/lib
-    /opt/local/lib64
-    /opt/local/lib
-    /opt/csw/lib64
-    /opt/csw/lib
-    /opt/lib64
-    /opt/lib
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OpenThreads_ROOT]/lib
-    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
-)
-
-
-IF(OPENTHREADS_LIBRARY)
-  IF(NOT OPENTHREADS_LIBRARY_DEBUG)
-      #MESSAGE("-- Warning Debug OpenThreads not found, using: ${OPENTHREADS_LIBRARY}")
-      #SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}")
-      SET(OPENTHREADS_LIBRARY_DEBUG "${OPENTHREADS_LIBRARY}" CACHE FILEPATH "Debug version of OpenThreads Library (use regular version if not available)" FORCE)
-  ENDIF(NOT OPENTHREADS_LIBRARY_DEBUG)
-ENDIF(OPENTHREADS_LIBRARY)
-
-SET(OPENTHREADS_FOUND "NO")
-IF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
-  SET(OPENTHREADS_FOUND "YES")
-  # MESSAGE("-- Found OpenThreads: "${OPENTHREADS_LIBRARY})
-ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
-
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenThreads DEFAULT_MSG
+    OPENTHREADS_LIBRARY OPENTHREADS_INCLUDE_DIR)


Allow configuration of external module dependency locations

Teach the vtk_module_export_code_find_package macro to check for a
VTK_INSTALL_FIND_PACKAGE_<name>_DIR variable to configure the default
location of <name>_DIR to be reported to applications.  Allow the
variable to be set to a false value to disable the default.  This will
allow module dependencies on external packages such as Qt5 to be
configured for redistributable/relocatable packages.

Also allow applications to set <name>_DIR themselves before finding
VTK so that they can override the VTK-provided default location.

Change-Id: I0e452fb02f371636ec3a04954a99e33c7193f77a

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -181,14 +181,29 @@
 # imported targets linked by VTK libraries.
 #
 # The <name>_DIR variable must be set to the package location.
+# The VTK_INSTALL_FIND_PACKAGE_<name>_DIR variable may be set
+# to an alternative location for the install tree to reference,
+# or to a false value to remove any default location.
 macro(vtk_module_export_code_find_package _name)
   if(${_name}_DIR)
+    if(DEFINED VTK_INSTALL_FIND_PACKAGE_${_name}_DIR)
+      set(_dir "${VTK_INSTALL_FIND_PACKAGE_${_name}_DIR}")
+    else()
+      set(_dir "${${_name}_DIR}")
+    endif()
+    if(_dir)
+      set(${vtk-module}_EXPORT_CODE_INSTALL "${${vtk-module}_EXPORT_CODE_INSTALL}
+if(NOT ${_name}_DIR)
+  set(${_name}_DIR \"${_dir}\")
+endif()")
+    endif()
     set(${vtk-module}_EXPORT_CODE_INSTALL "${${vtk-module}_EXPORT_CODE_INSTALL}
-set(${_name}_DIR \"${${_name}_DIR}\")
 find_package(${_name} REQUIRED QUIET)
 ")
     set(${vtk-module}_EXPORT_CODE_BUILD "${${vtk-module}_EXPORT_CODE_BUILD}
-set(${_name}_DIR \"${${_name}_DIR}\")
+if(NOT ${_name}_DIR)
+  set(${_name}_DIR \"${${_name}_DIR}\")
+endif()
 find_package(${_name} REQUIRED QUIET)
 ")
   endif()


Upgrade OpenCV to version 2.4.13.1 for GCC 6 support

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -66,8 +66,8 @@
       )
     endif()

-    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/opencv-2.4.13.tar.bz2)
-    set(opencv_url_md5 58cc63017a2b5cdc93ce3fca9e476f2e)
+    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/opencv-2.4.13.1.tar.bz2)
+    set(opencv_url_md5 0db9ad491e481a4d4a31b67f461f968c)

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}


Add Control library to dependencies.

Add Control library to dependencies.

--- Dependencies.cmake
+++ Dependencies.cmake
@@ -2,8 +2,12 @@
 # Distributed under the MIT License.
 # See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT

-# Include script to build external library with CMake.
+# Include script to build external libraries with CMake.
 include(ExternalProject)
+
+# -------------------------------
+
+# SML: https://github.com/openastro/sml

 if(NOT BUILD_DEPENDENCIES)
   find_package(SML)
@@ -40,6 +44,8 @@

 # -------------------------------

+# Astro: https://github.com/openastro/astro
+
 if(NOT BUILD_DEPENDENCIES)
   find_package(Astro)
 endif(NOT BUILD_DEPENDENCIES)
@@ -75,6 +81,47 @@
 endif(NOT APPLE)

 # -------------------------------
+
+# Control: https://github.com/openastro/control
+
+if(NOT BUILD_DEPENDENCIES)
+  find_package(Control)
+endif(NOT BUILD_DEPENDENCIES)
+
+if(NOT CONTROL_FOUND)
+  message(STATUS "Control will be downloaded when ${CMAKE_PROJECT_NAME} is built")
+  ExternalProject_Add(control-lib
+    DEPENDS sml-lib
+    PREFIX ${EXTERNAL_PATH}/Control
+    #--Download step--------------
+    URL https://github.com/openastro/control/archive/master.zip
+    TIMEOUT 30
+    #--Update/Patch step----------
+    UPDATE_COMMAND ""
+    PATCH_COMMAND ""
+    #--Configure step-------------
+    CONFIGURE_COMMAND ""
+    #--Build step-----------------
+    BUILD_COMMAND ""
+    #--Install step---------------
+    INSTALL_COMMAND ""
+    #--Output logging-------------
+    LOG_DOWNLOAD ON
+  )
+  ExternalProject_Get_Property(control-lib source_dir)
+  set(CONTROL_INCLUDE_DIRS ${source_dir}/include
+      CACHE INTERNAL "Path to include folder for Control")
+endif(NOT CONTROL_FOUND)
+
+if(NOT APPLE)
+  include_directories(SYSTEM AFTER "${CONTROL_INCLUDE_DIRS}")
+else(APPLE)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem \"${CONTROL_INCLUDE_DIRS}\"")
+endif(NOT APPLE)
+
+# -------------------------------
+
+# RapidJSON: https://github.com/miloyip/rapidjson

 if(NOT BUILD_DEPENDENCIES)
   find_package(rapidjson)
@@ -114,6 +161,8 @@

 # -------------------------------

+# Catch: https://github.com/philsquared/Catch
+
 if(BUILD_TESTS)
   if(NOT BUILD_DEPENDENCIES)
     find_package(CATCH)


Suppress unused CMake variable warning.

Suppress unused CMake variable warning.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -245,7 +245,7 @@
 else ()
     set (URHO3D_LIB_TYPE "" CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED (not available for Emscripten)")
     set (URHO3D_HOME "" CACHE PATH "Path to Urho3D build tree or SDK installation location (downstream project only)")
-    if (URHO3D_PCH OR URHO3D_UPDATE_SOURCE_TREE OR URHO3D_SAMPLES OR URHO3D_TOOLS)
+    if (URHO3D_PCH OR URHO3D_UPDATE_SOURCE_TREE OR URHO3D_SAMPLES OR URHO3D_TOOLS OR URHO3D_EXTRAS)
         # Just reference it to suppress "unused variable" CMake warning on downstream projects using this CMake module
     endif ()
     if (CMAKE_PROJECT_NAME MATCHES ^Urho3D-ExternalProject-)


cmake: Correct error message in mirtk_add_executable

--- CMake/mirtk_add_executable.cmake
+++ CMake/mirtk_add_executable.cmake
@@ -28,7 +28,7 @@
   endif ()
   cmake_parse_arguments(TARGET "" "" "SOURCES;DEPENDS;OPTIONAL" ${ARGN})
   if (TARGET_UNPARSED_ARGUMENTS)
-    message(FATAL_ERROR "mirtk_add_library called with unrecognized arguments: ${TARGET_UNPARSED_ARGUMENTS}!")
+    message(FATAL_ERROR "mirtk_add_executable called with unrecognized arguments: ${TARGET_UNPARSED_ARGUMENTS}!")
   endif ()
   if ("^${target_name}$" STREQUAL "^commands$")
     message(FATAL_ERROR "Invalid command name ${target_name}, used internally!")


fix FindGStreamer.cmake for msys2 mingw

fix FindGStreamer.cmake for msys2 mingw

--- CMakeModules/FindGStreamer.cmake
+++ CMakeModules/FindGStreamer.cmake
@@ -65,7 +65,7 @@
 #    )
 #endmacro()

-if (WIN32)
+if (MSVC)
     macro(FIND_GSTREAMER_COMPONENT _component_prefix _pkgconfig_name _header _library)
         find_path(${_component_prefix}_INCLUDE_DIRS
             NAMES ${_header}


Make sure notes file exists.

Make sure notes file exists.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -14,4 +14,7 @@
 set(CTEST_DROP_LOCATION "/submit.php?project=geojs")
 set(CTEST_DROP_SITE_CDASH TRUE)

+if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/build_notes.json")
+  file(WRITE "${CTEST_BINARY_DIRECTORY}/build_notes.json" "")
+endif()
 set(CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/build_notes.json")


First draft for fix of T26980

First draft for fix of T26980

Signed-off-by: Ralf Floca <fec4a647ab34f54e20bea9a9e3e1c74f13aefc78@dkfz-heidelberg.de>

--- CMake/mitkFunctionCreateModule.cmake
+++ CMake/mitkFunctionCreateModule.cmake
@@ -234,6 +234,15 @@
       endif()
       set(MODULE_IS_ENABLED 0)
     else()
+      foreach(dep ${MODULE_DEPENDS})
+          if(NOT dep STREQUAL "PUBLIC" AND NOT dep STREQUAL "PRIVATE" AND NOT dep STREQUAL "INTERFACE")
+            get_target_property(AUTLOAD_DEP ${dep} MITK_AUTOLOAD_DIRECTORY)
+            if (AUTLOAD_DEP)
+              message(SEND_ERROR "Module \"${MODULE_NAME}\" has an invalid dependency on autoload module \"${dep}\". Check MITK_CREATE_MODULE usage for \"${MODULE_NAME}\".")
+            endif()
+          endif()
+      endforeach(dep)
+
       set(MODULE_IS_ENABLED 1)
       # now check for every package if it is enabled. This overlaps a bit with
       # MITK_CHECK_MODULE ...


Changed style to conform to rest

Changed style to conform to rest

--- BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
+++ BlueBerry/CMake/FunctionCreateBlueBerryApplication.cmake
@@ -78,10 +78,12 @@
 # -----------------------------------------------------------------------
 # Add executable icon (Windows)
 # -----------------------------------------------------------------------
-
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
-  set(WINDOWS_ICON_RESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
-endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
+set(WINDOWS_ICON_RESOURCE_FILE "")
+if(WIN32)
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
+    set(WINDOWS_ICON_RESOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/${_APP_NAME}.rc")
+  endif()
+endif()

 # -----------------------------------------------------------------------
 # Create the executable and link libraries
@@ -101,14 +103,13 @@
 # -----------------------------------------------------------------------
 # Add executable icon (Mac)
 # -----------------------------------------------------------------------
-
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns")
-  set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns")
-  if(APPLE)
+if(APPLE)
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns")
+    set_target_properties(${_APP_NAME} PROPERTIES MACOSX_BUNDLE_ICON_FILE "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns")
     file(COPY ${MACOSX_BUNDLE_ICON_FILE} DESTINATION "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_APP_NAME}.app/Contents/Resources/")
     file(INSTALL ${MACOSX_BUNDLE_ICON_FILE} DESTINATION "${_APP_NAME}.app/Contents/Resources/")
-  endif(APPLE)
-endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns")
+  endif()
+endif()

 # -----------------------------------------------------------------------
 # Set build time dependencies


fixed conflicts

fixed conflicts

--- version_config.cmake
+++ version_config.cmake
@@ -141,7 +141,6 @@
   set(DEFAULT_ACE_URL https://github.com/paskino/libace-conda)
   set(DEFAULT_ACE_TAG origin/master)

-<<<<<<< HEAD
   # CCPi CIL
   set(CIL_VERSION "19.02")
   set(DEFAULT_CCPi-Framework_URL https://github.com/vais-ral/CCPi-Framework.git)
@@ -211,31 +210,23 @@
 set(ACE_URL ${DEFAULT_ACE_URL} CACHE STRING ON)
 set(ACE_TAG ${DEFAULT_ACE_TAG} CACHE STRING ON)

-<<<<<<< HEAD
 set(CCPi-RGL_URL ${DEFAULT_CCPi-RGL_URL} CACHE STRING ON)
 set(CCPi-RGL_TAG ${DEFAULT_CCPi-RGL_TAG} CACHE STRING ON)
 set(CCPi-Framework_URL ${DEFAULT_CCPi-Framework_URL} CACHE STRING ON)
 set(CCPi-Framework_TAG ${DEFAULT_CCPi-Framework_TAG} CACHE STRING ON)
 set(CCPi-FrameworkPlugins_URL ${DEFAULT_CCPi-FrameworkPlugins_URL} CACHE STRING ON)
 set(CCPi-FrameworkPlugins_TAG ${DEFAULT_CCPi-FrameworkPlugins_TAG} CACHE STRING ON)
-=======
 set(NIFTYREG_URL ${DEFAULT_NIFTYREG_URL} CACHE STRING ON)
 set(NIFTYREG_TAG ${DEFAULT_NIFTYREG_TAG} CACHE STRING ON)
->>>>>>> origin

 mark_as_advanced(SIRF_URL SIRF_TAG STIR_URL STIR_TAG
   Gadgetron_URL Gadgetron_TAG
   siemens_to_ismrmrd_URL siemens_to_ismrmrd_TAG
   ISMRMRD_URL ISMRMRD_TAG
-<<<<<<< HEAD
-  petmr_rd_tools_URL petmr_rd_tools_TAG
+  pet_rd_tools_URL pet_rd_tools_TAG
   glog_URL glog_TAG
+  NIFTYREG_URL NIFTYREG_TAG)
   CCPi-Framework_URL CCPi-Framework_TAG
   CCPi-FrameworkPlugins_URL CCPi-FrameworkPlugins_TAG
   CCPi-RGL_URL CCPi-RGL_TAG
 )
-=======
-  pet_rd_tools_URL pet_rd_tools_TAG
-  glog_URL glog_TAG
-  NIFTYREG_URL NIFTYREG_TAG)
->>>>>>> origin


Typo correction

Typo correction

git-svn-id: d0e553dc0c19e0587293496205f4994ffde05711@67 5988d2c4-2d00-3947-b3d2-f5ac3ac2f174

--- Trunk/SCD.pc.cmake
+++ Trunk/SCD.pc.cmake
@@ -8,5 +8,5 @@
 Name: ${PROJECT_NAME}
 Description: Library for collision detection computation
 Version: 1.0
-Libs: ${${PROJECT_NAME}_LDFLAGS} -L ${install_pkg_libdir} -lcd -lcd_penetration -lfile_parsing -ls_object -ls_polyhedron -lstp-bv
+Libs: ${${PROJECT_NAME}_LDFLAGS} -L${install_pkg_libdir} -lcd -lcd_penetration -lfile_parsing -ls_object -ls_polyhedron -lstp-bv
 Cflags: -I${install_pkg_include_dir}  ${${PROJECT_NAME}_CFLAGS}


BUG: Added classes for new QmitkDialogBar class hierarchy into build. Cf. bug #783

--- Qmitk/files.cmake
+++ Qmitk/files.cmake
@@ -18,6 +18,8 @@
   QmitkCallbackFromGUIThread.cpp
   QmitkChiliPluginSaveDialog.cpp
   QmitkColorTransferFunctionCanvas.cpp
+  QmitkDialogBar.cpp
+  QmitkDialogBars/QmitkSliderDialogBar.cpp
   QmitkFctCompMediator.cpp
   QmitkFunctionalityComponentContainer.cpp
   QmitkFunctionalityComponents/QmitkConnectivityFilterComponent.cpp
@@ -119,6 +121,8 @@
   QmitkCallbackFromGUIThread.h
   QmitkChiliPluginSaveDialog.h
   QmitkColorTransferFunctionCanvas.h
+  QmitkDialogBar.h
+  QmitkDialogBars/QmitkSliderDialogBar.h
   QmitkFctCompMediator.h
   QmitkFunctionalityComponentContainer.h
   QmitkFunctionalityComponents/QmitkConnectivityFilterComponent.h


Add TimeSyncEvent.h to files.cmake (#79)

--- lib/files.cmake
+++ lib/files.cmake
@@ -157,6 +157,7 @@
         ${smooth_inc_dir}/core/io/Output.h
         ${smooth_inc_dir}/core/network/Wifi.h
         ${smooth_inc_dir}/core/sntp/Sntp.h
+        ${smooth_inc_dir}/core/sntp/TimeSyncEvent.h
         ${smooth_inc_dir}/core/SystemStatistics.h
         )


AppleClang: Disable same compiler warnings as Clang

These warning flags are also applicable to AppleClang.

Change-Id: Iccf203fce9575d2ec06ae63f60cd88096759557a
Reviewed-on: http://review.couchbase.org/c/libcouchbase/+/139477
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

--- cmake/Modules/GetLibcouchbaseFlags.cmake
+++ cmake/Modules/GetLibcouchbaseFlags.cmake
@@ -38,7 +38,7 @@
         -Wpedantic # warn if non-standard C++ is used
         )

-IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+IF(CMAKE_C_COMPILER_ID STREQUAL "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
     LIST(APPEND LCB_GNUC_CPP_WARNINGS
             -Wno-cast-align
             -Wno-dollar-in-identifier-extension)


Squashed '3rdparty/github/cmake-utils-remote/' changes from 3d49a81..213382e

213382e More common sizes

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 213382ec8616e8ee375b8134a276eae608f24a36

--- cmake/MyPackageCheckCommonSizes.cmake
+++ cmake/MyPackageCheckCommonSizes.cmake
@@ -4,5 +4,59 @@
   CHECK_TYPE_SIZE("int" SIZEOF_INT)
   CHECK_TYPE_SIZE("long" SIZEOF_LONG)
   CHECK_TYPE_SIZE("long long" SIZEOF_LONG_LONG)
+  CHECK_TYPE_SIZE("unsigned short" SIZEOF_UNSIGNED_SHORT)
+  CHECK_TYPE_SIZE("unsigned int" SIZEOF_UNSIGNED_INT)
+  CHECK_TYPE_SIZE("unsigned long" SIZEOF_UNSIGNED_LONG)
+  CHECK_TYPE_SIZE("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
   CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
+  #
+  # Special types
+  #
+  FOREACH (_sign "" "u")
+    FOREACH (_size 8 16 32 64)
+      SET (_MYTYPE    MYPACKAGE_${_sign}INT${_size})
+      SET (_MYTYPEDEF MYPACKAGE_${_sign}INT${_size}_TYPEDEF)
+
+      SET (HAVE_${_MYTYPE} FALSE)
+      SET (${_MYTYPE} "")
+      SET (${_MYTYPEDEF} "")
+
+      SET (_found_type FALSE)
+      FOREACH (_underscore "" "_" "__")
+        SET (_type ${_underscore}${_sign}int${_size}_t)
+        STRING (TOUPPER ${_type} _TYPE)
+        CHECK_TYPE_SIZE (${_type} ${_TYPE})
+        IF (HAVE_${_TYPE})
+          SET (HAVE_${_MYTYPE} TRUE)
+          SET (${_MYTYPE} ${${_TYPE}})
+          SET (${_MYTYPEDEF} ${_type})
+          BREAK ()
+        ENDIF ()
+      ENDFOREACH ()
+      IF (NOT HAVE_${_MYTYPE})
+        #
+        # Try with C types
+        #
+        FOREACH (_c "short" "int" "long" "long long")
+          IF ("${_sign}" STREQUAL "u")
+            SET (_c "unsigned ${_c}")
+          ENDIF ()
+          STRING (TOUPPER ${_c} _C)
+          STRING (REPLACE " " "_" _C "${_C}")
+          IF (HAVE_SIZEOF_${_C})
+            IF (${SIZEOF_${_C}} EQUAL ${_size})
+              SET (HAVE_${_MYTYPE} TRUE)
+              SET (${_MYTYPE} ${${_TYPE}})
+              SET (${_MYTYPEDEF} ${_c})
+              BREAK ()
+            ENDIF ()
+          ENDIF ()
+        ENDFOREACH ()
+      ENDIF ()
+      MARK_AS_ADVANCED (
+        HAVE_${_MYTYPE}
+        ${_MYTYPE}
+        ${_MYTYPEDEF})
+    ENDFOREACH ()
+  ENDFOREACH ()
 ENDMACRO()


SITL: Add missing PWM out sim

SITL: Add missing PWM out sim

--- cmake/configs/posix_sitl_simple.cmake
+++ cmake/configs/posix_sitl_simple.cmake
@@ -6,6 +6,8 @@
 	drivers/led
 	drivers/device
 	drivers/boards/sitl
+	drivers/pwm_out_sim
+	drivers/rgbled
 	platforms/common
 	platforms/posix/px4_layer
 	platforms/posix/work_queue


[cmake] Start adding support for LLVM_USE_SANITIZER=Address on Windows

Pass "-fsanitize=address" to the compiler and "-debug" to the linker.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -445,16 +445,30 @@
 endif( MSVC )

 macro(append_common_sanitizer_flags)
-  # Append -fno-omit-frame-pointer and turn on debug info to get better
-  # stack traces.
-  add_flag_if_supported("-fno-omit-frame-pointer" FNO_OMIT_FRAME_POINTER)
-  if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND
-      NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
-    add_flag_if_supported("-gline-tables-only" GLINE_TABLES_ONLY)
-  endif()
-  # Use -O1 even in debug mode, otherwise sanitizers slowdown is too large.
-  if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
-    add_flag_if_supported("-O1" O1)
+  if (NOT MSVC)
+    # Append -fno-omit-frame-pointer and turn on debug info to get better
+    # stack traces.
+    add_flag_if_supported("-fno-omit-frame-pointer" FNO_OMIT_FRAME_POINTER)
+    if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND
+	NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
+      add_flag_if_supported("-gline-tables-only" GLINE_TABLES_ONLY)
+    endif()
+    # Use -O1 even in debug mode, otherwise sanitizers slowdown is too large.
+    if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+      add_flag_if_supported("-O1" O1)
+    endif()
+  elseif (CLANG_CL)
+    # Keep frame pointers around.
+    append("/Oy-" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    if (CMAKE_LINKER MATCHES "lld-link.exe")
+      # Use DWARF debug info with LLD.
+      append("-gdwarf" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    else()
+      # Enable codeview otherwise.
+      append("/Z7" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    endif()
+    # Always ask the linker to produce symbols with asan.
+    append("-debug" CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
   endif()
 endmacro()

@@ -485,6 +499,13 @@
     else()
       message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")
     endif()
+  elseif(MSVC)
+    if (LLVM_USE_SANITIZER STREQUAL "Address")
+      append_common_sanitizer_flags()
+      append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    else()
+      message(WARNING "This sanitizer not yet supported in the MSVC environment: ${LLVM_USE_SANITIZER}")
+    endif()
   else()
     message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.")
   endif()


ENH: Swig message indicates which language is being processed

--- Wrapping/UseSWIGLocal.cmake
+++ Wrapping/UseSWIGLocal.cmake
@@ -184,7 +184,7 @@
     "${swig_source_file_fullname}"
     MAIN_DEPENDENCY "${swig_source_file_fullname}"
     DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
-    COMMENT "Swig source")
+    COMMENT "Swig source to generate ${SWIG_MODULE_${name}_LANGUAGE} wrapping")
   SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}" ${swig_extra_generated_files}
     PROPERTIES GENERATED 1)
   SET(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})


cmake: added check for Python 2.x

cmake: added check for Python 2.x

--- config/FindVIGRANUMPY_DEPENDENCIES.cmake
+++ config/FindVIGRANUMPY_DEPENDENCIES.cmake
@@ -5,6 +5,22 @@
 FIND_PACKAGE(PythonInterp)

 IF(PYTHONINTERP_FOUND)
+    # check that Python version 2.x is used
+    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
+                         "import sys; print sys.version_info.major"
+                          OUTPUT_VARIABLE PYTHON_MAJOR_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+    IF(${PYTHON_MAJOR_VERSION} EQUAL 2)
+        SET(PYTHONINTERP_V2_FOUND 1)
+    ELSE()
+        MESSAGE(STATUS "vigranumpy currently requires Python 2.x.")
+        MESSAGE(STATUS "Make sure that Python 2 is in your PATH or use 'cmake_gui' to set the PYTHON_EXECUTABLE variable manually.")
+        SET(PYTHONINTERP_V2_FOUND 0)
+    ENDIF()
+ELSE()
+    SET(PYTHONINTERP_V2_FOUND 0)
+ENDIF()
+
+IF(PYTHONINTERP_V2_FOUND)
     VIGRA_FIND_PACKAGE( Boost 1.40.0 COMPONENTS python )

     FIND_PACKAGE(PythonLibs)
@@ -119,7 +135,7 @@
     ######################################################################
     INCLUDE(FindPackageHandleStandardArgs)
     FIND_PACKAGE_HANDLE_STANDARD_ARGS(VIGRANUMPY_DEPENDENCIES DEFAULT_MSG
-                         PYTHONINTERP_FOUND PYTHONLIBS_FOUND
+                         PYTHONINTERP_V2_FOUND PYTHONLIBS_FOUND
                          Boost_PYTHON_FOUND PYTHON_NUMPY_INCLUDE_DIR VIGRANUMPY_INSTALL_DIR)

     IF(NOT VIGRANUMPY_INCLUDE_DIRS OR VIGRANUMPY_INCLUDE_DIRS MATCHES "-NOTFOUND")


ARROW-2505: [C++] Disable MSVC warning C4800

Author: Antoine Pitrou <antoine@python.org>

Closes #1980 from pitrou/ARROW-2505-disable-msvc-warning-c4800 and squashes the following commits:

f586da2 <Antoine Pitrou> Fix command-line option
bb064db <Antoine Pitrou> ARROW-2505:  Disable MSVC warning C4800

--- cpp/cmake_modules/SetupCxxFlags.cmake
+++ cpp/cmake_modules/SetupCxxFlags.cmake
@@ -167,6 +167,11 @@
   endif()
 endif()

+# Disable annoying "performance warning" about int-to-bool conversion
+if ("${COMPILER_FAMILY}" STREQUAL "msvc")
+  set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} /wd4800")
+endif()
+
 # if build warning flags is set, add to CXX_COMMON_FLAGS
 if (BUILD_WARNING_FLAGS)
   # Use BUILD_WARNING_FLAGS with BUILD_WARNING_LEVEL=everything to disable


persist-sql is optional

persist-sql is optional

--- lib/FindAtomSpace.cmake
+++ lib/FindAtomSpace.cmake
@@ -62,13 +62,21 @@
 	${ATOMSPACE_clearbox_LIBRARY}
 	${ATOMSPACE_lambda_LIBRARY}
 	${ATOMSPACE_persist_LIBRARY}
-	${ATOMSPACE_persist-sql_LIBRARY}
 	${ATOMSPACE_query_LIBRARY}
 	${ATOMSPACE_execution_LIBRARY}
 	${ATOMSPACE_ruleengine_LIBRARY}
 	${ATOMSPACE_smob_LIBRARY}
 )

+# persist-sql is optional
+IF (ATOMSPACE_persist-sql_LIBRARY)
+	set(ATOMSPACE_LIBRARIES
+		${ATOMSPACE_LIBRARIES}
+		${ATOMSPACE_persist-sql_LIBRARY}
+	)
+ENDIF (ATOMSPACE_persist-sql_LIBRARY)
+
+# persist-zmq is optional
 IF (ATOMSPACE_zmqatoms_LIBRARY)
 	set(ATOMSPACE_LIBRARIES
 		${ATOMSPACE_LIBRARIES}


[C++] Compatibility with CMake 3.13

[C++] Compatibility with CMake 3.13

With CMake 3.13, compilation of the cluster controller fails because
libJoynr and libJoynrClusterController are not linked to the mosquitto
and MoCOCrW libraries. This is most likely a deficiency in CMake, as it
works with a newer version. Extend the use of the work-around we use for
earlier versions also for CMake 3.13.

--- cpp/CMake/ObjectLibraryTargetUtils.cmake
+++ cpp/CMake/ObjectLibraryTargetUtils.cmake
@@ -205,12 +205,13 @@

 # For CMake older than 3.12 target_link_libraries cannot be called for OBJECT libraries.
 # This is a compatibility wrapper.
+# We also discovered an issue with CMake 3.13, so the wrapper is also used there.
 function(objlibrary_target_link_libraries target)
     get_target_property(targetType ${target} TYPE)
     if(NOT "${targetType}" STREQUAL "OBJECT_LIBRARY")
         message(FATAL_ERROR "Target ${target} is not an OBJECT library. Use target_link_[obj]libraries(${target} ${ARGN}).")
     endif()
-    if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
+    if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
         target_link_libraries(${target} ${ARGN})
         return()
     endif()


BUG: Incorrect CDash URL in CTestConfig.cmake.

CDash has moved from www.cdash.org/CDash to open.cdash.org/.

Change-Id: I0b751eda4fa6945104cc0a1d5443a213b0a91755

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -2,6 +2,6 @@
 set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "www.cdash.org")
-set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Insight")
+set(CTEST_DROP_SITE "open.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=Insight")
 set(CTEST_DROP_SITE_CDASH TRUE)


FIX (#3235): do not try to build tests for disabled modules

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -181,8 +181,9 @@
     FILE(REMOVE ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake )
   ELSE(_MISSING_DEP)
     IF(NOT MODULE_QT_MODULE OR MITK_USE_QT)
+
     _MITK_CREATE_MODULE_CONF()
-
+    SET(MODULE_IS_ENABLED 1)
     IF(NOT MODULE_EXPORT_DEFINE)
       SET(MODULE_EXPORT_DEFINE ${MODULE_NAME}_EXPORT)
     ENDIF(NOT MODULE_EXPORT_DEFINE)
@@ -353,7 +354,7 @@
 ENDMACRO(MITK_INSTALL_TARGETS)

 MACRO(MITK_CREATE_MODULE_TESTS)
-IF(BUILD_TESTING)
+IF(BUILD_TESTING AND MODULE_IS_ENABLED)
   INCLUDE(files.cmake)
   INCLUDE_DIRECTORIES(.)

@@ -397,8 +398,7 @@
     ENDIF(EXISTS ${IMAGE_FULL_PATH})
   ENDFOREACH( image )

-ENDIF(BUILD_TESTING)
-
+ENDIF(BUILD_TESTING AND MODULE_IS_ENABLED)

 ENDMACRO(MITK_CREATE_MODULE_TESTS)


ENH: one more ossim include path removed

--- CMake/ImportOssim.cmake
+++ CMake/ImportOssim.cmake
@@ -18,8 +18,6 @@
            "Cannot find OSSIM include directory. Please set OSSIM_INCLUDE_DIR.")
   ENDIF (NOT OSSIM_INCLUDE_DIR)

-  INCLUDE_DIRECTORIES(${OSSIM_INCLUDE_DIR} ${OSSIM_INCLUDE_DIR}/ossim)
-
   IF (NOT OSSIM_LIBRARY)
     MESSAGE(FATAL_ERROR
              "Cannot find OSSIM library. Please set OSSIM_LIBRARY.")


Replace message(CHECK_* ...) with message(STATUS ...)

These arguments were not added until CMake 3.17.

--- cmake/CheckTypeRepresentation.cmake
+++ cmake/CheckTypeRepresentation.cmake
@@ -208,7 +208,7 @@
 function(check_float_type_representation type var)
   if(NOT DEFINED ${var})
     if(NOT CMAKE_REQUIRED_QUIET)
-      message(CHECK_START "Check representation of ${type}")
+      message(STATUS "Check representation of ${type}")
     endif()

     cmake_parse_arguments(_cftr "" "LANGUAGE" "" ${ARGN})
@@ -256,12 +256,12 @@

     if(_repr_name)
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(CHECK_PASS "done")
+        message(STATUS "Check representation of ${type} - done")
       endif()
       set(${var} "${_repr_name}" CACHE INTERNAL "check_float_type_representation(${type}): ${_repr_name}")
     else()
       if(NOT CMAKE_REQUIRED_QUIET)
-        message(CHECK_FAIL "failed")
+        message(STATUS "Check representation of ${type} - failed")
       endif()
       set(${var} "" CACHE INTERNAL "check_float_type_representation(${type}) failed")
     endif()


Fix double -k for dtrace

Fix double -k for dtrace

Change-Id: I8bb9e6122438a11a5b5da53234435ef259a7fa64
Reviewed-on: http://review.couchbase.org/85951
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

--- cmake/Modules/ConfigureDtrace.cmake
+++ cmake/Modules/ConfigureDtrace.cmake
@@ -26,7 +26,7 @@
     IF(NOT APPLE)
         SET(LCB_DTRACE_OBJECT "${LCB_GENSRCDIR}/probes.o")
         IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-            SET(LCB_DTRACE_OPTIONS "${LCB_DTRACE_OPTIONS} -k")
+            SET(LCB_DTRACE_OPTIONS "-k")
         ENDIF()
         # Generate probes.o
         IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
@@ -35,7 +35,7 @@
         ELSE()
             ADD_CUSTOM_COMMAND(OUTPUT ${LCB_DTRACE_OBJECT}
                 DEPENDS ${LCB_DTRACE_SRC}
-                COMMAND ${DTRACE} -k -C -G ${LCB_DTRACE_OPTIONS} -s ${LCB_DTRACE_SRC} -o ${LCB_DTRACE_OBJECT})
+                COMMAND ${DTRACE} -C -G ${LCB_DTRACE_OPTIONS} -s ${LCB_DTRACE_SRC} -o ${LCB_DTRACE_OBJECT})
         ENDIF()
     ENDIF()
 ENDIF()


Download Project: Reformat CMake code

Download Project: Reformat CMake code

--- cmake/Modules/DownloadProject.cmake
+++ cmake/Modules/DownloadProject.cmake
@@ -1,3 +1,4 @@
+# ~~~
 # Distributed under the OSI-approved MIT License.  See accompanying
 # file LICENSE or https://github.com/Crascit/DownloadProject for details.
 #
@@ -86,97 +87,88 @@
 #
 #   add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
 #
-#========================================================================================
+# ~~~

+set (_DownloadProjectDir "${CMAKE_CURRENT_LIST_DIR}")

-set(_DownloadProjectDir "${CMAKE_CURRENT_LIST_DIR}")
+include (CMakeParseArguments)

-include(CMakeParseArguments)
+function (download_project)

-function(download_project)
+	set (options QUIET)
+	set (oneValueArgs
+	     PROJ
+	     PREFIX
+	     DOWNLOAD_DIR
+	     SOURCE_DIR
+	     BINARY_DIR # Prevent the following from being passed through
+	     CONFIGURE_COMMAND
+	     BUILD_COMMAND
+	     INSTALL_COMMAND
+	     TEST_COMMAND)
+	set (multiValueArgs "")

-    set(options QUIET)
-    set(oneValueArgs
-        PROJ
-        PREFIX
-        DOWNLOAD_DIR
-        SOURCE_DIR
-        BINARY_DIR
-        # Prevent the following from being passed through
-        CONFIGURE_COMMAND
-        BUILD_COMMAND
-        INSTALL_COMMAND
-        TEST_COMMAND
-    )
-    set(multiValueArgs "")
+	cmake_parse_arguments (DL_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    cmake_parse_arguments(DL_ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+	# Hide output if requested
+	if (DL_ARGS_QUIET)
+		set (OUTPUT_QUIET "OUTPUT_QUIET")
+	else ()
+		unset (OUTPUT_QUIET)
+		message (STATUS "Downloading/updating ${DL_ARGS_PROJ}")
+	endif ()

-    # Hide output if requested
-    if (DL_ARGS_QUIET)
-        set(OUTPUT_QUIET "OUTPUT_QUIET")
-    else()
-        unset(OUTPUT_QUIET)
-        message(STATUS "Downloading/updating ${DL_ARGS_PROJ}")
-    endif()
+	# Set up where we will put our temporary CMakeLists.txt file and also
+	# the base point below which the default source and binary dirs will be.
+	# The prefix must always be an absolute path.
+	if (NOT DL_ARGS_PREFIX)
+		set (DL_ARGS_PREFIX "${CMAKE_BINARY_DIR}")
+	else ()
+		get_filename_component (DL_ARGS_PREFIX "${DL_ARGS_PREFIX}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+	endif ()
+	if (NOT DL_ARGS_DOWNLOAD_DIR)
+		set (DL_ARGS_DOWNLOAD_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-download")
+	endif ()

-    # Set up where we will put our temporary CMakeLists.txt file and also
-    # the base point below which the default source and binary dirs will be.
-    # The prefix must always be an absolute path.
-    if (NOT DL_ARGS_PREFIX)
-        set(DL_ARGS_PREFIX "${CMAKE_BINARY_DIR}")
-    else()
-        get_filename_component(DL_ARGS_PREFIX "${DL_ARGS_PREFIX}" ABSOLUTE
-                               BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
-    endif()
-    if (NOT DL_ARGS_DOWNLOAD_DIR)
-        set(DL_ARGS_DOWNLOAD_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-download")
-    endif()
+	# Ensure the caller can know where to find the source and build directories
+	if (NOT DL_ARGS_SOURCE_DIR)
+		set (DL_ARGS_SOURCE_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-src")
+	endif ()
+	if (NOT DL_ARGS_BINARY_DIR)
+		set (DL_ARGS_BINARY_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-build")
+	endif ()
+	set (${DL_ARGS_PROJ}_SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" PARENT_SCOPE)
+	set (${DL_ARGS_PROJ}_BINARY_DIR "${DL_ARGS_BINARY_DIR}" PARENT_SCOPE)

-    # Ensure the caller can know where to find the source and build directories
-    if (NOT DL_ARGS_SOURCE_DIR)
-        set(DL_ARGS_SOURCE_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-src")
-    endif()
-    if (NOT DL_ARGS_BINARY_DIR)
-        set(DL_ARGS_BINARY_DIR "${DL_ARGS_PREFIX}/${DL_ARGS_PROJ}-build")
-    endif()
-    set(${DL_ARGS_PROJ}_SOURCE_DIR "${DL_ARGS_SOURCE_DIR}" PARENT_SCOPE)
-    set(${DL_ARGS_PROJ}_BINARY_DIR "${DL_ARGS_BINARY_DIR}" PARENT_SCOPE)
+	# The way that CLion manages multiple configurations, it causes a copy of
+	# the CMakeCache.txt to be copied across due to it not expecting there to
+	# be a project within a project.  This causes the hard-coded paths in the
+	# cache to be copied and builds to fail.  To mitigate this, we simply
+	# remove the cache if it exists before we configure the new project.  It
+	# is safe to do so because it will be re-generated.  Since this is only
+	# executed at the configure step, it should not cause additional builds or
+	# downloads.
+	file (REMOVE "${DL_ARGS_DOWNLOAD_DIR}/CMakeCache.txt")

-    # The way that CLion manages multiple configurations, it causes a copy of
-    # the CMakeCache.txt to be copied across due to it not expecting there to
-    # be a project within a project.  This causes the hard-coded paths in the
-    # cache to be copied and builds to fail.  To mitigate this, we simply
-    # remove the cache if it exists before we configure the new project.  It
-    # is safe to do so because it will be re-generated.  Since this is only
-    # executed at the configure step, it should not cause additional builds or
-    # downloads.
-    file(REMOVE "${DL_ARGS_DOWNLOAD_DIR}/CMakeCache.txt")
+	# Create and build a separate CMake project to carry out the download.
+	# If we've already previously done these steps, they will not cause
+	# anything to be updated, so extra rebuilds of the project won't occur.
+	# Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
+	# has this set to something not findable on the PATH.
+	configure_file ("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in" "${DL_ARGS_DOWNLOAD_DIR}/CMakeLists.txt")
+	execute_process (COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" -D "CMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}" .
+			 RESULT_VARIABLE result
+					 ${OUTPUT_QUIET}
+			 WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}")
+	if (result)
+		message (FATAL_ERROR "CMake step for ${DL_ARGS_PROJ} failed: ${result}")
+	endif ()
+	execute_process (COMMAND ${CMAKE_COMMAND} --build .
+			 RESULT_VARIABLE result
+					 ${OUTPUT_QUIET}
+			 WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}")
+	if (result)
+		message (FATAL_ERROR "Build step for ${DL_ARGS_PROJ} failed: ${result}")
+	endif ()

-    # Create and build a separate CMake project to carry out the download.
-    # If we've already previously done these steps, they will not cause
-    # anything to be updated, so extra rebuilds of the project won't occur.
-    # Make sure to pass through CMAKE_MAKE_PROGRAM in case the main project
-    # has this set to something not findable on the PATH.
-    configure_file("${_DownloadProjectDir}/DownloadProject.CMakeLists.cmake.in"
-                   "${DL_ARGS_DOWNLOAD_DIR}/CMakeLists.txt")
-    execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-                        -D "CMAKE_MAKE_PROGRAM:FILE=${CMAKE_MAKE_PROGRAM}"
-                        .
-                    RESULT_VARIABLE result
-                    ${OUTPUT_QUIET}
-                    WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
-    )
-    if(result)
-        message(FATAL_ERROR "CMake step for ${DL_ARGS_PROJ} failed: ${result}")
-    endif()
-    execute_process(COMMAND ${CMAKE_COMMAND} --build .
-                    RESULT_VARIABLE result
-                    ${OUTPUT_QUIET}
-                    WORKING_DIRECTORY "${DL_ARGS_DOWNLOAD_DIR}"
-    )
-    if(result)
-        message(FATAL_ERROR "Build step for ${DL_ARGS_PROJ} failed: ${result}")
-    endif()
-
-endfunction()
+endfunction ()


[CMake] Remove Apple-lldb-linux.cmake to fix name collision with upstream Apple-lldb-Linux.cmake

--- cmake/caches/Apple-lldb-linux.cmake
+++ cmake/caches/Apple-lldb-linux.cmake
@@ -1,3 +0,0 @@
-include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)
-
-set(LLDB_ALLOW_STATIC_BINDINGS ON CACHE BOOL "")


Unlock directory before crash

Unlock directory before crash

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -279,6 +279,7 @@
   if(${h_generate_result} EQUAL 0)
     hunter_status_debug("Generate step successful (dir: ${h_work_dir})")
   else()
+    hunter_unlock()
     hunter_fatal_error("generate step failed (dir: ${h_work_dir})")
   endif()


Changed ignored compiler warning for MSVC

--- cmake/platform/win32/platform.cmake
+++ cmake/platform/win32/platform.cmake
@@ -12,7 +12,7 @@

 # ignore some warnings
 add_linker_flags(/ignore:4075)
-add_compiler_flags(/wd4244)
+add_compiler_flags(/wd4503)
 add_compiler_flags(/MP) # build with multi processors

 #add_linker_flags(/NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCRT)


Increment OpenSSL deps id

Increment OpenSSL deps id

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -307,4 +307,4 @@
 endif()

 hunter_cacheable(OpenSSL)
-hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID "10")
+hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID "11")


Fixes for file paths with spaces

Fixes for file paths with spaces

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -11,23 +11,23 @@
 if(BUILD_DIR)
   string(REGEX REPLACE "/+$" "" BUILD_APP_DIR "${BUILD_APP_DIR}") # remove trailing slash
   file(GLOB ALLOPROJECT_APP_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${BUILD_APP_DIR}/*.cpp)
-  string(REPLACE "/" "_" APP_NAME ${BUILD_APP_DIR})
+  string(REPLACE "/" "_" APP_NAME "${BUILD_APP_DIR}")
   string(REGEX REPLACE "_+$" "" APP_NAME "${APP_NAME}")
-  set(SOURCE_DIR ${BUILD_APP_DIR})
+  set(SOURCE_DIR "${BUILD_APP_DIR}")
 else()
-  set(ALLOPROJECT_APP_SRC ${BUILD_APP_FILE})
-  string(REPLACE "/" "_" APP_NAME ${BUILD_APP_FILE})
-  get_filename_component(APP_NAME ${APP_NAME} NAME)
+  set(ALLOPROJECT_APP_SRC "${BUILD_APP_FILE}")
+  string(REPLACE "/" "_" APP_NAME "${BUILD_APP_FILE}")
+  get_filename_component(APP_NAME "${APP_NAME}" NAME)
   STRING(REGEX REPLACE "\\.[^.]*\$" "" APP_NAME "${APP_NAME}")
-  string(REPLACE "." "_" APP_NAME ${APP_NAME})
+  string(REPLACE "." "_" APP_NAME "${APP_NAME}")
 #  get_filename_component(APP_NAME ${APP_NAME} NAME_WE) # Get name w/o extension (extension is anything after first dot!)
-  get_filename_component(SOURCE_DIR ${BUILD_APP_FILE} PATH)
+  get_filename_component(SOURCE_DIR "${BUILD_APP_FILE}" PATH)
 endif(BUILD_DIR)

 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build/bin)

-add_executable(${APP_NAME} EXCLUDE_FROM_ALL ${ALLOPROJECT_APP_SRC})
+add_executable("${APP_NAME}" EXCLUDE_FROM_ALL "${ALLOPROJECT_APP_SRC}")

 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   set_target_properties(${APP_NAME} PROPERTIES
@@ -49,7 +49,7 @@
 get_target_property(ALLOCORE_LIBRARY allocore${DEBUG_SUFFIX} LOCATION)
 get_target_property(ALLOCORE_DEP_INCLUDE_DIRS allocore${DEBUG_SUFFIX} ALLOCORE_DEP_INCLUDE_DIRS)
 get_target_property(ALLOCORE_LINK_LIBRARIES allocore${DEBUG_SUFFIX} ALLOCORE_LINK_LIBRARIES)
-add_dependencies(${APP_NAME} allocore${DEBUG_SUFFIX})
+add_dependencies("${APP_NAME}" allocore${DEBUG_SUFFIX})

 #message("Using allocore headers from: ${ALLOCORE_DEP_INCLUDE_DIRS}")

@@ -83,8 +83,8 @@
     get_target_property(ALLOUTIL_LIBRARY alloutil${DEBUG_SUFFIX} LOCATION)
     get_target_property(ALLOUTIL_DEP_INCLUDE_DIR alloutil${DEBUG_SUFFIX} ALLOUTIL_DEP_INCLUDE_DIR)
     get_target_property(ALLOUTIL_LINK_LIBRARIES alloutil${DEBUG_SUFFIX} ALLOUTIL_LINK_LIBRARIES)
-    add_dependencies(${APP_NAME} alloutil${DEBUG_SUFFIX})
-    target_link_libraries(${APP_NAME} ${ALLOUTIL_LIBRARY} ${ALLOUTIL_LINK_LIBRARIES})
+    add_dependencies("${APP_NAME}" alloutil${DEBUG_SUFFIX})
+    target_link_libraries("${APP_NAME}" ${ALLOUTIL_LIBRARY} ${ALLOUTIL_LINK_LIBRARIES})
     include_directories(${ALLOUTIL_DEP_INCLUDE_DIR})
 else()
   if(NOT ALLOUTIL_FOUND)
@@ -98,8 +98,8 @@
     get_target_property(ALLOGLV_LIBRARY alloGLV${DEBUG_SUFFIX} LOCATION)
     get_target_property(ALLOGLV_INCLUDE_DIR alloGLV${DEBUG_SUFFIX} ALLOGLV_INCLUDE_DIR)
     get_target_property(ALLOGLV_LINK_LIBRARIES "alloGLV${DEBUG_SUFFIX}" ALLOGLV_LINK_LIBRARIES)
-    add_dependencies(${APP_NAME} alloGLV${DEBUG_SUFFIX})
-    target_link_libraries(${APP_NAME} ${ALLOGLV_LIBRARY} ${ALLOGLV_LINK_LIBRARIES})
+    add_dependencies("${APP_NAME}" alloGLV${DEBUG_SUFFIX})
+    target_link_libraries("${APP_NAME}" ${ALLOGLV_LIBRARY} ${ALLOGLV_LINK_LIBRARIES})
     include_directories(${ALLOGLV_INCLUDE_DIR})
 else()
   if(NOT ALLOGLV_FOUND)
@@ -115,7 +115,7 @@
 # TODO copy resources to build directory

 #    message("Gamma : ${GAMMA_INCLUDE_DIRs}")
-target_link_libraries(${APP_NAME}
+target_link_libraries("${APP_NAME}"
   ${ALLOCORE_LIBRARY}
   ${ALLOCORE_LINK_LIBRARIES})


Fix typo in Flatbuffers cmake module

Fix typo in Flatbuffers cmake module

Change-Id: I0786344b5485a92c02a246b543b6acda279e199c
Reviewed-on: http://gerrit.cloudera.org:8080/6398
Reviewed-by: Dimitris Tsirogiannis <285e4b680d94e4ded69b0d5c81922fd12d83ee6c@cloudera.com>
Tested-by: Impala Public Jenkins

--- cmake_modules/FindFlatBuffers.cmake
+++ cmake_modules/FindFlatBuffers.cmake
@@ -40,4 +40,4 @@

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(FLATBUFFERS REQUIRED_VARS
-  FLATBUFFERS_INCLUDE_DIR FLATBUFERS_LIBS FLATBUFFERS_COMPILER)
+  FLATBUFFERS_INCLUDE_DIR FLATBUFFERS_LIBS FLATBUFFERS_COMPILER)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2010)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 09)
+SET(KWSYS_DATE_STAMP_MONTH 10)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   30)
+SET(KWSYS_DATE_STAMP_DAY   01)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   21)
+SET(KWSYS_DATE_STAMP_DAY   22)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   24)
+SET(KWSYS_DATE_STAMP_DAY   25)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   23)
+SET(KWSYS_DATE_STAMP_DAY   24)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   16)
+SET(KWSYS_DATE_STAMP_DAY   17)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   27)
+SET(KWSYS_DATE_STAMP_DAY   28)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -4,7 +4,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2008)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 03)
+SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   31)
+SET(KWSYS_DATE_STAMP_DAY   01)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   03)
+SET(KWSYS_DATE_STAMP_DAY   04)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   11)
+SET(KWSYS_DATE_STAMP_DAY   12)


Revert "Add new files to cmake scripts"

Revert "Add new files to cmake scripts"

This reverts commit e27bfb63a54825644cacd77cec174fb03f57bfdf.

--- add-sources.cmake
+++ add-sources.cmake
@@ -131,7 +131,6 @@
     ${LOMSE_SRC_DIR}/internal_model/lomse_im_figured_bass.cpp
     ${LOMSE_SRC_DIR}/internal_model/lomse_im_note.cpp
     ${LOMSE_SRC_DIR}/internal_model/lomse_internal_model.cpp
-    ${LOMSE_SRC_DIR}/internal_model/lomse_measures_table.cpp
     ${LOMSE_SRC_DIR}/internal_model/lomse_score_utilities.cpp
 )


Windows CPACK_GENERATOR default ZIP

Windows CPACK_GENERATOR default ZIP

* issue https://github.com/smanders/externpro/issues/22#issuecomment-568551590

--- modules/macpro.cmake
+++ modules/macpro.cmake
@@ -310,7 +310,9 @@
   if(NOT DEFINED CPACK_PACKAGE_VENDOR)
     set(CPACK_PACKAGE_VENDOR "smanders")
   endif()
-  if(UNIX AND NOT DEFINED CPACK_GENERATOR)
+  if(WIN32 AND NOT DEFINED CPACK_GENERATOR)
+    set(CPACK_GENERATOR ZIP)
+  elseif(UNIX AND NOT DEFINED CPACK_GENERATOR)
     set(CPACK_GENERATOR STGZ) # STGZ = Self extracting Tar GZip compression
   endif()
 endmacro()


fix library link order

fix library link order

--- FindOpenEXR.cmake
+++ FindOpenEXR.cmake
@@ -7,13 +7,14 @@
 set(OPENEXR_INCLUDE_DIR  ${OPENEXR_INCLUDE_DIRS})
 set(OPENEXR_LIBRARY_DIR  ${OPENEXR_LIBRARY_DIRS})

-set(OPENEXR_LIBRARIES "${ILMBASE_LIBRARIES}")
-list(APPEND OPENEXR_LIBRARIES "${ZLIB_LIBRARIES}")
+set(OPENEXR_LIBRARIES "")
 foreach (LIBNAME ${CONAN_LIBS_OPENEXR})
     string(REGEX MATCH "[^-]+" LIBNAME_STEM ${LIBNAME})
     find_library(OPENEXR_${LIBNAME_STEM}_LIBRARY NAMES ${LIBNAME} PATHS ${OPENEXR_LIBRARY_DIRS})
     list(APPEND OPENEXR_LIBRARIES "${OPENEXR_${LIBNAME_STEM}_LIBRARY}")
 endforeach()
+list(APPEND OPENEXR_LIBRARIES "${ILMBASE_LIBRARIES}")
+list(APPEND OPENEXR_LIBRARIES "${ZLIB_LIBRARIES}")
 set(OPENEXR_LIBRARY ${OPENEXR_LIBRARIES})

 foreach (INCLUDE_DIR ${OPENEXR_INCLUDE_DIRS})


fix(log): Actually enable trace logging by default

--- include/settings.hpp.cmake
+++ include/settings.hpp.cmake
@@ -47,8 +47,9 @@

 #cmakedefine XPP_EXTENSION_LIST @XPP_EXTENSION_LIST@

+#cmakedefine DEBUG_LOGGER
+
 #if DEBUG
-#cmakedefine DEBUG_LOGGER
 #cmakedefine DEBUG_LOGGER_VERBOSE
 #cmakedefine DEBUG_HINTS
 #cmakedefine DEBUG_WHITESPACE


Put /usr/lib/sse2 first in the search path.

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@1323 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- library/FindAtlas.cmake
+++ library/FindAtlas.cmake
@@ -8,7 +8,7 @@
 #FIND_LIBRARY( BOOST_FILESYSTEM_LIB NAMES boost_filesystem
 #	      PATHS /usr/lib /usr/local/lib C:\\Boost\\lib )

-SET(ATLAS_LIB_SEARCH_DIRS /usr/lib/atlas/sse2 /usr/lib/sse2 /usr/local/lib/atlas)
+SET(ATLAS_LIB_SEARCH_DIRS /usr/lib/sse2 /usr/lib/atlas/sse2 /usr/local/lib/atlas)

 FIND_LIBRARY( ATLAS NAMES atlas PATHS ${ATLAS_LIB_SEARCH_DIRS})
 FIND_LIBRARY( ATLAS_CBLAS NAMES cblas PATHS ${ATLAS_LIB_SEARCH_DIRS})