Put some debugging code in FindVTK.

Put some debugging code in FindVTK.

--- cmake_modules/FindVTK.cmake
+++ cmake_modules/FindVTK.cmake
@@ -142,7 +142,9 @@
     get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
     get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
     set(VTK_BIN_DIR "${__TMP_DIR}/bin" CACHE PATH "VTK Runtime libraries location.")
-
+message(STATUS "TMP_DIR IS: ${__TMP_DIR}")
+message(STATUS "VTK_LIB_DIR IS: ${VTK_LIB_DIR}")
+message(STATUS "VTK_BIN_DIR IS: ${VTK_BIN_DIR}")
     get_filename_component(__TMP_DIR "${VTK_LIB_DIR}" PATH)
     get_filename_component(__TMP_DIR "${__TMP_DIR}" PATH)
     set(VTK_INCLUDE_DIRS "${__TMP_DIR}/include/vtk-5.6" CACHE PATH "VTK Headers location.")


Cleanup

Cleanup

svn path=/trunk/KDE/kdeutils/superkaramba/; revision=546825

--- config-superkaramba.h.cmake
+++ config-superkaramba.h.cmake
@@ -1,3 +1,5 @@
 /* Define if you have xmms libraries and header files. */
 #cmakedefine HAVE_XMMS 1

+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H 1


fix not to complain about macro redefinition

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -2,7 +2,13 @@
 #define WC_CONFIG_H

 #cmakedefine TEST_APP
-#cmakedefine UNIX
-#cmakedefine WIN32
+
+#ifndef UNIX
+    #cmakedefine UNIX
+#endif
+
+#ifndef WIN32
+    #cmakedefine WIN32
+#endif

 #endif


ENH: Fix case sensitivity for FindBoost.cmake.

--- SuperBuild/External_Boost.cmake
+++ SuperBuild/External_Boost.cmake
@@ -17,7 +17,7 @@
 # Make sure that the ExtProjName/IntProjName variables are unique globally
 # even if other External_${ExtProjName}.cmake files are sourced by
 # SlicerMacroCheckExternalProjectDependency
-set(extProjName BOOST) #The find_package known name
+set(extProjName Boost) #The find_package known name
 set(proj        Boost) #This local name
 set(${extProjName}_REQUIRED_VERSION "")  #If a required version is necessary, then set this, else leave blank


