[CMake] Cleanup version check for 2.8.11

We are always greater than CMake 2.8.11, so we don't need this check.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -227,14 +227,12 @@

   include(ChooseMSVCCRT)

-  if( NOT (${CMAKE_VERSION} VERSION_LESS 2.8.11) )
-    # set stack reserved size to ~10MB
-    # CMake previously automatically set this value for MSVC builds, but the
-    # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
-    # value (1 MB) which is not enough for us in tasks such as parsing recursive
-    # C++ templates in Clang.
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
-  endif()
+  # set stack reserved size to ~10MB
+  # CMake previously automatically set this value for MSVC builds, but the
+  # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
+  # value (1 MB) which is not enough for us in tasks such as parsing recursive
+  # C++ templates in Clang.
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")

   if( MSVC11 )
     add_llvm_definitions(-D_VARIADIC_MAX=10)


Rename the c++11 option as cxx11 feature. Needed for root-config.in

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -342,6 +342,7 @@

 #---root-config----------------------------------------------------------------------------------------------
 ROOT_SHOW_OPTIONS(features)
+string(REPLACE "c++11" "cxx11" features ${features}) # change the name of the c++11 feature needed for root-config.in
 set(configfeatures ${features})
 set(configargs ${ROOT_CONFIGARGS})
 set(configoptions ${ROOT_CONFIGARGS})


update

update

--- modules/zlib.cmake
+++ modules/zlib.cmake
@@ -52,7 +52,7 @@
   # Module library
   file(GLOB SOURCE_FILES "zlib/*.c")
   if(NOT MSVC)
-    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} -Wno-shift-negative-value")
   else()
     # C4127: conditional expression is constant
     # C4131: 'function' : uses old-style declarator


Avoid adding package lookup dependency if no target defined

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -166,7 +166,9 @@
             "Whether package is obtained from a lookup build"
             FORCE
         )
-        add_dependencies(lookup_dependencies ${package})
+        if(TARGET ${package})
+            add_dependencies(lookup_dependencies ${package})
+        endif()
     endif()
 endmacro()


CI: allow configurable builds outside gitlab-runner

--- CI/main_ci.cmake
+++ CI/main_ci.cmake
@@ -26,13 +26,22 @@
 set (CTEST_BUILD_CONFIGURATION "Release")
 set (CTEST_CMAKE_GENERATOR "Ninja")

+# detect short sha
+if(NOT DEFINED ENV{CI_COMMIT_SHORT_SHA})
+  execute_process(COMMAND git log -1 --pretty=format:%h
+                  WORKING_DIRECTORY ${OTB_SOURCE_DIR}
+                  OUTPUT_VARIABLE ci_short_sha)
+else()
+  set(ci_short_sha "$ENV{CI_COMMIT_SHORT_SHA}")
+endif()
+
 # Find the build name and CI profile
 set(ci_profile wip)
 set(ci_mr_source "$ENV{CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}")
 set(ci_mr_target "$ENV{CI_MERGE_REQUEST_TARGET_BRANCH_NAME}")
 set(ci_mr_iid "$ENV{CI_MERGE_REQUEST_IID}")
 set(ci_ref_name "$ENV{CI_COMMIT_REF_NAME}")
-set (CTEST_BUILD_NAME "$ENV{CI_COMMIT_SHORT_SHA}")
+set (CTEST_BUILD_NAME ${ci_short_sha})
 if(ci_mr_source AND ci_mr_target AND ci_mr_iid)
   set (CTEST_BUILD_NAME "${ci_mr_source} (MR ${ci_mr_iid})")
   set(ci_profile mr)
@@ -45,14 +54,26 @@
   endif()
 endif()

-#Warning, this variable is used in cdash_status.py. If change from
-# ${IMAGE_NAME} to something else do not forget to change it.
+# Detect site
+if(NOT DEFINED IMAGE_NAME)
+  if(DEFINED ENV{IMAGE_NAME})
+    set(IMAGE_NAME $ENV{IMAGE_NAME})
+  endif()
+endif()
 set (CTEST_SITE "${IMAGE_NAME}")

 # Directory variable
 set (CTEST_SOURCE_DIRECTORY "${OTB_SOURCE_DIR}")
-set (CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/")
-set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/")
+if(BUILD_DIR)
+  set (CTEST_BINARY_DIRECTORY "${BUILD_DIR}")
+else()
+  set (CTEST_BINARY_DIRECTORY "${OTB_SOURCE_DIR}/build/")
+endif()
+if(INSTALL_DIR)
+  set (CTEST_INSTALL_DIRECTORY "${INSTALL_DIR}")
+else()
+  set (CTEST_INSTALL_DIRECTORY "${OTB_SOURCE_DIR}/install/")
+endif()
 set (PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}")

 # Ctest command value


Added new filters to sugar/cmake

Added new filters to sugar/cmake

--- ogles_gpgpu/common/proc/sugar.cmake
+++ ogles_gpgpu/common/proc/sugar.cmake
@@ -18,6 +18,8 @@
 sugar_files(
     OGLES_GPGPU_SRCS
     adapt_thresh.h
+    blend.cpp
+    blend.h
     box_opt.h
     diff.cpp
     diff.h
@@ -35,20 +37,24 @@
     grad.h
     grayscale.cpp
     grayscale.h
+    highpass.h
+    iir.cpp
+    iir.h
     ixyt.cpp
     ixyt.h
     lnorm.h
     lbp.cpp
     lbp.h
+    lowpass.h
     median.cpp
     median.h
     nms.cpp
     nms.h
     pyramid.cpp
     pyramid.h
-    shitomasi.cpp # corner
+    shitomasi.cpp
     shitomasi.h
-    tensor.cpp # tensor
+    tensor.cpp
     tensor.h
     thresh.cpp
     thresh.h
@@ -56,7 +62,7 @@
     transform.h
     two.cpp
     two.h
-    video.cpp # image source
+    video.cpp
     video.h
     yuv2rgb.cpp
     yuv2rgb.h


better script for finding minerva

better script for finding minerva

--- src/cmake/FindMinerva.cmake
+++ src/cmake/FindMinerva.cmake
@@ -5,17 +5,17 @@
 #  MINERVA_INCLUDE_DIR

 find_path(MINERVA_INCLUDE_DIR
-    NAMES minerva/minerva.h
+    NAMES minerva.h
     PATHS ${MINERVA_PREFIX_PATH}/minerva)

 find_library(MINERVA_LIBRARY
     NAMES minerva
-    PATHS ${MINERVA_PREFIX_PATH}/minerva/release/lib)
+    PATHS ${MINERVA_PREFIX_PATH}/release/lib)

 if(NOT MINERVA_LIBRARY)
   find_library(MINERVA_LIBRARY
       NAMES minerva
-      PATHS ${MINERVA_PREFIX_PATH}/minerva/debug/lib)
+      PATHS ${MINERVA_PREFIX_PATH}/debug/lib)
 endif(NOT MINERVA_LIBRARY)

 include(FindPackageHandleStandardArgs)


remove a useless define in Doxyfile

remove a useless define in Doxyfile

--- src/Doxyfile.cmake
+++ src/Doxyfile.cmake
@@ -2024,7 +2024,7 @@
 # recursively expanded use the := operator instead of the = operator.
 # This tag requires that the tag ENABLE_PREPROCESSING is set to YES.

-PREDEFINED             = protected=private
+PREDEFINED             =

 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The


Add message to show which source files

Add message to show which source files

