Support C++-only projects

Support C++-only projects

--- conan.cmake
+++ conan.cmake
@@ -63,17 +63,20 @@
     endif()

     get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
-    list (FIND _languages "CXX" _index)
-    if (${_index} GREATER -1)
+    if (";${_languages};" MATCHES ";CXX;")
+        set(LANGUAGE CXX)
         set(USING_CXX 1)
+    elseif (";${_languages};" MATCHES ";C;")
+        set(LANGUAGE C)
+        set(USING_CXX 0)
     else ()
-        set(USING_CXX 0)
-    endif()
-
-    if (${CMAKE_C_COMPILER_ID} STREQUAL GNU)
+        message(FATAL_ERROR "Conan: Neither C or C++ was detected as a language for the project. Unabled to detect compiler version.")
+    endif()
+
+    if (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL GNU)
         # using GCC
         # TODO: Handle other params
-        string(REPLACE "." ";" VERSION_LIST ${CMAKE_C_COMPILER_VERSION})
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
         set(_SETTINGS ${_SETTINGS} -s compiler=gcc -s compiler.version=${MAJOR}.${MINOR})
@@ -81,17 +84,17 @@
             conan_cmake_detect_gnu_libcxx(_LIBCXX)
             set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=${_LIBCXX})
         endif ()
-    elseif (${CMAKE_C_COMPILER_ID} STREQUAL AppleClang)
+    elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL AppleClang)
         # using AppleClang
-        string(REPLACE "." ";" VERSION_LIST ${CMAKE_C_COMPILER_VERSION})
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
         set(_SETTINGS ${_SETTINGS} -s compiler=apple-clang -s compiler.version=${MAJOR}.${MINOR})
         if (USING_CXX)
             set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=libc++)
         endif ()
-    elseif (${CMAKE_C_COMPILER_ID} STREQUAL Clang)
-        string(REPLACE "." ";" VERSION_LIST ${CMAKE_C_COMPILER_VERSION})
+    elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang)
+        string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
         if(APPLE)
@@ -112,7 +115,7 @@
                 set(_SETTINGS ${_SETTINGS} -s compiler.libcxx=${_LIBCXX})
             endif ()
         endif()
-    elseif(${CMAKE_C_COMPILER_ID} STREQUAL MSVC)
+    elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC)
         set(_VISUAL "Visual Studio")
         _get_msvc_ide_version(_VISUAL_VERSION)
         if("${_VISUAL_VERSION}" STREQUAL "")
@@ -121,15 +124,15 @@
             set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=${_VISUAL_VERSION})
         endif()

-        if (MSVC_C_ARCHITECTURE_ID MATCHES "64")
+        if (MSVC_${LANGUAGE}_ARCHITECTURE_ID MATCHES "64")
             set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
-        elseif (MSVC_C_ARCHITECTURE_ID MATCHES "^ARM")
+        elseif (MSVC_${LANGUAGE}_ARCHITECTURE_ID MATCHES "^ARM")
             message(STATUS "Conan: Using default ARM architecture from MSVC")
             set(_SETTINGS ${_SETTINGS} -s arch=armv6)
-        elseif (MSVC_C_ARCHITECTURE_ID MATCHES "86")
+        elseif (MSVC_${LANGUAGE}_ARCHITECTURE_ID MATCHES "86")
             set(_SETTINGS ${_SETTINGS} -s arch=x86)
         else ()
-            message(FATAL_ERROR "Conan: Unknown MSVC architecture [${MSVC_C_ARCHITECTURE_ID}]")
+            message(FATAL_ERROR "Conan: Unknown MSVC architecture [${MSVC_${LANGUAGE}_ARCHITECTURE_ID}]")
         endif()

         conan_cmake_detect_vs_runtime(_vs_runtime)


Allow to override VMCS_INSTALL_PREFIX

Allow to override VMCS_INSTALL_PREFIX

--- makefiles/cmake/vmcs.cmake
+++ makefiles/cmake/vmcs.cmake
@@ -9,7 +9,7 @@
 # Where shall we install?
 if (ANDROID)
   SET(VMCS_INSTALL_PREFIX "/vendor/brcm/islands" CACHE PATH "Prefix prepended to install directories" FORCE)
-else()
+elseif(NOT DEFINED VMCS_INSTALL_PREFIX)
   SET(VMCS_INSTALL_PREFIX "/opt/vc" CACHE PATH "Prefix prepended to install directories" FORCE)
 endif()


ENH: Update to version 0.1.0 for alpha 1 (va01)

This tag corresponds to ITK tag "v4.0a08".

--- Version.cmake
+++ Version.cmake
@@ -1,6 +1,6 @@
 # Version info
 set(SimpleITK_Major 0)
-set(SimpleITK_Minor 0)
+set(SimpleITK_Minor 1)
 set(SimpleITK_Patch 0)

 include(GetGitRevisionDescription)


Fix dependency for Catch tests

Fix dependency for Catch tests

--- cmake/Catch.cmake
+++ cmake/Catch.cmake
@@ -21,6 +21,7 @@
 FUNCTION(ADD_CATCH_TEST_EXECUTABLE target_name)
   PREPARE_CATCH()
   ADD_EXECUTABLE(${target_name} ${ARGN})
+  ADD_DEPENDENCIES(${target_name} Catch)
   ADD_TEST(NAME ${target_name} COMMAND ${target_name})

   ExternalProject_Get_Property(Catch source_dir)


Make hook initialization quiet as well

Make hook initialization quiet as well

--- cmake/hooks.cmake
+++ cmake/hooks.cmake
@@ -5,6 +5,7 @@
   OUTPUT  "${hooks_directory}/.git"
   COMMAND "${GIT_EXECUTABLE}"
           init
+          --quiet
   COMMAND "${GIT_EXECUTABLE}"
           remote add origin
           ../..


Require explicit configuration of BY configs

--- SubProject.cmake
+++ SubProject.cmake
@@ -210,45 +210,48 @@
   endif()
 endif()

-# interpret Buildyard project.cmake and depends.txt configurations
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/depends.txt")
-  file(READ depends.txt SUBPROJECT_DEPENDS)
-  string(REGEX REPLACE "#[^\n]*" "" SUBPROJECT_DEPENDS "${SUBPROJECT_DEPENDS}")
-  string(REGEX REPLACE "^\n" "" SUBPROJECT_DEPENDS "${SUBPROJECT_DEPENDS}")
-  string(REGEX REPLACE "[ \n]" ";" SUBPROJECT_DEPENDS "${SUBPROJECT_DEPENDS}")
-
-  list(LENGTH SUBPROJECT_DEPENDS SUBPROJECT_DEPENDS_LEFT)
-  while(SUBPROJECT_DEPENDS_LEFT GREATER 2)
-    list(GET SUBPROJECT_DEPENDS 0 SUBPROJECT_DEPENDS_DIR)
-    list(GET SUBPROJECT_DEPENDS 1 SUBPROJECT_DEPENDS_REPO)
-    list(GET SUBPROJECT_DEPENDS 2 SUBPROJECT_DEPENDS_TAG)
-    list(REMOVE_AT SUBPROJECT_DEPENDS 0 1 2)
+function(subproject_configure)
+  # interpret Buildyard project.cmake and depends.txt configurations
+  if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/depends.txt")
+    file(READ depends.txt SUBPROJECT_DEPENDS)
+    string(REGEX REPLACE "#[^\n]*" "" SUBPROJECT_DEPENDS
+      "${SUBPROJECT_DEPENDS}")
+    string(REGEX REPLACE "^\n" "" SUBPROJECT_DEPENDS "${SUBPROJECT_DEPENDS}")
+    string(REGEX REPLACE "[ \n]" ";" SUBPROJECT_DEPENDS "${SUBPROJECT_DEPENDS}")
+
     list(LENGTH SUBPROJECT_DEPENDS SUBPROJECT_DEPENDS_LEFT)
-
-    git_subproject(${SUBPROJECT_DEPENDS_DIR} ${SUBPROJECT_DEPENDS_REPO}
-      ${SUBPROJECT_DEPENDS_TAG})
-  endwhile()
-endif()
-
-file(GLOB _files *.cmake)
-foreach(_file ${_files})
-  string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" _config ${_file})
-  list(APPEND _localFiles ${_config})
-
-  string(REPLACE ".cmake" "" Name ${_config})
-  get_filename_component(NAME ${Name} NAME)
-  string(TOUPPER ${NAME} NAME)
-  set(${NAME}_DIR ${BASEDIR})
-  include(${_file})
-
-  if(${NAME}_SUBPROJECT)
-    if(NOT ${NAME}_REPO_TAG)
-      set(${NAME}_REPO_TAG master)
-    endif()
-    git_subproject(${Name} ${${NAME}_REPO_URL} ${${NAME}_REPO_TAG})
-  endif()
-endforeach()
-
-if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
-  unset(INSTALL_PACKAGES CACHE) # Remove after install in SubProject.cmake
-endif()
+    while(SUBPROJECT_DEPENDS_LEFT GREATER 2)
+      list(GET SUBPROJECT_DEPENDS 0 SUBPROJECT_DEPENDS_DIR)
+      list(GET SUBPROJECT_DEPENDS 1 SUBPROJECT_DEPENDS_REPO)
+      list(GET SUBPROJECT_DEPENDS 2 SUBPROJECT_DEPENDS_TAG)
+      list(REMOVE_AT SUBPROJECT_DEPENDS 0 1 2)
+      list(LENGTH SUBPROJECT_DEPENDS SUBPROJECT_DEPENDS_LEFT)
+
+      git_subproject(${SUBPROJECT_DEPENDS_DIR} ${SUBPROJECT_DEPENDS_REPO}
+        ${SUBPROJECT_DEPENDS_TAG})
+    endwhile()
+  endif()
+
+  file(GLOB _files *.cmake)
+  foreach(_file ${_files})
+    string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" _config ${_file})
+    list(APPEND _localFiles ${_config})
+
+    string(REPLACE ".cmake" "" Name ${_config})
+    get_filename_component(NAME ${Name} NAME)
+    string(TOUPPER ${NAME} NAME)
+    set(${NAME}_DIR ${BASEDIR})
+    include(${_file})
+
+    if(${NAME}_SUBPROJECT)
+      if(NOT ${NAME}_REPO_TAG)
+        set(${NAME}_REPO_TAG master)
+      endif()
+      git_subproject(${Name} ${${NAME}_REPO_URL} ${${NAME}_REPO_TAG})
+    endif()
+  endforeach()
+
+  if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+    unset(INSTALL_PACKAGES CACHE) # Remove after install in SubProject.cmake
+  endif()
+endfunction()


BUG: Does not build DTICrop when compiled as a Slicer extension

DTICrop is not a CLI and therefore will create errors when Slicer tries to load it.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -33,6 +33,7 @@
   #VTK_VERSION_MAJOR is define but not a CACHE variable
   set( VTK_VERSION_MAJOR ${VTK_VERSION_MAJOR} CACHE STRING "Choose the expected VTK major version to build Slicer (5 or 6).")
   set( USE_SYSTEM_SlicerExecutionModel ON CACHE BOOL "Build using an externally defined version of SlicerExecutionModel" FORCE )
+  set( BUILD_CropDTI OFF CACHE BOOL "Build CropDTI" FORCE) # CropDTI is not a CLI
 endif()

 option(USE_SYSTEM_ITK "Build using an externally defined version of ITK" OFF)
@@ -171,7 +172,7 @@
 #-----------------------------------------------------------------------------

 if( DTIProcess_BUILD_SLICER_EXTENSION )
-  set(EXTENSION_CLIS CropDTI dtiaverage dtiestim dtiprocess fiberprocess fiberstats polydatamerge polydatatransform)
+  set(EXTENSION_CLIS dtiaverage dtiestim dtiprocess fiberprocess fiberstats polydatamerge polydatatransform)
   set(TESTS dtiaverageTest dtiestimTest dtiprocessTest TestHomemadeRoundFunction)
   # Manual creation of imported targets for the tests
   # It is not possible to import the targets directly using "include(DTIProcess-targets.cmake)" because


Remove non-pdf conversions

Remove non-pdf conversions

--- doc/cmake/UseLATEX.cmake
+++ doc/cmake/UseLATEX.cmake
@@ -1258,21 +1258,9 @@
       latex_get_filename_component(path "${output_dir}/${file}" PATH)
       make_directory("${path}")

