Added OPENTHREADS_ATOMIC_USE_MUTEX Cmake options that allows you to override the default detection of atomic implementatition, making it possible to force the use of Mutex for OpenThreads::Atomic, and as a consequence for use of Mutex for Referenced::ref/unref() counting.

--- CMakeModules/CheckAtomicOps.cmake
+++ CMakeModules/CheckAtomicOps.cmake
@@ -2,121 +2,136 @@
 # This module defines
 # OPENTHREADS_HAVE_ATOMIC_OPS

-INCLUDE(CheckCXXSourceRuns)
+OPTION(OPENTHREADS_ATOMIC_USE_MUTEX "Set to ON to force OpenThreads to use a mutex for Atmoic." OFF)

-# Do step by step checking,
-CHECK_CXX_SOURCE_RUNS("
-#include <cstdlib>
+IF (OPENTHREADS_ATOMIC_USE_MUTEX)

-int main()
-{
-   unsigned value = 0;
-   void* ptr = &value;
-   __sync_add_and_fetch(&value, 1);
-   __sync_synchronize();
-   __sync_sub_and_fetch(&value, 1);
-   if (!__sync_bool_compare_and_swap(&value, 0, 1))
-      return EXIT_FAILURE;
-
-   if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
-      return EXIT_FAILURE;
+    SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS 0)
+    SET(_OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS 0)
+    SET(_OPENTHREADS_ATOMIC_USE_SUN 0)
+    SET(_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED 0)
+    SET(_OPENTHREADS_ATOMIC_USE_BSD_ATOMIC 0)

-   return EXIT_SUCCESS;
-}
-" _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)
+    SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)