--- cmake/CppCheck.cmake
+++ cmake/CppCheck.cmake
@@ -83,6 +83,7 @@

     file(WRITE ${CMAKE_BINARY_DIR}/cppcheck.cmake "
         file(GLOB_RECURSE GSRCS ${GLOBS})
+        message(\"${CPPCHECK_EXE} ${SOURCES} \${GSRCS}\")
         execute_process(
             COMMAND ${CPPCHECK_EXE}
             -q


Fix GLFW find script for linux (refs #126)

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -19,7 +19,7 @@
 )

 find_library(GLFW_LIBRARY
-    NAMES glfw3
+    NAMES glfw3 glfw
     PATHS
     ${GLFW_LIBRARY_DIR}  # provided by glfw config
     $ENV{GLFWDIR}/lib


fix OSX build to search and use a dynamic Ptex lib instead of static.

--- cmake/FindPTex.cmake
+++ cmake/FindPTex.cmake
@@ -96,7 +96,7 @@
             DOC "The directory where Ptexture.h resides")
     find_library( PTEX_LIBRARY
         NAMES
-            libPtex.a
+            Ptex libPtex.a
         PATHS
             ${PTEX_LOCATION}/lib
             $ENV{PTEX_LOCATION}/lib


cmake: Rework FindSCIP.cmake

cmake: Rework FindSCIP.cmake

--- cmake/FindSCIP.cmake
+++ cmake/FindSCIP.cmake
@@ -25,8 +25,14 @@
 A user may set ``SCIP_ROOT`` to a SCIP installation root to tell this
 module where to look.
 #]=======================================================================]
+# first specifically look for the CMake version of SCIP
+find_package(SCIP QUIET NO_MODULE)
+# if we found the SCIP cmake package then we are done.
+if(SCIP_FOUND)
+  return()
+endif()
+
 set(SCIP_FOUND FALSE)
-
 if(CMAKE_C_COMPILER_LOADED)
   include (CheckIncludeFile)
   include (CheckCSourceCompiles)
@@ -76,5 +82,7 @@
       ${SCIP_ROOT}/lib/soplex.lib
       ignore:4006
       )
+  else()
+    message(FATAL_ERROR "OR-Tools with SCIP not supported for ${CMAKE_SYSTEM}")
   endif()
 endif()


Get linkage working with external SDL 1.2 or 2.0.

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -1,6 +1,7 @@
 find_package( PkgConfig )
 if( PKG_CONFIG_FOUND )
   pkg_check_modules( SDL2 sdl2 )
+  find_library( SDL2_LIBRARY NAMES ${SDL2_LIBRARIES} HINTS ${SDL2_LIBDIR} ${SDL2_LIBRARY_DIRS} )
 else()
   set( SDL2_FOUND "" CACHE INTERNAL "" )
 endif()


Do not search for unused ZBAR_QT, avoid 'Could NOT find ZBAR_QT warning'

--- cmake/FindZBar.cmake
+++ cmake/FindZBar.cmake
@@ -1,13 +1,14 @@
-# https://svn.engsas.de/meganizer/trunk/cmake/modules/FindZBar0.cmake
-# - Try to find ZBar (with and without Qt)
+# Thanks: https://svn.engsas.de/meganizer/trunk/cmake/modules/FindZBar0.cmake
+#### - Try to find ZBar (with and without Qt)  #-- Comment out ZBAR_QT
+# - Try to find ZBar
 # Once done this will define
 #
 #  ZBAR_FOUND - system has ZBar
-#  ZBAR_QT_FOUND - system has ZBar with Qt
+####  ZBAR_QT_FOUND - system has ZBar with Qt  #-- Comment out ZBAR_QT
 #  ZBAR_LIBRARY_DIR - the QCA2 top level directory
 #  ZBAR_INCLUDE_DIR - the QCA2 include directory
 #  ZBAR_LIBRARIES - the libraries needed to ZBar
-#  ZBAR_QT_LIBRARIES - the libraries needed to ZBar Qt
+####  ZBAR_QT_LIBRARIES - the libraries needed to ZBar Qt #-- Comment out ZBAR_QT
 #
 # use pkg-config to get the directories and then use these values
 # in the FIND_PATH() and FIND_LIBRARY() calls
@@ -53,38 +54,39 @@

 ENDIF (ZBAR_INCLUDE_DIR AND ZBAR_LIBRARIES)

-IF (ZBAR_QT_LIBRARIES)
-
-  # in cache already
-  SET(ZBAR_QT_FOUND TRUE)
-
-ELSE (ZBAR_QT_LIBRARIES)
-
-  IF (WIN32)
-		FIND_LIBRARY(ZBAR_QT_LIBRARIES NAMES libzbarqt0.dll HINTS ${ZBAR_LIBRARY_DIR}/bin)
-		FIND_PATH(ZBAR_QT_INCLUDE_DIR NAMES QZBar.h HINTS ${ZBAR_INCLUDE_DIR})
-	ELSE(WIN32)
-		FIND_PACKAGE(PkgConfig)
-#     pkg_check_modules(PC_QCA2 QUIET qca2)
-    pkg_check_modules(PC_ZBAR_QT zbar-qt)
-    SET(ZBAR_QT_DEFINITIONS ${PC_ZBAR_QT_CFLAGS_OTHER})
-		FIND_LIBRARY(ZBAR_QT_LIBRARIES
-                  WIN32_DEBUG_POSTFIX d
-                  NAMES zbarqt
-                  HINTS ${ZBAR_LIBRARY_DIR}
-                  )
-		FIND_PATH(ZBAR_QT_INCLUDE_DIR QZBar.h
-							HINTS ${PC_ZBAR_QT_INCLUDEDIR} ${PC_ZBAR_QT_INCLUDE_DIRS} ${ZBAR_INCLUDE_DIR}
-							PATH_SUFFIXES zbar)
-  ENDIF (WIN32)
-
-	SET(ZBAR_QT_INCLUDE_DIR ${ZBAR_INCLUDE_DIR})
-
-	INCLUDE(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(ZBAR_QT  DEFAULT_MSG  ZBAR_QT_LIBRARIES ZBAR_QT_INCLUDE_DIR)
-	# QT versions get the not qt variables appended, so that only qt stuff must be included
-	# and the other needed stuff is automatically included to
-	#SET(ZBAR_QT_INCLUDE_DIR "${ZBAR_QT_INCLUDE_DIR} ${ZBAR_INCLUDE_DIR}")
-	SET(ZBAR_QT_LIBRARIES ${ZBAR_QT_LIBRARIES} ${ZBAR_LIBRARIES})
-
-ENDIF (ZBAR_QT_LIBRARIES)
+#-- Comment out ZBAR_QT
+###IF (ZBAR_QT_LIBRARIES)
+###
+###  # in cache already
+###  SET(ZBAR_QT_FOUND TRUE)
+###
+###ELSE (ZBAR_QT_LIBRARIES)
+###
+###  IF (WIN32)
+###		FIND_LIBRARY(ZBAR_QT_LIBRARIES NAMES libzbarqt0.dll HINTS ${ZBAR_LIBRARY_DIR}/bin)
+###		FIND_PATH(ZBAR_QT_INCLUDE_DIR NAMES QZBar.h HINTS ${ZBAR_INCLUDE_DIR})
+###	ELSE(WIN32)
+###		FIND_PACKAGE(PkgConfig)
+####     pkg_check_modules(PC_QCA2 QUIET qca2)
+###    pkg_check_modules(PC_ZBAR_QT zbar-qt)
+###    SET(ZBAR_QT_DEFINITIONS ${PC_ZBAR_QT_CFLAGS_OTHER})
+###		FIND_LIBRARY(ZBAR_QT_LIBRARIES
+###                  WIN32_DEBUG_POSTFIX d
+###                  NAMES zbarqt
+###                  HINTS ${ZBAR_LIBRARY_DIR}
+###                  )
+###		FIND_PATH(ZBAR_QT_INCLUDE_DIR QZBar.h
+###							HINTS ${PC_ZBAR_QT_INCLUDEDIR} ${PC_ZBAR_QT_INCLUDE_DIRS} ${ZBAR_INCLUDE_DIR}
+###							PATH_SUFFIXES zbar)
+###  ENDIF (WIN32)
+###
+###	SET(ZBAR_QT_INCLUDE_DIR ${ZBAR_INCLUDE_DIR})
+###
+###	INCLUDE(FindPackageHandleStandardArgs)
+###  find_package_handle_standard_args(ZBAR_QT  DEFAULT_MSG  ZBAR_QT_LIBRARIES ZBAR_QT_INCLUDE_DIR)
+###	# QT versions get the not qt variables appended, so that only qt stuff must be included
+###	# and the other needed stuff is automatically included to
+###	#SET(ZBAR_QT_INCLUDE_DIR "${ZBAR_QT_INCLUDE_DIR} ${ZBAR_INCLUDE_DIR}")
+###	SET(ZBAR_QT_LIBRARIES ${ZBAR_QT_LIBRARIES} ${ZBAR_LIBRARIES})
+###
+###ENDIF (ZBAR_QT_LIBRARIES)


fixed path with spaces in llvm-config (#2854)

* fixed path with spaces in llvm-config

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -5,15 +5,15 @@
 # LLVM_FOUND
 # LLVM_INCLUDE_DIRS
 # LLVM_LIBRARIES
-# LLVM_LIBDIRS
+# LLVM_LIBDIR

 find_program(LLVM_CONFIG_EXE
-    NAMES llvm-config-8 llvm-config-8.0 llvm-config80 llvm-config
-    PATHS
-        "/mingw64/bin"
-        "/c/msys64/mingw64/bin"
-        "c:/msys64/mingw64/bin"
-        "C:/Libraries/llvm-8.0.0/bin")
+  NAMES llvm-config-8 llvm-config-8.0 llvm-config80 llvm-config
+  PATHS
+    "/mingw64/bin"
+    "/c/msys64/mingw64/bin"
+    "c:/msys64/mingw64/bin"
+    "C:/Libraries/llvm-8.0.0/bin")

 if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
   message(FATAL_ERROR "unable to find llvm-config")
@@ -24,9 +24,9 @@
 endif()

 execute_process(
-	COMMAND ${LLVM_CONFIG_EXE} --version
-	OUTPUT_VARIABLE LLVM_CONFIG_VERSION
-	OUTPUT_STRIP_TRAILING_WHITESPACE)
+  COMMAND ${LLVM_CONFIG_EXE} --version
+  OUTPUT_VARIABLE LLVM_CONFIG_VERSION
+  OUTPUT_STRIP_TRAILING_WHITESPACE)

 if("${LLVM_CONFIG_VERSION}" VERSION_LESS 8)
   message(FATAL_ERROR "expected LLVM 8.x but found ${LLVM_CONFIG_VERSION}")
@@ -39,15 +39,15 @@
 endif()

 execute_process(
-	COMMAND ${LLVM_CONFIG_EXE} --targets-built
-    OUTPUT_VARIABLE LLVM_TARGETS_BUILT_SPACES
-	OUTPUT_STRIP_TRAILING_WHITESPACE)
-string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
+  COMMAND ${LLVM_CONFIG_EXE} --targets-built
+  OUTPUT_VARIABLE LLVM_TARGETS_BUILT_SPACES
+  OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
 function(NEED_TARGET TARGET_NAME)
-    list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
-    if (${_index} EQUAL -1)
-        message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
-    endif()
+  list (FIND LLVM_TARGETS_BUILT "${TARGET_NAME}" _index)
+  if (${_index} EQUAL -1)
+    message(FATAL_ERROR "LLVM is missing target ${TARGET_NAME}. Zig requires LLVM to be built with all default targets enabled.")
+  endif()
 endfunction(NEED_TARGET)
 NEED_TARGET("AArch64")
 NEED_TARGET("AMDGPU")
@@ -67,47 +67,53 @@

 if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
-      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")
+    COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
+    OUTPUT_VARIABLE LLVM_LIBDIR_ORIG
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  file(TO_CMAKE_PATH "${LLVM_LIBDIR_ORIG}" LLVM_LIBDIR)

   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
-      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
+    COMMAND ${LLVM_CONFIG_EXE} --libnames --link-static
+    OUTPUT_VARIABLE LLVM_LIBNAMES_SPACES
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REPLACE " " ";" LLVM_LIBNAMES "${LLVM_LIBNAMES_SPACES}")
+  foreach(LLVM_LIBNAME ${LLVM_LIBNAMES})
+    list(APPEND LLVM_LIBRARIES "${LLVM_LIBDIR}/${LLVM_LIBNAME}")
+  endforeach()

   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
-      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
+    COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
+    OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+    string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
 endif()
 if(NOT LLVM_LIBRARIES)
   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --libs
-      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")
+    COMMAND ${LLVM_CONFIG_EXE} --libdir
+    OUTPUT_VARIABLE LLVM_LIBDIR_ORIG
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  file(TO_CMAKE_PATH "${LLVM_LIBDIR_ORIG}" LLVM_LIBDIR)

   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --system-libs
-      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
+    COMMAND ${LLVM_CONFIG_EXE} --libs
+    OUTPUT_VARIABLE LLVM_LIBNAMES_SPACES
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+    string(REPLACE " " ";" LLVM_LIBNAMES "${LLVM_LIBNAMES_SPACES}")
+  foreach(LLVM_LIBNAME ${LLVM_LIBNAMES})
+    list(APPEND LLVM_LIBRARIES "${LLVM_LIBDIR}/${LLVM_LIBNAME}")
+  endforeach()

   execute_process(
-      COMMAND ${LLVM_CONFIG_EXE} --libdir
-      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
+    COMMAND ${LLVM_CONFIG_EXE} --system-libs
+    OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+    string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
 endif()

 execute_process(
-    COMMAND ${LLVM_CONFIG_EXE} --includedir
-    OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  COMMAND ${LLVM_CONFIG_EXE} --includedir
+  OUTPUT_VARIABLE LLVM_INCLUDE_DIRS
+  OUTPUT_STRIP_TRAILING_WHITESPACE)

 set(LLVM_LIBRARIES ${LLVM_LIBRARIES} ${LLVM_SYSTEM_LIBS})

@@ -116,9 +122,9 @@
 endif()

 link_directories("${CMAKE_PREFIX_PATH}/lib")
-link_directories("${LLVM_LIBDIRS}")
+link_directories("${LLVM_LIBDIR}")

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LLVM DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIRS)

-mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIRS)
+mark_as_advanced(LLVM_INCLUDE_DIRS LLVM_LIBRARIES LLVM_LIBDIR)


Fix ProtoBuf.cmake to use PROTOBUF_LIBRARY as well

Summary: Closes https://github.com/caffe2/caffe2/pull/152

Reviewed By: Yangqing

Differential Revision: D4577524

Pulled By: bwasti

fbshipit-source-id: 019ced46dc474c413ba00a98b8fdeb7230a28b55

--- cmake/ProtoBuf.cmake
+++ cmake/ProtoBuf.cmake
@@ -31,7 +31,8 @@
   if ( NOT (Protobuf_FOUND OR PROTOBUF_FOUND) )
     custom_protobuf_find()
   else()
-    list(APPEND Caffe2_DEPENDENCY_LIBS ${PROTOBUF_LIBRARIES})
+    # Adding PROTOBUF_LIBRARY for legacy support.
+    list(APPEND Caffe2_DEPENDENCY_LIBS ${PROTOBUF_LIBRARIES} ${PROTOBUF_LIBRARY})
     include_directories(SYSTEM ${PROTOBUF_INCLUDE_DIR})
   endif()
 endif()


cmake fix

cmake fix

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

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -89,8 +89,21 @@
 if (NOT DEFINED CMAKE_CXX_STANDARD)
     set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "")
 endif()
