fix osx build

fix osx build

--- cmake/bgfx.cmake
+++ cmake/bgfx.cmake
@@ -66,7 +66,9 @@
 elseif("${CMAKE_GENERATOR}" STREQUAL "Unix Makefiles")
     set(bgfx_CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E env "BX_DIR=${bx_DIR}" "BIMG_DIR=${bimg_DIR}" "${bx_GENIE}${CMAKE_EXECUTABLE_SUFFIX}" --with-tools --with-shared-lib "--gcc=${bgfx_GENIE_GCC}" gmake)
     set(bgfx_BUILD_COMMAND "$(MAKE)" -C "<SOURCE_DIR>/.build/projects/gmake-${bgfx_SYSTEM_NAME}" config=release64)
-    set(bgfx_SYSTEM_NAME "linux64_gcc")
+    if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+        set(bgfx_SYSTEM_NAME "linux64_gcc")
+    endif()
 else()
     message(FATAL_ERROR "BGFX does not support the generator '${CMAKE_GENERATOR}'.")
 endif()


Remove old Java 1.7 workaround

Remove old Java 1.7 workaround

--- properties.cmake
+++ properties.cmake
@@ -94,13 +94,6 @@
 set(TOML "${CLAW_X2T_JAR_INSTALL_PATH}/${TOML_NAME}.jar")
 set(BUILD_TOML "${CMAKE_SOURCE_DIR}/cx2t/lib/${TOML_NAME}.jar")

-#
-# External program options
-#
-if(${Java_VERSION} VERSION_EQUAL "1.7")
-  set(JAVA_OPT "-Xmx200m -Xms200m")
-endif()
-
 set(FPP "${CMAKE_Fortran_COMPILER}")
 set(CPP_OPT "${FPPFLAGS}")


moved Windows-specific flags under the WINDOWS guard in CMake

git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@231384 91177308-0d34-0410-b5e6-96231b3b80d8

--- runtime/cmake/Intel/AsmFlags.cmake
+++ runtime/cmake/Intel/AsmFlags.cmake
@@ -18,18 +18,18 @@
 function(append_assembler_specific_asm_flags input_asm_flags)
     set(local_asm_flags)
     append_asm_flags("-x assembler-with-cpp") # Assembly file that needs to be preprocessed
-    if(${IA32})
-        append_asm_flags("-safeseh") # Registers exception handlers for safe exception handling.
-        append_asm_flags("-coff") # Generates common object file format (COFF) type of object module.
-                                  # Generally required for Win32 assembly language development.
-        append_asm_flags("-D _M_IA32")
-    elseif(${INTEL64})
-        append_asm_flags("-D _M_AMD64")
-    endif()
     if(${MIC})
         append_asm_flags("-mmic") # Build Intel(R) MIC Architecture native code
     endif()
     if(${WINDOWS})
+        if(${IA32})
+            append_asm_flags("-safeseh") # Registers exception handlers for safe exception handling.
+            append_asm_flags("-coff") # Generates common object file format (COFF) type of object module.
+                                      # Generally required for Win32 assembly language development.
+            append_asm_flags("-D _M_IA32")
+        elseif(${INTEL64})
+            append_asm_flags("-D _M_AMD64")
+        endif()
         # CMake prefers the /MD flags when compiling Windows sources, but libiomp5 needs to use /MT instead
         # So we replace these /MD instances with /MT within the CMAKE_*_FLAGS variables and put that out to the CACHE.
         # replace_md_with_mt() is in HelperFunctions.cmake


Fix Qt5 dependencies in case only CTK_BUILD_ALL is enabled.

--- CMake/ctkMacroSetupQt.cmake
+++ CMake/ctkMacroSetupQt.cmake
@@ -35,13 +35,13 @@
     set(QT5_INSTALL_PREFIX "" CACHE PATH "The install location of Qt5")
     set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT5_INSTALL_PREFIX})
     set(CTK_QT5_COMPONENTS Core Xml XmlPatterns Concurrent Sql Test)
-    if(CTK_LIB_Widgets OR CTK_LIB_CommandLineModules/Frontend/QtGui OR CTK_BUILD_ALL_LIBRARIES)
+    if(CTK_LIB_Widgets OR CTK_LIB_CommandLineModules/Frontend/QtGui OR CTK_BUILD_ALL OR CTK_BUILD_ALL_LIBRARIES)
       list(APPEND CTK_QT5_COMPONENTS Widgets OpenGL UiTools)
     endif()
-    if(CTK_LIB_CommandLineModules/Frontend/QtWebKit OR CTK_BUILD_ALL_LIBRARIES)
+    if(CTK_LIB_CommandLineModules/Frontend/QtWebKit OR CTK_BUILD_ALL OR CTK_BUILD_ALL_LIBRARIES)
       list(APPEND CTK_QT5_COMPONENTS WebKitWidgets)
     endif()
-    if(CTK_LIB_XNAT/Core OR CTK_BUILD_ALL_LIBRARIES)
+    if(CTK_LIB_XNAT/Core OR CTK_BUILD_ALL OR CTK_BUILD_ALL_LIBRARIES)
       list(APPEND CTK_QT5_COMPONENTS Script)
     endif()
     find_package(Qt5 COMPONENTS ${CTK_QT5_COMPONENTS} REQUIRED)


Remove extraneous SQ_ARDUINO define on command line

--- cmake/CMakeAvr.cmake
+++ cmake/CMakeAvr.cmake
@@ -22,7 +22,7 @@
 SET(CXXOPT "-fno-exceptions")
 SET(CINCS "-I${CMAKE_SOURCE_DIR}/arduino")
 SET(CMCU "-mmcu=atmega328p")
-SET(CDEFS "-DF_CPU=16000000L -DSQ_ARDUINO")
+SET(CDEFS "-DF_CPU=16000000L")

 SET(CFLAGS "${CMCU} ${CDEBUG} ${CDEFS} ${CINCS} ${COPT} ${CWARN} ${CSTANDARD} ${CEXTRA} ${CTUNING}")
 #SET(CFLAGS "${CMCU} ${CDEFS} ${CINCS} ${COPT} ${CWARN} ${CSTANDARD} ${CEXTRA} ${CTUNING}")


Add -fix for clang-tidy

Add -fix for clang-tidy

--- cmake/ClangTools.cmake
+++ cmake/ClangTools.cmake
@@ -46,7 +46,7 @@
   cmake_parse_arguments(ARG "" "" "FILES;DEPENDS" ${ARGN})

   add_custom_target(tidy-${_target}
-    COMMAND ${CLANG_TIDY_PROG} -p=${CMAKE_BINARY_DIR} ${ARG_FILES}
+    COMMAND ${CLANG_TIDY_PROG} -fix -p=${CMAKE_BINARY_DIR} ${ARG_FILES}
     WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/..
     DEPENDS ${ARG_DEPENDS}
     COMMENT "Running clang-tidy for ${_target}"


Use CMAKE_CROSSCOMPILING_EMULATOR when generating LV2 ttl

Signed-off-by: falkTX <d7e5958cbb080ba57e41fb602ade747e1a2da17c@falktx.com>

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -347,6 +347,7 @@

   add_custom_command(TARGET "${NAME}-lv2" POST_BUILD
     COMMAND
+    ${CMAKE_CROSSCOMPILING_EMULATOR}
     "$<TARGET_FILE:lv2_ttl_generator>"
     "$<TARGET_FILE:${NAME}-lv2>"
     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/bin/${NAME}.lv2"


CMake: fix finding ffmpeg with pkgconfig.

--- cmake/FindFFMPEG.cmake
+++ cmake/FindFFMPEG.cmake
@@ -6,32 +6,34 @@
 #  FFMPEG_LIBRARIES - link these to use FFMPEG

 # Use pkg-config to get hints about paths
-#find_package(PkgConfig QUIET)
-#if(PKG_CONFIG_FOUND)
-#	pkg_check_modules(FFMPEG_PKGCONF ffmpeg)
-#endif(PKG_CONFIG_FOUND)
+find_package(PkgConfig QUIET)
+
+if(PKG_CONFIG_FOUND)
+	pkg_check_modules(AVCODEC_PKGCONF libavcodec)
+	pkg_check_modules(AVFORMAT_PKGCONF libavformat)
+	pkg_check_modules(AVUTIL_PKGCONF libavutil)
+endif(PKG_CONFIG_FOUND)

 # Include dir
 find_path(FFMPEG_INCLUDE_DIR
 	NAMES libavcodec/avcodec.h libavformat/avformat.h libavformat/avio.h
-#	PATH_SUFFIXES include
-#	PATHS ${FFMPEG_PKGCONF_INCLUDE_DIRS}
+	PATHS ${AVCODEC_PKGCONF_INCLUDE_DIRS} ${AVFORMAT_PKGCONF_INCLUDE_DIRS} ${AVUTIL_PKGCONF_INCLUDE_DIRS}
 )

 # Libraries
 find_library(AVCODEC_LIBRARY
 	NAMES avcodec
-#	PATHS ${FFMPEG_PKGCONF_LIBRARY_DIRS}
+	PATHS ${AVCODEC_PKGCONF_LIBRARY_DIRS}
 )

 find_library(AVFORMAT_LIBRARY
 	NAMES avformat
-#	PATHS ${FFMPEG_PKGCONF_LIBRARY_DIRS}
+	PATHS ${AVFORMAT_PKGCONF_LIBRARY_DIRS}
 )

 find_library(AVUTIL_LIBRARY
 	NAMES avutil
-#	PATHS ${FFMPEG_PKGCONF_LIBRARY_DIRS}
+	PATHS ${AVUTIL_PKGCONF_LIBRARY_DIRS}
 )

 find_package(PackageHandleStandardArgs)


build: Clean up the find-module for GnuTLS

--- cmake/FindGnuTLS.cmake
+++ cmake/FindGnuTLS.cmake
@@ -20,35 +20,38 @@
 # Copyright (C) 2018 Scylladb, Ltd.
 #

-find_package (PkgConfig)
+find_package (PkgConfig REQUIRED)

-pkg_search_module (PC_GnuTLS
+pkg_search_module (GnuTLS_PC
   QUIET
-  REQUIRED
   gnutls)
+
+find_library (GnuTLS_LIBRARY
+  NAMES gnutls
+  HINTS
+    ${GnuTLS_PC_LIBDIR}
+    ${GnuTLS_PC_LIBRARY_DIRS})

 find_path (GnuTLS_INCLUDE_DIR
   NAMES gnutls/gnutls.h
-  PATHS ${PC_GnuTLS_INCLUDE_DIRS})
+  HINTS
+    ${GnuTLS_PC_INCLUDEDIR}
+    ${GnuTLS_PC_INCLUDE_DIRS})

-find_library (GnuTLS_LIBRARY
-  NAMES gnutls
-  PATHS ${PC_GnuTLS_LIBRARY_DIRS})
-
-set (GnuTLS_VERSION ${PC_GnuTLS_VERSION})
+mark_as_advanced (
+  GnuTLS_LIBRARY
+  GnuTLS_INCLUDE_DIR)

 include (FindPackageHandleStandardArgs)

 find_package_handle_standard_args (GnuTLS
-  FOUND_VAR GnuTLS_FOUND
   REQUIRED_VARS
+    GnuTLS_LIBRARY
     GnuTLS_INCLUDE_DIR
-    GnuTLS_LIBRARY
-  VERSION_VAR GnuTLS_VERSION)
+  VERSION_VAR GnuTLS_PC_VERSION)

-if (GnuTLS_FOUND)
-  set (GnuTLS_INCLUDE_DIRS ${GnuTLS_INCLUDE_DIR})
-endif ()
+set (GnuTLS_LIBRARIES ${GnuTLS_LIBRARY})
+set (GnuTLS_INCLUDE_DIRS ${GnuTLS_INCLUDE_DIR})

 if (GnuTLS_FOUND AND NOT (TARGET GnuTLS::gnutls))
   add_library (GnuTLS::gnutls UNKNOWN IMPORTED)
@@ -56,10 +59,5 @@
   set_target_properties (GnuTLS::gnutls
     PROPERTIES
       IMPORTED_LOCATION ${GnuTLS_LIBRARY}
-      INTERFACE_COMPILE_OPTIONS "${PC_GnuTLS_CFLAGS_OTHER}"
-      INTERFACE_INCLUDE_DIRECTORIES ${GnuTLS_INCLUDE_DIR})
+      INTERFACE_INCLUDE_DIRECTORIES ${GnuTLS_INCLUDE_DIRS})
 endif ()
-
-mark_as_advanced (
-  GnuTLS_INCLUDE_DIR
-  GnuTLS_LIBRARY)


Updated FindMatlab.cmake

Updated FindMatlab.cmake