Update sqlite version for cmake build (#18524)

The sqlite has been updated in bazel, though
cmake version was not updated. This fix updates
sqlite in cmake so that cmake and bazel versions
are synced.

The fix has been tested on Linux:
```
tensorflow/tools/ci_build/ci_build.sh CMAKE tensorflow/tools/ci_build/builds/cmake.sh
```

Signed-off-by: Yong Tang <765086fe2e0c1f980161f127fec596800f327f62@outlook.com>

--- tensorflow/contrib/cmake/external/sqlite.cmake
+++ tensorflow/contrib/cmake/external/sqlite.cmake
@@ -15,8 +15,8 @@
 include (ExternalProject)

 set(sqlite_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/external/sqlite)
-set(sqlite_URL https://mirror.bazel.build/www.sqlite.org/2017/sqlite-amalgamation-3200000.zip)
-set(sqlite_HASH SHA256=208780b3616f9de0aeb50822b7a8f5482f6515193859e91ed61637be6ad74fd4)
+set(sqlite_URL https://mirror.bazel.build/www.sqlite.org/2018/sqlite-amalgamation-3230100.zip)
+set(sqlite_HASH SHA256=4239a1f69e5721d07d9a374eb84d594225229e54be4ee628da2995f4315d8dfc)
 set(sqlite_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sqlite/src/sqlite)
 set(sqlite_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/sqlite/install)


Oops, set CMake 3.20 CMP0116 policy to OLD

--- atdna/atdnaHelpers.cmake
+++ atdna/atdnaHelpers.cmake
@@ -3,8 +3,8 @@
 # across all dependencies.
 #

-# CMake 3.20: Transform add_custom_command DEPFILE for Ninja
-cmake_policy(SET CMP0116 NEW)
+# CMake 3.20: Don't transform add_custom_command DEPFILE for Ninja
+cmake_policy(SET CMP0116 OLD)

 function(_atdna_gather_include_directories_impl target_name)
   get_target_property(target_dependencies ${target_name} INTERFACE_LINK_LIBRARIES)


Don't add any autobuild prepacked dirs to link search path when building standalone.

--- indra/cmake/Linking.cmake
+++ indra/cmake/Linking.cmake
@@ -33,6 +33,8 @@
   set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
 endif(WINDOWS OR DARWIN)

+if( NOT STANDALONE ) # <FS:ND/> Don't add any autobuild dirs when building standalone
+
 # <FS:Ansariel> Changed for Firestorm
 #if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
 if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_open")
@@ -46,8 +48,11 @@
 #endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
 endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "ReleaseFS_open")
 # </FS:Ansariel> Changed for Firestorm
+
 message(STATUS "For ${CMAKE_BUILD_TYPE}, AUTOBUILD_LIBS_INSTALL_DIRS: ${AUTOBUILD_LIBS_INSTALL_DIRS}")
 link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
+
+endif( NOT STANDALONE ) # <FS:ND/> Don't add any autobuild dirs when building standalone

 if (LINUX)
   set(DL_LIBRARY dl)


Make configure check work on Windows (and probably other platforms), where socket operations require linking to more than libc

svn path=/branches/work/kdab-post-4.0/kdepim/; revision=720186

--- kleopatra/ConfigureChecks.cmake
+++ kleopatra/ConfigureChecks.cmake
@@ -83,8 +83,16 @@
         "
     HAVE_GPG_ERR_SOURCE_KLEO )

-  # check if assuan has assuan_sock_get_nonce
-  check_function_exists( "assuan_sock_get_nonce" HAVE_ASSUAN_SOCK_GET_NONCE )
+  # check if assuan has assuan_sock_get_nonce (via assuan_sock_nonce_t)
+  # function_exists runs into linking errors - libassuan is static,
+  # and assuan_sock_get_nonce drags in stuff that needs linking
+  # against winsock2.
+  check_cxx_source_compiles("
+        #include <assuan.h>
+        static assuan_sock_nonce_t nonce;
+        int main() { return 0; }
+        "
+    HAVE_ASSUAN_SOCK_GET_NONCE )

   if ( WIN32 AND NOT HAVE_ASSUAN_SOCK_GET_NONCE )
     set( USABLE_ASSUAN_FOUND false )


CELIX-199: Moved the code coverage CMake macros inside an option that can be enabled using the CMake cache (ENABLE_CODE_COVERAGE).

git-svn-id: 2595ac559ac7dd568b108f33b264eba7ab70070c@1650165 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/cmake_celix/CodeCoverage.cmake
+++ cmake/cmake_celix/CodeCoverage.cmake
@@ -44,41 +44,49 @@
 # 6. Removed unneeded Cobertura function
 #

-# Check prereqs
-FIND_PROGRAM( GCOV_PATH gcov )
-FIND_PROGRAM( LCOV_PATH lcov )
-FIND_PROGRAM( GENHTML_PATH genhtml )
-FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+# Option to enable/disable coverage
+option(ENABLE_CODE_COVERAGE "Enables code coverage" FALSE)

-IF(NOT GCOV_PATH)
-	MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
-ENDIF() # NOT GCOV_PATH
+# Check if coverage is enabled
+IF(ENABLE_CODE_COVERAGE)

-#IF(NOT CMAKE_COMPILER_IS_GNUCXX)
-#	MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
-#ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
-
-IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
-  MESSAGE( WARNING "Code coverage results with an optimised (non-Debug) build may be misleading" )
-ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
-
-# Setup compiler options
-ADD_DEFINITIONS(--coverage)
-set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
-set(CMAKE_EXE_LINKER_FLAGS "--coverage")
-
-IF(NOT TARGET coverage)
-    add_custom_target(coverage
-	    COMMAND ${CMAKE_COMMAND} -E make_directory coverage_results
-	    COMMAND ${GENHTML_PATH} -o coverage_results coverage/*.info.cleaned
-	    COMMAND ${CMAKE_COMMAND} -E remove_directory coverage
-
-	    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-	    COMMENT "Generating report.\nOpen ./${_outputname}/index.html in your browser to view the coverage report."
-    )
-
-    SET_TARGET_PROPERTIES(coverage PROPERTIES COVERAGE_TARGET_ADDED "")
-ENDIF()
+    # Check prereqs
+    FIND_PROGRAM( GCOV_PATH gcov )
+    FIND_PROGRAM( LCOV_PATH lcov )
+    FIND_PROGRAM( GENHTML_PATH genhtml )
+    FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+
+    IF(NOT GCOV_PATH)
+    	MESSAGE(FATAL_ERROR "gcov not found! Aborting...")
+    ENDIF() # NOT GCOV_PATH
+
+    #IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+    #	MESSAGE(FATAL_ERROR "Compiler is not GNU gcc! Aborting...")
+    #ENDIF() # NOT CMAKE_COMPILER_IS_GNUCXX
+
+    IF ( NOT CMAKE_BUILD_TYPE STREQUAL "Debug" )
+      MESSAGE( WARNING "Code coverage results with an optimised (non-Debug) build may be misleading" )
+    ENDIF() # NOT CMAKE_BUILD_TYPE STREQUAL "Debug"
+
+    # Setup compiler options
+    ADD_DEFINITIONS(--coverage)
+    set(CMAKE_SHARED_LINKER_FLAGS "--coverage")
+    set(CMAKE_EXE_LINKER_FLAGS "--coverage")
+
+    IF(NOT TARGET coverage)
+        add_custom_target(coverage
+    	    COMMAND ${CMAKE_COMMAND} -E make_directory coverage_results
+    	    COMMAND ${GENHTML_PATH} -o coverage_results coverage/*.info.cleaned
+    	    COMMAND ${CMAKE_COMMAND} -E remove_directory coverage
+
+    	    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    	    COMMENT "Generating report.\nOpen ./${_outputname}/index.html in your browser to view the coverage report."
+        )
+
+        SET_TARGET_PROPERTIES(coverage PROPERTIES COVERAGE_TARGET_ADDED "")
+    ENDIF()
+
+ENDIF(ENABLE_CODE_COVERAGE)

 # Param _targetname     The name of new the custom make target
 # Param _testrunner     The name of the target which runs the tests
@@ -87,31 +95,32 @@
 # Optional fourth parameter is passed as arguments to _testrunner
 #   Pass them in list form, e.g.: "-j;2" for -j 2
 FUNCTION(SETUP_TARGET_FOR_COVERAGE _targetname _testrunner _outputname)
-
-	IF(NOT LCOV_PATH)
-		MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
-	ENDIF() # NOT LCOV_PATH
-
-	IF(NOT GENHTML_PATH)
-		MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
-	ENDIF() # NOT GENHTML_PATH
-
-	# Setup target
-	ADD_CUSTOM_TARGET(${_targetname}
-
-		# Cleanup lcov
-		${LCOV_PATH} --directory . --zerocounters
-
-		# Run tests
-		COMMAND ${_testrunner} ${ARGV3}
-
-		# Capturing lcov counters and generating report
-		COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
-		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'mock/*' 'test/*' '/usr/*' --output-file ${_outputname}.info.cleaned
-
-		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-		COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
-	)
-	ADD_DEPENDENCIES(coverage ${_targetname})
+    IF(ENABLE_CODE_COVERAGE)
+    	IF(NOT LCOV_PATH)
+    		MESSAGE(FATAL_ERROR "lcov not found! Aborting...")
+    	ENDIF() # NOT LCOV_PATH
+
+    	IF(NOT GENHTML_PATH)
+    		MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
+    	ENDIF() # NOT GENHTML_PATH
+
+    	# Setup target
+    	ADD_CUSTOM_TARGET(${_targetname}
+
+    		# Cleanup lcov
+    		${LCOV_PATH} --directory . --zerocounters
+
+    		# Run tests
+    		COMMAND ${_testrunner} ${ARGV3}
+
+    		# Capturing lcov counters and generating report
+    		COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/coverage
+    		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
+    		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'mock/*' 'test/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+
+    		WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    		COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
+    	)
+    	ADD_DEPENDENCIES(coverage ${_targetname})
+    ENDIF(ENABLE_CODE_COVERAGE)
 ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE


Implement an option to ENABLE_workaround_9220 which defaults to ON.  If
this this option is turned off you get hard landings if some compiler is
missing/broken but generally debugging what is wrong is easier.

svn path=/trunk/; revision=10904

--- cmake/modules/language_support.cmake
+++ cmake/modules/language_support.cmake
@@ -6,10 +6,13 @@
 # This additional function definition is needed to provide a workaround for
 # CMake bug 9220.

-function(workaround_9220 language language_works)
-  #message("DEBUG: language = ${language}")
-  set(text
-    "project(test C)
+option(ENABLE_workaround_9220 "Enable a workaround for cmake bug 9220" ON)
+
+if(ENABLE_workaround_9220)
+  function(workaround_9220 language language_works)
+    #message("DEBUG: language = ${language}")
+    set(text
+      "project(test C)
 # Locations where PLplot cmake build system first looks for cmake modules.
 if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
   set(CMAKE_MODULE_PATH
@@ -29,81 +32,87 @@
 #enable_language(${language} OPTIONAL)
 enable_language(${language})
 "
-    )
-  file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})
-  file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language})
-  file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt
-    ${text})
-  # Special language support files for various languages:
-  # N.B. This list of files has to be maintained to be consistent
-  # with anything special we do in terms of language support.
-
-  if(language STREQUAL "Ada")
-    set(language_special ON)
-    set(language_files
-      language_support/cmake/CMakeAdaCompiler.cmake.in
-      language_support/cmake/CMakeAdaInformation.cmake
-      language_support/cmake/CMakeDetermineAdaCompiler.cmake
-      language_support/cmake/CMakeTestAdaCompiler.cmake
       )
-  elseif(language STREQUAL "D")
-    set(language_special ON)
-    set(language_files
-      language_support/cmake/CMakeDCompiler.cmake.in
-      language_support/cmake/CMakeDInformation.cmake
-      language_support/cmake/CMakeDetermineDCompiler.cmake
-      language_support/cmake/CMakeTestDCompiler.cmake
-      language_support/cmake/Platform/Linux-dmd.cmake
-      language_support/cmake/Platform/Linux-gdc.cmake
-      language_support/cmake/Platform/Windows-dmd.cmake
-      language_support/cmake/Platform/Windows-gdc.cmake
-      )
-  elseif(language STREQUAL "Fortran")
-    if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
+    file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})
+    file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language})
+    file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt
+      ${text})
+    # Special language support files for various languages:
+    # N.B. This list of files has to be maintained to be consistent
+    # with anything special we do in terms of language support.
+
+    if(language STREQUAL "Ada")
       set(language_special ON)
       set(language_files
-	language_support/cmake-2.6/CMakeFortranInformation.cmake
-	language_support/cmake-2.6/Platform/Cygwin-GNU-Fortran.cmake
-	language_support/cmake-2.6/Platform/Windows-GNU-Fortran.cmake
-	language_support/cmake-2.6/Platform/Windows-df.cmake
-	language_support/cmake-2.6/Platform/Windows-f90.cmake
+	language_support/cmake/CMakeAdaCompiler.cmake.in
+	language_support/cmake/CMakeAdaInformation.cmake
+	language_support/cmake/CMakeDetermineAdaCompiler.cmake
+	language_support/cmake/CMakeTestAdaCompiler.cmake
 	)
-    else(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
+    elseif(language STREQUAL "D")
+      set(language_special ON)
+      set(language_files
+	language_support/cmake/CMakeDCompiler.cmake.in
+	language_support/cmake/CMakeDInformation.cmake
+	language_support/cmake/CMakeDetermineDCompiler.cmake
+	language_support/cmake/CMakeTestDCompiler.cmake
+	language_support/cmake/Platform/Linux-dmd.cmake
+	language_support/cmake/Platform/Linux-gdc.cmake
+	language_support/cmake/Platform/Windows-dmd.cmake
+	language_support/cmake/Platform/Windows-gdc.cmake
+	)
+    elseif(language STREQUAL "Fortran")
+      if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
+	set(language_special ON)
+	set(language_files
+	  language_support/cmake-2.6/CMakeFortranInformation.cmake
+	  language_support/cmake-2.6/Platform/Cygwin-GNU-Fortran.cmake
+	  language_support/cmake-2.6/Platform/Windows-GNU-Fortran.cmake
+	  language_support/cmake-2.6/Platform/Windows-df.cmake
+	  language_support/cmake-2.6/Platform/Windows-f90.cmake
+	  )
+      else(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
+	set(language_special OFF)
+      endif(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
+    else(language STREQUAL "Ada")
       set(language_special OFF)
-    endif(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 6)
-  else(language STREQUAL "Ada")
-    set(language_special OFF)
-  endif(language STREQUAL "Ada")
+    endif(language STREQUAL "Ada")

-  if(language_special)
-    file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}/cmake/modules/Platform)
-    foreach(file ${language_files})
-      configure_file(
-	${CMAKE_SOURCE_DIR}/cmake/modules/${file}
-	${CMAKE_BINARY_DIR}/language_tests/${language}/cmake/modules/${file}
-	COPYONLY
-	)
-    endforeach(file ${language_files})
-  endif(language_special)
+    if(language_special)
+      file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}/cmake/modules/Platform)
+      foreach(file ${language_files})
+	configure_file(
+	  ${CMAKE_SOURCE_DIR}/cmake/modules/${file}
+	  ${CMAKE_BINARY_DIR}/language_tests/${language}/cmake/modules/${file}
+	  COPYONLY
+	  )
+      endforeach(file ${language_files})
+    endif(language_special)

-  execute_process(
-    COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
-    RESULT_VARIABLE return_code
-    #OUTPUT_VARIABLE output
-    #ERROR_VARIABLE error
-    #OUTPUT_STRIP_TRAILING_WHITESPACE
-    #ERROR_STRIP_TRAILING_WHITESPACE
-    )
-  if(return_code EQUAL 0)
+    execute_process(
+      COMMAND ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR} .
+      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
+      RESULT_VARIABLE return_code
+      #OUTPUT_VARIABLE output
+      #ERROR_VARIABLE error
+      #OUTPUT_STRIP_TRAILING_WHITESPACE
+      #ERROR_STRIP_TRAILING_WHITESPACE
+      )
+    if(return_code EQUAL 0)
+      set(${language_works} ON CACHE INTERNAL "")
+    else(return_code EQUAL 0)
+      set(${language_works} OFF CACHE INTERNAL "")
+      #message(STATUS "A test cmake run with language = ${language} enabled failed with the following stdout and stderr:")
+      #message(STATUS "stdout = ${output}")
+      #message(STATUS "stderr = ${error}")
+    endif(return_code EQUAL 0)
+  endfunction(workaround_9220)
+else(ENABLE_workaround_9220)
+  function(workaround_9220 language language_works)
+    # Dummy version that always returns success.
     set(${language_works} ON CACHE INTERNAL "")
-  else(return_code EQUAL 0)
-    set(${language_works} OFF CACHE INTERNAL "")
-    #message(STATUS "A test cmake run with language = ${language} enabled failed with the following stdout and stderr:")
-    #message(STATUS "stdout = ${output}")
-    #message(STATUS "stderr = ${error}")
-  endif(return_code EQUAL 0)
-endfunction(workaround_9220)
+  endfunction(workaround_9220)
+endif(ENABLE_workaround_9220)

 # Temporary tests of the above function.
 #workaround_9220(CXX CXX_language_works)


fix var handling for VAD_Ceres

fix var handling for VAD_Ceres

Change-Id: I96afbece020cbc18c8f85788c0486134c41a2ecc

--- VAD_Ceres.cmake
+++ VAD_Ceres.cmake
@@ -59,10 +59,10 @@
         "#undef ERROR\n#define MAX_LOG_LEVEL -1" FILECONTENT "${FILECONTENT}")
   file(WRITE "${VAD_EXTERNAL_ROOT}/Ceres/internal/ceres/miniglog/glog/logging.h" "${FILECONTENT}")

-  set(EIGENSPARSE ON CACHE BOOL "" FORCE) #use Eigen (no additional deps required - but suitesparse should be faster!)
-  set(MINIGLOG ON CACHE BOOL "" FORCE) #use miniglog
-  set(EIGENSPARSE ON CACHE BOOL "" FORCE)
-  set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
+  vad_add_var(EIGENSPARSE ON CACHE BOOL "" FORCE) #use Eigen (no additional deps required - but suitesparse should be faster!)
+  vad_add_var(MINIGLOG ON CACHE BOOL "" FORCE) #use miniglog
+  vad_add_var(EIGENSPARSE ON CACHE BOOL "" FORCE)
+  vad_add_var(BUILD_TESTING OFF CACHE BOOL "" FORCE)

   # TODO default seems to point to checkout out dir in source?!?
   add_subdirectory("${VAD_EXTERNAL_ROOT}/Ceres" "${CMAKE_BINARY_DIR}/external/Ceres")
@@ -70,8 +70,8 @@
   set_property(TARGET ceres APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${VAD_EXTERNAL_ROOT}/Ceres/include;${VAD_EXTERNAL_ROOT}/Ceres/config;${VAD_EXTERNAL_ROOT}/Ceres/internal/ceres/miniglog")
   target_link_libraries(ceres INTERFACE Eigen3::Eigen)

-  set(CERES_INCLUDE_DIRS "${CERES_INCLUDE_DIRS};${VAD_EXTERNAL_ROOT}/Ceres/include;${VAD_EXTERNAL_ROOT}/Ceres/config;${VAD_EXTERNAL_ROOT}/Ceres/internal/ceres/miniglog;${EIGEN_INCLUDE_DIRS}" CACHE STRING "" FORCE)
-  set(CERES_LIBRARIES ceres CACHE STRING "" FORCE)
-  set(CERES_FOUND TRUE CACHE BOOL "" FORCE)
+  vad_add_var(CERES_INCLUDE_DIRS "${VAD_EXTERNAL_ROOT}/Ceres/include;${VAD_EXTERNAL_ROOT}/Ceres/config;${VAD_EXTERNAL_ROOT}/Ceres/internal/ceres/miniglog;${EIGEN_INCLUDE_DIRS}" CACHE STRING "" FORCE)
+  vad_add_var(CERES_LIBRARIES ceres CACHE STRING "" FORCE)
+  vad_add_var(CERES_FOUND TRUE CACHE BOOL "" FORCE)

 endfunction()


open-183: improve local build number generation to account for multiple heads

--- indra/cmake/BuildVersion.cmake
+++ indra/cmake/BuildVersion.cmake
@@ -16,22 +16,26 @@

         else (DEFINED ENV{revision})
            find_program(MERCURIAL hg)
-           if (DEFINED MERCURIAL)
+           find_program(WORDCOUNT wc)
+           find_program(SED sed)
+           if (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
               execute_process(
-                 COMMAND ${MERCURIAL} log -r tip --template "{rev}"
+                 COMMAND ${MERCURIAL} log -r tip:0 --template '\\n'
+                 COMMAND ${WORDCOUNT} -l
+                 COMMAND ${SED} "s/ //g"
                  OUTPUT_VARIABLE VIEWER_VERSION_REVISION
                  OUTPUT_STRIP_TRAILING_WHITESPACE
                  )
               if ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
                  message("Revision (from hg) ${VIEWER_VERSION_REVISION}")
               else ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
+                 message("Revision not set (repository not found?); using 0")
                  set(VIEWER_VERSION_REVISION 0 )
-                 message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}")
               endif ("${VIEWER_VERSION_REVISION}" MATCHES "^[0-9]+$")
-           else (DEFINED MERCURIAL)
+           else (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
+              message("Revision not set: 'hg', 'wc' or 'sed' not found; using 0")
               set(VIEWER_VERSION_REVISION 0)
-              message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}")
-           endif (DEFINED MERCURIAL)
+           endif (DEFINED MERCURIAL AND DEFINED WORDCOUNT AND DEFINED SED)
         endif (DEFINED ENV{revision})
         message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}")
     else ( EXISTS ${VIEWER_VERSION_BASE_FILE} )


convert serial tests to one process mpi tests

--- test/testing.cmake
+++ test/testing.cmake
@@ -7,21 +7,21 @@
     COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} ${PROCS} ${VALGRIND} ${VALGRIND_ARGS} ${EXE} ${ARGN}
   )
 endfunction(mpi_test)
-add_test(shapefun shapefun)
-add_test(shapefun2 shapefun2)
-add_test(bezierElevation bezierElevation)
-add_test(bezierMesh bezierMesh)
-add_test(bezierMisc bezierMisc)
-add_test(bezierRefine bezierRefine)
-add_test(bezierSubdivision bezierSubdivision)
-add_test(bezierValidity bezierValidity)
+mpi_test(shapefun 1 shapefun)
+mpi_test(shapefun2 1 shapefun2)
+mpi_test(bezierElevation 1 bezierElevation)
+mpi_test(bezierMesh 1 bezierMesh)
+mpi_test(bezierMisc 1 bezierMisc)
+mpi_test(bezierRefine 1 bezierRefine)
+mpi_test(bezierSubdivision 1 bezierSubdivision)
+mpi_test(bezierValidity 1 bezierValidity)

-add_test(align align)
-add_test(eigen_test eigen_test)
-add_test(integrate integrate)
-add_test(qr_test qr)
-add_test(base64 base64)
-add_test(tensor_test tensor)
+mpi_test(align 1 align)
+mpi_test(eigen_test 1 eigen_test)
+mpi_test(integrate 1 integrate)
+mpi_test(qr_test 1 qr)
+mpi_test(base64 1 base64)
+mpi_test(tensor_test 1 tensor)

 if(ENABLE_SIMMETRIX)
   set(GXT smd)


Windows build fixes for the ASTC 3rd party library.

--- third_party/astc-encoder.cmake
+++ third_party/astc-encoder.cmake
@@ -29,6 +29,13 @@
 if(NOT DISABLED_CXX)
     add_library(astc-encoder ${sources})

-    target_compile_options(astc-encoder PRIVATE "-Wno-c++11-narrowing")
+    if(WIN32)
+        target_compile_options(astc-encoder PRIVATE "-Wno-narrowing"
+            "-D__NO_INLINE__"                     # Avoids a lvalue compile error
+            "-D_GLIBCXX_INCLUDE_NEXT_C_HEADERS"   # Avoids redefinition compile error
+        )
+    else()
+        target_compile_options(astc-encoder PRIVATE "-Wno-c++11-narrowing")
+    endif()
     target_include_directories(astc-encoder PUBLIC "${astc-encoder_gen}")
 endif()


fix to make build run on mac

fix to make build run on mac

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -208,7 +208,7 @@
     set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
   endif (NOT GCC_DISABLE_FATAL_WARNINGS)

-  set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
+  set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor")

   set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
   set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")


Fix LTO script warning for policy CMP0054

--- cmake/LTO.cmake
+++ cmake/LTO.cmake
@@ -52,7 +52,7 @@
 # SOFTWARE.

-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.1)

 option(ENABLE_LTO "enable link time optimization" ON)

@@ -61,7 +61,8 @@

       #LTO support was added for clang/gcc in 3.9
       if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_LESS 3.9)
-          message(STATUS "Checking for LTO Compatibility")
+          cmake_policy(SET CMP0054 NEW)
+		  message(STATUS "Checking for LTO Compatibility")
           # Since GCC 4.9 we need to use gcc-ar / gcc-ranlib / gcc-nm
           if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
               if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_GCC_AR OR NOT CMAKE_GCC_RANLIB OR NOT CMAKE_GCC_NM)


added option to override catkin devel space

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

 # define buildspace
-set(CATKIN_BUILD_PREFIX "${CMAKE_BINARY_DIR}/buildspace")
+if(CATKIN_DEVEL_SPACE)
+  set(CATKIN_DEVEL_SPACE ${CATKIN_DEVEL_SPACE} CACHE PATH "catkin devel space")
+else()
+  set(CATKIN_DEVEL_SPACE "${CMAKE_BINARY_DIR}/develspace")
+endif()
+message(STATUS "Using CATKIN_DEVEL_SPACE: ${CATKIN_DEVEL_SPACE}")
+set(CATKIN_BUILD_PREFIX "${CATKIN_DEVEL_SPACE}")

 # create workspace marker
 set(_sourcespaces "${CMAKE_SOURCE_DIR}")


enabling boost variadics

enabling boost variadics

--- cmake/lib.cmake
+++ cmake/lib.cmake
@@ -1,9 +1,13 @@
 find_package(EthRPC REQUIRED)
+find_package(JsonCPP REQUIRED)
+find_package(CryptoPP REQUIRED)

+add_definitions(-D__ABI_ENABLED__)
+add_definitions(-DBOOST_PP_VARIADICS)

 include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CopyHeaders.cmake)

-include_directories(${ETHRPC_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
+include_directories(${JSONCPP_INCLUDE_DIR} ${CRYPTOPP_INCLUDE_DIR} ${ETHRPC_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
 file(GLOB_RECURSE SOURCES "src/*.cpp")


Remove -mt_mpi (reverts ce1ff66d) -- is only valid for compiler _wrapper_

--- cmake/mpi.cmake
+++ cmake/mpi.cmake
@@ -56,22 +56,9 @@
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}")
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_CXX_LINK_FLAGS}")

-    IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
-      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mt_mpi")
-      SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mt_mpi")
-    ENDIF()
-
     INCLUDE_DIRECTORIES(SYSTEM ${MPI_CXX_INCLUDE_PATH})

-    IF (THIS_IS_MIC)
-      SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmic")
-    ENDIF()
-
   ENDMACRO()
-
-  IF (THIS_IS_MIC)
-    INCLUDE(${PROJECT_SOURCE_DIR}/cmake/icc_xeonphi.cmake)
-  ENDIF()

 ELSE()
   MACRO(CONFIGURE_MPI)


[Phi] Fix kps compile failed (#41129)

[Phi] Fix kps compile failed (#41129)

* fix kps compile failed

* remove useless cond

* add xpu for xpu_kp

--- cmake/phi.cmake
+++ cmake/phi.cmake
@@ -126,7 +126,7 @@
         if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.cc)
             list(APPEND common_srcs ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.cc)
         endif()
-        if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc AND NOT WITH_XPU_KP)
+        if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc)
             list(APPEND cpu_srcs ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc)
         endif()
         if (WITH_GPU OR WITH_ROCM)
@@ -149,11 +149,13 @@
             endif()
         endif()
         if (WITH_XPU_KP)
-            # Change XPU2 file suffix
-            # NOTE(chenweihang): If we can be sure that the *.kps suffix is no longer used, it can be copied directly to *.xpu
-            file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/kps)
-            file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.cu ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
-            list(APPEND kps_srcs ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
+            if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu)
+                # Change XPU2 file suffix
+                # NOTE(chenweihang): If we can be sure that the *.kps suffix is no longer used, it can be copied directly to *.xpu
+                file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/kps)
+                file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.cu ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
+                list(APPEND kps_srcs ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
+            endif()
         endif()
     else()
         # TODO(chenweihang): impl compile by source later
@@ -260,7 +262,7 @@
                 hip_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
             endif()
         elseif (WITH_XPU_KP)
-            xpu_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${kps_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            xpu_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${kps_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
         else()
             cc_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
         endif()
@@ -272,7 +274,7 @@
             hip_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
             hip_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${TARGET}_base${target_suffix} ${dnn_kernels})
         elseif (WITH_XPU_KP)
-            xpu_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${kps_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            xpu_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${kps_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
             xpu_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${TARGET}_base${target_suffix})
         else()
             cc_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})


Set CMake Policy version up to 3.20

Set CMake Policy version up to 3.20

--- CMake/sitkCMakeInit.cmake
+++ CMake/sitkCMakeInit.cmake
@@ -1,6 +1,2 @@
 set(SITK_CMAKE_MINIMUM_REQUIRED_VERSION "3.16.3")
-set(SITK_CMAKE_POLICY_VERSION "3.16.3")
-
-if("${CMAKE_VERSION}" VERSION_LESS_EQUAL "${SITK_CMAKE_POLICY_VERSION}")
-  set(SITK_CMAKE_POLICY_VERSION "${CMAKE_VERSION}")
-endif()
+set(SITK_CMAKE_POLICY_VERSION "${SITK_CMAKE_MINIMUM_REQUIRED_VERSION}...3.20")


ffmpeg/3.4: update FFmpeg wrapper

ffmpeg/3.4: update FFmpeg wrapper

- FFmpeg 3.4.7

--- 3rdparty/ffmpeg/ffmpeg.cmake
+++ 3rdparty/ffmpeg/ffmpeg.cmake
@@ -1,8 +1,8 @@
-# Binaries branch name: ffmpeg/3.4_20200310
-# Binaries were created for OpenCV: 4966186e10e2a940514d8c20447ca4a828af5f46
-ocv_update(FFMPEG_BINARIES_COMMIT "e81ccda615672833b578c6cefdb859ad69c560ba")
-ocv_update(FFMPEG_FILE_HASH_BIN32 "301ae2000e25f800ab8e0065f277ad28")
-ocv_update(FFMPEG_FILE_HASH_BIN64 "d87ce032289c3f811d02f0c3d8dbe366")
+# Binaries branch name: ffmpeg/3.4_20200608
+# Binaries were created for OpenCV: 458f1d5ebe31e22789d9d781d0ca2ca936758fde
+ocv_update(FFMPEG_BINARIES_COMMIT "57064cd66d98994503b34aade3c8d8ff25007b46")
+ocv_update(FFMPEG_FILE_HASH_BIN32 "6fff20f5617bd1b7362058790db52caa")
+ocv_update(FFMPEG_FILE_HASH_BIN64 "15df55131471191b575668a424dff385")
 ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")

 function(download_win_ffmpeg script_var)


Changed version number to 0.7.0

Changed version number to 0.7.0

--- cmake/Config.cmake
+++ cmake/Config.cmake
@@ -1,7 +1,7 @@

 # setup version numbers
 set(VERSION_MAJOR 0)
-set(VERSION_MINOR 6)
+set(VERSION_MINOR 7)
 set(VERSION_PATCH 0)
 set(VERSION_STR "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
 message("Project version: ${VERSION_STR}")


cmake: fix setting QBS_APP_INSTALL_DIR variable

It should be set before used

Change-Id: I133c7791f9efbb1f76e898109503e120b5adf18e
Reviewed-by: Eike Ziller <c142da16c73a95a82d35191bcc55b22835617128@qt.io>

--- cmake/QbsAPI.cmake
+++ cmake/QbsAPI.cmake
@@ -1,3 +1,4 @@
+set(QBS_APP_INSTALL_DIR "bin" CACHE STRING "Relative install location for Qbs binaries.")
 # default paths
 set(QBS_LIBDIR_NAME "lib")
 if(WIN32)
@@ -10,7 +11,6 @@

 # path options
 set(QBS_OUTPUT_PREFIX "" CACHE STRING "Qbs build output location relative to CMAKE_BINARY_DIR.")
-set(QBS_APP_INSTALL_DIR "bin" CACHE STRING "Relative install location for Qbs binaries.")
 set(QBS_LIB_INSTALL_DIR "${_DEFAULT_LIB_INSTALL_DIR}" CACHE STRING "Relative install location for Qbs libraries.")
 set(QBS_DLL_INSTALL_DIR "${QBS_LIB_INSTALL_DIR}" CACHE STRING "Relative install location for Qbs DLLs.")
 set(QBS_LIBEXEC_INSTALL_DIR "${_DEFAULT_LIBEXEC_INSTALL_DIR}" CACHE STRING "Relative install location for Qbs libexec.")


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -124,9 +124,15 @@

   if(CLANG_TIDY_AVAILABLE)
     if(NOT "${_TARGET}" STREQUAL "cellml")
-        set(_NO_BUGPRONE_EXCEPTION_ESCAPE -bugprone-exception-escape)
-        set(_NO_CPPCOREGUIDELINES_PRO_TYPE_VARARG -cppcoreguidelines-pro-type-vararg)
-        set(_NO_HICPP_VARARG -hicpp-vararg)
+        set(_DISABLED_BUGPRONE_CHECKS
+          -bugprone-exception-escape
+        )
+        set(_DISABLED_CPPCOREGUIDELINES_CHECKS
+          -cppcoreguidelines-pro-type-vararg
+        )
+        set(_DISABLED_HICPP_CHECKS
+          -hicpp-vararg
+        )
     endif()

     # The full list of Clang-Tidy checks can be found at
@@ -135,7 +141,7 @@
       -*
       bugprone-*
       -bugprone-branch-clone
-      ${_NO_BUGPRONE_EXCEPTION_ESCAPE}
+      ${_DISABLED_BUGPRONE_CHECKS}
       cert-*
       -cert-err58-cpp
       cppcoreguidelines-*
@@ -143,9 +149,9 @@
       -cppcoreguidelines-init-variables
       -cppcoreguidelines-owning-memory
       -cppcoreguidelines-pro-type-reinterpret-cast
-      ${_NO_CPPCOREGUIDELINES_PRO_TYPE_VARARG}
       -cppcoreguidelines-slicing
       -cppcoreguidelines-special-member-functions
+      ${_DISABLED_CPPCOREGUIDELINES_CHECKS}
       fuchsia-*
       -fuchsia-default-arguments
       -fuchsia-default-arguments-calls
@@ -158,7 +164,7 @@
       -google-runtime-references
       hicpp-*
       -hicpp-special-member-functions
-      ${_NO_HICPP_VARARG}
+      ${_DISABLED_HICPP_CHECKS}
       llvm-*
       -llvm-qualified-auto
       -llvm-header-guard


Revert "Fix luajit build issues on OSX + refactoring"

This reverts commit 615f09855c7c9533224e6b3c394f9c794b01077c.

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -129,50 +129,27 @@
 message (STATUS "Use LuaJIT library: ${LUAJIT_LIB}")

 macro(luajit_build)
-    # Cmake rules concerning strings and lists of strings are weird.
-    #   set (foo "1 2 3") defines a string, while
-    #   set (foo 1 2 3) defines a list.
-    # Use separate_arguments() to turn a string into a list (splits at ws).
-    # It appears that variable expansion rules are context-dependent.
-    # With the current arrangement add_custom_command()
-    # does the right thing. We can even handle pathnames with
-    # spaces though a path with an embeded semicolon or a quotation mark
-    # will most certainly wreak havok.
-    #
-    # This stuff is extremely fragile, proceed with caution.
-    set (luajit_cflags ${CMAKE_C_FLAGS})
-        separate_arguments(luajit_cflags)
-    set (luajut_ldflags ${CMAKE_STATIC_LINKER_FLAGS})
-        separate_arguments(luajit_ldflags)
-    # Use external unwind on all platforms.
-    set (luajit_xcflags "-DLUAJIT_UNWIND_EXTERNAL=1")
-    # We are consciously ommiting debug info in RelWithDebugInfo mode
+    set (luajit_buildoptions BUILDMODE=static)
+    set (luajit_copt "")
+    set (luajit_xcflags "")
     if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
-        set (luajit_ccopt -O0)
-        if (CC_HAS_GGDB)
-            set (luajit_ccdebug -g -ggdb)
-        else ()
-            set (luajit_ccdebug -g)
-        endif ()
+        set (luajit_buildoptions ${luajit_buildoptions} CCDEBUG=${CC_DEBUG_OPT})
+        set (luajit_copt ${luajit_copt} -O1)
         set (luajit_xcflags ${luajit_xcflags}
             -DLUA_USE_APICHECK -DLUA_USE_ASSERT)
     else ()
-        set (luajit_cсopt -O2)
-        set (luajit_ccdbebug "")
-    endif()
-    # Pass sysroot settings on OSX
-    if (NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
-        set (luajit_cflags ${luajit_cflags} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT})
-        set (luajit_ldflags ${luajit_ldlags} ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT})
+        set (luajit_copt ${luajit_copt} -O2)
     endif()
     if (ENABLE_VALGRIND)
         set (luajit_xcflags ${luajit_xcflags}
             -DLUAJIT_USE_VALGRIND -DLUAJIT_USE_SYSMALLOC)
     endif()
-    set (luajit_target_cc ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
+    set (luajit_target_cc "${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_FLAGS}")
+    # Use external unwind on all platforms.
+    set (luajit_target_cc "${luajit_target_cc} -DLUAJIT_UNWIND_EXTERNAL=1")
     if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
         # Regular mode - use CMake compiler for building host utils.
-        set (luajit_host_cc ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1})
+        set (luajit_host_cc ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} ${CMAKE_C_FLAGS})
     else()
         # Crosscompile mode - use a host CC compiler for building host utils.
         # Since CMake does not support cross compilation properly
@@ -184,16 +161,20 @@
         # The host compiler must have same pointer size as the target compiler.
         set (luajit_host_cc "${luajit_host_cc} -m32")
     endif()
-    set (luajit_buildoptions
-        BUILDMODE=static
+    set(luajit_ldflags "${CMAKE_SHARED_LINKER_FLAGS}")
+    separate_arguments(luajit_copt)
+    separate_arguments(luajit_ldflags)
+    separate_arguments(luajit_host_cc)
+    separate_arguments(luajit_target_cc)
+    set (luajit_buildoptions ${luajit_buildoptions}
+        CFLAGS=""
+        CXXFLAGS=""
+        XCFLAGS="${luajit_xcflags}"
         CC="${luajit_host_cc}"
-        CFLAGS="${luajit_cflags}"
-        LDFLAGS="${luajit_ldflags}"
-        CCOPT="${luajit_ccopt}"
-        CCDEBUG="${luajit_ccdebug}"
-        XCFLAGS="${luajit_xcflags}"
+        HOST_CC="${luajit_host_cc}"
         TARGET_CC="${luajit_target_cc}"
-        Q='')
+        CCOPT="${luajit_copt}")
+    set (luajit_buildoptions ${luajit_buildoptions} Q='' LDFLAGS="${luajit_ldflags}")
     if (${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
         add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/third_party/luajit/src/libluajit.a
             WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/third_party/luajit


python: Fix venv management

python: Fix venv management

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -47,6 +47,22 @@
       COMMAND ${Python_EXECUTABLE} -m pip install --user ${MODULE_NAME}
       OUTPUT_STRIP_TRAILING_WHITESPACE
       )
+  endif()
+endfunction()
+
+# Find if python builtin module MODULE_NAME is available.
+function(search_python_internal_module MODULE_NAME)
+  execute_process(
+    COMMAND ${Python_EXECUTABLE} -c "import ${MODULE_NAME}"
+    RESULT_VARIABLE _RESULT
+    OUTPUT_VARIABLE MODULE_VERSION
+    ERROR_QUIET
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  if(${_RESULT} STREQUAL "0")
+    message(STATUS "Found python internal module: ${MODULE_NAME}")
+  else()
+    message(FATAL_ERROR "Can't find python internal module \"${MODULE_NAME}\", please install it using your system package manger")
   endif()
 endfunction()

@@ -176,7 +192,7 @@
 if(BUILD_TESTING)
   # Look for python module venv
   search_python_module(absl-py)
-  search_python_module(venv)
+  search_python_internal_module(venv)
   # Testing using a vitual environment
   set(VENV_EXECUTABLE ${Python_EXECUTABLE} -m venv)
   set(VENV_DIR ${PROJECT_BINARY_DIR}/python/venv)


Remove unused SURGIMSIM_YAMLCPP_BUILD cmake option

Since yaml has been moved out of the repository, this option isn't used
anymore.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -74,7 +74,6 @@
 	"Build a single binary with all unit tests.  [Does not work yet!]" OFF)
 mark_as_advanced(SURGSIM_TESTS_ALL_IN_ONE)  # hide it as long as it's broken
 option(SURGSIM_EXAMPLES_BUILD "Include the examples in the build" ON)
-option(SURGSIM_YAMLCPP_BUILD "Include Yaml cpp in the build" ON)

 set(SURGSIM_COPY_WARNING_ONCE TRUE)
 set(SURGSIM_TEST_RUN_PREFIX)


FindEXPAT.cmake: use pkg-config too

FindEXPAT.cmake: use pkg-config too

--- CMakeModules/FindEXPAT.cmake
+++ CMakeModules/FindEXPAT.cmake
@@ -7,6 +7,7 @@

 #=============================================================================
 # Copyright 2006-2009 Kitware, Inc.
+# Copyright 2014 The VOTCA Development Team (http://www.votca.org)
 #
 # Distributed under the OSI-approved BSD License (the "License");
 # see accompanying file Copyright.txt for details.
@@ -18,11 +19,15 @@
 # (To distributed this file outside of CMake, substitute the full
 #  License text for the above reference.)

+find_package(PkgConfig)
+
+pkg_check_modules(PC_EXPAT expat)
+
 # Look for the header file.
-FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
+FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS} )

 # Look for the library.
-FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
+FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat HINTS ${PC_EXPAT_LIBRARY_DIRS} )

 # handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
 # all listed variables are TRUE


Add libm to the lib of required libraries when doing system checks

--- configure.cmake
+++ configure.cmake
@@ -283,7 +283,7 @@
   FIND_PACKAGE(Threads)

   SET(CMAKE_REQUIRED_LIBRARIES
-    ${LIBNLS} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT})
+    ${LIBM} ${LIBNLS} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT})

   LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})


fix voyager find

fix voyager find


Removed special characters from variable

--- Core/Code/CppMicroServices/CMake/usCTestScript.cmake
+++ Core/Code/CppMicroServices/CMake/usCTestScript.cmake
@@ -43,14 +43,14 @@

 endmacro()

-function(create_initial_cache var _shared _threading _sf _c++11 _autoload)
+function(create_initial_cache var _shared _threading _sf _cxx11 _autoload)

   set(_initial_cache "
       US_BUILD_TESTING:BOOL=ON
       US_BUILD_SHARED_LIBS:BOOL=${_shared}
       US_ENABLE_THREADING_SUPPORT:BOOL=${_threading}
       US_ENABLE_SERVICE_FACTORY_SUPPORT:BOOL=${_sf}
-      US_USE_C++11:BOOL=${_c++11}
+      US_USE_C++11:BOOL=${_cxx11}
       US_ENABLE_AUTOLOADING_SUPPORT:BOOL=${_autoload}
       ")

@@ -68,7 +68,7 @@
   if(_sf)
     set(CTEST_DASHBOARD_NAME "${CTEST_DASHBOARD_NAME}-servicefactory")
   endif()
-  if(_c++11)
+  if(_cxx11)
     set(CTEST_DASHBOARD_NAME "${CTEST_DASHBOARD_NAME}-cxx11")
   endif()
   if(_autoload)


correct md5 hash for boost download

correct md5 hash for boost download

--- superbuild/External-Boost.cmake
+++ superbuild/External-Boost.cmake
@@ -11,7 +11,7 @@

 if( UNIX )
   set( Boost_url "http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz")
-  set( Boost_md5 08d29a2d85db3ebc8c6fdfa3a1f2b83c )
+  set( Boost_md5 51528a0e3b33d9e10aaa311d9eb451e3 )
   set( Boost_Bootstrap_Command ./bootstrap.sh )
   set( Boost_b2_Command ./b2 )
 else()


correcting P2VV library in FindDooFit.cmake

--- external/FindDooFit.cmake
+++ external/FindDooFit.cmake
@@ -8,7 +8,7 @@
   SET(DooFit_INCLUDES "${DooFit_BASE}/include")
   SET(DooFit_INCLUDE_DIR "${DooFit_BASE}/include")
   SET(DooFit_LIBRARY_DIR "${DooFit_BASE}/lib")
-  SET(DooFit_LIBRARIES "-ldfdoroopdfs -ldfschillerroopdfs -ldfFitter -lToy -lBuilder -lPdf2WsStd -lPlotting -lConfig")
+  SET(DooFit_LIBRARIES "-ldfdoroopdfs -ldfschillerroopdfs -ldfFitter -lToy -lBuilder -lPdf2WsStd -lPlotting -lConfig -ldfp2vvpdfs")
   #SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${DooFit_LIBRARY_DIR})
   MESSAGE(STATUS "Looking for DooFit... - found at ${DooFit_BASE}")
 ENDIF(IS_DIRECTORY $ENV{DOOFITSYS})


ENH: Eternia BOOST_ROOT, KWStyle, and CPPCheck

--- Eternia_Kitware_TubeTK.cmake
+++ Eternia_Kitware_TubeTK.cmake
@@ -37,6 +37,7 @@
   "/home/aylward/src/dashboards/TubeTK-${SITE_BUILD_TYPE}" )

 set( TubeTK_USE_BOOST ON )
+set( BOOST_ROOT "/home/aylward/src/boost_1_54_0" )
 set( TubeTK_USE_CTK ON )
 set( TubeTK_USE_IMAGE_VIEWER OFF )
 set( TubeTK_USE_LIBSVM ON )
@@ -85,17 +86,17 @@

 set( SITE_CONTINUOUS_BUILD ON )
 set( SITE_CONTINUOUS_TEST ON )
-set( SITE_CONTINUOUS_CPPCHECK OFF )
-set( SITE_CONTINUOUS_KWSTYLE OFF )
+set( SITE_CONTINUOUS_CPPCHECK ON )
+set( SITE_CONTINUOUS_KWSTYLE ON )
 set( SITE_CONTINUOUS_COVERAGE OFF )
 set( SITE_CONTINUOUS_MEMORY OFF )
-set( SITE_CONTINUOUS_PACKAGE ON )
-set( SITE_CONTINUOUS_UPLOAD ON )
+set( SITE_CONTINUOUS_PACKAGE OFF )
+set( SITE_CONTINUOUS_UPLOAD OFF )

 set( SITE_NIGHTLY_BUILD ON )
 set( SITE_NIGHTLY_TEST ON )
-set( SITE_NIGHTLY_CPPCHECK OFF )
-set( SITE_NIGHTLY_KWSTYLE OFF )
+set( SITE_NIGHTLY_CPPCHECK ON )
+set( SITE_NIGHTLY_KWSTYLE ON )
 set( SITE_NIGHTLY_COVERAGE ON )
 set( SITE_NIGHTLY_MEMORY ON )
 set( SITE_NIGHTLY_PACKAGE ON )


Fix issue with path to conanfile.txt

Fix issue with path to conanfile.txt

Former-commit-id: ce38910e7690f1e20b66e2e5e68b7c3ba84ce5b4

--- cmake/SetupDependenciesConan.cmake
+++ cmake/SetupDependenciesConan.cmake
@@ -42,6 +42,7 @@
     find_file(CONANFILE
             conanfile.txt
             HINTS ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_LIST_DIR}
+            REQUIRED
             NO_DEFAULT_PATH)

     if(CONAN_BUILD_INFO AND CONANFILE AND ${CONAN_BUILD_INFO} IS_NEWER_THAN ${CONANFILE})
@@ -93,13 +94,16 @@
         else()
             list(APPEND DMRG_CONAN_OPTIONS OPTIONS "*:shared=False")
         endif()
+        if(CMAKE_BUILD_TYPE MATCHES "Debug")
+            list(APPEND DMRG_CONAN_OPTIONS OPTIONS "ceres-solver:use_glog=False")
+        endif()

         include(${CMAKE_BINARY_DIR}/conan.cmake)
         conan_add_remote(NAME conan-dmrg URL http://thinkstation.duckdns.org:8081/artifactory/api/conan/conan-dmrg)

         conan_cmake_run(
-                CONANFILE ${CONANFILE}
+                CONANFILE conanfile.txt
                 CONAN_COMMAND ${CONAN_COMMAND}
                 BUILD_TYPE ${CMAKE_BUILD_TYPE}
                 BASIC_SETUP CMAKE_TARGETS


Update SHA1

Update SHA1

--- cmake/projects/cereal/hunter.cmake
+++ cmake/projects/cereal/hunter.cmake
@@ -20,7 +20,7 @@
     URL
     "https://github.com/headupinclouds/cereal/archive/v1.2.1.tar.gz"
     SHA1
-    8d8179d71a12bafae3d90b6a5a7fc09cb2e69474
+    3b1188758515ed645e9ca073f7077828bdffa41d
 )

 # List of versions here...


gflags: Add REGISTER_INSTALL_PREFIX=OFF by default

--- cmake/projects/gflags/hunter.cmake
+++ cmake/projects/gflags/hunter.cmake
@@ -5,6 +5,7 @@

 include(hunter_add_version)
 include(hunter_cacheable)
+include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)

@@ -41,6 +42,12 @@
     b1c82261c8b9c87fb2fb5de6bdf70121ad1cca58
 )

+hunter_cmake_args(
+    gflags
+    CMAKE_ARGS
+    REGISTER_INSTALL_PREFIX=OFF
+)
+
 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(gflags)
 hunter_download(PACKAGE_NAME gflags)


Clang 5.0 (current trunk) got the SPIR CC patch committed in,
no reason to check for the patch anymore with Clang versions 5.0+.

Fixes #1.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -709,27 +709,33 @@
   endif()
 endif()

-######################################################################################
-# Test for presence of Clang calling convention patch from
-# https://github.com/pocl/pocl/issues/1
-
-execute_process(
-  COMMAND
+if(LLVM_OLDER_THAN_5_0)
+
+  ######################################################################################
+  # Test for presence of Clang calling convention patch from
+  # https://github.com/pocl/pocl/issues/1
+
+  execute_process(
+    COMMAND
     "${CLANG}" "-S" "-xcl" "-emit-llvm" "${CMAKE_SOURCE_DIR}/cmake/spir-cc-test-kernel.cl" "-o" "-"
     OUTPUT_VARIABLE SPIR_PATCH_TEST_IR
     ERROR_VARIABLE _DUMMY
     RESULT_VARIABLE SPIR_CC_RES)

-if(SPIR_CC_RES)
-  message(FATAL_ERROR "Clang exited with non-zero status when trying to compile calling convention test")
-endif()
-
-string(FIND "${SPIR_PATCH_TEST_IR}" "spir_kernel" SPIR_CC_RES)
-if("${SPIR_CC_RES}" MATCHES "-1")
-  set(CLANG_IS_PATCHED_FOR_SPIR_CC 0)
-  message(STATUS "Clang is NOT patched for SPIR CC")
+  if(SPIR_CC_RES)
+    message(FATAL_ERROR "Clang exited with non-zero status when trying to compile calling convention test")
+  endif()
+
+  string(FIND "${SPIR_PATCH_TEST_IR}" "spir_kernel" SPIR_CC_RES)
+  if("${SPIR_CC_RES}" MATCHES "-1")
+    set(CLANG_IS_PATCHED_FOR_SPIR_CC 0)
+    message(STATUS "Clang is NOT patched for SPIR CC")
+  else()
+    set(CLANG_IS_PATCHED_FOR_SPIR_CC 1)
+    set(POCL_KCACHE_SALT "${POCL_KCACHE_SALT}-spirccpatch")
+    message(STATUS "Clang IS patched for SPIR CC")
+  endif()
 else()
   set(CLANG_IS_PATCHED_FOR_SPIR_CC 1)
-  set(POCL_KCACHE_SALT "${POCL_KCACHE_SALT}-spirccpatch")
-  message(STATUS "Clang IS patched for SPIR CC")
-endif()
+  message(STATUS "Clang 5.0+ use SPIR CC by default")
+endif()


mpi fixes

mpi fixes

--- cmake/mpi.cmake
+++ cmake/mpi.cmake
@@ -27,10 +27,10 @@
 	DOC "MPI library.")
       SET(MPI_LIBRARIES ${MPI_LIBRARY})
     endif()
-    if (${MPI_COMPILER} STREQUAL "MPI_COMPILER-NOTFOUND")
-      message("could not find mpi compiler")
-    endif()
     SET(OSPRAY_MPI_MULTI_THREADING_FLAG "") #???
+  endif()
+  if (${MPI_COMPILER} STREQUAL "MPI_COMPILER-NOTFOUND")
+    message("could not find mpi compiler")
   endif()
   mark_as_advanced(MPI_COMPILER)


Avoid linker errors with *WindowContext on mingw.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -78,6 +78,13 @@
     find_package(OpenGLES2 REQUIRED)
 endif()

+# On Windows, *WindowContext libraries need to have ${MAGNUM_LIBRARY} listed
+# in dependencies also after *WindowContext.lib static library name to avoid
+# linker errors
+if(WIN32)
+    set(_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY ${MAGNUM_LIBRARY})
+endif()
+
 # Additional components
 foreach(component ${Magnum_FIND_COMPONENTS})
     string(TOUPPER ${component} _COMPONENT)
@@ -96,7 +103,7 @@
         if(${component} STREQUAL GlutWindowContext)
             find_package(GLUT)
             if(GLUT_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_LIBRARIES})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${GLUT_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
@@ -106,7 +113,7 @@
         if(${component} STREQUAL Sdl2WindowContext)
             find_package(SDL2)
             if(SDL2_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${SDL2_LIBRARY} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
                 set(_MAGNUM_${_COMPONENT}_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
@@ -117,7 +124,7 @@
         if(${component} STREQUAL GlxWindowContext)
             find_package(X11)
             if(X11_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()
@@ -128,7 +135,7 @@
             find_package(EGL)
             find_package(X11)
             if(EGL_FOUND AND X11_FOUND)
-                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY} ${X11_LIBRARIES})
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${EGL_LIBRARY} ${X11_LIBRARIES} ${_WINDOWCONTEXT_MAGNUM_LIBRARY_DEPENDENCY})
             else()
                 unset(MAGNUM_${_COMPONENT}_LIBRARY)
             endif()


Also reinstall non-luarocks dependencies when luarocks is upgraded.

Since we're now wiping the lua vendor directory on luarocks upgrades,
also installs these other manual vendor dependencies.

--- build/cmake/core-lua-deps.cmake
+++ build/cmake/core-lua-deps.cmake
@@ -17,6 +17,7 @@
 # Other Lua app dependencies (non-luarocks)
 ExternalProject_Add(
   lua_resty_dns_cache
+  DEPENDS luarocks
   URL https://github.com/hamishforbes/lua-resty-dns-cache/archive/${LUA_RESTY_DNS_CACHE_VERSION}.tar.gz
   URL_HASH MD5=${LUA_RESTY_DNS_CACHE_HASH}
   CONFIGURE_COMMAND ""
@@ -26,6 +27,7 @@

 ExternalProject_Add(
   lua_resty_logger_socket
+  DEPENDS luarocks
   URL https://github.com/cloudflare/lua-resty-logger-socket/archive/${LUA_RESTY_LOGGER_SOCKET_VERSION}.tar.gz
   URL_HASH MD5=${LUA_RESTY_LOGGER_SOCKET_HASH}
   CONFIGURE_COMMAND ""
@@ -35,6 +37,7 @@

 ExternalProject_Add(
   lua_resty_shcache
+  DEPENDS luarocks
   URL https://github.com/cloudflare/lua-resty-shcache/archive/${LUA_RESTY_SHCACHE_VERSION}.tar.gz
   URL_HASH MD5=${LUA_RESTY_SHCACHE_HASH}
   CONFIGURE_COMMAND ""


Fixed a cmake compile problem because of the 2.8.8 fix.

--- configure.cmake
+++ configure.cmake
@@ -149,8 +149,9 @@
   SET(CMAKE_REQUIRED_LIBRARIES
     ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})

-  IF(NOT ${CMAKE_REQUIRED_LIBRARIES} MATCHES '')
-    LIST(REMOVE_DUPLICATES ${CMAKE_REQUIRED_LIBRARIES})
+  LIST(LENGTH CMAKE_REQUIRED_LIBRARIES required_libs_length)
+  IF(${required_libs_length} GREATER 0)
+    LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES)
   ENDIF()
   LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})


add LLVM_LIBDIRS to link directories

add LLVM_LIBDIRS to link directories

This seems to be the only way to get the zig build to link against llvm
libraries in a non-standard location.

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -66,7 +66,7 @@
 endif()

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

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LLVM DEFAULT_MSG LLVM_LIBRARIES LLVM_INCLUDE_DIRS)


Disable a Clang warning which conflicts with Qt's moc tool.

--- cmake/SetFlags.cmake
+++ cmake/SetFlags.cmake
@@ -23,6 +23,7 @@
 		set(F_WARN "${F_WARN} -Wno-exit-time-destructors")
 		set(F_WARN "${F_WARN} -Wno-c++98-compat-pedantic")
 		set(F_WARN "${F_WARN} -Wno-global-constructors")
+		set(F_WARN "${F_WARN} -Wno-undefined-reinterpret-cast")

 		set(F_DBG "${F_WARN} -std=c++1y -g -O0 -fno-omit-frame-pointer")
 		set(F_DBG "${F_DBG} -fsanitize=address -fsanitize=undefined")


with clang, try whether the compiler groks -stdlib=libc++

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -374,6 +374,8 @@
       # disable these warnings because clang shows them for function overloads that were discarded via SFINAE
       vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-local-type-template-args")
       vc_add_compiler_flag(Vc_DEFINITIONS "-Wno-unnamed-type-template-args")
+
+      AddCompilerFlag(-stdlib=libc++)
    endif()

    if(NOT Vc_COMPILER_IS_MSVC)


CMake 2.8.3 is required

CMake 2.8.3 is required

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -14,6 +14,8 @@
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 # See the License for more information.
 #=============================================================================
+
+cmake_minimum_required(VERSION 2.8.3)

 get_filename_component(_currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include ("${_currentDir}/UserWarning.cmake")


ignore compiler warning C4661 concerning manual template instantiation

--- cmake/appveyor.cmake
+++ cmake/appveyor.cmake
@@ -16,8 +16,9 @@
 # warning C4503: Decorated name length truncated
 # warning C4800: casting from point to bool performance warning
 # warning C4996: 'isatty': The POSIX name for this item is deprecated
+# warning C4661: no suitable definition provided for explicit template instantiation request
 # dll linkage warning from python, define HAVE_ROUND
-SET (WARNINGS_IGNORE " /wd4005 /wd4244 /wd4267 /wd4503 /wd4800 /wd4996 /DHAVE_ROUND")
+SET (WARNINGS_IGNORE " /wd4005 /wd4244 /wd4267 /wd4503 /wd4800 /wd4996 /wd4661 /DHAVE_ROUND")
 SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:strict /EHsc ${WARNINGS_IGNORE}")
 SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:strict ${WARNINGS_IGNORE}")


Add HAVE_CXXABI_H to config.h.cmake so it gets added properly to config.h

--- cmake/config.h.cmake
+++ cmake/config.h.cmake
@@ -24,3 +24,6 @@

 /* Define to 1 if you have the ucontext.h header */
 #cmakedefine HAVE_UCONTEXT_H 1
+
+/* Define to 1 if you have the cxxabi.h header */
+#cmakedefine HAVE_CXXABI_H 1


MDEV-9350 Fix jemalloc detection for FreeBSD

on FreeBSD 10 jemalloc is in libc, no separate libjemalloc is needed

--- cmake/jemalloc.cmake
+++ cmake/jemalloc.cmake
@@ -20,18 +20,22 @@
       SET(CMAKE_REQUIRED_LIBRARIES pthread dl m)
       SET(what bundled)
     ELSE()
-      SET(libname jemalloc)
+      SET(libname jemalloc c)
       SET(what system)
     ENDIF()

-    CHECK_LIBRARY_EXISTS(${libname} malloc_stats_print "" HAVE_JEMALLOC)
+    FOREACH(lib ${libname})
+      CHECK_LIBRARY_EXISTS(${lib} malloc_stats_print "" HAVE_JEMALLOC_IN_${lib})
+      IF (HAVE_JEMALLOC_IN_${lib})
+        SET(LIBJEMALLOC ${lib})
+        SET(MALLOC_LIBRARY "${what} jemalloc")
+        BREAK()
+      ENDIF()
+    ENDFOREACH()
     SET(CMAKE_REQUIRED_LIBRARIES)

-    IF (HAVE_JEMALLOC)
-      SET(LIBJEMALLOC ${libname})
-      SET(MALLOC_LIBRARY "${what} jemalloc")
-    ELSEIF (NOT WITH_JEMALLOC STREQUAL "auto")
-      MESSAGE(FATAL_ERROR "${libname} is not found")
+    IF (NOT LIBJEMALLOC AND NOT WITH_JEMALLOC STREQUAL "auto")
+      MESSAGE(FATAL_ERROR "jemalloc is not found")
     ENDIF()
   ENDIF()
 ENDMACRO()


Add arch data for cross-compiling to CORE2

for #2235

--- cmake/prebuild.cmake
+++ cmake/prebuild.cmake
@@ -106,7 +106,25 @@
   file(APPEND ${TARGET_CONF_TEMP}
     "#define ${TCORE}\n"
     "#define CHAR_CORENAME \"${TCORE}\"\n")
-  if ("${TCORE}" STREQUAL "ARMV7")
+  if ("${TCORE}" STREQUAL "CORE2")
+    file(APPEND ${TARGET_CONF_TEMP}
+      "#define L1_DATA_SIZE\t32768\n"
+      "#define L1_DATA_LINESIZE\t64\n"
+      "#define L2_SIZE\t1048576\n"
+      "#define L2_LINESIZE\t64\n"
+      "#define DTB_DEFAULT_ENTRIES\t256\n"
+      "#define DTB_SIZE\t4096\n"
+      "#define HAVE_CMOV\n"
+      "#define HAVE_MMX\n"
+      "#define HAVE_SSE\n"
+      "#define HAVE_SSE2\n"
+      "#define HAVE_SSE3\n"
+      "#define HAVE_SSSE3\n")
+      set(SGEMM_UNROLL_M 8)
+      set(SGEMM_UNROLL_N 4)
+      set(DGEMM_UNROLL_M 4)
+      set(DGEMM_UNROLL_N 4)
+  elseif ("${TCORE}" STREQUAL "ARMV7")
     file(APPEND ${TARGET_CONF_TEMP}
       "#define L1_DATA_SIZE\t65536\n"
       "#define L1_DATA_LINESIZE\t32\n"


Add EXCLUDE_FROM_ALL to the CMake macro mimosa_test

--- cmake/Tests.cmake
+++ cmake/Tests.cmake
@@ -1,7 +1,7 @@
 add_custom_target(check)

 macro(mimosa_test MODULE)
-  add_executable(tst-${MODULE} ${ARGN})
+  add_executable(tst-${MODULE} EXCLUDE_FROM_ALL ${ARGN})
   target_link_libraries(tst-${MODULE} gtest_main gtest mimosa)
   add_custom_target(run-tst-${MODULE} ./tst-${MODULE} DEPENDS tst-${MODULE})
   add_dependencies(check run-tst-${MODULE})


Remove print for cuda gencode

Remove print for cuda gencode

Change-Id: I79fd722623430c11363c819bbd3ef10099197dbb

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -78,7 +78,6 @@
     list(APPEND __arch_flags " -gencode arch=compute_${capability},code=sm_${capability}")
 endforeach()

-message(${__arch_flags})
 if (CUDA_VERSION VERSION_GREATER "7.0")
     list(APPEND __arch_flags " -gencode arch=compute_52,code=sm_52")
 endif()


Updated WSREP_PATCH_REVNO.

Updated WSREP_PATCH_REVNO.

--- cmake/wsrep.cmake
+++ cmake/wsrep.cmake
@@ -23,7 +23,7 @@
 # MariaDB addition: Revision number of the last revision merged from
 # codership branch visible in @@visible_comment.
 # Branch : codership-mysql/5.5
-SET(WSREP_PATCH_REVNO "3997")  # Should be updated on every merge.
+SET(WSREP_PATCH_REVNO "4013")  # Should be updated on every merge.

 # MariaDB: Obtain patch revision number:
 # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.


fixes #7

fixes #7

--- cmake/ucm.cmake
+++ cmake/ucm.cmake
@@ -440,7 +440,7 @@

 	# inform the developer that the current target might benefit from a unity build
 	if(NOT ARG_UNITY AND ${UCM_UNITY_BUILD})
-		cgr_count_sources(ARG_SOURCES num_sources)
+		ucm_count_sources(${ARG_SOURCES} RESULT num_sources)
 		if(${num_sources} GREATER 1)
 			message(AUTHOR_WARNING "Target '${ARG_NAME}' may benefit from a unity build.\nIt has ${num_sources} sources - enable with UNITY flag")
 		endif()


Refactoring

Refactoring

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1872,11 +1872,8 @@
       -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
       -DCMAKE_OSX_ARCHITECTURES=${ARCHS}
   INSTALL_COMMAND
-    ${CMAKE_COMMAND} -E make_directory <INSTALL_DIR>/include &&
-    ${CMAKE_COMMAND} -E make_directory <INSTALL_DIR>/lib &&
     cd <BINARY_DIR> &&
-    find . -name "*${CMAKE_SHARED_LIBRARY_SUFFIX}" | cpio -dp <INSTALL_DIR>/lib &&
-    find . -name "*${CMAKE_STATIC_LIBRARY_SUFFIX}" | cpio -dp <INSTALL_DIR>/lib &&
+    find . -name "*${LIBRARY_SUFFIX}" | cpio -dp <INSTALL_DIR>/lib &&
     cd <SOURCE_DIR>/include &&
     find . -name "*.h" | cpio -dp <INSTALL_DIR>/include)


shift VS2010 to last choice since not fully supported (i#401)

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


cmake fix linker variable reference

cmake fix linker variable reference

--- cmake/DetectOpenCV.cmake
+++ cmake/DetectOpenCV.cmake
@@ -40,8 +40,8 @@
         #message(STATUS "OpenCV_LIBDIR=${OpenCV_LIBDIR}")               # <XPREFIX>_LIBDIR...lib-dir of the module

         message(STATUS "Prepending linker flags with ${OpenCV_LDFLAGS}")
-        set(CMAKE_EXE_LINKER_FLAGS "${OpenCV_CFLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
-        set(CMAKE_MODULE_LINKER_FLAGS "${OpenCV_CFLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
+        set(CMAKE_EXE_LINKER_FLAGS "${OpenCV_LDFLAGS} ${CMAKE_EXE_LINKER_FLAGS}")
+        set(CMAKE_MODULE_LINKER_FLAGS "${OpenCV_LDFLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")

         list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})


Bug 914: fix compiler detection on windows (grafted from d0828c602f7a055cbe51459e936741b5ff8e414c)

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -359,22 +359,29 @@
       endif()
     else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
-    # supporting a "--version" flag
+    # supporting a "--version" or "/version" flag
+
+    if(WIN32 AND NOT CYGWIN)
+      set(EIGEN_CXX_FLAG_VERSION "/version")
+    else()
+      set(EIGEN_CXX_FLAG_VERSION "--version")
+    endif()

     # check whether the head command exists
     find_program(HEAD_EXE head NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH)
     if(HEAD_EXE)
-      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${EIGEN_CXX_FLAG_VERSION}
                       COMMAND head -n 1
                       OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
     else()
-      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER}  ${EIGEN_CXX_FLAG_VERSION}
                       OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
       string(REGEX REPLACE "[\n\r].*"  ""  eigen_cxx_compiler_version_string  ${eigen_cxx_compiler_version_string})
     endif()

     ei_get_compilerver_from_cxx_version_string("${eigen_cxx_compiler_version_string}" CNAME CVER)
     set(${VAR} "${CNAME}-${CVER}")
+
   endif()
 endmacro(ei_get_compilerver)


Added the /bigobj flag in order to enable compilation with MSVC when EIGEN_SPLIT_LARGE_TESTS is not set.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -27,6 +27,10 @@
   endif(EIGEN_NO_ASSERTION_CHECKING)

   ei_add_target_property(${targetname} COMPILE_FLAGS "-DEIGEN_TEST_FUNC=${testname}")
+
+  if(MSVC AND NOT EIGEN_SPLIT_LARGE_TESTS)
+    ei_add_target_property(${targetname} COMPILE_FLAGS "/bigobj")
+  endif()

   # let the user pass flags.
   if(${ARGC} GREATER 2)
@@ -51,7 +55,7 @@
       # notice: no double quotes around ${libs_to_link} here. It may be a list.
       target_link_libraries(${targetname} ${libs_to_link})
     endif()
-  endif()
+  endif()

   if(WIN32)
     if(CYGWIN)


fix ei_add_property

fix ei_add_property

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -1,7 +1,7 @@

 macro(ei_add_property prop value)
   get_property(previous GLOBAL PROPERTY ${prop})
-  if (NOT ${previous} OR ${previous} STREQUAL "")
+  if ((NOT previous) OR (previous STREQUAL ""))
     set_property(GLOBAL PROPERTY ${prop} "${value}")
   else()
     set_property(GLOBAL PROPERTY ${prop} "${previous} ${value}")


Added spi to f1 _ex sources

Added spi to f1 _ex sources

--- cmake/FindSTM32HAL.cmake
+++ cmake/FindSTM32HAL.cmake
@@ -18,7 +18,7 @@
     SET(HAL_REQUIRED_COMPONENTS cortex pwr rcc)

     # Components that have _ex sources
-    SET(HAL_EX_COMPONENTS adc dac flash gpio pcd rcc rtc tim)
+    SET(HAL_EX_COMPONENTS adc dac flash gpio pcd rcc rtc tim spi)

     SET(HAL_PREFIX stm32f1xx_)


git merge stable

git merge stable

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

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -9,6 +9,7 @@
 ##
 ##   ctest -S /path/to/ctest_script.cmake
 ##
+## It is recommended to make a copy of the file (especially using git).
 ## For extra information
 ##
 ##   ctest -S /path/to/ctest_script.cmake -V
@@ -16,7 +17,8 @@
 ## or even  -VV
 ##
 ## Set execution options in the Configuration part.
-## For multiple tests (eg. different compilers) copy this file and adjust options.
+## For multiple tests (eg. different compilers) make multiple copies
+## of this file and adjust options.
 ##
 ######################################################################

@@ -61,8 +63,8 @@
 set(CTEST_BINARY_DIRECTORY ${CTEST_SOURCE_DIRECTORY}/build_ctest)

 # Update type (eg. svn or git)
-set( UPDATE_TYPE svn)
-set( CTEST_UPDATE_COMMAND "svn") #"${CTEST_SOURCE_DIRECTORY}/cmake/svn_github.sh"
+set( UPDATE_TYPE git)
+set( CTEST_UPDATE_COMMAND "git") #"${CTEST_SOURCE_DIRECTORY}/cmake/svn_github.sh"

 # Timeouts
 set(CTEST_TEST_TIMEOUT 200 CACHE STRING
@@ -72,15 +74,15 @@

 # Build options
 set(gismo_build_options
-    #-DGISMO_BUILD_COVERAGE=ON
-    -DGISMO_PLAINDOX=ON # plain doxygen output for the trac Wiki
     -DGISMO_BUILD_LIB=ON
     -DGISMO_WITH_ONURBS=ON
-    -DGISMO_WITH_IPOPT=ON
-    -DIpOpt_DIR=/home/amantzaflaris/dashboards/IpOpt_inst
-    -DGISMO_WITH_PSOLID=ON
-    -DParasolid_DIR=/home/amantzaflaris/dropboxOUT/gforge/parasolid/26/1/153
-    #-DGISMO_BUILD_AXL=ON -DAxel_DIR=/home/amantzaflaris/build/axel
+    #-DGISMO_WITH_IPOPT=ON
+    #-DIpOpt_DIR=/path/to/ipopt
+    #-DGISMO_WITH_PSOLID=ON
+    #-DParasolid_DIR=/path/to/parasolid
+    #-DGISMO_BUILD_AXL=ON -DAxel_DIR=/path/to/axel
+    #-DGISMO_PLAINDOX=ON
+    #-DGISMO_BUILD_COVERAGE=ON
 )

 # Coverage analysis


Fix Gerrit cmake build of Zooshi.

Fix Gerrit cmake build of Zooshi.

Wasn't finding fplutil with the Gerrit directory structure.

Deprecated functions in Firebase were generating warnings, which in turn were being considered errors.
PiperOrigin-RevId: 148263810
Change-Id: Id97f381997fb41b05d0fb7f3c694ac592fa0cc5a

--- cmake/find_fplutil.cmake
+++ cmake/find_fplutil.cmake
@@ -21,6 +21,7 @@
     "${dependencies_fplutil_dir}"
     "${fpl_root}/fplutil"
     "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/fplutil"
+    "${CMAKE_CURRENT_LIST_DIR}/../../../libs/fplutil"
     "${CMAKE_CURRENT_LIST_DIR}/../../fplutil"
     "${CMAKE_CURRENT_LIST_DIR}/../../../fplutil"
     "${CMAKE_CURRENT_LIST_DIR}/../../../../fplutil"


Modified FindCUDA.cmake to mark CUDA include directories as system includes

git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@1979 fa922fa7-2fde-0310-acd8-f43f465a7996

--- src/CMake/cuda/FindCUDA.cmake
+++ src/CMake/cuda/FindCUDA.cmake
@@ -764,7 +764,7 @@
   endif()

   # Initialize our list of includes with the user ones followed by the CUDA system ones.
-  set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER} "-I${CUDA_INCLUDE_DIRS}")
+  set(CUDA_NVCC_INCLUDE_ARGS ${CUDA_NVCC_INCLUDE_ARGS_USER} "--system-include;${CUDA_INCLUDE_DIRS}")
   # Get the include directories for this directory and use them for our nvcc command.
   get_directory_property(CUDA_NVCC_INCLUDE_DIRECTORIES INCLUDE_DIRECTORIES)
   if(CUDA_NVCC_INCLUDE_DIRECTORIES)


Require CMake>=3.3 for generated models (#1387)

Fixes CMake deprecation warning

--- src/CMakeLists.template.cmake
+++ src/CMakeLists.template.cmake
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.3)

 if(POLICY CMP0060)
   cmake_policy(SET CMP0060 NEW)


fix license variable for rpm packages

fix license variable for rpm packages

--- packaging/Packaging.cmake
+++ packaging/Packaging.cmake
@@ -25,7 +25,7 @@
   )

 set(CPACK_PACKAGE_DESCRIPTION
-  "${CPACK_PACKAGE_NAME} is a medical image visualisation and processing tool developed at Inria by the teams Asclepios, Athena, Parietal and Visages."
+  "${CPACK_PACKAGE_NAME} is a medical image visualization and processing tool developed at Inria by the teams Asclepios, Athena, Parietal and Visages."
   )

 set(CPACK_PACKAGE_VENDOR  http://med.inria.fr/)


Fix libcxx path

Fix libcxx path

--- find/FindLibcxx.cmake
+++ find/FindLibcxx.cmake
@@ -28,7 +28,7 @@

 set(
     Libcxx_INCLUDE_DIRS
-    "${LIBCXX_ROOT}/${POLLY_INSTALL_PREFIX}/include/c++/v1"
+    "${LIBCXX_ROOT}/include/c++/v1"
 )

 set(_find_libcxx_save_find_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES})