-#set(CMAKE_CXX_STANDARD_REQUIRED OFF)
-#set(CMAKE_CXX_EXTENSIONS OFF)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+
+IF((CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
+  SET(CMAKE_CXX_FLAGS "-stdlib=libc++")
+  # CMake 3.1 complains it does not know how to set the compile flag
+  # to enable C++11 with (Apple) Clang
+  SET(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")
+  SET(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
+ELSEIF((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND MSVC)
+  # CMake 3.1 complains it does not know how to set the compile flag
+  # to enable C++11 with MSVC
+  SET(CMAKE_CXX11_STANDARD_COMPILE_OPTION "")
+  SET(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
+ENDIF()

 if (CMAKE_VERSION VERSION_LESS "3.1" AND CMAKE_COMPILER_IS_GNUCC)


updated template for the unistd.h and pthread.h checks

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -20,6 +20,8 @@
 #cmakedefine  HAVE_SYS_WAIT_H
 #cmakedefine HAVE_SYS_TIME_H
 #cmakedefine HAVE_TIME_H
+#cmakedefine HAVE_UNISTD_H
+#cmakedefine HAVE_PTHREAD_H
 #cmakedefine HAVE_INET_ATON

 /* XATTR */


only install environment hooks for catkin_make(_isolated) completion in the catkin package

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -195,7 +195,7 @@
 if(CATKIN_BUILD_BINARY_PACKAGE)
   set(catkin_skip_install_env_hooks "SKIP_INSTALL")
 endif()
-if(CMAKE_HOST_UNIX)
+if(CMAKE_HOST_UNIX AND PROJECT_NAME STREQUAL "catkin")
   catkin_add_env_hooks(05.catkin_make SHELLS bash DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks})
   catkin_add_env_hooks(05.catkin_make_isolated SHELLS bash DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks})
 endif()


Squashed 'lib/libmrio/' changes from 1dff2c9..d036613

d036613 Include NetCDF_CXX4 by default

git-subtree-dir: lib/libmrio
git-subtree-split: d036613e2d7f091c77f72f40b695119fe6729454

--- libmrio.cmake
+++ libmrio.cmake
@@ -10,16 +10,7 @@

 option(LIBMRIO_WITH_NETCDF "NetCDF" ON)
 if(LIBMRIO_WITH_NETCDF)
-  find_package(NETCDF REQUIRED)
-  message(STATUS "NetCDF include directory: ${NETCDF_INCLUDE_DIR}")
-  message(STATUS "NetCDF library: ${NETCDF_LIBRARY}")
-  target_link_libraries(libmrio PRIVATE netcdf)
-
-  find_package(NETCDF_CPP4 REQUIRED)
-  message(STATUS "NetCDF_c++4 include directory: ${NETCDF_CPP4_INCLUDE_DIR}")
-  message(STATUS "NetCDF_c++4 library: ${NETCDF_CPP4_LIBRARY}")
-  target_link_libraries(libmrio PRIVATE netcdf_c++4)
-
+  include_netcdf_cxx4(libmrio ON v4.3.0)
   target_compile_definitions(libmrio PUBLIC LIBMRIO_WITH_NETCDF)
 endif()


added the defines for PG to the config.h template

git-svn-id: e98c317c6679dcf055eb388f05b44c3a6d6b38c6@1753 152afb58-edef-0310-8abb-c4023f1b3aa9

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -28,6 +28,10 @@
 /* mySQL */
 #cmakedefine  HAVE_MYSQL_H
 #cmakedefine  HAVE_LIBMYSQL
+
+/* postgresql */
+#cmakedefine  HAVE_LIBPQ_FE_H
+#cmakedefine  HAVE_LIBPQ

 /* OpenSSL */
 #cmakedefine  HAVE_OPENSSL_SSL_H


Always reset force_build variable to original value

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -48,21 +48,21 @@
 set(empty_binary_directory FALSE)

 # Attempt to build and test also if 'ctest_update' returned an error
-set(force_build FALSE)
+set(initial_force_build FALSE)

 # Set model options
 set(model "")
 if (SCRIPT_MODE STREQUAL "experimental")
   set(empty_binary_directory FALSE)
-  set(force_build TRUE)
+  set(initial_force_build TRUE)
   set(model Experimental)
 elseif (SCRIPT_MODE STREQUAL "continuous")
   set(empty_binary_directory FALSE)
-  set(force_build FALSE)
+  set(inital_force_build FALSE)
   set(model Continuous)
 elseif (SCRIPT_MODE STREQUAL "nightly")
   set(empty_binary_directory TRUE)
-  set(force_build TRUE)
+  set(initial_force_build TRUE)
   set(model Nightly)
 else()
   message(FATAL_ERROR "Unknown script mode: '${SCRIPT_MODE}'. Script mode should be either 'experimental', 'continuous' or 'nightly'")
@@ -71,7 +71,7 @@
 #message("script_mode:${SCRIPT_MODE}")
 #message("model:${model}")
 #message("empty_binary_directory:${empty_binary_directory}")
-#message("force_build:${force_build}")
+#message("force_build:${initial_force_build}")

 set(CTEST_USE_LAUNCHERS 1)

@@ -164,6 +164,7 @@
     math(EXPR build_errors "${build_errors} + 1")
   endif()

+  set(force_build ${inital_force_build})
   if(COMMAND MITK_OVERRIDE_FORCE_BUILD)
     MITK_OVERRIDE_FORCE_BUILD(force_build)
   endif()


Places correct tag in IBAMR external project.

Replace the branch name by a sha1 tag in the IBAMR external project.

Closes #33

--- CMake/SuperBuild/External_IBAMR.cmake
+++ CMake/SuperBuild/External_IBAMR.cmake
@@ -59,13 +59,13 @@
   endif()

 #     message(STATUS "Adding project:${proj}")
-
+  set(IBAMR_TAG "b1c423a69b51942ae2dc70eadf206645da2ab765")
   ExternalProject_Add(${proj}
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${CMAKE_BINARY_DIR}/${proj}-build
     PREFIX ${proj}${ep_suffix}
     GIT_REPOSITORY ${git_protocol}://github.com/MSV-Project/IBAMR.git
-    GIT_TAG "msvtk"
+    GIT_TAG ${IBAMR_TAG}
     UPDATE_COMMAND ""
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}


Remove debug message

Remove debug message

--- cmake/qibuild/internal/layout.cmake
+++ cmake/qibuild/internal/layout.cmake
@@ -5,7 +5,6 @@
 #the relative path between each var should remain the same.

 if(MSVC)
-  message(STATUS "We love visual studio")
   qi_set_global(QI_SDK_BIN ".")
   qi_set_global(QI_SDK_LIB ".")
 else()


qibuild/uselib: do not add the compile flags twice

Change-Id: I811c96452d5ac2481ce47ad1223bdda1bd20dba2

--- cmake/qibuild/internal/uselib.cmake
+++ cmake/qibuild/internal/uselib.cmake
@@ -6,6 +6,7 @@
   return()
 endif()
 set(_QI_USELIB_CMAKE_ TRUE)
+include(qibuild/internal/list)

 # Set CMAKE_FIND_LIBRARY_SUFFIXES so that
@@ -144,7 +145,7 @@
       if(_compile_defs)
         set(_to_add ${_compile_defs})
       endif()
-      list(APPEND _to_add "${${_U_PKG}_DEFINITIONS}")
+      _qi_list_append_uniq(_to_add "${${_U_PKG}_DEFINITIONS}")
       if(_to_add)
         set_target_properties(${name}
           PROPERTIES


fix qi_add_optional_package(QT_QTMULTIMEDIA) on ubuntu

 * qt installed on the system, but without qtmutlimedia
   installed

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

--- cmake/qibuild/modules/qtutils.cmake
+++ cmake/qibuild/modules/qtutils.cmake
@@ -25,6 +25,7 @@
       set(QT_${_suffix}_INCLUDE_DIRS ${QT_${_suffix}_INCLUDE_DIRS} PARENT_SCOPE)
     else()
       set(QT_${_suffix}_INCLUDE_DIRS FALSE PARENT_SCOPE)
+      set(QT_${_suffix}_PACKAGE_FOUND FALSE PARENT_SCOPE)
     endif()
     qi_append_uniq_global(QT_${_suffix}_LIBRARIES    "${QT_LIBRARIES}")
     set(QT_${_suffix}_LIBRARIES ${QT_${_suffix}_LIBRARIES} PARENT_SCOPE)


Fixed path to run AlloSphereApp to work with AlloProject

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -279,7 +279,7 @@
   SOURCES ${${ALLO_APP_SRC}})

 add_custom_target("${APP_NAME}_run"
-  COMMAND "python" "tools/allorun/allorun.py" "${BUILD_ROOT_DIR}/build/${APP_NAME}.json"
+  COMMAND "python" "${CMAKE_CURRENT_SOURCE_DIR}/tools/allorun/allorun.py" "${BUILD_ROOT_DIR}/build/${APP_NAME}.json"
   DEPENDS ${ALLOSPHERE_APPS}
   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
   SOURCES ${${ALLO_APP_SRC}}


another fix for debian (static linking of boost)

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -300,7 +300,10 @@
 SET(LIBS ${PYTHONLIBS})

 IF(BOOST_LINK_STATIC)
-	SET(LIBS ${LIBS} /usr/lib/libboost_filesystem.a /usr/lib/libboost_signals.a /usr/lib/libboost_system.a)
+	# seems this is the way for Debian:
+	SET(LIBS ${LIBS} boost_filesystem.a boost_signals.a)
+	# and this on newer CMake (>=2.6?)
+	#SET(LIBS ${LIBS} /usr/lib/libboost_filesystem.a /usr/lib/libboost_signals.a /usr/lib/libboost_system.a)
 ELSE(BOOST_LINK_STATIC)
 	SET(LIBS ${LIBS} boost_filesystem-mt boost_signals-mt)
 ENDIF(BOOST_LINK_STATIC)


disable ctest_empty_binary_directory for windows and using rebuild instead

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -123,7 +123,7 @@
 #set(CTEST_BUILD_NAME "${osname}-${cpu}")
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
 IF (WIN32)
-  set(CTEST_BUILD_COMMAND "${CMAKE_COMMAND} --build . --config ${CTEST_CONFIGURATION_TYPE}")
+  set(CTEST_BUILD_COMMAND "${CMAKE_COMMAND} --build . --config ${CTEST_CONFIGURATION_TYPE} -- /m /t:rebuild ")
 ELSE()
   set(CTEST_BUILD_COMMAND "make -j ${numProcessors}")
 ENDIF()
@@ -138,7 +138,9 @@
 set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} ${CTEST_BUILD_OPTIONS} ..")

 # start the test
-ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+IF (NOT WIN32)
+  ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+ENDIF()
 ctest_start("Continuous")
 #ctest_update (RETURN_VALUE count)
 IF (EMBREE_TESTING_INTENSITY GREATER 0)


Last set of comments

Last set of comments

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- make/devices.cmake
+++ make/devices.cmake
@@ -223,6 +223,21 @@
 endfunction()

 function(DEFINE_BOARD)
+  # DEFINE_BOARD(
+  #   BOARD <board>
+  #   DEVICE <device>
+  #   PACKAGE <package>
+  #   PROG_TOOL <prog_tool>
+  #   [PROG_CMD <command to use PROG_TOOL>
+  #   )
+  #
+  # Defines a target board for a project.  The listed device and package must
+  # have been defined using DEFINE_DEVICE.
+  #
+  # PROG_TOOL should be an executable that will program a bitstream to the
+  # specified board. PROG_CMD is an optional command string.  If PROG_CMD is
+  # not provided, PROG_CMD will simply be ${PROG_TOOL}.
+  #
   set(options)
   set(oneValueArgs BOARD DEVICE PACKAGE PROG_TOOL PROG_CMD)
   set(multiValueArgs)
@@ -236,6 +251,43 @@
 endfunction()

 function(ADD_FPGA_TARGET)
+  # ADD_FPGA_TARGET(
+  #   NAME <name>
+  #   TOP <top>
+  #   BOARD <board>
+  #   SOURCES <source list>
+  #   TESTBENCH_SOURCES <testbench source list>
+  #   [INPUT_IO_FILE <input_io_file>]
+  #   [EXPLICIT_MAKE_FILE_TARGET]
+  #   )
+  #
+  # ADD_FPGA_TARGET defines a FPGA build targetting a specific board.  By
+  # default input files (SOURCES, TESTBENCH_SOURCES, INPUT_IO_FILE) will be
+  # implicitly passed to MAKE_FILE_TARGET.  If EXPLICIT_MAKE_FILE_TARGET is
+  # supplied, this behavior is supressed.
+  #
+  # The SOURCES file list will be used to synthesize the FPGA images.
+  # INPUT_IO_FILE is required to define an io map.
+  # TESTBENCH_SOURCES will be used to run test benches.
+  #
+  # Targets generated:
+  #   <name>_eblif - Generate eblif file.
+  #   <name>_synth - Alias of <name>_eblif.
+  #   <name>_route - Generate place and routing synthesized design.
+  #   <name>_bit - Generate output bitstream.
+  #
+  # Naming conventions:
+  #
+  #  Outputs for this target will all be located in
+  # ${CMAKE_CURRENT_BINARY_DIR}/${NAME}/${ARCH}-${DEVICE_TYPE}-${DEVICE}-${PACKAGE}
+  #
+  #  Output files:
+  #    ${TOP}.eblif - Synthesized design
+  #    ${TOP}_io.place - IO placement.
+  #    ${TOP}.route - Place and routed design
+  #    ${TOP}.hlc - Place and routed design
+  #    ${TOP}.${BITSTREAM_EXTENSION} - Place and routed design
+  #
   set(options EXPLICIT_MAKE_FILE_TARGET)
   set(oneValueArgs NAME TOP BOARD INPUT_IO_FILE)
   set(multiValueArgs SOURCES TESTBENCH_SOURCES)
@@ -265,8 +317,12 @@
   get_target_property_required(OUT_RRXML_REAL ${DEVICE} ${PACKAGE}_OUT_RRXML_REAL)

   set(DEVICE_FULL ${DEVICE}-${PACKAGE})
-  set(FQDN ${ARCH}-${DEVICE_TYPE}-${DEVICE})
+  set(FQDN ${ARCH}-${DEVICE_TYPE}-${DEVICE}-${PACKAGE})
   set(OUT_LOCAL ${CMAKE_CURRENT_BINARY_DIR}/${NAME}/${FQDN})
+  set(DIRECTORY_TARGET ${NAME}-${FQDN}-make-directory)
+  add_custom_target(${DIRECTORY_TARGET} ALL
+    COMMAND ${CMAKE_COMMAND} -E make_directory ${OUT_LOCAL})
+
   set(NAME ${ADD_FPGA_TARGET_NAME})
   set(VPR_ROUTE_CHAN_WIDTH 100)
   set(VPR_ROUTE_CHAN_MINWIDTH_HINT ${VPR_ROUTE_CHAN_WIDTH})
@@ -296,10 +352,6 @@
   ##########################################################################
   set(OUT_EBLIF ${OUT_LOCAL}/${TOP}.eblif)

-  set(DIRECTORY_TARGET ${NAME}-${FQDN}-make-directory)
-  add_custom_target(${DIRECTORY_TARGET} ALL
-    COMMAND ${CMAKE_COMMAND} -E make_directory ${OUT_LOCAL})
-
   set(SOURCE_FILES_DEPS "")
   set(SOURCE_FILES "")
   foreach(SRC ${ADD_FPGA_TARGET_SOURCES})
@@ -325,7 +377,7 @@
     DEPENDS ${OUT_EBLIF})

   # Generate routing and generate HLC.
-  set(OUT_ROUTE $(OUT_LOCAL)/${TOP}.route)
+  set(OUT_ROUTE ${OUT_LOCAL}/${TOP}.route)
   set(OUT_HLC ${OUT_LOCAL}/${TOP}.hlc)

   set(VPR_DEPS "")
@@ -370,7 +422,7 @@
     get_target_property_required(PINMAP_FILE ${DEVICE} ${PACKAGE}_PINMAP)
     GET_FILE_LOCATION(PINMAP ${PINMAP_FILE})
     GET_FILE_TARGET(PINMAP_TARGET ${PINMAP_FILE})
-    set(OUT_IO ${OUT_LOCAL}/io.place)
+    set(OUT_IO ${OUT_LOCAL}/${TOP}_io.place)
     string(CONFIGURE ${PLACE_TOOL_CMD} PLACE_TOOL_CMD_FOR_TARGET)
     separate_arguments(PLACE_TOOL_CMD_FOR_TARGET_LIST UNIX_COMMAND ${PLACE_TOOL_CMD_FOR_TARGET})
     add_custom_command(


Bug: CMake syntax error

Bug: CMake syntax error

--- cmake/ExternalLibJPEG.cmake
+++ cmake/ExternalLibJPEG.cmake
@@ -9,7 +9,7 @@
         UPDATE_COMMAND ""
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
-        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${FAST_EXTERNAL_BUILD_DIR}/libjpeg/src/libjpeg/LibJPEG/9d/bin/libjpeg.dll ${FAST_EXTERNAL_INSTALL_DIR}/bin/
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${FAST_EXTERNAL_BUILD_DIR}/libjpeg/src/libjpeg/LibJPEG/9d/bin/libjpeg.dll ${FAST_EXTERNAL_INSTALL_DIR}/bin/ COMMAND
             ${CMAKE_COMMAND} -E copy_directory ${FAST_EXTERNAL_BUILD_DIR}/libjpeg/src/libjpeg/LibJPEG/9d/include/ ${FAST_EXTERNAL_INSTALL_DIR}/include/
 )
 endif()


Update whether or not to build APR

Update whether or not to build APR

--- cmake/LStoreExternals.cmake
+++ cmake/LStoreExternals.cmake
@@ -1,5 +1,5 @@
 include(ExternalProject)
-if(BUILD_APR)
+if(BUILD_APR AND (NOT APR_FOUND OR NOT APU_FOUND))
     list(APPEND REBUILD_DEPENDENCIES extern-apr-accre)
     set(APR_LIBRARY "apr-ACCRE-1")
     set(APR_INCLUDE_DIR "${EXTERNAL_INSTALL_DIR}/include/apr-ACCRE-1")


Set CPACK_DEBIAN_PACKAGE_ARCHITECTURE instead of CPACK_DEBIAN_ARCHITECTURE

Because that's the variable actually used by CPack.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -20,21 +20,21 @@

 #arch
 if(X86)
-  set(CPACK_DEBIAN_ARCHITECTURE "i386")
+  set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
   set(CPACK_RPM_PACKAGE_ARCHITECTURE "i686")
 elseif(X86_64)
-  set(CPACK_DEBIAN_ARCHITECTURE "amd64")
+  set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
   set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
 elseif(ARM)
-  set(CPACK_DEBIAN_ARCHITECTURE "armhf")
+  set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "armhf")
   set(CPACK_RPM_PACKAGE_ARCHITECTURE "armhf")
 else()
-  set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
+  set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
   set(CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
 endif()

 if(CPACK_GENERATOR STREQUAL "DEB")
-  set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_ARCHITECTURE})
+  set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
 elseif(CPACK_GENERATOR STREQUAL "RPM")
   set(OPENCV_PACKAGE_ARCH_SUFFIX ${CPACK_RPM_PACKAGE_ARCHITECTURE})
 else()


Adjusted ThirdPartyPETSc.cmake for build-specific third-party.

--- cmake/ThirdPartyPETSc.cmake
+++ cmake/ThirdPartyPETSc.cmake
@@ -26,24 +26,28 @@
         EXTERNALPROJECT_ADD(
             petsc-3.5.1
             PREFIX ${TPSRC}
-            BINARY_DIR ${TPSRC}/src/petsc-3.5.1
-            URL http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-lite-3.5.1.tar.gz
+            STAMP_DIR ${TPBUILD}/stamp
+            DOWNLOAD_DIR ${TPSRC}
+            SOURCE_DIR ${TPBUILD}/petsc-3.5.1
+            TMP_DIR ${TPBUILD}/petsc-3.5.1-tmp
+            INSTALL_DIR ${TPDIST}
+            BINARY_DIR ${TPBUILD}/petsc-3.5.1
+            URL http://www.nektar.info/thirdparty/petsc-lite-3.5.1.tar.gz
             URL_MD5 "539b3bdb627407b7e4e9e830fd5ccf43"
-            DOWNLOAD_DIR ${TPSRC}
             CONFIGURE_COMMAND ./configure
                 --with-cc=${PETSC_C_COMPILER}
                 --with-cxx=${PETSC_CXX_COMPILER}
                 --with-shared-libraries=0
                 --with-pic=1
                 --with-x=0
-                --prefix=${TPSRC}/dist
+                --prefix=${TPDIST}
                 --with-petsc-arch=c-opt
                 --with-fc=0
                 ${PETSC_NO_MPI}
                 )

-        INCLUDE_DIRECTORIES(${TPSRC}/dist/include)
-        SET(PETSC_LIBRARIES "${TPSRC}/dist/lib/libpetsc.a")
+        INCLUDE_DIRECTORIES(${TPDIST}/include)
+        SET(PETSC_LIBRARIES "${TPDIST}/lib/libpetsc.a")
         MESSAGE(STATUS "Build PETSc: ${PETSC_LIBRARIES}")
     ELSE (THIRDPARTY_BUILD_PETSC)
         INCLUDE(FindPETSc)


Trivial: Fix for CMake generator differences

--- cmake/build-info-file.cmake
+++ cmake/build-info-file.cmake
@@ -7,7 +7,7 @@
 set (_buildInfoFile "${CMAKE_BINARY_DIR}/build-info.txt")

 find_package(Git)
-if(Git_FOUND)
+if(Git_FOUND OR GIT_FOUND)
     set(_gitCommand "${GIT_EXECUTABLE}" "log" "-n1" "--pretty=format:Git commit: %H %ci%n")
 else()
     set(_gitCommand "${CMAKE_COMMAND}" "-E" "echo" "Git commit: (undetermined)")
@@ -16,7 +16,8 @@
 add_custom_command(
     OUTPUT "${_buildInfoFile}"
     COMMAND ${_gitCommand} ">" "${_buildInfoFile}"
-    COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Build type: $<CONFIG>" ">>" "${_buildInfoFile}"
+    COMMAND "${CMAKE_COMMAND}" "-E" "echo" "Build type: $<CONFIG>${CMAKE_BUILD_TYPE}" ">>" "${_buildInfoFile}"
+    WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
     COMMENT "Generating build information file"
     VERBATIM
 )


[lldb] Set component when invoking add_llvm_install_targets

This is needed to ensure that the distribution and install-distribution
targets work properly.

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

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

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -67,7 +67,8 @@
       endif()
       if (NOT CMAKE_CONFIGURATION_TYPES)
         add_llvm_install_targets(install-${name}
-                                 DEPENDS ${name})
+                                 DEPENDS ${name}
+                                 COMPONENT ${name})
       endif()
     endif()
   endif()
