Alphabeticise order of variables in environmentchecks.cmake.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -20,11 +20,11 @@

 find_program(CLANG_FORMAT_EXE NAMES ${PREFERRED_CLANG_FORMAT_NAMES} clang-format)
 find_program(CLANG_TIDY_EXE NAMES ${PREFERRED_CLANG_TIDY_NAMES} clang-tidy)
-find_program(LLVM_PROFDATA_EXE NAMES ${PREFERRED_LLVM_PROFDATA_NAMES} llvm-profdata HINTS /Library/Developer/CommandLineTools/usr/bin/)
-find_program(LLVM_COV_EXE NAMES ${PREFERRED_LLVM_COV_NAMES} llvm-cov HINTS /Library/Developer/CommandLineTools/usr/bin/)
 find_program(FIND_EXE NAMES ${PREFERRED_FIND_NAMES} find)
 find_program(GCOV_EXE NAMES ${PREFERRED_GCOV_NAMES} gcov)
 find_program(GIT_EXE NAMES ${PRFERRED_GIT_NAMES} git)
+find_program(LLVM_PROFDATA_EXE NAMES ${PREFERRED_LLVM_PROFDATA_NAMES} llvm-profdata HINTS /Library/Developer/CommandLineTools/usr/bin/)
+find_program(LLVM_COV_EXE NAMES ${PREFERRED_LLVM_COV_NAMES} llvm-cov HINTS /Library/Developer/CommandLineTools/usr/bin/)
 find_program(VALGRIND_EXE NAMES ${PREFERRED_VALGRIND_NAMES} valgrind)

 find_package(Doxygen)
@@ -96,13 +96,13 @@
 mark_as_advanced(
   CLANG_TIDY_EXE
   CLANG_FORMAT_EXE
+  FIND_EXE
+  GCC_COVERAGE_COMPILER_FLAGS_OK
+  GCOV_EXE
   GIT_EXE
-  FIND_EXE
-  GCOV_EXE
-  SWIG_EXECUTABLE
-  VALGRIND_EXE
   LLVM_COV_EXE
   LLVM_PROFDATA_EXE
   LLVM_COVERAGE_COMPILER_FLAGS_OK
-  GCC_COVERAGE_COMPILER_FLAGS_OK
+  SWIG_EXECUTABLE
+  VALGRIND_EXE
 )


make readable

make readable

svn path=/trunk/KDE/kdepim/; revision=541276

--- cmake/modules/FindGpgme.cmake
+++ cmake/modules/FindGpgme.cmake
@@ -5,55 +5,55 @@
 #  GPGME_INCLUDES - the gpgme include directory
 #  GPGME_LIBRARIES - The libraries needed to use gpgme

-INCLUDE (MacroEnsureVersion)
+include (MacroEnsureVersion)

 # if not already in cache
-IF (NOT GPGME_LIBRARIES OR NOT GPGME_INCLUDES)
+if (NOT GPGME_LIBRARIES OR NOT GPGME_INCLUDES)
   set(GPGME_FOUND FALSE)

   FIND_PROGRAM(GPGMECONFIG_EXECUTABLE NAMES gpgme-config)

   # if gpgme-config has been found
-  IF (GPGMECONFIG_EXECUTABLE)
+  if (GPGMECONFIG_EXECUTABLE)

     EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE GPGME_VERSION)

     MACRO_ENSURE_VERSION( "0.4.5" ${GPGME_VERSION} GPGME_INSTALLED_VERSION_TOO_OLD )

-    IF (NOT GPGME_INSTALLED_VERSION_TOO_OLD)
+    if (NOT GPGME_INSTALLED_VERSION_TOO_OLD)

       EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --libs OUTPUT_VARIABLE GPGME_LIBRARIES)

       # append -lgpg-error to the list of libraries, if necessary
-      IF (NOT GPGME_LIBRARIES MATCHES "lgpg-error")
+      if (NOT GPGME_LIBRARIES MATCHES "lgpg-error")
         set(GPGME_LIBRARIES "${GPGME_LIBRARIES} -lgpg-error")
-      ENDIF (NOT GPGME_LIBRARIES MATCHES "lgpg-error")
+      endif (NOT GPGME_LIBRARIES MATCHES "lgpg-error")

       EXEC_PROGRAM(${GPGMECONFIG_EXECUTABLE} ARGS --cflags OUTPUT_VARIABLE GPGME_CFLAGS)
-      IF (GPGME_CFLAGS)
+      if (GPGME_CFLAGS)
         string(REGEX REPLACE "(\r?\n)+$" "" GPGME_CFLAGS "${GPGME_CFLAGS}")
         string(REGEX REPLACE " *-I" ";" GPGME_INCLUDES "${GPGME_CFLAGS}")
-      ENDIF (GPGME_CFLAGS)
+      endif (GPGME_CFLAGS)

       # ensure that they are cached
       set(GPGME_INCLUDES ${GPGME_INCLUDES} CACHE INTERNAL "The gpgme include paths")
       set(GPGME_LIBRARIES ${GPGME_LIBRARIES} CACHE INTERNAL "The gpgme libraries")

-    ELSE (NOT GPGME_INSTALLED_VERSION_TOO_OLD)
+    else (NOT GPGME_INSTALLED_VERSION_TOO_OLD)
       message(STATUS "The installed version of gpgme is too old: ${GPGME_VERSION}")
-    ENDIF (NOT GPGME_INSTALLED_VERSION_TOO_OLD)
+    endif (NOT GPGME_INSTALLED_VERSION_TOO_OLD)

-  ENDIF (GPGMECONFIG_EXECUTABLE)
+  endif (GPGMECONFIG_EXECUTABLE)

-  IF (GPGME_LIBRARIES)
+  if (GPGME_LIBRARIES)
       set(GPGME_FOUND TRUE)
       #message(STATUS "Found gpgme: includes: ${GPGME_INCLUDES} libs: ${GPGME_LIBRARIES}")
       message(STATUS "Found gpgme using ${GPGMECONFIG_EXECUTABLE}.")
-  ENDIF (GPGME_LIBRARIES)
+  endif (GPGME_LIBRARIES)

-  IF (NOT GPGME_FOUND)
+  if (NOT GPGME_FOUND)
       message(FATAL_ERROR "You are missing gpgme 0.4.5 or higher.
     Download gpgme >= 0.4.5 from ftp://ftp.gnupg.org/gcrypt/alpha/gpgme
     or use the --with-gpgme-prefix=/path/where/gpgme/is/installed option.")
-  ENDIF (NOT GPGME_FOUND)
-ENDIF (NOT GPGME_LIBRARIES OR NOT GPGME_INCLUDES)
+  endif (NOT GPGME_FOUND)
+endif (NOT GPGME_LIBRARIES OR NOT GPGME_INCLUDES)


DOC: fix links when documenting module dependency

from http://www.stack.nl/~dimitri/doxygen/grouping.html

  "The \ref command can be used to refer to a group. The first
  argument of the \ref command should be group's label."

Change-Id: I2755e0dde7d375ae8cb5281b2ba24e1364f9fecb

--- CMake/ITKModuleDoxygen.cmake
+++ CMake/ITKModuleDoxygen.cmake
@@ -4,8 +4,9 @@
   set( _content "${_content} \\defgroup ${_name} ${_name} \n" )
   set( _content "${_content} ${ITK_MODULE_${_name}_DESCRIPTION} \n" )

+  set( _content "${_content} \\par Dependencies:\n" )
   foreach( d ${ITK_MODULE_${_name}_DEPENDS} )
-    set( _content "${_content} \\sa ${d} \n" )
+    set( _content "${_content} \li \\ref ${d} \n" )
   endforeach()

   set( _content "${_content} */\n" )


ENH: add macro to ease declaration of application tests

--- CMake/OTBWrapperMacros.cmake
+++ CMake/OTBWrapperMacros.cmake
@@ -61,3 +61,24 @@
        CACHE STRING "List of all applications" FORCE)

 endmacro(OTB_CREATE_APPLICATION)
+
+
+
+
+
+macro(OTB_TEST_APPLICATION)
+  OTB_PARSE_ARGUMENTS(
+      TESTAPPLICATION
+      "NAME;APP;OPTIONS;VALID"
+      ""
+      ${ARGN})
+
+   add_test(NAME ${TESTAPPLICATION_NAME}
+            COMMAND otbTestDriver
+                    ${TESTAPPLICATION_VALIDATION}
+                    Execute $<TARGET_FILE:otbApplicationLauncherCommandLine>
+                    ${TESTAPPLICATION_APP}
+                    $<TARGET_FILE_DIR:otbapp_${TESTAPPLICATION_APP}>
+                    ${TESTAPPLICATION_OPTIONS})
+
+endmacro(OTB_TEST_APPLICATION)


FindOIS.cmake fixes: - Respect OGRE_DEPENDENCIES_DIR (useful if used outside of OGRE) - On Win32 define names of the OIS DLLs so they can be copied from wherever they are found

--- CMake/Packages/FindOIS.cmake
+++ CMake/Packages/FindOIS.cmake
@@ -13,6 +13,7 @@
 #  OIS_FOUND - system has OIS
 #  OIS_INCLUDE_DIRS - the OIS include directories
 #  OIS_LIBRARIES - link these to use OIS
+#  OIS_BINARY_REL / OIS_BINARY_DBG - DLL names (windows only)

 include(FindPkgMacros)
 findpkg_begin(OIS)
@@ -22,9 +23,11 @@
 getenv_path(OGRE_SDK)
 getenv_path(OGRE_HOME)
 getenv_path(OGRE_SOURCE)
+getenv_path(OGRE_DEPENDENCIES_DIR)

 # construct search paths
 set(OIS_PREFIX_PATH ${OIS_HOME} ${ENV_OIS_HOME}
+  ${OGRE_DEPENDENCIES_DIR} ${ENV_OGRE_DEPENDENCIES_DIR}
   ${OGRE_SOURCE}/iPhoneDependencies ${ENV_OGRE_SOURCE}/iPhoneDependencies
   ${OGRE_SOURCE}/Dependencies ${ENV_OGRE_SOURCE}/Dependencies
   ${OGRE_SDK} ${ENV_OGRE_SDK}
@@ -61,6 +64,19 @@
 find_library(OIS_LIBRARY_DBG NAMES ${OIS_LIBRARY_NAMES_DBG} HINTS ${OIS_LIB_SEARCH_PATH} ${OIS_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
 make_library_set(OIS_LIBRARY)

+if (WIN32)
+	set(OIS_BIN_SEARCH_PATH ${OIS_HOME}/dll ${ENV_OIS_HOME}/dll
+		${OGRE_DEPENDENCIES_DIR}/bin ${ENV_OGRE_DEPENDENCIES_DIR}/bin
+		${OGRE_SOURCE}/Dependencies/bin ${ENV_OGRE_SOURCE}/Dependencies/bin
+		${OGRE_SDK}/bin ${ENV_OGRE_SDK}/bin
+		${OGRE_HOME}/bin ${ENV_OGRE_HOME}/bin)
+	find_file(OIS_BINARY_REL NAMES "OIS.dll" HINTS ${OIS_BIN_SEARCH_PATH}
+	  PATH_SUFFIXES "" release relwithdebinfo minsizerel)
+	find_file(OIS_BINARY_DBG NAMES "OIS_d.dll" HINTS ${OIS_BIN_SEARCH_PATH}
+	  PATH_SUFFIXES "" debug )
+endif()
+mark_as_advanced(OIS_BINARY_REL OIS_BINARY_DBG)
+

 findpkg_finish(OIS)


turn off versioned install for now (by default)

--- CMakeModules/OMPLUtils.cmake
+++ CMakeModules/OMPLUtils.cmake
@@ -16,7 +16,7 @@
 endmacro(add_ompl_python_test)

 if(UNIX)
-    option(OMPL_VERSIONED_INSTALL "Append version suffix to binaries, libraries, and include dir." ON)
+    option(OMPL_VERSIONED_INSTALL "Append version suffix to binaries, libraries, and include dir." OFF)
 else()
     option(OMPL_VERSIONED_INSTALL "Append version suffix to binaries, libraries, and include dir." OFF)
 endif()


MSVC: Fix for cmake_prefix_path. Previous set call was overwritting vcpkg or something

--- msvc/Custom-vs.cmake
+++ msvc/Custom-vs.cmake
@@ -17,7 +17,7 @@
 set(BUILD_FAUST_OPCODES OFF)
 set(BUILD_FLUID_OPCODES ON)
 set(BUILD_FRAMEBUFFER_OPCODES ON)
-set(BUILD_HDF5_OPCODES ON)
+set(BUILD_HDF5_OPCODES OFF)
 set(BUILD_IMAGE_OPCODES ON)
 set(BUILD_INSTALLER ON)
 set(BUILD_JACK_OPCODES OFF)
@@ -39,7 +39,7 @@
 set(BUILD_SELECT_OPCODE ON)
 set(BUILD_SERIAL_OPCODES ON)
 set(BUILD_STACK_OPCODES ON)
-set(BUILD_STATIC_LIBRARY OFF)
+set(BUILD_STATIC_LIBRARY ON)
 set(BUILD_STK_OPCODES ON)
 set(BUILD_TESTS ON)
 set(BUILD_UTILITIES ON)
@@ -73,7 +73,7 @@
 set(CMAKE_VERBOSE_MAKEFILE ON)
 set(CMAKE_16BIT_TYPE "unsigned short")
 set(FAIL_MISSING OFF) # Enable when packaging
-set(CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}\\msvc\\deps;${PROJECT_SOURCE_DIR}\\msvc\\deps\\swigwin-3.0.12;${PROJECT_SOURCE_DIR}\\msvc\\deps\\win_flex_bison;${PROJECT_SOURCE_DIR}\\msvc\\deps\\fluidsynthdeps")
+list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}\\msvc\\deps;${PROJECT_SOURCE_DIR}\\msvc\\deps\\swigwin-3.0.12;${PROJECT_SOURCE_DIR}\\msvc\\deps\\win_flex_bison;${PROJECT_SOURCE_DIR}\\msvc\\deps\\fluidsynthdeps")
 set(CMAKE_REQUIRED_INCLUDES ${PROJECT_SOURCE_DIR}\\msvc\\deps\\include)

 # Explicit settings for locally downloaded dependencies


Trying to fix missing python exe problem

--- indra/cmake/LLTestCommand.cmake
+++ indra/cmake/LLTestCommand.cmake
@@ -1,3 +1,4 @@
+include(Python)
 MACRO(LL_TEST_COMMAND OUTVAR LD_LIBRARY_PATH)
   # nat wonders how Kitware can use the term 'function' for a construct that
   # cannot return a value. And yet, variables you set inside a FUNCTION are


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


rpath on clblas

rpath on clblas

--- src/cmake/build_clBLAS.cmake
+++ src/cmake/build_clBLAS.cmake
@@ -42,8 +42,11 @@
 set_target_properties(clBLAS PROPERTIES
 #  INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}EasyCL${CMAKE_SHARED_LIBRARY_SUFFIX}
   MACOSX_RPATH TRUE
+  INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib
+  INSTALL_RPATH_USE_LINK_PATH TRUE
   IMPORTED_LOCATION ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}clBLAS${CMAKE_SHARED_LIBRARY_SUFFIX}
 )
+

 add_custom_target(clblas_delete_stamp clBLAS-external
   ${CMAKE_COMMAND} -E  remove_directory "${CMAKE_BINARY_DIR}/clBLAS/stamp"


Added missing QmitkPlotWidget.h to MOC_H_FILES variable.

--- Modules/QmitkExt/files.cmake
+++ Modules/QmitkExt/files.cmake
@@ -214,6 +214,7 @@
  QmitkRegionGrow3DToolGUI.h
  QmitkToolRoiDataSelectionBox.h
  QmitkBoundingObjectWidget.h
+ QmitkPlotWidget.h
 )

 IF ( NOT ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION} VERSION_LESS 5.4.0 )