@@ -40,7 +40,7 @@
   set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
 endif()

-set(_find_libcxx_install_path "${LIBCXX_ROOT}/${POLLY_INSTALL_PREFIX}/lib")
+set(_find_libcxx_install_path "${LIBCXX_ROOT}/lib")

 if(CMAKE_DEBUG_POSTFIX)
   set(_find_libcxx_debug_name c++${CMAKE_DEBUG_POSTFIX})


RUNTIME_OUTPUT_DIRECTORY

--- cmake/MyPackageExecutable.cmake
+++ cmake/MyPackageExecutable.cmake
@@ -27,6 +27,8 @@
     IF (MYPACKAGE_DEBUG)
       MESSAGE (STATUS "[${PROJECT_NAME}-EXECUTABLE-DEBUG] Set runtime output directory of ${_name} to ${LIBRARY_OUTPUT_PATH}")
     ENDIF ()
+    SET_TARGET_PROPERTIES (${_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH})
+
     IF (${_name} STREQUAL ${name})
       IF (TARGET ${PROJECT_NAME})
         IF (MYPACKAGE_DEBUG)


Fix in FindCLHEP so that it can work in OS X.

--- ndsim/build/FindCLHEP.cmake
+++ ndsim/build/FindCLHEP.cmake
@@ -20,7 +20,8 @@

 FIND_PATH(CLHEP_LIBRARY_DIR NAMES libG4clhep.so libG4clhep.dylib PATHS
                                                         	 $ENV{CLHEP}/lib64/
-								 $ENV{CLHEP_LIB_DIR}/
+                                                           $ENV{CLHEP}/lib/
+								                                           $ENV{CLHEP_LIB_DIR}/
                                                         	 NO_DEFAULT_PATH)

 # did not find libG4clhep.so - possibly using a build of CLHEP outside of G4 v10