@@ -134,7 +135,8 @@
           RUNTIME DESTINATION bin)
     if (NOT CMAKE_CONFIGURATION_TYPES)
       add_llvm_install_targets(install-${name}
-                               DEPENDS ${name})
+                               DEPENDS ${name}
+                               COMPONENT ${name})
     endif()
   endif()


[CMake] Allow LLVM_TOOLCHAIN_TOOLS to be overridden

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -640,11 +640,12 @@
   endif()
 endfunction()

-
-set (LLVM_TOOLCHAIN_TOOLS
-  llvm-ar
-  llvm-objdump
-  )
+if(NOT LLVM_TOOLCHAIN_TOOLS)
+  set (LLVM_TOOLCHAIN_TOOLS
+    llvm-ar
+    llvm-objdump
+    )
+endif()

 macro(add_llvm_tool name)
   if( NOT LLVM_BUILD_TOOLS )


[CMake] Refactor subdirectory inclusion code to take a project name.

Summary:
This refactoring makes some of the code used to control including subdirectories parameterized so it can be re-used elsewhere.

Specifically I want to re-use this code in clang to be able to turn off specific tool subdirectories.

Reviewers: chapuni, filcab, bogner, Bigcheese

Subscribers: emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D13783

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -730,52 +730,59 @@
   set(${output} "${nameUPPER}" PARENT_SCOPE)
 endfunction(canonicalize_tool_name)

+# Custom add_subdirectory wrapper
+# Takes in a project name (i.e. LLVM), the the subdirectory name, and an
+# and an optional path if it differs from the name.
+macro(add_llvm_subdirectory project type name)
+  set(add_llvm_external_dir "${ARGN}")
+  if("${add_llvm_external_dir}" STREQUAL "")
+    set(add_llvm_external_dir ${name})
+  endif()
+  canonicalize_tool_name(${name} nameUPPER)
+  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}/CMakeLists.txt)
+    # Treat it as in-tree subproject.
+    option(${project}_${type}_${nameUPPER}_BUILD
+           "Whether to build ${name} as part of ${project}" On)
+    mark_as_advanced(${project}_${type}_${name}_BUILD)
+    if(${project}_${type}_${nameUPPER}_BUILD)
+      add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir} ${add_llvm_external_dir})
+      # Don't process it in add_llvm_implicit_projects().
+      set(${project}_${type}_${nameUPPER}_BUILD OFF)
+    endif()
+  else()
+    set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR
+      "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}"
+      CACHE PATH "Path to ${name} source directory")
+    set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT ON)
+    if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR OR NOT EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
+      set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT OFF)
+    endif()
+    if("${LLVM_EXTERNAL_${nameUPPER}_BUILD}" STREQUAL "OFF")
+      set(${project}_${type}_${nameUPPER}_BUILD_DEFAULT OFF)
+    endif()
+    option(${project}_${type}_${nameUPPER}_BUILD
+      "Whether to build ${name} as part of LLVM"
+      ${${project}_${type}_${nameUPPER}_BUILD_DEFAULT})
+    if (${project}_${type}_${nameUPPER}_BUILD)
+      if(EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
+        add_subdirectory(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} ${add_llvm_external_dir})
+      elseif(NOT "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}" STREQUAL "")
+        message(WARNING "Nonexistent directory for ${name}: ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}")
+      endif()
+      # FIXME: It'd be redundant.
+      set(${project}_${type}_${nameUPPER}_BUILD Off)
+    endif()
+  endif()
+endmacro()
+
 # Add external project that may want to be built as part of llvm such as Clang,
 # lld, and Polly. This adds two options. One for the source directory of the
 # project, which defaults to ${CMAKE_CURRENT_SOURCE_DIR}/${name}. Another to
 # enable or disable building it with everything else.
 # Additional parameter can be specified as the name of directory.
 macro(add_llvm_external_project name)
-  set(add_llvm_external_dir "${ARGN}")
-  if("${add_llvm_external_dir}" STREQUAL "")
-    set(add_llvm_external_dir ${name})
-  endif()
-  canonicalize_tool_name(${name} nameUPPER)
-  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}/CMakeLists.txt)
-    # Treat it as in-tree subproject.
-    option(LLVM_TOOL_${nameUPPER}_BUILD
-           "Whether to build ${name} as part of LLVM" On)
-    mark_as_advanced(LLVM_TOOL_${name}_BUILD)
-    if(LLVM_TOOL_${nameUPPER}_BUILD)
-      add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir} ${add_llvm_external_dir})
-      # Don't process it in add_llvm_implicit_projects().
-      set(LLVM_TOOL_${nameUPPER}_BUILD OFF)
-    endif()
-  else()
-    set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR
-      "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}"
-      CACHE PATH "Path to ${name} source directory")
-    set(LLVM_TOOL_${nameUPPER}_BUILD_DEFAULT ON)
-    if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR OR NOT EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
-      set(LLVM_TOOL_${nameUPPER}_BUILD_DEFAULT OFF)
-    endif()
-    if("${LLVM_EXTERNAL_${nameUPPER}_BUILD}" STREQUAL "OFF")
-      set(LLVM_TOOL_${nameUPPER}_BUILD_DEFAULT OFF)
-    endif()
-    option(LLVM_TOOL_${nameUPPER}_BUILD
-      "Whether to build ${name} as part of LLVM"
-      ${LLVM_TOOL_${nameUPPER}_BUILD_DEFAULT})
-    if (LLVM_TOOL_${nameUPPER}_BUILD)
-      if(EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR})
-        add_subdirectory(${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR} ${add_llvm_external_dir})
-      elseif(NOT "${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}" STREQUAL "")
-        message(WARNING "Nonexistent directory for ${name}: ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}")
-      endif()
-      # FIXME: It'd be redundant.
-      set(LLVM_TOOL_${nameUPPER}_BUILD Off)
-    endif()
-  endif()
-endmacro(add_llvm_external_project)
+  add_llvm_subdirectory(LLVM TOOL ${name})
+endmacro()

 macro(add_llvm_tool_subdirectory name)
   add_llvm_external_project(${name})
@@ -791,16 +798,20 @@
   endif()
 endfunction()

-function(create_llvm_tool_options)
+function(create_subdirectory_options project type)
   file(GLOB sub-dirs "${CMAKE_CURRENT_SOURCE_DIR}/*")
   foreach(dir ${sub-dirs})
     if(IS_DIRECTORY "${dir}" AND EXISTS "${dir}/CMakeLists.txt")
       canonicalize_tool_name(${dir} name)
-      option(LLVM_TOOL_${name}_BUILD
-           "Whether to build ${name} as part of LLVM" On)
-      mark_as_advanced(LLVM_TOOL_${name}_BUILD)
+      option(${project}_${type}_${name}_BUILD
+           "Whether to build ${name} as part of ${project}" On)
+      mark_as_advanced(${project}_${type}_${name}_BUILD)
     endif()
   endforeach()
+endfunction(create_subdirectory_options)
+
+function(create_llvm_tool_options)
+  create_subdirectory_options(LLVM TOOL)
 endfunction(create_llvm_tool_options)

 function(add_llvm_implicit_projects)


Add SWIG_FOUND and PERL_FOUND to summary.

svn path=/trunk/; revision=6980

--- cmake/modules/summary.cmake
+++ cmake/modules/summary.cmake
@@ -21,9 +21,11 @@

 macro(summary)
 set(_output_results "
-Important CMake options:
+Important CMake results:

 CMAKE_SYSTEM_NAME:	${CMAKE_SYSTEM_NAME}
+SWIG_FOUND:		${SWIG_FOUND}
+PERL_FOUND:		${PERL_FOUND}
 X11_FOUND:		${X11_FOUND}
 CMAKE_INSTALL_PREFIX:	${CMAKE_INSTALL_PREFIX}
 CMAKE_BUILD_TYPE:	${CMAKE_BUILD_TYPE}


fixing pathing for roslaunch-check.py

fixing pathing for roslaunch-check.py

--- core/rosbuild/private.cmake
+++ core/rosbuild/private.cmake
@@ -289,7 +289,7 @@

   # Create target for this test
   add_custom_target(roslaunch_check_${_testname}
-                    COMMAND ${rosunit_path}/bin/roslaunch-check.py ${file} ${ARGN}
+                    COMMAND ${rostest_path}/bin/roslaunch-check.py ${file} ${ARGN}
                     DEPENDS ${file}
                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                     VERBATIM)


Refactored the TNUN_add_link_options() function to (ab)use the link_libraries() function to avoid cache polution. Added more documentation links.

--- build_options.cmake
+++ build_options.cmake
@@ -6,6 +6,8 @@
 #
 ################################################################################

+# http://www.cmake.org/Wiki/CMake_Cross_Compiling
+# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html
 # http://stackoverflow.com/questions/12802377/in-cmake-how-can-i-find-the-directory-of-an-included-file
 if ( WIN32 )
     include( "${CMAKE_CURRENT_LIST_DIR}/toolchains/msvc.toolchain.cmake" )
@@ -32,6 +34,7 @@
     # https://cmake.org/pipermail/cmake-developers/2012-August/016617.html
     # http://stackoverflow.com/a/35361099/6041906
     #                                         (14.05.2016.) (Domagoj Saric)
+    string( TOUPPER ${configuration} configuration )
     foreach( arg ${ARGN} )
         add_compile_options( $<$<CONFIG:${configuration}>:${arg}> )
     endforeach()
@@ -46,12 +49,14 @@
 #
 ################################################################################

-function( TNUN_add_link_options configuration options )
+function( TNUN_add_link_options configuration )
     # Implementation note:
-    # Function for symmetry/consistency with the TNUN_add_compile_options()
-    # function (with a major the difference: this function accepts a single
-    # string of options as opposed to a list).
-    #                                         (24.05.2016.) (Domagoj Saric)
+    # The documented feature of link_libraries(), that it also accepts linker
+    # options, is (ab)used here to simulate add_compile_options() behaviour.
+    # https://cmake.org/cmake/help/latest/prop_tgt/LINK_LIBRARIES.html
+    #                                         (01.06.2016.) (Domagoj Saric)
     string( TOUPPER ${configuration} configuration )
-    set( CMAKE_EXE_LINKER_FLAGS_${configuration} "${CMAKE_EXE_LINKER_FLAGS_${configuration}} ${options}" PARENT_SCOPE )
+    foreach( arg ${ARGN} )
+        link_libraries( $<$<CONFIG:${configuration}>:${arg}> )
+    endforeach()
 endfunction()


Update the tag to build

Update the tag to build

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- versions.cmake
+++ versions.cmake
@@ -102,7 +102,7 @@
   # Download tomviz from GIT
   add_customizable_revision(tomviz
     GIT_REPOSITORY https://github.com/openchemistry/tomviz.git
-    GIT_TAG "1.6.0")
+    GIT_TAG "1.8.0")
 else()
   if (tomviz_FROM_SOURCE_DIR)
     add_customizable_revision(tomviz


Add Windows branch for FindMKL Library path detection

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -19,7 +19,6 @@

 # Stage 2: find include path and libraries
-
 if (MKLROOT_PATH)
     # root-path found

@@ -38,6 +37,14 @@
             set(EXPECT_MKL_LIBPATH "${MKLROOT_PATH}/lib/ia32")
         endif (CMAKE_SIZEOF_VOID_P MATCHES 8)
     endif (CMAKE_SYSTEM_NAME MATCHES "Linux")
+
+	 if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+        if (CMAKE_SIZEOF_VOID_P MATCHES 8)
+            set(EXPECT_MKL_LIBPATH "${MKLROOT_PATH}\\lib\\intel64")
+        else (CMAKE_SIZEOF_VOID_P MATCHES 8)
+            set(EXPECT_MKL_LIBPATH "${MKLROOT_PATH}\\lib\\ia32")
+        endif (CMAKE_SIZEOF_VOID_P MATCHES 8)
+    endif (CMAKE_SYSTEM_NAME MATCHES "Windows")

     # set include


more paths to find qwt

more paths to find qwt

--- cmake/FindQwt.cmake
+++ cmake/FindQwt.cmake
@@ -40,13 +40,14 @@
   /usr/local/qwt/include
   /usr/local/include
   /opt/qwt/include
+  /opt/qwt-qt5/include
   /usr/include/qwt
   /usr/include/qt5/qwt
   /usr/include)

 find_library(QWT_LIBRARY
   NAMES ${QWT_NAMES}
-  PATHS /opt/qwt/lib /usr/local/qwt/lib /usr/local/lib /usr/lib)
+  PATHS /opt/qwt/lib /opt/qwt-qt5/lib /usr/local/qwt/lib /usr/local/lib /usr/lib)

 if(QWT_INCLUDE_DIR AND QWT_LIBRARY)
   set(QWT_LIBRARIES ${QWT_LIBRARY})