-CHECK_CXX_SOURCE_RUNS("
-#include <stdlib.h>
+ELSE()

-int main(int, const char**)
-{
-   unsigned value = 0;
-   void* ptr = &value;
-   __add_and_fetch(&value, 1);
-   __synchronize(value);
-   __sub_and_fetch(&value, 1);
-   if (!__compare_and_swap(&value, 0, 1))
-      return EXIT_FAILURE;
-
-   if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
-      return EXIT_FAILURE;
+    INCLUDE(CheckCXXSourceRuns)

-   return EXIT_SUCCESS;
-}
-" _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)
+    # Do step by step checking,
+    CHECK_CXX_SOURCE_RUNS("
+    #include <cstdlib>

-CHECK_CXX_SOURCE_RUNS("
-#include <atomic.h>
-#include <cstdlib>
+    int main()
+    {
+       unsigned value = 0;
+       void* ptr = &value;
+       __sync_add_and_fetch(&value, 1);
+       __sync_synchronize();
+       __sync_sub_and_fetch(&value, 1);
+       if (!__sync_bool_compare_and_swap(&value, 0, 1))
+          return EXIT_FAILURE;

-int main(int, const char**)
-{
-   uint_t value = 0;
-   void* ptr = &value;
-   atomic_inc_uint_nv(&value);
-   membar_consumer();
-   atomic_dec_uint_nv(&value);
-   if (0 != atomic_cas_uint(&value, 0, 1))
-      return EXIT_FAILURE;
-
-   if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
-      return EXIT_FAILURE;
+       if (!__sync_bool_compare_and_swap(&ptr, ptr, ptr))
+          return EXIT_FAILURE;

-   return EXIT_SUCCESS;
-}
-" _OPENTHREADS_ATOMIC_USE_SUN)
+       return EXIT_SUCCESS;
+    }
+    " _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)

-CHECK_CXX_SOURCE_RUNS("
-#include <windows.h>
-#include <intrin.h>
-#include <cstdlib>
+    CHECK_CXX_SOURCE_RUNS("
+    #include <stdlib.h>

-#pragma intrinsic(_InterlockedAnd)
-#pragma intrinsic(_InterlockedOr)
-#pragma intrinsic(_InterlockedXor)
+    int main(int, const char**)
+    {
+       unsigned value = 0;
+       void* ptr = &value;
+       __add_and_fetch(&value, 1);
+       __synchronize(value);
+       __sub_and_fetch(&value, 1);
+       if (!__compare_and_swap(&value, 0, 1))
+          return EXIT_FAILURE;

-int main(int, const char**)
-{
-   volatile long value = 0;
-   long data = 0;
-   long* volatile ptr = &data;
+       if (!__compare_and_swap((unsigned long*)&ptr, (unsigned long)ptr, (unsigned long)ptr))
+          return EXIT_FAILURE;

-   InterlockedIncrement(&value);
-   MemoryBarrier();
-   InterlockedDecrement(&value);
+       return EXIT_SUCCESS;
+    }
+    " _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)

-   if (0 != InterlockedCompareExchange(&value, 1, 0))
-      return EXIT_FAILURE;
+    CHECK_CXX_SOURCE_RUNS("
+    #include <atomic.h>
+    #include <cstdlib>

-   if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
-      return EXIT_FAILURE;
+    int main(int, const char**)
+    {
+       uint_t value = 0;
+       void* ptr = &value;
+       atomic_inc_uint_nv(&value);
+       membar_consumer();
+       atomic_dec_uint_nv(&value);
+       if (0 != atomic_cas_uint(&value, 0, 1))
+          return EXIT_FAILURE;

-   return EXIT_SUCCESS;
-}
-" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
+       if (ptr != atomic_cas_ptr(&ptr, ptr, ptr))
+          return EXIT_FAILURE;

-CHECK_CXX_SOURCE_RUNS("
-#include <libkern/OSAtomic.h>
+       return EXIT_SUCCESS;
+    }
+    " _OPENTHREADS_ATOMIC_USE_SUN)

-int main()
-{
-  volatile int32_t value = 0;
-  long data = 0;
-  long * volatile ptr = &data;
-
-  OSAtomicIncrement32(&value);
-  OSMemoryBarrier();
-  OSAtomicDecrement32(&value);
-  OSAtomicCompareAndSwapInt(value, 1, &value);
-  OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
-}
-" _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
+    CHECK_CXX_SOURCE_RUNS("
+    #include <windows.h>
+    #include <intrin.h>
+    #include <cstdlib>

+    #pragma intrinsic(_InterlockedAnd)
+    #pragma intrinsic(_InterlockedOr)
+    #pragma intrinsic(_InterlockedXor)

-IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
-   NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
-   NOT _OPENTHREADS_ATOMIC_USE_SUN AND
-   NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
-   NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
-           SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
+    int main(int, const char**)
+    {
+       volatile long value = 0;
+       long data = 0;
+       long* volatile ptr = &data;
+
+       InterlockedIncrement(&value);
+       MemoryBarrier();
+       InterlockedDecrement(&value);
+
+       if (0 != InterlockedCompareExchange(&value, 1, 0))
+          return EXIT_FAILURE;
+
+       if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
+          return EXIT_FAILURE;
+
+       return EXIT_SUCCESS;
+    }
+    " _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
+
+    CHECK_CXX_SOURCE_RUNS("
+    #include <libkern/OSAtomic.h>
+
+    int main()
+    {
+      volatile int32_t value = 0;
+      long data = 0;
+      long * volatile ptr = &data;
+
+      OSAtomicIncrement32(&value);
+      OSMemoryBarrier();
+      OSAtomicDecrement32(&value);
+      OSAtomicCompareAndSwapInt(value, 1, &value);
+      OSAtomicCompareAndSwapPtr(ptr, ptr, (void * volatile *)&ptr);
+    }
+    " _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
+
+    IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND
+       NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND
+       NOT _OPENTHREADS_ATOMIC_USE_SUN AND
+       NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED AND
+       NOT _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC)
+               SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
+    ENDIF()
+
 ENDIF()


added copy command so that libs can be loaded by numpy

--- numpy_eigen/cmake/add_python_export_library.cmake
+++ numpy_eigen/cmake/add_python_export_library.cmake
@@ -71,7 +71,7 @@
   set(PYTHON_LIB_DIR ${CATKIN_DEVEL_PREFIX}/${PROJECT_NAME}/lib/python2.7/dist-packages)
   add_custom_command(TARGET ${TARGET_NAME}
     POST_BUILD
-    COMMAND mdir -p ${PYTHON_LIB_DIR} && cp -v ${PYLIB_OUTPUT_FILE} ${PYTHON_LIB_DIR}/${PYLIB_SO_NAME}
+    COMMAND mkdir -p ${PYTHON_LIB_DIR} && cp -v ${PYLIB_OUTPUT_FILE} ${PYTHON_LIB_DIR}/${PYLIB_SO_NAME}
     WORKING_DIRECTORY ${CATKIN_DEVEL_PREFIX}
     COMMENT "Copying library files to python directory" )


fixes to PNG support

fixes to PNG support

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -121,7 +121,7 @@
   FIND_LIBRARY(PNG_LIBRARY libpng "${VTK_SOURCE_DIR}/IO/PNG")
   FIND_PATH(PNG_INCLUDE_PATH png.h "${VTK_SOURCE_DIR}/IO/PNG")
   FIND_PATH(ZLIB_INCLUDE_PATH zlib.h  "${VTK_SOURCE_DIR}/IO/PNG")
-  FIND_PATH(ZLIB_LIBRARY libzlib  "${VTK_SOURCE_DIR}/IO/PNG")
+  FIND_LIBRARY(ZLIB_LIBRARY zlib  "${VTK_SOURCE_DIR}/IO/PNG")
 ELSE (WIN32)
   FIND_LIBRARY(PNG_LIBRARY
     NAMES png libpng


fix binary name

fix binary name

--- arangod/dbg.cmake
+++ arangod/dbg.cmake
@@ -5,7 +5,7 @@
 set(STRIP_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/strip")
 execute_process(COMMAND mkdir -p ${STRIP_DIR})

-set(FILE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOBENCH}${CMAKE_EXECUTABLE_SUFFIX})
+set(FILE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_X}/${BIN_ARANGOD}${CMAKE_EXECUTABLE_SUFFIX})
 set(STRIP_FILE ${STRIP_DIR}/${BIN_ARANGOD}${CMAKE_EXECUTABLE_SUFFIX})
 if (NOT MSVC AND CMAKE_STRIP)
   execute_process(COMMAND "rm" -f ${STRIP_FILE})


Fix the weight computation in Sofa

Fix the weight computation in Sofa

--- CMake/Superbuild/External_SOFA.cmake
+++ CMake/Superbuild/External_SOFA.cmake
@@ -85,7 +85,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "git://public.kitware.com/Bender/SOFA.git"
-    GIT_TAG "3704279d21342969216a621b8c9b96a5cab33796"
+    GIT_TAG "2f609942ac9825d91554036d20b5529308cffafa"
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}
     LIST_SEPARATOR &&


Make queue slave parameters configurable

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

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

-list(APPEND CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/gpu-sd/CMake)
+#list(APPEND CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/gpu-sd/CMake)
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/gpu-sd/CMake)
 find_package(GPUSD 1.0.1)


[Build] Added support for AirRAC within the CMake configuration files.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -219,11 +219,18 @@
   set (SCM_IGNRD
     "/CVS/;/\\\\.svn/;/\\\\.bzr/;/\\\\.hg/;/\\\\.git/;\\\\.gitignore$")
   set (CPACK_SOURCE_IGNORE_FILES
+    "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD}"
+    CACHE STRING "CPACK will ignore these files")
+  #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)
+
+  # Initialise the source package generator with the variables above
+=======
     "${AUTOTOOLS_IGNRD};${SCM_IGNRD};${EDIT_IGNRD};${PACK_IGNRD}")
   #set (CPACK_SOURCE_IGNORE_DIRECTORY ${CPACK_SOURCE_IGNORE_FILES} .git)

   # Initialise the source package generator with the variables above
   include (InstallRequiredSystemLibraries)
+>>>>>>> trunk
   include (CPack)

   # Add a 'dist' target, similar to what is given by GNU Autotools
@@ -289,6 +296,10 @@
     if (${_arg_lower} STREQUAL "stdair")
       get_stdair (${_arg_version})
     endif (${_arg_lower} STREQUAL "stdair")
+
+    if (${_arg_lower} STREQUAL "airrac")
+      get_airrac (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airrac")

     if (${_arg_lower} STREQUAL "doxygen")
       get_doxygen (${_arg_version})
@@ -540,6 +551,38 @@
   endif (StdAir_FOUND)

 endmacro (get_stdair)
+
+# ~~~~~~~~~~ AirRAC ~~~~~~~~~
+macro (get_airrac)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires AirRAC-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires AirRAC without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (AirRAC ${_required_version} REQUIRED
+	HINTS ${WITH_AIRRAC_PREFIX})
+  if (AirRAC_FOUND)
+    #
+    message (STATUS "Found AirRAC version: ${AIRRAC_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AIRRAC_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRRAC_LIBRARIES})
+
+  else (AirRAC_FOUND)
+    set (ERROR_MSG "The AirRAC library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRRAC_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<AirRAC install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (AirRAC_FOUND)
+
+endmacro (get_airrac)

 ##############################################
@@ -1498,6 +1541,20 @@
     message (STATUS "  - STDAIR_SAMPLE_DIR .......... : ${STDAIR_SAMPLE_DIR}")
   endif (StdAir_FOUND)
 endmacro (display_stdair)
+
+# AirRAC
+macro (display_airrac)
+  if (AirRAC_FOUND)
+    message (STATUS)
+    message (STATUS "* AirRAC:")
+    message (STATUS "  - AIRRAC_VERSION ............. : ${AIRRAC_VERSION}")
+    message (STATUS "  - AIRRAC_BINARY_DIRS ......... : ${AIRRAC_BINARY_DIRS}")
+    message (STATUS "  - AIRRAC_EXECUTABLES ......... : ${AIRRAC_EXECUTABLES}")
+    message (STATUS "  - AIRRAC_LIBRARY_DIRS ........ : ${AIRRAC_LIBRARY_DIRS}")
+    message (STATUS "  - AIRRAC_LIBRARIES ........... : ${AIRRAC_LIBRARIES}")
+    message (STATUS "  - AIRRAC_INCLUDE_DIRS ........ : ${AIRRAC_INCLUDE_DIRS}")
+  endif (AirRAC_FOUND)
+endmacro (display_airrac)

 ##
 macro (display_status_all_modules)
@@ -1570,7 +1627,6 @@
   message (STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS ... : ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
   message (STATUS "CPACK_SOURCE_GENERATOR ......... : ${CPACK_SOURCE_GENERATOR}")
   message (STATUS "CPACK_SOURCE_PACKAGE_FILE_NAME . : ${CPACK_SOURCE_PACKAGE_FILE_NAME}")
-  message (STATUS "CPACK_SOURCE_IGNORE_FILES ...... : ${CPACK_SOURCE_IGNORE_FILES}")
   #
   message (STATUS)
   message (STATUS "---------------------------------")
@@ -1584,6 +1640,7 @@
   display_mysql ()
   display_soci ()
   display_stdair ()
+  display_airrac ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


[CMake][Python] The Python installation directory is now the standard one.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -113,8 +113,6 @@
   # Offer the user the choice of overriding the installation directories
   set (INSTALL_LIB_DIR ${LIBDIR} CACHE PATH
 	"Installation directory for libraries")
-  set (INSTALL_PY_LIB_DIR ${LIBDIR}/python${PYTHONLIBS_VERSION}/${PROJECT_NAME}
-	CACHE PATH "Installation directory for Python libraries")
   set (INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
   set (INSTALL_LIBEXEC_DIR CACHE PATH
 	"Installation directory for internal executables")
@@ -498,7 +496,11 @@
       PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION}")

-    # Update the list of include directories for the project
+	# Set the Python installation directory
+	set (INSTALL_PY_LIB_DIR ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PROJECT_NAME}
+	  CACHE PATH "Installation directory for Python libraries")
+
+	# Update the list of include directories for the project
     include_directories (${PYTHON_INCLUDE_DIRS})

     # Update the list of dependencies for the project
@@ -1420,7 +1422,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/${PACKAGE})
+  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


[Build] Improved the CMake macros for the Doxygen-based PDF generation.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -94,6 +94,14 @@
   # Documentation
   option (INSTALL_DOC "Set to OFF to skip build/install Documentation"
     ${_build_doc})
+
+  # Initialise a few variables
+  set (DOXYGEN_OUTPUT_REL)
+  set (REFMAN_TEX)
+  set (REFMAN_PDF)
+  set (CSS_ALL_TARGETS)
+  set (IMG_ALL_TARGETS)
+  set (MAN_ALL_TARGETS)

   # Set the library installation directory (either 32 or 64 bits)
   set (LIBDIR "lib${LIB_SUFFIX}" CACHE PATH
@@ -1728,16 +1736,20 @@
   set (REFMAN refman)
   set (TEX_GEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/latex)
   set (REFMAN_TEX ${REFMAN}.tex)
+  set (REFMAN_TEX ${REFMAN_TEX} PARENT_SCOPE)
   set (REFMAN_TEX_FULL ${TEX_GEN_DIR}/${REFMAN_TEX})

   # Add the build rule for Doxygen
-  set (DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
+  set (DOXYGEN_OUTPUT_REL html/index.html)
+  set (DOXYGEN_OUTPUT_REL ${DOXYGEN_OUTPUT_REL} PARENT_SCOPE)
+  set (DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${DOXYGEN_OUTPUT_REL})
+  set (DOXYGEN_OUTPUT ${DOXYGEN_OUTPUT} PARENT_SCOPE)
   add_custom_command (OUTPUT ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL}
 	COMMAND ${DOXYGEN_EXECUTABLE} ARGS ${DOXYGEN_CFG}
 	DEPENDS ${DOXYGEN_CFG} ${doc_SOURCES}
 	COMMENT "Generating documentation with Doxygen, from '${DOXYGEN_CFG}'...")
   # Add the 'doc' target, depending on the generated HTML documentation
-  add_custom_target (doc ALL DEPENDS ${DOXYGEN_OUTPUT})
+  add_custom_target (doc ALL DEPENDS ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL})

   ##
   # Copy the needed files into the generated HTML directory
@@ -1751,10 +1763,16 @@
 	add_custom_command (OUTPUT ${CSS_GEN_FULL_DIR}
 	  COMMAND ${CMAKE_COMMAND}
 	  ARGS -E copy ${CSS_SRC_FULL_DIR} ${CSS_GEN_FULL_DIR}
-	  DEPENDS ${DOXYGEN_OUTPUT} ${CSS_SRC_FULL_DIR}
+	  DEPENDS doc ${CSS_SRC_FULL_DIR}
 	  COMMENT "Copying style '${CSS_SRC_FULL_DIR}' into '${htmldoc_DIR}'...")
+
+	# Transpose the CSS-related operation into a target, so that CMake
+	# can handle it properly
 	add_custom_target (css_${style_SRC} ALL DEPENDS ${CSS_GEN_FULL_DIR})
+	list (APPEND CSS_ALL_TARGETS css_${style_SRC})
   endforeach (style_SRC)
+  set (CSS_ALL_TARGETS ${CSS_ALL_TARGETS} PARENT_SCOPE)
+  add_custom_target (css_style ALL DEPENDS ${CSS_ALL_TARGETS})

   # Images
   foreach (image_SRC ${image_SOURCES})
@@ -1763,10 +1781,16 @@
 	add_custom_command (OUTPUT ${IMG_GEN_FULL_DIR}
 	  COMMAND ${CMAKE_COMMAND}
 	  ARGS -E copy ${IMG_SRC_FULL_DIR} ${IMG_GEN_FULL_DIR}
-	  DEPENDS ${DOXYGEN_OUTPUT} ${IMG_SRC_FULL_DIR}
+	  DEPENDS doc ${IMG_SRC_FULL_DIR}
 	  COMMENT "Copying image '${IMG_SRC_FULL_DIR}' into '${htmldoc_DIR}'...")
+
+	# Transpose the image-related operation into a target, so that CMake
+	# can handle it properly
 	add_custom_target (img_${image_SRC} ALL DEPENDS ${IMG_GEN_FULL_DIR})
+	list (APPEND IMG_ALL_TARGETS img_${image_SRC})
   endforeach (image_SRC)
+  set (IMG_ALL_TARGETS ${IMG_ALL_TARGETS} PARENT_SCOPE)
+  add_custom_target (img_style ALL DEPENDS ${IMG_ALL_TARGETS})

   ##
   # PDF, generated by (Pdf)Latex from the Latex source file, itself generated
@@ -1774,25 +1798,21 @@
   set (REFMAN_IDX ${REFMAN}.idx)
   set (REFMAN_IDX_FULL ${TEX_GEN_DIR}/${REFMAN_IDX})
   set (REFMAN_PDF ${REFMAN}.pdf)
+  set (REFMAN_PDF ${REFMAN_PDF} PARENT_SCOPE)
   set (REFMAN_PDF_FULL ${TEX_GEN_DIR}/${REFMAN_PDF})
   # Note the "|| echo" addition to the pdflatex command, as that latter returns
   # as if there were an error.
   add_custom_command (OUTPUT ${REFMAN_IDX_FULL} ${REFMAN_PDF_FULL}
-	DEPENDS ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL}
+	DEPENDS doc css_style img_style
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "First PDF generation done."
+	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo 'First PDF generation done.'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} makeindex -q ${REFMAN_IDX}
+	ARGS -E chdir ${TEX_GEN_DIR} egrep -s 'Rerun to get cross-references right' refman.log && (cd ${TEX_GEN_DIR} && pdflatex -interaction batchmode ${REFMAN_TEX} || echo 'Second PDF generation done.') || echo 'Second PDF generation was not necessary'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "Second PDF generation done."
+	ARGS -E chdir ${TEX_GEN_DIR} egrep -s 'Rerun to get cross-references right' refman.log && (cd ${TEX_GEN_DIR} && pdflatex -interaction batchmode ${REFMAN_TEX} || echo 'Third PDF generation done.') || echo 'Third PDF generation was not necessary'
 	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} makeindex -q ${REFMAN_IDX}
-	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "Third PDF generation done."
-	COMMENT "Generating PDF Reference Manual ('${REFMAN_PDF}')..."
-	COMMAND ${CMAKE_COMMAND}
-	ARGS -E chdir ${TEX_GEN_DIR} test -f ${REFMAN_PDF} || (touch ${REFMAN_PDF} && echo "Warning: the PDF reference manual \\\('${REFMAN_PDF_FULL}'\\\) has failed to build. You can perform a simple re-build \\\('make' in the 'doc/latex' sub-directory\\\).")
-	COMMENT "Checking whether the PDF Reference Manual ('${REFMAN_PDF}') has been built...")
+	ARGS -E chdir ${TEX_GEN_DIR} test -f ${REFMAN_PDF} || (cd ${TEX_GEN_DIR} && touch ${REFMAN_PDF} && echo 'Warning: the PDF reference manual ('${REFMAN_PDF_FULL}') has failed to build. You can perform a simple re-build ('make' in the 'doc/latex' sub-directory).')
+	COMMENT "Generating PDF Reference Manual ('${REFMAN_TEX}' => '${REFMAN_PDF}')...")
   # Add the 'pdf' target, depending on the generated PDF manual
   add_custom_target (pdf ALL DEPENDS ${REFMAN_PDF_FULL})

@@ -1832,12 +1852,11 @@
   endforeach (_idx RANGE 1 9)

   # Initialise the lists gathering information for each valid manual section
-  set (man_doxy_output_list "")
-  set (man_dir_list "")
+  set (man_dir_list)

   # Parse the arguments
-  set (options "")
-  set (oneValueArgs "")
+  set (options)
+  set (oneValueArgs)

   # Added one argument option for every manual section
   foreach (man_sect ${man_section_list})
@@ -1900,9 +1919,11 @@
 		DEPENDS ${DOXYGEN_CFG${man_sect}} ${man${man_sect}_SOURCES}
 		COMMENT "Generating section ${man_sect} manual pages with Doxygen, from '${DOXYGEN_CFG${man_sect}}'...")

-	  # Add the current manual section output to the dedicated list,
-	  # so that it can then be added to the corresponding target (see below).
-	  list (APPEND man_doxy_output_list ${DOXYGEN_OUTPUT${man_sect}})
+	  # Transpose the man-page-related operation into a target, so that CMake
+	  # can handle it properly
+	  add_custom_target (man_${man_sect}
+		ALL DEPENDS ${DOXYGEN_OUTPUT${man_sect}})
+	  list (APPEND MAN_ALL_TARGETS man_${man_sect})

 	  # Specifiy what to do for the installation of the manual pages
 	  install (DIRECTORY "${man${man_sect}_DIR}" DESTINATION ${MAN_PATH})
@@ -1911,7 +1932,8 @@
   endforeach (man_sect ${man_section_list})

   # Add the 'man' target, depending on the generated manual page documentation
-  add_custom_target (man ALL DEPENDS ${man_doxy_output_list})
+  set (MAN_ALL_TARGETS ${MAN_ALL_TARGETS} PARENT_SCOPE)
+  add_custom_target (man ALL DEPENDS ${MAN_ALL_TARGETS})

   # Clean-up $build/man1 and $build/man3 on 'make clean'
   set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
@@ -2277,6 +2299,19 @@
 endmacro (display_status_all_test_suites)

 ##
+macro (display_doc_generation)
+  message (STATUS)
+    message (STATUS "* Documentation to be generated ... :")
+	if (INSTALL_DOC)
+      message (STATUS "  + HTML main page ................ : ${DOXYGEN_OUTPUT_REL}")
+      message (STATUS "  + CSS-related files ............. : ${CSS_ALL_TARGETS}")
+      message (STATUS "  + Image-related files ........... : ${IMG_ALL_TARGETS}")
+      message (STATUS "  + PDF reference manual .......... : ${REFMAN_TEX} => ${REFMAN_PDF}")
+	endif (INSTALL_DOC)
+    message (STATUS "  + Man page sections ............. : ${MAN_ALL_TARGETS}")
+endmacro (display_doc_generation)
+
+##
 macro (display_status)
   message (STATUS)
   message (STATUS "=============================================================")
@@ -2302,6 +2337,7 @@
   message (STATUS "Binaries to test .................. : ${PROJ_ALL_TST_TARGETS}")
   display_status_all_modules ()
   display_status_all_test_suites ()
+  display_doc_generation ()
   message (STATUS)
   message (STATUS "BUILD_SHARED_LIBS ................. : ${BUILD_SHARED_LIBS}")
   message (STATUS "CMAKE_BUILD_TYPE .................. : ${CMAKE_BUILD_TYPE}")


Push ParaView forward

Push ParaView forward

--- versions.cmake
+++ versions.cmake
@@ -92,7 +92,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "faf73d45cd343ac57ea39d847c11c194bdcbc68b")
+  set(_paraview_revision "9d53375abd79403a01d2a0c91bfd0ea425c77d57")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Allow disable of Buildyard bootstrap

Allow disable of Buildyard bootstrap

--- Buildyard.cmake
+++ Buildyard.cmake
@@ -15,6 +15,16 @@
 cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
 if(BUILDYARD)
   message(FATAL_ERROR "Running from within Buildyard, don't use me here")
+endif()
+
+if(RELEASE_VERSION)
+  option(DISABLE_BUILDYARD "Disable bootstrapping using Buildyard" ON)
+else()
+  option(DISABLE_BUILDYARD "Disable bootstrapping using Buildyard" OFF)
+endif()
+
+if(DISABLE_BUILDYARD)
+  return()
 endif()

 include(GitExternal)


Fix Visual Studio 2017 warning https://github.com/chriskohlhoff/asio/pull/371

--- modules/asio.cmake
+++ modules/asio.cmake
@@ -2,6 +2,12 @@

   # Module library
   file(GLOB SOURCE_FILES "asio/asio/src/*.cpp")
+  if(MSVC)
+    # C4267: 'var' : conversion from 'size_t' to 'type', possible loss of data
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4267")
+  else()
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
+  endif()
   add_library(asio ${SOURCE_FILES})
   target_compile_definitions(asio PRIVATE ASIO_STANDALONE ASIO_SEPARATE_COMPILATION)
   target_include_directories(asio PUBLIC "asio/asio/include" PUBLIC ${OPENSSL_INCLUDE_DIR})


Add bsymbolic flags to linux linker

Add bsymbolic flags to linux linker

The problem with not having these flags are:

`libhostfxr.so` and `libhostpolicy.so` would still keep using common functions that are defined in `dotnet.exe` effectively void a servicing override. Of course, servicing of common code would service both `dotnet.exe` and `libhostpolicy.so`, but this is needed to match Windows for consistency and is easier to reason about.

--- src/corehost/cli/setup.cmake
+++ src/corehost/cli/setup.cmake
@@ -37,6 +37,12 @@
     add_compile_options(-Wno-unused-local-typedef)
 endif()

+# This is required to map a symbol reference to a matching definition local to the module (.so)
+# containing the reference instead of using definitions from other modules.
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Xlinker -Bsymbolic -Bsymbolic-functions")
+endif()
+
 if(CLI_CMAKE_PLATFORM_ARCH_I386)
     add_definitions(-D_TARGET_X86_=1)
 elseif(CLI_CMAKE_PLATFORM_ARCH_AMD64)


[UPD] FindMatlab.cmake module works also for Matlab on Unix system. However, The unix part doesn't detect automatically the Matlab version. It is necessary to set the MATLAB_ROOT.

git-svn-id: ed06c97986a68fa016311908f99ed1538fbb9b5d@147 93be6e1e-6fcc-11de-baec-69240fdc299a

--- CMake/FindMatlab.cmake
+++ CMake/FindMatlab.cmake
@@ -1,9 +1,15 @@
 # - Try to find a version of Matlab and headers/library required by the
-#   used compiler. It determines the right MEX-File extension.
-# This module detects a Matlab's version between Matlab 7.0 (R14) and
-# Matlab 7.9 (r2009b).
+#   used compiler. It determines the right MEX-File extension and add
+#   a macro to help the build of MEX-functions.
+#
+# For Windows, this module detects a Matlab's version between Matlab 7.0
+# (R14) and Matlab 7.9 (r2009b).
+# The Unix part of this module doesn't detect the Matlab version. To use it,
+# it is necessary to set the MATLAB_ROOT with the path of the Matlab
+# installation.
 #
 # This module defines:
+#  MATLAB_ROOT: Matlab installation path
 #  MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
 #  MATLAB_MEX_LIBRARY: path to libmex.lib
 #  MATLAB_MX_LIBRARY:  path to libmx.lib
@@ -16,18 +22,15 @@
 #  - function's name which will be called in Matlab;
 #  - C/C++ source files;
 #  - third libraries required.
-#
-# This module was tested with Matlab 7.0, 7.4 and 7.7 on a win32 system
-# with the compiler cl 9.0 (Microsoft Visual C++ Express edition 2008).

 # Copyright (c) 2009 Arnaud Barré <arnaud.barre@gmail.com>
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

-IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+IF(MATLAB_ROOT AND MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
    # in cache already
    SET(Matlab_FIND_QUIETLY TRUE)
-ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
+ENDIF(MATLAB_ROOT AND MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)

 IF(WIN32)
   SET(MATLAB_PATHS
@@ -67,6 +70,11 @@
   ELSE(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$")
     MESSAGE("Matlab Mex files are only supported by MS Visual Studio")
   ENDIF(CMAKE_CXX_COMPILER MATCHES "^.*cl.exe$")
+
+  # LIBMEX, LIBMX, LIBENG names
+  SET(LIBMEX "libmex")
+  SET(LIBMX "libmx")
+  SET(LIBENG "libeng")
 ELSE(WIN32)
   # MEX files extension
   IF(APPLE)
@@ -75,50 +83,38 @@
     ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386)
       SET(MATLAB_MEXFILE_EXT mexmac)
     ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386)
+    SET(LIBMEX "libmex.dylib")
+    SET(LIBMX "libmx.dylib")
+    SET(LIBENG "libeng.dylib")
    ELSE(APPLE)
     SET(MATLAB_MEXFILE_EXT mexglx)
+    SET(LIBMEX "libmex.so")
+    SET(LIBMX "libmx.so")
+    SET(LIBENG "libeng.so")
   ENDIF(APPLE)

-  MESSAGE(STATUS "FindMatlab.cmake needs a way to determine the Matlab version on Linux/Apple.\nYou should need to set MATLAB_ENG_LIBRARY, MATLAB_MX_LIBRARY, MATLAB_MEX_LIBRARY\n and MATLAB_INCLUDE_DIR manualy.")
-  SET(MATLAB_VERSION "Matlab-7.8")
+  FIND_PATH(MATLAB_ROOT "license.txt" ${MATLAB_PATHS})
   IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
     # Regular x86
-    SET(MATLAB_ROOT
-      /usr/local/${MATLAB_VERSION}/bin/glnx86/
-      /opt/${MATLAB_VERSION}/bin/glnx86/
-      $ENV{HOME}/${MATLAB_VERSION}/bin/glnx86/
-      $ENV{HOME}/redhat-matlab/bin/glnx86/
-      )
+    SET(MATLAB_LIBRARIES_PATHS "${MATLAB_ROOT}/bin/glnx86")
   ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
     # AMD64:
-    SET(MATLAB_ROOT
-      /usr/local/${MATLAB_VERSION}/bin/glnxa64/
-      /opt/${MATLAB_VERSION}/bin/glnxa64/
-      $ENV{HOME}/matlab7_64/bin/glnxa64/
-      $ENV{HOME}/${MATLAB_VERSION}/bin/glnxa64/
-      $ENV{HOME}/redhat-matlab/bin/glnxa64/
-      )
+    SET(MATLAB_LIBRARIES_PATHS "${MATLAB_ROOT}/bin/glnxa64")
   ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)

-  SET(MATLAB_LIBRARIES_PATHS
-    ${MATLAB_ROOT})
-  SET(MATLAB_INCLUDE_PATHS
-    "/usr/local/${MATLAB_VERSION}/extern/include/"
-    "/opt/${MATLAB_VERSION}/extern/include/"
-    "$ENV{HOME}/${MATLAB_VERSION}/extern/include/"
-    "$ENV{HOME}/redhat-matlab/extern/include/")
+  SET(MATLAB_INCLUDE_PATHS "${MATLAB_ROOT}/extern/include/")
 ENDIF(WIN32)

 FIND_LIBRARY(MATLAB_MEX_LIBRARY
-    libmex
+    ${LIBMEX}
     ${MATLAB_LIBRARIES_PATHS}
     )
 FIND_LIBRARY(MATLAB_MX_LIBRARY
-    libmx
+    ${LIBMX}
     ${MATLAB_LIBRARIES_PATHS}
     )
 FIND_LIBRARY(MATLAB_ENG_LIBRARY
-    libeng
+    ${LIBENG}
     ${MATLAB_LIBRARIES_PATHS}
     )
 FIND_PATH(MATLAB_INCLUDE_DIR
@@ -134,7 +130,6 @@
 )

 # Macros for building MEX-files
-
 MACRO(MATLAB_EXTRACT_SOURCES_LIBRARIES sources thirdlibraries)
   SET(${sources})
   SET(${thirdlibraries})
@@ -161,7 +156,7 @@
 ENDMACRO(MATLAB_MEX_CREATE)

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Matlab DEFAULT_MSG MATLAB_INCLUDE_DIR MATLAB_MEX_LIBRARY MATLAB_MX_LIBRARY MATLAB_ENG_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Matlab DEFAULT_MSG MATLAB_ROOT MATLAB_INCLUDE_DIR MATLAB_MEX_LIBRARY MATLAB_MX_LIBRARY MATLAB_ENG_LIBRARY)

 MARK_AS_ADVANCED(
   MATLAB_ROOT
@@ -170,5 +165,5 @@
   MATLAB_ENG_LIBRARY
   MATLAB_LIBRARIES
   MATLAB_INCLUDE_DIR
-  MATLAB_MEXFILE_EXT:
+  MATLAB_MEXFILE_EXT
 )