--- cmake/FindMatlab.cmake
+++ cmake/FindMatlab.cmake
@@ -73,13 +73,17 @@
   IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
     SET(MATLAB_SYS
       $ENV{MATLAB_ROOT}/bin/glnx86/
-      /usr/local/matlab-7sp1/bin/glnx86/
-      /opt/matlab-7sp1/bin/glnx86/
+      /usr/local/MATLAB/R2010b/bin/glnx86/
+      /usr/local/MATLAB/R2011a/bin/glnx86/
+      /usr/local/MATLAB/R2011b/bin/glnx86/
+      /usr/local/MATLAB/R2012a/bin/glnx86/
+      /usr/local/matlab/bin/glnx86/
       )
   # AMD64:
   ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
     SET(MATLAB_SYS
       $ENV{MATLAB_ROOT}/bin/glnxa64/
+      /usr/local/MATLAB/R2010b/bin/glnxa64/
       /usr/local/MATLAB/R2011a/bin/glnxa64/
       /usr/local/MATLAB/R2011b/bin/glnxa64/
       /usr/local/MATLAB/R2012a/bin/glnxa64/
@@ -92,7 +96,7 @@
   find_library(MATLAB_MEX_LIBRARY mex  PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
   find_library(MATLAB_MAT_LIBRARY mat  PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
   find_library(MATLAB_MX_LIBRARY  mx   PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
-  find_library(MATLAB_ENG_LIBRARY eng  PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
+  find_library(MATLAB_ENG_LIBRARY eng  PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
   #find_library(MATLAB_QT_QTCORE_LIBRARY QtCore PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
   #find_library(MATLAB_QT_QTGUI_LIBRARY  QtGui  PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
   #find_library(MATLAB_QT_QTXML_LIBRARY  QtXml  PATHS ${MATLAB_SYS} NO_DEFAULT_PATH)
@@ -103,6 +107,7 @@
     "mex.h"
     PATHS
     $ENV{MATLAB_ROOT}/extern/include/
+    /usr/local/MATLAB/R2010b/extern/include
     /usr/local/MATLAB/R2011a/extern/include
     /usr/local/MATLAB/R2011b/extern/include
     /usr/local/MATLAB/R2012a/extern/include


handle cross compiling on same arch for x86 (#408)

--- cmake/FindUnwind.cmake
+++ cmake/FindUnwind.cmake
@@ -12,26 +12,26 @@
 if (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
     set (Unwind_ARCH "arm")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
-    set (Unwind_ARCH "aarch64")
+    set (Unwind_ARCH "unwind-aarch64")
 elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
         CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR
         CMAKE_SYSTEM_PROCESSOR STREQUAL "corei7-64")
-    set (Unwind_ARCH "x86_64")
+    set (Unwind_ARCH "unwind-x86_64" "unwind-x86")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
-    set (Unwind_ARCH "x86")
+    set (Unwind_ARCH "unwind-x86" "unwind-x86_64")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64")
-    set (Unwind_ARCH "ppc64")
+    set (Unwind_ARCH "unwind-ppc64")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc")
-    set (Unwind_ARCH "ppc32")
+    set (Unwind_ARCH "unwind-ppc32")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^mips")
-    set (Unwind_ARCH "mips")
+    set (Unwind_ARCH "unwind-mips")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^hppa")
-    set (Unwind_ARCH "hppa")
+    set (Unwind_ARCH "unwind-hppa")
 elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^ia64")
-    set (Unwind_ARCH "ia64")
+    set (Unwind_ARCH "unwind-ia64")
 endif (CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")

-find_library (Unwind_PLATFORM_LIBRARY NAMES "unwind-${Unwind_ARCH}"
+find_library (Unwind_PLATFORM_LIBRARY NAMES ${Unwind_ARCH}
   DOC "unwind library platform")

 mark_as_advanced (Unwind_INCLUDE_DIR Unwind_LIBRARY Unwind_PLATFORM_LIBRARY)
@@ -81,4 +81,4 @@
       IMPORTED_CONFIGURATIONS RELEASE
     )
   endif (NOT TARGET unwind::unwind)
-endif (Unwind_FOUND)+endif (Unwind_FOUND)


Created a git macro for c++ applications.

--- cmake/ROCSMacros.cmake
+++ cmake/ROCSMacros.cmake
@@ -31,6 +31,7 @@
 # <name> SOURCES <source_file> [<source_file> ...]
 # HEADERS <header_file> [<header_file> ...]
 # LINK <library> [<library> ...]
+# LINK_MODULES <module> [<module> ...]
 macro(add_rocs_cpp_module)
 	# Parse arguments
 	parse_arguments(ARG "SOURCES;HEADERS;LINK;LINK_MODULES" "" ${ARGN})
@@ -81,18 +82,44 @@

 # Adds a C++ application
-macro(add_rocs_cpp_app _NAME_ _SOURCES_VAR_)
+# Arguments:
+# <name> SOURCES <source_file> [<source_file> ...]
+# LINK <library> [<library> ...]
+# LINK_MODULES <module> [<module> ...]
+macro(add_rocs_cpp_app)
+	# Parse arguments
+	parse_arguments(ARG "SOURCES;HEADERS;LINK;LINK_MODULES" "" ${ARGN})
+	list(GET ARG_DEFAULT_ARGS 0 ARG_NAME)
+
+	# Check if module name is set
+	if("${MODULE_NAME}" STREQUAL "")
+		message(FATAL_ERROR "Module must be defined before a test suite can be defined!")
+	endif("${MODULE_NAME}" STREQUAL "")
+
 	# Get sources
 	set(_SOURCES_ "")
-	foreach(I ${${_SOURCES_VAR_}})
-		set(_SOURCES_ "${I}" ${_SOURCES_})
+	foreach(I ${ARG_SOURCES})
+		set(_SOURCES_ "cpp/apps/${I}" ${_SOURCES_})
 	endforeach(I)

-	# Add target
-	add_executable(${_NAME_} ${_SOURCES_})
+	# Add executable
+	add_executable(rocs_${ARG_NAME} ${_SOURCES_})
+
+	# Get and add linked libraries
+	if(NOT "${ARG_LINK}" STREQUAL "")
+		target_link_libraries(rocs_${ARG_NAME} ${ARG_LINK})
+	endif(NOT "${ARG_LINK}" STREQUAL "")
+
+	# Get and add linked module libraries
+	if(NOT "${ARG_LINK_MODULES}" STREQUAL "")
+		foreach(I ${ARG_LINK_MODULES})
+			add_dependencies(rocs_${ARG_NAME} rocs_${I})
+			target_link_libraries(rocs_${ARG_NAME} rocs_${I})
+		endforeach(I)
+	endif(NOT "${ARG_LINK_MODULES}" STREQUAL "")

 	# Install
-	install(TARGETS ${_NAME_} RUNTIME DESTINATION ${ROCS_DIR}/bin)
+	install(TARGETS rocs_${ARG_NAME} RUNTIME DESTINATION ${ROCS_DIR}/bin)
 endmacro(add_rocs_cpp_app)


cmake: use the correct property for the memory region name

Fix the zephyr_linker_dts_memory to lookup the correct property name
when trying to figre the region name.

Signed-off-by: Fabio Baltieri <161d407f4dc681bfd4aedb33b8273b2aafd727bc@gmail.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -3376,7 +3376,7 @@

   dt_reg_addr(addr PATH ${DTS_MEMORY_PATH})
   dt_reg_size(size PATH ${DTS_MEMORY_PATH})
-  dt_prop(name PATH ${DTS_MEMORY_PATH} PROPERTY "memory-region")
+  dt_prop(name PATH ${DTS_MEMORY_PATH} PROPERTY "zephyr,memory-region")
   if (NOT DEFINED name)
     # Fallback to the node path
     set(name ${DTS_MEMORY_PATH})


Add cmake logic to turn of the memqt device if Qt is not installed, untested.

svn path=/trunk/; revision=11213

--- cmake/modules/qt.cmake
+++ cmake/modules/qt.cmake
@@ -31,6 +31,7 @@
 # PLD_qtwidget		  - ON means the qtwidget device is enabled.
 # PLD_svgqt		  - ON means the svgqt device is enabled.
 # PLD_extqt		  - ON means the extqt device is enabled.
+# PLD_memqt               - ON means the memqt device is enabled.
 # qt_COMPILE_FLAGS	  - individual COMPILE_FLAGS required to compile wxwidgets
 # 			    device.
 # qt_LINK_FLAGS	  	  - list of full path names of libraries and
@@ -50,7 +51,7 @@
 # PYQT_SIP_DIR		  - sip system directory
 # PYQT_SIP_FLAGS	  - sip command flags

-if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt)
+if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt)
   set(ANY_QT_DEVICE ON)
 endif(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt)

@@ -101,6 +102,7 @@
     set(PLD_qtwidget OFF CACHE BOOL "Enable Qt interactive device" FORCE)
     set(PLD_svgqt OFF CACHE BOOL "Enable Qt SVG device" FORCE)
     set(PLD_extqt OFF CACHE BOOL "Enable Qt ext device" FORCE)
+    set(PLD_memqt OFF CACHE BOOL "Enable Qt ext device" FORCE)
 endif(NOT ANY_QT_DEVICE)

 if(DEFAULT_NO_BINDINGS)


don't call comspec when doing copy_dlls

don't call comspec when doing copy_dlls

--- cmake/CopyDlls.cmake
+++ cmake/CopyDlls.cmake
@@ -72,7 +72,7 @@
 	add_custom_command(
 		TARGET ${TARGET}
 		POST_BUILD
-		COMMAND $ENV{COMSPEC} /c ${_cmd_file}
+		COMMAND ${_cmd_file}
 		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 		VERBATIM)


CMake: gcov: really accept appleclang :/

--- cmake/gcc-gcov.cmake
+++ cmake/gcc-gcov.cmake
@@ -2,6 +2,7 @@
   if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS 3)
     message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
   endif()
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
 elseif(NOT CMAKE_COMPILER_IS_GNUCXX)
   message(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
 endif()


small fix

small fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@5997 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -159,7 +159,8 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
     #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffunction-sections -Wl,--gc-sections")
   endif()
-elseif(NOT MSVC AND NOT POLICY CMP0063) #not mingw
+elseif(CMAKE_COMPILER_IS_GNUCXX AND NOT POLICY CMP0063) #not mingw
+#elseif(NOT MSVC AND NOT POLICY CMP0063) #to do: fix clang
   check_cxx_compiler_flag(-fvisibility=hidden visibility)
     if (visibility) # for object libraries with cmake less than 3.3
       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")


fix standard choice

fix standard choice

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@8564 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -89,7 +89,7 @@
 if (NOT DEFINED CMAKE_CXX_STANDARD)
     set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "")
 endif()
-#set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_STANDARD_REQUIRED OFF)
 set(CMAKE_CXX_EXTENSIONS OFF)

 if (CMAKE_VERSION VERSION_LESS "3.1" AND CMAKE_COMPILER_IS_GNUCC)


Fix error with cmake 2.6

Fix error with cmake 2.6

--- cmake/readline.cmake
+++ cmake/readline.cmake
@@ -197,11 +197,11 @@
     # Handle mutual exclusion of WITH_READLINE/WITH_LIBEDIT variables
     # We save current setting to recognize when user switched between
     # WITH_READLINE and WITH_LIBEDIT
-    IF(WITH_READLINE AND SAVE_READLINE_SETTING MATCHES "WITH_LIBEDIT"
-      OR NOT SAVE_READLINE_SETTING )
+    IF(WITH_READLINE AND (SAVE_READLINE_SETTING MATCHES "WITH_LIBEDIT"
+      OR NOT SAVE_READLINE_SETTING))
       SET(WITH_LIBEDIT OFF CACHE BOOL "Use bundled libedit" FORCE)
-    ELSEIF(WITH_LIBEDIT AND SAVE_READLINE_SETTING MATCHES "WITH_READLINE"
-      OR NOT SAVE_READLINE_SETTING )
+    ELSEIF(WITH_LIBEDIT AND (SAVE_READLINE_SETTING MATCHES "WITH_READLINE"
+      OR NOT SAVE_READLINE_SETTING))
       SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline" FORCE)
     ENDIF()


remove extraneous test dependency

remove extraneous test dependency

Infovis/Layout/Testing temporarily needed vtkViewsContext2D
for TestTreeHeatmapItem, but now that this test lives in
Views/Infovis, we can remove the dependency here.

Change-Id: If6471f50113ccbc5e725618b8564b00cbadc0a04

--- Infovis/Layout/module.cmake
+++ Infovis/Layout/module.cmake
@@ -11,5 +11,4 @@
     vtkRenderingOpenGL
     vtkTestingRendering
     vtkIOInfovis
-    vtkViewsContext2D
   )


oops.

oops.

--- cmake-scripts/Findwxwidgets3.cmake
+++ cmake-scripts/Findwxwidgets3.cmake
@@ -30,7 +30,7 @@
     SET(WXWIDGETS_INCLUDE_DIR ${WXWIDGETS_INCLUDE_DIR} ${WXWIDGETS_SETUP_PATH})
 ELSE(MINGW)
     FIND_PROGRAM(WX_CONFIG
-        wx-config3.0 | wx-config2.9
+        NAMES wx-config3.0 wx-config2.9
         PATHS
             /usr/bin
             /usr/local/bin


Renamed IOS_SDK_VERSION to SDK_VERSION

Renamed IOS_SDK_VERSION to SDK_VERSION

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -94,7 +94,7 @@
 # This toolchain defines the following variables for use externally:
 #
 # XCODE_VERSION: Version number (not including Build version) of Xcode detected.
-# IOS_SDK_VERSION: Version of iOS SDK being used.
+# SDK_VERSION: Version of iOS SDK being used.
 # CMAKE_OSX_ARCHITECTURES: Architectures being compiled for (generated from
 #    IOS_PLATFORM).
 #
@@ -334,7 +334,7 @@
 set(ENABLE_VISIBILITY_INT ${ENABLE_VISIBILITY} CACHE BOOL "Whether or not to hide symbols (-fvisibility=hidden)" FORCE)
 # Get the SDK version information.
 execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT} -version SDKVersion
-  OUTPUT_VARIABLE IOS_SDK_VERSION
+  OUTPUT_VARIABLE SDK_VERSION
   ERROR_QUIET
   OUTPUT_STRIP_TRAILING_WHITESPACE)
 # Find the Developer root for the specific iOS platform being compiled for
@@ -404,7 +404,7 @@
   set(CMAKE_SYSTEM_NAME Darwin CACHE INTERNAL "" FORCE)
 endif()
 # Standard settings.
-set(CMAKE_SYSTEM_VERSION ${IOS_SDK_VERSION} CACHE INTERNAL "")
+set(CMAKE_SYSTEM_VERSION ${SDK_VERSION} CACHE INTERNAL "")
 set(UNIX TRUE CACHE BOOL "")
 set(APPLE TRUE CACHE BOOL "")
 set(IOS TRUE CACHE BOOL "")
@@ -441,7 +441,7 @@
 endif()

 message(STATUS "Building for minimum iOS version: ${IOS_DEPLOYMENT_TARGET}"
-               " (SDK version: ${IOS_SDK_VERSION})")
+               " (SDK version: ${SDK_VERSION})")
 # Note that only Xcode 7+ supports the newer more specific:
 # -m${SDK_NAME}-version-min flags, older versions of Xcode use:
 # -m(ios/ios-simulator)-version-min instead.


more ICC warnings that tell us not to use this flag

--- cmake/CheckMicCXXCompilerFlag.cmake
+++ cmake/CheckMicCXXCompilerFlag.cmake
@@ -69,8 +69,10 @@
                "[Ww]arning: [Oo]ption"                     # SunPro
                "command option .* is not recognized"       # XL
                "WARNING: unknown flag:"                    # Open64
-               " #10159: "                                 # ICC
-               " #10006: "                                 # ICC
+               " #10159: "  # ICC
+               " #10006: "  # ICC
+               " #10148: "  # ICC: option '-msse2avx' not supported
+               " #10353: "  # ICC: option '-mavx2' ignored, suggest using '-march=core-avx2'
                )
             if("${OUTPUT}" MATCHES "${_fail_regex}")
                set(${_RESULT} FALSE)


handle 06_02H (kvm CPU) correctly as SSE2 CPU by making a difference on how unknown CPU models are treated: below 14 as SSE2 only - above as Core2

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -74,11 +74,15 @@
                set(TARGET_ARCHITECTURE "merom")
             elseif(_cpu_model EQUAL 14)
                set(TARGET_ARCHITECTURE "core")
+            elseif(_cpu_model LESS 14)
+               message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the generic CPU settings with SSE2.")
+               set(TARGET_ARCHITECTURE "generic")
             else()
                message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the 65nm Core 2 CPU settings.")
                set(TARGET_ARCHITECTURE "merom")
             endif()
          elseif(_cpu_family EQUAL 7) # Itanium (not supported)
+            message(WARNING "Your CPU (Itanium: family ${_cpu_family}, model ${_cpu_model}) is not supported by OptimizeForArchitecture.cmake.")
          elseif(_cpu_family EQUAL 15) # NetBurst
             list(APPEND _available_vector_units_list "sse" "sse2")
             if(_cpu_model GREATER 2) # Not sure whether this must be 3 or even 4 instead


Simplify architecture detection

Simplify architecture detection

--- cmake/cross-toolchain-linux32.cmake
+++ cmake/cross-toolchain-linux32.cmake
@@ -1,6 +1,10 @@
 # Target operating system and architecture
 set( CMAKE_SYSTEM_NAME Linux )
 set( CMAKE_SYSTEM_PROCESSOR x86 )
+
+# C/C++ compilers
+set( CMAKE_C_COMPILER gcc -m32 )
+set( CMAKE_CXX_COMPILER g++ -m32 )

 # Only look for libraries in lib32
 set( CMAKE_SYSTEM_LIBRARY_PATH /lib32 /usr/lib32 /usr/local/lib32 )


[cmake] fix warning settings

[cmake] fix warning settings

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -59,11 +59,11 @@
   "-DDNDEBUG -O2 -fPIC " )

 SET( CMAKE_CXX_FLAGS_DEBUG
-  "-O0 -DDNDEBUG -g3 -ggdb -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Wunused-variable -Winline -fno-strict-aliasing -Wundef -Wnon-virtual-dtor -fPIC " )
+  "-O0 -DDNDEBUG -g3 -ggdb  -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow  -Wundef -Wnon-virtual-dtor" )

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   set( CMAKE_CXX_FLAGS_DEBUG
-        "${CMAKE_CXX_FLAGS_DEBUG} -Wdocumentation -Wshorten-64-to-32 -Wused-but-marked-unused -Wdisabled-macro-expansion -Wcovered-switch-default  -Wfloat-equal -Wswitch-enum -Wunreachable-code -Wnon-literal-null-conversion "
+        "${CMAKE_CXX_FLAGS_DEBUG} -Wnon-literal-null-conversion -Wused-but-marked-unused -Wno-tautological-compare -Wfloat-equal -Wdisabled-macro-expansion -Wcovered-switch-default  -Wswitch-enum -Wunreachable-code  -Wshorten-64-to-32"
         )
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
   set( CMAKE_CXX_FLAGS_DEBUG
@@ -102,13 +102,13 @@
   if(MPI_FOUND)
     if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
       message(STATUS "Enabling mpi features, mac style!")
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS} -w -pthread -DMPIPP_H -DENABLE_MPI=1" )
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS} -pthread -DMPIPP_H -DENABLE_MPI=1" )
       include_directories(${MPI_CXX_INCLUDE_PATH})
       SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS} -pthread")
       LIST( APPEND PARALIBS ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY})
     else(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
       message(STATUS "Enabling mpi features")
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS} -w -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -DMPIPP_H -DENABLE_MPI=1" )
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS} -I/usr/lib/openmpi/include -I/usr/lib/openmpi/include/openmpi -pthread -DMPIPP_H -DENABLE_MPI=1" )
       include_directories(${MPI_CXX_INCLUDE_PATH})
       SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS} -pthread -L/usr/lib/openmpi/lib -lmpi -lopen-rte -lopen-pal -ldl -Wl,--export-dynamic -lnsl -lutil -lm -ldl")
       LIST( APPEND PARALIBS ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY} parmetis metis)