[Build] Fix: SIP_LIBRARIES with x86_64-linux-gnu suffix Debian Stretch, CMake 3.7.2

--- cmake/FindSIP.cmake
+++ cmake/FindSIP.cmake
@@ -150,7 +150,7 @@
 	SET(CMAKE_FIND_LIBRARY_PREFIXES "")
 	IF(SIP_MOD_DIR)
 		FIND_LIBRARY(SIP_LIBRARIES
-			NAMES sip libsip
+			NAMES sip libsip sip.x86_64-linux-gnu
 			PATHS ${SIP_MOD_DIR}
 			PATH_SUFFIXES lib dlls
 			NO_DEFAULT_PATH
@@ -158,7 +158,7 @@
 		SET(CMAKE_FIND_LIBRARY_PREFIXES "${OLD_CMAKE_FIND_LIBRARY_PREFIXES}")
 	ELSE()
 		FIND_LIBRARY(SIP_LIBRARIES
-			NAMES sip libsip
+			NAMES sip libsip sip.x86_64-linux-gnu
 			PATHS ${SIP_POSSIBLE_LIB_DIRS} ${PYTHON_SITE_PACKAGES}
 			PATH_SUFFIXES lib dlls
 			DOC "SIP module")


Updated FindTBB to prioritise newer TBB versions and print a warning if multiple are found

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -162,26 +162,44 @@
   ${SYSTEM_LIBRARY_PATHS}
 )

-# Look for a standard tbb header file.
-find_path(Tbb_INCLUDE_DIR tbb/tbb_stddef.h
-  ${_FIND_TBB_ADDITIONAL_OPTIONS}
-  PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
-  PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
-)
-
-set(_tbb_version_file "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h")
-
-if(NOT EXISTS ${_tbb_version_file})
-  # From TBB 2021, tbb_stddef is removed and the directory include/tbb is
-  # simply an alias for include/oneapi/tbb. Try and find the version header
-  # in oneapi/tbb
-  find_path(Tbb_INCLUDE_DIR oneapi/tbb/version.h
+if(NOT Tbb_INCLUDE_DIR)
+  # Look for a legacy tbb header file.
+  find_path(Tbb_LEGACY_INCLUDE_DIR tbb/tbb_stddef.h
     ${_FIND_TBB_ADDITIONAL_OPTIONS}
     PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
     PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
   )
-  set(_tbb_version_file "${Tbb_INCLUDE_DIR}/oneapi/tbb/version.h")
-endif()
+endif()
+
+# Look for a new tbb header installation
+# From TBB 2021, tbb_stddef is removed and the directory include/tbb is
+# simply an alias for include/oneapi/tbb. Try and find the version header
+# in oneapi/tbb
+find_path(Tbb_INCLUDE_DIR oneapi/tbb/version.h
+  ${_FIND_TBB_ADDITIONAL_OPTIONS}
+  PATHS ${_TBB_INCLUDE_SEARCH_DIRS}
+  PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
+)
+
+set(_tbb_legacy_version_file "${Tbb_LEGACY_INCLUDE_DIR}/tbb/tbb_stddef.h")
+set(_tbb_version_file "${Tbb_INCLUDE_DIR}/oneapi/tbb/version.h")
+
+if(EXISTS ${_tbb_legacy_version_file})
+  if(EXISTS ${_tbb_version_file})
+    message(WARNING "
+      FindTBB located both an old and new tbb installation.
+          old: ${_tbb_legacy_version_file}
+          new: ${_tbb_version_file}
+      The NEWER versioned installation will be used. You can set TBB_INCLUDEDIR
+      to control FindTBB.cmake search, or explicitly set Tbb_INCLUDE_DIR to the
+      desired location.
+      ")
+  else()
+    set(_tbb_version_file "${_tbb_legacy_version_file}")
+    set(Tbb_INCLUDE_DIR ${Tbb_LEGACY_INCLUDE_DIR} CACHE STRING "" FORCE)
+  endif()
+endif()
+

 if(EXISTS ${_tbb_version_file})
   file(STRINGS ${_tbb_version_file}
@@ -207,6 +225,8 @@
 endif()

 unset(_tbb_version_file)
+unset(_tbb_legacy_version_file)
+unset(Tbb_LEGACY_INCLUDE_DIR)

 # ------------------------------------------------------------------------
 #  Search for TBB lib DIR


Fix Op.cmake to work on OS X

Fix Op.cmake to work on OS X

--- cmake/Util/Op.cmake
+++ cmake/Util/Op.cmake
@@ -46,7 +46,14 @@
       OUTPUT_VARIABLE SCANNER_LIB_PATH
       COMMAND
       python3 -c "import scannerpy.stdlib.build_flags as b; b.print_lib()")
-    target_link_libraries(${args_LIB_NAME} PUBLIC "${SCANNER_LIB_PATH}/libscanner.so")
+
+    if(APPLE)
+      target_link_libraries(${args_LIB_NAME} PUBLIC
+        "${SCANNER_LIB_PATH}/libscanner.dylib")
+    else()
+      target_link_libraries(${args_LIB_NAME} PUBLIC
+        "${SCANNER_LIB_PATH}/libscanner.so")
+    endif()

     execute_process(
       OUTPUT_VARIABLE BUILD_FLAGS


Set Verbs.MTU and Verbs.INLINE for QPACE2

Set MTU=2048 and INLINE=256.

These seem to be a good first guess for ConnectIB.

More general we for now use:
MTU=2048 INLINE=256 for ConnectIB and ConnectX4 or newer.
MTU=1024 INLINE=128 for older ConnectX.

For non Mellanox hardware reasonable values are unknown.

--- cmake/cluster.cmake
+++ cmake/cluster.cmake
@@ -22,6 +22,8 @@
     set(PROVIDER.LOOP ON)
     set(PROVIDER.SCIF ON)
     set(PROVIDER.VERBS ON)
+    set(VERBS.MTU 2048)
+    set(VERBS.INLINE 256)
     set(ALLREDUCE "RECURSIVEDOUBLING")
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/clusters/qpaceb)


ENH: Typesetting CMake

ENH: Typesetting CMake

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -92,16 +92,16 @@
 endif(NOT APPLE)

 function(merge_static_libs TARGET_NAME)
-	set(libs ${ARGN})
-	list(REMOVE_DUPLICATES libs)
-
-	# First get the file names of the libraries to be merged
-	foreach(lib ${libs})
-		get_target_property(libtype ${lib} TYPE)
-		if(NOT libtype STREQUAL "STATIC_LIBRARY")
-			message(FATAL_ERROR "merge_static_libs can only process static libraries")
-		endif()
-		set(libfiles ${libfiles} $<TARGET_FILE:${lib}>)
+  set(libs ${ARGN})
+  list(REMOVE_DUPLICATES libs)
+
+  # First get the file names of the libraries to be merged
+  foreach(lib ${libs})
+    get_target_property(libtype ${lib} TYPE)
+    if(NOT libtype STREQUAL "STATIC_LIBRARY")
+      message(FATAL_ERROR "merge_static_libs can only process static libraries")
+    endif()
+    set(libfiles ${libfiles} $<TARGET_FILE:${lib}>)
   endforeach()

   if(APPLE) # Use OSX's libtool to merge archives


Deploying the runtime, archive and library outputs to proper folders

--- cmake/options.cmake
+++ cmake/options.cmake
@@ -30,3 +30,7 @@

 set(CMAKE_INCLUDE_DIRS_CONFIGCMAKE "${CMAKE_INSTALL_PREFIX}/include")
 set(CMAKE_LIB_DIRS_CONFIGCMAKE     "${CMAKE_INSTALL_PREFIX}/lib")
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)


Package name now always contains arch and platform

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -54,7 +54,7 @@
 ##############################################################

 set(CPACK_PACKAGE_NAME "OSPRay")
-set(CPACK_PACKAGE_FILE_NAME "ospray-${OSPRAY_VERSION}")
+set(CPACK_PACKAGE_FILE_NAME "ospray-${OSPRAY_VERSION}.x86_64")
 #set(CPACK_PACKAGE_ICON ${PROJECT_SOURCE_DIR}/ospray-doc/images/icon.png)
 #set(CPACK_PACKAGE_RELOCATABLE TRUE)
 set(CPACK_STRIP_FILES TRUE) # do not disable, stripping symbols is important for security reasons
@@ -111,9 +111,10 @@
     message(FATAL_ERROR "Only 64bit architecture supported.")
   endif()

+  set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.windows")
+
   if (OSPRAY_ZIP_MODE)
     set(CPACK_GENERATOR ZIP)
-    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.windows")
   else()
     set(CPACK_GENERATOR WIX)
     set(CPACK_WIX_ROOT_FEATURE_DESCRIPTION "OSPRay is an open source, scalable, and portable ray tracing engine for high-performance, high-fidelity visualization.")
@@ -132,14 +133,13 @@

   configure_file(${PROJECT_SOURCE_DIR}/README.md ${PROJECT_BINARY_DIR}/ReadMe.txt COPYONLY)
   set(CPACK_RESOURCE_FILE_README ${PROJECT_BINARY_DIR}/ReadMe.txt)
+  set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.macosx")

   if (OSPRAY_ZIP_MODE)
     set(CPACK_GENERATOR ZIP)
-    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")
   else()
     set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
     set(CPACK_GENERATOR productbuild)
-    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64")
     set(CPACK_PACKAGE_NAME ospray-${OSPRAY_VERSION})
     set(CPACK_PACKAGE_VENDOR "intel") # creates short name com.intel.ospray.xxx in pkgutil
   endif()
@@ -147,9 +147,10 @@

 else() # Linux specific settings

+  set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.linux")
+
   if (OSPRAY_ZIP_MODE)
     set(CPACK_GENERATOR TGZ)
-    set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")
   else()
     set(CPACK_GENERATOR RPM)
     set(CPACK_RPM_COMPONENT_INSTALL ON)


boost.cmake: For now, only build one boost library (boost-python), because that's all ilastik needs.

--- boost.cmake
+++ boost.cmake
@@ -33,6 +33,7 @@
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
     CONFIGURE_COMMAND   ${FLYEM_ENV_STRING} ./bootstrap.sh
+        --with-libraries=python
         --with-python=${PYTHON_EXE}
         --prefix=${FLYEM_BUILD_DIR}
         LDFLAGS=${FLYEM_LDFLAGS}


Add "Visual Studio 15 2017" support.

Add "Visual Studio 15 2017" support.

--- conan.cmake
+++ conan.cmake
@@ -82,6 +82,8 @@
           set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=12)
       elseif (MSVC_VERSION EQUAL 1900)
           set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=14)
+      elseif (MSVC_VERSION EQUAL 1910)
+          set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=15)
       else ()
           message(FATAL_ERROR "Visual Studio not recognized")
       endif()


FIX: Resolve issues with build on OS X where resources and libs would not get put into the debug app bundles with the _d suffix (but would overwite the release versions), and /all/ versions of the libs could be copied into release versions of the app bundles (without the _d suffix).  Resolves: http://www.cegui.org.uk/mantis/view.php?id=513

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -261,7 +261,7 @@
     endif()

     if (${_INSTALL_HEADERS} AND UNIX AND NOT APPLE AND NOT WIN32)
-        string (REPLACE "cegui/src" "" _REL_HEADER_DIR ${_REL_SRC_DIR})
+        string (REPLACE "cegui/src/" "" _REL_HEADER_DIR ${_REL_SRC_DIR})
         install(FILES ${${_HEADER_FILES_VAR}} DESTINATION "${CEGUI_INCLUDE_INSTALL_DIR}/${CMAKE_PROJECT_NAME}/${_REL_HEADER_DIR}")
     endif()
 endmacro()
@@ -297,29 +297,41 @@
         set (_ACTIONMSG "copies of")
     endif()