-      # Do conversions for dvi.
-      latex_convert_image(output_files "${file}" .eps "${convert_flags}"
-        "${LATEX_DVI_IMAGE_EXTENSIONS}" "${ARGN}")
-      list(APPEND dvi_outputs ${output_files})
-
-      # Do conversions for pdf.
-      if(is_raster)
-        latex_convert_image(output_files "${file}" .png "${convert_flags}"
-          "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
-        list(APPEND pdf_outputs ${output_files})
-      else()
-        latex_convert_image(output_files "${file}" .pdf "${convert_flags}"
-          "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
-        list(APPEND pdf_outputs ${output_files})
-      endif()
+      latex_convert_image(output_files "${file}" .pdf "${convert_flags}"
+        "${LATEX_PDF_IMAGE_EXTENSIONS}" "${ARGN}")
+      list(APPEND pdf_outputs ${output_files})
     else()
       message(WARNING "Could not find file ${CMAKE_CURRENT_SOURCE_DIR}/${file}.  Are you sure you gave relative paths to IMAGES?")
     endif()
@@ -1607,7 +1595,7 @@
     else()
       set(bib_compiler ${BIBTEX_COMPILER})
       set(bib_compiler_flags ${BIBTEX_COMPILER_ARGS})
-    endif()
+    endif()
     if(LATEX_MULTIBIB_NEWCITES)
       foreach (multibib_auxfile ${LATEX_MULTIBIB_NEWCITES})
         latex_get_filename_component(multibib_target ${multibib_auxfile} NAME_WE)


playing with module_path

playing with module_path

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -3,20 +3,21 @@
 cmake_policy(SET CMP0045 OLD)

 IF(NOT DEFINED CMAKE_PREFIX_PATH)
-	set(CMAKE_PREFIX_PATH ${CMAKI_PATH}/../depends/cmakefiles)
+	set(CMAKE_PREFIX_PATH ${CMAKE_MODULE_PATH}/../depends/cmakefiles)
 ENDIF()

 IF(NOT DEFINED ARTIFACTS_PATH)
-	set(ARTIFACTS_PATH ${CMAKE_CURRENT_SOURCE_DIR}/..)
+	set(ARTIFACTS_PATH ${CMAKE_MODULE_PATH}/../artifacts)
 ENDIF()

 IF(NOT DEFINED CMAKI_PATH)
-	set(CMAKI_PATH ${CMAKE_PREFIX_PATH}/..)
+	set(CMAKI_PATH ${CMAKE_MODULE_PATH})
 ENDIF()

 MESSAGE("CMAKI_PATH = ${CMAKI_PATH}")
 MESSAGE("ARTIFACTS_PATH = ${ARTIFACTS_PATH}")
 MESSAGE("CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
+MESSAGE("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")

 set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/bin)
 set(PACKAGE_BASE_URL "http://localhost/artifacts")


Fix 32-bit gcc builds for assembler too Add -m32 flag for ASM as well as C and C++

--- flags/32bit.cmake
+++ flags/32bit.cmake
@@ -11,3 +11,5 @@

 polly_add_cache_flag(CMAKE_CXX_FLAGS "-m32")
 polly_add_cache_flag(CMAKE_C_FLAGS "-m32")
+polly_add_cache_flag(CMAKE_ASM_FLAGS "-m32")
+


:rotating_light: suppress missingReturn warnings

--- cmake/ci.cmake
+++ cmake/ci.cmake
@@ -560,7 +560,7 @@
 ###############################################################################

 add_custom_target(ci_cppcheck
-    COMMAND ${CPPCHECK_TOOL} --enable=warning --inline-suppr --inconclusive --force --std=c++11 ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp --error-exitcode=1
+    COMMAND ${CPPCHECK_TOOL} --enable=warning --suppress=missingReturn --inline-suppr --inconclusive --force --std=c++11 ${PROJECT_SOURCE_DIR}/single_include/nlohmann/json.hpp --error-exitcode=1
     COMMENT "Check code with Cppcheck"
 )


Update config.h.cmake

Update config.h.cmake

setting defines for CPPUTEST_NO_XXX instead of CPPUTEST_HAS_XXX

--- config.h.cmake
+++ config.h.cmake
@@ -4,8 +4,8 @@
 #cmakedefine CPPUTEST_MEM_LEAK_DETECTION_DISABLED
 #cmakedefine CPPUTEST_USE_LONG_LONG

-#cmakedefine CPPUTEST_HAS_INF
-#cmakedefine CPPUTEST_HAS_NAN
+#cmakedefine CPPUTEST_NO_INF
+#cmakedefine CPPUTEST_NO_NAN

 #cmakedefine CPPUTEST_STD_C_LIB_DISABLED
 #cmakedefine CPPUTEST_STD_CPP_LIB_DISABLED


Fix other check

Fix other check

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

--- config.h.cmake
+++ config.h.cmake
@@ -59,7 +59,7 @@
 #cmakedefine HAVE_FCNTL_H 1

 /* Define if you have getdomainname */
-#define HAVE_GETDOMAINNAME 1
+#cmakedefine HAVE_GETDOMAINNAME 1

 /* Define if you have the getdomainname prototype */
 #cmakedefine HAVE_GETDOMAINNAME_PROTO 1


[config.h] handle ENABLE_ALUGRID

[config.h] handle ENABLE_ALUGRID

--- config.h.cmake
+++ config.h.cmake
@@ -122,6 +122,10 @@
 # define HAVE_GRAPE 0
 #endif

+#ifndef ENABLE_ALUGRID
+# define ENABLE_ALUGRID 0
+#endif
+
 /*** End: Silence implicitly False evaluation of undefined macro warnings ****/

 /* end dune-stuff */


Change version number to 1.0.5

Change version number to 1.0.5

--- Projects/velodyneviewer.bundle.common.cmake
+++ Projects/velodyneviewer.bundle.common.cmake
@@ -2,7 +2,7 @@
 # configure stage.
 set (vv_version_major 1)
 set (vv_version_minor 0)
-set (vv_version_patch 4)
+set (vv_version_patch 5)
 set (vv_version_suffix)
 set (vv_version "${vv_version_major}.${vv_version_minor}")


Update CompileOption - Use warning all and error

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -66,7 +66,7 @@
 	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
 		/MP           # -> build with multiple processes
 		/W4           # -> warning level 3
-		# /WX         # -> treat warnings as errors
+		/WX           # -> treat warnings as errors

 		# /wd4251     # -> disable warning: 'identifier': class 'type' needs to have dll-interface to be used by clients of class 'type2'
 		# /wd4592     # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
@@ -93,7 +93,8 @@
 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
 		-Wall
-		# -Werror
+		-Wno-missing-braces
+		-Werror
 		-std=c++1z
 	)
 endif ()


fix: Rename Hearthstonepp to RosettaStone

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -3,8 +3,8 @@
 #

 # Set warnings as errors flag
-option(HEARTHSTONEPP_WARNINGS_AS_ERRORS "Treat all warnings as errors" ON)
-if(HEARTHSTONEPP_WARNINGS_AS_ERRORS)
+option(ROSETTASTONE_WARNINGS_AS_ERRORS "Treat all warnings as errors" ON)
+if(ROSETTASTONE_WARNINGS_AS_ERRORS)
 	if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
 		set(WARN_AS_ERROR_FLAGS	"/WX")
 	else()


New parameter in MITK_CREATE_MODULE: WARNINGS_AS_ERRORS

This enables "treat warnings as errors" compiler switches for this module.

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -17,6 +17,7 @@
 #!     [EXPORT_DEFINE <declspec macro name for dll exports>]
 #!     [QT_MODULE]
 #!     [HEADERS_ONLY]
+#!     [WARNINGS_AS_ERRORS]
 #! \endcode
 #!
 #! \param MODULE_NAME_IN The name for the new module
@@ -25,7 +26,7 @@
 macro(MITK_CREATE_MODULE MODULE_NAME_IN)
   MACRO_PARSE_ARGUMENTS(MODULE
                         "SUBPROJECTS;VERSION;INCLUDE_DIRS;INTERNAL_INCLUDE_DIRS;DEPENDS;DEPENDS_INTERNAL;PACKAGE_DEPENDS;TARGET_DEPENDS;EXPORT_DEFINE;ADDITIONAL_LIBS;GENERATED_CPP"
-                        "QT_MODULE;FORCE_STATIC;HEADERS_ONLY;GCC_DEFAULT_VISIBILITY;NO_INIT"
+                        "QT_MODULE;FORCE_STATIC;HEADERS_ONLY;GCC_DEFAULT_VISIBILITY;NO_INIT;WARNINGS_AS_ERRORS"
                         ${ARGN})

   set(MODULE_NAME ${MODULE_NAME_IN})
@@ -136,6 +137,14 @@
             endif()
           endif()

+          if(MODULE_WARNINGS_AS_ERRORS)
+            if(MSVC_VERSION)
+              mitkFunctionCheckCompilerFlags("/WX" module_compile_flags)
+            else()
+              mitkFunctionCheckCompilerFlags("-Werror" module_compile_flags)
+            endif()
+          endif(MODULE_WARNINGS_AS_ERRORS)
+
           if(NOT MODULE_NO_INIT)
             list(APPEND CPP_FILES ${module_init_src_file})
           endif()


COMP: no Wrappers/CommandLine dir in install tree

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -291,12 +291,6 @@
   Utilities/otbconfigfile
 )

-# For CommandLine wrappers
-IF(BUILD_APPLICATIONS)
-  SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
-    Wrappers/CommandLine )
-ENDIF(BUILD_APPLICATIONS)
-
 #For BOOST header file
 IF(OTB_USE_EXTERNAL_BOOST)
   SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}


COMP: wrong condition in cmake for include dirs

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -84,7 +84,7 @@
 IF(OTB_USE_EXTERNAL_TINYXML)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${TINYXML_INCLUDE_DIR})
-ELSEIF(OTB_USE_EXTERNAL_TINYXML)
+ELSE(OTB_USE_EXTERNAL_TINYXML)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${OTB_SOURCE_DIR}/Utilities/tinyXMLlib)
 ENDIF(OTB_USE_EXTERNAL_TINYXML)
@@ -92,7 +92,7 @@
 IF(OTB_USE_EXTERNAL_MUPARSER)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${MUPARSER_INCLUDE_DIR})
-ELSEIF(OTB_USE_EXTERNAL_MUPARSER)
+ELSE(OTB_USE_EXTERNAL_MUPARSER)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${OTB_SOURCE_DIR}/Utilities/otbmuparser)
 ENDIF(OTB_USE_EXTERNAL_MUPARSER)
@@ -100,7 +100,7 @@
 IF(OTB_USE_EXTERNAL_LIBKML)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${LIBKML_INCLUDE_DIRS})
-ELSEIF(OTB_USE_EXTERNAL_LIBKML)
+ELSE(OTB_USE_EXTERNAL_LIBKML)
   SET(OTB_INCLUDE_DIRS_BUILD_TREE ${OTB_INCLUDE_DIRS_BUILD_TREE}
       ${OTB_SOURCE_DIR}/Utilities/otbkml/src)
 ENDIF(OTB_USE_EXTERNAL_LIBKML)


r11345/sofa : FIX Flexible test compilation

Former-commit-id: 12704d7e40ea9d2a3f73af5379a982866d40ca3a

--- applications/plugins/Flexible/Flexible_test/scenes/python/python.cmake
+++ applications/plugins/Flexible/Flexible_test/scenes/python/python.cmake
@@ -1,4 +1,3 @@
 set(PYTHON_FILES
     scenes/python/reInitMapping.py
-    scenes/python/evaluateShapeFunction.py
 )


Include ProjectInfo at initialization time.

	* build-aux/cmake/modules/Init.cmake: Here.

--- build-aux/cmake/modules/Init.cmake
+++ build-aux/cmake/modules/Init.cmake
@@ -18,6 +18,7 @@
 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE)
 enable_testing()
 include(Tools)
+include(ProjectInfo)
 hostname(BUILDER_HOSTNAME)
 set(BUILDFARM $ENV{BUILDFARM})
 include(GenLibLoader)


Fix ALPN detection logic (for non-portable shim builds) (#32956)

--- src/Native/Unix/System.Security.Cryptography.Native/configure.cmake
+++ src/Native/Unix/System.Security.Cryptography.Native/configure.cmake
@@ -2,7 +2,7 @@
 include(CheckFunctionExists)

 set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
-set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
+set(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY} ${OPENSSL_SSL_LIBRARY})

 check_function_exists(
     EC_GF2m_simple_method


Added more information to README.cmake - how to get a list of possible interfaces.

--- README.cmake
+++ README.cmake
@@ -1,7 +1,11 @@
+# getting a list of possible interfaces to enable:
+grep -E "OPTION.*(Modular|Static)" CMakeLists.txt
+
+
 # setup cmake for developers (debugging symbols on, optimization off, etc.):
 mkdir build-debug
 cd build-debug
-cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX="$BUILDDIR/install" ..
+cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_TESTING=ON -DTRACE_MEMORY_ALLOCS=OFF -DPythonModular=ON -DCMAKE_INSTALL_PREFIX="$BUILDDIR/install" ..

 # setup cmake for building the final binaries (debugging off, optimization on):


Revert "Remove bogus dependencies in syscall lib cmake file."

This reverts commit 94de49626df388d2abbb89f98162e346a0e995f3.

This change caused the standard universe tests to start failing in
the batlab.

--- build/cmake/macros/CondorStdExeTest.cmake
+++ build/cmake/macros/CondorStdExeTest.cmake
@@ -36,14 +36,14 @@

 		#here is where cmake is not so good you can not easily access the object files :-( so rip them out
 		command_target( arx_${_CNDR_TARGET} ar "-x;lib${_CNDR_TARGET}.a" "${objs_${_CNDR_TARGET}}")
-		add_dependencies( arx_${_CNDR_TARGET} ${_CNDR_TARGET} )
+		add_dependencies( arx_${_CNDR_TARGET} ${_CNDR_TARGET} ${_SRCS})

 		# call condor compile, you will need to verify that make install has passed.
 		command_target( cc_${_CNDR_TARGET} ${CONDOR_COMPILE} "-condor_lib;${STDU_LIB_LOC};-condor_ld_dir;${STDU_LIB_LOC};${_COMPILER};-o;${CMAKE_CURRENT_BINARY_DIR}/${_CNDR_TARGET}.cndr.exe;${objs_${_CNDR_TARGET}};${_LINK_FLAGS}" "${CMAKE_CURRENT_BINARY_DIR}/${_CNDR_TARGET}.cndr.exe" )
-		add_dependencies( cc_${_CNDR_TARGET} arx_${_CNDR_TARGET} )
+		add_dependencies( cc_${_CNDR_TARGET} arx_${_CNDR_TARGET} ${_SRCS})

 		command_target( ca_${_CNDR_TARGET} ${CONDOR_ARCH_LINK} "${_CNDR_TARGET}.cndr.exe" "${CMAKE_CURRENT_BINARY_DIR}/${_CNDR_TARGET}.cndr.exe.LINUX.INTEL")
-		add_dependencies( ca_${_CNDR_TARGET} cc_${_CNDR_TARGET} )
+		add_dependencies( ca_${_CNDR_TARGET} cc_${_CNDR_TARGET} ${_SRCS})

 		append_var(CONDOR_TESTS ca_${_CNDR_TARGET})
 		set_target_properties( cc_${_CNDR_TARGET} ca_${_CNDR_TARGET} arx_${_CNDR_TARGET} PROPERTIES EXCLUDE_FROM_ALL TRUE)


[cmake] Use custom command for copying files

The CMake `file(COPY` will only copy files during the initial
configuration, so changes in the headers of CF will not be propagated to
the build directory and will make for confussing compilation errors.

Using custom commands should keep the dependencies between files
correctly updated and Ninja should copy the modified headers during each
build if necessary.

--- CoreFoundation/cmake/modules/CoreFoundationAddFramework.cmake
+++ CoreFoundation/cmake/modules/CoreFoundationAddFramework.cmake
@@ -22,24 +22,32 @@
          NO_SOURCE_PERMISSIONS)
   endif()
   if(AF_PUBLIC_HEADERS)
-    file(COPY
-           ${AF_PUBLIC_HEADERS}
-         DESTINATION
-           ${CMAKE_BINARY_DIR}/${NAME}.framework/Headers
-         NO_SOURCE_PERMISSIONS)
+    foreach(HEADER IN LISTS AF_PUBLIC_HEADERS)
+      get_filename_component(HEADER_FILENAME ${HEADER} NAME)
+      set(DEST ${CMAKE_BINARY_DIR}/${NAME}.framework/Headers/${HEADER_FILENAME})
+      add_custom_command(OUTPUT ${DEST}
+                         DEPENDS ${HEADER}
+                         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                         COMMAND ${CMAKE_COMMAND} -E copy ${HEADER} ${DEST})
+      list(APPEND PUBLIC_HEADER_PATHS ${DEST})
+    endforeach()
   endif()
   if(AF_PRIVATE_HEADERS)