ENH: Remove Visualization options

ENH: Remove Visualization options

--- CI/configure_options.cmake
+++ CI/configure_options.cmake
@@ -44,9 +44,6 @@
 set (otb_use_option
 "OTB_USE_6S:BOOL=ON
 OTB_USE_CURL:BOOL=ON
-OTB_USE_GLEW:BOOL=ON
-OTB_USE_GLFW:BOOL=ON
-OTB_USE_GLUT:BOOL=ON
 OTB_USE_GSL:BOOL=ON
 OTB_USE_LIBKML:BOOL=OFF
 OTB_USE_LIBSVM:BOOL=ON
@@ -54,10 +51,7 @@
 OTB_USE_MUPARSER:BOOL=ON
 OTB_USE_MUPARSERX:BOOL=ON
 OTB_USE_OPENCV:BOOL=ON
-OTB_USE_OPENGL:BOOL=ON
 OTB_USE_OPENMP:BOOL=OFF
-OTB_USE_QT:BOOL=ON
-OTB_USE_QWT:BOOL=ON
 OTB_USE_SHARK:BOOL=ON
 OTB_USE_SIFTFAST:BOOL=ON
 OTB_USE_SPTW:BOOL=ON


COMP: Patch up one more occurrence of CVS CMake GET_PROPERTY use so that the AIX dashboards will configure and build again.

--- CMake/FindPythonLibs.cmake
+++ CMake/FindPythonLibs.cmake
@@ -81,7 +81,7 @@

 # if the platform supports shared libs, build the modules shared by default
 IF(COMMAND GET_PROPERTY)
-  GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS GLOBAL TARGET_SUPPORTS_SHARED_LIBS)
+  GET_PROPERTY(_TARGET_SUPPORTS_SHARED_LIBS GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
 ELSE(COMMAND GET_PROPERTY)
   SET(_TARGET_SUPPORTS_SHARED_LIBS TRUE)
 ENDIF(COMMAND GET_PROPERTY)


cmake: remove deprecated FindGSL.cmake

cmake: remove deprecated FindGSL.cmake

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -1,59 +0,0 @@
-# - Find gsl
-# Find the native GSL headers and libraries.
-#
-#  GSL_INCLUDE_DIRS - where to find gsl/gsl_linalg.h, etc.
-#  GSL_LIBRARIES    - List of libraries when using gsl.
-#  GSL_FOUND        - True if gsl found.
-#
-# Copyright 2009-2011 The VOTCA Development Team (http://www.votca.org)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-find_package(PkgConfig)
-
-pkg_check_modules(PC_GSL gsl)
-find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h HINTS ${PC_GSL_INCLUDE_DIRS})
-find_library(GSL_LIBRARY NAMES gsl HINTS ${PC_GSL_LIBRARY_DIRS} )
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR)
-
-set(GSL_LIBRARIES "${GSL_LIBRARY}")
-set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
-
-if (GSL_FOUND)
-  include(CheckLibraryExists)
-  #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it
-  check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
-  if(NOT FOUND_QR_DECOMP)
-    #Some distributions like OpenSUSE need cblas in the linker flags, too
-    find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )
-    find_package_handle_standard_args(GSLCBLAS DEFAULT_MSG GSLCBLAS_LIBRARY)
-    if (GSLCBLAS_FOUND)
-      check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
-      if(NOT FOUND_DSYRK)
-        message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
-      endif(NOT FOUND_DSYRK)
-      set(GSL_LIBRARIES "${GSL_LIBRARY};${GSLCBLAS_LIBRARY}")
-      check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_lssolve "" FOUND_QR_DECOMP_AGAIN)
-    endif(GSLCBLAS_FOUND)
-  endif(NOT FOUND_QR_DECOMP)
-  if(NOT FOUND_QR_DECOMP AND NOT FOUND_QR_DECOMP_AGAIN)
-      message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong.  If you are using a static lib (.a) make sure you have specified all dependencies of libgsl in GSL_LIBRARY by hand (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libm.so') !")
-  endif(NOT FOUND_QR_DECOMP AND NOT FOUND_QR_DECOMP_AGAIN)
-endif (GSL_FOUND)
-
-mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY)


cmake: add a macro to build a test bin and automatically run it

This macro is useful for test binaries that require no input files.

Signed-off-by: Josef 'Jeff' Sipek <a620f141433c70aa9e43778305a6c68cbfadfb25@josefsipek.net>

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -36,3 +36,10 @@
 		jeffpc
 	)
 endmacro()
+
+macro(build_test_bin_and_run name)
+	build_test_bin(${name})
+	add_test(NAME "${name}"
+		 COMMAND "${CMAKE_BINARY_DIR}/test_${name}"
+	)
+endmacro()


cmake: Inherit VERSION and SOVERSION from top-level MIRTK project

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -44,8 +44,6 @@
   # meta-data
   NAME        "Deformable"
   PACKAGE     "MIRTK"
-  VERSION     "1.0.0rc2" # External module version
-  SOVERSION   "0"        # API yet unstable
   AUTHORS     "Andreas Schuh"
   DESCRIPTION "Deformable library of the Medical Image Registration ToolKit."
   COPYRIGHT   "2013-2015 Imperial College London, Andreas Schuh"


Define C++11 by default

Define C++11 by default

This help the project compile with gcc 5.x

--- CMake/Common.cmake
+++ CMake/Common.cmake
@@ -10,23 +10,25 @@

 if (WIN32)
     set(CMAKE_USE_RELATIVE_PATHS "1")
-    # Set compiler flags
-	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP")
-    set(CMAKE_CXX_FLAGS_RELEASE "/MD /MP /Ox /Ob2 /Oi /Ot /D NDEBUG /openmp")
+    # Set compiler flags
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MP")
+    set(CMAKE_CXX_FLAGS_RELEASE "/MD /MP /Ox /Ob2 /Oi /Ot /D NDEBUG /openmp")
     set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
-	set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
-	set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
+    set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/INCREMENTAL:NO")
 endif (WIN32)

 if (UNIX)
     set(CMAKE_USE_RELATIVE_PATHS "1")
-	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
     # Set compiler flags for "release"
-    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fopenmp")
+    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fopenmp")
 endif (UNIX)

 if(APPLE)
-	set(CMAKE_MACOSX_RPATH 1)
+    set(CMAKE_MACOSX_RPATH 1)
 endif()

+set (CMAKE_CXX_STANDARD 11)
+
 add_definitions(-D_CRT_SECURE_NO_DEPRECATE)


--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2303,21 +2303,15 @@
 			VERBATIM)
 		list (APPEND ${_cmdsVar} COMMAND ${_unityCmd})
 	endforeach()
-	list (LENGTH _unityFiles _numberOfUnityFiles)
-	if (_numberOfUnityFiles GREATER 1)
-		# create a joint unity file from all unity file segments
-		cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
-		cotire_setup_combine_command(${_language} "${_targetConfigScript}" "${_unityFile}" ${_cmdsVar} ${_unityFiles})
-	endif()
 	set (${_cmdsVar} ${${_cmdsVar}} PARENT_SCOPE)
 endfunction()

-function (cotire_setup_prefix_generation_command _language _target _targetScript _prefixFile _unityFile _cmdsVar)
+function (cotire_setup_prefix_generation_command _language _target _targetScript _prefixFile _unityFiles _cmdsVar)
 	set (_sourceFiles ${ARGN})
 	set (_dependencySources "")
 	cotire_get_prefix_header_dependencies(${_language} ${_target} _dependencySources ${_sourceFiles})
 	cotire_set_cmd_to_prologue(_prefixCmd)
-	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" "${_unityFile}")
+	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
 	set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
 	if (COTIRE_DEBUG)
 		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
@@ -2332,7 +2326,7 @@
 	add_custom_command(
 		OUTPUT "${_prefixFile}" "${_prefixFile}.log"
 		COMMAND ${_prefixCmd}
-		DEPENDS "${_unityFile}" ${_dependencySources}
+		DEPENDS ${_unityFiles} ${_dependencySources}
 		COMMENT "${_comment}"
 		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 		VERBATIM)
@@ -2348,17 +2342,9 @@
 	else()
 		set (_prefixSourceFile "${_prefixFile}")
 	endif()
-	list (LENGTH _unityFiles _numberOfUnityFiles)
-	if (_numberOfUnityFiles GREATER 1)
-		cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
-		cotire_setup_prefix_generation_command(
-			${_language} ${_target} "${_targetScript}"
-			"${_prefixSourceFile}" "${_unityFile}" ${_cmdsVar} ${_sourceFiles})
-	else()
-		cotire_setup_prefix_generation_command(
-			${_language} ${_target} "${_targetScript}"
-			"${_prefixSourceFile}" "${_unityFiles}" ${_cmdsVar} ${_sourceFiles})
-	endif()
+	cotire_setup_prefix_generation_command(
+		${_language} ${_target} "${_targetScript}"
+		"${_prefixSourceFile}" "${_unityFiles}" ${_cmdsVar} ${_sourceFiles})
 	if (CMAKE_${_language}_COMPILER_ID MATCHES "GNU|Clang")
 		# set up generation of a prefix source file which includes the prefix header
 		cotire_setup_combine_command(${_language} "${_targetScript}" "${_prefixFile}" _cmds ${_prefixSourceFile})
@@ -2619,14 +2605,22 @@
 	endif()
 	cotire_generate_target_script(
 		${_language} "${_configurations}" ${_target} _targetScript _targetConfigScript ${_unitySourceFiles})
+	# set up unity files for parallel compilation
 	cotire_compute_unity_max_number_of_includes(${_target} _maxIncludes ${_unitySourceFiles})
 	cotire_make_unity_source_file_paths(${_language} ${_target} ${_maxIncludes} _unityFiles ${_unitySourceFiles})
-	if (NOT _unityFiles)
+	list (LENGTH _unityFiles _numberOfUnityFiles)
+	if (_numberOfUnityFiles EQUAL 0)
 		return()