cmake: Fix missing dependency

cmake: Fix missing dependency

KOBJ_OTYPE should depend on any changes to the tool that generates it,
gen_kobject_list.py.

Signed-off-by: Phil Erwin <0c2a6e12a3ee3123563f88831cd6d692c33fb195@lexmark.com>

--- cmake/kobj.cmake
+++ cmake/kobj.cmake
@@ -22,6 +22,7 @@
     --kobj-otype-output ${KOBJ_OTYPE}
     --kobj-size-output ${KOBJ_SIZE}
     $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:--verbose>
+    DEPENDS $ENV{ZEPHYR_BASE}/scripts/gen_kobject_list.py
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     )
   add_custom_target(${KOBJ_TYPES_H_TARGET} DEPENDS ${KOBJ_TYPES} ${KOBJ_OTYPE})


PackageConfig searches for ABI-matching upstream dependencies. If VERSION_ABI is not available, fallback to matching VERSION MAJOR+MINOR.

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -21,6 +21,7 @@
 #   ${PROJECT_NAME}_FOUND - Same as above
 #
 #   ${UPPER_PROJECT_NAME}_VERSION - The version of the project which was found
+#   ${UPPER_PROJECT_NAME}_VERSION_ABI - The ABI version of the project which was found
 #   ${UPPER_PROJECT_NAME}_INCLUDE_DIRS - Where to find the headers
 #   ${UPPER_PROJECT_NAME}_LIBRARIES - The project link libraries
 #   ${UPPER_PROJECT_NAME}_LIBRARY - The produced (core) library