-    file (REMOVE_RECURSE
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
-    )
-    file (MAKE_DIRECTORY
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
-    )
+    # depending on the generator used, we need to examine different things to discover the build type
+    if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+        set(_CEGUI_BUILD_CONFIG ${CMAKE_BUILD_TYPE})
+    else()
+        set(_CEGUI_BUILD_CONFIG "$(CONFIGURATION)")
+    endif()
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; rm -rf \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks\"
+        COMMENT "Removing old Frameworks in ${_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; rm -rf \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources\"
+        COMMENT "Removing old Resources in ${_TARGET_NAME}.app")
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; mkdir -p \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks\"
+        COMMENT "Creating Frameworks directory ${_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; mkdir -p \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources\"
+        COMMENT "Creating Resources directory ${_TARGET_NAME}.app")

     if (NOT ${_STATIC})
         if (NOT CEGUI_BUILD_SHARED_LIBS_WITH_STATIC_DEPENDENCIES)
             add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-                COMMAND ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+                COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/dynamic/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"
                 COMMENT "Creating ${_ACTIONMSG} dependency libraries in ${_TARGET_NAME}.app")
         endif()

         add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-            COMMAND ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+            COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; ce_libglob=\"*${CEGUI_BUILD_SUFFIX}.dylib\"\; else ce_ext=\"\"\; shopt -s extglob\; ce_libglob=\"!\(*${CEGUI_BUILD_SUFFIX}\).dylib\"\; fi\; ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$$ce_libglob \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Frameworks/\"
             COMMENT "Creating ${_ACTIONMSG} built cegui libraries in ${_TARGET_NAME}.app")
     endif()

     add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
-        COMMAND ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources/
+        COMMAND if [ x${_CEGUI_BUILD_CONFIG} == xDebug ]\; then ce_ext=\"${CEGUI_BUILD_SUFFIX}\"\; else ce_ext=\"\"\; fi\; ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}$$ce_ext.app/Contents/Resources/\"
         COMMENT "Creating ${_ACTIONMSG} sample datafiles ${_TARGET_NAME}.app")
 endmacro()


Remove half dependency from our exported cmake rules.

Signed-off-by: jlait <81974a1ed0c0d66870f9fb02ff829ce3f8e53fdd@andorra.sidefx.com>

--- cmake/FindOpenVDB.cmake
+++ cmake/FindOpenVDB.cmake
@@ -448,7 +448,6 @@

 # Add standard dependencies

-find_package(IlmBase REQUIRED COMPONENTS Half)
 find_package(TBB REQUIRED COMPONENTS tbb)
 find_package(ZLIB REQUIRED)

@@ -612,7 +611,6 @@
   # @note OPENVDB_OPENEXR_STATICLIB is old functionality from the makefiles
   #       used in PlatformConfig.h to configure EXR exports. Once this file
   #       is completely removed, this define can be too
-  get_target_property(ILMBASE_LIB_TYPE IlmBase::Half TYPE)
   if(OPENEXR_USE_STATIC_LIBS OR (${ILMBASE_LIB_TYPE} STREQUAL STATIC_LIBRARY))
     list(APPEND OpenVDB_DEFINITIONS OPENVDB_OPENEXR_STATICLIB)
   endif()
@@ -627,7 +625,6 @@
 set(_OPENVDB_VISIBLE_DEPENDENCIES
   Boost::iostreams
   Boost::system
-  IlmBase::Half
 )

 if(OpenVDB_ABI)


wrap the windows part in a condition

wrap the windows part in a condition

--- cmake/get-tinyxml.cmake
+++ cmake/get-tinyxml.cmake
@@ -8,18 +8,25 @@

 set(TINYXML_VERSION "2.6.2")

-ExternalProject_Add(
-  tinyxml
-  PREFIX                ${DEPENDENCY_EXTRACT_DIR}
-  DOWNLOAD_DIR          ${DEPENDENCY_DOWNLOAD_DIR}
-  DOWNLOAD_NAME         tinyxml-v${TINYXML_VERSION}.zip
-  URL                   http://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.zip/download
-  URL_MD5               2a0aaf609c9e670ec9748cd01ed52dae
-  PATCH_COMMAND         ${CMAKE_COMMAND} -E copy ${CMAKE_MODULE_PATH}/patches/tinyxml/CMakeLists.txt  ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml
-  INSTALL_COMMAND       ${CMAKE_COMMAND} -E make_directory ${DEPENDENCY_INSTALL_DIR}/include/tinyxml
-    COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/Release/tinyxml.dll  ${DEPENDENCY_INSTALL_DIR}/bin/tinyxml.dll
-    COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/Release/tinyxml.lib  ${DEPENDENCY_INSTALL_DIR}/lib/tinyxml.lib
-    COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml/tinystr.h                  ${DEPENDENCY_INSTALL_DIR}/include/tinyxml/tinystr.h
-    COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml/tinyxml.h                  ${DEPENDENCY_INSTALL_DIR}/include/tinyxml/tinyxml.h
-
-)+if (WIN32)
+
+  ExternalProject_Add(
+    tinyxml
+    PREFIX                ${DEPENDENCY_EXTRACT_DIR}
+    DOWNLOAD_DIR          ${DEPENDENCY_DOWNLOAD_DIR}
+    DOWNLOAD_NAME         tinyxml-v${TINYXML_VERSION}.zip
+    URL                   http://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.zip/download
+    URL_MD5               2a0aaf609c9e670ec9748cd01ed52dae
+    PATCH_COMMAND         ${CMAKE_COMMAND} -E copy ${CMAKE_MODULE_PATH}/patches/tinyxml/CMakeLists.txt  ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml
+    INSTALL_COMMAND       ${CMAKE_COMMAND} -E make_directory ${DEPENDENCY_INSTALL_DIR}/include/tinyxml
+      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/Release/tinyxml.dll  ${DEPENDENCY_INSTALL_DIR}/bin/tinyxml.dll
+      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml-build/Release/tinyxml.lib  ${DEPENDENCY_INSTALL_DIR}/lib/tinyxml.lib
+      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml/tinystr.h                  ${DEPENDENCY_INSTALL_DIR}/include/tinyxml/tinystr.h
+      COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml/tinyxml.h                  ${DEPENDENCY_INSTALL_DIR}/include/tinyxml/tinyxml.h
+  )
+
+else() # build from source
+
+ # TODO
+
+endif()


GNATMAKE_EXECUTABLE no longer used directly now that add_executable works
for the Ada language.

svn path=/trunk/; revision=7388

--- cmake/modules/ada.cmake
+++ cmake/modules/ada.cmake
@@ -22,15 +22,6 @@
 option(ENABLE_ada "Enable Ada bindings" OFF)

 if(ENABLE_ada)
-  find_program(GNATMAKE_EXECUTABLE gnatmake)
-  if(NOT GNATMAKE_EXECUTABLE)
-    message(STATUS "WARNING: "
-      "gnatmake not found. Disabling ada bindings")
-      set(ENABLE_ada OFF CACHE BOOL "Enable Ada bindings" FORCE)
-  endif(NOT GNATMAKE_EXECUTABLE)
-endif(ENABLE_ada)
-
-if(ENABLE_ada)
   find_library(GNAT_LIB gnat)
   if(NOT GNAT_LIB)
     message(STATUS "WARNING: "


adding the debug postfix for tools and demos executables for MSVC

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@1038 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -112,7 +112,7 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+      set_target_properties(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF DEBUG_OUTPUT_NAME ${_name}${CMAKE_DEBUG_POSTFIX})
     elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
       set_target_properties(${_name} PROPERTIES LINK_FLAGS -Wl)
     else()


Fix for OpenImageIO not being found on some linux systems.

--- src/cmake/oiio.cmake
+++ src/cmake/oiio.cmake
@@ -14,9 +14,13 @@

 find_library ( OPENIMAGEIO_LIBRARY
                NAMES OpenImageIO
+               HINTS ${OPENIMAGEIOHOME}
+               PATH_SUFFIXES lib64 lib
                PATHS ${OPENIMAGEIOHOME}/lib )
-find_path ( OPENIMAGEIO_INCLUDES OpenImageIO/imageio.h
-            ${OPENIMAGEIOHOME}/include )
+find_path ( OPENIMAGEIO_INCLUDES
+            NAMES OpenImageIO/imageio.h
+            HINTS ${OPENIMAGEIOHOME}
+            PATH_SUFFIXES include )
 IF (OPENIMAGEIO_INCLUDES AND OPENIMAGEIO_LIBRARY )
     SET ( OPENIMAGEIO_FOUND TRUE )
     MESSAGE ( STATUS "OpenImageIO includes = ${OPENIMAGEIO_INCLUDES}" )


Fixed android SDK version, now using variable.

--- client/Android/aFreeRDP/AndroidManifest.xml.cmake
+++ client/Android/aFreeRDP/AndroidManifest.xml.cmake
@@ -6,7 +6,7 @@
 	android:versionCode="3"
 	android:versionName="@GIT_REVISION@" >

-	<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"/>
+	<uses-sdk android:targetSdkVersion="@ANDROID_APP_TARGET_SDK@" android:minSdkVersion="@ANDROID_APP_MIN_SDK@"/>
 	<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />

 	<application android:name="com.freerdp.afreerdp.application.GlobalApp"


ENH: use strict name comparison COMP: fix warning "integer conversion resulted in a change of sign" with intel compiler

--- Wrapping/WrapITK/Python/CreateLanguageSupport.cmake
+++ Wrapping/WrapITK/Python/CreateLanguageSupport.cmake
@@ -306,7 +306,7 @@
   SET(text "${text} // Python typemaps for Smart Pointers to ${template_params} class. \n\n")
   SET(text "${text}%typemap(out) ${template_params} * {\n")
   SET(text "${text}  std::string methodName = \"\$symname\";\n")
-  SET(text "${text}  if(methodName.find(\"GetPointer\") != -1) {\n")
+  SET(text "${text}  if(methodName == \"GetPointer\") {\n")
   SET(text "${text}    // really return a pointer in that case\n")
   SET(text "${text}    \$result = SWIG_NewPointerObj((void *)(\$1), \$1_descriptor, 1);\n")
   SET(text "${text}  } else {\n")


COMP: Make ThirdParty Eigen3 COMPILE_DEPENDS

The public dependency was imposed to avoid bogus warnings
when using Eigen headers with gcc. See related:

http://eigen.tuxfamily.org/bz/show_bug.cgi?id=640
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66472

The public dependency propagates the use of the target defined in ITKEigen3_LIBRARIES
which treats Eigen3 headers as system headers, supressing these warnings.

I have not seen these warnings with the latest release of Eigen (3.3.7),
so changing it to COMPILE_DEPENDS.

--- Modules/Core/Common/itk-module.cmake
+++ Modules/Core/Common/itk-module.cmake
@@ -13,12 +13,12 @@
 itk_module(ITKCommon
   ENABLE_SHARED
   DEPENDS
-    ITKEigen3
     ITKKWIML
     ${ITKCOMMON_TBB_DEPENDS}
   PRIVATE_DEPENDS
     ITKDoubleConversion
   COMPILE_DEPENDS
+    ITKEigen3
     ITKKWSys
     ITKVNLInstantiation
   TEST_DEPENDS


adjust build to updated externals

adjust build to updated externals

--- CMake/GitExternal.cmake
+++ CMake/GitExternal.cmake
@@ -8,11 +8,9 @@
 #    update target to bump the tag to the master revision by
 #    recreating .gitexternals.
 #  * Provides function
-#      git_external(<directory> <giturl> <gittag> [NO_UPDATE, VERBOSE]
-#        [RESET <files>])
-#    which will check out directory in CMAKE_SOURCE_DIR (if relative)
-#    or in the given absolute path using the given repository and tag
-#    (commit-ish).
+#    git_external(<directory> <giturl> <gittag> [NO_UPDATE, VERBOSE]
+#      [RESET <files>])
+#  git_external_manage(<file>)
 #
 # Options which control behaviour:
 #  GIT_EXTERNAL_DISABLE_UPDATE
@@ -53,28 +51,11 @@
   if(GIT_EXTERNAL_VERBOSE)
     message(STATUS "${NAME} : ${msg}")
   endif()
-endmacro()
+endmacro(GIT_EXTERNAL_MESSAGE)

 function(GIT_EXTERNAL DIR REPO TAG)
   cmake_parse_arguments(GIT_EXTERNAL "" "" "RESET" ${ARGN})
-
-  # check if we had a previous external of the same name
-  string(REGEX REPLACE "[:/]" "_" TARGET "${DIR}")
-  get_property(OLD_TAG GLOBAL PROPERTY ${TARGET}_GITEXTERNAL_TAG)
-  if(OLD_TAG)
-    if(NOT OLD_TAG STREQUAL TAG)
-      string(REPLACE "${CMAKE_SOURCE_DIR}/" "" PWD
-        "${CMAKE_CURRENT_SOURCE_DIR}")
-      message(STATUS "${DIR}: already configured with ${OLD_TAG}, ignoring requested ${TAG} in ${PWD}")
-      return()
-    endif()
-  else()
-    set_property(GLOBAL PROPERTY ${TARGET}_GITEXTERNAL_TAG ${TAG})
-  endif()
-
-  if(NOT IS_ABSOLUTE "${DIR}")
-    set(DIR "${CMAKE_SOURCE_DIR}/${DIR}")
-  endif()
+  get_filename_component(DIR  "${DIR}" ABSOLUTE)
   get_filename_component(NAME "${DIR}" NAME)
   get_filename_component(GIT_EXTERNAL_DIR "${DIR}/.." ABSOLUTE)

@@ -99,66 +80,64 @@
       WORKING_DIRECTORY "${DIR}")
   endif()

-  if(NOT IS_DIRECTORY "${DIR}/.git")
-    message(STATUS "Can't update git external ${DIR}: Not a git repository")
-    return()
-  endif()
-
-  if(GIT_EXTERNAL_DISABLE_UPDATE)
-    git_external_message("git update disabled by user")
-    return()
-  endif()
-
-  # update to given tag
-  execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
-    OUTPUT_VARIABLE currentref OUTPUT_STRIP_TRAILING_WHITESPACE
-    WORKING_DIRECTORY ${DIR})
-  git_external_message(
-    "current ref is \"${currentref}\" and tag is \"${TAG}\"")
-  if(currentref STREQUAL TAG) # nothing to do
-    return()
-  endif()
-
-  # reset generated files
-  foreach(GIT_EXTERNAL_RESET_FILE ${GIT_EXTERNAL_RESET})
-    git_external_message("git reset -q ${GIT_EXTERNAL_RESET_FILE}")
-    execute_process(
-      COMMAND "${GIT_EXECUTABLE}" reset -q "${GIT_EXTERNAL_RESET_FILE}"
-      RESULT_VARIABLE nok ERROR_VARIABLE error
-      WORKING_DIRECTORY "${DIR}")
-    git_external_message("git checkout -q -- ${GIT_EXTERNAL_RESET_FILE}")
-    execute_process(
-      COMMAND "${GIT_EXECUTABLE}" checkout -q -- "${GIT_EXTERNAL_RESET_FILE}"
-      RESULT_VARIABLE nok ERROR_VARIABLE error
-      WORKING_DIRECTORY "${DIR}")
-  endforeach()
-
-  # fetch latest update
-  execute_process(COMMAND "${GIT_EXECUTABLE}" fetch origin -q
-    RESULT_VARIABLE nok ERROR_VARIABLE error
-    WORKING_DIRECTORY "${DIR}")
-  if(nok)
-    message(STATUS "Update of ${DIR} failed:\n   ${error}")
-  endif()
-
-  # update tag
-  git_external_message("git rebase FETCH_HEAD")
-  execute_process(COMMAND ${GIT_EXECUTABLE} rebase FETCH_HEAD
-    RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE OUTPUT
-    WORKING_DIRECTORY "${DIR}")
-  if(RESULT)
-    message(STATUS "git rebase failed, aborting ${DIR} merge")
-    execute_process(COMMAND ${GIT_EXECUTABLE} rebase --abort
-      WORKING_DIRECTORY "${DIR}")
-  endif()
-
-  # checkout requested tag
-  execute_process(
-    COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
-    RESULT_VARIABLE nok ERROR_VARIABLE error
-    WORKING_DIRECTORY "${DIR}")
-  if(nok)
-    message(STATUS "git checkout ${TAG} in ${DIR} failed: ${error}\n")
+  if(IS_DIRECTORY "${DIR}/.git")
+    if(GIT_EXTERNAL_DISABLE_UPDATE)
+      GIT_EXTERNAL_MESSAGE("git update disabled by user")
+    else()
+      execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
+        OUTPUT_VARIABLE currentref OUTPUT_STRIP_TRAILING_WHITESPACE
+        WORKING_DIRECTORY ${DIR})
+      GIT_EXTERNAL_MESSAGE(
+        "current ref is \"${currentref}\" and tag is \"${TAG}\"")
+      if(currentref STREQUAL TAG) # nothing to do
+        return()
+      endif()
+
+      # reset generated files
+      foreach(GIT_EXTERNAL_RESET_FILE ${GIT_EXTERNAL_RESET})
+        GIT_EXTERNAL_MESSAGE("git reset -q ${GIT_EXTERNAL_RESET_FILE}")
+        execute_process(
+          COMMAND "${GIT_EXECUTABLE}" reset -q "${GIT_EXTERNAL_RESET_FILE}"
+          RESULT_VARIABLE nok ERROR_VARIABLE error
+          WORKING_DIRECTORY "${DIR}")
+        GIT_EXTERNAL_MESSAGE("git checkout -q -- ${GIT_EXTERNAL_RESET_FILE}")
+        execute_process(
+          COMMAND "${GIT_EXECUTABLE}" checkout -q -- "${GIT_EXTERNAL_RESET_FILE}"
+          RESULT_VARIABLE nok ERROR_VARIABLE error
+          WORKING_DIRECTORY "${DIR}")
+      endforeach()
+
+      # fetch latest update
+      execute_process(COMMAND "${GIT_EXECUTABLE}" fetch origin -q
+        RESULT_VARIABLE nok ERROR_VARIABLE error
+        WORKING_DIRECTORY "${DIR}")
+      if(nok)
+        message(STATUS "Update of ${DIR} failed:\n   ${error}")
+      endif()
+
+      # update tag
+      GIT_EXTERNAL_MESSAGE("git rebase FETCH_HEAD")
+      execute_process(COMMAND ${GIT_EXECUTABLE} rebase FETCH_HEAD
+        RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE OUTPUT
+        WORKING_DIRECTORY "${DIR}")
+      if(RESULT)
+        message(STATUS "git rebase failed, aborting ${DIR} merge")
+        execute_process(COMMAND ${GIT_EXECUTABLE} rebase --abort
+          WORKING_DIRECTORY "${DIR}")
+      endif()
+
+      # checkout requested tag
+      execute_process(
+        COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
+        RESULT_VARIABLE nok ERROR_VARIABLE error
+        WORKING_DIRECTORY "${DIR}"
+        )
+      if(nok)
+        message(STATUS "git checkout ${TAG} in ${DIR} failed: ${error}\n")
+      endif()
+    else()
+      message(STATUS "Can't update git external ${DIR}: Not a git repository")
+    endif()
   endif()
 endfunction()