cmake: print message if build needs to default to boost::shared_ptr

--- cmake/Modules/LibPKMNCompilerCheck.cmake
+++ cmake/Modules/LibPKMNCompilerCheck.cmake
@@ -114,6 +114,7 @@

     IF(NOT HAVE_SHARED_PTR)
         ADD_DEFINITIONS(-DLIBPKMN_USE_BOOST_SHARED_PTR)
+        MESSAGE(STATUS "STL shared_ptr not found. Defaulting to boost::shared_ptr.")
     ENDIF(NOT HAVE_SHARED_PTR)
 ENDIF(NOT USE_BOOST_SHARED_PTR)


Add OpenCV-Extra 3.4.0

Add OpenCV-Extra 3.4.0

--- cmake/projects/OpenCV-Extra/hunter.cmake
+++ cmake/projects/OpenCV-Extra/hunter.cmake
@@ -6,6 +6,17 @@
 include(hunter_add_version)
 include(hunter_download)
 include(hunter_pick_scheme)
+
+hunter_add_version(
+    PACKAGE_NAME
+    OpenCV-Extra
+    VERSION
+    "3.4.0"
+    URL
+    "https://github.com/opencv/opencv_contrib/archive/3.4.0.tar.gz"
+    SHA1
+    e7ba971a30fe85e87de606d8cdf3b3bf4cc3da14
+)

 hunter_add_version(
     PACKAGE_NAME


build: update download URL for Boost

build: update download URL for Boost

boost project does not host its dist tarballs at bintray anymore.
let's use the new place. and take this opportunity to use the
latest boost stable release at the time of writing.

Signed-off-by: Kefu Chai <cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>
Message-Id: <20211004001535.26104-1-cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>

--- cooking_recipe.cmake
+++ cooking_recipe.cmake
@@ -133,9 +133,8 @@

 cooking_ingredient (Boost
   EXTERNAL_PROJECT_ARGS
-    # The 1.67.0 release has a bug in Boost Lockfree around a missing header.
-    URL https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
-    URL_MD5 319c6ffbbeccc366f14bb68767a6db79
+    URL https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2
+    URL_HASH SHA256=fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854
     PATCH_COMMAND
       ./bootstrap.sh
       --prefix=<INSTALL_DIR>


Support of EMBEDDED keyword

Support of EMBEDDED keyword

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -44,9 +44,6 @@
       IF (MYPACKAGE_DEBUG)
         MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} embedded mode")
       ENDIF ()
-      SET (_ALL FALSE)
-      SET (_LIBS TRUE)
-      SET (_TESTS TRUE)
       SET (_ALL_IN_ONE TRUE)
     ENDIF ()
   ENDFOREACH ()


CMake support2

CMake support2

--- cmake/packaging/windows/generate_msvc_libraries.cmake
+++ cmake/packaging/windows/generate_msvc_libraries.cmake
@@ -19,7 +19,7 @@

     file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/../${platform}")

-    execute_process(COMMAND cmake -G "${GENERATOR}" ../..
+    execute_process(COMMAND cmake -G "${GENERATOR}" -DEPROSIMA_BUILD=${EPROSIMA_BUILD} ../..
         WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/../${platform}
         RESULT_VARIABLE EXECUTE_RESULT)


[Config] Added support for Python 3.10

[Config] Added support for Python 3.10

--- config/FindPython/Support.cmake
+++ config/FindPython/Support.cmake
@@ -25,7 +25,7 @@
   message (FATAL_ERROR "FindPython: INTERNAL ERROR")
 endif()
 if (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 3)
-  set(_${_PYTHON_PREFIX}_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+  set(_${_PYTHON_PREFIX}_VERSIONS 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
 elseif (_${_PYTHON_PREFIX}_REQUIRED_VERSION_MAJOR EQUAL 2)
   set(_${_PYTHON_PREFIX}_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
 else()


UMUNDONATIVEJAVA_LOCATION not enough to check whether java was built

--- contrib/cmake/CPackUMundo.cmake
+++ contrib/cmake/CPackUMundo.cmake
@@ -90,9 +90,13 @@
 GET_TARGET_PROPERTY(UMUNDONATIVEJAVA_LOCATION umundoNativeJava LOCATION)
 if (UMUNDONATIVEJAVA_LOCATION)
 	if (DIST_PREPARE)
-		install(FILES ${PROJECT_SOURCE_DIR}/package/umundo.jar DESTINATION share/umundo/lib COMPONENT librarySwig)
+		if (EXISTS "${PROJECT_SOURCE_DIR}/package/umundo.jar")
+			install(FILES ${PROJECT_SOURCE_DIR}/package/umundo.jar DESTINATION share/umundo/lib COMPONENT librarySwig)
+		endif()
 	else()
-		install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/umundo.jar DESTINATION share/umundo/lib COMPONENT librarySwig)
+		if (EXISTS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/umundo.jar")
+			install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/umundo.jar DESTINATION share/umundo/lib COMPONENT librarySwig)
+		endif()
 	endif()
 	list (APPEND UMUNDO_CPACK_COMPONENTS "librarySwig")
 endif()


Due to change to use memoryview object Python 2.7 is now required

Change-Id: Ieec306d8b7c8e543ef93144f6fcb0ed9b44f7fe9

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -75,8 +75,8 @@
 endif()

 if ( PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND
-    AND PYTHON_VERSION_STRING VERSION_LESS 2.6 )
-  message( WARNING "Python version less that 2.6: \"${PYTHON_VERSION_STRING}\"." )
+    AND PYTHON_VERSION_STRING VERSION_LESS 2.7 )
+  message( WARNING "Python version less that 2.7: \"${PYTHON_VERSION_STRING}\"." )
 endif()

 if ( PYTHONLIBS_FOUND AND PYTHONINTERP_FOUND


Up LLVM version number (attempt to resolve github CI failure for all workflows).

PiperOrigin-RevId: 354426515

--- clif/cmake/modules/CLIFUtils.cmake
+++ clif/cmake/modules/CLIFUtils.cmake
@@ -34,7 +34,7 @@

 find_package(absl REQUIRED)
 find_package(Clang REQUIRED)
-find_package(LLVM 11 REQUIRED)
+find_package(LLVM 11.1.0 REQUIRED)
 find_package(GTest REQUIRED)

 function(add_protobuf_include_directories)


Better guide to find gfortran libs given to OpenBLAS

Former-commit-id: 0d4dd16288522afd458a4ca33f57160218d0462e

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -28,7 +28,9 @@
     else()
         set(OpenBLAS_ENABLE_OPENMP 0) # Openmp doesnt work on clang it seems
     endif()
-    get_target_property(GFORTRAN_LIBS gfortran INTERFACE_LINK_LIBRARIES)
+    include(cmake-modules/getExpandedTarget.cmake)
+    expand_target_libs(gfortran GFORTRAN_LIBS)
+    list(FILTER GFORTRAN_LIBS INCLUDE REGEX "gfortran|quadmath")
     list(JOIN GFORTRAN_LIBS " " GFORTRAN_LIBS_SPACE_SEP_STRING)
     list(GET  GFORTRAN_LIBS 0 GFORTRAN_LIB)
     get_filename_component(GFORTRAN_PATH ${GFORTRAN_LIB} DIRECTORY)


Investigating bug on cluster

Investigating bug on cluster

Former-commit-id: 4d2aa08dcc68ba52fa36a564ea0881afdcaaafe5

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -146,20 +146,20 @@
 #            BUILD_COMMAND export LD_LIBRARY_PATH=${GFORTRAN_PATH}:$LD_LIBRARY_PATH &&
 #            export LDFLAGS="-L${GFORTRAN_PATH} $LDFLAGS" &&
             BUILD_IN_SOURCE 1
-            BUILD_COMMAND $(MAKE) TARGET=${OPENBLAS_MARCH}
-                          USE_THREAD=${OpenBLAS_MULTITHREADED}
-                          USE_OPENMP=${OpenBLAS_USE_OPENMP}
-                          NO_AFFINITY=1
-                          NO_WARMUP=1
-                          QUIET_MAKE=0
-                          NUM_THREADS=128
-                          DEBUG=0
-                          FFLAGS=-frecursive
-                          DYNAMIC_ARCH=0
-                          BINARY64=64
-                          GEMM_MULTITHREAD_THRESHOLD=16
-                          LDFLAGS=-L${GFORTRAN_PATH}
-                          FFLAGS=-O3 -Wno-maybe-uninitialized -Wno-conversion -Wno-unused-but-set-variable -Wno-unused-variable
+            BUILD_COMMAND $(MAKE) TARGET=SANDYBRIDGE
+                        DYNAMIC_ARCH=1
+                        USE_THREAD=${OpenBLAS_MULTITHREADED}
+                        USE_OPENMP=${OpenBLAS_USE_OPENMP}
+                        NO_AFFINITY=1
+                        NO_WARMUP=1
+                        QUIET_MAKE=0
+                        NUM_THREADS=128
+                        DEBUG=0
+                        FFLAGS=-frecursive
+                        BINARY64=64
+                        GEMM_MULTITHREAD_THRESHOLD=16
+                        LDFLAGS=-L${GFORTRAN_PATH}
+                        FFLAGS=-O3 -Wno-maybe-uninitialized -Wno-conversion -Wno-unused-but-set-variable -Wno-unused-variable
             INSTALL_COMMAND $(MAKE) PREFIX=<INSTALL_DIR> install
             DEPENDS gfortran
             )


[CMake] Replace use of llvm-config with LLVM and Clang CMake packages

Summary:
I did this for two reasons:
- Using the CMake packages simplifies building LLDB Standalone. This is for two
  reasons: 1) We were doing a decent amount of work that is already done in the
  LLVMConfig.cmake that we want to import, 2) We had to do some manual work to call
  llvm-config, parse its output, and populate variables that the build system
  uses.
- As far as I understand, using llvm-config makes it difficult if not impossible
  to cross-compile LLDB standalone.

Reviewers: sgraenitz, labath, zturner, JDevlieghere, davide, aprantl, stella.stamenova

Subscribers: mgorny, lldb-commits

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

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -4,6 +4,9 @@
   project(lldb)

   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)