@@ -78,8 +79,7 @@

 set(_config_file_standard_find
   "if(NOT _fail)\n"
-# setup VERSION, INCLUDE_DIRS and DEB_DEPENDENCIES
-  "  set(${UPPER_PROJECT_NAME}_VERSION ${VERSION})\n"
+# setup INCLUDE_DIRS and DEB_DEPENDENCIES
   "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_PREFIX_DIR}/include)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES \"${CPACK_PACKAGE_NAME} (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_LIB_DEPENDENCY \"${CPACK_PACKAGE_NAME}-lib (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
@@ -155,8 +155,7 @@

 set(_config_file_subproject_find
   "if(NOT _fail)\n"
-# setup VERSION, INCLUDE_DIRS and DEB_DEPENDENCIES
-  "  set(${UPPER_PROJECT_NAME}_VERSION ${VERSION})\n"
+# setup INCLUDE_DIRS and DEB_DEPENDENCIES
   "  list(APPEND ${UPPER_PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_PREFIX_DIR}/include)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES \"${CPACK_PACKAGE_NAME} (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_LIB_DEPENDENCY \"${CPACK_PACKAGE_NAME}-lib (>= ${VERSION_MAJOR}.${VERSION_MINOR})\")\n"
@@ -197,6 +196,7 @@
   "  set(${UPPER_PROJECT_NAME}_FOUND)\n"
   "  set(${PROJECT_NAME}_FOUND)\n"
   "  set(${UPPER_PROJECT_NAME}_VERSION)\n"
+  "  set(${UPPER_PROJECT_NAME}_VERSION_ABI)\n"
   "  set(${UPPER_PROJECT_NAME}_INCLUDE_DIRS)\n"
   "  set(${UPPER_PROJECT_NAME}_LIBRARIES)\n"
   "  set(${UPPER_PROJECT_NAME}_DEB_DEPENDENCIES)\n"
@@ -208,6 +208,8 @@
   "else()\n"
   "  set(${UPPER_PROJECT_NAME}_FOUND TRUE)\n"
   "  set(${PROJECT_NAME}_FOUND TRUE)\n"
+  "  set(${UPPER_PROJECT_NAME}_VERSION ${VERSION})\n"
+  "  set(${UPPER_PROJECT_NAME}_VERSION_ABI ${VERSION_ABI})\n"
   "  set(${UPPER_PROJECT_NAME}_MODULE_FILENAME ${MODULE_FILENAME})\n"
   "  list(SORT ${UPPER_PROJECT_NAME}_INCLUDE_DIRS)\n"
   "  list(REMOVE_DUPLICATES ${UPPER_PROJECT_NAME}_INCLUDE_DIRS)\n"
@@ -215,7 +217,7 @@
   "    list(REMOVE_DUPLICATES ${UPPER_PROJECT_NAME}_LIBRARIES)\n"
   "  endif()\n"
   "  if(_out AND ${UPPER_PROJECT_NAME}_STATUS)\n"
-  "    message(STATUS \"Found ${PROJECT_NAME} ${VERSION} [\${${UPPER_PROJECT_NAME}_COMPONENTS}] in \"\n"
+  "    message(STATUS \"Found ${PROJECT_NAME} ${VERSION}-${VERSION_ABI} [\${${UPPER_PROJECT_NAME}_COMPONENTS}] in \"\n"
   "      \"\${${UPPER_PROJECT_NAME}_INCLUDE_DIRS}:\${${UPPER_PROJECT_NAME}_LIBRARY}\")\n"
   "  endif()\n"
   "endif()\n"
@@ -258,7 +260,8 @@
   endif()
 endforeach()

-# compile finding of dependent libraries
+# compile finding of dependent libraries (ProjectConfig.cmake)
+# 1. set the search mode for the dependent projects [ required | optional ]
 set(DEPENDENTS
   "if(${PROJECT_NAME}_FIND_REQUIRED)\n"
   "  set(_output_type FATAL_ERROR)\n"
@@ -274,29 +277,31 @@
   "  set(_quiet QUIET)\n"
   "endif()\n\n"
 )
+
+# 2. add code to find each individual dependency
 foreach(_dependent ${${UPPER_PROJECT_NAME}_DEPENDENT_LIBRARIES})
   string(TOUPPER ${_dependent} _DEPENDENT)
+  # Check if the dependant project uses mixed case or upper case for its name
+  # (e.g. Boost_FOUND or BOOST_FOUND) and set ${_dependent}_name accordingly.
+  # This is generally already done by FindPackages.cmake
   if(NOT ${_dependent}_name)
     if(${_DEPENDENT}_FOUND)
       set(${_dependent}_name ${_DEPENDENT})
     elseif(${_dependent}_FOUND)
       set(${_dependent}_name ${_dependent})
+    else()
+      message(FATAL_ERROR
+        "Dependent library ${_dependent} was not properly resolved")
     endif()
   endif()
-  if(NOT ${_dependent}_name)
-    message(FATAL_ERROR
-      "Dependent library ${_dependent} was not properly resolved")
-  endif()
+
+  # determine the appropriate version of the dependency
   if(${${_dependent}_name}_VERSION)
-    set(${${_dependent}_name}_findmode EXACT)
     set(_FIND_VERSION "${${${_dependent}_name}_VERSION}")
-    set(_FIND_MAX_VERSION "${${${_dependent}_name}_VERSION}")
-
     if("${_FIND_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)")
       set(_FIND_VERSION "${CMAKE_MATCH_1}")
     endif()
   else()
-    set(${${_dependent}_name}_findmode REQUIRED)
     set(_FIND_VERSION)
   endif()

@@ -315,11 +320,22 @@
     "set(${${_dependent}_name}_FOUND)\n"
     "find_package(${_dependent} ${_FIND_VERSION} QUIET \${_req} ${_components})\n"
     "if(${${_dependent}_name}_FOUND)\n" )
-  if(_FIND_VERSION)
+
+  # if possible, look for the exact ABI version of the dependency that was used to build this project.
+  # PackageConfig.cmake files generated by Buildyard have this value, but external projects do not have it
+  if(${${_dependent}_name}_VERSION_ABI)
+    set(_find_abi_version ${${${_dependent}_name}_VERSION_ABI})
+    list(APPEND DEPENDENTS
+      "  if(NOT \${${${_dependent}_name}_VERSION_ABI} VERSION_EQUAL ${_find_abi_version})\n"
+      "    message(FATAL_ERROR \"${${_dependent}_name} ABI version '\${${${_dependent}_name}_VERSION_ABI}' not compatible with expected version '${_find_abi_version}'\")\n"
+      "  endif()\n")
+  # if it is not possible to match the ABI version, work around by looking for a close version match,
+  # i.e. VERSION_MAJOR + VERSION_MINOR. For example, Boost 1.54.x.
+  elseif(_FIND_VERSION)
     list(APPEND DEPENDENTS
       "  if(\"\${${${_dependent}_name}_VERSION}\" MATCHES \"^([0-9]+\\\\.[0-9]+)\")\n"
-      "    if(CMAKE_MATCH_1 VERSION_GREATER ${_FIND_VERSION})\n"
-      "      message(FATAL_ERROR \"${${_dependent}_name} ${${${_dependent}_name}_VERSION} not compatible with ${_FIND_VERSION}\")\n"
+      "    if(NOT CMAKE_MATCH_1 VERSION_EQUAL ${_FIND_VERSION})\n"
+      "      message(FATAL_ERROR \"${${_dependent}_name} \${CMAKE_MATCH_1} does not match expected version ${_FIND_VERSION}\")\n"
       "    endif()\n"
       "  endif()\n")
   endif()
@@ -335,7 +351,7 @@
 endforeach()
 string(REGEX REPLACE ";" " " DEPENDENTS ${DEPENDENTS})

-# create ProjectConfig.cmake
+# 3. create ProjectConfig.cmake by adding DEPENDENTS to ProjectConfig.cmake.in
 if(LIBRARY_NAMES)
   set(HAS_LIBRARY_NAMES LIBRARY_NAMES)
 endif()


COMP: Using MultiThreaderBase, avoids legacy warning

Change-Id: Ia77a25382bcb461dcbde929b39beca9e3142cc52

--- Modules/Remote/MorphologicalContourInterpolation.remote.cmake
+++ Modules/Remote/MorphologicalContourInterpolation.remote.cmake
@@ -14,5 +14,5 @@
 This work is supported by NIH grant R01 EB014346
 'Continued development and maintenance of the ITK-SNAP 3D image segmentation software'."
   GIT_REPOSITORY ${git_protocol}://github.com/KitwareMedical/ITKMorphologicalContourInterpolation.git
-  GIT_TAG 55081578b270af82addfbdf9720e0b8a3929eaea
+  GIT_TAG 6ab2409320e661ddc8220be8fba5d9f03de6cb8b
   )