COMP: small cleanup; remove cmake messages

--- CMake/selxModules.cmake
+++ CMake/selxModules.cmake
@@ -65,10 +65,7 @@
     # Collect header files for Visual Studio
     # http://stackoverflow.com/questions/8316104/specify-how-cmake-creates-visual-studio-project
     file( GLOB ${MODULE}_HEADER_FILES "${${MODULE}_SOURCE_DIR}/include/*.*" )
-	message(STATUS "  scanning: ${${MODULE}_SOURCE_DIR}/include/*.*")
-	message(STATUS "  found: ${${MODULE}_HEADER_FILES}")
-    # Collect header files for Visual Studio
-    # http://stackoverflow.com/questions/8316104/specify-how-cmake-creates-visual-studio-project
+    # Collect interface files for Visual Studio
     file( GLOB ${MODULE}_INTERFACE_FILES "${${MODULE}_SOURCE_DIR}/interfaces/*.*" )
 	message( STATUS "  Interfaces: ${${MODULE}_INTERFACE_FILES}")
     # These variables are defined in the module's .cmake file


Corrected a typo that only affected linux, but not OSX or Windows.

--- CMakeInstallation.cmake
+++ CMakeInstallation.cmake
@@ -1,12 +1,12 @@
 #####
 # Contains variables and settings used
-# by the CMake build system in order to
+# by the CMake build system in order to
 # build binary installers.
 #####

 ###
-# Set options specific to the
+# Set options specific to the
 # Nullsoft Installation System (NSIS)
 ###

@@ -16,4 +16,4 @@
   SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
 ENDIF()

-INCLUDE(CPACK)+INCLUDE(CPack)


update to ossim r23537 until we are ready for 1.8.20-1

--- SuperBuild/CMake/External_ossim.cmake
+++ SuperBuild/CMake/External_ossim.cmake
@@ -48,58 +48,27 @@
   # archive version
   ExternalProject_Add(${proj}
     PREFIX ${proj}
-    URL "http://download.osgeo.org/ossim/source/ossim-1.8.20/ossim-1.8.20-1.tar.gz"
-    URL_MD5 19bd40f12d65c2e5b2963466dc838854
+    URL "https://www.orfeo-toolbox.org/packages/ossim-minimal-r23537.tar.gz"
+    URL_MD5 40f406c0da9cc188092582b3bdb20a80
     BINARY_DIR ${OSSIM_SB_BUILD_DIR}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
     DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-    CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${OSSIM_SB_SRC}/ossim
+    CMAKE_CACHE_ARGS
     -DProject_WC_REVISION:STRING=23537
-    -DSUBVERSION_FOUND:BOOL=FALSE
     -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
     -DCMAKE_BUILD_TYPE:STRING=Release
     -DCMAKE_CXX_FLAGS:STRING=${OSSIM_CXX_FLAGS}
     -DBUILD_OSSIM_MPI_SUPPORT:BOOL=OFF
     -DBUILD_OSSIM_FREETYPE_SUPPORT:BOOL=ON
     -DBUILD_OSSIM_APPS:BOOL=OFF
-    -DBUILD_OSSIM_TEST_APPS:BOOL=OFF
     -DBUILD_OSSIM_FRAMEWORKS:BOOL=OFF
     -DINSTALL_ARCHIVE_DIR:STRING=lib
     -DINSTALL_LIBRARY_DIR:STRING=lib
-    -DCMAKE_MODULE_PATH:PATH=${OSSIM_SB_SRC}/ossim_package_support/cmake/CMakeModules
-    -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
+    -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX}
     ${OSSIM_SB_CONFIG}
     DEPENDS ${${proj}_DEPENDENCIES}
+    CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${OSSIM_SB_SRC}/ossim
     )
-
-  if(WIN32)
-    if(MSVC)
-      ExternalProject_Add_Step(${proj} patch_ossim_src
-        COMMAND ${CMAKE_COMMAND} -E copy_directory
-        ${CMAKE_SOURCE_DIR}/patches/ossim/src ${OSSIM_SB_SRC}/ossim/src
-        DEPENDEES patch_ossim_include
-        DEPENDERS configure )
-
-      ExternalProject_Add_Step(${proj} patch_ossim_include
-        COMMAND ${CMAKE_COMMAND} -E copy_directory
-        ${CMAKE_SOURCE_DIR}/patches/ossim/include ${OSSIM_SB_SRC}/ossim/include
-        DEPENDEES patch_ossim_cmake1
-        DEPENDERS patch_ossim_src )
-
-    endif()
-
-    ExternalProject_Add_Step(${proj} patch_ossim_cmake1
-      COMMAND ${CMAKE_COMMAND} -E copy
-      ${CMAKE_SOURCE_DIR}/patches/ossim/CMakeLists.txt ${OSSIM_SB_SRC}/ossim/
-      DEPENDEES patch_ossim_cmake2
-      DEPENDERS patch_ossim_include )
-
-    ExternalProject_Add_Step(${proj} patch_ossim_cmake2
-      COMMAND ${CMAKE_COMMAND} -E copy
-      ${CMAKE_SOURCE_DIR}/patches/ossim/OssimUtilities.cmake ${OSSIM_SB_SRC}/ossim_package_support/cmake/CMakeModules
-      DEPENDEES patch
-      DEPENDERS patch_ossim_cmake1 )
-  endif()

   set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
   if(WIN32)


ENH: Reverted use of IncrediBuild for SuperElastixApplications, because the sln file only has two CXX files (selxSuperElastix.cxx and selxConfigurationReader.cxx).

--- SuperBuild/ExternalApplications.cmake
+++ SuperBuild/ExternalApplications.cmake
@@ -19,8 +19,6 @@

 set( proj Applications )

-UPDATE_SELX_SUPERBUILD_COMMAND(SuperElastix${proj})
-
 ExternalProject_Add( ${proj}
   DOWNLOAD_COMMAND ""
   SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../Applications
@@ -32,5 +30,4 @@
     -DITK_DIR:PATH=${ITK_DIR}
   DEPENDS ${SUPERELASTIX_DEPENDENCIES}
   INSTALL_COMMAND ""
-  BUILD_COMMAND ${SELX_SUPERBUILD_COMMAND}
 )


COMP: Somehow, the git tag that dtiprep requests went away.

--- SuperBuild/External_BRAINSTools.cmake
+++ SuperBuild/External_BRAINSTools.cmake
@@ -32,7 +32,7 @@
 if(${ITK_VERSION_MAJOR} STREQUAL "3")
   set(GIT_TAG "03ce71cca9bbfb1f0da0040b139011211694b1c6")
 else()
-  set(GIT_TAG "tempDTIPrepBranch")
+  set(GIT_TAG "77b6402e395f022e90b17d950bc237b129163c1d")
 endif()

   if(NOT DEFINED git_protocol)


Set the EXTERNAL_PROJECT property.

Set the EXTERNAL_PROJECT property.

This way, other users of this library can know the external project
target that we belong to.

--- FindGoogleMock.cmake
+++ FindGoogleMock.cmake
@@ -213,6 +213,8 @@
     add_library (${library_target} STATIC IMPORTED GLOBAL)
     set_target_properties (${library_target}
                            PROPERTIES IMPORTED_LOCATION ${location})
+    set_target_properties (${library_target}
+                           PROPERTIES EXTERNAL_PROJECT ${extproj})
     add_dependencies (${library_target} ${extproj})

 endmacro (_import_library_from_extproject)


updated SIRF tag to v2.2.0-rc.1 in version_config.cmake (#405)

Co-authored-by: Kris Thielemans <47fc7759b48490fcc499eab91ccf4678880ebb49@users.noreply.github.com>

--- version_config.cmake
+++ version_config.cmake
@@ -191,7 +191,7 @@
   set(DEFAULT_ACE_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG 1756793187cdd96df397689f35ec0332455bc401)
+  set(DEFAULT_SIRF_TAG v2.2.0-rc.1)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


Apply equivalent changes to FindPySide2Tools as FindPySideTools.

These are largely matching files, potential to de-duplicate them, but this
just ports the changes over for now.

--- cMake/FindPySide2Tools.cmake
+++ cMake/FindPySide2Tools.cmake
@@ -38,14 +38,15 @@
         )
     else(WIN32)
         # Especially on Open Build Service we don't want changing date like
-        # pyside2-uic generates in comments at beginning.
-        EXECUTE_PROCESS(
-          COMMAND ${PYSIDE2UICBINARY} ${infile}
-          COMMAND sed "/^# /d"
-          OUTPUT_FILE ${outfile}
+        # pyside2-uic generates in comments at beginning., which is why
+        # we follow the tool command with in-place sed.
+        ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+          COMMAND "${PYSIDE2UICBINARY}" "${infile}" -o "${outfile}"
+          COMMAND sed -i "/^# /d" "${outfile}"
+          MAIN_DEPENDENCY "${infile}"
         )
     endif(WIN32)
-    SET(${outfiles} ${${outfiles}} ${outfile})
+    list(APPEND ${outfiles} ${outfile})
   ENDFOREACH(it)
 ENDMACRO (PYSIDE_WRAP_UI)

@@ -53,7 +54,7 @@
   FOREACH(it ${ARGN})
     GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
     GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
-    SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py)
+    SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py")
     #ADD_CUSTOM_TARGET(${it} ALL
     #  DEPENDS ${outfile}
     #)