+
+  set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH "Path to LLVM build tree")
+  set(LLDB_PATH_TO_CLANG_BUILD "" CACHE PATH "Path to Clang build tree")

   file(TO_CMAKE_PATH "${LLDB_PATH_TO_LLVM_BUILD}" LLDB_PATH_TO_LLVM_BUILD)
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_BUILD}" LLDB_PATH_TO_CLANG_BUILD)
@@ -12,82 +15,20 @@
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_SOURCE}" LLDB_PATH_TO_CLANG_SOURCE)
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_SWIFT_SOURCE}" LLDB_PATH_TO_SWIFT_SOURCE)

-  # Rely on llvm-config.
-  set(CONFIG_OUTPUT)
-  set(FIND_PATHS "")
-  if (LLDB_PATH_TO_LLVM_BUILD)
-    set(FIND_PATHS "${LLDB_PATH_TO_LLVM_BUILD}/bin")
-  endif()
-  find_program(LLVM_CONFIG "llvm-config"
-    HINTS ${FIND_PATHS} NO_CMAKE_FIND_ROOT_PATH)
+  find_package(LLVM REQUIRED CONFIG
+    HINTS "${LLDB_PATH_TO_LLVM_BUILD}" NO_CMAKE_FIND_ROOT_PATH)
+  find_package(Clang REQUIRED CONFIG
+    HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_CMAKE_FIND_ROOT_PATH)

-  if(LLVM_CONFIG)
-    message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-    set(CONFIG_COMMAND ${LLVM_CONFIG}
-      "--assertion-mode"
-      "--bindir"
-      "--libdir"
-      "--includedir"
-      "--prefix"
-      "--src-root"
-      "--cmakedir")
-    execute_process(
-      COMMAND ${CONFIG_COMMAND}
-      RESULT_VARIABLE HAD_ERROR
-      OUTPUT_VARIABLE CONFIG_OUTPUT
-    )
-    if(NOT HAD_ERROR)
-      string(REGEX REPLACE
-        "[ \t]*[\r\n]+[ \t]*" ";"
-        CONFIG_OUTPUT ${CONFIG_OUTPUT})
-
-    else()
-      string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
-      message(STATUS "${CONFIG_COMMAND_STR}")
-      message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
-    endif()
-  else()
-    message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
-  endif()
-
-  list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
-  list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
-  list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
-  list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
-  list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
-  list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
-  list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH)
-
-  if(NOT MSVC_IDE)
-    set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
-      CACHE BOOL "Enable assertions")
-    # Assertions should follow llvm-config's.
-    mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
-  endif()
-
-  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake")
-  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_SWIFT_SOURCE}/cmake/modules")
-  set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
-  set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
-  set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
-  set(LLVM_DIR ${LLVM_OBJ_ROOT}/cmake/modules/CMakeFiles CACHE PATH "Path to LLVM build tree CMake files")
-  set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
-  set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+  # We set LLVM_MAIN_INCLUDE_DIR so that it gets included in TableGen flags.
+  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_BUILD_MAIN_INCLUDE_DIR}" CACHE PATH "Path to LLVM's source include dir")
+  # We set LLVM_CMAKE_PATH so that GetSVN.cmake is found correctly when building SVNVersion.inc
+  set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules")
   set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")

   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
     NO_DEFAULT_PATH)

-  set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-    file(TO_CMAKE_PATH "${LLVM_CMAKE_PATH}" LLVM_CMAKE_PATH)
-    list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-    include(${LLVMCONFIG_FILE})
-  else()
-    message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
-
-  # These variables are used by add_llvm_library.
   # They are used as destination of target generators.
   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
   set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
@@ -98,6 +39,10 @@
     set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
   endif()

+  # We append the directory in which LLVMConfig.cmake lives. We expect LLVM's
+  # CMake modules to be in that directory as well.
+  list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
+  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_SWIFT_SOURCE}/cmake/modules")
   include(AddLLVM)
   include(HandleLLVMOptions)
   include(CheckAtomic)
@@ -116,8 +61,6 @@
   endif()

   # Start Swift Mods
-  find_package(Clang REQUIRED CONFIG
-    HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   find_package(Swift REQUIRED CONFIG
     HINTS "${LLDB_PATH_TO_SWIFT_BUILD}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   # End Swift Mods
@@ -128,12 +71,15 @@
   # set(LLVM_BINARY_DIR ${CMAKE_BINARY_DIR})

   set(CMAKE_INCLUDE_CURRENT_DIR ON)
-  include_directories("${LLVM_BINARY_DIR}/include"
-                      "${LLVM_MAIN_INCLUDE_DIR}"
-                      "${CLANG_INCLUDE_DIRS}"
-                      "${LLDB_PATH_TO_SWIFT_BUILD}/include"
-                      "${LLDB_PATH_TO_SWIFT_SOURCE}/include"
-                      "${CMAKE_CURRENT_SOURCE_DIR}/source")
+  include_directories(
+    "${CMAKE_BINARY_DIR}/include"
+    "${LLVM_INCLUDE_DIRS}"
+    "${CLANG_INCLUDE_DIRS}"
+    "${LLDB_PATH_TO_SWIFT_BUILD}/include"
+    "${LLDB_PATH_TO_SWIFT_SOURCE}/include"
+    "${CMAKE_CURRENT_SOURCE_DIR}/source")
+
+  link_directories("${LLVM_LIBRARY_DIR}")

   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})


[LLDBStandalone] Fix mismerge from upstream.

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -50,33 +50,26 @@
   find_program(lit_full_path ${lit_file_name} ${config_dirs} NO_DEFAULT_PATH)
   set(LLVM_DEFAULT_EXTERNAL_LIT ${lit_full_path} CACHE PATH "Path to llvm-lit")