-    file(COPY
-           ${AF_PRIVATE_HEADERS}
-         DESTINATION
-           ${CMAKE_BINARY_DIR}/${NAME}.framework/PrivateHeaders
-         NO_SOURCE_PERMISSIONS)
+    foreach(HEADER IN LISTS AF_PRIVATE_HEADERS)
+      get_filename_component(HEADER_FILENAME ${HEADER} NAME)
+      set(DEST ${CMAKE_BINARY_DIR}/${NAME}.framework/PrivateHeaders/${HEADER_FILENAME})
+      add_custom_command(OUTPUT ${DEST}
+                         DEPENDS ${HEADER}
+                         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                         COMMAND ${CMAKE_COMMAND} -E copy ${HEADER} ${DEST})
+      list(APPEND PRIVATE_HEADER_PATHS ${DEST})
+    endforeach()
   endif()
   add_custom_target(${NAME}_POPULATE_HEADERS
                     DEPENDS
                       ${AF_MODULE_MAP}
-                      ${AF_PUBLIC_HEADERS}
-                      ${AF_PRIVATE_HEADERS}
+                      ${PUBLIC_HEADER_PATHS}
+                      ${PRIVATE_HEADER_PATHS}
                     SOURCES
                       ${AF_MODULE_MAP}
                       ${AF_PUBLIC_HEADERS}


[t:4871] change cdash site name to be user@host

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@43559 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCTest.cmake
+++ cmake_modules/TokuSetupCTest.cmake
@@ -45,6 +45,23 @@
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 endmacro(uname)

+## gives the current username
+macro(whoami out)
+  execute_process(
+    COMMAND whoami
+    OUTPUT_VARIABLE ${out}
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+endmacro(whoami)
+
+## gives the current hostname, minus .tokutek.com if it's there
+macro(hostname out)
+  execute_process(
+    COMMAND hostname
+    OUTPUT_VARIABLE fullhostname
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(REGEX REPLACE "\\.tokutek\\.com$" "" ${out} ${fullhostname})
+endmacro(hostname)
+
 ## determines the current revision of ${svn_dir}
 macro(get_svn_revision svn_dir out)
   find_program(CMAKE_SVN_PROG svn)
@@ -88,7 +105,11 @@
 get_svn_revision("${CMAKE_CURRENT_SOURCE_DIR}" svn_revision)  ## unused since it confuses cdash about history
 get_svn_wc_status("${CMAKE_CURRENT_SOURCE_DIR}" wc_status)    ## unused since it confuses cdash about history
 get_filename_component(branchname "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
+hostname(host)
+whoami(user)

+## construct SITE, seems to have to happen before include(CTest)
+set(SITE "${user}@${host}")
 ## construct BUILDNAME, seems to have to happen before include(CTest)
 set(BUILDNAME "${branchname} ${CMAKE_BUILD_TYPE} ${CMAKE_SYSTEM} ${machine_type} ${CMAKE_C_COMPILER_ID} ${real_c_compiler} ${CMAKE_C_COMPILER_VERSION}" CACHE STRING "CTest build name" FORCE)


cmake/FindIconvCapabilities.cmake: take into account same charset capability when testing //IGNORE and //TRANSLIT [ci skip]

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

 #
 # Just to be sure, we do not limit the calls to iconv_open, but do the full thing
-# Input is FORCED to be UTF-8 in any case. Caller have the choice of destination charset
-# and have to provide TWO TRAILING BYTES.
+# Input is FORCED to start with valid UTF-8, but invalid ASCII in any case.
+# Caller have the choice of destination charset and have to provide TWO TRAILING BYTES.
 #
-MACRO(_FINDICONVCAPABILITY tocharset outputvariable twobytes)
+MACRO(_FINDICONVCAPABILITY tocharset fromcharset outputvariable twobytes)
   include(CheckCSourceRuns)
   SET (CMAKE_REQUIRED_INCLUDES_PREVIOUS ${CMAKE_REQUIRED_INCLUDES})
   SET (CMAKE_REQUIRED_LIBRARIES_PREVIOUS ${CMAKE_REQUIRED_LIBRARIES})
@@ -40,7 +40,7 @@
     size_t   outl = 1024;                           /* 1024 bytes available in output buffer */

     memset((void *) dst, '\\\\0', 1024);
-    conv = iconv_open(\"${tocharset}\", \"UTF-8\");
+    conv = iconv_open(\"${tocharset}\", \"${fromcharset}\");
     if (conv == (iconv_t)-1) { perror(\"iconv_open\"); return 1; }
     if (iconv(conv, &inp, &inl, &outp, &outl) == (size_t)-1)  { perror(\"iconv\"); return 1; }
     /* Flush */
@@ -67,11 +67,16 @@
 SET (TWO_UTF8_BYTES_OK "\"!!\"")
 SET (TWO_UTF8_BYTES_KO "\"\\\\\\\\xa0\\\\\\\\xa1\"")

-_FINDICONVCAPABILITY("UTF-8"           ICONV_CAN_SAME_CHARSETS      ${TWO_UTF8_BYTES_OK})
-_FINDICONVCAPABILITY("ASCII//TRANSLIT" ICONV_CAN_TRANSLIT           ${TWO_UTF8_BYTES_OK})
-_FINDICONVCAPABILITY("ASCII"           ICONV_WITHOUT_TRANSLIT_IS_OK ${TWO_UTF8_BYTES_OK})
-_FINDICONVCAPABILITY("ASCII//IGNORE"   ICONV_CAN_IGNORE             ${TWO_UTF8_BYTES_KO})
-_FINDICONVCAPABILITY("ASCII"           ICONV_WITHOUT_IGNORE_IS_OK   ${TWO_UTF8_BYTES_KO})
+_FINDICONVCAPABILITY("UTF-8"           "UTF-8" ICONV_CAN_SAME_CHARSETS      ${TWO_UTF8_BYTES_OK})
+_FINDICONVCAPABILITY("ASCII//TRANSLIT" "UTF-8" ICONV_CAN_TRANSLIT           ${TWO_UTF8_BYTES_OK})
+_FINDICONVCAPABILITY("ASCII"           "UTF-8" ICONV_WITHOUT_TRANSLIT_IS_OK ${TWO_UTF8_BYTES_OK})
+IF (ICONV_CAN_SAME_CHARSETS)
+  _FINDICONVCAPABILITY("ASCII//IGNORE"   "ASCII" ICONV_CAN_IGNORE             ${TWO_UTF8_BYTES_KO})
+  _FINDICONVCAPABILITY("ASCII"           "ASCII" ICONV_WITHOUT_IGNORE_IS_OK   ${TWO_UTF8_BYTES_KO})
+ELSE ()
+  _FINDICONVCAPABILITY("ASCII//IGNORE"   "UTF-8" ICONV_CAN_IGNORE             ${TWO_UTF8_BYTES_KO})
+  _FINDICONVCAPABILITY("ASCII"           "UTF-8" ICONV_WITHOUT_IGNORE_IS_OK   ${TWO_UTF8_BYTES_KO})
+ENDIF ()

 IF (NOT ICONV_CAN_SAME_CHARSETS)
   MESSAGE (WARNING "When input and destination charsets are equivalent, they will NOT be checked and fuzzy conversion will happen")


Don't overwrite configured __init__.py with original

--- cmake/Modules/LibPKMNPython.cmake
+++ cmake/Modules/LibPKMNPython.cmake
@@ -96,8 +96,10 @@
         ${CMAKE_CURRENT_BINARY_DIR}/__init__.py
     @ONLY)

-    FILE(GLOB py_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.py")
-    LIST(APPEND py_files ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.py)
+    SET(py_files
+        ${CMAKE_CURRENT_BINARY_DIR}/__init__.py
+        ${CMAKE_CURRENT_BINARY_DIR}/${module_name}.py
+    )

     INSTALL(
         FILES ${py_files}


Update OpenCVCompilerOptions.cmake

Update OpenCVCompilerOptions.cmake

misplaced else

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -18,9 +18,9 @@
         message(STATUS "Unable to compile program with enabled ccache, reverting...")
         set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${__OLD_RULE_LAUNCH_COMPILE}")
       endif()
-    else()
-      message(STATUS "Looking for ccache - not found")
     endif()
+  else()
+    message(STATUS "Looking for ccache - not found")
   endif()
 endif()


[CMake][Fuchsia] Disable modules for the second stage build

This made the toolchain build 50% slower.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@351415 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -9,7 +9,6 @@
   set(LLVM_ENABLE_LLD ON CACHE BOOL "")
 endif()
 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
-set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
 set(LLVM_ENABLE_TERMINFO OFF CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")


Fix typo that CMake 3 complained about.

Fix typo that CMake 3 complained about.

--- cmake/modules/AddGTestSuite.cmake
+++ cmake/modules/AddGTestSuite.cmake
@@ -21,6 +21,6 @@
     # Setup lit configuration
     configure_file(${CMAKE_SOURCE_DIR}/tests/lit-unit-tests-common.site.cfg.in
                    ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-                   @ONLY@
+                   @ONLY
                   )
 endmacro()


Remove "-c" from dict generation with rootcling as it is ignored.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -334,7 +334,7 @@
   #---call rootcint------------------------------------------
   add_custom_command(OUTPUT ${dictionary}.cxx ${pcm_name} ${rootmap_name}
                      COMMAND ${command} -f  ${dictionary}.cxx ${newargs} ${rootmapargs}
-                                        -c ${ARG_OPTIONS} ${definitions} ${includedirs} ${rheaderfiles} ${_linkdef}
+                                        ${ARG_OPTIONS} ${definitions} ${includedirs} ${rheaderfiles} ${_linkdef}
                      DEPENDS ${headerfiles} ${_linkdef} ${ROOTCINTDEP})
   get_filename_component(dictname ${dictionary} NAME)


Add ROOT_ADD_PYUNITTEST and ROOT_ADD_PYUNITTESTS functions to the CMake code

in order to make even easier to test python code in source.
The rationale behind the two function is:
- Use ROOT_ADD_PYUNITTESTS(testName) to add all tests in all *py files in the current directory
- Use ROOT_ADD_PYUNITTEST(testName my/path/to/mytests.py) to add all tests in my/path/to/mytests.py

The latter option allows to parallelise the execution of the tests.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -242,7 +242,7 @@
           list(APPEND _list_of_header_dependencies ${f})
         endif()
       endforeach()
-    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
+    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
            EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${fp}) # only for ROOT project
       list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
       list(APPEND _list_of_header_dependencies ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
@@ -261,7 +261,7 @@
       unset(headerFile CACHE)
     endif()
   endforeach()
-  string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/inc/" ""  headerfiles "${headerfiles}")
+  string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/inc/" ""  headerfiles "${headerfiles}")
   # Replace the non-standard folder layout of Core.
   if (ARG_STAGE1 AND ARG_MODULE STREQUAL "Core")
     # FIXME: Glob these folders.
@@ -805,7 +805,7 @@
     ROOT_GLOB_FILES(include_files
       RECURSE
       RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${d}
-      FILTER ${filter}
+      FILTER ${filter}
       ${d}/*.h ${d}/*.hxx ${d}/*.icc )
     foreach (include_file ${include_files})
       set (src ${CMAKE_CURRENT_SOURCE_DIR}/${d}/${include_file})
@@ -815,7 +815,7 @@
         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${dst}
         COMMENT "Copying header ${src} to /include"
         DEPENDS ${src})
-      list(APPEND dst_list ${dst})
+      list(APPEND dst_list ${dst})
     endforeach()
     set_property(GLOBAL APPEND PROPERTY ROOT_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/${d})
   endforeach()
@@ -1236,7 +1236,7 @@
 function(ROOT_ADD_GTEST test_suite)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LIBRARIES" ${ARGN})
   include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR})
-
+
   ROOT_GET_SOURCES(source_files . ${ARG_UNPARSED_ARGUMENTS})
   # Note we cannot use ROOT_EXECUTABLE without user-specified set of LIBRARIES to link with.
   # The test suites should choose this in their specific CMakeLists.txt file.
@@ -1258,6 +1258,36 @@
 function(ROOT_ADD_TEST_SUBDIRECTORY subdir)
   file(RELATIVE_PATH subdir ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${subdir})
   set_property(GLOBAL APPEND PROPERTY ROOT_TEST_SUBDIRS ${subdir})
+endfunction()
+
+#----------------------------------------------------------------------------
+# ROOT_ADD_PYUNITTESTS( <name> )
+#----------------------------------------------------------------------------
+function(ROOT_ADD_PYUNITTESTS name)
+  set(ROOT_ENV ROOTSYS=${ROOTSYS}
+      PATH=${ROOTSYS}/bin:$ENV{PATH}
+      LD_LIBRARY_PATH=${ROOTSYS}/lib:$ENV{LD_LIBRARY_PATH}
+      PYTHONPATH=${ROOTSYS}/lib:$ENV{PYTHONPATH})
+  string(REGEX REPLACE "[_]" "-" good_name "${name}")
+  ROOT_ADD_TEST(pyunittests-${good_name}
+                COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR} -p "*.py" -v
+                ENVIRONMENT ${ROOT_ENV})
+endfunction()
+
+#----------------------------------------------------------------------------
+# ROOT_ADD_PYUNITTEST( <name> <file>)
+#----------------------------------------------------------------------------
+function(ROOT_ADD_PYUNITTEST name file)
+  set(ROOT_ENV ROOTSYS=${ROOTSYS}
+      PATH=${ROOTSYS}/bin:$ENV{PATH}
+      LD_LIBRARY_PATH=${ROOTSYS}/lib:$ENV{LD_LIBRARY_PATH}
+      PYTHONPATH=${ROOTSYS}/lib:$ENV{PYTHONPATH})
+  string(REGEX REPLACE "[_]" "-" good_name "${name}")
+  get_filename_component(file_name ${file} NAME)
+  get_filename_component(file_dir ${file} DIRECTORY)
+  ROOT_ADD_TEST(pyunittests-${good_name}
+                COMMAND ${PYTHON_EXECUTABLE} -m unittest discover -s ${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} -p ${file_name} -v
+                ENVIRONMENT ${ROOT_ENV})
 endfunction()

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


Correctly escape CMake regex

Correctly escape CMake regex

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -499,7 +499,7 @@
   foreach(header ${found_headers})
     #message (STATUS "header: ${header}")
     set(textual_header "")
-    if (${header} MATCHES ".*\.icc$")
+    if (${header} MATCHES ".*\\.icc$")
       set(textual_header "textual ")
     endif()
     if (NOT ${excluded_headers} MATCHES ${header})


[cmake] Dict depends on libs only for modules:

General rootcling does not need to regenerate dictionaries if dependent libraries
(or their dictionaries) are out of date. Modules, however, will need underlying
modules to be created first. We use "library" as a replacement for that, as not all
dependent dictionary targets are available for depending dictionaries.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -413,12 +413,16 @@
     list(APPEND _implicitdeps CXX ${_dep})
   endforeach()

+  if(ARG_MODULE)
+    set(MODULE_LIB_DEPENDENCY ${ARG_DEPENDENCIES})
+  endif()
+
   #---call rootcint------------------------------------------
   add_custom_command(OUTPUT ${dictionary}.cxx ${pcm_name} ${rootmap_name} ${cpp_module_file}
                      COMMAND ${command} -v2 -f  ${dictionary}.cxx ${newargs} ${excludepathsargs} ${rootmapargs}
                                         ${definitions} ${includedirs} ${ARG_OPTIONS} ${headerfiles} ${_linkdef}
                      IMPLICIT_DEPENDS ${_implicitdeps}
-                     DEPENDS ${_list_of_header_dependencies} ${_linkdef} ${ROOTCINTDEP} ${ARG_DEPENDENCIES})
+                     DEPENDS ${_list_of_header_dependencies} ${_linkdef} ${ROOTCINTDEP} ${MODULE_LIB_DEPENDENCY})
   get_filename_component(dictname ${dictionary} NAME)

   #---roottest compability


cmake: add nice comment

cmake: add nice comment

--- cmake/qibuild/compat/compat.cmake
+++ cmake/qibuild/compat/compat.cmake
@@ -212,6 +212,7 @@
   endif()

+  # Last case: user-defined .cmake module file.
   qi_deprecated("use() is deprecated
    Simply use find_package() instead.
   Old:


Increased the timeout for the package testwq

--- CMake/mitkTestPluginGenerator.cmake
+++ CMake/mitkTestPluginGenerator.cmake
@@ -67,14 +67,14 @@
                COMMAND ${CMAKE_COMMAND} --build ${test_project_binary_dir}/${proj}-build --config Release --target package)
       set_tests_properties(mitkPluginGeneratorPackageTest PROPERTIES
                            DEPENDS mitkPluginGeneratorBuildTest-Release
-                           TIMEOUT 1200
+                           TIMEOUT 1800
                            LABELS "MITK;BlueBerry")
     elseif(CMAKE_BUILD_TYPE)
       add_test(mitkPluginGeneratorPackageTest
                ${CMAKE_COMMAND} --build ${test_project_binary_dir}/${proj}-build --config ${CMAKE_BUILD_TYPE} --target package)
       set_tests_properties(mitkPluginGeneratorPackageTest PROPERTIES
                            DEPENDS mitkPluginGeneratorBuildTest-${CMAKE_BUILD_TYPE}
-                           TIMEOUT 1200
+                           TIMEOUT 1800
                            LABELS "MITK;BlueBerry")
     endif()


Find uic and rcc on openSUSE

Find uic and rcc on openSUSE

openSUSE (and most likely other distributions) is renaming uic and rcc
to avoid file conflicts with Qt4.

Prefer these if they exist

--- cMake/FindPySide2Tools.cmake
+++ cMake/FindPySide2Tools.cmake
@@ -33,9 +33,9 @@
   set(RCCOPTIONS "")
 ELSE(Qt5Core_VERSION VERSION_LESS 5.14)
   # New (>= 5.14)
-  FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic)
+  FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic-qt5 uic)
   set(UICOPTIONS "--generator=python")
-  FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc)
+  FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc-qt5 rcc)
   set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
 ENDIF(Qt5Core_VERSION VERSION_LESS 5.14)


update mimalloc build version

update mimalloc build version

--- cmake/mimalloc-config-version.cmake
+++ cmake/mimalloc-config-version.cmake
@@ -1,5 +1,5 @@
 set(mi_version_major 1)
-set(mi_version_minor 0)
+set(mi_version_minor 1)
 set(mi_version ${mi_version_major}.${mi_version_minor})

 set(PACKAGE_VERSION ${mi_version})


qtutils: export to cache or value are lost!

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

--- cmake/qibuild/modules/qtutils.cmake
+++ cmake/qibuild/modules/qtutils.cmake
@@ -14,10 +14,12 @@
     # Use upstream cmake files
     find_package(Qt4 COMPONENTS ${_libname} REQUIRED)
     include("${QT_USE_FILE}")
-    set(QT_${_suffix}_INCLUDE_DIRS ${QT_INCLUDE_DIR} PARENT_SCOPE)
-    set(QT_${_suffix}_LIBRARIES    ${QT_LIBRARIES}   PARENT_SCOPE)
+    qi_append_uniq_global(QT_${_suffix}_INCLUDE_DIRS "${QT_${_suffix}_INCLUDE_DIR}")
+    qi_append_uniq_global(QT_${_suffix}_INCLUDE_DIRS "${QT_INCLUDE_DIR}")
+    qi_append_uniq_global(QT_${_suffix}_LIBRARIES    "${QT_LIBRARIES}")
     return()
   endif()
+

   flib(QT_${_suffix} OPTIMIZED NAMES "${_libame}" "${_libame}4"  PATH_SUFFIXES qt4)
   flib(QT_${_suffix} DEBUG     NAMES "${_libame}" "${_libame}d4" PATH_SUFFIXES qt4)


Raised minimum boost to 1.53 a few checkins ago, but forgot this check.

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -130,7 +130,7 @@
     # Boost_VERSION, Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES.
 else ()
     set (Boost_COMPONENTS filesystem regex system thread)
-    find_package (Boost 1.50 REQUIRED
+    find_package (Boost 1.53 REQUIRED
                   COMPONENTS ${Boost_COMPONENTS}
                  )


Fix linker error with newer OIIO

Fix linker error with newer OIIO

The define OIIO uses to link statically has changed
in the newer versions of OIIO. We define both symbols
for maximum compatibility.

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -94,7 +94,11 @@
 	# of OpenImageIO and GL*, otherwise linker will try to use
 	# dynamic one which we don't have and don't want even.
 	add_definitions(
+		# OIIO changed the name of this define in newer versions
+		# we define both, so it would work with both old and new
+		# versions.
 		-DOIIO_STATIC_BUILD
+		-DOIIO_STATIC_DEFINE
 		-DGLEW_STATIC
 		-DFREEGLUT_STATIC
 		-DFREEGLUT_LIB_PRAGMAS=0


Find glew precompiled libs on Mac OS.

Find glew precompiled libs on Mac OS.

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -17,7 +17,7 @@
 elseif(WIN32)
 	if(NOT MSVC12 OR NOT CMAKE_CL_64)
 		# TODO(sergey): Would be cool to support GCC/CLang as well.
-		message(FATAL_ERROR "Currently only MSVC 2012 64bit is supported")
+		message(FATAL_ERROR "Currently only Visual Studio 2013 64bit is supported")
 	endif()
 	set(_lib_DIR "${CMAKE_SOURCE_DIR}/../lib/win64_vc12")
 endif()
@@ -42,6 +42,9 @@
 	# Precompiled PNG library depends on ZLib.
 	find_package(ZLIB REQUIRED)
 	list(APPEND PLATFORM_LINKLIBS ${ZLIB_LIBRARIES})
+
+	# Glew
+	_set_default(GLEW_ROOT_DIR "${_lib_DIR}/glew")
 elseif(MSVC)
 	# TODO(sergey): On Windows llvm-config doesn't give proper results for the
 	# library names, use hardcoded libraries for now.


chore(CMake)!: Drop support for MariaDB 10.1

BREAKING CHANGE: Building with MariaDB 10.1 will no longer be supported since we use code that exceeds its limits

--- src/cmake/macros/FindMySQL.cmake
+++ src/cmake/macros/FindMySQL.cmake
@@ -28,7 +28,7 @@
 # Find MariaDB for Windows
 if (WIN32)
   # Set know versions MariaDB
-  set(_MARIADB_KNOWN_VERSIONS "MariaDB 10.4" "MariaDB 10.3" "MariaDB 10.2" "MariaDB 10.1")
+  set(_MARIADB_KNOWN_VERSIONS "MariaDB 10.4" "MariaDB 10.3" "MariaDB 10.2")

   # Set default oprions
   set(MARIADB_FOUND_LIB 0)


edited FreeGLUT cmake find to work better on Mac OSX

--- plugins/FREEGLUT/cmake/FindFreeGLUT.cmake
+++ plugins/FREEGLUT/cmake/FindFreeGLUT.cmake
@@ -15,35 +15,40 @@
 #  FREEGLUT_LIBRARIES    - List of libraries when using FreeGLUT.
 #  FREEGLUT_FOUND        - True if FreeGLUT found.

+# Hack: On OSX, this makes sure *not* to use the Glut files that come
+# with the system.  These appear not to be the same freeglut that we
+# are counting on.
+set(CMAKE_FIND_FRAMEWORK "NEVER")
+
 # Look for the header file.
 FIND_PATH(FREEGLUT_INCLUDE_DIR
-          NAMES GL/freeglut.h
-	  HINTS
-	  ENV CPATH # For OSCAR modules at Brown/CCV
-	  )
+  NAMES GL/freeglut.h
+	HINTS
+	ENV CPATH # For OSCAR modules at Brown/CCV
+  /usr/local/Cellar/freeglut/2.8.1/include # This is how it comes with Brew.
+  /usr/local/Cellar/freeglut/3.0.0/include # This another way it comes with Brew.
+	)

 # Look for the library.
 FIND_LIBRARY(FREEGLUT_LIBRARY
-             NAMES glut
-	     HINTS
-	     ENV LD_LIBRARY_PATH # For OSCAR modules at Brown/CCV
-	     )
+  NAMES glut
+	HINTS
+	ENV LD_LIBRARY_PATH # For OSCAR modules at Brown/CCV
+  /usr/local/Cellar/freeglut/2.8.1/lib/libglut.3.dylib # Brew version.
+  /usr/local/Cellar/freeglut/3.0.0/lib/libglut.3.dylib # Another Brew version.
+	)

-# Handle the QUIETLY and REQUIRED arguments and set FREEGLUT_FOUND to TRUE if all listed variables are TRUE.
+# Undo the above hack.
+set(CMAKE_FIND_FRAMEWORK)
+
+# Handle the QUIETLY and REQUIRED arguments and set FREEGLUT_FOUND to
+# TRUE if all listed variables are TRUE.
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(
   FREEGLUT
   DEFAULT_MSG
   FREEGLUT_LIBRARY
   FREEGLUT_INCLUDE_DIR)
-
-# If you're using a Brew version of FreeGLUT, these might work.  Too specific
-# to add into a hint for FIND_LIBRARY or FIND_PATH.
-#set(FREEGLUT_INCLUDE_DIR /usr/local/Cellar/freeglut/2.8.1/include)
-#set(FREEGLUT_LIBRARY /usr/local/Cellar/freeglut/2.8.1/lib/libglut.3.dylib)
-
-message("FreeGLUT library: " ${FREEGLUT_LIBRARY})
-message("FreeGLUT include: " ${FREEGLUT_INCLUDE_DIR})

 # Copy the results to the output variables.
 IF(FREEGLUT_FOUND)
@@ -52,6 +57,16 @@
 ELSE(FREEGLUT_FOUND)
 	SET(FREEGLUT_LIBRARIES)
 	SET(FREEGLUT_INCLUDE_DIRS)
+  message("You can specify the FreeGLUT paths with -DFREEGLUT_INCLUDE_DIR=/path")
+  message("and -DFREEGLUT_LIBRARY=/path/to/libglut")
+  message("Or set the variables in MinVR/plugins/FREEGLUT/FindFreeGLUT.cmake.")
 ENDIF(FREEGLUT_FOUND)

+## Uncomment and edit these lines for your machine if there seems to be no hope.
+## set(FREEGLUT_LIBRARIES /path/to/libglut)
+## set(FREEGLUT_INCLUDE_DIRS /path/to/freeglut/include/files)
+
+message("-- FreeGLUT libraries: " ${FREEGLUT_LIBRARIES})
+message("-- FreeGLUT includes:  " ${FREEGLUT_INCLUDE_DIRS})
+
 MARK_AS_ADVANCED(FREEGLUT_INCLUDE_DIRS FREEGLUT_LIBRARIES)


Fixed spelling of LAPACK vendor COPASI Dependencies.

--- cmake-set-dependencies.cmake
+++ cmake-set-dependencies.cmake
@@ -62,14 +62,21 @@
   # the default clapack uses the names 'lapack.lib' / 'blas.lib'
   set(CLAPACK_LIBRARY_LAPACK ${COPASI_DEPENDENCY_DIR}/lib/liblapack.lib)
   if (NOT EXISTS ${CLAPACK_LIBRARY_LAPACK})
-  set(CLAPACK_LIBRARY_LAPACK ${COPASI_DEPENDENCY_DIR}/lib/lapack.lib)
+    set(CLAPACK_LIBRARY_LAPACK ${COPASI_DEPENDENCY_DIR}/lib/lapack.lib)
   endif()
+
   set(CLAPACK_LIBRARY_BLAS ${COPASI_DEPENDENCY_DIR}/lib/libblas.lib)
   if (NOT EXISTS ${CLAPACK_LIBRARY_BLAS})
-  set(CLAPACK_LIBRARY_BLAS ${COPASI_DEPENDENCY_DIR}/lib/blas.lib)
+    set(CLAPACK_LIBRARY_BLAS ${COPASI_DEPENDENCY_DIR}/lib/blas.lib)
   endif()
+
+  set(CLAPACK_LIBRARY_F2C ${COPASI_DEPENDENCY_DIR}/lib/libf2c.lib)
+  if (NOT EXISTS ${CLAPACK_LIBRARY_F2C})
+    set(CLAPACK_LIBRARY_F2C ${COPASI_DEPENDENCY_DIR}/lib/f2c.lib)
+  endif()
+
   set (CLAPACK_LIBRARIES
-       ${CLAPACK_LIBRARY_LAPACK};${CLAPACK_LIBRARY_BLAS};${COPASI_DEPENDENCY_DIR}/lib/libf2c.lib
+       ${CLAPACK_LIBRARY_LAPACK};${CLAPACK_LIBRARY_BLAS};${CLAPACK_LIBRARY_F2C}s
        CACHE FILEPATH "lapack library" FORCE)

   add_definitions(-DHAVE_BLASWRAP_H)
@@ -170,7 +177,7 @@
   add_definitions(-DHAVE_CLAPACK_H)
   add_definitions(-DNO_BLAS_WRAP)

-  set (BLA_VENDOR "COPASI Dependecies")
+  set (BLA_VENDOR "COPASI Dependencies")
   set (CLAPACK_FOUND TRUE)
   mark_as_advanced(CLAPACK_INCLUDE_DIR CLAPACK_LIBRARIES)
 endif()


Fix bug in setting VS compiler flags.

Fix bug in setting VS compiler flags.

--- cmake/FindChronoEngine.cmake
+++ cmake/FindChronoEngine.cmake
@@ -72,11 +72,11 @@
         ADD_DEFINITIONS( "-D_SCL_SECURE_NO_DEPRECATE" )  # avoids deprecation warnings
     ENDIF(MSVC)
     IF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC")
-        SET (CH_BUILDFLAGS "-DWIN32; -DNOMINMAX; -MP")
+        SET (CH_BUILDFLAGS "-DWIN32 -DNOMINMAX -MP")
         SET (CH_LINKERFLAG_SHARED "/FORCE:MULTIPLE")
         SET(CPACK_SYSTEM_NAME "Win-x86")
     ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC_X64")
-        SET (CH_BUILDFLAGS "-DWIN64; -D_WIN64; -DNOMINMAX; -MP")
+        SET (CH_BUILDFLAGS "-DWIN64 -D_WIN64 -DNOMINMAX -MP")
         SET (CH_LINKERFLAG_SHARED "/FORCE:MULTIPLE")
         SET(CPACK_SYSTEM_NAME "Win-x64")
     ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_GCC")


Add missing include for FindPackageHandleStandardArgs

Don't know why I didn't hit this before. Perhaps it was always already ran at this point in the configuration.

--- cmake/FindPythonModule.cmake
+++ cmake/FindPythonModule.cmake
@@ -25,5 +25,6 @@
 	else(NOT PYTHON_${module_uppercase})
 		set(PYTHON_${module_uppercase}_FOUND TRUE PARENT_SCOPE)
 	endif(NOT PYTHON_${module_uppercase})
+	include(FindPackageHandleStandardArgs)
 	find_package_handle_standard_args(PYTHON_${module} DEFAULT_MSG PYTHON_${module_uppercase})
 endfunction(find_python_module)


cmake: add screen cmd detection error feedback

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -538,12 +538,14 @@
     if(INPUT_SERIAL)
         setup_serial_target(${INPUT_NAME} "${INPUT_SERIAL}" "${INPUT_PORT}")
     else()
-       if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
-           set(INPUT_SERIAL "screen")
-       elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+       if(CMAKE_HOST_UNIX)
+           find_program(SCREEN screen)
+           if(NOT SCREEN)
+               message(FATAL_ERROR "Please install screen!" )
+           endif()
            set(INPUT_SERIAL "screen")
        else()
-           message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} not supported yet." )
+           message(FATAL_ERROR "${CMAKE_HOST_SYSTEM_NAME} not supported yet!" )
        endif()

        if(INPUT_SERIAL)


catkin variable pointing at rosdep roots.

--- cmake/catkin_workspace.cmake
+++ cmake/catkin_workspace.cmake
@@ -12,13 +12,19 @@
   set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

-  foreach(path ${CMAKE_INCLUDE_PATH})
-    include_directories(${path})
+  # This is convenient when the platform has no 'system' path (e.g. windows).
+  set(CATKIN_ROSDEPS_PATH "" CACHE STRING "Semi-colon separated list of root directories to search for rosdeps.")
+  foreach(path ${CATKIN_ROSDEPS_PATH})
+    message(STATUS "Rosdep root search path added: ${path}")
+    # Help cmake's find_file and find_library
+    if (CMAKE_PREFIX_PATH)
+      set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${path}")
+    else()
+      set(CMAKE_PREFIX_PATH "${path}")
+    endif()
+    # CMAKE_PREFIX_PATH doesn't add it to the compile search path for includes.
+    include_directories(${path}/include)
   endforeach()
-  foreach(path ${CMAKE_PREFIX_PATH})
-    message(STATUS "Include directory added: ${path}/include")
-    include_directories(${path}/include)
-  endforeach()

   # libraries.cmake
   configure_shared_library_build_settings()


Remove unused FindSQLite3

Remove unused FindSQLite3

--- cmake/find/FindSQLite3.cmake
+++ cmake/find/FindSQLite3.cmake
@@ -1,67 +0,0 @@
-# ----------------------------------------------------------------------
-# FindSQLite3.cmake - SQLite3 CMake module
-#
-# Copyright (C) 2015 Alexandre Pretyman. All rights reserved.
-#
-# ----------------------------------------------------------------------
-
-if(NOT HUNTER_ENABLED)
-  macro(hunter_status_debug)
-    message(${ARGV})
-  endmacro()
-endif()
-
-hunter_status_debug("SQLITE3_ROOT: ${SQLITE3_ROOT}")
-
-find_path(
-    SQLITE3_INCLUDE_DIR
-      sqlite3.h
-    PATHS
-      "${SQLITE3_ROOT}/include"
-    NO_DEFAULT_PATH
-)
-
-hunter_status_debug("SQLITE3_INCLUDE_DIR: ${SQLITE3_INCLUDE_DIR}")
-
-find_library(
-    SQLITE3_LIBRARY
-      sqlite3
-    PATHS
-      "${SQLITE3_ROOT}/lib"
-    NO_DEFAULT_PATH
-)
-
-hunter_status_debug("SQLITE3_LIBRARY: ${SQLITE3_LIBRARY}")
-
-if(NOT TARGET "SQLite3")
-  if(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
-    set(SQLITE3_FOUND TRUE)
-    add_library("SQLite3" UNKNOWN IMPORTED)
-    set_target_properties("SQLite3"
-        PROPERTIES
-          INTERFACE_INCLUDE_DIRECTORIES "${SQLITE3_INCLUDE_DIR}"
-          IMPORTED_LOCATION "${SQLITE3_LIBRARY}"
-    )
-    get_filename_component(
-        SQLITE3_LIB_DIR
-          "${SQLITE3_LIBRARY}"
-        DIRECTORY CACHE
-    )
-
-    if(UNIX AND NOT APPLE AND NOT ANDROID) # if Linux
-      string(REGEX MATCH "\\.a$" _ends_in_dot_a "${SQLITE3_LIBRARY}")
-      string(COMPARE NOTEQUAL "${_ends_in_dot_a}" "" _sqlite_is_static)
-      if(_sqlite_is_static)
-        # when static linking we need to add pthread and dl libraries
-        find_package(Threads REQUIRED)
-        list(APPEND _sqlite3_static_library_dependencies Threads::Threads ${CMAKE_DL_LIBS})
-        set_target_properties("SQLite3"
-            PROPERTIES
-              INTERFACE_LINK_LIBRARIES "${_sqlite3_static_library_dependencies}"
-        )
-      endif()
-    endif()
-  elseif(SQLite3_FIND_REQUIRED)
-    message(FATAL_ERROR "Could not find SQLite3")
-  endif()
-endif()


FindQore.cmake unified accross modules

FindQore.cmake unified accross modules

git-svn-id: 7dcbe3a2cfbab14f53e32d77b78d91a4bd2a180d@6200 1b0b35fe-f740-4c1b-b404-a338b32e513b

--- cmake/modules/FindQore.cmake
+++ cmake/modules/FindQore.cmake
@@ -7,8 +7,38 @@
 # QORE_INCLUDE_DIR
 # QORE_LIBRARY
 # QORE_MODULES_DIR
+#
+# QORE_EXECUTABLE
+# QORE_QPP_EXECUTABLE
+#

 SET(QORE_FOUND FALSE)
+
+
+MACRO (QORE_WRAP_QPP _cpp_files _inputs )
+  message(STATUS "QPP: ${QORE_QPP_EXECUTABLE}")
+  message(STATUS "QPP2: ${_inputs}")
+
+  FOREACH (it ${_inputs})
+    message(STATUS "QPP1: ${it}")
+    GET_FILENAME_COMPONENT(_outfile ${it} NAME_WE)
+    GET_FILENAME_COMPONENT(_infile ${it} ABSOLUTE)
+    SET(_cppfile ${CMAKE_CURRENT_BINARY_DIR}/${_outfile}.cpp)
+    SET(_doxfile ${CMAKE_CURRENT_BINARY_DIR}/${_outfile}.dox.h)
+    message(STATUS "QPP processing: ${_infile} -> ${_cppfile} ${_doxfile}")
+    ADD_CUSTOM_COMMAND(OUTPUT ${_cppfile} ${_doxfile}
+      COMMAND ${QORE_QPP_EXECUTABLE}
+      ARGS --output=${_cppfile} --dox-output=${_doxfile} ${_infile}
+      MAIN_DEPENDENCY ${_infile}
+      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+      )
+    SET(${_cpp_files} ${${_cpp_files}} ${_cppfile})
+  ENDFOREACH (it)
+
+  message(STATUS "QPP files: ${${_cpp_files}}")
+
+ENDMACRO (QORE_WRAP_QPP)
+

 FIND_PATH (QORE_INCLUDE_DIR qore/Qore.h
@@ -41,6 +71,11 @@
 IF (NOT QORE_EXECUTABLE)
     MESSAGE( FATAL_ERROR "Cannot find 'qore' executable. Check if it's in your PATH" )
 ENDIF (NOT QORE_EXECUTABLE)
+
+FIND_PROGRAM(QORE_QPP_EXECUTABLE NAMES qpp DOC "Searching for qore qpp preprocessor")
+IF (NOT QORE_QPP_EXECUTABLE)
+    MESSAGE( FATAL_ERROR "Cannot find 'qpp' executable. Check if it's in your PATH" )
+ENDIF (NOT QORE_QPP_EXECUTABLE)

 IF (QORE_MIN_VERSION)


cuda windows

cuda windows

--- cmake/cuda.cmake
+++ cmake/cuda.cmake
@@ -169,14 +169,19 @@

 # Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc.
 # So, don't set these flags here.
+if (NOT WIN32) # windows msvc2015 support c++11 natively.
+# -std=c++11 -fPIC not recoginize by msvc, -Xcompiler will be added by cmake.
 list(APPEND CUDA_NVCC_FLAGS "-std=c++11")
+list(APPEND CUDA_NVCC_FLAGS "-Xcompiler -fPIC")
+endif(NOT WIN32)
+
 list(APPEND CUDA_NVCC_FLAGS "--use_fast_math")
-list(APPEND CUDA_NVCC_FLAGS "-Xcompiler -fPIC")
 # in cuda9, suppress cuda warning on eigen
 list(APPEND CUDA_NVCC_FLAGS "-w")
 # Set :expt-relaxed-constexpr to suppress Eigen warnings
 list(APPEND CUDA_NVCC_FLAGS "--expt-relaxed-constexpr")

+if (NOT WIN32)
 if(CMAKE_BUILD_TYPE  STREQUAL "Debug")
     list(APPEND CUDA_NVCC_FLAGS  ${CMAKE_CXX_FLAGS_DEBUG})
 elseif(CMAKE_BUILD_TYPE  STREQUAL "Release")
@@ -187,6 +192,13 @@
     # nvcc 9 does not support -Os. Use Release flags instead
     list(APPEND CUDA_NVCC_FLAGS  ${CMAKE_CXX_FLAGS_RELEASE})
 endif()
+else(NOT WIN32)
+if(CMAKE_BUILD_TYPE STREQUAL "Release")
+  list(APPEND CUDA_NVCC_FLAGS "-O3 -DNDEBUG")
+else()
+  message(FATAL "Windows only support Release build now. Please set visual studio build type to Release, x64 build.")
+endif()
+endif(NOT WIN32)

 mark_as_advanced(CUDA_BUILD_CUBIN CUDA_BUILD_EMULATION CUDA_VERBOSE_BUILD)
 mark_as_advanced(CUDA_SDK_ROOT_DIR CUDA_SEPARABLE_COMPILATION)


commented out tests which fail under linux

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -8,7 +8,7 @@
    mitkNavigationDataLandmarkTransformFilterTest.cpp
    mitkNavigationDataObjectVisualizationFilterTest.cpp
    mitkNavigationDataTest.cpp
-   mitkNavigationDataRecorderTest.cpp
+   # mitkNavigationDataRecorderTest.cpp # see bug 16349
    mitkNavigationDataReferenceTransformFilterTest.cpp
    mitkNavigationDataSequentialPlayerTest.cpp
    mitkNavigationDataSourceTest.cpp
@@ -33,8 +33,8 @@
    # ------------------ Navigation Tool Management Tests -------------------
    mitkNavigationToolStorageTest.cpp # see bug 16385
    mitkNavigationToolTest.cpp # see bug 16385
-   mitkNavigationToolReaderAndWriterTest.cpp
-   mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
+   # mitkNavigationToolReaderAndWriterTest.cpp # see bug 16350
+   # mitkNavigationToolStorageSerializerAndDeserializerTest.cpp # see bug 16351
    # -----------------------------------------------------------------------
 )


add a rule back for non-Android platforms

`-DBUILD_TEST=ON -DBUILD_BINARY=ON -DUSE_OBSERVERS=ON -DBUILD_OBSERVERS=ON`
should work for both Andorid and non-Android platformas (e.g., Ubuntu)

--- cmake/Utils.cmake
+++ cmake/Utils.cmake
@@ -166,7 +166,11 @@
   # libraries even if they are not part of the public dependency libs. As a
   # result, we will explicitly link the test against the Caffe2 dependency
   # libs. This should be changed in a future cleanup.
-  # target_link_libraries(${__target} ${Caffe2_DEPENDENCY_LIBS})
+  if (ANDROID)
+    # ${Caffe2_DEPENDENCY_LIBS}) will break -DBUILD_BINARY
+  else()
+    target_link_libraries(${__target} ${Caffe2_DEPENDENCY_LIBS})
+  endif()
   if (USE_CUDA)
     target_link_libraries(${__target} ${Caffe2_CUDA_DEPENDENCY_LIBS})
   endif()


COMP: fix case -- again -- for find_package(Boost)

--- SuperBuild/External_Boost.cmake
+++ SuperBuild/External_Boost.cmake
@@ -90,7 +90,7 @@
   set(BOOST_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/boost-install/include)
 else()
   if(${USE_SYSTEM_${extProjName}})
-    find_package(${extProjName} ${${extProjName}_REQUIRED_VERSION} REQUIRED)
+    find_package(${proj} ${${extProjName}_REQUIRED_VERSION} REQUIRED)
     if(NOT ${extProjName}_DIR)
       message(FATAL_ERROR "To use the system ${extProjName}, set ${extProjName}_DIR")
     endif()


COMP: wrong version tag

COMP: wrong version tag

--- SuperBuild/External_ITKv5.cmake
+++ SuperBuild/External_ITKv5.cmake
@@ -149,7 +149,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
   set(${proj}_GIT_TAG 902c9d0e0a2d8349796b1b2b805fd94648e8a197) ##
-  set(ITK_VERSION_ID ITK-4.12) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID
+  set(ITK_VERSION_ID ITK-5.0) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


Rewrite gp_resolve_item_override to find plugins within install folder

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -90,15 +90,37 @@
       endif()
     endmacro(gp_resolved_file_type_override)

-    if(NOT APPLE)
-      macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
-        if(\${item} MATCHES \"blueberry_osgi\")
-          get_filename_component(_item_name \${item} NAME)
-          set(\${resolved_item_var} \"\${exepath}/plugins/\${_item_name}\")
-          set(\${resolved_var} 1)
+    macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
+
+      get_filename_component(_item_name \"\${item}\" NAME)
+      get_filename_component(_item_path \"\${item}\" PATH)
+
+      set(_bundle_dest_dir \"${_bundle_dest_dir}\")
+      if(_bundle_dest_dir)
+        set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/\${_bundle_dest_dir}/plugins\")
+      else()
+        set(_plugins_path \"\${CMAKE_INSTALL_PREFIX}/bin/plugins\")
+      endif()
+
+      if(NOT _item_path MATCHES \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}\")
+        set(full_path \"full_path-NOTFOUND\")
+        file(GLOB_RECURSE full_path \${_plugins_path}/\${_item_name} )
+        list(LENGTH full_path full_path_length)
+        if(full_path_length GREATER 1)
+          list(GET full_path 0 full_path)
         endif()
-      endmacro()
-    endif()
+        get_filename_component(_item_path \"\${full_path}\" PATH)
+      endif()
+
+      set(ri \"ri-NOTFOUND\")
+      find_file(ri \"\${item}\" \${_item_path})
+      if(ri)
+        set(resolved 1)
+        set(resolved_item \"\${ri}\")
+        set(ri \"ri-NOTFOUND\")
+      endif(ri)
+
+    endmacro()

     if(\"${_install_GLOB_PLUGINS}\" STREQUAL \"TRUE\")
       # When installing multiple applications, this will find *all* already installed


Fix lua building

Fix lua building

--- CMakeModules/build_lua.cmake
+++ CMakeModules/build_lua.cmake
@@ -2,7 +2,7 @@

 SET(prefix ${CMAKE_BINARY_DIR}/third_party/lua)

-SET(lua_location "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lua${CMAKE_STATIC_LIBRARY_SUFFIX}")
+SET(lua_location "${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}lua${CMAKE_SHARED_LIBRARY_SUFFIX}")
 IF(CMAKE_VERSION VERSION_LESS 3.2)
     IF(CMAKE_GENERATOR MATCHES "Ninja")
         MESSAGE(WARNING "Building forge with Ninja has known issues with CMake older than 3.2")
@@ -13,7 +13,13 @@
 ENDIF()

 IF(WIN32)
-    ADD_DEFINITIONS("-DLUA_DL_DLL")
+    SET(LUA_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLUA_DL_DLL")
+    SET(LUA_C_FLAGS "${CMAKE_C_FLAGS} -DLUA_DL_DLL")
+    SET(LUA_BUILD_AS_DLL ON)
+ELSE()
+    SET(LUA_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+    SET(LUA_C_FLAGS "${CMAKE_C_FLAGS}")
+    SET(LUA_BUILD_AS_DLL OFF)
 ENDIF()

 # FIXME Tag forge correctly during release
@@ -29,17 +35,17 @@
     -DCMAKE_SOURCE_DIR:PATH=<SOURCE_DIR>
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
-    -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-    -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}
+    -DCMAKE_CXX_FLAGS:STRING=${LUA_CXX_FLAGS}
+    -DCMAKE_C_FLAGS:STRING=${LUA_C_FLAGS}
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
     -DBUILD_SHARED_LIBS=ON
-    -DLUA_BUILD_AS_DLL=ON
+    -DLUA_BUILD_AS_DLL=${LUA_BUILD_AS_DLL}
     ${byproducts}
     )

 ExternalProject_Get_Property(lua-ext install_dir)
-ADD_LIBRARY(lua IMPORTED STATIC)
+ADD_LIBRARY(lua IMPORTED SHARED)
 SET_TARGET_PROPERTIES(lua PROPERTIES IMPORTED_LOCATION ${lua_location})
 ADD_DEPENDENCIES(lua lua-ext)
 SET(LUA_INCLUDE_DIR ${install_dir}/include)


Fix lua dll build

Fix lua dll build

--- CMakeModules/build_lua.cmake
+++ CMakeModules/build_lua.cmake
@@ -1,6 +1,7 @@
 INCLUDE(ExternalProject)

 SET(prefix ${CMAKE_BINARY_DIR}/third_party/lua)
+SET(lua_lib_prefix "${prefix}/lib")

 SET(lua_location "${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}lua${CMAKE_SHARED_LIBRARY_SUFFIX}")
 IF(CMAKE_VERSION VERSION_LESS 3.2)
@@ -44,9 +45,15 @@
     ${byproducts}
     )

+ExternalProject_Get_Property(lua-ext binary_dir)
 ExternalProject_Get_Property(lua-ext install_dir)
+
 ADD_LIBRARY(lua IMPORTED SHARED)
 SET_TARGET_PROPERTIES(lua PROPERTIES IMPORTED_LOCATION ${lua_location})
+IF(WIN32)
+    SET_TARGET_PROPERTIES(lua PROPERTIES IMPORTED_IMPLIB ${lua_lib_prefix}/lua.lib)
+ENDIF(WIN32)
+
 ADD_DEPENDENCIES(lua lua-ext)
 SET(LUA_INCLUDE_DIR ${install_dir}/include)
 SET(LUA_LIBRARIES lua)


CMake: minor fix to avoid detection of a package on the system in CONFIG mode.

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -246,7 +246,9 @@
       # Hope to find direclty a CMake config file, indicating the SALOME CMake file
       # paths (the command already look in places like "share/cmake", etc ... by default)
       # Note the options NO_CMAKE_BUILDS_PATH, NO_CMAKE_PACKAGE_REGISTRY to avoid (under Windows)
-      # looking into a previous CMake build done via a GUI, or into the Win registry.
+      # looking into a previous CMake build done via a GUI, or into the Win registry.
+      # NO_CMAKE_SYSTEM_PATH and NO_SYSTEM_ENVIRONMENT_PATH ensure any _system_ files like 'xyz-config.cmake'
+      # don't get loaded (typically Boost). To force their loading, set the XYZ_ROOT_DIR variable to '/usr'.
       # See documentation of FIND_PACKAGE() for full details.

       # Do we need to call the signature using components?
@@ -254,12 +256,14 @@
         FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
               NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}
               PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
-              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH)
+              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
+                NO_SYSTEM_ENVIRONMENT_PATH)
       ELSE()
         FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact}
               NO_MODULE ${_tmp_quiet} ${_tmp_req}
               PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
-              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH)
+              NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH
+                 NO_SYSTEM_ENVIRONMENT_PATH)
       ENDIF()
       MARK_AS_ADVANCED(${stdPkg}_DIR)

@@ -347,13 +351,13 @@
   # Override the variable - don't append to it, as it would give precedence
   # to what was stored there before!
   SET(CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}")
-
+
   # Try find_package in config mode. This has the priority, but is
   # performed QUIET and not REQUIRED:
   SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} NO_MODULE TRUE)

   IF (${pkg_UC}_FOUND OR ${pkg}_FOUND)
-     MESSAGE(STATUS "Found ${pkg} in CONFIG mode!")
+    MESSAGE(STATUS "Found ${pkg} in CONFIG mode!")
   ENDIF()

   # Otherwise try the standard way (module mode, with the standard CMake Find*** macro):


CMake: introduced flag SALOME_CMAKE_DEBUG to see the initial CMake error when having troubles with the package detection mechanism.

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -485,8 +485,12 @@
   ENDIF()

   # Otherwise try the standard way (module mode, with the standard CMake Find*** macro):
-  # We do it quietly to produce our own error message:
-  SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)
+  # We do it quietly to produce our own error message, except if we are in debug mode:
+  IF(SALOME_CMAKE_DEBUG)
+    SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE FALSE)
+  ELSE()
+    SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE)
+  ENDIF()

   # Set the "FOUND" variable for the SALOME wrapper:
   IF(${pkg_UC}_FOUND OR ${pkg}_FOUND)
@@ -496,10 +500,12 @@
     IF(NOT Salome${pkg}_FIND_QUIETLY)
       IF(Salome${pkg}_FIND_REQUIRED)
          MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
-         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}")
+         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}  "
+         "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
       ELSE()
          MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? "
-         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}")
+         "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR}  "
+         "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.")
       ENDIF()
     ENDIF()
   ENDIF()


Fix bdw-gc package name in FindLibGc.make (#1435)

--- cmake/FindLibGc.cmake
+++ cmake/FindLibGc.cmake
@@ -32,7 +32,7 @@
 # use pkg-config to get the directories and then use these values
 # in the find_path() and find_library() calls
 find_package(PkgConfig QUIET)
-PKG_CHECK_MODULES(PC_LIBGC QUIET bwd-gc)
+PKG_CHECK_MODULES(PC_LIBGC QUIET bdw-gc)
 set(LIBGC_DEFINITIONS ${PC_LIBGC_CFLAGS_OTHER})

 find_path(LIBGC_INCLUDE_DIR NAMES gc/gc.h


[cmake] Added MT_Require_Version check in MT_Config.cmake

--- cmake/MT_Config.cmake
+++ cmake/MT_Config.cmake
@@ -174,3 +174,17 @@
   MT_link_robot_app(${APP_NAME})
   MT_osx_app_copy_step(${APP_NAME})
 endfunction(MT_robot_app)
+
+#### Version check function
+function(MT_Require_Version APP_NAME MIN_VERSION)
+  string(REGEX MATCH "[0-9]+\\." REQ_MAJ ${MIN_VERSION})
+  string(REGEX MATCH "[0-9]+" REQ_MAJ ${REQ_MAJ})
+  string(REGEX MATCH "\\.[0-9]+\\." REQ_MIN ${MIN_VERSION})
+  string(REGEX MATCH "[0-9]+" REQ_MIN ${REQ_MIN})
+  string(REGEX MATCH "\\.[0-9]+$" REQ_PATCH ${MIN_VERSION})
+  string(REGEX MATCH "[0-9]+" REQ_PATCH ${REQ_PATCH})
+  math(EXPR REQ_VERSION_NUMBER "${REQ_MAJ}*10000 + ${REQ_MIN}*100 + ${REQ_PATCH}")
+  if(MT_VERSION_NUMBER LESS REQ_VERSION_NUMBER)
+    message(FATAL_ERROR "${APP_NAME} requires MADTraC version ${MIN_VERSION}, but you have ${MT_VERSION}")
+  endif()
+endfunction(MT_Require_Version)


[runtimes] Use -Wunknown-pragmas for the pragma check

This is a follow up to r362055, we need -Wunknown-pragmas otherwise
the check is going to succeed it the pragma isn't supported.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@362057 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -1,3 +1,4 @@
+include(CMakePushCheckState)
 include(CheckLibraryExists)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
@@ -62,10 +63,13 @@

 # Check compiler pragmas
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  cmake_push_check_state()
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unknown-pragmas")
   check_c_source_compiles("
 #pragma comment(lib, \"c\")
 int main() { return 0; }
 " LIBCXX_HAS_COMMENT_LIB_PRAGMA)
+  cmake_pop_check_state()
 endif()

 if(NOT WIN32 OR MINGW)


Revert r316064 "Fix the incorrect detection of ICONV_LIBRARY_PATH"

This broke the use of libxml2 on machines where iconv() is provided by libc.
I'll follow up on the mailing list to discuss how to fix this properly.

> This is introduced in rL308711.
> Check for c library is incorrect here just because libc will be found always
> and it does not mean that iconv is presented.
>
> Thank to Andrew Krasny for narrowing down the root cause.
>
> Reviewers: ecbeckmann
> Reviewed By: ecbeckmann
> Subscribers: mgorny, llvm-commits
> Differential Revision: https://reviews.llvm.org/D38875

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -157,7 +157,7 @@
     set(HAVE_TERMINFO 0)
   endif()

-  find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2)
+  find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
   set(LLVM_LIBXML2_ENABLED 0)
   set(LIBXML2_FOUND 0)
   if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE))


typo

typo

svn path=/trunk/kdesupport/strigi/; revision=1111857

--- strigidaemon/cmake/FindFAM.cmake
+++ strigidaemon/cmake/FindFAM.cmake
@@ -17,7 +17,7 @@
 ENDIF (NOT GAMIN_LIBRARIES AND FAM_LIBRARIES)

 if (GAMIN_LIBRARIES)
-  message(STATUS "Found Gamin: good choice, it's better then FAM")
+  message(STATUS "Found Gamin: good choice, it's better than FAM")
 endif (GAMIN_LIBRARIES)

 IF(FAM_INCLUDE_DIR AND FAM_LIBRARIES)


fixed: HUGH_INSTALL_PREFIX handling

fixed: HUGH_INSTALL_PREFIX handling

--- share/hugh/cmake/SetupInstallPrefix.cmake
+++ share/hugh/cmake/SetupInstallPrefix.cmake
@@ -7,13 +7,15 @@
 ####################################################################################################

 if(DEFINED ENV{HUGH_INSTALL_PREFIX})
-  set(CMAKE_INSTALL_PREFIX $ENV{HUGH_INSTALL_PREFIX})
-else()
-  if(HUGH_INSTALL_PREFIX)
-    set(CMAKE_INSTALL_PREFIX ${HUGH_INSTALL_PREFIX})
-  endif()
+  set(HUGH_INSTALL_PREFIX $ENV{HUGH_INSTALL_PREFIX} CACHE INTERNAL "HUGH Installation Root")
 endif()

-if(VERBOSE)
+if(NOT HUGH_INSTALL_PREFIX)
+  set(HUGH_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE INTERNAL "HUGH Installation Root")
+endif()
+
+set(CMAKE_INSTALL_PREFIX ${HUGH_INSTALL_PREFIX})
+
+if(TRUE OR VERBOSE)
   message(STATUS "CMAKE_INSTALL_PREFIX set to '" ${CMAKE_INSTALL_PREFIX} "'")
 endif()


Use llvm 11 on darwin.

Use llvm 11 on darwin.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -39,9 +39,9 @@
   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
     set(DEFAULT_LLVM_INCLUDE_DIRECTORY "/usr/local/opt/llvm/include")
     set(DEFAULT_LLVM_LINK_DIRECTORY "/usr/local/opt/llvm/lib")
-    set(DEFAULT_VESPA_LLVM_VERSION "10" PARENT_SCOPE)
+    set(DEFAULT_VESPA_LLVM_VERSION "11" PARENT_SCOPE)
   else()
-    set(DEFAULT_VESPA_LLVM_VERSION "10" PARENT_SCOPE)
+    set(DEFAULT_VESPA_LLVM_VERSION "11" PARENT_SCOPE)
   endif()
   set(DEFAULT_CMAKE_PREFIX_PATH "${VESPA_DEPS}" "/usr/local/opt/bison" "/usr/local/opt/flex" "/usr/local/opt/openssl@1.1" "/usr/local/opt/openblas" "/usr/local/opt/icu4c" PARENT_SCOPE)
   set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib" "/usr/local/opt/bison/lib" "/usr/local/opt/flex/lib" "/usr/local/opt/icu4c/lib" "/usr/local/opt/openssl@1.1/lib" "/usr/local/opt/openblas/lib")


Fix lua compilation

Fix lua compilation

It was not possible to have two lua_compile macro in the smae
CMakeFiles.txt.

--- build/UseLua.cmake
+++ build/UseLua.cmake
@@ -37,6 +37,8 @@
 	else()
 		set(LUA_FLAGS "${LUA_COMPILE_FLAGS}")
 	endif()
+
+	set(LUA_COMPILE_COMPILED_FILES)

 	foreach(it ${LUA_COMPILE_FILES})
 		get_filename_component(lua_source_file_path "${it}" ABSOLUTE)


Do not build the multi-label segmentation plugins by default.

--- Plugins/PluginList.cmake
+++ Plugins/PluginList.cmake
@@ -73,7 +73,7 @@
   org.mitk.gui.qt.spectrocamrecorder:OFF
   org.mitk.gui.qt.classificationsegmentation:OFF
   org.mitk.gui.qt.overlaymanager:OFF
-  org.mitk.gui.qt.multilabelsegmentation:ON
+  org.mitk.gui.qt.multilabelsegmentation:OFF
   org.mitk.matchpoint.core.helper:OFF
   org.mitk.gui.qt.matchpoint.algorithm.browser:OFF
   org.mitk.gui.qt.matchpoint.algorithm.control:OFF


cmake/Custom.cmake : add source_group_by_path_all


CMake: Fix ccache detection (#382)

CMake: Fix ccache detection (#382)

--- cmake/ccache.cmake
+++ cmake/ccache.cmake
@@ -19,22 +19,21 @@
      NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")

     message(STATUS "ccache: Not supported")
-    return()
+
+  else()
+    find_program(ccache_path ccache)
+    if("${ccache_path}" STREQUAL "ccache_path-NOTFOUND")
+      message(STATUS "ccache: Not found")
+    else()
+      set(CMAKE_C_COMPILER_LAUNCHER "${ccache_path}")
+      set(CMAKE_CXX_COMPILER_LAUNCHER "${ccache_path}")
+
+      set(ccache_dir "$ENV{CCACHE_DIR}")
+      if("${ccache_dir}" STREQUAL "")
+        set(ccache_dir "$ENV{HOME}/.ccache")
+      endif()
+
+      message(STATUS "ccache: enabled with '${ccache_path}'. The cache folder is located here: '${ccache_dir}'")
+    endif()
   endif()
-
-  find_program(ccache_path ccache)
-  if("${ccache_path}" STREQUAL "ccache_path-NOTFOUND")
-    message(STATUS "ccache: Not found")
-    return()
-  endif()
-
-  set(CMAKE_C_COMPILER_LAUNCHER "${ccache_path}")
-  set(CMAKE_CXX_COMPILER_LAUNCHER "${ccache_path}")
-
-  set(ccache_dir "$ENV{CCACHE_DIR}")
-  if("${ccache_dir}" STREQUAL "")
-    set(ccache_dir "$ENV{HOME}/.ccache")
-  endif()
-
-  message(STATUS "ccache: enabled with '${ccache_path}'. The cache folder is located here: '${ccache_dir}'")
 endmacro()


Some minor work on our common.cmake file.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -171,15 +171,6 @@

         SET(CMAKE_OSX_DEPLOYMENT_TARGET ${OLDEST_OS_X_VERSION_NUMBER})
         SET(CMAKE_OSX_SYSROOT ${OLDEST_SDK_PATH})
-    ENDIF()
-
-    # Default location of third-party libraries
-    # Note: this is only required so that we can quickly test third-party
-    #       libraries without first having to package everything...
-
-    IF(NOT WIN32)
-        SET(LIBRARY_OUTPUT_PATH ${PROJECT_BUILD_DIR})
-        # Note: MSVC doesn't care about this location, so...
     ENDIF()

     # Location of our plugins so that we don't have to deploy OpenCOR on
@@ -470,13 +461,8 @@

     # Location of our plugins

-    IF(WIN32)
-        STRING(REPLACE "${${CMAKE_PROJECT_NAME}_SOURCE_DIR}" "" PLUGIN_BUILD_DIR ${PROJECT_SOURCE_DIR})
-        SET(PLUGIN_BUILD_DIR "${PROJECT_BUILD_DIR}${PLUGIN_BUILD_DIR}")
-        # Note: MSVC generate things in a different place to GCC, so...
-    ELSE()
-        SET(PLUGIN_BUILD_DIR ${LIBRARY_OUTPUT_PATH})
-    ENDIF()
+    STRING(REPLACE "${${CMAKE_PROJECT_NAME}_SOURCE_DIR}/" "" PLUGIN_BUILD_DIR ${PROJECT_SOURCE_DIR})
+    SET(PLUGIN_BUILD_DIR ${CMAKE_BINARY_DIR}/${PLUGIN_BUILD_DIR}/${CMAKE_CFG_INTDIR})

     # Copy the plugin to our plugins directory
     # Note: this is done so that we can, on Windows and Linux, test the use of
@@ -741,7 +727,7 @@
                               DEPENDS ${PLUGIN_NAME}_COPY_PLUGIN_TO_BUILD_DIRECTORY
                               COMMAND install_name_tool -change @executable_path/../Frameworks/${QT_DEPENDENCY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_DEPENDENCY}
                                                                 ${QT_LIBRARY_DIR}/${QT_DEPENDENCY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_DEPENDENCY}
-                                                                ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+                                                                ${PROJECT_BUILD_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
         ENDFOREACH()
     ENDIF()


Minor editing.

Minor editing.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -28,8 +28,8 @@

         IF(NOT APPLE)
             SET(LINK_FLAGS_PROPERTIES "${LINK_FLAGS_PROPERTIES} -Wl,-s")
-            # Note #1: -Wl,-s strips all the symbols, thus reducing the final size
-            #          of OpenCOR of one its shared libraries
+            # Note #1: -Wl,-s strips all the symbols, thus reducing the final
+            #          size of OpenCOR or one its shared libraries
             # Note #2: the above linking option has become obsolete on Mac OS X,
             #          so...
         ENDIF()


Add cmake defaults for ?sum kernels

Add cmake defaults for ?sum kernels

--- cmake/kernel.cmake
+++ cmake/kernel.cmake
@@ -107,6 +107,12 @@
   set(DAXPBYKERNEL ../arm/axpby.c)
   set(CAXPBYKERNEL ../arm/zaxpby.c)
   set(ZAXPBYKERNEL ../arm/zaxpby.c)
+  set(SSUMKERNEL sum.S)
+  set(DSUMKERNEL sum.S)
+  set(CSUMKERNEL zsum.S)
+  set(ZSUMKERNEL zsum.S)
+  set(QSUMKERNEL sum.S)
+  set(XSUMKERNEL zsum.S)
 endmacro ()

 macro(SetDefaultL2)
@@ -162,4 +168,4 @@
   set(DGEADD_KERNEL ../generic/geadd.c)
   set(CGEADD_KERNEL ../generic/zgeadd.c)
   set(ZGEADD_KERNEL ../generic/zgeadd.c)
-endmacro ()+endmacro ()


Copy BUILD_* directives to the compiler options to allow ifdef in tests

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -393,6 +393,18 @@
 set(MAJOR_VERSION ${OpenBLAS_MAJOR_VERSION})

 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CCOMMON_OPT}")
+if (BUILD_SINGLE)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_SINGLE")
+endif()
+if (BUILD_DOUBLE)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_DOUBLE")
+endif()
+if (BUILD_COMPLEX)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX")
+endif()
+if (BUILD_COMPLEX16)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16")
+endif()
 if(NOT MSVC)
 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")
 endif()


Added new triangle mesh modules. https://tracker.physiomeproject.org/show_bug.cgi?id=1989

--- source/graphics.cmake
+++ source/graphics.cmake
@@ -21,6 +21,7 @@
 	graphics/renderstl.cpp
 	graphics/rendervrml.cpp
 	graphics/renderwavefront.cpp
+	graphics/render_triangularisation.cpp
 	graphics/quaternion.cpp
 	graphics/selected_graphic.c
 	graphics/spectrum.cpp
@@ -28,6 +29,7 @@
 	graphics/texture.cpp
 	graphics/texture_line.c
 	graphics/transform_tool.cpp
+	graphics/triangle_mesh.cpp
 	graphics/userdef_objects.c
 	graphics/volume_texture.c )


Correct capitalisation of ScaLAPACK in MKL_ScaLAPACK_LIBRARY

--- modules/FindMKL.cmake
+++ modules/FindMKL.cmake
@@ -431,14 +431,14 @@
     # ScaLAPACK
     list(FIND MKL_FIND_COMPONENTS ScaLAPACK _MKL_INDEXOF_SCALAPACK)
     if (${_MKL_INDEXOF_SCALAPACK} GREATER -1)
-      find_library(MKL_SCALAPACK_LIBRARY
+      find_library(MKL_ScaLAPACK_LIBRARY
                    "mkl_scalapack_${_MKL_INTERFACE_LC}"
                    HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
-      if("${MKL_SCALAPACK_LIBRARY}" STREQUAL "MKL_SCALAPACK_LIBRARY-NOTFOUND")
+      if("${MKL_ScaLAPACK_LIBRARY}" STREQUAL "MKL_ScaLAPACK_LIBRARY-NOTFOUND")
         set(MKL_FOUND 0)
       else()
-        list(APPEND MKL_LIBRARIES ${MKL_SCALAPACK_LIBRARY})
-        set(MKL_SCALAPACK_FOUND TRUE)
+        list(APPEND MKL_LIBRARIES ${MKL_ScaLAPACK_LIBRARY})
+        set(MKL_ScaLAPACK_FOUND TRUE)
       endif()
     endif()
     unset(_MKL_INDEXOF_SCALAPACK)


bump version to 0.2.0

bump version to 0.2.0

--- src/CPackConfig.cmake
+++ src/CPackConfig.cmake
@@ -3,7 +3,7 @@
 set(CPACK_PACKAGE_NAME "libmm0")

 set(CPACK_PACKAGE_VERSION_MAJOR "0")
-set(CPACK_PACKAGE_VERSION_MINOR "1")
+set(CPACK_PACKAGE_VERSION_MINOR "2")
 set(CPACK_PACKAGE_VERSION_PATCH "0")
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")


Fix typo

Fix typo

--- cmake/05-summary.cmake
+++ cmake/05-summary.cmake
@@ -12,7 +12,7 @@
 colored_option("   polybar-msg" BUILD_IPC_MSG)
 colored_option("   testsuite" BUILD_TESTS)

-message(STATUS " Module supprt:")
+message(STATUS " Module support:")
 colored_option("   alsa" ENABLE_ALSA)
 colored_option("   curl" ENABLE_CURL)
 colored_option("   i3" ENABLE_I3)


comment adjusted

comment adjusted

--- cmake/FindAtomic.cmake
+++ cmake/FindAtomic.cmake
@@ -1,4 +1,4 @@
-# Simplistic
+# Simple check to see if we need a library for std::atomic

 if(TARGET std::atomic)
 	return()


Re-enable hints from env variables.

Re-enable hints from env variables.

--- cmake/FindLIBIGL.cmake
+++ cmake/FindLIBIGL.cmake
@@ -9,10 +9,10 @@

 find_path(LIBIGL_INCLUDE_DIR igl/readOBJ.h
     HINTS
-        # ENV LIBIGL
-        # ENV LIBIGLROOT
-        # ENV LIBIGL_ROOT
-        # ENV LIBIGL_DIR
+        ENV LIBIGL
+        ENV LIBIGLROOT
+        ENV LIBIGL_ROOT
+        ENV LIBIGL_DIR
     PATHS
         ${CMAKE_SOURCE_DIR}/../..
         ${CMAKE_SOURCE_DIR}/..


Fix a copy-paste error in the header

Fix a copy-paste error in the header

--- cmake/FindVulkan.cmake
+++ cmake/FindVulkan.cmake
@@ -1,6 +1,6 @@
 # Locate the Vulkan SDK
 # This module defines
-#  Vulkan_FOUND, if false, do not try to link to Lua
+#  Vulkan_FOUND
 #  Vulkan_INCLUDE_DIR
 #  Vulkan_LIBRARY
 #


Fix compiler detection for AppleClang in Sanitizers.cmake

--- cmake/Sanitizers.cmake
+++ cmake/Sanitizers.cmake
@@ -1,7 +1,7 @@
 function(enable_sanitizers project_name)

-  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL
-                                             "Clang")
+  if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES
+                                             ".*Clang")
     option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE)

     if(ENABLE_COVERAGE)


Configure some sip-related variables so that can use sip directly (rather
than indirectly via python) to generate source code for plplot_pyqt4
extension module.

svn path=/trunk/; revision=10064

--- cmake/modules/qt.cmake
+++ cmake/modules/qt.cmake
@@ -41,6 +41,9 @@
 # ENABLE_qt		  - ON means the plplot_qt library is enabled.
 # ENABLE_pyqt4		  - ON means the plplot_pyqt4 Python extension module
 # 			    is enabled.
+# SIP_EXECUTABLE	  - full path for sip
+# PYQT_SIP_DIR		  - sip system directory
+# PYQT_SIP_FLAGS	  - sip command flags

 find_package(Qt4)
 if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt)
@@ -88,17 +91,17 @@

 if(ENABLE_qt AND NOT PLD_extqt)
   message(STATUS
-  "WARNING: PLD_extqt is OFF so "
-  "setting ENABLE_qt to OFF."
-  )
+    "WARNING: PLD_extqt is OFF so "
+    "setting ENABLE_qt to OFF."
+    )
   set(ENABLE_qt OFF CACHE BOOL "Enable Qt bindings" FORCE)
 endif(ENABLE_qt AND NOT PLD_extqt)

 if(ENABLE_pyqt4 AND NOT ENABLE_python AND NOT ENABLE_qt)
   message(STATUS
-  "WARNING: ENABLE_python OR ENABLE_qt is OFF so "
-  "setting ENABLE_pyqt4 to OFF."
-  )
+    "WARNING: ENABLE_python OR ENABLE_qt is OFF so "
+    "setting ENABLE_pyqt4 to OFF."
+    )
   set(ENABLE_pyqt4 OFF CACHE BOOL "Enable pyqt4 Python extension module " FORCE)
 endif(ENABLE_pyqt4 AND NOT ENABLE_python AND NOT ENABLE_qt)

@@ -107,3 +110,47 @@
 else(ENABLE_qt)
   set(qt_gui_true "#")
 endif(ENABLE_qt)
+
+if(ENABLE_pyqt4)
+  find_program(SIP_EXECUTABLE sip)
+  if(NOT SIP_EXECUTABLE)
+    message(STATUS
+      "WARNING: sip not found so setting ENABLE_pyqt4 to OFF."
+      )
+    set(ENABLE_pyqt4 OFF CACHE BOOL "Enable pyqt4 Python extension module " FORCE)
+  endif(NOT SIP_EXECUTABLE)
+endif(ENABLE_pyqt4)
+
+if(ENABLE_pyqt4)
+  execute_process(
+    COMMAND ${PYTHON_EXECUTABLE} -c "from PyQt4 import pyqtconfig; print pyqtconfig.Configuration().pyqt_sip_dir"
+    OUTPUT_VARIABLE PYQT_SIP_DIR
+    RESULT_VARIABLE PYQT_SIP_DIR_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  if(PYQT_SIP_DIR_ERR)
+    message(STATUS
+      "WARNING: could not find sip directory so setting ENABLE_pyqt4 to OFF."
+      )
+    set(ENABLE_pyqt4 OFF CACHE BOOL "Enable pyqt4 Python extension module " FORCE)
+  endif(PYQT_SIP_DIR_ERR)
+endif(ENABLE_pyqt4)
+
+if(ENABLE_pyqt4)
+  execute_process(
+    COMMAND ${PYTHON_EXECUTABLE} -c "from PyQt4 import pyqtconfig; print pyqtconfig.Configuration().pyqt_sip_flags"
+    OUTPUT_VARIABLE PYQT_SIP_FLAGS
+    RESULT_VARIABLE PYQT_SIP_FLAGS_ERR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  if(PYQT_SIP_FLAGS_ERR)
+    message(STATUS
+      "WARNING: could not find sip flags so setting ENABLE_pyqt4 to OFF."
+      )
+    set(ENABLE_pyqt4 OFF CACHE BOOL "Enable pyqt4 Python extension module " FORCE)
+  endif(PYQT_SIP_DIR_ERR)
+  # Must change from blank-delimited string to CMake list so that sip
+  # COMMAND will work properly with these flags later on.
+  string(REGEX REPLACE " " ";"PYQT_SIP_FLAGS "${PYQT_SIP_FLAGS}")
+endif(ENABLE_pyqt4)
+


Upgraded re2 to fix some cxx11 issues.

Upgraded re2 to fix some cxx11 issues.

--- cmake/re2-config.cmake
+++ cmake/re2-config.cmake
@@ -13,8 +13,8 @@

 if(NOT TARGET re2)
   ExternalProject_Add(re2
-    URL     http://dl.dropbox.com/u/782372/Software/re2.zip
-    URL_MD5 02ef3dc07e72033ca14fc3d59259182b
+    URL     http://dl.dropboxusercontent.com/u/21394583/re2.zip
+    URL_MD5 d01a0e4ec3edddd16627ac02f86c8c2b
     CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
                -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
                -DCMAKE_CXX_FLAGS:STRING=${FLAGS}


Fixed Android cross-compiling problems: - missing install_name_tool on OS X - incorrectly working try_compile() command

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -2,6 +2,9 @@
 #  Android CMake toolchain file, for use with the Android NDK r5-r7
 #  Requires cmake 2.6.3 or newer (2.8.3 or newer is recommended).
 #  See home page: http://code.google.com/p/android-cmake/
+#
+#  The file is mantained by the OpenCV project. And also can be found at
+#  http://code.opencv.org/svn/opencv/trunk/opencv/android/android.toolchain.cmake
 #
 #  Usage Linux:
 #   $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
@@ -87,7 +90,7 @@
 #
 #    Make sure to do the following in your scripts:
 #      SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${my_cxx_flags}" )
-#      SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  ${my_cxx_flags}" )
+#      SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${my_cxx_flags}" )
 #      The flags will be prepopulated with critical flags, so don't loose them.
 #      Also be aware that toolchain also sets configuration-specific compiler
 #      flags and linker flags.
@@ -103,6 +106,7 @@
 #    Default is ${CMAKE_SOURCE_DIR}, and the android libs will always be
 #    under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
 #    (depending on the target ABI). This is convenient for Android packaging.
+#
 #
 #  Change Log:
 #   - initial version December 2010 Ethan Rublee ethan.ruble@gmail.com
@@ -156,9 +160,18 @@
 #     [+] filtered out hidden files (starting with .) while globbing inside NDK
 #     [+] automatically applied GLESv2 linkage fix for NDK revisions 5-6
 #     [+] added ANDROID_GET_ABI_RAWNAME to get NDK ABI names by CMake flags
-#   - modified February 2012
-#     [+] mostly fixed try_compile (it was always failing for Android)
+#   - modified February 2012 Andrey Kamaev andrey.kamaev@itseez.com
+#     [+] updated for NDK r7b
+#     [~] fixed cmake try_compile() command
+#     [~] Fix for missing install_name_tool on OS X
 # ------------------------------------------------------------------------------
+
+cmake_minimum_required( VERSION 2.6.3 )
+
+if( PROJECT_NAME STREQUAL "CMAKE_TRY_COMPILE" )
+ # all needed flags and variables are already inherited from the parent project
+ return()
+endif()

 # this one is important
 set( CMAKE_SYSTEM_NAME Linux )
@@ -622,7 +635,13 @@
 set( CMAKE_OBJCOPY      "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objcopy${TOOL_OS_SUFFIX}" CACHE PATH "objcopy" )
 set( CMAKE_OBJDUMP      "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-objdump${TOOL_OS_SUFFIX}" CACHE PATH "objdump" )
 set( CMAKE_RANLIB       "${ANDROID_TOOLCHAIN_ROOT}/bin/${ANDROID_TOOLCHAIN_MACHINE_NAME}-ranlib${TOOL_OS_SUFFIX}"  CACHE PATH "ranlib" )
-
+if( APPLE )
+ find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool )
+ if( NOT CMAKE_INSTALL_NAME_TOOL )
+  message( FATAL_ERROR "Could not find install_name_tool, please check your installation." )
+ endif()
+ mark_as_advanced( CMAKE_INSTALL_NAME_TOOL )
+endif()
 #export directories
 set( ANDROID_SYSTEM_INCLUDE_DIRS "" )
 set( ANDROID_SYSTEM_LIB_DIRS "" )
@@ -865,6 +884,7 @@
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )

+
 #macro to find packages on the host OS
 macro( find_host_package )
  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
@@ -885,6 +905,8 @@
  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
  set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
 endmacro()
+
+
 #macro to find programs on the host OS
 macro( find_host_program )
  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
@@ -906,6 +928,7 @@
  set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
 endmacro()

+
 macro( ANDROID_GET_ABI_RAWNAME TOOLCHAIN_FLAG VAR )
  if( "${TOOLCHAIN_FLAG}" STREQUAL "ARMEABI" )
   set( ${VAR} "armeabi" )
@@ -918,6 +941,7 @@
  endif()
 endmacro()

+
 set( ANDROID_SET_OBSOLETE_VARIABLES ON CACHE BOOL "Define obsolete Andrid-specific cmake variables" )
 mark_as_advanced( ANDROID_SET_OBSOLETE_VARIABLES )
 if( ANDROID_SET_OBSOLETE_VARIABLES )
@@ -933,7 +957,7 @@
 #   ANDROID_NO_UNDEFINED : ON/OFF
 #   ANDROID_SO_UNDEFINED : OFF/ON  (default depends on NDK version)
 #   ANDROID_SET_OBSOLETE_VARIABLES : ON/OFF
-#   LIBRARY_OUTPUT_PATH_ROOT : <any path>
+#   LIBRARY_OUTPUT_PATH_ROOT : <any valid path>
 #   ANDROID_USE_STLPORT : OFF/ON - EXPERIMENTAL!!!
 #   ANDROID_FORBID_SYGWIN : ON/OFF
 # Can be set only at the first run:
@@ -983,4 +1007,3 @@
 #   ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH
 #   ANDROID_SUPPORTED_ABIS_${ARCH}
 #   ANDROID_SUPPORTED_NDK_VERSIONS
-


Take substring of TOOL_VERSION_OUTPUT, not FIND_TOOL_VERSION_OUTPUT.

Fixes out-of-range error when attempting to locate header to version
information in a version string because FIND_TOOL_VERSION_OUTPUT
has no content to it

--- ToolingFindPackageUtil.cmake
+++ ToolingFindPackageUtil.cmake
@@ -159,7 +159,7 @@
                 FIND_TOOL_VHEADER_SIZE)
         math (EXPR FIND_TOOL_VERSION_START
               "${FIND_TOOL_VHEADER_LOC} + ${FIND_TOOL_VHEADER_SIZE}")
-        string (SUBSTRING "${FIND_TOOL_VERSION_OUTPUT}"
+        string (SUBSTRING "${TOOL_VERSION_OUTPUT}"
                 ${FIND_TOOL_VERSION_START} -1 FIND_TOOL_VERSION_TO_END)

     else (FIND_TOOL_VERSION_HEADER)


Provide information about compatibility and ES 2.0 target to users.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -65,10 +65,20 @@
 # Configuration
 file(READ ${MAGNUM_INCLUDE_DIR}/magnumConfigure.h _magnumConfigure)

-# Built for OpenGL ES?
+# Compatibility?
+string(FIND "${_magnumConfigure}" "#define MAGNUM_GCC46_COMPATIBILITY" _GCC46_COMPATIBILITY)
+if(NOT _GCC46_COMPATIBILITY EQUAL -1)
+    set(MAGNUM_GCC46_COMPATIBILITY 1)
+endif()
+
+# Built for specific target?
 string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES" _TARGET_GLES)
 if(NOT _TARGET_GLES EQUAL -1)
     set(MAGNUM_TARGET_GLES 1)
+endif()
+string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_GLES2" _TARGET_GLES2)
+if(NOT _TARGET_GLES2 EQUAL -1)
+    set(MAGNUM_TARGET_GLES2 1)
 endif()

 if(NOT MAGNUM_TARGET_GLES)


fix: (WIP) ios build

fix: (WIP) ios build

--- external/ios_cmake/ios.cmake
+++ external/ios_cmake/ios.cmake
@@ -6,10 +6,11 @@

 # path
 set(DEV_ROOT "/Applications/Xcode.app/Contents/Developer")
-file(GLOB IOS_SDKS "${DEV_ROOT}/Platforms/${PLATFORM}.platform/Developer/SDKs/*")
-list(SORT IOS_SDKS)
-list(REVERSE IOS_SDKS)
-list(GET IOS_SDKS 0 SDK_ROOT)
+#file(GLOB IOS_SDKS "${DEV_ROOT}/Platforms/${PLATFORM}.platform/Developer/SDKs/*")
+#list(SORT IOS_SDKS)
+#list(REVERSE IOS_SDKS)
+#list(GET IOS_SDKS 0 SDK_ROOT)
+set(SDK_ROOT "${DEV_ROOT}/Platforms/${PLATFORM}.platform/Developer/SDKs/${PLATFORM}.sdk")
 set(CMAKE_C_COMPILER "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang")
 set(CMAKE_CXX_COMPILER "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++")
 set(CMAKE_AR "${DEV_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar")


[CMake] [Darwin] [builtins] Need to special case the naming of the OS X cc_kext builtin library.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -293,7 +293,11 @@
                                 DEFS KERNEL_USE
                                 PARENT_TARGET builtins)
       endforeach()
-      darwin_lipo_libs(clang_rt.cc_kext_${os}
+      set(archive_name clang_rt.cc_kext_${os})
+      if(${os} STREQUAL "osx")
+        set(archive_name clang_rt.cc_kext)
+      endif()
+      darwin_lipo_libs(${archive_name}
                       PARENT_TARGET builtins
                       LIPO_FLAGS ${${os}_cc_kext_lipo_flags}
                       DEPENDS ${${os}_cc_kext_libs}


Use "npm install" rather than "grunt" after update step on aiur

--- cmake/aiur_nightly.cmake
+++ cmake/aiur_nightly.cmake
@@ -17,7 +17,7 @@
 ctest_update(SOURCE ${CTEST_SOURCE_DIRECTORY})

 # We must run grunt so the correct git hash gets built into the version file
-execute_process(COMMAND grunt WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY})
+execute_process(COMMAND npm install WORKING_DIRECTORY ${CTEST_SOURCE_DIRECTORY})

 ctest_configure()
 ctest_build()


Added old behaviour with dependencies in gtest

--- cmake/common/gtest.cmake
+++ cmake/common/gtest.cmake
@@ -76,7 +76,7 @@

 macro(add_gtest test)
     # Parse arguments
-    set(multiValueArgs SOURCES ENVIRONMENTS)
+    set(multiValueArgs SOURCES ENVIRONMENTS DEPENDENCIES)
     cmake_parse_arguments(GTEST "" "" "${multiValueArgs}" ${ARGN})

     if(GTEST_INDIVIDUAL)
@@ -90,6 +90,9 @@
                     endif()
                 endforeach()
             endif()
+            foreach(DEP ${GTEST_DEPENDENCIES})
+                set(WIN_PATH "$<TARGET_FILE_DIR:${DEP}>;${WIN_PATH}")
+            endforeach()
             string(REPLACE ";" "\\;" WIN_PATH "${WIN_PATH}")
         endif()

@@ -105,7 +108,7 @@

                 # Add environment
                 if(WIN32)
-                    set_tests_properties(${GTEST_GROUP_NAME}.${GTEST_NAME} PROPERTIES ENVIRONMENT "PATH=${WIN_PATH}")
+                    set_property(TEST ${GTEST_GROUP_NAME}.${GTEST_NAME} APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
                 endif()

                 foreach(property ${GTEST_ENVIRONMENTS})
@@ -127,8 +130,11 @@
                     endif()
                 endforeach()
             endif()
+            foreach(DEP ${GTEST_DEPENDENCIES})
+                set(WIN_PATH "$<TARGET_FILE_DIR:${DEP}>;${WIN_PATH}")
+            endforeach()
             string(REPLACE ";" "\\;" WIN_PATH "${WIN_PATH}")
-            set_tests_properties(${test} PROPERTIES ENVIRONMENT "PATH=${WIN_PATH}")
+            set_property(TEST ${test} APPEND PROPERTY ENVIRONMENT "PATH=${WIN_PATH}")
         endif()

         foreach(property ${GTEST_ENVIRONMENTS})


add date to cdash links

add date to cdash links

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -676,7 +676,8 @@
   endif()
   run_ctests(res)

-  message("CDASH LINK:\nhttps://cdash-ci.inria.fr/index.php?project=${CTEST_PROJECT_NAME}&filtercount=2&showfilters=1&filtercombine=and&field1=buildname&compare1=61&value1=${CTEST_BUILD_NAME}&field2=site&compare2=61&value2=${CTEST_SITE}")
+  string(TIMESTAMP TODAY "%Y-%m-%d")
+  message("CDASH LINK:\nhttps://cdash-ci.inria.fr/index.php?project=${CTEST_PROJECT_NAME}&date=${TODAY}&filtercount=2&showfilters=1&filtercombine=and&field1=buildname&compare1=61&value1=${CTEST_BUILD_NAME}&field2=site&compare2=61&value2=${CTEST_SITE}")

   if(NOT res EQUAL 0)
     message(SEND_ERROR "Some Tests failed.")