fixed error in macro call

fixed error in macro call

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -122,11 +122,6 @@
 # You need include and src in your hierarchy at least for this to work correctly
 # You also need MergeLists.txt
 #
-
-#for backward compatibility
-macro (WkBuild project_type )
-	WkCompile ${project_type}
-endmacro (WkBuild)

 #WkCompile( target_name EXECUTABLE | LIBRARY [ STATIC|SHARED|MODULE ]  )

@@ -276,6 +271,11 @@
 CMAKE_POLICY(POP)
 endmacro (WkCompile)

+#for backward compatibility
+macro (WkBuild project_type )
+	WkCompile( ${project_type} )
+endmacro (WkBuild)
+

 #
 # Find a dependency built in an external WK hierarchy


[INTERNAL] TravisCI: always use 4 threads, consider warnings as errors

--- util/travis/linux-cibuild.cmake
+++ util/travis/linux-cibuild.cmake
@@ -20,12 +20,8 @@
 set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000)
 set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000)

-# try to speed up the builds so we don't get killed
-if ("$ENV{CXX}" MATCHES ".*(clang\\+\\+-?.*)")
-  set(CTEST_BUILD_FLAGS -j6)
-else ("$ENV{CXX}" MATCHES ".*(clang\\+\\+-?.*)")
-  set(CTEST_BUILD_FLAGS -j4)
-endif ("$ENV{CXX}" MATCHES ".*(clang\\+\\+-?.*)")
+# Use 4 build threads
+set(CTEST_BUILD_FLAGS -j4)

 # we want makefiles
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
@@ -40,13 +36,13 @@
 # run the classical ctest suite without update
 # travis-ci handles this for us
 ctest_start     (Continuous)