-	endif()
+	elseif (_numberOfUnityFiles GREATER 1)
+		cotire_setup_unity_generation_commands(
+			${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+	endif()
+	# set up single unity file for prefix header generation
+	cotire_make_single_unity_source_file_path(${_language} ${_target} _unityFile)
 	cotire_setup_unity_generation_commands(
-		${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+		${_language} ${_target} "${_targetScript}" "${_targetConfigScript}" "${_unityFile}" _cmds ${_unitySourceFiles})
 	cotire_make_prefix_file_path(${_language} ${_target} _prefixFile)
+	# set up prefix header
 	if (_prefixFile)
 		# check for user provided prefix header files
 		get_property(_prefixHeaderFiles TARGET ${_target} PROPERTY COTIRE_${_language}_PREFIX_HEADER_INIT)
@@ -2635,7 +2629,7 @@
 				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" _cmds ${_prefixHeaderFiles})
 		else()
 			cotire_setup_prefix_generation_from_unity_command(
-				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_unityFiles}" _cmds ${_unitySourceFiles})
+				${_language} ${_target} "${_targetConfigScript}" "${_prefixFile}" "${_unityFile}" _cmds ${_unitySourceFiles})
 		endif()
 		# check if selected language has enough sources at all
 		list (LENGTH _sourceFiles _numberOfSources)


utils: allow triplet with no toolset like linux-x64

--- Engine/scripts/utils.cmake
+++ Engine/scripts/utils.cmake
@@ -220,11 +220,19 @@
 		set(_toolset "v${MSVC_TOOLSET_VERSION}")
 	elseif(DEFINED CMAKE_VS_PLATFORM_TOOLSET)
 		set(_toolset "${CMAKE_VS_PLATFORM_TOOLSET}")
+	elseif(UNIX)
+		set(_toolset "")
 	else()
 		message(FATAL_ERROR "Visual studio toolset couldn't be deduced from cmake")
 	endif()

-	set(${out_triplet} "${_vcpkgTarget}-${_toolset}${_config}" PARENT_SCOPE)
+	set(_out_triplet "${_vcpkgTarget}")
+	if(NOT "${_toolset}" STREQUAL "")
+		set(_out_triplet "${_out_triplet}-${_toolset}")
+	endif()
+	set(_out_triplet "${_out_triplet}${_config}")
+
+	set(${out_triplet} "${_out_triplet}" PARENT_SCOPE)
 endfunction(getToolsetTriplet)


Update CMake module for SQLiteCpp library.

--- CMakeModules/FindSQLiteCpp.cmake
+++ CMakeModules/FindSQLiteCpp.cmake
@@ -2,13 +2,13 @@
 # @ingroup SQLiteCpp
 # @brief   SQLiteCpp CMake module.
 #
-# Copyright (c) 2013 Kartik Kumar (me@kartikkumar.com)
+# Copyright (c) 2010-2014 Kartik Kumar (me@kartikkumar.com)
 #
 # Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt
 # or copy at http://opensource.org/licenses/MIT)

 macro(_sqlitecpp_check_version)
-  file(READ "${SQLITECPP_INCLUDE_DIR}/SQLiteC++.h" _sqlitecpp_header)
+  file(READ "${SQLITECPP_INCLUDE_DIR}/SQLiteCpp.h" _sqlitecpp_header)

   string(REGEX MATCH "define[ \t]+SQLITECPP_VERSION_NUMBER[ \t]+([0-9]+)"
          _sqlitecpp_version_match "${_sqlitecpp_header}")
@@ -24,7 +24,7 @@
                    "but at least version ${SQLiteCpp_FIND_VERSION} is required!")
   endif(NOT SQLITECPP_VERSION_OK)

-  set(SQLITECPP_LIBRARY "sqlitecpp")
+  set(SQLITECPP_LIBRARY "SQLiteCpp")
   link_directories(${SQLITECPP_LIBRARY_DIR})
 endmacro(_sqlitecpp_check_version)

@@ -34,16 +34,17 @@
   set(SQLITECPP_FOUND ${SQLITECPP_VERSION_OK})

 else (SQLITECPP_INCLUDE_DIR)
-  find_path(SQLITECPP_BASE_PATH NAMES SQLiteC++.h
+  find_path(SQLITECPP_BASE_PATH NAMES SQLiteCpp.h
       PATHS
       ${PROJECT_SOURCE_DIR}
       ${PROJECT_SOURCE_DIR}/..
       ${PROJECT_SOURCE_DIR}/../..
       ${PROJECT_SOURCE_DIR}/../../..
-      PATH_SUFFIXES SQLiteCpp/src
+      ${PROJECT_SOURCE_DIR}/../../../..
+      PATH_SUFFIXES SQLiteCpp/include/SQLiteCpp
     )
   set(SQLITECPP_INCLUDE_DIR ${SQLITECPP_BASE_PATH})
-  set(SQLITECPP_LIBRARY_DIR ${SQLITECPP_BASE_PATH}/../lib)
+  set(SQLITECPP_LIBRARY_DIR ${SQLITECPP_BASE_PATH}/../../build)

   if(SQLITECPP_INCLUDE_DIR)
     _sqlitecpp_check_version()


From Torben Dannhauer, "I have extended the attached zipped file to recognize some more filenames and versions.
I added support to find libxml2 in the 3rdparty package if available.

Now this file can find all libraries from the 32/64bit VS2008sp1 dependency package except collada. I will add that later.
"

--- CMakeModules/Find3rdPartyDependencies.cmake
+++ CMakeModules/Find3rdPartyDependencies.cmake
@@ -59,7 +59,7 @@

 MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
         FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i")
-        FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype234;freetype234MT;freetype235;freetype237;freetype238" ${OSG_3RDPARTY_BIN} "d" "")
+        FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;" ${OSG_3RDPARTY_BIN} "d" "")
         IF(FREETYPE_FOUND)
             #forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
             SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)
@@ -68,7 +68,7 @@
             SET(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
         ENDIF(FREETYPE_FOUND)
         FIND_DEPENDENCY(CURL curl/curl.h "libcurl;curllib" ${OSG_3RDPARTY_BIN} "D" "")
-        FIND_DEPENDENCY(JPEG jpeglib.h libjpeg ${OSG_3RDPARTY_BIN} "D" "")
+        FIND_DEPENDENCY(JPEG jpeglib.h "libjpeg;jpeg" ${OSG_3RDPARTY_BIN} "D" "")
         FIND_DEPENDENCY(GDAL gdal.h "gdal;gdal16" ${OSG_3RDPARTY_BIN} "d" "_i")
         FIND_DEPENDENCY(GLUT GL/glut.h glut32 ${OSG_3RDPARTY_BIN} "D" "")
         IF(GLUT_FOUND)
@@ -76,7 +76,7 @@
             SET(GLUT_glut_LIBRARY ${GLUT_LIBRARY} CACHE FILEPATH "")
             MARK_AS_ADVANCED(GLUT_glut_LIBRARY)
         ENDIF(GLUT_FOUND)
-        FIND_DEPENDENCY(GIFLIB gif_lib.h "ungif;libungif" ${OSG_3RDPARTY_BIN} "D" "")
+        FIND_DEPENDENCY(GIFLIB gif_lib.h "ungif;libungif;giflib" ${OSG_3RDPARTY_BIN} "D" "")
         FIND_DEPENDENCY(ZLIB zlib.h "z;zlib;zlib1" ${OSG_3RDPARTY_BIN} "D" "")
         IF(ZLIB_FOUND)
             FIND_DEPENDENCY(PNG png.h "libpng;libpng13" ${OSG_3RDPARTY_BIN} "D" "")
@@ -85,7 +85,13 @@
                 SET(PNG_PNG_INCLUDE_DIR ${PNG_INCLUDE_DIR} CACHE FILEPATH "")
                 MARK_AS_ADVANCED(PNG_PNG_INCLUDE_DIR)
             ENDIF(PNG_FOUND)
-        ENDIF(ZLIB_FOUND)
+        ENDIF(ZLIB_FOUND)
+        FIND_DEPENDENCY(LIBXML2 libxml "libxml2" ${OSG_3RDPARTY_BIN} "D" "")
+        IF(LIBXML2_FOUND)
+            # The CMAKE find libxml module uses LIBXML2_LIBRARIES -> fill it.... kind of a hack
+            SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY} CACHE FILEPATH "" FORCE)
+            SET(LIBXML2_XMLLINT_EXECUTABLE ${OSG_3RDPARTY_BIN}/bin/xmllint.exe CACHE FILEPATH "Path to xmllint executable" FORCE)
+        ENDIF(LIBXML2_FOUND)
 #luigi#INCLUDE(FindOSGDepends.cmake)
 ENDMACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)


change version of libuv from 1_28 to 1_33

tap (train):
https://test.corp.google.com/ui#id=OCL:287864175:BASE:288298139:1578417634643:9ae99db4

all failures unrelated or flakes

PiperOrigin-RevId: 288581744

--- cmake/external/libuv.cmake
+++ cmake/external/libuv.cmake
@@ -22,7 +22,7 @@
   libuv

   GIT_REPOSITORY https://github.com/libuv/libuv
-  GIT_TAG        v1.28.0
+  GIT_TAG        v1.33.1
   GIT_SHALLOW    1

   PREFIX ${PROJECT_BINARY_DIR}
@@ -31,4 +31,4 @@
   BUILD_COMMAND ""
   INSTALL_COMMAND ""
   TEST_COMMAND ""
-)+)


Change local variable names to begin with GD_ to prevent possible
namespace contamination.

svn path=/trunk/; revision=6836

--- cmake/modules/FindGD.cmake
+++ cmake/modules/FindGD.cmake
@@ -58,33 +58,33 @@

    # Trim the list of include directories
    SET(GDINCTRIM)
-   FOREACH(DIR ${GD_INCLUDE_DIR})
-    SET(FOUND OFF)
-    FOREACH(TRIMMED ${GDINCTRIM})
-      IF ("${DIR}" STREQUAL "${TRIMMED}")
-	SET(FOUND ON)
-      ENDIF ("${DIR}" STREQUAL "${TRIMMED}")
-    ENDFOREACH(TRIMMED ${GDINCTRIM})
-    IF (NOT FOUND)
-      SET(GDINCTRIM "${GDINCTRIM}" "${DIR}")
-    ENDIF (NOT FOUND)
-  ENDFOREACH(DIR ${GD_INCLUDE_DIR})
+   FOREACH(GD_DIR ${GD_INCLUDE_DIR})
+    SET(GD_TMP_FOUND OFF)
+    FOREACH(GD_TRIMMED ${GDINCTRIM})
+      IF ("${GD_DIR}" STREQUAL "${GD_TRIMMED}")
+	SET(GD_TMP_FOUND ON)
+      ENDIF ("${GD_DIR}" STREQUAL "${GD_TRIMMED}")
+    ENDFOREACH(GD_TRIMMED ${GDINCTRIM})
+    IF (NOT GD_TMP_FOUND)
+      SET(GDINCTRIM "${GDINCTRIM}" "${GD_DIR}")
+    ENDIF (NOT GD_TMP_FOUND)
+  ENDFOREACH(GD_DIR ${GD_INCLUDE_DIR})
   SET(GD_INCLUDE_DIR ${GDINCTRIM})

   SET(GD_LIBRARY_DIR)
   # Generate trimmed list of library directories and list of libraries
-  FOREACH(LIB ${GD_LIBRARIES})
-    GET_FILENAME_COMPONENT(NEXTLIBDIR ${LIB} PATH)
-    SET(FOUND OFF)
-    FOREACH(LIBDIR ${GD_LIBRARY_DIR})
-      IF ("${NEXTLIBDIR}" STREQUAL "${LIBDIR}")
-	SET(FOUND ON)
-      ENDIF ("${NEXTLIBDIR}" STREQUAL "${LIBDIR}")
-    ENDFOREACH(LIBDIR ${GD_LIBRARIES})
-    IF (NOT FOUND)
-      SET(GD_LIBRARY_DIR "${GD_LIBRARY_DIR}" "${NEXTLIBDIR}")
-    ENDIF (NOT FOUND)
-  ENDFOREACH(LIB ${GD_LIBRARIES})
+  FOREACH(GD_LIB ${GD_LIBRARIES})
+    GET_FILENAME_COMPONENT(GD_NEXTLIBDIR ${GD_LIB} PATH)
+    SET(GD_TMP_FOUND OFF)
+    FOREACH(GD_LIBDIR ${GD_LIBRARY_DIR})
+      IF ("${GD_NEXTLIBDIR}" STREQUAL "${GD_LIBDIR}")
+	SET(GD_TMP_FOUND ON)
+      ENDIF ("${GD_NEXTLIBDIR}" STREQUAL "${GD_LIBDIR}")
+    ENDFOREACH(GD_LIBDIR ${GD_LIBRARIES})
+    IF (NOT GD_TMP_FOUND)
+      SET(GD_LIBRARY_DIR "${GD_LIBRARY_DIR}" "${GD_NEXTLIBDIR}")
+    ENDIF (NOT GD_TMP_FOUND)
+  ENDFOREACH(GD_LIB ${GD_LIBRARIES})

 ENDIF (GD_FOUND)


COMP: Use portable method to find source dir & find DCMTK headers

Change-Id: I28bce754947efa74b09d7ba7f478443378c89ed0

--- Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake
+++ Modules/ThirdParty/DCMTK/CMake/FindDCMTK.cmake
@@ -33,18 +33,11 @@
 # Upgraded for GDCM by Mathieu Malaterre.
 # Modified for EasyViz by Thomas Sondergaard.
 #
-
+if(NOT DCMTK_DIR)
+  set(DCMTK_DIR "" CACHE PATH "Directory where DCMTK lib/include files can be found")
+endif()
 # prefer DCMTK_DIR over default system paths like /usr/lib
 set(CMAKE_PREFIX_PATH ${DCMTK_DIR}/lib ${CMAKE_PREFIX_PATH}) # this is given to FIND_LIBRARY or FIND_PATH
-
-if(NOT DCMTK_FOUND AND NOT DCMTK_DIR)
-  set(DCMTK_DIR
-    "/usr/include/dcmtk/"
-    CACHE
-    PATH
-    "Root of DCMTK source tree (optional).")
-  mark_as_advanced(DCMTK_DIR)
-endif()

 # Find all libraries, store debug and release separately
 foreach(lib
@@ -90,7 +83,6 @@
     ${DCMTK_DIR}/dcmjpeg/lib${lib}/Debug
     NO_DEFAULT_PATH
     )
-
   mark_as_advanced(DCMTK_${lib}_LIBRARY_RELEASE)
   mark_as_advanced(DCMTK_${lib}_LIBRARY_DEBUG)

@@ -119,22 +111,17 @@
 endif()

 #
-# SPECIFIC CASE FOR DCMTK BUILD DIR
+# SPECIFIC CASE FOR DCMTK BUILD DIR as DCMTK_DIR
 # (as opposed to a DCMTK install dir)