@@ -64,14 +65,15 @@
         )
     else(WIN32)
         # Especially on Open Build Service we don't want changing date like
-        # pyside2-rcc generates in comments at beginning.
-        EXECUTE_PROCESS(
-          COMMAND ${PYSIDE2RCCBINARY} ${infile}
-          COMMAND sed "/^# /d"
-          OUTPUT_FILE ${outfile}
-       )
+        # pyside-rcc generates in comments at beginning, which is why
+        # we follow the tool command with in-place sed.
+        ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
+          COMMAND "${PYSIDE2RCCBINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
+          COMMAND sed -i "/^# /d" "${outfile}"
+          MAIN_DEPENDENCY "${infile}"
+        )
     endif(WIN32)
-    SET(${outfiles} ${${outfiles}} ${outfile})
+    list(APPEND ${outfiles} ${outfile})
   ENDFOREACH(it)
 ENDMACRO (PYSIDE_WRAP_RC)


WIP: Add documentation and start imported targets


Doxygen: Assume Qt path is present in CMAKE_PREFIX_PATH

--- tools/doxygen/doxygen.cmake
+++ tools/doxygen/doxygen.cmake
@@ -284,9 +284,8 @@
         GENERATE_QHP
     )

-    get_filename_component(QT_BIN_PATH ${QT_QMAKE_EXECUTABLE} PATH)
-    find_program(IVW_DOXY_QCOLLECTIONGENERATOR "qcollectiongenerator" ${QT_BIN_PATH})
-    find_program(IVW_DOXY_QHELPGENERATOR "qhelpgenerator" ${QT_BIN_PATH})
+    find_program(IVW_DOXY_QCOLLECTIONGENERATOR "qcollectiongenerator")
+    find_program(IVW_DOXY_QHELPGENERATOR "qhelpgenerator")

     add_custom_target("DOXY-HELP-${HARG_NAME}"
         COMMAND ${CMAKE_COMMAND} -E echo "Building help for ${ARG_NAME}"


Stop setting custom C++11 flags

Stop setting custom C++11 flags

--- NonServerBuild.cmake
+++ NonServerBuild.cmake
@@ -7,8 +7,6 @@

 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wpedantic")
-
 # Include some of the compiler flag modules from couchbase/tlm
 INCLUDE(CouchbaseCompilerOptions)
 INCLUDE(CouchbaseCodeCoverage)


updates to .gitlab-ci.yml

updates to .gitlab-ci.yml

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -62,6 +62,7 @@
     RESULT_VARIABLE retcode)
   check_result()
 ENDMACRO()
+

 EXECUTE_PROCESS(
   COMMAND "wget" "http://10.123.110.90/CDash"


KWSys: Remove unused CheckCXXSourceRuns cmake module

This file has not been used in KWSys since commit "Moved test for large
file support into kwsysPlatformCxxTests.cxx", 2006-08-25.  CMake 2.6.0
and above come with a copy of this module anyway, and KWSys has required
CMake 2.6.3 since commit "KWSys: Require at least CMake 2.6.3",
2011-03-01.

--- Utilities/kwsys/CheckCXXSourceRuns.cmake
+++ Utilities/kwsys/CheckCXXSourceRuns.cmake
@@ -1,62 +0,0 @@
-# - Check if the source code provided in the SOURCE argument compiles.
-# CHECK_CXX_SOURCE_COMPILES(SOURCE VAR)
-# - macro which checks if the source code compiles\
-#  SOURCE - source code to try to compile
-#  VAR    - variable to store size if the type exists.
-#
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-#  CMAKE_REQUIRED_FLAGS = string of compile command line flags
-#  CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-#  CMAKE_REQUIRED_INCLUDES = list of include directories
-#  CMAKE_REQUIRED_LIBRARIES = list of libraries to link
-
-MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR COMMENT)
-  IF("HAVE_${VAR}" MATCHES "^HAVE_${VAR}$")
-    SET(MACRO_CHECK_FUNCTION_DEFINITIONS
-      "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
-    IF(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
-        "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
-    ELSE(CMAKE_REQUIRED_LIBRARIES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
-    ENDIF(CMAKE_REQUIRED_LIBRARIES)
-    IF(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
-        "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
-    ELSE(CMAKE_REQUIRED_INCLUDES)
-      SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
-    ENDIF(CMAKE_REQUIRED_INCLUDES)
-    SET(CMAKE_EMPTY_INPUT_FILE_CONTENT "${SOURCE}")
-    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/CMakeEmptyInputFile.in"
-      "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx" IMMEDIATE)
-
-    MESSAGE(STATUS "Performing Test ${COMMENT}")
-    TRY_RUN(${VAR} HAVE_${VAR}
-      ${CMAKE_BINARY_DIR}
-      ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/src.cxx
-      COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
-      CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS}
-      "${CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES}"
-      "${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
-      OUTPUT_VARIABLE OUTPUT)
-    IF(HAVE_${VAR})
-      SET(${VAR} 1 CACHE INTERNAL "Test ${COMMENT}")
-      MESSAGE(STATUS "Performing Test ${COMMENT} - Success")
-      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log
-        "Performing C++ SOURCE FILE Test ${COMMENT} succeded with the following output:\n"
-        "${OUTPUT}\n"
-        "Source file was:\n${SOURCE}\n")
-    ELSE(HAVE_${VAR})
-      MESSAGE(STATUS "Performing Test ${COMMENT} - Failed")
-      SET(${VAR} "" CACHE INTERNAL "Test ${COMMENT}")
-      FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
-        "Performing C++ SOURCE FILE Test ${COMMENT} failed with the following output:\n"
-        "${OUTPUT}\n"
-        "Source file was:\n${SOURCE}\n")
-    ENDIF(HAVE_${VAR})
-  ENDIF("HAVE_${VAR}" MATCHES "^HAVE_${VAR}$")
-ENDMACRO(CHECK_CXX_SOURCE_RUNS)
-
-


- issue 2640: found another place that needed to change to intall_libdir

--- cmake-set-dependencies.cmake
+++ cmake-set-dependencies.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2017 by Pedro Mendes, Virginia Tech Intellectual
+# Copyright (C) 2017 - 2018 by Pedro Mendes, Virginia Tech Intellectual
 # Properties, Inc., University of Heidelberg, and University of
 # of Connecticut School of Medicine.
 # All rights reserved.
@@ -154,8 +154,8 @@
 set (SBW_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "SBW include directory" FORCE)
 endif()
 if (NOT EXISTS ${SBW_LIBRARY})
-set (SBW_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libSBW-static.a CACHE FILEPATH "SBW library" FORCE)
-set (SBW_LIBRARIES ${COPASI_DEPENDENCY_DIR}/lib/libSBW-static.a CACHE FILEPATH "SBW library" FORCE)
+set (SBW_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libSBW-static.a CACHE FILEPATH "SBW library" FORCE)
+set (SBW_LIBRARIES ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libSBW-static.a CACHE FILEPATH "SBW library" FORCE)
 endif()

@@ -164,7 +164,7 @@
 set (LIBSBML_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "SBML include directory" FORCE)
 endif()
 if (NOT EXISTS ${LIBSBML_LIBRARY})
-set (LIBSBML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libsbml-static.a CACHE FILEPATH "libSBML library" FORCE)
+set (LIBSBML_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libsbml-static.a CACHE FILEPATH "libSBML library" FORCE)
 endif()

 # libsedml
@@ -172,7 +172,7 @@
 set (LIBSEDML_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "SEDML include directory" FORCE)
 endif()
 if (NOT EXISTS ${LIBSEDML_LIBRARY})
-set (LIBSEDML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libsedml-static.a CACHE FILEPATH "libSEDML library" FORCE)
+set (LIBSEDML_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libsedml-static.a CACHE FILEPATH "libSEDML library" FORCE)
 endif()

@@ -181,7 +181,7 @@
 set (RAPTOR_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "raptor include directory" FORCE)
 endif()
 if (NOT EXISTS ${RAPTOR_LIBRARY})
-set (RAPTOR_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libraptor.a CACHE FILEPATH "raptor library" FORCE)
+set (RAPTOR_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libraptor.a CACHE FILEPATH "raptor library" FORCE)
 endif()

 if (NOT APPLE AND (NOT BLA_VENDOR OR "${BLA_VENDOR}" STREQUAL "COPASI Dependencies"))
@@ -189,15 +189,15 @@
   # clapack
   set (CLAPACK_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "clapack include directory" FORCE)

-  set(CLAPACK_LIBRARY_F2C "${COPASI_DEPENDENCY_DIR}/lib/libf2c.a")
+  set(CLAPACK_LIBRARY_F2C "${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libf2c.a")

   if (NOT EXISTS "${CLAPACK_LIBRARY_F2C}")
-    set(CLAPACK_LIBRARY_F2C "/usr/lib/libgfortran.so")
+    set(CLAPACK_LIBRARY_F2C "/usr/${CMAKE_INSTALL_LIBDIR}/libgfortran.so")
   endif()

   set (CLAPACK_LIBRARIES
-       ${COPASI_DEPENDENCY_DIR}/lib/liblapack.a;${COPASI_DEPENDENCY_DIR}/lib/libblas.a;${CLAPACK_LIBRARY_F2C}
+       ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/liblapack.a;${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libblas.a;${CLAPACK_LIBRARY_F2C}
        CACHE FILEPATH "lapack library" FORCE)

   add_definitions(-DHAVE_BLASWRAP_H)
@@ -215,7 +215,7 @@
 set (CPPUNIT_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "cpp unit include directory" FORCE)
 endif()
 if (NOT EXISTS ${CPPUNIT_LIBRARY})
-set (CPPUNIT_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libcppunit.a CACHE FILEPATH "cppunit library" FORCE)
+set (CPPUNIT_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libcppunit.a CACHE FILEPATH "cppunit library" FORCE)
 endif()

 # expat
@@ -223,14 +223,14 @@
 set (LIBEXPAT_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "expat include directory" FORCE)
 endif()
 if (NOT EXISTS ${LIBEXPAT_LIBRARY})
-set (LIBEXPAT_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libexpat.a CACHE FILEPATH "expat library" FORCE)
+set (LIBEXPAT_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libexpat.a CACHE FILEPATH "expat library" FORCE)
 endif()

 if (NOT EXISTS ${EXPAT_INCLUDE_DIR})
 set (EXPAT_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "expat include directory" FORCE)
 endif()
 if (NOT EXISTS ${EXPAT_LIBRARY})
-set (EXPAT_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libexpat.a CACHE FILEPATH "expat library" FORCE)
+set (EXPAT_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libexpat.a CACHE FILEPATH "expat library" FORCE)
 endif()

 # mml
@@ -238,7 +238,7 @@
 set (MML_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "mml include directory" FORCE)
 endif()
 if (NOT EXISTS ${MML_LIBRARY})
-set (MML_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libmml.a CACHE FILEPATH "mml library" FORCE)
+set (MML_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libmml.a CACHE FILEPATH "mml library" FORCE)
 endif()

 # QWT
@@ -246,7 +246,7 @@
 set (QWT_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "qwt include directory" FORCE)
 endif()
 if (NOT EXISTS ${QWT_LIBRARY})
-set (QWT_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libqwt.a CACHE FILEPATH "qwt library" FORCE)
+set (QWT_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libqwt.a CACHE FILEPATH "qwt library" FORCE)
 endif()

 # QWT Plot
@@ -254,10 +254,10 @@
 set (QWTPLOT3D_INCLUDE_DIR ${COPASI_DEPENDENCY_DIR}/include CACHE PATH "qwtplot3d include directory" FORCE)
 endif()
 if (NOT EXISTS ${QWTPLOT3D_LIBRARY})
-set (QWTPLOT3D_LIBRARY ${COPASI_DEPENDENCY_DIR}/lib/libqwtplot3d.a CACHE FILEPATH "qwtplot3d library" FORCE)
-endif()
-
-
-endif()
-
-endif()
+set (QWTPLOT3D_LIBRARY ${COPASI_DEPENDENCY_DIR}/${CMAKE_INSTALL_LIBDIR}/libqwtplot3d.a CACHE FILEPATH "qwtplot3d library" FORCE)
+endif()
+
+
+endif()
+
+endif()


Guess NCCL path as /usr/local/cuda on UNIX systems (#17297)

* Update FindNCCL.cmake

If Cuda root dir is not specified, search for the symlinked unix default

* Update FindNCCL.cmake

* fix the cmake variable name

FindCUDAToolkit exposes result variables (cmake variables). Use those.

https://github.com/apache/incubator-mxnet/blob/28e053edb4f2079743458bf087557bcac7e58c62/cmake/Modules/FindCUDAToolkit.cmake#L427-L464

* search for library in /usr/local/cuda

* comment if

* indent, comment fix

* fix indent, add nccl_root alongside nccl_root_dir

Also add warning about deprecation

* fix indent, remove nccl_root checks

* Update FindNCCL.cmake

--- cmake/Modules/FindNCCL.cmake
+++ cmake/Modules/FindNCCL.cmake
@@ -31,7 +31,9 @@
 # install NCCL in the same location as the CUDA toolkit.
 # See https://github.com/caffe2/caffe2/issues/1601

-set(NCCL_ROOT_DIR "" CACHE PATH "Folder contains NVIDIA NCCL")
+if ($ENV{NCCL_ROOT_DIR})
+  message(WARNING "NCCL_ROOT_DIR is deprecated. Please set NCCL_ROOT instead.")
+endif()

 find_path(NCCL_INCLUDE_DIRS
   NAMES nccl.h
@@ -55,6 +57,23 @@
   $ENV{NCCL_DIR}/lib
   )

+# if not found in any of the above paths, finally, check in the /usr/local/cuda for UNIX systems
+if (UNIX)
+  set (search_paths "/usr/local/cuda")
+
+  find_path(NCCL_INCLUDE_DIRS
+    NAMES nccl.h
+    PATHS ${search_paths}
+    PATH_SUFFIXES include
+  )
+
+  find_library(NCCL_LIBRARIES
+    NAMES nccl
+    PATHS ${search_paths}
+    PATH_SUFFIXES lib
+  )
+endif()
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIRS NCCL_LIBRARIES)