-
 ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE _configure_ret)
-ctest_build     (BUILD "${CTEST_BINARY_DIRECTORY}" NUMBER_ERRORS _build_errors)
-ctest_test      (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 8)
+ctest_build     (BUILD "${CTEST_BINARY_DIRECTORY}" NUMBER_ERRORS _build_errors
+                                                   NUMBER_WARNINGS _build_warnings)
+ctest_test      (BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 4)
 ctest_submit()

 # indicate errors
-if(${_build_errors} GREATER 0 OR NOT ${_configure_ret} EQUAL 0)
+if (${_build_errors} GREATER 0 OR ${_build_warnings} GREATER 0 OR NOT ${_configure_ret} EQUAL 0)
   file(WRITE "$ENV{SOURCE_DIRECTORY}/failed" "build_failed")
-endif()
+endif ()


Put back python version test in header test

--- CMake/OTBModuleHeaderTest.cmake
+++ CMake/OTBModuleHeaderTest.cmake
@@ -66,6 +66,7 @@
   if( NOT ${_name}_THIRD_PARTY
       AND EXISTS ${${_name}_SOURCE_DIR}/include
       AND PYTHON_EXECUTABLE
+      AND NOT (PYTHON_VERSION_STRING VERSION_LESS 2.6)
       AND NOT (${_name} STREQUAL OTBTestKernel)
       AND NOT (CMAKE_GENERATOR MATCHES "^Visual Studio 10.*"))


Don't enable R by default

Don't enable R by default

SWIG has bugs in it with regards to R an enum types.

Change-Id: Ic1173b833aaf945e23342ae609fb927ea64a1824

--- CMake/SITKLanguageOptions.cmake
+++ CMake/SITKLanguageOptions.cmake
@@ -128,6 +128,9 @@
 else( )
   set ( WRAP_R_DEFAULT OFF )
 endif( )
+# SWIG 2.0.9-10 has bugs in enum types
+set ( WRAP_R_DEFAULT OFF )
+

 list( APPEND SITK_LANGUAGES_VARS
  R_INCLUDE_DIR


[benchmark][cmake] Fix typo. This is NFC since this option is usually disabled.

--- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
+++ benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
@@ -134,9 +134,9 @@
       LIBRARY_FLAGS ${common_options_driver} ${BENCH_DRIVER_LIBRARY_FLAGS})
     precondition(objfile_out)
     list(APPEND bench_library_objects "${objfile_out}")
-    if (SWIFT_BENCHMARK_EMIT_SUB)
+    if (SWIFT_BENCHMARK_EMIT_SIB)
       precondition(sibfile_out)
-      list(APPEND bench_library_subfiles "${sibfile_out}")
+      list(APPEND bench_library_sibfiles "${sibfile_out}")
     endif()
   endforeach()

@@ -151,9 +151,9 @@
       LIBRARY_FLAGS ${common_options})
     precondition(objfile_out)
     list(APPEND bench_library_objects "${objfile_out}")
-    if (SWIFT_BENCHMARK_EMIT_SUB)
+    if (SWIFT_BENCHMARK_EMIT_SIB)
       precondition(sibfile_out)
-      list(APPEND bench_library_subfiles "${sibfile_out}")
+      list(APPEND bench_library_sibfiles "${sibfile_out}")
     endif()
   endforeach()


No longer install all dependent dynamic libraries.

	* build-aux/cmake/modules/CopyDependentLibraries.cmake: Accept custom
	destination directory and no longer install all directory contents by
	default.

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

--- build-aux/cmake/modules/CopyDependentLibraries.cmake
+++ build-aux/cmake/modules/CopyDependentLibraries.cmake
@@ -16,14 +16,13 @@

 # Copy dependent libraries of _target_ in target-dldep and schedule them for
 # installation. It uses dldep.
-function(COPY_DEPENDENT_LIBRARIES target)
+function(COPY_DEPENDENT_LIBRARIES target destination)
   check_cmake_vars_exists(CMAKE_AUX_DIR)
-  set(out "${target}-dldep")
   set(binary ${target}${CMAKE_EXECUTABLE_SUFFIX})
   set(generator ${CMAKE_AUX_DIR}/dldep)
   add_custom_target(
-    ${out} ALL
-    COMMAND ${generator} ${binary} ${out}
+    ${target}-dldep ALL
+    COMMAND ${generator} ${binary} ${destination}
     DEPENDS ${binary} ${generator}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "${CMAKE_COMMAND} -E cmake_echo_color "
@@ -31,11 +30,8 @@
     "Copying dependent libraries of '${binary}'."
     VERBATIM
     )
-  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ${out})
-  # The trailing backslash is need to avoid to have the last component of the
-  # path installed too.
-  install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${out}/
-    DESTINATION lib/${target})
+  set_directory_properties(PROPERTIES
+    ADDITIONAL_MAKE_CLEAN_FILES ${destination})
 endfunction(COPY_DEPENDENT_LIBRARIES)

 endif(NOT COMMAND COPY_DEPENDENT_LIBRARIES)


Attempt to add AVX and aggressive optimizations on Darwin when building with Xcode5

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -254,6 +254,16 @@
   # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
   set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
+  if (USE_AVX_OPTIMIZATION)
+    if (XCODE_VERSION GREATER 4.9)
+      set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS AVX)
+      set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL -Ofast)
+      set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -mavx ${CMAKE_CXX_FLAGS_RELEASE}")
+      set(CMAKE_C_FLAGS_RELEASE "-Ofast -mavx ${CMAKE_C_FLAGS_RELEASE}")
+	else (XCODE_VERSION GREATER 4.9)
+	  error("Darwin AVX Optimizations only available on Xcode5 with Clang, silly person!")
+	endif (XCODE_VERSION GREATER 4.9)
+  endif (USE_AVX_OPTIMIZATION)
   if (XCODE_VERSION GREATER 4.2)
     set(ENABLE_SIGNING TRUE)
     set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")