-  if(LLVM_TABLEGEN)
-    set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN})
-  else()
-    if(CMAKE_CROSSCOMPILING)
-      set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")
-      if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
-        message(FATAL_ERROR
-          "Attempting to cross-compile LLDB standalone but no native LLVM build
-          found. Please cross-compile LLVM as well.")
-      endif()
+  if(CMAKE_CROSSCOMPILING)
+    set(LLVM_NATIVE_BUILD "${LLDB_PATH_TO_LLVM_BUILD}/NATIVE")
+    if (NOT EXISTS "${LLVM_NATIVE_BUILD}")
+      message(FATAL_ERROR
+        "Attempting to cross-compile LLDB standalone but no native LLVM build
+        found. Please cross-compile LLVM as well.")
+    endif()

-      if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
-        set(HOST_EXECUTABLE_SUFFIX ".exe")
-      endif()
+    if (CMAKE_HOST_SYSTEM_NAME MATCHES "Windows")
+      set(HOST_EXECUTABLE_SUFFIX ".exe")
+    endif()

-      if (NOT CMAKE_CONFIGURATION_TYPES)
-        set(LLVM_TABLEGEN_EXE
-          "${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
-      else()
-        # NOTE: LLVM NATIVE build is always built Release, as is specified in
-        # CrossCompile.cmake
-        set(LLVM_TABLEGEN_EXE
-          "${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
-      endif()
+    if (NOT CMAKE_CONFIGURATION_TYPES)
+      set(LLVM_TABLEGEN_EXE
+        "${LLVM_NATIVE_BUILD}/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
     else()
-      find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
-        NO_DEFAULT_PATH)
+      # NOTE: LLVM NATIVE build is always built Release, as is specified in
+      # CrossCompile.cmake
+      set(LLVM_TABLEGEN_EXE
+        "${LLVM_NATIVE_BUILD}/Release/bin/llvm-tblgen${HOST_EXECUTABLE_SUFFIX}")
     endif()
   else()
     set(tblgen_file_name "llvm-tblgen${CMAKE_EXECUTABLE_SUFFIX}")


qibuild-config.cmake: cosmetic change

qibuild-config.cmake: cosmetic change

Change-Id: Ifd25d15216386d4f9910222f9ee52acfe28aac21
Reviewed-on: http://gerrit.aldebaran.lan/56319
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/qibuild-config.cmake
+++ cmake/qibuild/qibuild-config.cmake
@@ -15,8 +15,8 @@
 # remove qi_tests.json
 # Note:
 #  this will fail silently if the file does not exist
-#  this file is used by `qibuild test` and other commands
-#  later on and can ben patched from CMake
+#  this file is used by `qitest run` and other commands
+#  later on and can be patched from CMake
 file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/qitest.cmake)

 get_filename_component(_this_dir ${CMAKE_CURRENT_LIST_FILE} PATH)


Fix resource installation for libraries and MacOsX Bundle

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -25,6 +25,16 @@
     PROPERTY RADIUM_TARGET_RESOURCES_FILES
     BRIEF_DOCS "Identify the optional resource files associated with a target."
     FULL_DOCS "Contains a list of individual files that will be installed when installing the target."
+    )
+define_property(TARGET
+    PROPERTY RADIUM_TARGET_RESOURCES_PREFIX
+    BRIEF_DOCS "Identify the optional resource install prefix associated with a target."
+    FULL_DOCS "Contains a name that will be prepended to each resource name before installing the target resources."
+    )
+define_property(TARGET
+    PROPERTY RADIUM_TARGET_INSTALLED_RESOURCES
+    BRIEF_DOCS "Identify the path where optional resource are installed for the target."
+    FULL_DOCS "Contains the inxtallation directory of the target resources."
     )

 # ------------------------------------------------------------------------------
@@ -135,12 +145,29 @@
         TARGETS ${ARGS_NAME}
         BUNDLE DESTINATION "bin/"
     )
+    # build the list of resource directory from the linked libraries to copy into the bundle
+    get_target_property(linkedLibs ${ARGS_NAME} LINK_LIBRARIES)
+    set(depsRsc "")
+    foreach(lib ${linkedLibs})
+        get_target_property(rscPrefix ${lib} RADIUM_TARGET_RESOURCES_PREFIX)
+        if (NOT ${rscPrefix} STREQUAL "rscPrefix-NOTFOUND")
+            get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
+            message(STATUS " [configure_radium_app] Found lib ${lib} resources location to be : ${rscLocation} !" )
+            list(APPEND depsRsc ${rscLocation})
+        endif ()
+    endforeach()
     if (ARGS_USE_PLUGINS)
+        # TODO : fix rpath for plugins that use helper libs (can't load helper.dylib)
         install(CODE "
         include(BundleUtilities)
         set(BU_CHMOD_BUNDLE_ITEMS TRUE)
         file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/Resources)
         file(COPY ${RADIUM_RESOURCES_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents)
+        set(instRsc ${depsRsc})
+        foreach( rsc \${instRsc})
+            message(STATUS \"Copy resources from  \${rsc}\")
+            file(COPY \${rsc} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/Resources)
+        endforeach()
         if (EXISTS ${RADIUM_PLUGINS_DIR})
             file(COPY ${RADIUM_PLUGINS_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/)
         else()
@@ -153,7 +180,7 @@
         foreach (plugin \${RadiumAvailablePlugins})
             list( APPEND InstalledPlugins ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/Plugins/lib/\${plugin} )
         endforeach ()
-        fixup_bundle(${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app \"\${InstalledPlugins}\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")
+        fixup_bundle(${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app \"\${InstalledPlugins}\" \"${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/Plugins/lib/\")
         "
             )
     else ()
@@ -163,11 +190,15 @@
             set(BU_CHMOD_BUNDLE_ITEMS TRUE)
             file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/Resources)
             file(COPY ${RADIUM_RESOURCES_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents)
-            fixup_bundle(${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app \"\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")
+            set(instRsc ${depsRsc})
+            foreach( rsc \${instRsc})
+                message(STATUS \"Copy resources from  \${rsc}\")
+                file(COPY \${rsc} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app/Contents/Resources)
+            endforeach()
+            fixup_bundle(${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.app \"\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR};${CMAKE_INSTALL_PREFIX}/lib\")
             "
             )
     endif ()
-
     # Configure the resources installation
     if (ARGS_RESOURCES)
         foreach (resLocation ${ARGS_RESOURCES})
@@ -303,11 +334,21 @@
     #Install in the install tree
     #Identify the individual files( to preserve directory structure )
     # set the target properties
-    message(STATUS " [installTargetResources] Set resources properties for target ${ARGS_TARGET} to ${ARGS_DIRECTORY}")
+    #message(STATUS " [installTargetResources] Set resources properties for target ${ARGS_TARGET} : DIRECTORY =  ${ARGS_DIRECTORY}")
     set_target_properties(${ARGS_TARGET}
         PROPERTIES
         RADIUM_TARGET_RESOURCES_DIRECTORY ${ARGS_DIRECTORY}
         )
+    if (ARGS_PREFIX)
+        #message(STATUS " [installTargetResources] Set resources properties for target ${ARGS_TARGET} : PREFIX = ${ARGS_PREFIX}")
+        set(ARGS_PREFIX "${ARGS_PREFIX}")
+        set_target_properties(${ARGS_TARGET}
+            PROPERTIES
+            RADIUM_TARGET_RESOURCES_PREFIX ${ARGS_PREFIX}
+            )
+    else()
+        set(ARGS_PREFIX "")
+    endif ()
     if (ARGS_FILES)
         set_target_properties(${ARGS_TARGET}
             PROPERTIES
@@ -315,9 +356,6 @@
             )
     else ()
         file(GLOB_RECURSE ARGS_FILES RELATIVE ${ARGS_DIRECTORY} ${ARGS_DIRECTORY}/*)
-    endif ()
-    if (ARGS_PREFIX)
-        set(ARGS_PREFIX "${ARGS_PREFIX}/")
     endif ()
     #install resource for application or shared library
     get_target_property(targetType ${ARGS_TARGET} TYPE)
@@ -328,26 +366,30 @@
             if (APPLE)
                 install(
                     FILES ${ARGS_DIRECTORY}/${file}
-                    DESTINATION ${ARGS_TARGET}.app/Contents/Resources/${rsc_dir}/${file_dir}
+                    DESTINATION ${ARGS_TARGET}.app/Contents/Resources/${ARGS_PREFIX}/${rsc_dir}/${file_dir}
                 )
             else ()
                 install(
                     FILES ${ARGS_DIRECTORY}/${file}
-                    DESTINATION Resources/${rsc_dir}/${file_dir}
+                    DESTINATION Resources/${ARGS_PREFIX}/${rsc_dir}/${file_dir}
                 )
             endif ()
         endforeach ()
     elseif (${targetType} STREQUAL "SHARED_LIBRARY")
-        message(STATUS " [installTargetResources] Installing resources for target ${ARGS_TARGET} into Resources/${ARGS_PREFIX}${rsc_dir}/${file_dir}")
+        message(STATUS " [installTargetResources] Installing resources for target ${ARGS_TARGET} into Resources/${ARGS_PREFIX}")
+        set_target_properties(${ARGS_TARGET}
+            PROPERTIES
+            RADIUM_TARGET_INSTALLED_RESOURCES "${CMAKE_INSTALL_PREFIX}/Resources/${ARGS_PREFIX}"
+        )
         foreach (file ${ARGS_FILES})
             get_filename_component(file_dir ${file} DIRECTORY)
             install(
                 FILES ${ARGS_DIRECTORY}/${file}
-                DESTINATION Resources/${ARGS_PREFIX}${rsc_dir}/${file_dir}
+                DESTINATION Resources/${ARGS_PREFIX}/${rsc_dir}/${file_dir}
             )
         endforeach ()
     else ()
-        message(FATAL_ERROR "Unknonw target type ${targetType} for target ${ARGS_TARGET} ")
+        message(FATAL_ERROR "Unknown target type ${targetType} for target ${ARGS_TARGET} ")
     endif ()
 endfunction()

@@ -357,7 +399,7 @@
 # usage :
 #   configure_radium_app(
 #         NAME theTargetName # <- this must be an executable
-#         [USE_PLUGINS] # <- The application uses Radium Plugins : install available plugins into the bundle is it is one
+#         [USE_PLUGINS] # <- The application uses Radium Plugins : install available plugins into the bundle if it is one
 #         [RESOURCES ResourceDir1 ResourceDir2] # <- acept a list of directories
 # )
 function(configure_radium_app)
@@ -450,26 +492,33 @@
         set_target_properties(${ARGS_NAME}
             PROPERTIES INSTALL_RPATH "@loader_path;${CMAKE_INSTALL_RPATH}")
         foreach (helperLib ${ARGS_HELPER_LIBS})
-            message(STATUS " [configure_plugin] Request to install the helper library ${helperLib} for plugin ${ARGS_NAME}")
+            # if helperLib is an alias, find the original name
+            get_target_property(OriginalLib "${helperLib}" ALIASED_TARGET)
+            if (${OriginalLib} STREQUAL "OriginalLib-NOTFOUND")
+                #                message(STATUS "The name ${ARGS_HELPER_LIBS} is a REAL target.")
+                set(OriginalLib ${helperLib})
+            endif ()
+            message(STATUS " [configure_radium_plugin] Request to install the helper library ${helperLib} for plugin ${ARGS_NAME}")
+            # gets the resource install property of the target
             get_target_property(resourceDir ${helperLib} RADIUM_TARGET_RESOURCES_DIRECTORY)
             if (NOT ${resourceDir} STREQUAL "resourceDir-NOTFOUND")
-                message(STATUS " [configure_plugin]    Installing ${helperLib} resources in ${${ARGS_NAME}_INSTALL_DIR}/Resources/${helperLib}/${rsc_dir}/${file_dir}")
+                # gets the resource prefix for the target
+                get_target_property(resourcePrefix ${helperLib} RADIUM_TARGET_RESOURCES_PREFIX)
+                if (${resourcePrefix} STREQUAL "resourcePrefix-NOTFOUND")
+                    set(resourcePrefix "")
+                endif()
+                message(STATUS " [configure_radium_plugin] Installing ${helperLib} resources in ${${ARGS_NAME}_INSTALL_DIR}/Resources/${resourcePrefix}")
                 get_filename_component(rsc_dir ${resourceDir} NAME)
                 file(GLOB_RECURSE RSC_FILES RELATIVE ${resourceDir} ${resourceDir}/*)
                 foreach (file ${RSC_FILES})
                     get_filename_component(file_dir ${file} DIRECTORY)
                     install(
                         FILES ${resourceDir}/${file}
-                        DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/Resources/${helperLib}/${rsc_dir}/${file_dir}
+                        DESTINATION ${${ARGS_NAME}_INSTALL_DIR}/Resources/${resourcePrefix}/${rsc_dir}/${file_dir}
                     )
                 endforeach ()
             endif ()
-            get_target_property(OriginalLib "${helperLib}" ALIASED_TARGET)
-            if (${OriginalLib} STREQUAL "OriginalLib-NOTFOUND")
-                #                message(STATUS "The name ${ARGS_HELPER_LIBS} is a REAL target.")
-                set(OriginalLib ${helperLib})
-            endif ()
-            message(STATUS "Installing ${OriginalLib}")
+            message(STATUS " [configure_radium_plugin] Installing the helper lib ${OriginalLib}")
             get_target_property(IsImported "${OriginalLib}" IMPORTED)
             if (${IsImported})
                 #                message(STATUS "The name ${OriginalLib} is a IMPORTED target.")
@@ -489,7 +538,7 @@
     # Configure the resources installation
     if (ARGS_RESOURCES)
         foreach (resLocation ${ARGS_RESOURCES})
-            message(STATUS " Installing plugin resources ${resLocation} for ${ARGS_NAME} ")
+            message(STATUS " [configure_radium_plugin] Installing plugin resources ${resLocation} for ${ARGS_NAME} ")
             installPluginResources(
                 TARGET ${ARGS_NAME}
                 DIRECTORY ${resLocation}
@@ -510,7 +559,6 @@
 #   TARGET_DIR : The directory where FILES will be installed (default : <prefix>/include/<TARGET>
 #   NAMESPACE : The namespace in which the library will be added (default Radium)
 #   PACKAGE_DIR : The directory in which the cmake package config file will be installed (default <prefix>/lib/cmake/Radium)
-
 function(configure_radium_library)
     # parse and verify args
     cmake_parse_arguments(
@@ -555,6 +603,7 @@
         $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
         $<INSTALL_INTERFACE:include/${ARGS_TARGET}>
         )
+    message(STATUS " [configure_radium_library] Defining alias ${ARGS_NAMESPACE}::${ARGS_TARGET} for target ${ARGS_TARGET}")
     add_library(${ARGS_NAMESPACE}::${ARGS_TARGET} ALIAS ${ARGS_TARGET})
     set(ConfigPackageLocation ${ARGS_PACKAGE_DIR})
     install(TARGETS ${ARGS_TARGET}


Use FastDDS as default DDS (#315)

Use FastDDS as default DDS (#315)

Signed-off-by: Audrow Nash <d1b2311ea31e31d3a8723c274ae46046466c0083@hey.com>

--- rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake
+++ rmw_implementation_cmake/cmake/get_default_rmw_implementation.cmake
@@ -32,8 +32,8 @@
   if("${RMW_IMPLEMENTATION}" STREQUAL "" AND
     "$ENV{RMW_IMPLEMENTATION}" STREQUAL ""
   )
-    # prefer CycloneDDS, otherwise first in alphabetical order
-    list(FIND _middleware_implementations "rmw_cyclonedds_cpp" _index)
+    # prefer FastDDS, otherwise first in alphabetical order
+    list(FIND _middleware_implementations "rmw_fastrtps_cpp" _index)
     if(NOT _index EQUAL -1)
       list(GET _middleware_implementations ${_index} _middleware_implementation)
     else()


Add a missing if opencv found check

Add a missing if opencv found check

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -10,7 +10,7 @@

 # ---[ BLAS
 set(BLAS "Eigen" CACHE STRING "Selected BLAS library")
-set_property(CACHE BLAS PROPERTY STRINGS "Eigen;ATLAS;OpenBLAS;MKL")
+set_property(CACHE BLAS PROPERTY STRINGS "Eigen;ATLAS;OpenBLAS;MKL;vecLib")
 message(STATUS "The BLAS backend of choice:" ${BLAS})

 if(BLAS STREQUAL "Eigen")
@@ -32,6 +32,10 @@
   list(APPEND Caffe2_DEPENDENCY_LIBS ${MKL_LIBRARIES})
   list(APPEND Caffe2_DEPENDENCY_LIBS cblas)
   add_definitions(-DCAFFE2_USE_MKL)
+elseif(BLAS STREQUAL "vecLib")
+  find_package(vecLib REQUIRED)
+  include_directories(SYSTEM ${vecLib_INCLUDE_DIR})
+  list(APPEND Caffe2_DEPENDENCY_LIBS ${vecLib_LINKER_LIBS})
 else()
   message(FATAL_ERROR "Unrecognized blas option:" ${BLAS})
 endif()
@@ -93,9 +97,11 @@
     # OpenCV 2
     find_package(OpenCV QUIET COMPONENTS core highgui imgproc)
   endif()
-  include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
-  list(APPEND Caffe2_DEPENDENCY_LIBS ${OpenCV_LIBS})
-  message(STATUS "OpenCV found (${OpenCV_CONFIG_PATH})")
+  if (OpenCV_FOUND)
+    include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
+    list(APPEND Caffe2_DEPENDENCY_LIBS ${OpenCV_LIBS})
+    message(STATUS "OpenCV found (${OpenCV_CONFIG_PATH})")
+  endif()
 endif()

 # ---[ EIGEN


- remove the debug_test_* targets from "all"   (otherwise they are compiled when you simply run    make in test/ or when enforcing "test" to be part of "all") - add linking libraries to the debug_test_* targets

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -45,7 +45,7 @@
   set(filename ${testname}.cpp)
   add_executable(${targetname} ${filename})
   add_dependencies(btest ${targetname})
-  add_executable(${debug_targetname} ${filename})
+  add_executable(${debug_targetname} EXCLUDE_FROM_ALL ${filename})

   if(NOT EIGEN_NO_ASSERTION_CHECKING)

@@ -92,6 +92,7 @@
     string(LENGTH "${ARGV2_stripped}" ARGV2_stripped_length)
     if(${ARGV2_stripped_length} GREATER 0)
       target_link_libraries(${targetname} ${ARGV2})
+      target_link_libraries(${debug_targetname} ${ARGV2})
     endif(${ARGV2_stripped_length} GREATER 0)
   endif(${ARGC} GREATER 2)


Remove superfluous testing files (as changeset 5c4d6666125a but more complete)

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -68,11 +68,7 @@
     endif()
   endif()

-  if(EIGEN_BIN_BASH_EXISTS)
-    add_test(${testname_with_suffix} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname_with_suffix}")
-  else()
-    add_test(${testname_with_suffix} "${targetname}")
-  endif()
+  add_test(${testname_with_suffix} "${targetname}")

   # Specify target and test labels accoirding to EIGEN_CURRENT_SUBPROJECT
   get_property(current_subproject GLOBAL PROPERTY EIGEN_CURRENT_SUBPROJECT)


cmake: Make indentation consistent with the code guidelines

--- cmake/StdargDetect.cmake
+++ cmake/StdargDetect.cmake
@@ -1,6 +1,7 @@
 # The MIT License
 #
 # Copyright (C) 2017 Jean-Damien Durand <jeandamiendurand@gmail.com>
+# Copyright (C) 2019 Alexander Saprykin <saprykin.spb@gmail.com>
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -53,9 +54,9 @@
                         va_end (args2);
                      }

-                     int main() {
+                     int main () {
                         f (0, 42);
-                        exit(0);
+                        exit (0);
                      }"
                     PLIBSYS_${KEYWORD}
         )


add dgc cuda11 support for Paddle (#27204)

--- cmake/external/dgc.cmake
+++ cmake/external/dgc.cmake
@@ -19,7 +19,7 @@
 SET(DGC_INSTALL_DIR "${THIRD_PARTY_PATH}/install/dgc")
 SET(DGC_INCLUDE_DIR "${DGC_INSTALL_DIR}/include" CACHE PATH "dgc include directory." FORCE)
 SET(DGC_LIBRARIES   "${DGC_INSTALL_DIR}/lib/libdgc.a" CACHE FILEPATH "dgc library." FORCE)
-SET(DGC_URL         "http://fleet.bj.bcebos.com/collective_ef2216a.tgz")
+SET(DGC_URL         "https://fleet.bj.bcebos.com/dgc/collective_f66ef73.tgz")
 INCLUDE_DIRECTORIES(${DGC_INCLUDE_DIR})

 cache_third_party(extern_dgc
@@ -30,7 +30,7 @@
     extern_dgc
     ${EXTERNAL_PROJECT_LOG_ARGS}
     "${DGC_DOWNLOAD_CMD}"
-    URL_MD5         "2f67549fd5f1262383d83289abc4f88f"
+    URL_MD5         "94e6fa1bc97169d0e1aad44570fe3251"
     PREFIX          "${DGC_PREFIX_DIR}"
     SOURCE_DIR      "${DGC_SOURCES_DIR}"
     CONFIGURE_COMMAND ""


make sure that we actualy substitute a number into the debian scripts

--- cmake/packages/deb.cmake
+++ cmake/packages/deb.cmake
@@ -18,7 +18,11 @@
 set(CPACK_COMPONENTS_ALL debian-extras)
 set(CPACK_GENERATOR "DEB")

-set(CPACK_SYSTEMD_FOUND "${SYSTEMD_FOUND}")
+if (SYSTEMD_FOUND)
+  set(CPACK_SYSTEMD_FOUND "1")
+else()
+  set(CPACK_SYSTEMD_FOUND "0")
+endif()

 # substitute the package name so debconf works:
 configure_file (


include/llvm/Config/config.h.cmake: Reorder to follow config.h.in, and import stuff from llvm-config.h.cmake and clang/config.h.

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

--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -5,6 +5,27 @@
 #ifndef CONFIG_H
 #define CONFIG_H

+/* Bug report URL. */
+#define BUG_REPORT_URL "${BUG_REPORT_URL}"
+
+/* Relative directory for resource files */
+#define CLANG_RESOURCE_DIR "${CLANG_RESOURCE_DIR}"
+
+/* 32 bit multilib directory. */
+#define CXX_INCLUDE_32BIT_DIR "${CXX_INCLUDE_32BIT_DIR}"
+
+/* 64 bit multilib directory. */
+#define CXX_INCLUDE_64BIT_DIR "${CXX_INCLUDE_64BIT_DIR}"
+
+/* Arch the libstdc++ headers. */
+#define CXX_INCLUDE_ARCH "${CXX_INCLUDE_ARCH}"
+
+/* Directory with the libstdc++ headers. */
+#define CXX_INCLUDE_ROOT "${CXX_INCLUDE_ROOT}"
+
+/* Directories clang will search for headers */
+#define C_INCLUDE_DIRS "${C_INCLUDE_DIRS}"
+
 /* Define if CBE is enabled for printf %a output */
 #cmakedefine ENABLE_CBE_PRINTF_A ${ENABLE_CBE_PRINTF_A}

@@ -516,34 +537,34 @@
 #undef HOST_LINK_VERSION

 /* Installation directory for binary executables */
-#undef LLVM_BINDIR
+#cmakedefine LLVM_BINDIR "${LLVM_BINDIR}"

 /* Time at which LLVM was configured */
-#undef LLVM_CONFIGTIME
+#cmakedefine LLVM_CONFIGTIME "${LLVM_CONFIGTIME}"
+
+/* Installation directory for data files */
+#cmakedefine LLVM_DATADIR "${LLVM_DATADIR}"

 /* Installation directory for documentation */
-#undef LLVM_DATADIR
-
-/* Installation directory for documentation */
-#undef LLVM_DOCSDIR
+#cmakedefine LLVM_DOCSDIR "${LLVM_DOCSDIR}"

 /* Installation directory for config files */
-#undef LLVM_ETCDIR
+#cmakedefine LLVM_ETCDIR "${LLVM_ETCDIR}"

 /* Host triple we were built on */
 #cmakedefine LLVM_HOSTTRIPLE "${LLVM_HOSTTRIPLE}"

 /* Installation directory for include files */
-#undef LLVM_INCLUDEDIR
+#cmakedefine LLVM_INCLUDEDIR "${LLVM_INCLUDEDIR}"

 /* Installation directory for .info files */
-#undef LLVM_INFODIR
+#cmakedefine LLVM_INFODIR "${LLVM_INFODIR}"

 /* Installation directory for libraries */
-#undef LLVM_LIBDIR
+#cmakedefine LLVM_LIBDIR "${LLVM_LIBDIR}"

 /* Installation directory for man pages */
-#undef LLVM_MANDIR
+#cmakedefine LLVM_MANDIR "${LLVM_MANDIR}"

 /* Build multithreading support into LLVM */
 #cmakedefine LLVM_MULTITHREADED ${LLVM_MULTITHREADED}
@@ -551,18 +572,21 @@
 /* LLVM architecture name for the native architecture, if available */
 #cmakedefine LLVM_NATIVE_ARCH ${LLVM_NATIVE_ARCH}

+/* LLVM name for the native AsmParser init function, if available */
+#cmakedefine LLVM_NATIVE_ASMPARSER LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser
+
 /* LLVM name for the native AsmPrinter init function, if available */
 #cmakedefine LLVM_NATIVE_ASMPRINTER LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter

-/* LLVM name for the native TargetMC init function, if available */
-#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC
-
 /* LLVM name for the native Target init function, if available */
 #cmakedefine LLVM_NATIVE_TARGET LLVMInitialize${LLVM_NATIVE_ARCH}Target

 /* LLVM name for the native TargetInfo init function, if available */
 #cmakedefine LLVM_NATIVE_TARGETINFO LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo

+/* LLVM name for the native target MC init function, if available */
+#cmakedefine LLVM_NATIVE_TARGETMC LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC
+
 /* Define if this is Unixish platform */
 #cmakedefine LLVM_ON_UNIX ${LLVM_ON_UNIX}

@@ -582,7 +606,7 @@
 #cmakedefine LLVM_PATH_FDP "${LLVM_PATH_FDP}"

 /* Define to path to Graphviz program if found or 'echo Graphviz' otherwise */
-#undef LLVM_PATH_GRAPHVIZ
+#cmakedefine LLVM_PATH_GRAPHVIZ "${LLVM_PATH_GRAPHVIZ}"

 /* Define to path to gv program if found or 'echo gv' otherwise */
 #cmakedefine LLVM_PATH_GV "${LLVM_PATH_GV}"


boost-cmake: Removed debug log.

boost-cmake: Removed debug log.

--- src/external/boost/boost-cmake-repo/cmake/Modules/AddBoostLib.cmake
+++ src/external/boost/boost-cmake-repo/cmake/Modules/AddBoostLib.cmake
@@ -34,6 +34,4 @@
   if(BOOSTLIB_INCLUDE_PRIVATE)
     target_include_directories(Boost_${BOOSTLIB_NAME} PRIVATE ${BOOSTLIB_INCLUDE_PRIVATE})
   endif()
-
-  message("Added Boost::${BOOSTLIB_NAME}")
 endfunction()


Fix for defining int64_t on 64 bit Solaris systems.

svn path=/trunk/playground/base/strigi/; revision=604979

--- src/streams/jstreamsconfig.h.cmake
+++ src/streams/jstreamsconfig.h.cmake
@@ -59,19 +59,33 @@
 #ifndef HAVE_INT64_T
  #if defined(HAVE___INT64)
   typedef __int64 int64_t;
-  typedef unsigned __int64 uint64_t;
- #elif 0${SIZEOF_LONGLONG}==8
+ #elif ${SIZEOF_LONG}==8
+  typedef long int64_t
+ #elif ${SIZEOF_LONGLONG}==8
   typedef long long int64_t;
-  typedef unsigned long long uint64_t;
+ #endif
+#endif
+#ifndef HAVE_UINT64_T
+ #if defined(HAVE___UINT64)
+  typedef __uint64 uint64_t;
+ #elif ${SIZEOF_LONG}==8
+  typedef unsigned long uint64_t
+ #elif ${SIZEOF_LONGLONG}==8
+  typedef unsigned long long uint64_t;
  #endif
 #endif

 #ifndef HAVE_INT32_T
- #if 0${SIZEOF_INT}==4 //is int 4bits?
+ #if ${SIZEOF_INT}==4 //is int 4bits?
   typedef int int32_t;
+ #elif ${SIZEOF_LONG}==4 //is long 4bits?
+  typedef long int32_t;
+ #endif
+#endif
+#ifndef HAVE_UINT32_T
+ #if ${SIZEOF_INT}==4 //is int 4bits?
   typedef unsigned int uint32_t;
- #elif 0${SIZEOF_LONG}==4 //is long 4bits?
-  typedef long int32_t;
+ #elif ${SIZEOF_LONG}==4 //is long 4bits?
   typedef unsigned long uint32_t;
  #endif
 #endif


Updated Continuous test script.

Updated Continuous test script.

--- ctest-scripts/ContinuousTest.cmake
+++ ctest-scripts/ContinuousTest.cmake
@@ -20,16 +20,16 @@

 # Set locations of src/build
-set (CTEST_DASHBOARD_ROOT /Users/wfisher/Desktop/netcdf-cmake/Dashboards)
-SET (CTEST_SOURCE_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}/src-snapshot")
-SET (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/build-cont")
+set (CTEST_DASHBOARD_ROOT "/Users/wfisher/Dashboards")
+SET (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/src-snapshot")
+SET (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/builds/build-cont")

 #####
 # End Test/System Setup
 #####

-set (CTEST_CONTINUOUS_DURATION 300)
-set (CTEST_CONTINUOUS_MINIMUM_INTERVAL 10)
+#set (CTEST_CONTINUOUS_DURATION 300)
+#set (CTEST_CONTINUOUS_MINIMUM_INTERVAL 10)

 set (CTEST_CMAKE_GENERATOR "Unix Makefiles")
 set (CTEST_SVN_COMMAND "/opt/local/bin/svn")


Put the full version of the zinc library into the python package initialisation file.  https://tracker.physiomeproject.org/show_bug.cgi?id=3260

--- python/createpackagefiles.in.cmake
+++ python/createpackagefiles.in.cmake
@@ -7,6 +7,6 @@
 ")
 FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${ZINC_PYTHON_MODULE}/__init__.py" "
 # Zinc Python package initialisation file.
-__version__ = \"${ZINC_VERSION}\"
+__version__ = \"${ZINC_VERSION}${ZINC_DEVELOPER_VERSION}\"

 ")


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

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


Handle pre-built files for new macOS 11.4.


Use a simpler and more reliable command for converting from HEAD to
commit-ish. Funny thing, they have a command designed for this. ;]

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

--- cmake/modules/VersionFromVCS.cmake
+++ cmake/modules/VersionFromVCS.cmake
@@ -50,7 +50,7 @@
         set(git_svn_rev "")
       endif()
       execute_process(COMMAND
-                      ${git_executable} show-ref --abbrev --hash --head HEAD
+                      ${git_executable} rev-parse --short HEAD
                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                       TIMEOUT 5
                       RESULT_VARIABLE git_result


Fix typo in nistcd_VERSION.  (Thanks to Orion Poplawski for spotting this
issue.)

svn path=/trunk/; revision=9901

--- cmake/modules/plplot_version.cmake
+++ cmake/modules/plplot_version.cmake
@@ -28,7 +28,7 @@
 #     library version numbers the same for the release.

 set(nistcd_SOVERSION 0)
-set(nistcd_VERSION ${nist_SOVERSION}.0.1)
+set(nistcd_VERSION ${nistcd_SOVERSION}.0.1)

 set(csirocsa_SOVERSION 0)
 set(csirocsa_VERSION ${csirocsa_SOVERSION}.0.1)


Add missing path when including Windeployqt

Was breaking cmake package.

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -10,7 +10,7 @@
 cmake_minimum_required(VERSION 3.13 FATAL_ERROR)

 if (MSVC OR MSVC_IDE OR MINGW)
-    include( Windeployqt )
+    include( ${CMAKE_CURRENT_LIST_DIR}/Windeployqt.cmake )
 endif()

 include(CMakeParseArguments)


[cmake] check if lib is a target before acces to props.

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -156,11 +156,13 @@
     get_target_property(linkedLibs ${ARGS_NAME} LINK_LIBRARIES)
     set(depsRsc ${RADIUM_RESOURCES_DIR})
     foreach(lib ${linkedLibs})
-        get_target_property(rscPrefix ${lib} RADIUM_TARGET_RESOURCES_PREFIX)
-        if (NOT ${rscPrefix} STREQUAL "rscPrefix-NOTFOUND")
-            get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
-            list(APPEND depsRsc ${rscLocation})
-        endif ()
+        if(TARGET ${lib})
+            get_target_property(rscPrefix ${lib} RADIUM_TARGET_RESOURCES_PREFIX)
+            if (NOT ${rscPrefix} STREQUAL "rscPrefix-NOTFOUND")
+                get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
+                list(APPEND depsRsc ${rscLocation})
+            endif ()
+        endif()
     endforeach()
     list(REMOVE_DUPLICATES depsRsc)
     # install qtPlugins (QPA plugin name found here https://doc.qt.io/qt-5/qpa.html) needed to fixup the bundle
@@ -508,10 +510,12 @@
     get_target_property(linkedLibs ${ARGS_NAME} LINK_LIBRARIES)
     set(depsRsc  ${RADIUM_RESOURCES_DIR})
     foreach(lib ${linkedLibs})
-        get_target_property(rscPrefix ${lib} RADIUM_TARGET_RESOURCES_PREFIX)
-        if (NOT ${rscPrefix} STREQUAL "rscPrefix-NOTFOUND")
-            get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
-            list(APPEND depsRsc ${rscLocation})
+        if(TARGET ${lib})
+            get_target_property(rscPrefix ${lib} RADIUM_TARGET_RESOURCES_PREFIX)
+            if (NOT ${rscPrefix} STREQUAL "rscPrefix-NOTFOUND")
+                get_target_property(rscLocation ${lib} RADIUM_TARGET_INSTALLED_RESOURCES)
+                list(APPEND depsRsc ${rscLocation})
+            endif ()
         endif ()
     endforeach()
     list(REMOVE_DUPLICATES depsRsc)


[cmake] Install pdb files in debug mode on windows

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -72,6 +72,9 @@
                         fixup_bundle( ${CMAKE_INSTALL_PREFIX}/bin/${ARGS_NAME}.exe \"\" \"${FIX_LIBRARY_DIR}\")
             "
             )
+        if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+            install(FILES $<TARGET_PDB_FILE:${ARGS_NAME}> DESTINATION bin)
+        endif()
     endif ()

     # Configure the application own resources installation
@@ -516,6 +519,9 @@
             PUBLIC
             _DEBUG
             )
+        if (MSVC OR MSVC_IDE)
+            install(FILES $<TARGET_PDB_FILE:${ARGS_TARGET}> DESTINATION bin)
+        endif()
     endif ()
     target_compile_features(${ARGS_TARGET} PUBLIC cxx_std_17)
     if (OPENMP_FOUND)


Allow for extra destinations in sprokit_configure

This is going to be used for Python per-configuration modules.

--- conf/sprokit-macro-configure.cmake
+++ conf/sprokit-macro-configure.cmake
@@ -3,6 +3,11 @@
 #
 #   sprokit_configure_file
 #   sprokit_configure_directory
+#
+# The following variables may be used to control the behavior of the functions:
+#
+#   sprokit_configure_extra_dests
+#     A list of other paths to configure the file into.
 #
 # Their syntax is:
 #
@@ -43,8 +48,17 @@
   \"${dest}\"
   COPYONLY)\n")

+  foreach (extra_dest IN LISTS sprokit_configure_extra_dests)
+    file(APPEND "${configure_script}" "
+configure_file(
+  \"${configured_path}\"
+  \"${extra_dest}\"
+  COPYONLY)\n")
+  endforeach ()
+
   set(clean_files
     "${dest}"
+    ${sprokit_configure_extra_dests}
     "${configured_path}"
     "${configure_script}")


ENH: Update ITK version.

ENH: Update ITK version.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -79,7 +79,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG 64bff813227aaa45e8ebe8469d44e30bb4063265) #2012-11-28
+  set(${proj}_GIT_TAG 2823c65d64f92f4e3cef8bae078271b336c68a6f) #2012-11-29
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


PERF: Update with brad lowekamps line search performance upgrades

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -149,7 +149,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   # set(${proj}_REPOSITORY ${git_protocol}://github.com/stnava/ITK.git)
-  set(${proj}_GIT_TAG 3a6158a416bd6f20882ac0dde27a0c1c50809991) ## itk vnl updates
+  set(${proj}_GIT_TAG 407989d73f5a50ac9f2251663b2f497cf900cbd7) ## itk line search updates
   set(ITK_VERSION_ID ITK-5.0) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}


fixed cmake

fixed cmake

--- CMake/GOMCCUDASetup.cmake
+++ CMake/GOMCCUDASetup.cmake
@@ -2,7 +2,8 @@

 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DGOMC_CUDA)
 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Wno-deprecated-gpu-targets)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Xcompiler -D__CORRECT_ISO_CPP11_MATH_H_PROTO)
+set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Xcompiler -std=c++98)
+set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Xcompiler -D__CORRECT_ISO_CPP11_MATH_H_PROTO)
 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_20,code=sm_20)
 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_20,code=sm_21)
 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_30,code=sm_30)


Removed comment

Removed comment

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -312,11 +312,9 @@
 macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION)
   set(XCODE_RELVERSION_I "${XCODE_RELVERSION}")
   if (XCODE_RELVERSION_I STREQUAL "All")
-    message(STATUS "XCODE_RELVERSION_I match!")
     set_property(TARGET ${TARGET} PROPERTY
     XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}")
   else()
-    message(STATUS "XCODE_RELVERSION_I NO match! ${XCODE_RELVERSION_I}")
     set_property(TARGET ${TARGET} PROPERTY
     XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}")
   endif()


+ fix error message in PySide check macro

--- cMake/FindPySideTools.cmake
+++ cMake/FindPySideTools.cmake
@@ -85,7 +85,7 @@
     endif (NOT PySideTools_FIND_QUIETLY)
 else(PYSIDERCC4BINARY AND PYSIDEUIC4BINARY)
     if(PySideTools_FIND_REQUIRED)
-        message(FATAL_ERROR "PySideTools could not be not found, but are required.")
+        message(FATAL_ERROR "PySideTools could not be found, but are required.")
     else(PySideTools_FIND_REQUIRED)
         if (NOT PySideTools_FIND_QUIETLY)
                 message(STATUS "PySideTools: not found.")


MSVC: - replaced slashes with dashes in compiler and linker options (with an appropriate implementation note) - disabled 'secure STL' warnings - enabled parallelizer reporting.

--- toolchains/msvc.toolchain.cmake
+++ toolchains/msvc.toolchain.cmake
@@ -6,22 +6,29 @@
 #
 ################################################################################

-set( TNUN_compiler_debug_symbols      /Zi                                         )
-set( TNUN_linker_debug_symbols        /DEBUG                                      )
-set( TNUN_compiler_LTO                /GL                                         )
-set( TNUN_linker_LTO                  /LTCG                                       )
-set( TNUN_compiler_fastmath           /fp:except- /fp:fast /Qfast_transcendentals )
-set( TNUN_compiler_rtti_on            /GR                                         )
-set( TNUN_compiler_rtti_off           /GR-                                        )
-set( TNUN_compiler_exceptions_on      /EHsc                                       )
-set( TNUN_compiler_exceptions_off     /wd4577                                     )
-set( TNUN_compiler_optimize_for_speed /Ox /Ot /Qvec-report:2                      )
+# www.drdobbs.com/cpp/the-most-underused-compiler-switches-in/240166599

-set( TNUN_compiler_release_flags /DNDEBUG /Bt /Ox /Ob2 /Oy /GF /Gw /Gm- /GS- /Gy /Qpar )
+# Implementation note: Use the dash (instead of slash) syntax as the compiler
+# supports this and it plays better in certain CMake related special/edge-cases
+# (e.g. generator expressions).
+#                                             (01.06.2016.) (Domagoj Saric)
+set( TNUN_compiler_debug_symbols      -Zi                                         )
+set( TNUN_linker_debug_symbols        -DEBUG                                      )
+set( TNUN_compiler_LTO                -GL                                         )
+set( TNUN_linker_LTO                  -LTCG                                       )
+set( TNUN_compiler_fastmath           -fp:except- -fp:fast -Qfast_transcendentals )
+set( TNUN_compiler_rtti_on            -GR                                         )
+set( TNUN_compiler_rtti_off           -GR-                                        )
+set( TNUN_compiler_exceptions_on      -EHsc                                       )
+set( TNUN_compiler_exceptions_off     -wd4577                                     )
+set( TNUN_compiler_optimize_for_speed -Ox -Ot -Qpar -Qpar-report:1 -Qvec-report:2 ) # https://msdn.microsoft.com/en-us/library/jj658585.aspx Vectorizer and Parallelizer Messages

-add_compile_options( /MP /Oi /W4 /Zc:threadSafeInit- /wd4324 ) # w4324 = 'structure was padded due to alignment specifier'
+set( TNUN_compiler_release_flags -DNDEBUG -Bt -Ox -Ob2 -Oy -GF -Gw -Gm- -GS- -Gy )
+
+add_compile_options( -MP -Oi -W4 -Zc:threadSafeInit- -wd4324 ) # w4324 = 'structure was padded due to alignment specifier'
 add_definitions(
     -D_CRT_SECURE_NO_WARNINGS
+    -D_SCL_SECURE_NO_WARNINGS
     -D_SBCS
     -D_WIN32_WINNT=0x0601 # Win7
-)+)