-#
-# the header files are in the source directory,
-# but we don't know how to find the source directory
-# without peeking at the CMakeDirectoryInformation.cmake.
-# once we know where the source is, we can add it to the
-# paths searched for include files
-find_file(CMakeDirInfoFile
-  CMakeDirectoryInformation.cmake
-  PATHS ${DCMTK_DIR}/config/CMakeFiles
-  NO_DEFAULT_PATH
-)
-if(EXISTS ${CMakeDirInfoFile})
-  include(${CMakeDirInfoFile})
-  set(DCMTK_SOURCE_DIR ${CMAKE_RELATIVE_PATH_TOP_SOURCE})
+# Have to find the source directory.
+if(EXISTS ${DCMTK_DIR}/CMakeCache.txt)
+          load_cache(${DCMTK_DIR} READ_WITH_PREFIX "EXT"
+          DCMTK_SOURCE_DIR)
+  if(NOT EXISTS ${EXTDCMTK_SOURCE_DIR})
+    message(FATAL_ERROR
+      "DCMTK build directory references
+nonexistant DCMTK source directory ${EXTDCMTK_SOURCE_DIR}")
+  endif()
 endif()

 set(DCMTK_config_TEST_HEADER osconfig.h)
@@ -151,6 +138,8 @@
 set(DCMTK_ofstd_TEST_HEADER ofstdinc.h)
 set(DCMTK_oflog_TEST_HEADER oflog.h)
 set(DCMTK_dcmjpls_TEST_HEADER djlsutil.h)
+
+set(DCMTK_INCLUDE_DIR_NAMES)

 foreach(dir
     config
@@ -167,6 +156,10 @@
     dcmtls
     ofstd
     oflog)
+  if(EXTDCMTK_SOURCE_DIR)
+    set(SOURCE_DIR_PATH
+      ${EXTDCMTK_SOURCE_DIR}/${dir}/include/dcmtk/${dir})
+  endif()
   find_path(DCMTK_${dir}_INCLUDE_DIR
     ${DCMTK_${dir}_TEST_HEADER}
     PATHS
@@ -175,24 +168,22 @@
     ${DCMTK_DIR}/include/dcmtk/${dir}
     ${DCMTK_DIR}/${dir}/include/dcmtk/${dir}
     ${DCMTK_DIR}/include/${dir}
-    ${DCMTK_SOURCE_DIR}/${dir}/include/dcmtk/${dir}
+    ${SOURCE_DIR_PATH}
     )

   mark_as_advanced(DCMTK_${dir}_INCLUDE_DIR)
+  list(APPEND DCMTK_INCLUDE_DIR_NAMES DCMTK_${dir}_INCLUDE_DIR)

   if(DCMTK_${dir}_INCLUDE_DIR)
-    message("DCMTK_${dir}_INCLUDE_DIR=${DCMTK_${dir}_INCLUDE_DIR}")
+    # add the 'include' path so eg
+    #include "dcmtk/dcmimgle/dcmimage.h"
+    # works
+    get_filename_component(_include ${DCMTK_${dir}_INCLUDE_DIR} PATH)
+    get_filename_component(_include ${_include} PATH)
     list(APPEND
       DCMTK_INCLUDE_DIRS
-      ${DCMTK_${dir}_INCLUDE_DIR})
-    if(EXISTS ${CMakeDirInfoFile})
-      # to handle full path includes eg
-      # include "dcmtk/dcmimgle/dcmimage.h"
-      get_filename_component(dir2 ${DCMTK_${dir}_INCLUDE_DIR} PATH)
-      get_filename_component(dir2 ${dir2} PATH)
-      message("Adding ${dir2}")
-      list(APPEND DCMTK_INCLUDE_DIRS ${dir2})
-    endif()
+      ${DCMTK_${dir}_INCLUDE_DIR}
+      ${_include})
   endif()
 endforeach()

@@ -213,3 +204,7 @@

 # Compatibility: This variable is deprecated
 set(DCMTK_INCLUDE_DIR ${DCMTK_INCLUDE_DIRS})
+
+find_package_handle_standard_args(DCMTK
+  REQUIRED_VARS ${DCMTK_INCLUDE_DIR_NAMES} DCMTK_LIBRARIES
+  FAIL_MESSAGE "Please set DCMTK_DIR and re-run configure" )


Add cmake support static library builds

Add cmake support static library builds

--- Source/cmake_core.cmake
+++ Source/cmake_core.cmake
@@ -20,10 +20,8 @@
 set(GNU_LIKE "GNU,Clang,AppleClang")
 set(CLANG_LIKE "Clang,AppleClang")

-add_executable(astc${CODEC}-${ISA_SIMD})
-
-target_sources(astc${CODEC}-${ISA_SIMD}
-    PRIVATE
+add_library(astc${CODEC}-${ISA_SIMD}-static
+    STATIC
         astcenc_averages_and_directions.cpp
         astcenc_block_sizes2.cpp
         astcenc_color_quantize.cpp
@@ -48,7 +46,13 @@
         astcenc_quantization.cpp
         astcenc_symbolic_physical.cpp
         astcenc_weight_align.cpp
-        astcenc_weight_quant_xfer_tables.cpp
+        astcenc_weight_quant_xfer_tables.cpp)
+
+target_include_directories(astc${CODEC}-${ISA_SIMD}-static
+    PUBLIC
+        ${CMAKE_CURRENT_SOURCE_DIR})
+
+add_executable(astc${CODEC}-${ISA_SIMD}
         astcenccli_error_metrics.cpp
         astcenccli_image.cpp
         astcenccli_image_external.cpp
@@ -57,150 +61,161 @@
         astcenccli_toplevel.cpp
         astcenccli_toplevel_help.cpp)

-target_compile_features(astc${CODEC}-${ISA_SIMD}
+target_link_libraries(astc${CODEC}-${ISA_SIMD}
     PRIVATE
-        cxx_std_14)
-
-target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-    PRIVATE
-        # MSVC defines
-        $<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>)
-
-if(${DECOMPRESSOR})
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_DECOMPRESS_ONLY)
+        astc${CODEC}-${ISA_SIMD}-static)
+
+macro(astcenc_set_properties NAME)
+
+    target_compile_features(${NAME}
+        PRIVATE
+            cxx_std_14)
+
+    target_compile_definitions(${NAME}
+        PRIVATE
+            # MSVC defines
+            $<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>)
+
+    if(${DECOMPRESSOR})
+        target_compile_definitions(${NAME}
+            PRIVATE
+                ASTCENC_DECOMPRESS_ONLY)
+    endif()
+
+    if(${DIAGNOSTICS})
+        target_compile_definitions(${NAME}
+            PUBLIC
+                ASTCENC_DIAGNOSTICS)
+    endif()
+
+    target_compile_options(${NAME}
+        PRIVATE
+            # Use pthreads on Linux/macOS
+            $<$<PLATFORM_ID:Linux,Darwin>:-pthread>
+
+            # MSVC compiler defines
+            $<$<CXX_COMPILER_ID:MSVC>:/EHsc>
+
+            # G++ and Clang++ compiler defines
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wextra>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wpedantic>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Werror>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wshadow>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wdouble-promotion>
+
+            # Hide noise thrown up by Clang 10 and clang-cl
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unknown-warning-option>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-compat-pedantic>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-c++11-compat-pedantic>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-float-equal>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated-declarations>
+
+            # Clang 10 also throws up warnings we need to investigate (ours)
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-old-style-cast>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-cast-align>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-sign-conversion>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-implicit-int-conversion>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-shift-sign-overflow>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-format-nonliteral>
+
+            $<$<CXX_COMPILER_ID:Clang>:-Wdocumentation>)
+
+
+    target_link_options(${NAME}
+        PRIVATE
+            # Use pthreads on Linux/macOS
+            $<$<PLATFORM_ID:Linux,Darwin>:-pthread>)
+
+    # Enable LTO on release builds
+    set_property(TARGET ${NAME}
+        PROPERTY
+            INTERPROCEDURAL_OPTIMIZATION_RELEASE True)
+
+    # Use a static runtime on MSVC builds (ignored on non-MSVC compilers)
+    set_property(TARGET ${NAME}
+        PROPERTY
+            MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
+
+    # Set up configuration for SIMD ISA builds
+    if(${ISA_SIMD} MATCHES "none")
+        target_compile_definitions(${NAME}
+            PRIVATE
+                ASTCENC_NEON=0
+                ASTCENC_SSE=0
+                ASTCENC_AVX=0
+                ASTCENC_POPCNT=0
+                ASTCENC_F16C=0)
+
+    elseif(${ISA_SIMD} MATCHES "neon")
+        target_compile_definitions(${NAME}
+            PRIVATE
+                ASTCENC_NEON=1
+                ASTCENC_SSE=0
+                ASTCENC_AVX=0
+                ASTCENC_POPCNT=0
+                ASTCENC_F16C=0)
+
+    elseif(${ISA_SIMD} MATCHES "sse2")
+        target_compile_definitions(${NAME}
+            PRIVATE
+                ASTCENC_NEON=0
+                ASTCENC_SSE=20
+                ASTCENC_AVX=0
+                ASTCENC_POPCNT=0
+                ASTCENC_F16C=0)
+
+    elseif(${ISA_SIMD} MATCHES "sse4.1")
+        target_compile_definitions(${NAME}
+            PRIVATE
+                ASTCENC_NEON=0
+                ASTCENC_SSE=41
+                ASTCENC_AVX=0
+                ASTCENC_POPCNT=1
+                ASTCENC_F16C=0)
+
+        target_compile_options(${NAME}
+            PRIVATE
+                $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse4.1 -mpopcnt>)
+
+    elseif(${ISA_SIMD} MATCHES "avx2")
+        target_compile_definitions(${NAME}
+            PRIVATE
+                ASTCENC_NEON=0
+                ASTCENC_SSE=41
+                ASTCENC_AVX=2
+                ASTCENC_POPCNT=1
+                ASTCENC_F16C=1)
+
+        target_compile_options(${NAME}
+            PRIVATE
+                $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-mavx2 -mpopcnt -mf16c>
+                $<$<CXX_COMPILER_ID:MSVC>:/arch:AVX2>)
+    endif()
+
+endmacro()
+
+if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
+    string(CONCAT EXTERNAL_CXX_FLAGS
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -fno-strict-aliasing>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-unused-parameter>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-double-promotion>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-zero-as-null-pointer-constant>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-disabled-macro-expansion>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-reserved-id-macro>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-extra-semi-stmt>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-implicit-fallthrough>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-tautological-type-limit-compare>"
+            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-cast-qual>"
+            " $<$<CXX_COMPILER_ID:Clang>: -Wno-missing-prototypes>")
+
+    set_source_files_properties(astcenccli_image_external.cpp
+        PROPERTIES
+            COMPILE_FLAGS ${EXTERNAL_CXX_FLAGS})
 endif()

-if(${DIAGNOSTICS})
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_DIAGNOSTICS)
-endif()
-
-target_compile_options(astc${CODEC}-${ISA_SIMD}
-    PRIVATE
-        # Use pthreads on Linux/macOS
-        $<$<PLATFORM_ID:Linux,Darwin>:-pthread>
-
-        # MSVC compiler defines
-        $<$<CXX_COMPILER_ID:MSVC>:/EHsc>
-
-        # G++ and Clang++ compiler defines
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wextra>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wpedantic>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Werror>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wshadow>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wdouble-promotion>
-
-        # Hide noise thrown up by Clang 10 and clang-cl
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-unknown-warning-option>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-compat-pedantic>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-c++11-compat-pedantic>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-float-equal>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated-declarations>
-
-        # Clang 10 also throws up warnings we need to investigate (ours)
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-old-style-cast>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-cast-align>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-sign-conversion>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-implicit-int-conversion>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-shift-sign-overflow>
-        $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-format-nonliteral>
-
-        $<$<CXX_COMPILER_ID:Clang>:-Wdocumentation>)
-
-
-target_link_options(astc${CODEC}-${ISA_SIMD}
-    PRIVATE
-        # Use pthreads on Linux/macOS
-        $<$<PLATFORM_ID:Linux,Darwin>:-pthread>)
-
-# Enable LTO on release builds
-set_property(TARGET astc${CODEC}-${ISA_SIMD} PROPERTY
-             INTERPROCEDURAL_OPTIMIZATION_RELEASE True)
-
-# Use a static runtime on MSVC builds (ignored on non-MSVC compilers)
-set_property(TARGET astc${CODEC}-${ISA_SIMD} PROPERTY
-             MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
-
-if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
-
-    string(CONCAT EXTERNAL_CXX_FLAGS
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -fno-strict-aliasing>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-unused-parameter>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-double-promotion>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-zero-as-null-pointer-constant>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-disabled-macro-expansion>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-reserved-id-macro>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-extra-semi-stmt>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-implicit-fallthrough>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-tautological-type-limit-compare>"
-        " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-cast-qual>"
-        " $<$<CXX_COMPILER_ID:Clang>: -Wno-missing-prototypes>"
-    )
-
-
-
-    set_source_files_properties(astcenccli_image_external.cpp
-        PROPERTIES COMPILE_FLAGS ${EXTERNAL_CXX_FLAGS})
-endif()
-
-# Set up configuration for SIMD ISA builds
-if(${ISA_SIMD} MATCHES "none")
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_NEON=0
-            ASTCENC_SSE=0
-            ASTCENC_AVX=0
-            ASTCENC_POPCNT=0
-            ASTCENC_F16C=0)
-
-elseif(${ISA_SIMD} MATCHES "neon")
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_NEON=1
-            ASTCENC_SSE=0
-            ASTCENC_AVX=0
-            ASTCENC_POPCNT=0
-            ASTCENC_F16C=0)
-
-elseif(${ISA_SIMD} MATCHES "sse2")
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_NEON=0
-            ASTCENC_SSE=20
-            ASTCENC_AVX=0
-            ASTCENC_POPCNT=0
-            ASTCENC_F16C=0)
-
-elseif(${ISA_SIMD} MATCHES "sse4.1")
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_NEON=0
-            ASTCENC_SSE=41
-            ASTCENC_AVX=0
-            ASTCENC_POPCNT=1
-            ASTCENC_F16C=0)
-
-    target_compile_options(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-msse4.1 -mpopcnt>)
-
-elseif(${ISA_SIMD} MATCHES "avx2")
-    target_compile_definitions(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            ASTCENC_NEON=0
-            ASTCENC_SSE=41
-            ASTCENC_AVX=2
-            ASTCENC_POPCNT=1
-            ASTCENC_F16C=1)
-
-    target_compile_options(astc${CODEC}-${ISA_SIMD}
-        PRIVATE
-            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-mavx2 -mpopcnt -mf16c>
-            $<$<CXX_COMPILER_ID:MSVC>:/arch:AVX2>)
-endif()
+astcenc_set_properties(astc${CODEC}-${ISA_SIMD})
+
+astcenc_set_properties(astc${CODEC}-${ISA_SIMD}-static)

 install(TARGETS astc${CODEC}-${ISA_SIMD} DESTINATION ${PACKAGE_ROOT})


Updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -124,6 +124,7 @@
 # CMake module dir
 find_path(_CORRADE_MODULE_DIR
     NAMES UseCorrade.cmake CorradeLibSuffix.cmake
+    PATHS ${CMAKE_ROOT}/Modules
     PATH_SUFFIXES share/cmake/Corrade)

 include(FindPackageHandleStandardArgs)
@@ -189,6 +190,10 @@
     CORRADE_TESTSUITE_LIBRARY
     _CORRADE_MODULE_DIR)