Reverted change to function name

Reverted change to function name

--- scripts/cmake/ElektraCache.cmake
+++ scripts/cmake/ElektraCache.cmake
@@ -424,7 +424,7 @@
 	XercesC_DIR
 	OPENSSL_INCLUDE_DIR
 )
-mark_as_advanced_protected_from_user (
+mark_as_advanced(
 	LUA_EXECUTABLE # The following settings are internal (not to be changed by users):
 	FEDORA
 	CARGO_EXECUTABLE


Missing parentheses on endif statement in CMake

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

--- cmake/AvogadroCPack.cmake
+++ cmake/AvogadroCPack.cmake
@@ -33,7 +33,7 @@
   set(INSTALL_BUNDLE_FILES ON)
 else()
   option(INSTALL_BUNDLE_FILES "Add install rules to bundle files" OFF)
-endif
+endif()
 if(INSTALL_BUNDLE_FILES)
   # First the AvogadroLibs files that are not detected.
   find_package(AvogadroLibs REQUIRED NO_MODULE)


Add more debug flags

Add more debug flags

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -29,6 +29,8 @@
     set_debug_flag_if_possible("-Wconversion")
     set_debug_flag_if_possible("-Wsign-conversion")
     set_debug_flag_if_possible("-Wsign-promo")
+    set_debug_flag_if_possible("-Wsuggest-override")
+    set_debug_flag_if_possible("-pedantic")
 endif()

 include(CheckCCompilerFlag)


give credit where credit is due

give credit where credit is due

--- cmake/FindProtobufC.cmake
+++ cmake/FindProtobufC.cmake
@@ -29,6 +29,8 @@
 	PROTOBUFC_LIBRARY PROTOBUFC_INCLUDE_DIR PROTOBUFC_COMPILER)
 mark_as_advanced(PROTOBUFC PROTOBUFC_INCLUDE_DIR PROTOBUFC_LIBRARY)

+#The following was adopted from the protobuf cmake function by
+#Esben Mose Hansen <esben@ange.dk>, (C) Ange Optimization ApS 2008
 function(PROTOC VAR)
 	if (NOT ARGN)
 		message(SEND_ERROR "Error: WRAP PROTO called without any proto files")


Align line

Align line

--- cmake/FindSioClient.cmake
+++ cmake/FindSioClient.cmake
@@ -98,9 +98,7 @@
 endif()

 # Enable TLS
-target_compile_definitions(sioclient_tls PRIVATE
- -DSIO_TLS
- )
+target_compile_definitions(sioclient_tls PRIVATE -DSIO_TLS)

 # ============================================================================


linux: Work-around for old CMake version

--- cmake/linux.service.cmake
+++ cmake/linux.service.cmake
@@ -2,10 +2,10 @@
 #   Linux Userspace CMake script   #
 ####################################

-set(CMAKE_CXX_STANDARD 17)
+#set(CMAKE_CXX_STANDARD 17)
 set(COMMON "-g -O2 -march=native -Wall -Wextra")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON}")
-set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON}")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 ${COMMON}")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON}")

 option(DEBUGGING "Enable debugging" OFF)
 option(GPROF "Enable profiling with gprof" OFF)


Define filtered QHULL_RPATH.

Define filtered QHULL_RPATH.

svn path=/trunk/; revision=10798

--- cmake/modules/csiro.cmake
+++ cmake/modules/csiro.cmake
@@ -78,6 +78,9 @@
     if(QH_NEW_EXIST)
       message(STATUS "QHULL_INCLUDE_DIRS = ${QHULL_INCLUDE_DIRS}")
       message(STATUS "QHULL_LIBRARIES = ${QHULL_LIBRARIES}")
+      set(QHULL_RPATH ${QHULL_LIBRARY_DIRS})
+      filter_rpath(QHULL_RPATH)
+      message(STATUS "QHULL_RPATH = ${QHULL_RPATH}")
     else(QH_NEW_EXIST)
       message(STATUS "WARNING: function qh_new_qhull not found.  Setting HAVE_QHULL to OFF.")
       set(HAVE_QHULL OFF CACHE BOOL "Enable use of the Qhull library" FORCE)


[BUILD] Fix LLVM static/dynamic link issue (#1461)

This patch prevents libtvm.so from both containing static parts of LLVM
and link with libLLVM.so by removing the latter from link list.

--- cmake/util/FindLLVM.cmake
+++ cmake/util/FindLLVM.cmake
@@ -18,7 +18,14 @@
   if(LLVM_CONFIG STREQUAL "ON")
     find_package(LLVM REQUIRED CONFIG)
     llvm_map_components_to_libnames(LLVM_LIBS all)
-    list(REMOVE_ITEM LLVM_LIBS LTO)
+    list (FIND LLVM_LIBS "LLVM" _llvm_dynlib_index)
+    if (${_llvm_dynlib_index} GREATER -1)
+      set(LLVM_LIBS LLVM)
+      message(STATUS "Link with dynamic LLVM library")
+    else()
+      list(REMOVE_ITEM LLVM_LIBS LTO)
+      message(STATUS "Link with static LLVM libraries")
+    endif()
     set(TVM_LLVM_VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_MINOR})
   elseif(NOT LLVM_CONFIG STREQUAL "OFF")
     # use llvm config


typo fix

typo fix

--- cmake/vSMCFindMutex.cmake
+++ cmake/vSMCFindMutex.cmake
@@ -41,7 +41,7 @@
     SET (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES}
         ${Boost_INCLUDE_DIRS})
     SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
-        ${CMAKE_MUTEX_LIBS_INIT})
+        ${CMAKE_THREAD_LIBS_INIT})
     SET (CMAKE_REQUIRED_DEFINITIONS -DVSMC_HAS_CXX11LIB_MUTEX=1)
     CHECK_CXX_SOURCE_RUNS ("${VSMC_MUTEX_TEST_SOURCE}"
         VSMC_MUTEX_STD_FOUND)
@@ -58,7 +58,7 @@
         SET (VSMC_MUTEX_FOUND TRUE CACHE BOOL "Found mutex")
     ENDIF (VSMC_MUTEX_STD_FOUND OR VSMC_MUTEX_BOOST_FOUND)
     IF (VSMC_MUTEX_STD_FOUND)
-        SET (VSMC_MUTEX_STD_LINK_LIBRARIES ${CMAKE_MUTEX_LIBS_INIT}
+        SET (VSMC_MUTEX_STD_LINK_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}
             CACHE STRING "Link to STD mutex")
     ENDIF (VSMC_MUTEX_STD_FOUND)
     IF (VSMC_MUTEX_BOOST_FOUND)


FindFreetype needs to look for the header ft2build.h separately; might be in a different directory.

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -43,11 +43,15 @@
 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)
+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")


Bump up CLBlast dependency version to 1.5.2

--- CMakeModules/build_CLBlast.cmake
+++ CMakeModules/build_CLBlast.cmake
@@ -8,7 +8,7 @@
 FetchContent_Declare(
   ${clblast_prefix}
   GIT_REPOSITORY    https://github.com/cnugteren/CLBlast.git
-  GIT_TAG           41f344d1a6f2d149bba02a6615292e99b50f4856
+  GIT_TAG           1.5.2
 )
 af_dep_check_and_populate(${clblast_prefix})


j'en ai marre 2

j'en ai marre 2

--- CMake/Modules/common.cmake
+++ CMake/Modules/common.cmake
@@ -5,6 +5,11 @@
             "You can define the source files explicitly by setting the SOURCE_FILES variable in your CMakeLists.txt; or ")
     endif ()
 endmacro ()
+
+
+
+set (CMAKE_BUILD_TYPE Release)
+

 # execute_process (COMMAND echo COMMAND ${CMAKE_C_COMPILER} -E -dM - OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
 # string (REGEX MATCH "#define +__(x86_64|aarch64)__ +1" matched "${PREDEFINED_MACROS}")


Improve error message when configuration fails.

Only suggest optional download on windows, otherwise suggest enabling
C++11.

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -98,10 +98,20 @@

 if ( (NOT SITK_HAS_TR1_FUNCTIONAL AND NOT SITK_HAS_CXX11_FUNCTIONAL)
     OR
-    (NOT SITK_HAS_TR1_TYPE_TRAITS AND NOT SITK_HAS_CXX11_TYPE_TRAITS) )
-  message( FATAL_ERROR
-    "SimpleITK requires usage of C++11 or C++ Technical Report 1 (TR1).\n"
-    "It may be available as an optional download for your compiler or difference CXX_FLAGS."
-    "Please see the FAQs for details."
-    "http://simpleitk.readthedocs.io/en/master/Documentation/docs/source/faq.html#do-i-need-to-download-an-option-package-for-tr1-support\n")
-endif ( )
+    (NOT SITK_HAS_TR1_TYPE_TRAITS AND NOT SITK_HAS_CXX11_TYPE_TRAITS)
+    )
+  if (MSVC)
+    message( FATAL_ERROR
+      "SimpleITK requires usage of C++11 or C++ Technical Report 1 (TR1).\n"
+      "It may be available as an optional download for your compiler or difference CXX_FLAGS."
+      "Please see the FAQs for details."
+      "http://simpleitk.readthedocs.io/en/master/Documentation/docs/source/faq.html#do-i-need-to-download-an-option-package-for-tr1-support\n")
+  else()
+      message( FATAL_ERROR
+        "SimpleITK requires usage of C++11 or C++ Technical Report 1 "
+        "(TR1), but were neither able to detect TR1 nor automatically "
+        "enable C++11. Please review your configuration settings and "
+        "enable C++11.\n")
+
+  endif()
+endif ()


Enable CMP0067, and warn if needed and not available

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -14,6 +14,16 @@
 # SITK_HAS_TR1_FUNCTIONAL
 # SITK_HAS_TR1_TYPE_TRAITS
 # SITK_HAS_TR1_UNORDERED_MAP
+
+if(POLICY CMP0067) # CMake 3.8.2
+  cmake_policy(SET CMP0067 NEW)
+elseif( DEFINED CMAKE_CXX_STANDARD
+  OR DEFINED CMAKE_CXX_STANDARD_REQUIRED
+  OR CMAKE_CXX_EXTENSIONS )
+message(WARNING "CXX standard variables are not properly supported by \
+  CMake ${CMAKE_VERSION}. Configuration compilations will not detect \
+  features properly!")
+endif()

 #
 # Function to wrap try compiles on the aggregate cxx test file1


Use try_compiles COMPILE_DEFINITIONS argument over CMAKE_FLAGS

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -35,12 +35,10 @@

   if(NOT DEFINED ${VARIABLE})
     message(STATUS "Performing Test ${VARIABLE}")
-    set(requred_definitions "${CMAKE_REQUIRED_DEFINITIONS} -D${VARIABLE}")
     try_compile(${VARIABLE}
       "${PROJECT_BINARY_DIR}/CMakeTmp"
       "${CMAKE_CURRENT_LIST_DIR}/sitk_check_cxx11.cxx"
-      CMAKE_FLAGS
-      -DCOMPILE_DEFINITIONS:STRING=${requred_definitions}
+      COMPILE_DEFINITIONS "-D${VARIABLE}" ${CMAKE_REQUIRED_DEFINITIONS}
       OUTPUT_VARIABLE output)

     set(${cache_var} ${${VARIABLE}} CACHE INTERNAL "hashed flags with  try_compile results")


Remove hashing of try_compile is favor of CMake standard behavior

The downside to changing to the normal CMake behavior if the use adds
the std=c++11 flag after the initial configuration the try_compiles
will not be re-tried. But this is standard CMake behavior.

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -32,14 +32,8 @@
 # Function to wrap try compiles on the aggregate cxx test file1
 #
 function(sitkCXX11Test VARIABLE)
-  # use the hash of the dependent cxx flags in the variable name to
-  # cache the results.
-  string(MD5 cmake_cxx_flags_hash "#${CMAKE_CXX_FLAGS}")
-  set(cache_var "${VARIABLE}_${cmake_cxx_flags_hash}")

-  if(DEFINED "${cache_var}")
-    set(${VARIABLE} "${${cache_var}}"  CACHE INTERNAL "Using hashed value from TRY_COMPILE")
-  else()
+  if(NOT DEFINED ${VARIABLE})
     message(STATUS "Performing Test ${VARIABLE}")
     set(requred_definitions "${CMAKE_REQUIRED_DEFINITIONS} -D${VARIABLE}")
     try_compile(${VARIABLE}


intel_1000_crb: fix path to xt-ocd

intel_1000_crb: fix path to xt-ocd

Capitilised Tensilica is not what we have in the documentation. should
be /opt/tensilica.

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- boards/xtensa/intel_s1000_crb/board.cmake
+++ boards/xtensa/intel_s1000_crb/board.cmake
@@ -2,7 +2,7 @@
 set(BOARD_DEBUG_RUNNER intel_s1000)

 board_finalize_runner_args(intel_s1000
-  "--xt-ocd-dir=/opt/Tensilica/xocd-12.0.4/xt-ocd"
+  "--xt-ocd-dir=/opt/tensilica/xocd-12.0.4/xt-ocd"
   "--ocd-topology=topology_dsp0_flyswatter2.xml"
   "--ocd-jtag-instr=dsp0_gdb.txt"
   "--gdb-flash-file=load_elf.txt"


Enabled c99 support for C files

Enabled c99 support for C files

--- modules/acore/cmake/compiler/gcc/settings.cmake
+++ modules/acore/cmake/compiler/gcc/settings.cmake
@@ -10,8 +10,8 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
 message(STATUS "GCC: Enabled c++11 support")

-#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
-#message(STATUS "GCC: Enabled C99 support")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+message(STATUS "GCC: Enabled C99 support")

 if(PLATFORM EQUAL 32)
   # Required on 32-bit systems to enable SSE2 (standard on x64)