Fix version checks in CMake packages.

Fix version checks in CMake packages.

--- cub/cmake/cub-config-version.cmake
+++ cub/cmake/cub-config-version.cmake
@@ -20,11 +20,12 @@
 set(PACKAGE_VERSION_UNSUITABLE FALSE)

 if(PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION)
-  if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CUB_VERSION_MAJOR)
+  if(CUB_VERSION_MAJOR VERSION_EQUAL PACKAGE_FIND_VERSION_MAJOR AND
+     CUB_VERSION_MINOR VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MINOR)
     set(PACKAGE_VERSION_COMPATIBLE TRUE)
   endif()

-  if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+  if(PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
     set(PACKAGE_VERSION_EXACT TRUE)
   endif()
 endif()


Check for guile-2.2 as well as 2.0

Check for guile-2.2 as well as 2.0

--- lib/FindGuile.cmake
+++ lib/FindGuile.cmake
@@ -11,9 +11,13 @@

 # Look for the header file
-# Look for guile-2.0 first, then 1.8
+# Look for guile-2.2 first, then 2.0, then 1.8
 # Macports for OSX puts things in /opt/local
 FIND_PATH(GUILE_INCLUDE_DIR libguile.h
+	/usr/include/guile/2.2
+	/usr/local/include/guile/2.2
+	/opt/local/include/guile/2.2
+
 	/usr/include/guile/2.0
 	/usr/local/include/guile/2.0
 	/opt/local/include/guile/2.0
@@ -27,7 +31,7 @@
 )

 # Look for the library
-FIND_LIBRARY(GUILE_LIBRARY NAMES guile guile-2.0 PATHS
+FIND_LIBRARY(GUILE_LIBRARY NAMES guile-2.2 guile-2.0 guile PATHS
 	/usr/lib
 	/usr/local/lib
 	/opt/local/lib


Parse MHD version in header file with a similar way it's read in pkg-config

--- cmake-modules/FindMHD.cmake
+++ cmake-modules/FindMHD.cmake
@@ -46,9 +46,15 @@
 elseif (MHD_INCLUDE_DIR AND EXISTS "${MHD_INCLUDE_DIR}/microhttpd.h")
     set(regex_mhd_version "^#define[ \t]+MHD_VERSION[ \t]+([^\"]+).*")
     file(STRINGS "${MHD_INCLUDE_DIR}/microhttpd.h" mhd_version REGEX "${regex_mhd_version}")
-    string(REGEX REPLACE "${regex_mhd_version}" "\\1" MHD_VERSION_STRING "${mhd_version}")
+    string(REGEX REPLACE "${regex_mhd_version}" "\\1" MHD_VERSION_NUM "${mhd_version}")
     unset(regex_mhd_version)
     unset(mhd_version)
+    # parse MHD_VERSION from numerical format 0x12345678 to string format "12.34.56.78" so the version value can be compared to the one returned by pkg-config
+    string(SUBSTRING ${MHD_VERSION_NUM} 2 2 MHD_VERSION_STRING_MAJOR)
+    string(SUBSTRING ${MHD_VERSION_NUM} 4 2 MHD_VERSION_STRING_MINOR)
+    string(SUBSTRING ${MHD_VERSION_NUM} 6 2 MHD_VERSION_STRING_REVISION)
+    string(SUBSTRING ${MHD_VERSION_NUM} 8 2 MHD_VERSION_STRING_PATCH)
+    set(MHD_VERSION_STRING "${MHD_VERSION_STRING_MAJOR}.${MHD_VERSION_STRING_MINOR}.${MHD_VERSION_STRING_REVISION}.${MHD_VERSION_STRING_PATCH}")
 endif ()

 include(FindPackageHandleStandardArgs)
@@ -61,4 +67,4 @@
     set(MHD_INCLUDE_DIRS ${MHD_INCLUDE_DIR})
 endif ()

-mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)+mark_as_advanced(MHD_INCLUDE_DIR MHD_LIBRARY)


[cmake] fix

[cmake] fix

--- cmake/CMakePathMacros.cmake
+++ cmake/CMakePathMacros.cmake
@@ -66,7 +66,7 @@
   if(issub)
     file(RELATIVE_PATH rel_path "${src_path}" "${path}")
     cmake_utils_abs_path(path "${bin_path}/${rel_path}")
-    set(path "${path}" PARENT_SCOPE)
+    set("${out}" "${path}" PARENT_SCOPE)
   endif()
 endfunction()


add jessie to debian build

add jessie to debian build

--- cmake/EnumerateSystem.cmake
+++ cmake/EnumerateSystem.cmake
@@ -50,6 +50,9 @@
         endif()
         if(${LINUX_VER} MATCHES "7")
           set(LINUX_VER "wheezy")
+        endif()
+        if(${LINUX_VER} MATCHES "8")
+          set(LINUX_VER "jessie")
         endif()
         if(${LINUX_VER} MATCHES "98")
           set(LINUX_VER "testing")


Another windows build fix attempt after r198136.

The current quoting is stripped by cmake, try quoting more.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -37,7 +37,7 @@

     add_custom_command(OUTPUT symbol.def
       COMMAND ${CMAKE_COMMAND} -E echo "EXPORTS" > symbol.def
-      COMMAND ${CAT} "${export_file}" >> symbol.def
+      COMMAND ${CAT} "\"${export_file}\"" >> symbol.def
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")


[CMake] Don't pass all LLVM_COMPILE_FLAGS to the C compiler

GCC (unlike clang!) warns about C++ flags when compiling C.

https://reviews.llvm.org/D67171

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -7,6 +7,8 @@
   if("${sources}" MATCHES "\\.c(;|$)")
     set(update_src_props ON)
   endif()
+
+  list(APPEND LLVM_COMPILE_CFLAGS " ${LLVM_COMPILE_FLAGS}")

   # LLVM_REQUIRES_EH is an internal flag that individual targets can use to
   # force EH
@@ -54,13 +56,18 @@
   #   - LLVM_COMPILE_FLAGS is list.
   #   - PROPERTY COMPILE_FLAGS is string.
   string(REPLACE ";" " " target_compile_flags " ${LLVM_COMPILE_FLAGS}")
+  string(REPLACE ";" " " target_compile_cflags " ${LLVM_COMPILE_CFLAGS}")

   if(update_src_props)
     foreach(fn ${sources})
       get_filename_component(suf ${fn} EXT)
-      if("${suf}" STREQUAL ".cpp" OR "${suf}" STREQUAL ".c")
+      if("${suf}" STREQUAL ".cpp")
         set_property(SOURCE ${fn} APPEND_STRING PROPERTY
           COMPILE_FLAGS "${target_compile_flags}")
+      endif()
+      if("${suf}" STREQUAL ".c")
+        set_property(SOURCE ${fn} APPEND_STRING PROPERTY
+          COMPILE_FLAGS "${target_compile_cflags}")
       endif()
     endforeach()
   else()


AddLLVM.cmake: Untabify.

AddLLVM.cmake: Untabify.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -37,8 +37,8 @@
     foreach(fn ${sources})
       get_filename_component(suf ${fn} EXT)
       if("${suf}" STREQUAL ".cpp")
-	set_property(SOURCE ${fn} APPEND_STRING PROPERTY
-	  COMPILE_FLAGS "${target_compile_flags}")
+        set_property(SOURCE ${fn} APPEND_STRING PROPERTY
+          COMPILE_FLAGS "${target_compile_flags}")
       endif()
     endforeach()
   else()


Remove warning about obsolete PKGCONFIG macro

--- cmake/modules/FindGIO.cmake
+++ cmake/modules/FindGIO.cmake
@@ -16,23 +16,23 @@
 endif(GIO_INCLUDE_DIR AND GIO_LIBRARIES)

 if (NOT WIN32)
-    include(UsePkgConfig)
-    pkgconfig(gio-2.0 _LibGIOIncDir _LibGIOLinkDir _LibGIOLinkFlags _LibGIOCflags)
+  find_package(PkgConfig REQUIRED)
+  pkg_check_modules(PKG_GIO REQUIRED QUIET gio-2.0)
 endif(NOT WIN32)

 if (NOT GIO_FIND_QUIETLY)
-MESSAGE(STATUS "gio include dir: ${_LibGIOIncDir}")
+  MESSAGE(STATUS "gio include dir: ${PKG_GIO_INCLUDEDIR}")
 endif (NOT GIO_FIND_QUIETLY)
 # first try without default paths to respect PKG_CONFIG_PATH

 find_path(GIO_MAIN_INCLUDE_DIR glib.h
         PATH_SUFFIXES glib-2.0
-        PATHS ${_LibGIOIncDir}
+        PATHS ${PKG_GIO_INCLUDEDIR}
         NO_DEFAULT_PATH)

 find_path(GIO_MAIN_INCLUDE_DIR glib.h
         PATH_SUFFIXES glib-2.0
-        PATHS ${_LibGIOIncDir} )
+        PATHS ${PKG_GIO_INCLUDEDIR} )

 if (NOT GIO_FIND_QUIETLY)
   MESSAGE(STATUS "found gio main include dir: ${GIO_MAIN_INCLUDE_DIR}")
@@ -41,24 +41,24 @@
 # search the glibconfig.h include dir under the same root where the library is found
 find_library(GIO_LIBRARIES
         NAMES gio-2.0
-        PATHS ${_LibGIOLinkDir}
+        PATHS ${PKG_GIO_INCLUDEDIR}
         NO_DEFAULT_PATH)

 find_library(GIO_LIBRARIES
         NAMES gio-2.0
-        PATHS ${_LibGIOLinkDir})
+        PATHS ${PKG_GIO_LIBDIR})

-get_filename_component(GIOLibDir "${GIO_LIBRARIES}" PATH)
+get_filename_component(GIOLibDir "${PKG_GIO_LIBRARIES}" PATH)

 find_path(GIO_INTERNAL_INCLUDE_DIR glibconfig.h
         PATH_SUFFIXES glib-2.0/include
-        PATHS ${_LibGIOIncDir} "${GIOLibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}
+        PATHS ${PKG_GIO_INCLUDEDIR} "${GIOLibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH}
         NO_DEFAULT_PATH)

 find_path(GIO_INTERNAL_INCLUDE_DIR glibconfig.h
         PATH_SUFFIXES glib-2.0/include
-        PATHS ${_LibGIOIncDir} "${GIOLibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})
+        PATHS ${PKG_GIO_INCLUDEDIR} "${GIOLibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})

 set(GIO_INCLUDE_DIR "${GIO_MAIN_INCLUDE_DIR}")

@@ -69,6 +69,6 @@
 endif(GIO_INTERNAL_INCLUDE_DIR)

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GIO  DEFAULT_MSG  GIO_LIBRARIES GIO_MAIN_INCLUDE_DIR)
+find_package_handle_standard_args(GIO  DEFAULT_MSG  GIO_LIBRARIES GIO_MAIN_INCLUDE_DIR GIO_INCLUDE_DIR)

 mark_as_advanced(GIO_INCLUDE_DIR GIO_LIBRARIES)


fix bad version number in cmake

fix bad version number in cmake

--- cmake/qibuild/version.cmake
+++ cmake/qibuild/version.cmake
@@ -1,4 +1,4 @@
 ## Copyright (c) 2012-2020 SoftBank Robotics. All rights reserved.
 ## Use of this source code is governed by a BSD-style license that can be
 ## found in the COPYING file.
-set(QIBUILD_VERSION "3.14.1" CACHE STRING "qibuild version" FORCE)
+set(QIBUILD_VERSION "3.15" CACHE STRING "qibuild version" FORCE)


More debugging. Cmake not evaluating "$ENV{HOME}" correctly.

--- cmake_modules/FindVTK.cmake
+++ cmake_modules/FindVTK.cmake
@@ -115,7 +115,8 @@
     set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.10" CACHE PATH "VTK Headers location.")
 message(STATUS "${VTK_LIB_DIR}")
 message(STATUS "${__TMP_DIR}/include/vtk-5.10")
-message(STATUS "$ENV{VTK_LIB_DIR} $ENV{HOME}/LPS/prerequisites/vtk/lib")
+message(STATUS "HOME dir is: $ENV{HOME}")
+message(STATUS "$ENV{HOME}/LPS/prerequisites/vtk/lib")
 else()

   # Look for UseVTK.cmake in build trees or under <prefix>/include/vtk.


timeout of loop waiting for app to start

git-svn-id: fe3cd4388a6e5a968b09397a3d721fe124e8117a@101 5b54908e-ead4-fc18-b48a-0285e6dbc711

--- tests/runtest.cmake
+++ tests/runtest.cmake
@@ -85,6 +85,7 @@
 # use perl since /bin/sleep not on all platforms
 set(SLEEP_SHORT ${PERL} -e "sleep(0.2)")
 set(SLEEP_LONG ${PERL} -e "sleep(2)")
+set(TIMEOUT_SHORT "50")

 # intra-arg space=@@ and inter-arg space=@
 set(cmd_with_at ${cmd})
@@ -122,18 +123,34 @@
     execute_process(COMMAND ${SLEEP_LONG})
   endif (VMKERNEL)

+  set(iters 0)
   while (NOT EXISTS "${out}")
     execute_process(COMMAND ${SLEEP_SHORT})
+    math(EXPR iters "${iters} + 1")
+    if ("${iters}" STREQUAL "${TIMEOUT_SHORT}")
+      message(FATAL_ERROR "Timed out waiting for run_in_bg")
+    endif ()
   endwhile ()
+
   file(READ "${out}" output)
+  set(iters 0)
   while (NOT "${output}" MATCHES "starting\n")
     execute_process(COMMAND ${SLEEP_SHORT})
     file(READ "${out}" output)
+    math(EXPR iters "${iters} + 1")
+    if ("${iters}" STREQUAL "${TIMEOUT_SHORT}")
+      message(FATAL_ERROR "Timed out waiting for app to start")
+    endif ()
   endwhile()

   if (WIN32)
+    set(iters 0)
     while (NOT EXISTS "${out}pid")
       execute_process(COMMAND ${SLEEP_SHORT})
+      math(EXPR iters "${iters} + 1")
+      if ("${iters}" STREQUAL "${TIMEOUT_SHORT}")
+        message(FATAL_ERROR "Timed out waiting for ${out}pid: app failed to start!")
+      endif ()
     endwhile ()
     file(READ "${out}pid" pid)
     string(REGEX REPLACE "\r?\n" "" pid "${pid}")


MSVC: unconditionally silenced warning 4373 ('...': virtual function overrides '...', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers).

--- toolchains/msvc.toolchain.cmake
+++ toolchains/msvc.toolchain.cmake
@@ -28,7 +28,9 @@

 set( TNUN_compiler_release_flags -DNDEBUG -Bt -Ox -Ob2 -Oy -GF -Gw -Gm- -GS- -Gy )

-add_compile_options( /std:c++latest -MP -Oi -W4 -Zc:threadSafeInit- -wd4324 ) # w4324 = 'structure was padded due to alignment specifier'
+# w4373: '...': virtual function overrides '...', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
+# w4324: 'structure was padded due to alignment specifier'
+add_compile_options( /std:c++latest -MP -Oi -W4 -Zc:threadSafeInit- -wd4324 -wd4373 )
 add_definitions(
   -D_CRT_SECURE_NO_WARNINGS
   -D_SCL_SECURE_NO_WARNINGS
@@ -71,7 +73,7 @@
   set_property( TARGET ${target} PROPERTY LIBRARY_OUTPUT_DIRECTORY         "${LIBRARY_OUTPUT_PATH}" )
   set_property( TARGET ${target} PROPERTY ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${LIBRARY_OUTPUT_PATH}" )
   set_property( TARGET ${target} PROPERTY LIBRARY_OUTPUT_DIRECTORY_RELEASE "${LIBRARY_OUTPUT_PATH}" )
-  set_property( TARGET ${target} PROPERTY OUTPUT_NAME              "${base_target_name}_${TNUN_arch_suffix}_${TNUN_os_suffix}" )
+  set_property( TARGET ${target} PROPERTY OUTPUT_NAME                      "${base_target_name}_${TNUN_arch_suffix}_${TNUN_os_suffix}" )

   target_compile_options( ${target} PRIVATE ${TNUN_arch_compiler_options} )
 endfunction()


Revert "[CMake] Use cmakedefine01 instead of cmakedefine"

This reverts commit r288959.

Apparently using cmakedefine01 explodes.

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

--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -17,7 +17,7 @@
 #cmakedefine HAVE_BACKTRACE ${HAVE_BACKTRACE}

 /* Define to 1 if you have the <CrashReporterClient.h> header file. */
-#cmakedefine01 HAVE_CRASHREPORTERCLIENT_H
+#cmakedefine HAVE_CRASHREPORTERCLIENT_H

 /* can use __crashreporter_info__ */
 #undef HAVE_CRASHREPORTER_INFO


build/cmake/DefineOptions.cmake: Minor improvement in logging for 'WITH_MT'

--- build/cmake/DefineOptions.cmake
+++ build/cmake/DefineOptions.cmake
@@ -145,7 +145,7 @@

 # Visual Studio only options
 if(MSVC)
-    option(WITH_MT "Build using MT instead of MD (MSVC only)" OFF)
+    option(WITH_MT "Build using the static runtime 'MT' instead of the shared DLL-specific runtime 'MD' (MSVC only)" OFF)
 endif(MSVC)

 macro(MESSAGE_DEP flag summary)
@@ -207,6 +207,9 @@
 message(STATUS "  Build Python library:                       ${BUILD_PYTHON}")
 MESSAGE_DEP(WITH_PYTHON "Disabled by WITH_PYTHON=OFF")
 MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
+if(MSVC)
+    message(STATUS "  Using static runtime library:               ${WITH_MT}")
+endif(MSVC)
 message(STATUS)
 message(STATUS)
 message(STATUS "----------------------------------------------------------")


pyqt4.cmake: Separate mac-only config flag.

--- pyqt4.cmake
+++ pyqt4.cmake
@@ -23,7 +23,11 @@

 message ("Installing ${pyqt4_NAME} into FlyEM build area: ${FLYEM_BUILD_DIR} ...")

-# MAC OS X config flags!
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    set (EXTRA_PYQT4_CONFIG_FLAGS
+        --use-arch=x86_64)
+endif()
+
 ExternalProject_Add(${pyqt4_NAME}
     DEPENDS             ${python_NAME} ${sip_NAME} ${qt4_NAME}
     PREFIX              ${FLYEM_BUILD_DIR}
@@ -35,7 +39,7 @@
     CONFIGURE_COMMAND   ${PYTHON_EXE} ${pyqt4_SRC_DIR}/configure.py
         --confirm-license
         -q "${FLYEM_BUILD_DIR}/bin/qmake"
-        --use-arch=x86_64
+        ${EXTRA_PYQT4_CONFIG_FLAGS}
     BUILD_COMMAND       ${FLYEM_ENV_STRING} make
     INSTALL_COMMAND     ${FLYEM_ENV_STRING} make install
     BUILD_IN_SOURCE 1


Backed out changeset dfb1d2c23122

Backed out changeset dfb1d2c23122

--- indra/cmake/APR.cmake
+++ indra/cmake/APR.cmake
@@ -56,7 +56,7 @@

   if (LINUX)
     if (VIEWER)
-      list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} uuid)
+      list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})
     endif (VIEWER)
     list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES} rt)
   endif (LINUX)


Fix path to in source ExternalData with Superbuild

The path must be the root of the source of SimpleITK and not of the
current project ( i.e. Superbuild's sub-directory ).

--- CMake/sitkExternalData.cmake
+++ CMake/sitkExternalData.cmake
@@ -24,7 +24,7 @@
 endif()
 list(APPEND ExternalData_OBJECT_STORES
   # Local data store populated by the ITK pre-commit hook
-  "${CMAKE_SOURCE_DIR}/.ExternalData"
+  "${CMAKE_CURRENT_SOURCE_DIR}/../.ExternalData"
   )

 set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/ExternalData)


[INTERNAL] More README => README.rst renaming.

--- util/cmake/package.cmake
+++ util/cmake/package.cmake
@@ -69,7 +69,7 @@
     SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SeqAn - The C++ library for sequence analysis.")
     SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>")
     SET(CPACK_PACKAGE_VENDOR "SeqAn Team, FU Berlin")
-    SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
+    SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.rst")
     SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")

     seqan_get_version()