-# Include file with macros from our module dir
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_CORRADE_MODULE_DIR}")
+# Include our module dir, if we have any
+if(NOT "${_CORRADE_MODULE_DIR}" STREQUAL "${CMAKE_ROOT}/Modules")
+    set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_CORRADE_MODULE_DIR}")
+endif()
+
+# Finalize the finding process
 include(UseCorrade)


fixed FindNPP.cmake Apple-aimed part

fixed FindNPP.cmake Apple-aimed part

--- modules/gpu/FindNPP.cmake
+++ modules/gpu/FindNPP.cmake
@@ -115,7 +115,7 @@
     # We need to add the path to cudart to the linker using rpath, since the library name for the cuda libraries is prepended with @rpath.
     get_filename_component(_cuda_path_to_npp "${CUDA_NPP_LIBRARIES}" PATH)
     if(_cuda_path_to_npp)
-        list(APPEND CUDA_NPP_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_npp}")
+        list(APPEND CUDA_NPP_LIBRARIES "-Wl,-rpath,${_cuda_path_to_npp}")
     endif()
 endif()


[CMake] Cleanup find_compiler_rt_library function [NFC]

Rename the output variable and remove the unnecessary set call.

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

--- cmake/Modules/HandleCompilerRT.cmake
+++ cmake/Modules/HandleCompilerRT.cmake
@@ -1,5 +1,4 @@
-function(find_compiler_rt_library name dest)
-  set(dest "" PARENT_SCOPE)
+function(find_compiler_rt_library name variable)
   set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${SANITIZER_COMMON_CFLAGS}
       "--rtlib=compiler-rt" "--print-libgcc-file-name")
   if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET)
@@ -14,7 +13,7 @@
   string(REPLACE "builtins" "${name}" LIBRARY_FILE "${LIBRARY_FILE}")
   if (NOT HAD_ERROR AND EXISTS "${LIBRARY_FILE}")
     message(STATUS "Found compiler-rt ${name} library: ${LIBRARY_FILE}")
-    set(${dest} "${LIBRARY_FILE}" PARENT_SCOPE)
+    set(${variable} "${LIBRARY_FILE}" PARENT_SCOPE)
   else()
     message(STATUS "Failed to find compiler-rt ${name} library")
   endif()


Use iPhone 5s simulator by default for iOS test

--- cmake/core/sugar_add_ios_gtest.cmake
+++ cmake/core/sugar_add_ios_gtest.cmake
@@ -46,6 +46,8 @@
       "${IOS_SIM}"
       "--target"
       "${targetname}"
+      "--devicetypeid"
+      "iPhone-5s"
       "--args"
       ${test_argv}
       "--configuration"


[cmake] Document that builtin_cling is not meant for general usage

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -83,7 +83,8 @@
 ROOT_BUILD_OPTION(builtin_afterimage OFF "Build bundled copy of libAfterImage")
 ROOT_BUILD_OPTION(builtin_cfitsio OFF "Build CFITSIO internally (requires network)")
 ROOT_BUILD_OPTION(builtin_clang ON "Build bundled copy of Clang")
-ROOT_BUILD_OPTION(builtin_cling ON "Build bundled copy of Cling")
+ROOT_BUILD_OPTION(builtin_cling ON "Build bundled copy of Cling. Only build with an external cling if you know what you are doing: associating ROOT commits with cling commits is tricky.")
+MARK_AS_ADVANCED(builtin_cling)
 ROOT_BUILD_OPTION(builtin_davix OFF "Build Davix internally (requires network)")
 ROOT_BUILD_OPTION(builtin_fftw3 OFF "Build FFTW3 internally (requires network)")
 ROOT_BUILD_OPTION(builtin_freetype OFF "Build bundled copy of freetype")


[CMake] (NFC) advise we need liburing to use io_uring features

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -169,7 +169,7 @@
 ROOT_BUILD_OPTION(tmva-rmva OFF "Enable support for R in TMVA")
 ROOT_BUILD_OPTION(spectrum ON "Enable support for TSpectrum")
 ROOT_BUILD_OPTION(unuran OFF "Enable support for UNURAN (package for generating non-uniform random numbers)")
-ROOT_BUILD_OPTION(uring OFF "Enable support for io_uring (requires Linux kernel >= 5.1)")
+ROOT_BUILD_OPTION(uring OFF "Enable support for io_uring (requires liburing and Linux kernel >= 5.1)")
 ROOT_BUILD_OPTION(vc OFF "Enable support for Vc (SIMD Vector Classes for C++)")
 ROOT_BUILD_OPTION(vmc OFF "Build VMC simulation library")
 ROOT_BUILD_OPTION(vdt ON "Enable support for VDT (fast and vectorisable mathematical functions)")


fixes issue 800
+ add use_msbuild arg to runsuite_common_pre.cmake for building with
  msbuild.  off by default until we know for sure it works on XP
  and elsewhere.

git-svn-id: ed337ca7cdb08c0ba29d8fe58632bb7686892c2d@1398 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -1,5 +1,5 @@
 # **********************************************************
-# Copyright (c) 2011 Google, Inc.    All rights reserved.
+# Copyright (c) 2011-2012 Google, Inc.    All rights reserved.
 # Copyright (c) 2009-2010 VMware, Inc.    All rights reserved.
 # **********************************************************

@@ -66,11 +66,12 @@
 set(arg_preload "")   # cmake file to include prior to each 32-bit build
 set(arg_preload64 "") # cmake file to include prior to each 64-bit build
 set(arg_ssh OFF)      # running over cygwin ssh: disable pdbs
-set(arg_use_nmake OFF)# use nmake instead of devenv
+set(arg_use_nmake OFF)# use nmake instead of visual studio
+set(arg_use_msbuild OFF) # use msbuild instead of devenv for visual studio
 if (UNIX)
   set(arg_use_make ON)  # use unix make
 else (UNIX)
-  set(arg_use_make OFF) # use unix make instead of devenv
+  set(arg_use_make OFF) # use unix make instead of visual studio
 endif (UNIX)
 set(arg_long OFF)     # whether to run the long suite
 set(arg_already_built OFF) # for testing w/ already-built suite
@@ -97,6 +98,9 @@
   endif (${arg} STREQUAL "ssh")
   if (${arg} STREQUAL "use_nmake")
     set(arg_use_nmake ON)
+  endif ()
+  if (${arg} STREQUAL "use_msbuild")
+    set(arg_use_msbuild ON)
   endif ()
   if (${arg} STREQUAL "use_make")
     set(arg_use_make ON)
@@ -238,6 +242,35 @@
     endif ()
   endif ()
   message("Using ${vs_generator} generators")