fixed: don't complain on windows

fixed: don't complain on windows

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@1930 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/FindOpenSG.cmake
+++ CMake/FindOpenSG.cmake
@@ -132,9 +132,11 @@

   ENDIF(OpenSG_${UPPERCOMPONENT}_LIBRARY_DEBUG)

-  SET_TARGET_PROPERTIES(${COMPONENT}Lib PROPERTIES
-                        ${OSG_IMP_RELEASE}
-                        ${OSG_IMP_DEBUG}        )
+  IF(OSG_IMP_RELEASE OR OSG_IMP_DEBUG)
+    SET_TARGET_PROPERTIES(${COMPONENT}Lib PROPERTIES
+                          ${OSG_IMP_RELEASE}
+                          ${OSG_IMP_DEBUG}        )
+  ENDIF(OSG_IMP_RELEASE OR OSG_IMP_DEBUG)
 ENDFUNCTION(SETUP_OSG_LIB_TARGETS)

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


cutting build times by another 25%

cutting build times by another 25%

--- build/build.cmake
+++ build/build.cmake
@@ -35,14 +35,14 @@
     ${root}/build/build.cmake
 )

-add_library(platform OBJECT
+add_library(platform
   ${PUBLIC_HDRS}
   ${SRCS}
   ${BUILD}
 )

-settingsCR(platform)
-createPCH(platform)
+settingsCR(platform)
+usePCH(platform core)

 target_include_directories(platform PUBLIC "${root}/inc")
 target_link_libraries(platform PUBLIC
@@ -69,8 +69,8 @@
 )

 add_executable(platform_tests
-					${SRCS})
-createPCH(platform_tests)
+					${SRCS})
+usePCH(platform_tests core)

 target_link_libraries(platform_tests
 	doctest


Moved compiler identification earlier

Moved compiler identification earlier

--- build/macros.cmake
+++ build/macros.cmake
@@ -5,251 +5,7 @@
 set(ORK_MACROS_INCLUDED 1)

 ####################
-#Variable section
-####################
-
-macro(ensure_non_empty _var)
-	if(NOT ${_var})
-		message(FATAL_ERROR "Error: ${${_var}} not defined")
-	endif()
-endmacro()
-
-macro(mark_as_internal _var)
-	ensure_non_empty(${_var})
-	mark_as_advanced(${_var})
-	set(${_var} "${${_var}}" CACHE INTERNAL "" FORCE)
-endmacro()
-
-macro(set_as_internal _var _val)
-	mark_as_advanced(${_var})
-	set(${_var} "${_val}" CACHE INTERNAL "" FORCE)
-endmacro()
-
-macro(append_string_internal _var _str)
-	ensure_non_empty(${_var})
-	mark_as_advanced(${_var})
-	if(NOT DEFINED ORK_CMAKE_RUN_ONCE)
-		message(FATAL_ERROR "Error: ORK_CMAKE_RUN_ONCE not defined")
-	elseif(${ORK_CMAKE_RUN_ONCE})
-		set(${_var} "${${_var}} ${_str}" CACHE INTERNAL "" FORCE)
-	endif()
-endmacro()
-
-macro(append_as_internal _var _val)
-	ensure_non_empty(${_var})
-	mark_as_advanced(${_var})
-	if(NOT DEFINED ORK_CMAKE_RUN_ONCE)
-		message(FATAL_ERROR "Error: ORK_CMAKE_RUN_ONCE not defined")
-	elseif(${ORK_CMAKE_RUN_ONCE})
-		set(${_var} "${${_var}} ${${_val}}" CACHE INTERNAL "" FORCE)
-	endif()
-endmacro()
-
-macro(mark_empty_internal _var)
-	if(${_var})
-		message(FATAL_ERROR "Error: ${${_var}} defined")
-	endif()
-	mark_as_advanced(${_var})
-	set(${_var} "" CACHE INTERNAL "" FORCE)
-endmacro()
-
-####################
-#Global section
-####################
-
-macro(ork_pre_project_config)
-	set(CMAKE_SUPPRESS_REGENERATION OFF) #Projects can be run on machines without CMake installed
-	set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-	set(ORK_USE_SOLUTION_FOLDERS ON)
-
-
-	if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
-	  message(FATAL_ERROR "Prevented in-tree built. Call cmake from outside source tree.")
-	endif()
-
-
-	if(NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
-		message(FATAL_ERROR "Error: Only x64 targets are supported")
-	endif()
-
-
-	#Used for concatenating to avoid repeats
-	if(NOT ORK_CMAKE_RAN_INTERNAL)
-		set(ORK_CMAKE_RUN_ONCE ON)
-	else()
-		set(ORK_CMAKE_RUN_ONCE OFF)
-	endif()
-	set_as_internal(ORK_CMAKE_RAN_INTERNAL ON)
-
-
-	#Must be set before PROJECT to hide
-	set(CMAKE_CONFIGURATION_TYPES Debug Release)
-	mark_as_internal(CMAKE_CONFIGURATION_TYPES)
-
-	set(ORK_PRE_PROJECT_CONFIGURED ON)
-endmacro()
-
-####################
-#Option section
-####################
-
-macro(detect_option_flag _var _msg _val)
-	if(DEFINED ${_var})
-		option(${_var} "${_msg}" "${${_var}}")
-	else()
-		option(${_var} "${_msg}" "${_val}")
-	endif()
-endmacro()
-
-macro(detect_option _var _msg _val)
-	if(NOT DEFINED ${_var})
-		set(${_var} "${_val}" CACHE STRING "${_msg}")
-	endif()
-endmacro()
-
-macro(detect_option_path _var _msg _val)
-	if(NOT DEFINED ${_var})
-		set(${_var} "${_val}" CACHE PATH "${_msg}")
-	endif()
-endmacro()
-
-macro(detect_path _var _val1 _val2)
-	if(EXISTS "${_val1}")
-		set(${_var} "${_val1}")
-	elseif(EXISTS "${_val2}")
-		set(${_var} "${_val2}")
-	else()
-		message(FATAL_ERROR "Cannot find path ${_val1} or ${_val2}")
-	endif()
-endmacro()
-
-macro(find_3p_path _build _var _val1 _val2)
-	if(NOT ${_build})
-		# Do nothing
-	elseif(${_var})
-		# Allow override
-	else()
-		detect_path(${_var} "${ORK_3P_SOURCE_DIR}/${_val1}" "${ORK_3P_SOURCE_DIR}/${_val2}")
-	endif()
-endmacro()
-
-####################
-#Install section
-####################
-
-macro(parse_version _ver _prefix)
-	set(VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+")
-	if(${_ver} MATCHES ${VERSION_REGEX})
-		string(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${_ver})
-		list(GET VERSION_PARTS 0 ${_prefix}_MAJOR)
-		list(GET VERSION_PARTS 1 ${_prefix}_MINOR)
-		list(GET VERSION_PARTS 2 ${_prefix}_PATCH)
-	else()
-		message(FATAL_ERROR "Invalid version: ${${_ver}}")
-	endif()
-endmacro()
-
-macro(install_exe _targ)
-	if(NOT SKIP_INSTALL_ALL)
-		install(
-			TARGETS ${_targ}
-			RUNTIME DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Runtime
-		)
-	endif()
-endmacro()
-
-macro(install_bin _targ)
-	if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
-		install(
-			TARGETS ${_targ}
-			ARCHIVE DESTINATION "${ORK_INSTALL_LIB_DIR}" COMPONENT Development
-		)
-		install(
-			FILES $<TARGET_PDB_FILE:${_targ}> DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Development OPTIONAL
-		)
-	endif()
-	if(NOT SKIP_INSTALL_RUNTIME AND NOT SKIP_INSTALL_ALL)
-		install(
-			TARGETS ${_targ}
-			RUNTIME DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Runtime
-		)
-	endif()
-endmacro()
-
-macro(install_headers _head _dest)
-	if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
-		install(
-			FILES ${_head}
-			DESTINATION "${_dest}"
-			COMPONENT Development
-		)
-	endif()
-endmacro()
-
-macro(install_header_dir _dir _dest _exclude)
-	if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
-		install(
-			DIRECTORY "${_dir}/" #Note trailing slash
-			DESTINATION "${_dest}"
-			COMPONENT Development
-			PATTERN "${_exclude}" EXCLUDE
-		)
-	endif()
-endmacro()
-
-macro(install_shared _targ _head)
-	install_bin(${_targ})
-	install_headers(${_head} "${ORK_INSTALL_INC_DIR}")
-endmacro()
-
-macro(install_file_or_directory _file_or_dir _dest)
-	if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
-		if(IS_DIRECTORY "${_file_or_dir}")
-			install(
-				DIRECTORY "${_file_or_dir}/" #Note trailing slash
-				DESTINATION "${_dest}"
-				COMPONENT Runtime
-			)
-		else()
-			install(
-				FILES "${_file_or_dir}"
-				DESTINATION  "${_dest}"
-				COMPONENT Runtime
-			)
-		endif()
-	endif()
-endmacro()
-
-macro(ork_install_config)
-	if(DEFINED ORK_INSTALL_PREFIX AND ORK_INSTALL_PREFIX) #We set this previously
-		file(TO_CMAKE_PATH "${ORK_INSTALL_PREFIX}" ORK_INSTALL_PREFIX)
-	elseif(DEFINED CMAKE_INSTALL_PREFIX AND CMAKE_INSTALL_PREFIX)
-		detect_option_path(ORK_INSTALL_PREFIX "Path of install directory" "${CMAKE_INSTALL_PREFIX}")
-	else()
-		detect_option_path(ORK_INSTALL_PREFIX "Path of install directory" "${CMAKE_SOURCE_DIR}/../bin")
-	endif()
-	set_as_internal(CMAKE_INSTALL_PREFIX "${ORK_INSTALL_PREFIX}")
-
-	detect_option(ORK_INSTALL_BIN_SUFFIX "Subdirectory for installation of executables and shared libraries" bin)
-	detect_option(ORK_INSTALL_INC_SUFFIX "Subdirectory for installation of headers" inc)
-	detect_option(ORK_INSTALL_LIB_SUFFIX "Subdirectory for installation of static libraries and archives" lib)
-	set(ORK_INSTALL_BIN_DIR "${ORK_INSTALL_PREFIX}/${ORK_INSTALL_BIN_SUFFIX}")
-	set(ORK_INSTALL_INC_DIR "${ORK_INSTALL_PREFIX}/${ORK_INSTALL_INC_SUFFIX}")
-	set(ORK_INSTALL_LIB_DIR "${ORK_INSTALL_PREFIX}/${ORK_INSTALL_LIB_SUFFIX}")
-
-
-	#Build output, not that it is usually used without installing
-	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${ORK_INSTALL_LIB_SUFFIX}")
-	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${ORK_INSTALL_BIN_SUFFIX}")
-
-	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${ORK_INSTALL_LIB_SUFFIX}")
-	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${ORK_INSTALL_BIN_SUFFIX}")
-
-	set(ORK_INSTALL_CONFIGURED ON)
-endmacro()
-
-####################
-#Compiler section
+#Basic compiler identification
 ####################

 macro(get_compiler_name _var)
@@ -276,6 +32,254 @@
 	endif()
 endmacro()

+####################
+#Variable section
+####################
+
+macro(ensure_non_empty _var)
+	if(NOT ${_var})
+		message(FATAL_ERROR "Error: ${${_var}} not defined")
+	endif()
+endmacro()
+
+macro(mark_as_internal _var)
+	ensure_non_empty(${_var})
+	mark_as_advanced(${_var})
+	set(${_var} "${${_var}}" CACHE INTERNAL "" FORCE)
+endmacro()
+
+macro(set_as_internal _var _val)
+	mark_as_advanced(${_var})
+	set(${_var} "${_val}" CACHE INTERNAL "" FORCE)
+endmacro()
+
+macro(append_string_internal _var _str)
+	ensure_non_empty(${_var})
+	mark_as_advanced(${_var})
+	if(NOT DEFINED ORK_CMAKE_RUN_ONCE)
+		message(FATAL_ERROR "Error: ORK_CMAKE_RUN_ONCE not defined")
+	elseif(${ORK_CMAKE_RUN_ONCE})
+		set(${_var} "${${_var}} ${_str}" CACHE INTERNAL "" FORCE)
+	endif()
+endmacro()
+
+macro(append_as_internal _var _val)
+	ensure_non_empty(${_var})
+	mark_as_advanced(${_var})
+	if(NOT DEFINED ORK_CMAKE_RUN_ONCE)
+		message(FATAL_ERROR "Error: ORK_CMAKE_RUN_ONCE not defined")
+	elseif(${ORK_CMAKE_RUN_ONCE})
+		set(${_var} "${${_var}} ${${_val}}" CACHE INTERNAL "" FORCE)
+	endif()
+endmacro()
+
+macro(mark_empty_internal _var)
+	if(${_var})
+		message(FATAL_ERROR "Error: ${${_var}} defined")
+	endif()
+	mark_as_advanced(${_var})
+	set(${_var} "" CACHE INTERNAL "" FORCE)
+endmacro()
+
+####################
+#Global section
+####################
+
+macro(ork_pre_project_config)
+	set(CMAKE_SUPPRESS_REGENERATION OFF) #Projects can be run on machines without CMake installed
+	set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+	set(ORK_USE_SOLUTION_FOLDERS ON)
+
+
+	if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
+	  message(FATAL_ERROR "Prevented in-tree built. Call cmake from outside source tree.")
+	endif()
+
+
+	if(NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+		message(FATAL_ERROR "Error: Only x64 targets are supported")
+	endif()
+
+
+	#Used for concatenating to avoid repeats
+	if(NOT ORK_CMAKE_RAN_INTERNAL)
+		set(ORK_CMAKE_RUN_ONCE ON)
+	else()
+		set(ORK_CMAKE_RUN_ONCE OFF)
+	endif()
+	set_as_internal(ORK_CMAKE_RAN_INTERNAL ON)
+
+
+	#Must be set before PROJECT to hide
+	set(CMAKE_CONFIGURATION_TYPES Debug Release)
+	mark_as_internal(CMAKE_CONFIGURATION_TYPES)
+
+	set(ORK_PRE_PROJECT_CONFIGURED ON)
+endmacro()
+
+####################
+#Option section
+####################
+
+macro(detect_option_flag _var _msg _val)
+	if(DEFINED ${_var})
+		option(${_var} "${_msg}" "${${_var}}")
+	else()
+		option(${_var} "${_msg}" "${_val}")
+	endif()
+endmacro()
+
+macro(detect_option _var _msg _val)
+	if(NOT DEFINED ${_var})
+		set(${_var} "${_val}" CACHE STRING "${_msg}")
+	endif()
+endmacro()
+
+macro(detect_option_path _var _msg _val)
+	if(NOT DEFINED ${_var})
+		set(${_var} "${_val}" CACHE PATH "${_msg}")
+	endif()
+endmacro()
+
+macro(detect_path _var _val1 _val2)
+	if(EXISTS "${_val1}")
+		set(${_var} "${_val1}")
+	elseif(EXISTS "${_val2}")
+		set(${_var} "${_val2}")
+	else()
+		message(FATAL_ERROR "Cannot find path ${_val1} or ${_val2}")
+	endif()
+endmacro()
+
+macro(find_3p_path _build _var _val1 _val2)
+	if(NOT ${_build})
+		# Do nothing
+	elseif(${_var})
+		# Allow override
+	else()
+		detect_path(${_var} "${ORK_3P_SOURCE_DIR}/${_val1}" "${ORK_3P_SOURCE_DIR}/${_val2}")
+	endif()
+endmacro()
+
+####################
+#Install section
+####################
+
+macro(parse_version _ver _prefix)
+	set(VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+")
+	if(${_ver} MATCHES ${VERSION_REGEX})
+		string(REGEX MATCHALL "[0-9]+|-([A-Za-z0-9_]+)" VERSION_PARTS ${_ver})
+		list(GET VERSION_PARTS 0 ${_prefix}_MAJOR)
+		list(GET VERSION_PARTS 1 ${_prefix}_MINOR)
+		list(GET VERSION_PARTS 2 ${_prefix}_PATCH)
+	else()
+		message(FATAL_ERROR "Invalid version: ${${_ver}}")
+	endif()
+endmacro()
+
+macro(install_exe _targ)
+	if(NOT SKIP_INSTALL_ALL)
+		install(
+			TARGETS ${_targ}
+			RUNTIME DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Runtime
+		)
+	endif()
+endmacro()
+
+macro(install_bin _targ)
+	if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
+		install(
+			TARGETS ${_targ}
+			ARCHIVE DESTINATION "${ORK_INSTALL_LIB_DIR}" COMPONENT Development
+		)
+		install(
+			FILES $<TARGET_PDB_FILE:${_targ}> DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Development OPTIONAL
+		)
+	endif()
+	if(NOT SKIP_INSTALL_RUNTIME AND NOT SKIP_INSTALL_ALL)
+		install(
+			TARGETS ${_targ}
+			RUNTIME DESTINATION "${ORK_INSTALL_BIN_DIR}" COMPONENT Runtime
+		)
+	endif()
+endmacro()
+
+macro(install_headers _head _dest)
+	if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
+		install(
+			FILES ${_head}
+			DESTINATION "${_dest}"
+			COMPONENT Development
+		)
+	endif()
+endmacro()
+
+macro(install_header_dir _dir _dest _exclude)
+	if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
+		install(
+			DIRECTORY "${_dir}/" #Note trailing slash
+			DESTINATION "${_dest}"
+			COMPONENT Development
+			PATTERN "${_exclude}" EXCLUDE
+		)
+	endif()
+endmacro()
+
+macro(install_shared _targ _head)
+	install_bin(${_targ})
+	install_headers(${_head} "${ORK_INSTALL_INC_DIR}")
+endmacro()
+
+macro(install_file_or_directory _file_or_dir _dest)
+	if(NOT SKIP_INSTALL_FILES AND NOT SKIP_INSTALL_ALL)
+		if(IS_DIRECTORY "${_file_or_dir}")
+			install(
+				DIRECTORY "${_file_or_dir}/" #Note trailing slash
+				DESTINATION "${_dest}"
+				COMPONENT Runtime
+			)
+		else()
+			install(
+				FILES "${_file_or_dir}"
+				DESTINATION  "${_dest}"
+				COMPONENT Runtime
+			)
+		endif()
+	endif()
+endmacro()
+
+macro(ork_install_config)
+	if(DEFINED ORK_INSTALL_PREFIX AND ORK_INSTALL_PREFIX) #We set this previously
+		file(TO_CMAKE_PATH "${ORK_INSTALL_PREFIX}" ORK_INSTALL_PREFIX)
+	elseif(DEFINED CMAKE_INSTALL_PREFIX AND CMAKE_INSTALL_PREFIX)
+		detect_option_path(ORK_INSTALL_PREFIX "Path of install directory" "${CMAKE_INSTALL_PREFIX}")
+	else()
+		detect_option_path(ORK_INSTALL_PREFIX "Path of install directory" "${CMAKE_SOURCE_DIR}/../bin")
+	endif()
+	set_as_internal(CMAKE_INSTALL_PREFIX "${ORK_INSTALL_PREFIX}")
+
+	detect_option(ORK_INSTALL_BIN_SUFFIX "Subdirectory for installation of executables and shared libraries" bin)
+	detect_option(ORK_INSTALL_INC_SUFFIX "Subdirectory for installation of headers" inc)
+	detect_option(ORK_INSTALL_LIB_SUFFIX "Subdirectory for installation of static libraries and archives" lib)
+	set(ORK_INSTALL_BIN_DIR "${ORK_INSTALL_PREFIX}/${ORK_INSTALL_BIN_SUFFIX}")
+	set(ORK_INSTALL_INC_DIR "${ORK_INSTALL_PREFIX}/${ORK_INSTALL_INC_SUFFIX}")
+	set(ORK_INSTALL_LIB_DIR "${ORK_INSTALL_PREFIX}/${ORK_INSTALL_LIB_SUFFIX}")
+
+
+	#Build output, not that it is usually used without installing
+	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${ORK_INSTALL_LIB_SUFFIX}")
+	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${ORK_INSTALL_BIN_SUFFIX}")
+
+	set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${ORK_INSTALL_LIB_SUFFIX}")
+	set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${ORK_INSTALL_BIN_SUFFIX}")
+
+	set(ORK_INSTALL_CONFIGURED ON)
+endmacro()
+
+####################
+#Compiler section
+####################
+
 macro(append_all_compiler_flag _flag)
 	if(NOT ${_flag} MATCHES "^(/|-)")
 		message(FATAL_ERROR "All MSVC and GCC flag start with a slash or dash: ${_flag}")


ctest support added

ctest support added

--- cmake/tests.cmake
+++ cmake/tests.cmake
@@ -8,6 +8,7 @@
   target_link_libraries(${app} but)
   target_link_libraries(${app} gmock_main gmock gtest)
   target_link_libraries(${app} boost_serialization boost_filesystem boost_system)
+  add_test(NAME run-${app} COMMAND ${CMAKE_BINARY_DIR}/${app})
   list(APPEND TEST_TARGETS ${app})
 endforeach()

@@ -23,3 +24,11 @@

 add_custom_target(but_manual    DEPENDS ${TEST_TARGETS_MANUAL})
 add_custom_target(but_tests_all DEPENDS ${TEST_TARGETS})
+
+# enables ctest (otherwise tests would be discarded)
+enable_testing()
+
+add_custom_target(run-but_tests
+  COMMAND ctest
+  DEPENDS ${TEST_TARGETS}
+)


[3531904] Update FindSoftimage.cmake to find Softimage 2013

--HG--
branch : v1-8

--- CMake/Packages/FindSoftimage.cmake
+++ CMake/Packages/FindSoftimage.cmake
@@ -32,6 +32,7 @@
   "$ENV{ProgramFiles}/Autodesk/Softimage 2011 SP1/XSISDK"
   "$ENV{ProgramFiles}/Autodesk/Softimage 2012/XSISDK"
   "$ENV{ProgramFiles}/Autodesk/Softimage 2012 SP1/XSISDK"
+  "$ENV{ProgramFiles}/Autodesk/Softimage 2013/XSISDK"
   "C:/Softimage/XSI_6.0_x64/XSISDK"
   "C:/Softimage/XSI_6.01_x64/XSISDK"
   "C:/Softimage/XSI_6.02_x64/XSISDK"
@@ -45,6 +46,7 @@
   "$ENV{ProgramW6432}/Autodesk/Softimage 2011 SP1/XSISDK"
   "$ENV{ProgramW6432}/Autodesk/Softimage 2012/XSISDK"
   "$ENV{ProgramW6432}/Autodesk/Softimage 2012 SP1/XSISDK"
+  "$ENV{ProgramW6432}/Autodesk/Softimage 2013/XSISDK"
 )

 if (CMAKE_CL_64)


ENH: Bump TubeTK

ENH: Bump TubeTK

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -48,5 +48,5 @@
   "http://www.tubetk.org"
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG d531330b4b04ffce71e62c557e984a9f35ff6371
+  GIT_TAG 06b083a7158be433f55ccc05bbfcafe124f94fde
   )


Eliminate vcredist dependency

Eliminate vcredist dependency

--- src/corehost/cli/setup.cmake
+++ src/corehost/cli/setup.cmake
@@ -11,6 +11,12 @@
     add_compile_options($<$<CONFIG:Release>:-DNDEBUG>)
     add_compile_options($<$<CONFIG:RelWithDebInfo>:-DNDEBUG>)
     add_compile_options($<$<CONFIG:Debug>:/Od>)
+    add_compile_options(/guard:cf)
+    add_compile_options(/d2Zi+) # make optimized builds debugging easier
+    add_compile_options(/Oi) # enable intrinsics
+    add_compile_options(/Oy-) # disable suppressing of the creation of frame pointers on the call stack for quicker function calls
+    add_compile_options(/GF) # enable read-only string pooling
+    add_compile_options(/FC) # use full pathnames in diagnostics
     add_compile_options(/DEBUG)
     add_compile_options(/GS)
     add_compile_options(/W1)
@@ -30,11 +36,15 @@
     set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
     set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
     set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+    set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")

     # RelWithDebInfo specific flags
     set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF")
     set(CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF")
     set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /DEBUG /OPT:REF /OPT:ICF")
+    set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
+    set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")
 else()
     add_compile_options(-Wno-unused-local-typedef)
 endif()


ENH: Addition of the VTK version necessary to compile the project

--- 3DMetricTools.cmake
+++ 3DMetricTools.cmake
@@ -37,7 +37,7 @@
 SETIFEMPTY( INSTALL_ARCHIVE_DESTINATION lib )

 # find the VTK headers
-find_package( VTK REQUIRED )
+find_package( VTK 6 REQUIRED )
 include( ${VTK_USE_FILE} )

 option( Build_Static "Static libraries and executables only" ON )


Make sure that, on Windows (note: it doesn't apply on Linux and Mac OS X), our plugins refer to either the debug or release version of the Qt libraries, depending on the version of OpenCOR we want to build.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -10,6 +10,8 @@
     IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
         MESSAGE("Building a debug version...")

+        SET(DEBUG_MODE ON)
+
         # Default compiler settings

         SET(CMAKE_CXX_FLAGS "-g -O0")
@@ -17,6 +19,8 @@
         SET(CMAKE_BUILD_TYPE "Release")

         MESSAGE("Building a release version...")
+
+        SET(DEBUG_MODE OFF)

         # Default compiler and linker settings

@@ -220,7 +224,13 @@

     FOREACH(QT_LIBRARY ${QT_DEPENDENCIES})
         IF(WIN32)
-            SET(QT_LIBRARY_PATH ${QT_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${QT_LIBRARY}${QT_VERSION_MAJOR}${CMAKE_STATIC_LIBRARY_SUFFIX})
+            IF(DEBUG_MODE)
+                SET(QT_DEPENDENCY_VERSION d)
+            ELSE()
+                SET(QT_DEPENDENCY_VERSION)
+            ENDIF()
+
+            SET(QT_LIBRARY_PATH ${QT_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${QT_LIBRARY}${QT_DEPENDENCY_VERSION}${QT_VERSION_MAJOR}${CMAKE_STATIC_LIBRARY_SUFFIX})
         ELSEIF(APPLE)
             SET(QT_LIBRARY_PATH ${QT_LIBRARY_DIR}/${QT_LIBRARY}.framework)
         ELSE()


Fix build : change MYSQL_ADD_PLUGIN  to be MACRO again, rather than FUNCTION

--- cmake/plugin.cmake
+++ cmake/plugin.cmake
@@ -28,15 +28,13 @@
 # [LINK_LIBRARIES lib1...libN]
 # [DEPENDENCIES target1...targetN]

-FUNCTION(MYSQL_ADD_PLUGIN)
+MACRO(MYSQL_ADD_PLUGIN)
   MYSQL_PARSE_ARGUMENTS(ARG
     "LINK_LIBRARIES;DEPENDENCIES;MODULE_OUTPUT_NAME;STATIC_OUTPUT_NAME;COMPONENT;CONFIG"
     "STORAGE_ENGINE;STATIC_ONLY;MODULE_ONLY;MANDATORY;DEFAULT;DISABLED;RECOMPILE_FOR_EMBEDDED;CLIENT"
     ${ARGN}
   )
-  IF(WITHOUT_SERVER AND NOT ARG_CLIENT)
-    RETURN()
-  ENDIF()
+  IF(NOT WITHOUT_SERVER OR ARG_CLIENT)

   # Add common include directories
   INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
@@ -238,7 +236,9 @@
   IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/mysql-test")
     INSTALL_MYSQL_TEST("${CMAKE_CURRENT_SOURCE_DIR}/mysql-test/" "plugin/${subpath}")
   ENDIF()
-ENDFUNCTION()
+
+  ENDIF(NOT WITHOUT_SERVER OR ARG_CLIENT)
+ENDMACRO()

 # Add all CMake projects under storage  and plugin


fix #97 (FindFreetype.cmake on Max OS X)

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -1,38 +1,49 @@
-# - Try to find FreeType
-# Once done, this will define
-#
-#  FREETYPE_FOUND - system has FreeType
-#  FREETYPE_INCLUDE_DIRS - the FreeType include directories
-#  FREETYPE_LIBRARIES - link these to use FreeType
-
-include(FindPkgMacros)
-findpkg_begin(FREETYPE)
-
-# Get path, convert backslashes as ${ENV_${var}}
-getenv_path(FREETYPE_HOME)
-
-# construct search paths
-set(FREETYPE_PREFIX_PATH ${FREETYPE_HOME} ${ENV_FREETYPE_HOME})
-create_search_paths(FREETYPE)
-# redo search if prefix path changed
-clear_if_changed(FREETYPE_PREFIX_PATH
-  FREETYPE_LIBRARY_FWK
-  FREETYPE_LIBRARY_REL
-  FREETYPE_LIBRARY_DBG
-  FREETYPE_INCLUDE_DIR
-)
-
-set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238 freetype239 freetype2311)
-get_debug_names(FREETYPE_LIBRARY_NAMES)
-
-use_pkgconfig(FREETYPE_PKGC freetype2)
-
-findpkg_framework(FREETYPE)
-
-find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2)
-find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
-find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
-make_library_set(FREETYPE_LIBRARY)
-
-findpkg_finish(FREETYPE)
-
+# - Try to find FreeType
+# Once done, this will define
+#
+#  FREETYPE_FOUND - system has FreeType
+#  FREETYPE_INCLUDE_DIRS - the FreeType include directories
+#  FREETYPE_LIBRARIES - link these to use FreeType
+
+include(FindPkgMacros)
+findpkg_begin(FREETYPE)
+
+# Get path, convert backslashes as ${ENV_${var}}
+getenv_path(FREETYPE_HOME)
+
+# construct search paths
+set(FREETYPE_PREFIX_PATH ${FREETYPE_HOME} ${ENV_FREETYPE_HOME})
+create_search_paths(FREETYPE)
+# redo search if prefix path changed
+clear_if_changed(FREETYPE_PREFIX_PATH
+  FREETYPE_LIBRARY_FWK
+  FREETYPE_LIBRARY_REL
+  FREETYPE_LIBRARY_DBG
+  FREETYPE_INCLUDE_DIR
+)
+
+set(FREETYPE_LIBRARY_NAMES freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+get_debug_names(FREETYPE_LIBRARY_NAMES)
+
+use_pkgconfig(FREETYPE_PKGC freetype2)
+
+# prefer static library over framework
+set(CMAKE_FIND_FRAMEWORK "LAST")
+
+findpkg_framework(FREETYPE)
+message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
+
+find_path(FREETYPE_INCLUDE_DIR NAMES freetype/freetype.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS} PATH_SUFFIXES freetype2)
+find_path(FREETYPE_FT2BUILD_INCLUDE_DIR NAMES ft2build.h HINTS ${FREETYPE_INC_SEARCH_PATH} ${FREETYPE_PKGC_INCLUDE_DIRS})
+find_library(FREETYPE_LIBRARY_REL NAMES ${FREETYPE_LIBRARY_NAMES} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
+find_library(FREETYPE_LIBRARY_DBG NAMES ${FREETYPE_LIBRARY_NAMES_DBG} HINTS ${FREETYPE_LIB_SEARCH_PATH} ${FREETYPE_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
+make_library_set(FREETYPE_LIBRARY)
+
+findpkg_finish(FREETYPE)
+mark_as_advanced(FREETYPE_FT2BUILD_INCLUDE_DIR)
+if (NOT FREETYPE_FT2BUILD_INCLUDE_DIR STREQUAL FREETYPE_INCLUDE_DIR)
+  set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_FT2BUILD_INCLUDE_DIR})
+endif ()
+
+# Reset framework finding
+set(CMAKE_FIND_FRAMEWORK "FIRST")


fix render system related error message

fix render system related error message

--- CMake/Utils/MacroLogFeature.cmake
+++ CMake/Utils/MacroLogFeature.cmake
@@ -88,7 +88,7 @@
    SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
    IF (EXISTS ${_file})
       FILE(READ ${_file} _requirements)
-      MESSAGE(FATAL_ERROR "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-- If you are in Windows, try passing -DMYGUI_DEPENDENCIES_DIR=<path to dependencies>\n-- Also check that you buildind with RenderSystem that you need or set another with -DMYGUI_RENDERSYSTEM=<1 2 or 3 for Direct3D_9 OGRE or OpenGL>\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------")
+      MESSAGE(FATAL_ERROR "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-- If you are in Windows, try passing -DMYGUI_DEPENDENCIES_DIR=<path to dependencies>\n-- Also check that you buildind with RenderSystem that you need or set another with -DMYGUI_RENDERSYSTEM=<3, 4, 5, 6 for OGRE, OpenGL, Direct3D_9 or Direct3D_11>\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------")
       FILE(REMOVE ${_file})
       MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
    ENDIF (EXISTS ${_file})


Change freetype repo to use http

Change freetype repo to use http

--- CMakeModules/build_freetype.cmake
+++ CMakeModules/build_freetype.cmake
@@ -4,7 +4,7 @@

 ExternalProject_Add(
     freetype-ext
-    GIT_REPOSITORY git://git.sv.nongnu.org/freetype/freetype2.git
+    GIT_REPOSITORY http://git.sv.nongnu.org/r/freetype/freetype2.git
     GIT_TAG 14df6b1a63f5c5773bb498063205cb79aac21173
     PREFIX "${prefix}"
     UPDATE_COMMAND ""


fix KNL CMake logic error

fix KNL CMake logic error

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -48,7 +48,7 @@

 ## Macro check for compiler support of ISA ##
 MACRO(OSPRAY_CHECK_COMPILER_SUPPORT ISA)
-  IF (${ISA} STREQUAL "AVX512" AND NOT OSPRAY)
+  IF (${ISA} STREQUAL "AVX512" AND NOT OSPRAY_COMPILER_ICC)
     OSPRAY_WARN_ONCE(MISSING_AVX512 "OSPRay Currently requires ICC for KNL support. Disabling KNL ISA target.")
     SET(OSPRAY_EMBREE_ENABLE_${ISA} false)
   ELSEIF (OSPRAY_EMBREE_ENABLE_${ISA} AND NOT OSPRAY_COMPILER_SUPPORTS_${ISA})


Add getarch flags to disable AVX on x86

Add getarch flags to disable AVX on x86

(and other small fixes to match Makefile behaviour)

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -70,6 +70,13 @@
   set(GETARCH_FLAGS "${GETARCH_FLAGS} -march=native")
 endif ()

+# On x86 no AVX support is available
+if (X86 OR X86_64)
+if ((DEFINED BINARY AND BINARY EQUAL 32) OR ("$CMAKE_SIZEOF_VOID_P}" EQUAL "4"))
+  set(GETARCH_FLAGS "${GETARCH_FLAGS} -DNO_AVX -DNO_AVX2 -DNO_AVX512")
+endif ()
+endif ()
+
 if (INTERFACE64)
   message(STATUS "Using 64-bit integers.")
   set(GETARCH_FLAGS	"${GETARCH_FLAGS} -DUSE64BITINT")
@@ -148,7 +155,9 @@
 endif ()

 include("${PROJECT_SOURCE_DIR}/cmake/prebuild.cmake")
-
+if (DEFINED BINARY)
+  message(STATUS "Compiling a ${BINARY}-bit binary.")
+endif ()
 if (NOT DEFINED NEED_PIC)
   set(NEED_PIC 1)
 endif ()
@@ -165,6 +174,9 @@
 if (NOT NOFORTRAN)
   # Fortran Compiler dependent settings
   include("${PROJECT_SOURCE_DIR}/cmake/fc.cmake")
+else ()
+set(NO_LAPACK 1)
+set(NO_LAPACKE 1)
 endif ()

 if (BINARY64)
@@ -190,9 +202,14 @@
 endif ()

 if (DYNAMIC_ARCH)
-  set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
-  if (DYNAMIC_OLDER)
-    set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
+  if (X86 OR X86_64 OR ARM64 OR PPC)
+    set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_ARCH")
+    if (DYNAMIC_OLDER)
+      set(CCOMMON_OPT "${CCOMMON_OPT} -DDYNAMIC_OLDER")
+    endif ()
+  else ()
+    unset (DYNAMIC_ARCH)
+    message (STATUS "DYNAMIC_ARCH is not supported on the target architecture, removing")
   endif ()
 endif ()


Use virgil-crypto lib 1.4.0

Use virgil-crypto lib 1.4.0

--- cmake/virgil.cmake
+++ cmake/virgil.cmake
@@ -86,7 +86,7 @@
         if (NOT TARGET ${VIRGIL}_project)
             ExternalProject_Add (${VIRGIL}_project
                 GIT_REPOSITORY "https://github.com/VirgilSecurity/virgil-crypto.git"
-                GIT_TAG "v1.4.0-rc1"
+                GIT_TAG "v1.4.0"
                 PREFIX "${CMAKE_CURRENT_BINARY_DIR}/ext/virgil-crypto"
                 CMAKE_ARGS ${CMAKE_ARGS}
             )


Specify that we want to package UCRT in windows.

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -2,6 +2,7 @@

 # install the visual studio runtime:
 if (MSVC)
+  set(CMAKE_INSTALL_UCRT_LIBRARIES 1)
   include(InstallRequiredSystemLibraries)
   INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT Libraries)
   INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT} DESTINATION bin COMPONENT Libraries)


Fixed warning-messages displayed by BALLConfigFFTW.cmake.

--- cmake/BALLConfigFFTW.cmake
+++ cmake/BALLConfigFFTW.cmake
@@ -31,19 +31,19 @@
 	IF (FFTWF_FOUND)
 		SET(BALL_FFTW_DEFAULT_TRAITS FloatTraits)
 	ELSE()
-		MESSAGE(SEND_ERROR "FFTW library needed for desired complex precision is not available! (see BALL_COMPLEX_PRECISION)")
+		MESSAGE(SEND_ERROR "An FFTW library needed for ${BALL_COMPLEX_PRECISION} is not available! Thus FFTW-support has been disabled!")
 	ENDIF()
 ELSEIF(BALL_COMPLEX_PRECISION STREQUAL "double")
 	IF (FFTWD_FOUND)
 		SET(BALL_FFTW_DEFAULT_TRAITS DoubleTraits)
 	ELSE()
-		MESSAGE(SEND_ERROR "FFTW library needed for desired complex precision is not available! (see BALL_COMPLEX_PRECISION)")
+		MESSAGE(SEND_ERROR "An FFTW library needed for ${BALL_COMPLEX_PRECISION} is not available! Thus FFTW-support has been disabled!")
 	ENDIF()
 ELSEIF(BALL_COMPLEX_PRECISION STREQUAL "long double")
 	IF (FFTWL_FOUND)
 		SET(BALL_FFTW_DEFAULT_TRAITS LongDoubleTraits)
 	ELSE()
-		MESSAGE(SEND_ERROR "FFTW library needed for desired complex precision is not available! (see BALL_COMPLEX_PRECISION)")
+		MESSAGE(SEND_ERROR "An FFTW library needed for ${BALL_COMPLEX_PRECISION} is not available! Thus FFTW-support has been disabled!")
 	ENDIF()
 ENDIF()


Added support for python 3.2

Added support for python 3.2

--- cmake/FindPythonLibs.cmake
+++ cmake/FindPythonLibs.cmake
@@ -27,7 +27,7 @@
 # Search for the python framework on Apple.
 CMAKE_FIND_FRAMEWORKS(Python)

-FOREACH(_CURRENT_VERSION 3.1)
+FOREACH(_CURRENT_VERSION 3.1 3.2)
   STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
   IF(WIN32)
     FIND_LIBRARY(PYTHON_DEBUG_LIBRARY


CMake: fix warning 'LNK4044: unrecognized option /openmp' (#661)

Signed-off-by: Zheltov, Sergey1 <2caecf572425dfc72b1e4daa2cc6a716d92adb58@intel.com>

--- cmake/compilers/MSVC.cmake
+++ cmake/compilers/MSVC.cmake
@@ -75,7 +75,6 @@
     if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64|i.86)")
         set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm -mwaitpkg)
     endif()
-    set(TBB_OPENMP_NO_LINK_FLAG TRUE)
     set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
     set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
 else()
@@ -84,3 +83,4 @@
 endif()

 set(TBB_OPENMP_FLAG /openmp)
+set(TBB_OPENMP_NO_LINK_FLAG TRUE) # TBB_OPENMP_FLAG will be used only on compilation but not on linkage


apply eigen patch only for ACL.

apply eigen patch only for ACL.

--- cmake/external/eigen.cmake
+++ cmake/external/eigen.cmake
@@ -5,8 +5,8 @@
     file(TO_CMAKE_PATH ${eigen_SOURCE_PATH} eigen_INCLUDE_DIRS)
     target_include_directories(eigen INTERFACE ${eigen_INCLUDE_DIRS})
 else ()
-    execute_process(COMMAND  git apply --ignore-space-change --ignore-whitespace ${PROJECT_SOURCE_DIR}/patches/eigen/Fix_Eigen_Build_Break.patch
-                    WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-                   )
+    if (onnxruntime_USE_ACL)
+        execute_process(COMMAND  git apply --ignore-space-change --ignore-whitespace ${PROJECT_SOURCE_DIR}/patches/eigen/Fix_Eigen_Build_Break.patch WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
+    endif()
     set(eigen_INCLUDE_DIRS  "${PROJECT_SOURCE_DIR}/external/eigen")
 endif()


cmake/smfc_generator: Build seastar::sstring directly

This patch avoids copying a std::string into a seastar::sstring by
building the latter directly, using the flatbuffers
"cpp-str-flex-ctor" option.

Signed-off-by: Duarte Nunes <a60e8b7496f7715d71354fe4c06dd24017025bf1@vectorized.io>
Message-Id: <20190518202352.24364-1-a60e8b7496f7715d71354fe4c06dd24017025bf1@vectorized.io>

--- cmake/smfc_generator.cmake
+++ cmake/smfc_generator.cmake
@@ -61,6 +61,7 @@
       ARGS ${flatc_generated_includes} --force-empty --gen-compare
       ARGS --keep-prefix --json --reflect-names --defaults-json
       ARGS --gen-mutable --cpp-str-type 'seastar::sstring'
+      ARGS --cpp-str-flex-ctor
       ARGS -o "${SMFC_GEN_OUTPUT_DIRECTORY}/" "${FILE}"
       COMMENT "Building C++ header for ${FILE}"
       DEPENDS ${FILE}


devices.cmake: remove OUT_MERGED_FASM before appending fasm files

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -1061,14 +1061,14 @@
         DEPENDS ${BITSTREAM_DEPS}
         COMMAND
           ${CMAKE_COMMAND} -E make_directory ${OUT_LOCAL}
-        COMMAND cat ${ALL_OUT_FASM} >> ${OUT_FASM_MERGED}
+        COMMAND cat ${ALL_OUT_FASM} > ${OUT_FASM_MERGED}
         COMMAND ${FASM_TO_BIT_CMD_FOR_TARGET_LIST}
       )
     else()
       add_custom_command(
         OUTPUT ${OUT_BITSTREAM}
         DEPENDS ${BITSTREAM_DEPS}
-        COMMAND cat ${ALL_OUT_FASM} >> ${OUT_FASM_MERGED}
+        COMMAND cat ${ALL_OUT_FASM} > ${OUT_FASM_MERGED}
         COMMAND ${FASM_TO_BIT_CMD_FOR_TARGET_LIST}
       )
     endif()


More debugging

More debugging

--- CPM.cmake
+++ CPM.cmake
@@ -423,7 +423,7 @@
   if (NOT CPM_HIERARCHY_LEVEL EQUAL 0)
     foreach(_cpm_kvName IN LISTS CPM_KV_LIST_SOURCE_ADDED_MAP)
       set(CPM_KV_SOURCE_ADDED_MAP_${_cpm_kvName} ${CPM_KV_SOURCE_ADDED_MAP_${_cpm_kvName}} PARENT_SCOPE)
-      message("Propogating: ${CPM_KV_SOURCE_ADDED_MAP_${_cpm_kvName}}")
+      message("Propogating: CPM_KV_SOURCE_ADDED_MAP_${_cpm_kvName}: ${CPM_KV_SOURCE_ADDED_MAP_${_cpm_kvName}}")
     endforeach()
     set(_cpm_kvName) # Clear kvName


Fix source dir unique ID generation.

Fix source dir unique ID generation.

--- CPM.cmake
+++ CPM.cmake
@@ -1122,11 +1122,19 @@
       string(REGEX REPLACE "\\.git$" "" _CPM_SOURCE_GHOST_GIT_REPO ${_CPM_SOURCE_GHOST_GIT_REPO})
       set(__CPM_PATH_UNID ${_CPM_SOURCE_GHOST_GIT_REPO})
       set(__CPM_PATH_UNID_VERSION ${source_ghost_tag})
+
+      # Ensure all lower case. This string is used when testing preprocessor
+      # name collisions.
+      string(TOLOWER ${__CPM_PATH_UNID} __CPM_PATH_UNID)
+      string(TOLOWER ${__CPM_PATH_UNID_VERSION} __CPM_PATH_UNID_VERSION)
     else()
       set(__CPM_PATH_UNID ${tmp_src_dir})
       set(__CPM_PATH_UNID_VERSION "")
+
+      string(TOLOWER ${__CPM_PATH_UNID} __CPM_PATH_UNID)
     endif()
     set(__CPM_MODULE_SOURCE_DIR "${tmp_src_dir}")
+
   endif()

   # Cunstruct full UNID


Missing declaration for EXTERNAL_ROOT

Missing declaration for EXTERNAL_ROOT

--- scripts/AddCatchTest.cmake
+++ scripts/AddCatchTest.cmake
@@ -1,4 +1,8 @@
 # First finds or downloads catch
+if(NOT EXTERNAL_ROOT)
+  include(PackageLookup) # Just to set EXTERNAL_ROOT
+endif()
+
 find_package(Catch)
 if(NOT CATCH_FOUND)
   set(catch_url


Fix how we ask for LLVM static libs (#1070)

--- src/cmake/modules/FindLLVM.cmake
+++ src/cmake/modules/FindLLVM.cmake
@@ -93,7 +93,7 @@
     # if static LLVM libraries were requested, use llvm-config to generate
     # the list of what libraries we need, and substitute that in the right
     # way for LLVM_LIBRARY.
-    execute_process (COMMAND ${LLVM_CONFIG} --libfiles
+    execute_process (COMMAND ${LLVM_CONFIG} --libfiles --link-static
                      OUTPUT_VARIABLE LLVM_LIBRARIES
                      OUTPUT_STRIP_TRAILING_WHITESPACE)
     string (REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES}")


Improve variable usage

Improve variable usage

--- cmake/CMakeModulesLibLoader.cmake
+++ cmake/CMakeModulesLibLoader.cmake
@@ -13,7 +13,7 @@
   endif()

-  if(NOT LIB_CMAKE_MODULES_EXISTS)
+  if(NOT LIB_CMAKE_MODULES_CLONED)
     set(LIB_CMAKE_MODULES_URL https://github.com/andreaskunz/cmake-modules.git CACHE STRING "The path to the origin of the cmake-modules library")

     execute_process(COMMAND ${GIT_EXECUTABLE} clone ${LIB_CMAKE_MODULES_URL}
@@ -24,9 +24,10 @@
       message(FATAL_ERROR "failed command: git clone ${LIB_CMAKE_MODULES_URL}\n ${LIB_CMAKE_MODULES_CLONE_OUTPUT}")
     endif()

-    list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/cmake-modules")
+    set(LIB_CMAKE_MODULES_ROOT_PATH "${CMAKE_BINARY_DIR}/cmake-modules" CACHE PATH "Root directory path of the CMake modules library" FORCE)
+    list(APPEND CMAKE_MODULE_PATH ${LIB_CMAKE_MODULES_ROOT_PATH})
     set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} CACHE PATH "List of directories specifying a search path for CMake modules to be loaded" FORCE)
-    set(LIB_CMAKE_MODULES_EXISTS TRUE CACHE BOOL "TRUE if the cmake-modules library was cloned successfully")
+    set(LIB_CMAKE_MODULES_CLONED TRUE CACHE BOOL "TRUE if the cmake-modules library was cloned successfully")
   endif()
 endfunction()


[CMAKE] Fix Miniupnpc error message

[CMAKE] Fix Miniupnpc error message

Summary:
The error message when the miniupnpc.h is not found is fubared due the
CMAKE_REQUIRED_INCLUDES not taking into account the NOTFOUND case. This
diff fixes the issue and restore the expected error.

Test Plan:
Uninstall miniupnpc, then
  mkdir buildcmake && cd buildcmake
  cmake -GNinja ..
Should output a CMake error:
```
Could NOT find MiniUPnPc (missing: MINIUPNPC_INCLUDE_DIR
MINIUPNPC_LIBRARY)
```

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3141

--- cmake/modules/FindMiniUPnPc.cmake
+++ cmake/modules/FindMiniUPnPc.cmake
@@ -10,21 +10,23 @@

 find_path(MINIUPNPC_INCLUDE_DIR miniupnpc/miniupnpc.h)

-set(MINIUPNPC_REQUIRED_HEADERS
-	miniupnpc/miniwget.h
-	miniupnpc/upnpcommands.h
-	miniupnpc/upnperrors.h
-)
+if(MINIUPNPC_INCLUDE_DIR)
+	set(MINIUPNPC_REQUIRED_HEADERS
+		miniupnpc/miniwget.h
+		miniupnpc/upnpcommands.h
+		miniupnpc/upnperrors.h
+	)

-include(SanitizeHelper)
-set(CMAKE_REQUIRED_INCLUDES ${MINIUPNPC_INCLUDE_DIR})
-foreach(_miniupnpc_header ${MINIUPNPC_REQUIRED_HEADERS})
-	sanitize_variable(HAVE_MINIUPNPC_ ${_miniupnpc_header} HEADER_FOUND)
-	check_include_files(${_miniupnpc_header} ${HEADER_FOUND})
-	if(NOT ${HEADER_FOUND})
-		set(MINIUPNPC_MISSING_HEADER ON)
-	endif()
-endforeach()
+	include(SanitizeHelper)
+	set(CMAKE_REQUIRED_INCLUDES ${MINIUPNPC_INCLUDE_DIR})
+	foreach(_miniupnpc_header ${MINIUPNPC_REQUIRED_HEADERS})
+		sanitize_variable(HAVE_MINIUPNPC_ ${_miniupnpc_header} HEADER_FOUND)
+		check_include_files(${_miniupnpc_header} ${HEADER_FOUND})
+		if(NOT ${HEADER_FOUND})
+			set(MINIUPNPC_MISSING_HEADER ON)
+		endif()
+	endforeach()
+endif()

 if(NOT MINIUPNPC_MISSING_HEADER)
 	find_library(MINIUPNPC_LIBRARY NAMES miniupnpc libminiupnpc)


From Lorenzo:
avoid to run script for preparing environment for rootcint, since the
script is not always copied in ROOTSYS/bin.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41749 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -58,7 +58,8 @@
   if(WIN32)
     set(rootcint_cmd rootcint)
   else()
-    set(rootcint_cmd ${ROOTSYS}/bin/setenvwrap.csh ${ld_library_path}=${ROOTSYS}/lib ${ROOTSYS}/bin/rootcint)
+    set(rootcint_cmd rootcint)
+#    set(rootcint_cmd ${ROOTSYS}/bin/setenvwrap.csh ${ld_library_path}=${ROOTSYS}/lib ${ROOTSYS}/bin/rootcint)
   endif()
   set(rlibmap_cmd rlibmap)
 endif()


Remove trailing whitespaces

Remove trailing whitespaces

--- cmake/projects/GTest/hunter.cmake
+++ cmake/projects/GTest/hunter.cmake
@@ -145,7 +145,7 @@
     GTest
     VERSION
     1.8.0-hunter-p2
-    URL
+    URL
     "https://github.com/hunter-packages/googletest/archive/1.8.0-hunter-p2.tar.gz"
     SHA1
     93148cb8850abe78b76ed87158fdb6b9c48e38c4


tests are now added by default, but not built as a part of 'all' target

--- cmake/tests.cmake
+++ cmake/tests.cmake
@@ -1,20 +1,24 @@
 add_subdirectory(gmock)

-add_executable(uts ${SOURCES_UT})
-add_executable(mts ${SOURCES_MT})
-add_executable(its ${SOURCES_IT})
+add_executable(but_uts EXCLUDE_FROM_ALL ${SOURCES_UT})
+add_executable(but_mts EXCLUDE_FROM_ALL ${SOURCES_MT})
+add_executable(but_its EXCLUDE_FROM_ALL ${SOURCES_IT})

-foreach(app uts mts its)
+foreach(app but_uts but_mts but_its)
   target_link_libraries(${app} but)
   target_link_libraries(${app} gmock_main gmock gtest)
   set_target_properties(${app} PROPERTIES COMPILE_FLAGS --coverage)
   set_target_properties(${app} PROPERTIES LINK_FLAGS    --coverage)
+  list(APPEND TEST_TARGETS ${app})
 endforeach()

 foreach(src ${SOURCES_MANUAL})
   get_filename_component(dir  ${src} DIRECTORY)
   get_filename_component(name ${src} NAME_WE)
-  set(app ${dir}/${name}.manual)
-  add_executable(${app} ${src})
+  set(app but_${name}.manual)
+  add_executable(${app} EXCLUDE_FROM_ALL ${src})
   target_link_libraries(${app} but)
+  list(APPEND TEST_TARGETS ${app})
 endforeach()
+
+add_custom_target(but_tests_all DEPENDS ${TEST_TARGETS})


Fix bootstrap.h broken by the fix for the out-of-source build.

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -57,9 +57,11 @@
 endfunction()

 function(bin_source varname srcfile dstfile)
-    set (srcfile "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
-    set (tmpfile "${CMAKE_CURRENT_BINARY_DIR}/${dstfile}.tmp")
-    set (dstfile "${CMAKE_CURRENT_BINARY_DIR}/${dstfile}")
+    set(var ${${varname}})
+    set(${varname} ${var} ${dstfile} PARENT_SCOPE)
+    set (srcfile "${CMAKE_CURRENT_SOURCE_DIR}/${srcfile}")
+    set (dstfile "${CMAKE_CURRENT_SOURCE_DIR}/${dstfile}")
+    set (tmpfile "${dstfile}.tmp")
     get_filename_component(module ${dstfile} NAME_WE)

     ADD_CUSTOM_COMMAND(OUTPUT ${dstfile}
@@ -70,6 +72,4 @@
         COMMAND ${CMAKE_COMMAND} -E remove ${tmpfile}
         DEPENDS ${srcfile} bin2c)

-    set(var ${${varname}})
-    set(${varname} ${var} ${dstfile} PARENT_SCOPE)
 endfunction()


ParseMakefileVars now replaces Makefile vars with CMake vars.

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -14,7 +14,6 @@

 # Reads a Makefile into CMake vars.
 # TODO: respect IFDEF/IFNDEF?
-# TODO: regex replace makefile vars, e.g. $(TSUFFIX) is set to the target arch in the var CGEMMOTCOPYOBJ = cgemm_otcopy$(TSUFFIX).$(SUFFIX)
 macro(ParseMakefileVars MAKEFILE_IN)
   message(STATUS "Reading vars from ${MAKEFILE_IN}...")
   file(STRINGS ${MAKEFILE_IN} makefile_contents)
@@ -23,14 +22,19 @@
     if (NOT "${line_match}" STREQUAL "")
       set(var_name ${CMAKE_MATCH_1})
       set(var_value ${CMAKE_MATCH_2})
+      # check for Makefile variables in the string, e.g. $(TSUFFIX)
+      string(REGEX MATCHALL "\\$\\(([0-9_a-zA-Z]+)\\)" make_var_matches ${var_value})
+      foreach (make_var ${make_var_matches})
+        # strip out Makefile $() markup
+        string(REGEX REPLACE "\\$\\(([0-9_a-zA-Z]+)\\)" "\\1" make_var ${make_var})
+        # now replace the instance of the Makefile variable with the value of the CMake variable (note the double quote)
+        string(REPLACE "$(${make_var})" "${${make_var}}" var_value ${var_value})
+      endforeach ()
       set(${var_name} ${var_value})
-      message(STATUS "found var ${var_name} = ${var_value}")
     else ()
       string(REGEX MATCH "include \\$\\(KERNELDIR\\)/(.+)$" line_match "${makefile_line}")
       if (NOT "${line_match}" STREQUAL "")
         ParseMakefileVars(${KERNELDIR}/${CMAKE_MATCH_1})
-      else ()
-        message(STATUS "couldn't parse ${makefile_line} into a var")
       endif ()
     endif ()
   endforeach ()
@@ -106,8 +110,10 @@
     set(defines_in ${ARGV1})
   endif ()

-  if (DEFINED ARGV2)
+  if (DEFINED ARGV2 AND NOT "${ARGV2}" STREQUAL "")
     set(name_in ${ARGV2})
+    # strip off extension for kernel files that pass in the object name.
+    get_filename_component(name_in ${name_in} NAME_WE)
   endif ()

   if (DEFINED ARGV3)


Bug fix to enable re-generate on thrift file change (#368)

Summary:
The current cmake macros does not re-generate code when the thrift file is changed. This is because the cmake_custom_command only lists thrift1 as dependency. By adding the thrift file to the dependencies list, we can force cmake re-generates code when the file is changed.

Tested on my custom code.
Pull Request resolved: https://github.com/facebook/fbthrift/pull/368

Reviewed By: vitaut

Differential Revision: D18502590

Pulled By: yfeldblum

fbshipit-source-id: 25ed8044cf99babb7578d2c8408d7b8354d8222c

--- ThriftLibrary.cmake
+++ ThriftLibrary.cmake
@@ -255,7 +255,9 @@
       -o ${output_path}
       ${thrift_include_directories}
       "${file_path}/${file_name}.thrift"
-    DEPENDS ${THRIFT1}
+    DEPENDS
+      ${THRIFT1}
+      "${file_path}/${file_name}.thrift"
     COMMENT "Generating ${file_name} files. Output: ${output_path}"
   )
   add_custom_target(


change for gfx11xx HostLibraryTests

change for gfx11xx HostLibraryTests

--- Tensile/cmake/TensileConfig.cmake
+++ Tensile/cmake/TensileConfig.cmake
@@ -80,10 +80,16 @@
     add_custom_target(
         ${Target_NAME} ALL
         COMMENT "${Target_NAME}: Copying tensile objects to ${Dest_PATH}"
-        COMMAND_EXPAND_LISTS
-        COMMAND ${CMAKE_COMMAND} -E copy_if_different ${Tensile_OBJECTS_TO_COPY} ${Dest_PATH}
         DEPENDS ${Tensile_OBJECTS_TO_COPY}
     )
+    foreach(OBJECT_TO_COPY ${Tensile_OBJECTS_TO_COPY})
+        add_custom_command(
+            TARGET ${Target_NAME} PRE_BUILD
+            COMMAND_EXPAND_LISTS
+            COMMAND ${CMAKE_COMMAND} -E copy_if_different ${OBJECT_TO_COPY} ${Dest_PATH}
+            DEPENDS ${OBJECT_TO_COPY}
+        )
+    endforeach()
 endfunction()

 # Output target: ${Tensile_VAR_PREFIX}_LIBRARY_TARGET. Ensures that the libs get built in Tensile_OUTPUT_PATH/library.


updated

updated

--- tests/tests.cmake
+++ tests/tests.cmake
@@ -3,7 +3,7 @@

 macro(tests)

-import(object)
+import(oo-cmake)

 test_register(shouldCreateAObject)
 function(${current_test_name})


Add output file in the command comment.

Add output file in the command comment.

	* build-aux/cmake/modules/ConfigureVersionInfo.cmake: Do that.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/ConfigureVersionInfo.cmake
+++ build-aux/cmake/modules/ConfigureVersionInfo.cmake
@@ -22,7 +22,7 @@
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     COMMENT "${CMAKE_COMMAND} -E cmake_echo_color "
     "--switch=${CMAKE_MAKEFILE_COLOR} --cyan "
-    "Generating version information time stamp" VERBATIM)
+    "Generating version information time stamp '${output}.tmp'" VERBATIM)
   add_custom_command(
     OUTPUT ${output}
     COMMAND ${CMAKE_AUX_DIR}/move-if-change
@@ -31,7 +31,7 @@
     WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
     COMMENT "${CMAKE_COMMAND} -E cmake_echo_color "
     "--switch=${CMAKE_MAKEFILE_COLOR} --cyan "
-    "Generating version information" VERBATIM)
+    "Generating version information '${output}'" VERBATIM)
   set_source_files_properties(${deps}
     PROPERTIES OBJECT_DEPENDS ${output})
   set_directory_properties(PROPERTIES


cmake: pyside2: we also need headers from shiboken and pyside2

--- cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake
+++ cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake
@@ -47,20 +47,27 @@
         # to dance to be compatible with the old (<5.12) and the new versions (>=5.12)
         if(NOT SHIBOKEN_LIBRARY AND TARGET Shiboken2::libshiboken)
                 get_property(SHIBOKEN_LIBRARY TARGET Shiboken2::libshiboken PROPERTY IMPORTED_LOCATION_RELEASE)
+                get_property(SHIBOKEN_INCLUDE_DIR TARGET Shiboken2::libshiboken PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
         endif(NOT SHIBOKEN_LIBRARY AND TARGET Shiboken2::libshiboken)

-        if(NOT SHIBOKEN_LIBRARY)
+        if(NOT SHIBOKEN_LIBRARY AND NOT SHIBOKEN_INCLUDE_DIR)
             message("====================\n"
                     "shiboken2 not found.\n"
                     "====================\n")
-        endif(NOT SHIBOKEN_LIBRARY)
+        endif(NOT SHIBOKEN_LIBRARY AND NOT SHIBOKEN_INCLUDE_DIR)

         find_package(PySide2 QUIET)# REQUIRED
-        if(NOT PYSIDE_INCLUDE_DIR)
+
+        if(NOT PYSIDE_LIBRARY AND TARGET PySide2::pyside2)
+                get_property(PYSIDE_LIBRARY TARGET PySide2::pyside2 PROPERTY IMPORTED_LOCATION_RELEASE)
+                get_property(PYSIDE_INCLUDE_DIR TARGET PySide2::pyside2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+        endif(NOT PYSIDE_LIBRARY AND TARGET PySide2::pyside2)
+
+        if(NOT PYSIDE_LIBRARY AND NOT PYSIDE_INCLUDE_DIR)
             message("==================\n"
                     "PySide2 not found.\n"
                     "==================\n")
-        endif(NOT PYSIDE_INCLUDE_DIR)
+        endif(NOT PYSIDE_LIBRARY AND NOT PYSIDE_INCLUDE_DIR)

         find_package(PySide2Tools QUIET) #REQUIRED # PySide2 utilities (pyside2-uic & pyside2-rcc)
         if(NOT PYSIDE2_TOOLS_FOUND)


Separate tests for GeodSolve74 and 75 to allow more fuzziness in -E result.


adding convert test at the very beginning

--- test/testing.cmake
+++ test/testing.cmake
@@ -2,14 +2,19 @@
     CACHE string
     "path to the meshes svn repo")
 set(MDIR ${MESHES}/pipe)
+add_test(convert
+  convert
+  "${MDIR}/pipe.smd"
+  "${MDIR}/pipe.sms"
+  "pipe.smb")
 add_test(verify_serial
   verify
   "${MDIR}/pipe.smd"
-  "${MDIR}/pipe.smb")
+  "pipe.smb")
 add_test(uniform_serial
   uniform
   "${MDIR}/pipe.smd"
-  "${MDIR}/pipe.smb"
+  "pipe.smb"
   "pipe_unif.smb")
 add_test(snap_serial
   snap


Fix framework linking in macOS builds

Fix framework linking in macOS builds

--- Source/PLT/target/macOS/config.cmake
+++ Source/PLT/target/macOS/config.cmake
@@ -25,7 +25,7 @@
 #-------------------------------------------------------------------------------
 # Special compile flags for this platform

-set(PLT_cxx_flags "-std=c++11")
+set(PLT_cxx_flags "-std=c++14")

 set(PLT_c_flags "-DPLT_FRAME_BUFFERED")

@@ -59,7 +59,8 @@

 set(PLT_libs ${SDL2_LIBRARIES})

-# TODO
-#env.Append(LINKFLAGS = ['-framework', 'CoreMIDI'])
-#env.Append(LINKFLAGS = ['-framework', 'CoreFoundation'])
+# Use of bizar "SHELL: <option>" syntax to get round cmakes de-duplication of
+# -framework
+add_link_options("SHELL: -framework CoreMIDI")
+add_link_options("SHELL: -framework CoreFoundation")


enable option to generate filter documentation

--- Superbuild/Projects/paraview.cmake
+++ Superbuild/Projects/paraview.cmake
@@ -3,6 +3,7 @@

   CMAKE_ARGS
     -DCMAKE_CXX_STANDARD=11
+    -DPARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION=ON
     -DBUILD_SHARED_LIBS:BOOL=ON
     -DBUILD_TESTING:BOOL=OFF
     -DPARAVIEW_BUILD_QT_GUI:BOOL=ON


testing installer dependencies

testing installer dependencies

--- cpack-config.cmake
+++ cpack-config.cmake
@@ -1,4 +1,6 @@
 INCLUDE(InstallRequiredSystemLibraries)
+# INSTALL(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION bin COMPONENT Libraries)
+
 SET(CPACK_PACKAGE_VERSION_MAJOR "${RIDE_VERSION_MAJOR}")
 SET(CPACK_PACKAGE_VERSION_MINOR "${RIDE_VERSION_MINOR}")
 SET(CPACK_PACKAGE_VERSION_PATCH "${RIDE_VERSION_REVISION}")


COMP: Set CTEST_GIT_UPDATE_CUSTOM and added ctest_update() to SupelElastix root test, the same way as I did for the SuperBuild.

--- CTest.cmake
+++ CTest.cmake
@@ -36,6 +36,11 @@
     OUTPUT_VARIABLE SELX_GIT_BRANCH_NAME
 )

+if(NOT DEFINED CTEST_GIT_COMMAND)
+  find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
+endif()
+set(CTEST_GIT_UPDATE_CUSTOM "${CTEST_GIT_COMMAND}" pull origin)
+
 set(CTEST_BUILD_NAME "${SELX_GIT_BRANCH_NAME};Tests;commit=SHA\\:${SELX_GIT_COMMIT_SHA}")

 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
@@ -48,6 +53,7 @@
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} \"${CTEST_SOURCE_DIRECTORY}\"")

 ctest_start("Nightly")
-# TODO Add ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
+# Added ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
+ctest_update()
 ctest_test()
 ctest_submit( PARTS Test )


fix: Do not reset <Pkg>_FIND_* variables when DEPENDS_<Pkg>_DIR changed [BASIS]

--- CMake/Basis/CommonTools.cmake
+++ CMake/Basis/CommonTools.cmake
@@ -523,10 +523,9 @@
         basis_update_value (DEPENDS_${PKG}_DIR "${_BFP_PREFIX}")
       endif ()
       # --------------------------------------------------------------------
-      # reset _?<PKG>[_-]* cache entries when DEPENDS_<PKG>_DIR has changed
+      # reset _?<PKG>[_-]* variables when DEPENDS_<PKG>_DIR has changed
       if (_DEPENDS_${PKG}_DIR AND DEPENDS_${PKG}_DIR)
         if (NOT "^${_DEPENDS_${PKG}_DIR}$" STREQUAL "^${DEPENDS_${PKG}_DIR}$")
-          set (${PKG}_FOUND FALSE) # need to start a new search
           get_cmake_property (_BFP_VARS VARIABLES)
           basis_sanitize_for_regex (PKG_RE     "${PKG}")
           basis_sanitize_for_regex (PKG_U_RE   "${PKG_U}")
@@ -537,7 +536,7 @@
               if (_BFP_CACHED)
                 set_property (CACHE ${_BFP_VAR} PROPERTY VALUE "${_BFP_VAR}-NOTFOUND")
                 set_property (CACHE ${_BFP_VAR} PROPERTY TYPE  INTERNAL)
-              else ()
+              elseif (NOT _BFP_VAR MATCHES "^${PKG_RE}_FIND_")
                 unset (${_BFP_VAR})
               endif ()
             endif ()


COMP: remove boilerplate code. it has no effect since CMAKE_MODULE_PATH contains /CMake

--- CMake/ImportOpenThreads.cmake
+++ CMake/ImportOpenThreads.cmake
@@ -1,12 +1,6 @@
 MESSAGE(STATUS "Importing OpenThreads...")
-#-----------------------------------------------------------------------------
-# Option for OpenThreads (necessary because used by the OSSIM library)
-# Find OpenThread library
-IF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake")
-        FIND_PACKAGE(OpenThreads)
-ELSE(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake")
-        INCLUDE(${OTB_SOURCE_DIR}/CMake/FindOpenThreads.cmake)
-ENDIF(EXISTS "${CMAKE_ROOT}/Modules/FindOpenThreads.cmake")
+
+FIND_PACKAGE(OpenThreads)

 MARK_AS_ADVANCED(OPENTHREADS_INCLUDE_DIR)
 MARK_AS_ADVANCED(OPENTHREADS_LIBRARY)


cmake BUGFIX ssh_threads linking

cmake BUGFIX ssh_threads linking

--- CMakeModules/FindLibSSH.cmake
+++ CMakeModules/FindLibSSH.cmake
@@ -90,15 +90,15 @@

             if(LIBSSH_VERSION VERSION_LESS 0.8.0)
                 # libssh_threads also needs to be linked for these versions
-                string(REPLACE "libssh.so" ""
+                string(REPLACE "libssh.so" "libssh_threads.so"
                     LIBSSH_THREADS_LIBRARY
                     ${LIBSSH_LIBRARY}
                 )
-                string(REPLACE "libssh.dylib" ""
+                string(REPLACE "libssh.dylib" "libssh_threads.dylib"
                     LIBSSH_THREADS_LIBRARY
                     ${LIBSSH_THREADS_LIBRARY}
                 )
-                string(REPLACE "ssh.so" ""
+                string(REPLACE "ssh.so" "ssh_threads.so"
                     LIBSSH_THREADS_LIBRARY
                     ${LIBSSH_THREADS_LIBRARY}
                 )


Fix CommonCTest

Fix CommonCTest

--- CommonCTest.cmake
+++ CommonCTest.cmake
@@ -58,7 +58,7 @@
 endforeach(FILE ${TEST_FILES})

 add_custom_target(runtests
-  COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS any ${ALL_TESTS}
+  COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS ${ALL_TESTS}
   COMMENT "Running all unit tests")

 if(COVERAGE)


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 01)

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


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   06)
+SET(KWSYS_DATE_STAMP_DAY   07)


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   15)
+SET(KWSYS_DATE_STAMP_DAY   16)


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 09)

 # 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
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


cmake: fixed method to locate arch-specific python libraries (patch be Bruno Postle)

--- config/FindVIGRANUMPY_DEPENDENCIES.cmake
+++ config/FindVIGRANUMPY_DEPENDENCIES.cmake
@@ -36,7 +36,7 @@
     ######################################################################
     IF(NOT DEFINED VIGRANUMPY_INSTALL_DIR OR VIGRANUMPY_INSTALL_DIR MATCHES "^$")
         execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c
-                         "from distutils.sysconfig import *; print get_python_lib()"
+                         "from distutils.sysconfig import *; print get_python_lib(1)"
                           OUTPUT_VARIABLE PYTHON_SITE_PACKAGES OUTPUT_STRIP_TRAILING_WHITESPACE)
         FILE(TO_CMAKE_PATH ${PYTHON_SITE_PACKAGES} VIGRANUMPY_INSTALL_DIR)
     ENDIF()


Hide the Simbody_ROOT_DIR variable in CMake.

git-svn-id: 9e047e1e624cce0a2485e750063112e834f85522@7383 fc29be9c-2cb0-420d-b520-73dbd18add6e

--- FindSimbody.cmake
+++ FindSimbody.cmake
@@ -366,8 +366,8 @@
     mark_as_advanced(Simbody_LIBRARIES_VN Simbody_STATIC_LIBRARIES_VN)
 endif()

-# Leave Simbody_ROOT_DIR visible
 mark_as_advanced(
+	Simbody_ROOT_DIR
     Simbody_INCLUDE_DIR
     Simbody_BIN_DIR
     Simbody_LIB_DIR


moab: remove username specification

moab: remove username specification

--- superbuild/versions.cmake
+++ superbuild/versions.cmake
@@ -221,7 +221,7 @@

 if(WIN32)
 add_revision(moab
-  GIT_REPOSITORY https://judajake@bitbucket.org/judajake/moab.git
+  GIT_REPOSITORY https://bitbucket.org/judajake/moab.git
   GIT_TAG fix_windows)
 else()
 add_revision(moab


Squashed 'cmake/yacma/' changes from b51f63cb..0bde32cd

0bde32cd Tentative clang warning workaround.

git-subtree-dir: cmake/yacma
git-subtree-split: 0bde32cd405c64cfb618da84e7c76afbdb9a0c8b

--- YACMACompilerLinkerSettings.cmake
+++ YACMACompilerLinkerSettings.cmake
@@ -112,6 +112,9 @@
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class)
+        # NOTE: this is a new flag in Clang 13 which seems to give
+        # incorrect warnings for UDLs.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier)
     endif()

     # Common configuration for GCC, clang and Intel.


Trying to fix the find for geos

Trying to fix the find for geos

--- cmake/CMakeModules/FindGEOS.cmake
+++ cmake/CMakeModules/FindGEOS.cmake
@@ -30,13 +30,16 @@
 find_path( GEOS_INCLUDE_DIR geos_c.h
            PATHS
            $ENV{GEOS_DIR}/include
-           ${GEOS_DIR}/include)
+           ${GEOS_DIR}/include
+           /usr/local/include)

 # Find GEOS library:
 find_library( GEOS_LIB NAMES geos
               PATHS
               $ENV{GEOS_DIR}/lib
-              ${GEOS_DIR}/lib)
+              ${GEOS_DIR}/lib
+              /usr/local/lib
+              /usr/local/lib64)

 # Find GEOS C library:
 find_library( GEOS_C_LIB NAMES geos_c


[CMake] Don't set <PROJECT>_STANDALONE_BUILD

We shouldn't be treating runtimes builds as standalone builds since
we have enough of the context loaded into the runtimes environment.

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

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -515,7 +515,7 @@
   if(LIBCXX_USE_TOOLCHAIN)
     set(compiler_args -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER}
                       -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_CXX_COMPILER})
-    if(NOT COMPILER_RT_STANDALONE_BUILD)
+    if(NOT COMPILER_RT_STANDALONE_BUILD AND NOT RUNTIMES_BUILD)
       set(toolchain_deps $<TARGET_FILE:clang>)
       set(force_deps DEPENDS $<TARGET_FILE:clang>)
     endif()


cmake: don't force -Werror=...

cmake: don't force -Werror=...

- improve compatibility with further compiler versions
- warnings are not errors by default

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -119,12 +119,12 @@
     # we want.
     add_extra_compiler_option(-Wall)
   endif()
-  add_extra_compiler_option(-Werror=return-type)
-  add_extra_compiler_option(-Werror=non-virtual-dtor)
-  add_extra_compiler_option(-Werror=address)
-  add_extra_compiler_option(-Werror=sequence-point)
+  add_extra_compiler_option(-Wreturn-type)
+  add_extra_compiler_option(-Wnon-virtual-dtor)
+  add_extra_compiler_option(-Waddress)
+  add_extra_compiler_option(-Wsequence-point)
   add_extra_compiler_option(-Wformat)
-  add_extra_compiler_option(-Werror=format-security -Wformat)
+  add_extra_compiler_option(-Wformat-security -Wformat)
   add_extra_compiler_option(-Wmissing-declarations)
   add_extra_compiler_option(-Wmissing-prototypes)
   add_extra_compiler_option(-Wstrict-prototypes)


[CMake] Simplify a few framework build rules

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

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -22,8 +22,8 @@
   endif()
   add_custom_command(TARGET lldb-framework POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
-    COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers
-    COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current
+    COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Headers
+    COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Versions/Current
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
   )
 else()


Deps check system for cmake (libs only)

Deps check system for cmake (libs only)

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -147,6 +147,7 @@
 	# Include dirs for mrpt-XXX libs:
 	set(AUX_DEPS_LIST "")
 	set(AUX_EXTRA_LINK_LIBS "")
+	set(AUX_ALL_DEPS_BUILD 1)
 	FOREACH(DEP ${ARGN})
 		# Only for "mrpt-XXX" libs:
 		IF (${DEP} MATCHES "mrpt-")
@@ -168,9 +169,23 @@

 				# Append to list of mrpt-* lib dependences:
 				LIST(APPEND AUX_DEPS_LIST ${DEP})
+
+				# Check if all dependencies are to be build:
+				if ("BUILD_mrpt-${DEP_MRPT_NAME}" STREQUAL "OFF")
+					SET(AUX_ALL_DEPS_BUILD 0)
+					MESSAGE(STATUS "*Warning*: Lib mrpt-${name} cannot be built because dependency mrpt-${DEP_MRPT_NAME} has been disabled!")
+				endif ("BUILD_mrpt-${DEP_MRPT_NAME}" STREQUAL "OFF")
+
 			ENDIF(NOT "${DEP_MRPT_NAME}" STREQUAL "")
 		ENDIF (${DEP} MATCHES "mrpt-")
 	ENDFOREACH(DEP)
+
+	# Impossible to build?
+	if (NOT AUX_ALL_DEPS_BUILD)
+		MESSAGE(STATUS "*Warning* ==> Disabling compilation of lib mrpt-${name} for missing dependencies listed above.")
+		SET(BUILD_mrpt-${name} OFF CACHE BOOL "Build the library mrpt-${name}" FORCE)
+	endif (NOT AUX_ALL_DEPS_BUILD)
+

 	# Emulates a global variable:
 	set_property(GLOBAL PROPERTY "mrpt-${name}_LIB_DEPS" "${AUX_DEPS_LIST}")


Find OpenBLAS more aggressively.  This made a difference on Fedora 20

--- bench/btl/cmake/FindOPENBLAS.cmake
+++ bench/btl/cmake/FindOPENBLAS.cmake
@@ -3,7 +3,7 @@
   set(OPENBLAS_FIND_QUIETLY TRUE)
 endif (OPENBLAS_LIBRARIES)

-find_file(OPENBLAS_LIBRARIES libopenblas.so PATHS /usr/lib $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})
+find_file(OPENBLAS_LIBRARIES NAMES libopenblas.so libopenblas.so.0 PATHS /usr/lib /usr/lib64 $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})
 find_library(OPENBLAS_LIBRARIES openblas PATHS $ENV{OPENBLASDIR} ${LIB_INSTALL_DIR})

 if(OPENBLAS_LIBRARIES AND CMAKE_COMPILER_IS_GNUCXX)