+  if (arg_use_msbuild)
+    find_program(MSBUILD_PROGRAM msbuild)
+    if (MSBUILD_PROGRAM)
+      set(base_cache "${base_cache}
+        CMAKE_MAKE_PROGRAM:FILEPATH=${MSBUILD_PROGRAM}")
+      # Unfortunately we have to provide all the args (setting CMAKE_MAKE_PROGRAM
+      # doesn't do it for ctest builds).  We want ALL_BUILD.vcproj for pre-VS2010
+      # and ALL_BUILD.vcxproj for VS2010.
+      if (vs_generator MATCHES "Visual Studio 10")
+        set(proj_file "ALL_BUILD.vcxproj")
+      else ()
+        set(proj_file "ALL_BUILD.vcproj")
+      endif ()
+      # Request parallel build on all available cores (sequential by default: i#800)
+      # via "/m".
+      # Configuration will be adjusted per build below.
+      set(CTEST_BUILD_COMMAND
+        "${MSBUILD_PROGRAM} ${proj_file} /p:Configuration=REPLACE_CONFIG /m")
+    else (MSBUILD_PROGRAM)
+      message("WARNING: cannot find msbuild; disabling")
+      set(arg_use_msbuild OFF)
+    endif (MSBUILD_PROGRAM)
+  endif (arg_use_msbuild)
+  if ("${cmake_ver_string}" STREQUAL "2.8.4")
+    # 2.8.4 uses msbuild by default.
+    # XXX: any way to tell other than matching version #?
+    # Request parallel build (sequential by default: i#800)
+    set(extra_build_args "/m")
+  endif ()
 endif (arg_use_make)

 function(get_default_config config builddir)
@@ -293,7 +326,10 @@
       # in the 2.8 release; going ahead and setting now.
       # For Linux these messages make little perf difference, and can help
       # diagnose errors or watch progress.
-      set(os_specific_defines "CMAKE_RULE_MESSAGES:BOOL=OFF")
+      # The messages only apply to Makefile generators, not Visual Studio.
+      if (NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Visual Studio")
+        set(os_specific_defines "CMAKE_RULE_MESSAGES:BOOL=OFF")
+      endif ()
     else (WIN32)
       set(os_specific_defines "")
     endif (WIN32)
@@ -385,9 +421,14 @@
           get_default_config(defconfig "${CTEST_BINARY_DIRECTORY}")
           set(CTEST_BUILD_CONFIGURATION "${defconfig}")
           message("building default config \"${defconfig}\"")
-          if (NOT "${build_args}" STREQUAL "")
-            set(CTEST_BUILD_FLAGS "-- ${build_args}")
+          if (NOT "${build_args}" STREQUAL "" OR
+              NOT "${extra_build_args}" STREQUAL "")
+            set(CTEST_BUILD_FLAGS "-- ${extra_build_args} ${build_args}")
           endif ()
+          if (arg_use_msbuild)
+            string(REPLACE "REPLACE_CONFIG" "${defconfig}" CTEST_BUILD_COMMAND
+              "${CTEST_BUILD_COMMAND}")
+          endif (arg_use_msbuild)
         else ()
           set(CTEST_BUILD_FLAGS "${build_args}")
         endif ()


Support multiple installed versions of Visual Studio by passing correct toolset

--- superbuild/External-Boost.cmake
+++ superbuild/External-Boost.cmake
@@ -29,13 +29,25 @@
   set(Boost_address_model 32)
 endif()

+if (MSVC_VERSION EQUAL 1500) #VS2008
+set(boost_toolset "--toolset=msvc-9.0")
+elseif(MSVC_VERSION EQUAL 1600) #VS2010
+set(boost_toolset "--toolset=msvc-10.0")
+elseif(MSVC_VERSION EQUAL 1700) #VS2012
+set(boost_toolset "--toolset=msvc-11.0")
+elseif(MSVC_VERSION EQUAL 1800) #VS2013
+set(boost_toolset "--toolset=msvc-12.0")
+elseif(MSVC_VERSION EQUAL 1900) #VS2015
+set(boost_toolset "--toolset=msvc-14.0")
+endif(MSVC_VERSION EQUAL 1500)
+
 ExternalProject_Add(Boost
   BUILD_IN_SOURCE 1
   URL ${Boost_url}
   URL_MD5 ${Boost_md5}
   UPDATE_COMMAND ""
   CONFIGURE_COMMAND ${Boost_Bootstrap_Command} --prefix=${INSTALL_DEPENDENCIES_DIR}/lib
-  BUILD_COMMAND ${Boost_b2_Command} install -j8   --prefix=${INSTALL_DEPENDENCIES_DIR} --with-thread --with-filesystem --with-system --with-date_time --with-program_options address-model=${Boost_address_model}
+  BUILD_COMMAND ${Boost_b2_Command} install -j8   --prefix=${INSTALL_DEPENDENCIES_DIR} --with-thread --with-filesystem --with-system --with-date_time --with-program_options address-model=${Boost_address_model} ${boost_toolset}
   INSTALL_COMMAND ""
 )


use libvlc 2.0.7

use libvlc 2.0.7

--- PluginConfig.cmake
+++ PluginConfig.cmake
@@ -13,7 +13,7 @@
 #if you want embed vlc into FBVLC distribution:
 # 1) place vlc into FBVLC\Win\WiX\vlc-${VLC_VERSION}
 # 2) uncomment following line
-set(VLC_VERSION "2.0.6")
+set(VLC_VERSION "2.0.7")
 # 3) run prepXXXX.cmd from FireBreath

 #unfortunately current implementation does not work :(


Find Coin3 header files on Fedora.

Find Coin3 header files on Fedora.

--- cMake/FindCoin3D.cmake
+++ cMake/FindCoin3D.cmake
@@ -71,6 +71,7 @@
    ELSE(APPLE)

   FIND_PATH(COIN3D_INCLUDE_DIR Inventor/So.h
+    /usr/include/Coin3
     /usr/include
     /usr/local/include
   )


Diagnosing by build script

Diagnosing by build script

--- appveyor.cmake
+++ appveyor.cmake
@@ -1,2 +1,3 @@
 set(BUILD_DIR C:/projects/morebin CACHE PATH "")
 set(BOOST_ROOT C:/Libraries/boost_1_60_0/lib64-msvc-14.0 CACHE_PATH "")
+set(BOOST_DIR C:/Libraries/boost_1_60_0/lib64-msvc-14.0 CACHE_PATH "")


Fixed SOURCE_GROUP definitions in BALLMacros.cmake

--- cmake/BALLMacros.cmake
+++ cmake/BALLMacros.cmake
@@ -70,27 +70,27 @@

 	### source group definition ###
 	STRING(REGEX REPLACE "/" "\\\\" S_GROUP ${GROUP})
-	SOURCE_GROUP("Source Files\\\\${S_GROUP}" FILES ${SOURCE})
+	SOURCE_GROUP("Source Files\\\\${S_GROUP}" FILES ${SOURCES})
 ENDMACRO()

-## Add the source files in SOURCES_LIST to the list
+## Add the header files in HEADERS_LIST to the list
 ## of files compiled into libBALL, and mark them as
 ## part of source group GROUP
-MACRO(ADD_BALL_SOURCES GROUP SOURCES_LIST)
-	SET(DIRECTORY source/${GROUP})
+MACRO(ADD_BALL_HEADERS GROUP HEADERS_LIST)
+	SET(DIRECTORY include/BALL/${GROUP})

 	### add full path to the filenames ###
-	SET(SOURCES)
-	FOREACH(i ${SOURCES_LIST})
-		LIST(APPEND SOURCES ${DIRECTORY}/${i})
+	SET(HEADERS)
+	FOREACH(i ${HEADERS_LIST})
+		LIST(APPEND HEADERS ${DIRECTORY}/${i})
 	ENDFOREACH()

 	### pass source file list to the upper instance ###
-	SET(BALL_sources ${BALL_sources} ${SOURCES})
+	SET(BALL_headers ${BALL_headers} ${HEADERS})

 	### source group definition ###
 	STRING(REGEX REPLACE "/" "\\\\" S_GROUP ${GROUP})
-	SOURCE_GROUP("Source Files\\\\${S_GROUP}" FILES ${SOURCE})
+	SOURCE_GROUP("Header Files\\\\${S_GROUP}" FILES ${HEADERS})
 ENDMACRO()

 ## Add a parser and corresponding lexer to libBALL
@@ -135,7 +135,7 @@

 	### source group definition ###
 	STRING(REGEX REPLACE "/" "\\\\" S_GROUP ${GROUP})
-	SOURCE_GROUP("Source Files\\\\${S_GROUP}" FILES ${SOURCE})
+	SOURCE_GROUP("Source Files\\\\${S_GROUP}" FILES ${SOURCES})
 ENDMACRO()

 ### Generate appropriate uic and moc rules for the files in UI_LIST,


Define dpf__target_link_directories for compat with old cmake

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

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -1,5 +1,6 @@
 # DISTRHO Plugin Framework (DPF)
 # Copyright (C) 2021 Jean Pierre Cimalando <jp-dev@inbox.ru>
+# Copyright (C) 2022 Filipe Coelho <falktx@falktx.com>
 #
 # SPDX-License-Identifier: ISC

@@ -201,8 +202,8 @@
   if(SDL2_FOUND)
     target_compile_definitions("${NAME}" PUBLIC "HAVE_SDL2")
     target_include_directories("${NAME}-jack" PRIVATE ${SDL2_INCLUDE_DIRS})
-    target_link_directories("${NAME}-jack" PUBLIC ${SDL2_LIBRARY_DIRS})
     target_link_libraries("${NAME}-jack" PRIVATE ${SDL2_LIBRARIES})
+    dpf__target_link_directories("${NAME}-jack" ${SDL2_LIBRARY_DIRS})
   endif()

   if(APPLE OR WIN32)
@@ -213,14 +214,14 @@
     if(ALSA_FOUND)
       target_compile_definitions("${NAME}" PUBLIC "HAVE_ALSA")
       target_include_directories("${NAME}-jack" PRIVATE ${ALSA_INCLUDE_DIRS})
-      target_link_directories("${NAME}-jack" PUBLIC ${ALSA_LIBRARY_DIRS})
       target_link_libraries("${NAME}-jack" PRIVATE ${ALSA_LIBRARIES})
+      dpf__target_link_directories("${NAME}-jack" ${ALSA_LIBRARY_DIRS})
     endif()
     if(PULSEAUDIO_FOUND)
       target_compile_definitions("${NAME}" PUBLIC "HAVE_PULSEAUDIO")
       target_include_directories("${NAME}-jack" PRIVATE ${PULSEAUDIO_INCLUDE_DIRS})
-      target_link_directories("${NAME}-jack" PUBLIC ${PULSEAUDIO_LIBRARY_DIRS})
       target_link_libraries("${NAME}-jack" PRIVATE ${PULSEAUDIO_LIBRARIES})
+      dpf__target_link_directories("${NAME}-jack" ${PULSEAUDIO_LIBRARY_DIRS})
     endif()
     if(ALSA_FOUND OR PULSEAUDIO_FOUND)
       target_compile_definitions("${NAME}" PUBLIC "HAVE_RTAUDIO")
@@ -294,8 +295,8 @@

     target_compile_definitions("${NAME}" PUBLIC "HAVE_LIBLO")
     target_include_directories("${NAME}-dssi-ui" PRIVATE ${LIBLO_INCLUDE_DIRS})
-    target_link_directories("${NAME}-dssi-ui" PUBLIC ${LIBLO_LIBRARY_DIRS})
     target_link_libraries("${NAME}-dssi-ui" PRIVATE ${LIBLO_LIBRARIES})
+    dpf__target_link_directories("${NAME}-dssi-ui" ${LIBLO_LIBRARY_DIRS})
   endif()
 endfunction()

@@ -864,6 +865,20 @@
   endif()
 endmacro()

+# dpf__target_link_directories
+# ------------------------------------------------------------------------------
+#
+# Call `target_link_directories` if cmake >= 3.13,
+# otherwise fallback to global `link_directories`.
+#
+macro(dpf__target_link_directories NAME DIRS)
+  if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.13")
+    target_link_directories("${NAME}" PUBLIC ${DIRS})
+  else()
+    link_directories(${DIRS})
+  endif()
+endmacro()
+
 # dpf__warn_once
 # ------------------------------------------------------------------------------
 #


fix FindOctave.cmake

fix FindOctave.cmake

--- cmake/FindOctave.cmake
+++ cmake/FindOctave.cmake
@@ -15,7 +15,6 @@
 #  OCTAVE_PATCH_VERSION        - patch version
 #  OCTAVE_OCT_FILE_DIR         - object files that will be dynamically loaded
 #  OCTAVE_OCT_LIB_DIR          - oct libraries
-#  OCTAVE_ROOT_DIR             - octave prefix
 #  OCTAVE_M_SITE_DIR           - .m files site dir
 #  OCTAVE_OCT_SITE_DIR         - .oct files site dir
 #
@@ -26,13 +25,6 @@
 #         [EXTENSION ext]
 #)
 #
-# To install it, you can the use the variable OCTAVE_OCT_FILE_DIR as follow:
-#  file (RELATIVE_PATH PKG_OCTAVE_OCT_SITE_DIR ${OCTAVE_ROOT_DIR} ${OCTAVE_OCT_SITE_DIR})
-#  install (
-#    TARGETS target_name
-#    DESTINATION ${PKG_OCTAVE_OCT_SITE_DIR}
-#)
-

 #=============================================================================
 # Copyright 2013, Julien Schueller
@@ -179,7 +171,7 @@

 # handle REQUIRED and QUIET options
 include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (Octave REQUIRED_VARS OCTAVE_EXECUTABLE OCTAVE_ROOT_DIR OCTAVE_INCLUDE_DIRS OCTAVE_LIBRARIES VERSION_VAR OCTAVE_VERSION_STRING)
+find_package_handle_standard_args (Octave REQUIRED_VARS OCTAVE_EXECUTABLE OCTAVE_INCLUDE_DIRS OCTAVE_LIBRARIES VERSION_VAR OCTAVE_VERSION_STRING)

 mark_as_advanced (
   OCTAVE_OCT_FILE_DIR
@@ -190,7 +182,6 @@
   OCTAVE_LIBRARIES
   OCTAVE_INCLUDE_DIR
   OCTAVE_INCLUDE_DIRS
-  OCTAVE_ROOT_DIR
   OCTAVE_VERSION_STRING
   OCTAVE_MAJOR_VERSION
   OCTAVE_MINOR_VERSION


Add omega_h to list of libraries only if option enabled

--- cmake/FindScorec.cmake
+++ cmake/FindScorec.cmake
@@ -48,7 +48,6 @@
   ma
   spr
   parma
-  apf_omega_h
   apf_zoltan
   mds
   apf
@@ -58,6 +57,13 @@
   pcu
   )

+if(ENABLE_OMEGA_H)
+  set(SCOREC_LIB_NAMES
+    ${SCOREC_LIB_NAMES}
+    apf_omega_h
+    )
+endif()
+
 scorecLibCheck("${SCOREC_LIB_NAMES}" TRUE)

 find_path(SCOREC_INCLUDE_DIR


add comment for newer cmake feature

add comment for newer cmake feature

--- cmake/LLVMIRUtil.cmake
+++ cmake/LLVMIRUtil.cmake
@@ -34,6 +34,9 @@
   set(FULL_OUT_LLVMIR_FILES "")

   llvmir_check_non_llvmir_target_properties(${IN_TRGT})
+
+  # the 3.x and above INTERFACE_SOURCES does not participate in the compilation
+  # of a target

   # if the property does not exist the related variable is not defined
   get_property(IN_FILES TARGET ${IN_TRGT} PROPERTY SOURCES)


Improved SPIRV-Tools library search on Linux (#2643)

--- cmake/TaichiCore.cmake
+++ cmake/TaichiCore.cmake
@@ -223,10 +223,16 @@
       find_library(SPIRV_OPT NAMES "SPIRV-Tools-opt" PATHS "${Vulkan_INCLUDE_DIR}/../Lib" REQUIRED)
       find_library(SPIRV_LINK NAMES "SPIRV-Tools-link" PATHS "${Vulkan_INCLUDE_DIR}/../Lib" REQUIRED)
     else ()
-      set(SPIRV_OPT SPIRV-Tools-opt)
-      set(SPIRV_TOOLS SPIRV-Tools)
-      set(SPIRV_LINK SPIRV-Tools-link)
+      get_filename_component(VULKAN_LIBRARY_PATH ${Vulkan_LIBRARY} DIRECTORY)
+      find_library(SPIRV_TOOLS NAMES "SPIRV-Tools"  PATHS ${VULKAN_LIBRARY_PATH} REQUIRED)
+      find_library(SPIRV_OPT NAMES "SPIRV-Tools-opt" PATHS ${VULKAN_LIBRARY_PATH} REQUIRED)
+      find_library(SPIRV_LINK NAMES "SPIRV-Tools-link"  PATHS ${VULKAN_LIBRARY_PATH} REQUIRED)
     endif ()
+
+    message(STATUS "SPIRV_TOOLS=" ${SPIRV_TOOLS})
+    message(STATUS "SPIRV_OPT=" ${SPIRV_OPT})
+    message(STATUS "SPIRV_LINK=" ${SPIRV_LINK})
+
     # NOTE: SPIRV-Tools-opt must come before SPIRV-Tools
     # https://github.com/KhronosGroup/SPIRV-Tools/issues/1569#issuecomment-390250792
     target_link_libraries(${CORE_LIBRARY_NAME} ${SPIRV_OPT} ${SPIRV_TOOLS} ${SPIRV_LINK})


remove TestScript

remove TestScript

see #595

--- cmake/TestScript.cmake
+++ cmake/TestScript.cmake
@@ -1,6 +0,0 @@
-set (CTEST_SOURCE_DIRECTORY /home/markus/Projekte/Elektra/current)
-set (CTEST_BINARY_DIRECTORY /home/markus/Projekte/Elektra/current/build)
-set (CTEST_COMMAND ctest)
-set ($ENV{srcdir} /home/markus/Projekte/Elektra/current/build/tests)
-
-ctest_memcheck ()


cmake: zephyr_file() now accepts BOARD and BOARD_REVISION as argument

With the introduction of #32556 changing the BOARD now prints a warning.

Zephyr provides `zephyr_file()` to look up overlays and Kconfig
fragments for a specified board, and it used to be possible and safe to
do:
```
function(my_func)
  set(BOARD <local_scope_board>)
  zephyr_file(CONF_FILES ...)
endfunction(my_func)
```

As the BOARD inside `my_func` is locally scoped, this is safe to do.
But with introduction of #32556 a warning is now printed when running
CMake.

Therefore `zephyr_file` has been extended to allow for optional BOARD
and BOARD_REVISION arguments.
If BOARD is not given as argument the current BOARD in the build system
will be used.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -1874,6 +1874,13 @@
 #                    The conf file search will return existing configuration
 #                    files for the current board.
 #                    CONF_FILES takes the following additional arguments:
+#                    BOARD <board>:             Find configuration files for specified board.
+#                    BOARD_REVISION <revision>: Find configuration files for specified board
+#                                               revision. Requires BOARD to be specified.
+#
+#                                               If no board is given the current BOARD and
+#                                               BOARD_REVISION will be used.
+#
 #                    DTS <list>:   List to populate with DTS overlay files
 #                    KCONF <list>: List to populate with Kconfig fragment files
 #                    BUILD <type>: Build type to include for search.
@@ -1892,7 +1899,7 @@
   if(${ARGV0} STREQUAL APPLICATION_ROOT)
     set(single_args APPLICATION_ROOT)
   elseif(${ARGV0} STREQUAL CONF_FILES)
-    set(single_args CONF_FILES DTS KCONF BUILD)
+    set(single_args CONF_FILES BOARD BOARD_REVISION DTS KCONF BUILD)
   endif()

   cmake_parse_arguments(FILE "" "${single_args}" "" ${ARGN})
@@ -1937,10 +1944,26 @@
   endif()

   if(FILE_CONF_FILES)
-    set(FILENAMES ${BOARD})
-
-    if(DEFINED BOARD_REVISION)
-      list(APPEND FILENAMES "${BOARD}_${BOARD_REVISION_STRING}")
+    if(DEFINED FILE_BOARD_REVISION AND NOT FILE_BOARD)
+        message(FATAL_ERROR
+          "zephyr_file(${ARGV0} <path> BOARD_REVISION ${FILE_BOARD_REVISION} ...)"
+          " given without BOARD argument, please specify BOARD"
+        )
+    endif()
+
+    if(NOT DEFINED FILE_BOARD)
+      # Defaulting to system wide settings when BOARD is not given as argument
+      set(FILE_BOARD ${BOARD})
+      if(DEFINED BOARD_REVISION)
+        set(FILE_BOARD_REVISION ${BOARD_REVISION})
+      endif()
+    endif()
+
+    set(FILENAMES ${FILE_BOARD})
+
+    if(DEFINED FILE_BOARD_REVISION)
+      string(REPLACE "." "_" revision_string ${FILE_BOARD_REVISION})
+      list(APPEND FILENAMES "${FILE_BOARD}_${revision_string}")
     endif()

     if(FILE_DTS)


Ensure that cached versions of PLD_* variables are saved when disabling
a device due to lack of libraries.

svn path=/trunk/; revision=6853

--- cmake/modules/gd.cmake
+++ cmake/modules/gd.cmake
@@ -40,9 +40,9 @@
 if(PLD_png OR PLD_jpeg OR PLD_gif)
   include(FindGD)
   if (NOT GD_FOUND)
-    set(PLD_png OFF)
-    set(PLD_jpeg OFF)
-    set(PLD_gif OFF)
+    set(PLD_png OFF CACHE BOOL "Enable png device" FORCE)
+    set(PLD_jpeg OFF CACHE BOOL "Enable jpeg device" FORCE)
+    set(PLD_gif OFF CACHE BOOL "Enable gif device" FORCE)
   else (NOT GD_FOUND)

     set(GDINCCMD ${GD_INCLUDE_DIR})
@@ -52,15 +52,15 @@

 if (GD_FOUND)
   if (NOT GD_SUPPORTS_PNG)
-    set(PLD_png OFF)
+    set(PLD_png OFF CACHE BOOL "Enable png device" FORCE)
   endif(NOT GD_SUPPORTS_PNG)

   if (NOT GD_SUPPORTS_JPEG)
-    set(PLD_jpeg OFF)
+    set(PLD_jpeg OFF CACHE BOOL "Enable jpeg device" FORCE)
   endif(NOT GD_SUPPORTS_JPEG)

   if (NOT GD_SUPPORTS_GIF)
-    set(PLD_gif OFF)
+    set(PLD_gif OFF CACHE BOOL "Enable gif device" FORCE)
   endif(NOT GD_SUPPORTS_GIF)
 endif (GD_FOUND)


Removed redundant cmake statement

Removed redundant cmake statement

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

--- CMake/BuildConfigurations/FlowBenchSegmentation.cmake
+++ CMake/BuildConfigurations/FlowBenchSegmentation.cmake
@@ -12,5 +12,3 @@
   org.mitk.gui.qt.multilabelsegmentation
   org.mitk.gui.qt.flow.segmentation
 )
-
-set(MITK_VTK_DEBUG_LEAKS OFF CACHE BOOL "Enable VTK Debug Leaks" FORCE)


FindSodium: Do not create target unconditionally (#430)

Summary:
This fixes  https://github.com/facebook/fbthrift/issues/429

Pull Request resolved: https://github.com/facebook/fbthrift/pull/430

Reviewed By: iahs

Differential Revision: D28832985

Pulled By: vitaut

fbshipit-source-id: 0719f27207d11bb7970cc43c621640c425d8f55d

--- build/fbcode_builder/CMake/FindSodium.cmake
+++ build/fbcode_builder/CMake/FindSodium.cmake
@@ -254,7 +254,10 @@
 else()
     set(_LIB_TYPE SHARED)
 endif()
-add_library(sodium ${_LIB_TYPE} IMPORTED)
+
+if(NOT TARGET sodium)
+    add_library(sodium ${_LIB_TYPE} IMPORTED)
+endif()

 set_target_properties(sodium PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES "${sodium_INCLUDE_DIR}"


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Fixed an issue with lib name clashes.

Fixed an issue with lib name clashes.

--- tools/cmake/ANHExecutable.cmake
+++ tools/cmake/ANHExecutable.cmake
@@ -134,6 +134,10 @@

     # Create the executable and link to it's library
     ADD_EXECUTABLE(${name} ${SOURCES})
+	SET_TARGET_PROPERTIES(${name}
+		PROPERTIES
+		ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
+    )

     IF(_project_deps_list_length GREATER 0)
         TARGET_LINK_LIBRARIES(${name} ${ANHEXE_DEPENDS})


Update FW: improve image resize mechanism (less cropping), for ColorCamera `preview` output and ImageManip setResize

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "37a2c71ec7b87b24fba7d6c018c701acf662c077")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "4549a0e785f7e3a5d79481c05112e5f78ceb5e4e")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Update build recipe for Vc external project

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1,6 +1,8 @@
 #---Check for installed packages depending on the build options/components eamnbled -
 include(ExternalProject)
 include(FindPackageHandleStandardArgs)
+
+set(lcgpackages http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources)
 set(repository_tarfiles http://service-spi.web.cern.ch/service-spi/external/tarFiles)

 #---On MacOSX, try to find frameworks after standard libraries or headers------------
@@ -1252,38 +1254,68 @@
 endif()

 #---Check for Vc---------------------------------------------------------------------
-if(vc OR builtin_vc)
-  if(NOT builtin_vc)
-    message(STATUS "Looking for Vc")
-    find_package(Vc 1.0 CONFIG QUIET)
+if(builtin_vc)
+  unset(Vc_FOUND)
+  unset(Vc_FOUND CACHE)
+  set(vc ON CACHE BOOL "" FORCE)
+elseif(vc)
+  if(fail-on-missing)
+    find_package(Vc 1.3.0 CONFIG QUIET REQUIRED)
+  else()
+    find_package(Vc 1.3.0 CONFIG QUIET)
     if(NOT Vc_FOUND)
-      if(fail-on-missing)
-        message(FATAL_ERROR "Vc not found. Ensure that the installation of Vc is in the CMAKE_PREFIX_PATH")
-      else()
-        message(STATUS "Vc not found. Ensure that the installation of Vc is in the CMAKE_PREFIX_PATH")
-        message(STATUS "              Alternatively, you can also enable the option 'builtin_vc' to build the Vc libraries internally")
-        message(STATUS "              For the time being switching OFF 'vc' option")
-        set(vc OFF CACHE BOOL "" FORCE)
-      endif()
-    endif()
-    set(VC_INCLUDE_DIRS ${Vc_INCLUDE_DIR})    # Missing from VcConfig.cmake
-    set(VC_LIBRARIES ${Vc_LIBRARIES})         # ROOT project name is "VC"; upstream uses "Vc".
-  endif()
-  if(builtin_vc)
-    set(vc_version 1.1.0)
-    set(VC_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX})
-    ExternalProject_Add(
-      VC
-      URL ${repository_tarfiles}/Vc-${vc_version}.tar.gz
-      INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-      LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
-      BUILD_BYPRODUCTS ${VC_LIBRARIES}
-    )
-    set(VC_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
-    set(VC_TARGET VC)
-    set(vc ON CACHE BOOL "" FORCE)
-  endif()
+      message(STATUS  "Vc library not found, support for it disabled.")
+      message(STATUS  "Please enable the option 'builtin_vc' to build Vc internally.")
+      set(vc OFF CACHE BOOL "" FORCE)
+    endif()
+  endif()
+endif()
+
+if(vc AND NOT Vc_FOUND)
+  set(Vc_VERSION "1.3.0")
+  set(Vc_PROJECT "Vc-${Vc_VERSION}")
+  set(Vc_SRC_URI "${lcgpackages}/${Vc_PROJECT}.tar.gz")
+  set(Vc_SRC_MD5 "a248e904f0b1a330ad8f37ec50cbad30")
+  set(Vc_DESTDIR "${CMAKE_BINARY_DIR}/externals/install/${Vc_PROJECT}")
+  set(Vc_ROOTDIR "${Vc_DESTDIR}/${CMAKE_INSTALL_PREFIX}")
+  set(Vc_LIBNAME "${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  set(Vc_LIBRARY "${Vc_ROOTDIR}/${_LIBDIR_DEFAULT}/${Vc_LIBNAME}")
+
+  ExternalProject_Add(${Vc_PROJECT}
+    PREFIX externals
+    URL     ${Vc_SRC_URI}
+    URL_MD5 ${Vc_SRC_MD5}
+    BUILD_IN_SOURCE 0
+    BUILD_BYPRODUCTS ${Vc_LIBRARY}
+    CMAKE_ARGS -G ${CMAKE_GENERATOR}
+               -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+               -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+               -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+               -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+               -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+               -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+    INSTALL_COMMAND env DESTDIR=${Vc_DESTDIR} ${CMAKE_COMMAND} --build . --target install
+  )
+
+  add_library(Vc STATIC IMPORTED)
+  set_property(TARGET Vc PROPERTY IMPORTED_LOCATION ${Vc_LIBRARY})
+  add_dependencies(Vc ${Vc_PROJECT})
+
+  set(Vc_LIBRARIES Vc)
+  set(Vc_INCLUDE_DIR "${Vc_ROOTDIR}/include")
+  set(Vc_CMAKE_MODULES_DIR "${Vc_ROOTDIR}/${_LIBDIR_DEFAULT}/cmake/Vc")
+
+  find_package_handle_standard_args(Vc
+    FOUND_VAR Vc_FOUND
+    REQUIRED_VARS Vc_INCLUDE_DIR Vc_LIBRARIES Vc_CMAKE_MODULES_DIR
+    VERSION_VAR Vc_VERSION)
+
+  install(DIRECTORY ${Vc_ROOTDIR}/ DESTINATION ".")
+endif()
+
+if(Vc_FOUND)
+	# Missing from VcConfig.cmake
+	set(Vc_INCLUDE_DIRS ${Vc_INCLUDE_DIR})
 endif()

 #---Check for Vdt--------------------------------------------------------------------


Force the lib location for builtin_gsl (to avoid /lib64 in some systems)

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -404,7 +404,10 @@
       # http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${gsl_version}.tar.gz
       URL ${repository_tarfiles}/gsl-${gsl_version}.tar.gz
       INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --enable-shared=no CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS}
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR>
+                        --libdir=<INSTALL_DIR>/lib
+                        --enable-shared=no
+                        CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS}
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
       BUILD_BYPRODUCTS ${GSL_LIBRARIES}
     )


Include platform dependencies first and more

- include networkWorker headers and cpp from linux directory structure

--- toolchains/raspberrypi.cmake
+++ toolchains/raspberrypi.cmake
@@ -19,6 +19,12 @@
 	message(FATAL_ERROR "Please install a C++11 compatible compiler")
 endif()

+# add sources and include headers
+find_sources_and_include_directories(
+	${PROJECT_SOURCE_DIR}/rpi/src/*.h
+	${PROJECT_SOURCE_DIR}/rpi/src/*.cpp
+	${PROJECT_SOURCE_DIR}/linux/src/netWorkerData.*)
+
 # include headers for rpi-installed libraries
 include_directories(/opt/vc/include/)
 include_directories(/opt/vc/include/interface/vcos/pthreads)
@@ -28,11 +34,6 @@
 add_subdirectory(${PROJECT_SOURCE_DIR}/core)
 include_directories(${CORE_INCLUDE_DIRS})
 include_directories(${CORE_LIBRARIES_INCLUDE_DIRS})
-
-# add sources and include headers
-find_sources_and_include_directories(
-	${PROJECT_SOURCE_DIR}/rpi/src/*.h
-	${PROJECT_SOURCE_DIR}/rpi/src/*.cpp)

 # link and build functions
 function(link_libraries)


correction forme avant => waves

correction forme avant => waves

--- tbb/FindTBB.cmake
+++ tbb/FindTBB.cmake
@@ -82,7 +82,7 @@

 SET(_TBB_LIB_PATH ${TBB_LIB_PATH})                              # copy cached value
 IF(NOT _TBB_LIB_PATH)                                           # work on copy
-	# try to find "tbb.dll/so" from the env variables
+	# try to find "(lib)tbb.dll/so" from the env variables
 	IF(MSVC)
 		find_file(_TBB_TBBDLL "tbb.dll" PATHS "" )
 	ELSE()
@@ -99,7 +99,6 @@
 			SET(_TBB_LIB_PATH ${_TBB_DLL_PATH})
 		ENDIF()
 		unset(_TBB_DLL_PATH CACHE)
-
 		#MESSAGE(STATUS "_TBB_LIB_PATH=${_TBB_LIB_PATH}")
 	ELSE()
 		MESSAGE(WARNING "!!!!!!!! ${CMAKE_SHARED_LIBRARY_PREFIX}${_TBB_TBBLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} should be in PATH/LD_LIBRARY_PATH !!!!!!!!!")
@@ -117,7 +116,7 @@

 SET(_TBB_LIB_PATH_DEBUG ${TBB_LIB_PATH_DEBUG})                              # copy cached value
 IF(NOT _TBB_LIB_PATH_DEBUG)                                                 # work on copy
-	# try to find "tbb_debug.dll/so" from the env variables
+	# try to find "(lib)tbb_debug.dll/so" from the env variables
 	IF(MSVC)
 		find_file(_TBB_TBBDLL_DEBUG "tbb_debug.dll" PATHS "" )
 	ELSE()
@@ -134,10 +133,9 @@
 			SET(_TBB_LIB_PATH_DEBUG ${_TBB_DLL_PATH_DEBUG})
 		ENDIF()
 		unset(_TBB_DLL_PATH_DEBUG CACHE)
-
 		#MESSAGE(STATUS "_TBB_LIB_PATH_DEBUG=${_TBB_LIB_PATH_DEBUG}")
 	ELSE()
-		MESSAGE(WARNING "!!!!!!!! tbb_debug${CMAKE_SHARED_LIBRARY_SUFFIX} should be in PATH/LD_LIBRARY_PATH !!!!!!!!!")
+		MESSAGE(WARNING "!!!!!!!! ${CMAKE_SHARED_LIBRARY_PREFIX}${_TBB_TBBLIB_NAME}_debug${CMAKE_SHARED_LIBRARY_SUFFIX} should be in PATH/LD_LIBRARY_PATH !!!!!!!!!")
 	ENDIF()
 	unset(_TBB_TBBDLL_DEBUG CACHE)
 ENDIF()


Revert "ENH: upgrade itk to 4.9.1 to get rid of negative spacing tolerance"

This reverts commit 6f988de4795aadc16bdb24e61f8c73fe2a9b725e.

--- SuperBuild/CMake/External_itk.cmake
+++ SuperBuild/CMake/External_itk.cmake
@@ -141,13 +141,13 @@
     )

   #later used below for _SB_ITK_DIR and then in packaging
-  set(ITK_SB_VERSION 4.9)
+  set(ITK_SB_VERSION 4.8)
   set(ITK_SB_VERSION_FULL ${ITK_SB_VERSION}.1)

   ExternalProject_Add(ITK
     PREFIX ITK
-    URL "https://sourceforge.net/projects/itk/files/itk/4.9/InsightToolkit-4.9.1.tar.gz/download"
-    URL_MD5 d52b9072dd3678069081fc5191d6a8f6
+    URL "http://sourceforge.net/projects/itk/files/itk/4.8/InsightToolkit-4.8.1.tar.gz/download"
+    URL_MD5 b1ed53604de854501cb61f34f410420e
     SOURCE_DIR ${ITK_SB_SRC}
     BINARY_DIR ${ITK_SB_BUILD_DIR}
     INSTALL_DIR ${SB_INSTALL_PREFIX}


updates to test.cmake

updates to test.cmake

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -5,16 +5,23 @@
 SET(CTEST_PROJECT_NAME "Embree")
 SET(TEST_REPOSITORY "https://github.com/embree/embree.git")

-SET(TEST_ROOT_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}/..")
-STRING(REPLACE ":/" ":\\" TEST_ROOT_DIRECTORY1 "${TEST_ROOT_DIRECTORY}") # cygwin git has issues with c:/dir paths
-#SET(TEST_MODELS_DIRECTORY ${TEST_ROOT_DIRECTORY}/dependencies/embree-models)
-SET(TEST_MODELS_DIRECTORY $ENV{HOME}/embree-models)
+# set directories
+set(CTEST_SOURCE_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}/..")
+set(CTEST_BINARY_DIRECTORY "${CTEST_SCRIPT_DIRECTORY}/../build")
+SET(TEST_MODELS_PARENT_DIRECTORY $ENV{HOME})
+SET(TEST_MODELS_DIRECTORY ${TEST_MODELS_PARENT_DIRECTORY}/embree-models)
+
+# fix slashes under windows
+IF (WIN32)
+  STRING(REPLACE "/" "\\" CTEST_SOURCE_DIRECTORY "${CTEST_SOURCE_DIRECTORY}")
+  STRING(REPLACE "/" "\\" CTEST_BINARY_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+  STRING(REPLACE "/" "\\" TEST_MODELS_PARENT_DIRECTORY "${TEST_MODELS_PARENT_DIRECTORY}")
+  STRING(REPLACE "/" "\\" TEST_MODELS_DIRECTORY "${TEST_MODELS_DIRECTORY}")
+ENDIF()
+
+MESSAGE("CTEST_SOURCE_DIRECTORY = ${CTEST_SOURCE_DIRECTORY}")
+MESSAGE("CTEST_BINARY_DIRECTORY = ${CTEST_BINARY_DIRECTORY}")
 MESSAGE("TEST_MODELS_DIRECTORY = ${TEST_MODELS_DIRECTORY}")
-
-# set source and build directory
-set(CTEST_SOURCE_DIRECTORY "${TEST_ROOT_DIRECTORY1}")
-message("CTEST_SOURCE_DIRECTORY = ${CTEST_SOURCE_DIRECTORY}")
-set(CTEST_BINARY_DIRECTORY "${TEST_ROOT_DIRECTORY1}/build")

 # update external model repository
 FIND_PROGRAM(CTEST_GIT_COMMAND NAMES git)
@@ -25,7 +32,7 @@
     MESSAGE("cloning test models ...")
     EXECUTE_PROCESS(
       COMMAND ${CTEST_GIT_COMMAND} "clone" "git@git.sdvis.org:embree-models" embree-models
-      WORKING_DIRECTORY $ENV{HOME}
+      WORKING_DIRECTORY ${TEST_MODELS_PARENT_DIRECTORY}
     )
   ELSE()
     MESSAGE("updating test models ...")


guard correct listing filename for gp regression meta example

--- cmake/FindMetaExamples.cmake
+++ cmake/FindMetaExamples.cmake
@@ -7,7 +7,7 @@
 	ENDIF()

 	IF(NOT USE_GPL_SHOGUN)
-		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_CURRENT_SOURCE_DIR}/src/gaussian_processes/gaussian_process_regression.sg)
+		LIST(REMOVE_ITEM META_EXAMPLE_LISTINGS ${CMAKE_SOURCE_DIR}/examples/meta/src/gaussian_processes/gaussian_process_regression.sg)
 	ENDIF()

 	SET(META_EXAMPLES ${META_EXAMPLE_LISTINGS} PARENT_SCOPE)


CMake: minor fix

CMake: minor fix

--- cmake/compileresources.cmake
+++ cmake/compileresources.cmake
@@ -44,7 +44,7 @@
         set(ADD_INCLUDES "")
         set(ADD_RESOURCES "")
         configure_file(${IVW_CMAKE_TEMPLATES}/shader_resource_template.h
-                   ${CMAKE_BINARY_DIR}/modules/_generated/modules/${PROJECT_NAME}/shader_resources.h)
+                   ${CMAKE_BINARY_DIR}/modules/_generated/modules/${l_project_name}/shader_resources.h)
     endif()
 endfunction()

@@ -55,13 +55,17 @@
     set(cmd "include(${IVW_ROOT_DIR}/cmake/utilities/txt2h.cmake)\n")
     set(includes "")
     set(resources "")
+
+    string(TOUPPER ${PROJECT_NAME} u_project_name)
+    string(TOLOWER ${PROJECT_NAME} l_project_name)
+
     foreach(shader_path ${ARGN})
         file(RELATIVE_PATH shaderkey ${parent_path} ${shader_path})
         string(REPLACE "/" "_" tmp ${shaderkey})
         string(REPLACE "." "_" tmp ${tmp})
         string(REPLACE " " "_" varName ${tmp})

-        set(headerpath "modules/${_projectName}/glsl/${varName}.h")
+        set(headerpath "modules/${l_project_name}/glsl/${varName}.h")

         set(outfile "${CMAKE_BINARY_DIR}/modules/_generated/${headerpath}")
         set(cmd "${cmd}ivw_generate_shader_header(\"${varName}\" \"${shader_path}\" \"${outfile}\")\n")
@@ -69,27 +73,25 @@
         set(resources "${resources}    manager->addShaderResource(\"${shaderkey}\", ${varName});\n")
     endforeach()

-    file(WRITE ${CMAKE_BINARY_DIR}/modules/${_projectName}/create_shader_resource.cmake ${cmd})
+    file(WRITE ${CMAKE_BINARY_DIR}/modules/${l_project_name}/create_shader_resource.cmake ${cmd})

-    string(TOUPPER ${_projectName} u_project_name)
     add_definitions(-D${u_project_name}_INCLUDE_SHADER_RESOURCES)

     set(U_MODULE ${u_project_name})
-    string(TOLOWER ${_projectName} l_project_name)
     set(L_MODULE ${l_project_name})
     set(ADD_INCLUDES "${includes}")
     set(ADD_RESOURCES "${resources}")
     configure_file(${IVW_CMAKE_TEMPLATES}/shader_resource_template.h
-                   ${CMAKE_BINARY_DIR}/modules/_generated/modules/${_projectName}/shader_resources.h)
+                   ${CMAKE_BINARY_DIR}/modules/_generated/modules/${l_project_name}/shader_resources.h)

-    add_custom_target("inviwo-shader-resources-${_projectName}"
-        COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/modules/${_projectName}/create_shader_resource.cmake
+    add_custom_target("inviwo-shader-resources-${l_project_name}"
+        COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/modules/${l_project_name}/create_shader_resource.cmake
         DEPENDS ${ARGN}
         WORKING_DIRECTORY ${OUTPUT_DIR}
-        COMMENT "Generating Shader resources for ${_projectName}"
+        COMMENT "Generating Shader resources for ${PROJECT_NAME}"
         VERBATIM
     )
-    set_target_properties("inviwo-shader-resources-${_projectName}" PROPERTIES FOLDER "shader-resources")
-    add_dependencies(inviwo-module-${_projectName} inviwo-shader-resources-${_projectName})
+    set_target_properties("inviwo-shader-resources-${l_project_name}" PROPERTIES FOLDER "shader-resources")
+    add_dependencies(inviwo-module-${l_project_name} inviwo-shader-resources-${l_project_name})

 endfunction()


build: collapse two checks into a single one (NFC)

Merge two cases into a single case rather than keeping them separate.
Additionally check the condition early rather than perform the action
and then revert it.  NFC.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1536,34 +1536,21 @@
   # library itself.
   if(SWIFTLIB_HAS_SWIFT_CONTENT AND NOT SWIFTLIB_IS_STDLIB_CORE)
     list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS Core)
+
+    # swiftSwiftOnoneSupport does not depend on itself, obviously.
+    if(NOT ${name} STREQUAL swiftSwiftOnoneSupport)
+      # All Swift code depends on the SwiftOnoneSupport in non-optimized mode,
+      # except for the standard library itself.
+      is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" optimized)
+      if(NOT optimized)
+        list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS SwiftOnoneSupport)
+      endif()
+    endif()
   endif()

   if((NOT "${SWIFT_BUILD_STDLIB}") AND
      (NOT "${SWIFTLIB_SWIFT_MODULE_DEPENDS}" STREQUAL ""))
-    list(REMOVE_ITEM SWIFTLIB_SWIFT_MODULE_DEPENDS
-        Core)
-  endif()
-
-  if(SWIFTLIB_HAS_SWIFT_CONTENT AND NOT SWIFTLIB_IS_STDLIB_CORE)
-    # All Swift code depends on the SwiftOnoneSupport in non-optimized mode,
-    # except for the standard library itself.
-    is_build_type_optimized("${SWIFT_STDLIB_BUILD_TYPE}" optimized)
-    if(NOT optimized)
-      list(APPEND SWIFTLIB_SWIFT_MODULE_DEPENDS SwiftOnoneSupport)
-    endif()
-  endif()
-
-  if((NOT "${SWIFT_BUILD_STDLIB}") AND
-    (NOT "${SWIFTLIB_SWIFT_MODULE_DEPENDS}" STREQUAL ""))
-    list(REMOVE_ITEM SWIFTLIB_SWIFT_MODULE_DEPENDS
-        SwiftOnoneSupport)
-  endif()
-
-  # swiftSwiftOnoneSupport does not depend on itself,
-  # obviously.
-  if("${name}" STREQUAL "swiftSwiftOnoneSupport")
-    list(REMOVE_ITEM SWIFTLIB_SWIFT_MODULE_DEPENDS
-        SwiftOnoneSupport)
+    list(REMOVE_ITEM SWIFTLIB_SWIFT_MODULE_DEPENDS Core SwiftOnoneSupport)
   endif()

   translate_flags(SWIFTLIB "${SWIFTLIB_options}")


Ruby 1.9 header files are in RbConfig[:rubyhdrdir]

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -21,11 +21,14 @@
 #   RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
 #   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`

-FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby1.8 ruby18 )
+FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby19 ruby1.8 ruby18 )

 EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['archdir']"
    OUTPUT_VARIABLE RUBY_ARCH_DIR)

+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['rubyhdrdir']"
+   OUTPUT_VARIABLE RUBY_HDR_DIR ERROR_QUIET)
+
 EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['libdir']"
    OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_PATH)

@@ -39,19 +42,13 @@
 EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitelibdir']"
    OUTPUT_VARIABLE RUBY_SITELIB_DIR)

+EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
+  OUTPUT_VARIABLE RUBY_VENDORARCH_DIR ERROR_QUIET)

-# vendor_ruby
-EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print '-rvendor-specific'"
-   OUTPUT_VARIABLE RUBY_VENDOR_ARG)
-
-IF(RUBY_VENDOR_ARG)
-    EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
-       OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
-
+IF(RUBY_VENDORARCH_DIR)
     EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorlibdir']"
        OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
-ELSE(RUBY_VENDOR_ARG)
-    MESSAGE(STATUS "'vendor-specific' not found, using 'site-specific'")
+ELSE(RUBY_VENDORARCH_DIR)

     # fall back to site*dir
     EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitearchdir']"
@@ -59,7 +56,7 @@

     EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitelibdir']"
        OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
-ENDIF(RUBY_VENDOR_ARG)
+ENDIF(RUBY_VENDORARCH_DIR)

 # this is not needed if you use "print" inside the ruby statements
 # remove the new lines from the output by replacing them with empty strings
@@ -71,8 +68,9 @@
 FIND_PATH(RUBY_INCLUDE_PATH
    NAMES ruby.h
   PATHS
+   ${RUBY_HDR_DIR}
    ${RUBY_ARCH_DIR}
-  /usr/lib/ruby/1.8/i586-linux-gnu/ )
+   /usr/lib/ruby/1.8/i586-linux-gnu/ )

 FIND_LIBRARY(RUBY_LIBRARY
   NAMES ruby ruby1.8


Add -ldl linker flag for jenkins build.

Add -ldl linker flag for jenkins build.

--- cmake_modules/FindLlvm.cmake
+++ cmake_modules/FindLlvm.cmake
@@ -60,7 +60,7 @@
 # CMake really doesn't like adding link directories and wants absolute paths
 # Reconstruct it with LLVM_MODULE_LIBS and LLVM_LIBRARY_DIR
 string(REPLACE " " ";" LIBS_LIST ${LLVM_MODULE_LIBS})
-set (LLVM_MODULE_LIBS "")
+set (LLVM_MODULE_LIBS "-ldl")
 foreach (LIB ${LIBS_LIST})
   set(LLVM_MODULE_LIBS ${LLVM_MODULE_LIBS} "${LLVM_LIBRARY_DIR}/${LIB}")
 endforeach(LIB)


set allowed core-sim warnings to 3

set allowed core-sim warnings to 3

I really hope this doesn't get abused
in the future.

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -308,7 +308,7 @@
 )

 SET(ALLOWED_WARNINGS 0)
-SET(ALLOWED_WARNINGS-sim 0)
+SET(ALLOWED_WARNINGS-sim 3)

 setup_repo()
 foreach(REPO_SUFFIX IN LISTS REPO_SUFFIXES)


disabling using static runtime under windows

--- common/cmake/msvc_post.cmake
+++ common/cmake/msvc_post.cmake
@@ -15,12 +15,12 @@
 ## ======================================================================== ##

 # optionally use static runtime library
-#OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." ON)
-#IF (EMBREE_STATIC_RUNTIME)
-#  STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
-#  STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
-#  STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-#ENDIF()
+OPTION(EMBREE_STATIC_RUNTIME "Use the static version of the C/C++ runtime library." OFF)
+IF (EMBREE_STATIC_RUNTIME)
+  STRING(REPLACE "/MDd" "/MTd" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
+  STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
+  STRING(REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
+ENDIF()

 # remove define NDEBUG and instead set define DEBUG for config RelWithDebInfo
 STRING(REPLACE "NDEBUG" "DEBUG" CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})