ENH: Create startmenu shortcuts for mapla and monteverdi.

--- CMake/CPackFunctions.cmake
+++ CMake/CPackFunctions.cmake
@@ -19,13 +19,16 @@
 #function(create_cpack_config application)
 function(create_cpack_config)

+
   #should we handle this when calling function ?
   #for now mapla has no specific version or it is same as monteverdi
-  SET(CPACK_PACKAGE_VERSION "${Monteverdi_VERSION_MAJOR}.${Monteverdi_VERSION_MINOR}.${Monteverdi_VERSION_PATCH}")
+  SET(CPACK_PACKAGE_VERSION "${Monteverdi_VERSION_MAJOR}.${Monteverdi_VERSION_MINOR}.${Monteverdi_VERSION_PATCH}${Monteverdi_VERSION_SUFFIX}")
   SET(CPACK_PACKAGE_VERSION_MAJOR "${Monteverdi_VERSION_MAJOR}")
   SET(CPACK_PACKAGE_VERSION_MINOR "${Monteverdi_VERSION_MINOR}")
   SET(CPACK_PACKAGE_VERSION_PATCH "${Monteverdi_VERSION_PATCH}")
-
+  #monteverdi short version string - eg: 3.0.0-beta
+  SET(PACKAGE_SHORT_VERSION_STRING ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}${Monteverdi_VERSION_SUFFIX})
+
   if(WIN32)
     set(arch_prefix win32)
     set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
@@ -34,6 +37,8 @@
       set(arch_prefix win64)
     endif()
     SET(CPACK_GENERATOR "NSIS")
+    SET(CPACK_NSIS_MODIFY_PATH OFF)
+        SET(CPACK_NSIS_CONTACT "contact@orfeo-toolbox.org")

     #RK: two packages.
     #STRING(TOLOWER ${application} application_)
@@ -47,18 +52,22 @@
     #   "CreateShortCut \\\"$SMPROGRAMS\\\\${application}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\${application}.lnk\\\" \\\"$INSTDIR\\\\bin\\\\${BATFILE_NAME}\\\" \\\" \\\" \\\"$INSTDIR\\\\bin\\\\${EXEFILE_NAME}\\\"
     # ")

-    SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
-      "CreateShortCut \\\"$SMPROGRAMS\\\\Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\Monteverdi.lnk\\\" \\\"$INSTDIR\\\\bin\\\\monteverdi.bat\\\" \\\" \\\" \\\"$INSTDIR\\\\bin\\\\monteverdi.exe\\\"
-    ")
-
-    LIST(APPEND CPACK_NSIS_EXTRA_INSTALL_COMMANDS
-      "CreateShortCut \\\"$SMPROGRAMS\\\\Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\Mapla.lnk\\\" \\\"$INSTDIR\\\\bin\\\\mapla.bat\\\" \\\" \\\" \\\"$INSTDIR\\\\bin\\\\mapla.exe\\\"
-    ")
-
-    SET(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
-      "Delete \\\"$SMPROGRAMS\\\\Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\Monteverdi.lnk\\\"  ")
-    LIST(APPEND CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
-    "Delete \\\"$SMPROGRAMS\\\\Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}\\\\Mapla.lnk\\\"  ")
+SET(application "Monteverdi")
+SET(startmenufolder "${application}-${PACKAGE_SHORT_VERSION_STRING}")
+
+#set(CPACK_NSIS_DEFINES "  !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"${startmenufolder} (${arch_prefix})\\\"")
+#SET(CPACK_PACKAGE_EXECUTABLES "monteverdi.bat" "Monteverdi")
+#SET(CPACK_CREATE_DESKTOP_LINKS "monteverdi.bat" )
+
+SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\monteverdi.exe")
+SET(CPACK_PACKAGE_ICON   "${Monteverdi_SOURCE_DIR}\\\\Data\\\\Icons\\\\monteverdi.ico")
+SET(CPACK_NSIS_CREATE_ICONS "CreateShortCut '$SMPROGRAMS\\\\${startmenufolder}\\\\Monteverdi.lnk'  '$INSTDIR\\\\bin\\\\monteverdi.bat' ")
+SET(CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\${startmenufolder}\\\\Mapla.lnk'     '$INSTDIR\\\\bin\\\\mapla.bat' ")
+SET(CPACK_NSIS_MUI_FINISHPAGE_RUN "monteverdi.bat")
+SET(CPACK_NSIS_DELETE_ICONS
+      "Delete \\\"$SMPROGRAMS\\\\${startmenufolder}\\\\Monteverdi.lnk\\\" ")
+SET(CPACK_NSIS_DELETE_ICONS_EXTRA
+      "Delete \\\"$SMPROGRAMS\\\\${startmenufolder}\\\\Mapla.lnk\\\" ")

   else(APPLE)
       set(arch_prefix Darwin)
@@ -67,7 +76,7 @@
     endif()
     SET(CPACK_GENERATOR "Bundle")
     SET(CPACK_BUNDLE_ICON "${Monteverdi_SOURCE_DIR}/Packaging/MacOS/Monteverdi.icns" )
-    SET(CPACK_BUNDLE_NAME "${application}-${CPACK_PACKAGE_VERSION_MAJOR}.${Monteverdi_VERSION_MINOR}" )
+    SET(CPACK_BUNDLE_NAME "${application}-${PACKAGE_SHORT_VERSION_STRING}" )
     SET(CPACK_BUNDLE_PLIST "${CMAKE_BINARY_DIR}/Packaging/MacOS/${application}-Info.plist" )
     SET(CPACK_BUNDLE_STARTUP_COMMAND "${Monteverdi_SOURCE_DIR}/Packaging/MacOS/${application}-StartupCommand" )

@@ -114,27 +123,25 @@

   SET(CPACK_COMPONENT_RESOURCES_HIDDEN ON)

+  if(APPLE)
   SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${application};ALL;/")
-
-  SET(CPACK_PACKAGE_VENDOR "CNES")
-
-
-  #RK: two packages
-  #SET(CPACK_PACKAGE_NAME "${application}")
-  SET(CPACK_PACKAGE_NAME "Monteverdi")
-
-  #RK: for two packages -${application} ->  Monteverdi
-  SET(CPACK_NSIS_DISPLAY_NAME "Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
-  SET(CPACK_NSIS_PACKAGE_NAME "Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
-  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
-  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
-
-  SET(CPACK_PACKAGE_FILE_NAME "Monteverdi-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${arch_prefix}")
+  else(WIN32)
+    SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};ALL;ALL;/")
+  endif()
+  SET(CPACK_PACKAGE_VENDOR "OTB Team")
+
+  SET(CPACK_PACKAGE_NAME "${application}")
+  SET(CPACK_NSIS_DISPLAY_NAME "${application}-${PACKAGE_SHORT_VERSION_STRING}")
+  SET(CPACK_NSIS_PACKAGE_NAME "${application}-${PACKAGE_SHORT_VERSION_STRING}")
+  SET(CPACK_PACKAGE_INSTALL_DIRECTORY "${application}-${PACKAGE_SHORT_VERSION_STRING}")
+  SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${application}-${PACKAGE_SHORT_VERSION_STRING}")
+  SET(CPACK_PACKAGE_FILE_NAME "${application}-${CPACK_PACKAGE_VERSION}-${arch_prefix}")

   INCLUDE(InstallRequiredSystemLibraries)
   INCLUDE(CPack)

 endfunction(create_cpack_config)
+

 function(configure_app_package app with_otb_apps)


rust: find cargo with find_program to give a better error message when cargo isn't available

Summary:
If you build Watchman from source on a machine without cargo, the
error message was confusing. You'd see "command not found" somewhere
mixed into ninja's output.

Change RustStaticLibrary, which is only used by Watchman and EdenFS,
to find cargo with find_program instead of guessing its name and
assuming it exists. This gives a much less confusing error message at
CMake configure time.

Reviewed By: genevievehelsel

Differential Revision: D40441374

fbshipit-source-id: eeafe615616775c660c700e14cf1f6b2fd9715a8

--- build/fbcode_builder/CMake/RustStaticLibrary.cmake
+++ build/fbcode_builder/CMake/RustStaticLibrary.cmake
@@ -57,6 +57,8 @@
     "directory = \"${ESCAPED_RUST_VENDORED_CRATES_DIR}\"\n"
   )
 endif()
+
+find_program(CARGO_COMMAND cargo REQUIRED)

 # Cargo is a build system in itself, and thus will try to take advantage of all
 # the cores on the system. Unfortunately, this conflicts with Ninja, since it
@@ -119,11 +121,6 @@
   set(staticlib_name "${CMAKE_STATIC_LIBRARY_PREFIX}${crate_name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(rust_staticlib "${CMAKE_CURRENT_BINARY_DIR}/${target_dir}/${staticlib_name}")

-  set(cargo_cmd cargo)
-  if(WIN32)
-    set(cargo_cmd cargo.exe)
-  endif()
-
   if(DEFINED ARG_FEATURES)
     set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
   else()
@@ -142,7 +139,7 @@
       "${CMAKE_COMMAND}" -E env
       "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
       ${extra_cargo_env}
-      ${cargo_cmd}
+      ${CARGO_COMMAND}
       ${cargo_flags}
     COMMENT "Building Rust crate '${crate_name}'..."
     JOB_POOL rust_job_pool
@@ -195,11 +192,6 @@
     set(features )
   endif()

-  set(cargo_cmd cargo)
-  if(WIN32)
-    set(cargo_cmd cargo.exe)
-  endif()
-
   if(DEFINED ARG_FEATURES)
     set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
   else()
@@ -219,7 +211,7 @@
       "${CMAKE_COMMAND}" -E env
       "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
       ${extra_cargo_env}
-      ${cargo_cmd}
+      ${CARGO_COMMAND}
       ${cargo_flags}
     COMMENT "Building Rust executable '${crate_name}'..."
     JOB_POOL rust_job_pool


Update ydbcmake directory with latest commits

Adds option to embed the source code into the shared object so $TEXT
works as intended

--- ydbcmake/CMakeMUMPSInformation.cmake
+++ ydbcmake/CMakeMUMPSInformation.cmake
@@ -29,12 +29,23 @@

 # Option to suppress mumps compiler warnings
 option(MUMPS_NOWARNING "Disable warnings and ignore status code from MUMPS compiler")
+option(MUMPS_EMBED_SOURCE "Embed source code in generated shared object" ON)
+option(MUMPS_DYNAMIC_LITERALS "Enable dynamic loading of source code literals" OFF)
+
 set(CMAKE_MUMPS_COMPILE_OBJECT "LC_ALL=\"${LC_ALL}\" ydb_chset=\"${ydb_chset}\" ydb_icu_version=\"${icu_version}\" <CMAKE_MUMPS_COMPILER> -object=<OBJECT>")

+if(MUMPS_EMBED_SOURCE)
+  set(CMAKE_MUMPS_COMPILE_OBJECT "${CMAKE_MUMPS_COMPILE_OBJECT} -embed_source")
+endif()
+
+if(MUMPS_DYNAMIC_LITERALS)
+  set(CMAKE_MUMPS_COMPILE_OBJECT "${CMAKE_MUMPS_COMPILE_OBJECT} -dynamic_literals")
+endif()
+
 if(MUMPS_NOWARNING)
-  set(CMAKE_MUMPS_COMPILE_OBJECT "${CMAKE_MUMPS_COMPILE_OBJECT}  -nowarning <SOURCE> || true")
+  set(CMAKE_MUMPS_COMPILE_OBJECT "${CMAKE_MUMPS_COMPILE_OBJECT} -nowarning <SOURCE> || true")
 else()
-  set(CMAKE_MUMPS_COMPILE_OBJECT "${CMAKE_MUMPS_COMPILE_OBJECT}  <SOURCE>")
+  set(CMAKE_MUMPS_COMPILE_OBJECT "${CMAKE_MUMPS_COMPILE_OBJECT} <SOURCE>")
 endif()

 set(CMAKE_MUMPS_LINK_EXECUTABLE "")


Fixed install directory for include files.

--- CMake/Macros.cmake
+++ CMake/Macros.cmake
@@ -171,7 +171,7 @@
   install(TARGETS ${target}
           # IMPORTANT: Add the target library to the "export-set"
           EXPORT GExL_LibraryDepends
-          PUBLIC_HEADER DESTINATION include/GExL COMPONENT devel
+          PUBLIC_HEADER DESTINATION include COMPONENT devel
           RUNTIME DESTINATION bin COMPONENT bin
           LIBRARY DESTINATION lib COMPONENT shlib
           ARCHIVE DESTINATION lib COMPONENT devel)
@@ -179,7 +179,7 @@
   # install Core library include files
   if(THIS_HEADER_DIR)
     install(DIRECTORY ${THIS_HEADER_DIR}
-            DESTINATION include/GExL
+            DESTINATION include
             COMPONENT devel
             PATTERN ".hg" EXCLUDE)
   endif(THIS_HEADER_DIR)


Fix build process not refreshing core release on existing builds.

If the core release was already created, we weren't always coping over
the latest files to the release directory.

--- build/cmake/core.cmake
+++ build/cmake/core.cmake
@@ -9,7 +9,7 @@
     ${STAMP_DIR}/core-web-app-bundle
     ${STAMP_DIR}/core-lua-deps
   COMMAND mkdir -p ${CORE_SHARED_BUILD_DIR}/vendor
-  COMMAND rsync -a --delete-after ${VENDOR_DIR}/ ${CORE_SHARED_BUILD_DIR}/vendor/
+  COMMAND rsync -av --delete-after ${VENDOR_DIR}/ ${CORE_SHARED_BUILD_DIR}/vendor/
   COMMAND touch -c ${CORE_SHARED_BUILD_DIR}/vendor
 )

@@ -18,7 +18,7 @@
   OUTPUT ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets
   DEPENDS ${STAMP_DIR}/core-web-app-assets-precompiled
   COMMAND mkdir -p ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets
-  COMMAND rsync -a --delete-after ${WORK_DIR}/src/web-app/public/web-assets/ ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets/
+  COMMAND rsync -av --delete-after ${WORK_DIR}/src/web-app/public/web-assets/ ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets/
   COMMAND touch -c ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets
 )

@@ -43,17 +43,18 @@

 # Copy the code into a build release directory.
 add_custom_command(
-  OUTPUT ${STAMP_DIR}/core-build-release-dir
+  OUTPUT ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
   COMMAND mkdir -p ${CORE_RELEASE_BUILD_DIR}
-  COMMAND rsync -a --delete-after --delete-excluded "--filter=:- ${CMAKE_SOURCE_DIR}/.gitignore" --include=/templates/etc/perp/.boot --exclude=.* --exclude=/templates/etc/test-env* --exclude=/templates/etc/perp/test-env* --exclude=/src/api-umbrella/web-app/spec --exclude=/src/api-umbrella/web-app/app/assets --exclude=/src/api-umbrella/hadoop-analytics --include=/bin/*** --include=/config/*** --include=/LICENSE.txt --include=/templates/*** --include=/src/*** --exclude=* ${CMAKE_SOURCE_DIR}/ ${CORE_RELEASE_BUILD_DIR}/
-  COMMAND touch ${STAMP_DIR}/core-build-release-dir
+  COMMAND rsync -av --delete-after --delete-excluded "--filter=:- ${CMAKE_SOURCE_DIR}/.gitignore" --include=/templates/etc/perp/.boot --exclude=.* --exclude=/templates/etc/test-env* --exclude=/templates/etc/perp/test-env* --exclude=/src/api-umbrella/web-app/spec --exclude=/src/api-umbrella/web-app/app/assets --exclude=/src/api-umbrella/hadoop-analytics --include=/bin/*** --include=/config/*** --include=/LICENSE.txt --include=/templates/*** --include=/src/*** --exclude=* ${CMAKE_SOURCE_DIR}/ ${CORE_RELEASE_BUILD_DIR}/
+  COMMAND rm -f ${STAMP_DIR}/core-build-release-dir*
+  COMMAND touch ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
 )

 # Create a symlink to the shared vendor directory within the release.
 add_custom_command(
   OUTPUT ${CORE_RELEASE_BUILD_DIR}/vendor
   DEPENDS
-    ${STAMP_DIR}/core-build-release-dir
+    ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
     ${CORE_SHARED_BUILD_DIR}/vendor
   WORKING_DIRECTORY ${CORE_RELEASE_BUILD_DIR}
   COMMAND ln -snf ../../shared/vendor ./vendor
@@ -64,7 +65,7 @@
 add_custom_command(
   OUTPUT ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app/.bundle/config
   DEPENDS
-    ${STAMP_DIR}/core-build-release-dir
+    ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
     ${CORE_RELEASE_BUILD_DIR}/vendor
   WORKING_DIRECTORY ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app
   # Disable all non-production gems and remove any old, unused gems.
@@ -78,7 +79,7 @@
 add_custom_command(
   OUTPUT ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets
   DEPENDS
-    ${STAMP_DIR}/core-build-release-dir
+    ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
     ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets
   WORKING_DIRECTORY ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app/public
   COMMAND ln -snf ../../../../../../shared/src/api-umbrella/web-app/public/web-assets ./web-assets
@@ -89,7 +90,7 @@
 add_custom_command(
   OUTPUT ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app/tmp
   DEPENDS
-    ${STAMP_DIR}/core-build-release-dir
+    ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
     ${CORE_SHARED_BUILD_DIR}/src/api-umbrella/web-app/tmp
   WORKING_DIRECTORY ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app
   COMMAND ln -snf ../../../../../shared/src/api-umbrella/web-app/tmp ./tmp
@@ -102,7 +103,7 @@
 add_custom_command(
   OUTPUT ${STAMP_DIR}/core-build-release
   DEPENDS
-    ${STAMP_DIR}/core-build-release-dir
+    ${STAMP_DIR}/core-build-release-dir-${RELEASE_TIMESTAMP}
     ${CORE_RELEASE_BUILD_DIR}/vendor
     ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app/.bundle/config
     ${CORE_RELEASE_BUILD_DIR}/src/api-umbrella/web-app/public/web-assets
@@ -115,7 +116,7 @@
   OUTPUT ${STAGE_EMBEDDED_DIR}/apps/core/shared
   DEPENDS ${STAMP_DIR}/core-build-shared
   COMMAND mkdir -p ${STAGE_EMBEDDED_DIR}/apps/core/shared
-  COMMAND rsync -a --delete-after ${CORE_SHARED_BUILD_DIR}/ ${STAGE_EMBEDDED_DIR}/apps/core/shared/
+  COMMAND rsync -av --delete-after ${CORE_SHARED_BUILD_DIR}/ ${STAGE_EMBEDDED_DIR}/apps/core/shared/
   COMMAND touch -c ${STAGE_EMBEDDED_DIR}/apps/core/shared
 )


Merging branches back in order

Merging branches back in order

--- projects/CannyToggle/CMakeFiles/Makefile.cmake
+++ projects/CannyToggle/CMakeFiles/Makefile.cmake
@@ -10,88 +10,24 @@
   "CMakeFiles/3.6.2/CMakeCCompiler.cmake"
   "CMakeFiles/3.6.2/CMakeCXXCompiler.cmake"
   "CMakeFiles/3.6.2/CMakeSystem.cmake"
-  "CMakeFiles/feature_tests.c"
-  "CMakeFiles/feature_tests.cxx"
   "CMakeLists.txt"
   "/usr/local/share/OpenCV/OpenCVConfig-version.cmake"
   "/usr/local/share/OpenCV/OpenCVConfig.cmake"
   "/usr/local/share/OpenCV/OpenCVModules-release.cmake"
   "/usr/local/share/OpenCV/OpenCVModules.cmake"
-  "/usr/share/cmake/Modules/CMakeCCompiler.cmake.in"
-  "/usr/share/cmake/Modules/CMakeCCompilerABI.c"
   "/usr/share/cmake/Modules/CMakeCInformation.cmake"
-  "/usr/share/cmake/Modules/CMakeCXXCompiler.cmake.in"
-  "/usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp"
   "/usr/share/cmake/Modules/CMakeCXXInformation.cmake"
   "/usr/share/cmake/Modules/CMakeCommonLanguageInclude.cmake"
-  "/usr/share/cmake/Modules/CMakeCompilerIdDetection.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineCCompiler.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineCompileFeatures.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineCompilerABI.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineCompilerId.cmake"
-  "/usr/share/cmake/Modules/CMakeDetermineSystem.cmake"
-  "/usr/share/cmake/Modules/CMakeFindBinUtils.cmake"
   "/usr/share/cmake/Modules/CMakeGenericSystem.cmake"
   "/usr/share/cmake/Modules/CMakeLanguageInformation.cmake"
   "/usr/share/cmake/Modules/CMakeParseArguments.cmake"
-  "/usr/share/cmake/Modules/CMakeParseImplicitLinkInfo.cmake"
-  "/usr/share/cmake/Modules/CMakeSystem.cmake.in"
   "/usr/share/cmake/Modules/CMakeSystemSpecificInformation.cmake"
   "/usr/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake"
-  "/usr/share/cmake/Modules/CMakeTestCCompiler.cmake"
-  "/usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake"
-  "/usr/share/cmake/Modules/CMakeTestCompilerCommon.cmake"
-  "/usr/share/cmake/Modules/CMakeUnixFindMake.cmake"
-  "/usr/share/cmake/Modules/Compiler/ADSP-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Borland-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Clang-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
-  "/usr/share/cmake/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Cray-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/GHS-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/GNU-C-FeatureTests.cmake"
   "/usr/share/cmake/Modules/Compiler/GNU-C.cmake"
-  "/usr/share/cmake/Modules/Compiler/GNU-CXX-FeatureTests.cmake"
   "/usr/share/cmake/Modules/Compiler/GNU-CXX.cmake"
-  "/usr/share/cmake/Modules/Compiler/GNU-DetermineCompiler.cmake"
   "/usr/share/cmake/Modules/Compiler/GNU.cmake"
-  "/usr/share/cmake/Modules/Compiler/HP-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/HP-CXX-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/IAR-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
-  "/usr/share/cmake/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake"
-  "/usr/share/cmake/Modules/Compiler/Intel-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/MIPSpro-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/MSVC-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/PGI-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/PathScale-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/SCO-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/TI-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/Watcom-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/XL-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/XL-CXX-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
-  "/usr/share/cmake/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake"
   "/usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake"
   "/usr/share/cmake/Modules/FindPackageMessage.cmake"
-  "/usr/share/cmake/Modules/Internal/FeatureTesting.cmake"
-  "/usr/share/cmake/Modules/Platform/Linux-CXX.cmake"
   "/usr/share/cmake/Modules/Platform/Linux-GNU-C.cmake"
   "/usr/share/cmake/Modules/Platform/Linux-GNU-CXX.cmake"
   "/usr/share/cmake/Modules/Platform/Linux-GNU.cmake"
@@ -107,11 +43,6 @@

 # Byproducts of CMake generate step:
 set(CMAKE_MAKEFILE_PRODUCTS
-  "CMakeFiles/3.6.2/CMakeSystem.cmake"
-  "CMakeFiles/3.6.2/CMakeCCompiler.cmake"
-  "CMakeFiles/3.6.2/CMakeCXXCompiler.cmake"
-  "CMakeFiles/3.6.2/CMakeCCompiler.cmake"
-  "CMakeFiles/3.6.2/CMakeCXXCompiler.cmake"
   "CMakeFiles/CMakeDirectoryInformation.cmake"
   )


fix: basis_set_target_install_rpath to semicolon-separated list [BASIS]

--- CMake/Basis/TargetTools.cmake
+++ CMake/Basis/TargetTools.cmake
@@ -428,6 +428,9 @@
 #
 # Another reason is the mapping of build target names to fully-qualified
 # build target names as used by BASIS (see basis_get_target_uid()).
+#
+# Only link dependencies added with this function are considered for the setting
+# of the INSTALL_RPATH of executable targets (see basis_set_target_install_rpath()).
 #
 # Example:
 # @code
@@ -2579,7 +2582,6 @@
     list (REMOVE_DUPLICATES INSTALL_RPATH)
   endif ()
   # set INSTALL_RPATH property
-  string (REPLACE ";" ":" INSTALL_RPATH "${INSTALL_RPATH}")
   set_target_properties (${TARGET_UID} PROPERTIES INSTALL_RPATH "${INSTALL_RPATH}")
   if (BASIS_DEBUG)
     message ("**    INSTALL_RPATH: [${INSTALL_RPATH}]")


FindOGRE.cmake should pick up OGRE_SDK defined as a CMake variable before the environment variable

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -88,7 +88,7 @@
   )
 endif ()
 set(OGRE_PREFIX_PATH
-  ${OGRE_HOME} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
+  ${OGRE_HOME} ${OGRE_SDK} ${ENV_OGRE_HOME} ${ENV_OGRE_SDK}
   ${OGRE_PREFIX_GUESSES}
 )
 create_search_paths(OGRE)


[OGRE-282] Remove strange Apple specific code in FindOgre

--HG--
branch : v1-9

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -232,9 +232,6 @@

 make_library_set(OGRE_LIBRARY)

-if(APPLE)
-  set(OGRE_LIBRARY_DBG ${OGRE_LIB_SEARCH_PATH})
-endif()
 if (OGRE_INCOMPATIBLE)
   set(OGRE_LIBRARY "NOTFOUND")
 endif ()


COMP: updated the test image in the mitk-data repository

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag b6cf7fd6) # first 8 characters of hash-tag
+  set(revision_tag 53189e8e) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


added haswell to supported architectures

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -71,7 +71,9 @@
 	if(_vendor_id STREQUAL "GenuineIntel")
 if(_cpu_family EQUAL 6)
 # Any recent Intel CPU except NetBurst
-if(_cpu_model EQUAL 62)
+if(_cpu_model EQUAL 63)
+	set(TARGET_ARCHITECTURE "haswell")
+    elseif(_cpu_model EQUAL 62)
 	set(TARGET_ARCHITECTURE "ivy-bridge")
 	elseif(_cpu_model EQUAL 58)
 	set(TARGET_ARCHITECTURE "ivy-bridge")
@@ -165,6 +167,11 @@
 	list(APPEND _march_flag_list "corei7")
 	list(APPEND _march_flag_list "core2")
 	list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
+	elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+	list(APPEND _march_flag_list "core-avx-i")
+	list(APPEND _march_flag_list "corei7-avx")
+	list(APPEND _march_flag_list "core2")
+	list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c")
 	elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
 	list(APPEND _march_flag_list "core-avx-i")
 	list(APPEND _march_flag_list "corei7-avx")


fix v2.0.5 version

fix v2.0.5 version

--- cmake/mimalloc-config-version.cmake
+++ cmake/mimalloc-config-version.cmake
@@ -1,12 +1,6 @@
-<<<<<<< HEAD
 set(mi_version_major 2)
 set(mi_version_minor 0)
-set(mi_version_patch 4)
-=======
-set(mi_version_major 1)
-set(mi_version_minor 7)
 set(mi_version_patch 5)
->>>>>>> dev
 set(mi_version ${mi_version_major}.${mi_version_minor})

 set(PACKAGE_VERSION ${mi_version})


When submitting to CDash, retry three times with a three seconds delay.

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -121,7 +121,7 @@
               RETURN_VALUE res
               NUMBER_ERRORS num_errors
               NUMBER_WARNINGS num_warnings)
-  ctest_submit(PARTS Build)
+  ctest_submit(PARTS Build RETRY_DELAY 3 RETRY_COUNT 3)

   if(num_errors)
     math(EXPR build_errors "${build_errors} + ${num_errors}")
@@ -150,7 +150,7 @@
              EXCLUDE ${TEST_TO_EXCLUDE_REGEX}
              RETURN_VALUE res
             )
-  ctest_submit(PARTS Test)
+  ctest_submit(PARTS Test RETRY_DELAY 3 RETRY_COUNT 3)

   if(res)
     math(EXPR test_errors "${test_errors} + 1")
@@ -167,7 +167,7 @@
   if(WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
     message("----------- [ Coverage ${label} ] -----------")
     ctest_coverage(BUILD "${build_dir}" LABELS ${label})
-    ctest_submit(PARTS Coverage)
+    ctest_submit(PARTS Coverage RETRY_DELAY 3 RETRY_COUNT 3)
   endif()

   if(WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
@@ -180,7 +180,7 @@
       set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --show-reachable=no --show-possibly-lost=no --workaround-gcc296-bugs=yes --num-callers=50")
     endif()
     ctest_memcheck(BUILD "${build_dir}" INCLUDE_LABEL ${label})
-    ctest_submit(PARTS MemCheck)
+    ctest_submit(PARTS MemCheck RETRY_DELAY 3 RETRY_COUNT 3)
   endif()

 endfunction()
@@ -275,16 +275,16 @@
     endif()

     # Project.xml is generated during the superbuild configure step
-    ctest_submit(FILES "${CTEST_BINARY_DIRECTORY}/Project.xml")
+    ctest_submit(FILES "${CTEST_BINARY_DIRECTORY}/Project.xml" RETRY_DELAY 3 RETRY_COUNT 3)

     ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")

-    ctest_submit(PARTS Configure)
+    ctest_submit(PARTS Configure RETRY_DELAY 3 RETRY_COUNT 3)

     # submit the update results *after* the submitting the Configure info,
     # otherwise CDash is somehow confused and cannot add the update info
     # to the superbuild project
-    ctest_submit(PARTS Update)
+    ctest_submit(PARTS Update RETRY_DELAY 3 RETRY_COUNT 3)

     # To get CTEST_PROJECT_SUBPROJECTS and CTEST_PROJECT_EXTERNALS definition
     include("${CTEST_BINARY_DIRECTORY}/CTestConfigSubProject.cmake")
@@ -363,7 +363,7 @@
       RETURN_VALUE res
     )
     ctest_read_custom_files("${CTEST_BINARY_DIRECTORY}")
-    ctest_submit(PARTS Configure)
+    ctest_submit(PARTS Configure RETRY_DELAY 3 RETRY_COUNT 3)

     if(res)
       math(EXPR build_errors "${build_errors} + 1")
@@ -436,18 +436,18 @@
     if(WITH_COVERAGE AND CTEST_COVERAGE_COMMAND)
       message("----------- [ Global coverage ] -----------")
       ctest_coverage(BUILD "${build_dir}" APPEND)
-      ctest_submit(PARTS Coverage)
+      ctest_submit(PARTS Coverage RETRY_DELAY 3 RETRY_COUNT 3)
     endif()

     # Global dynamic analysis ...
     if(WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
       message("----------- [ Global memcheck ] -----------")
       ctest_memcheck(BUILD "${build_dir}")
-      ctest_submit(PARTS MemCheck)
+      ctest_submit(PARTS MemCheck RETRY_DELAY 3 RETRY_COUNT 3)
     endif()

     # Note should be at the end
-    ctest_submit(PARTS Notes)
+    ctest_submit(PARTS Notes RETRY_DELAY 3 RETRY_COUNT 3)

     # Send status to the "CDash Web Admin"
     if(CDASH_ADMIN_URL_PREFIX)


Ident macro.

Ident macro.

--- HWShading/ShaderText.cmake
+++ HWShading/ShaderText.cmake
@@ -1,36 +1,36 @@
 MACRO(SHADER_TO_HEADER ShaderName ShaderFile HeaderFile)

-FILE (READ ${ShaderFile} FILE_CONTENTS)
+  FILE (READ ${ShaderFile} FILE_CONTENTS)

-STRING(REGEX REPLACE
- "\n"
-  "\\\\n"
-  FILE_CONTENTS "${FILE_CONTENTS}"
-)
+  STRING(REGEX REPLACE
+   "\n"
+    "\\\\n"
+    FILE_CONTENTS "${FILE_CONTENTS}"
+  )

-STRING (REGEX REPLACE
-  "\r"
-  "\\\\r"
-  FILE_CONTENTS "${FILE_CONTENTS}"
-)
+  STRING (REGEX REPLACE
+    "\r"
+    "\\\\r"
+    FILE_CONTENTS "${FILE_CONTENTS}"
+  )

-# Construct the file in a temporary location, compare with existing and copy if different.
-SET(TemporaryFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/ShadToHead.tmp)
+  # Construct the file in a temporary location, compare with existing and copy if different.
+  SET(TemporaryFile ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/ShadToHead.tmp)

-SET(OUTPUT_FILE ${TemporaryFile})
-SET(DEFINE_NAME  "_${ShaderName}_h_")
-STRING(REGEX REPLACE "/" "_" DEFINE_NAME ${DEFINE_NAME})
-STRING(REGEX REPLACE "\\." "_" DEFINE_NAME ${DEFINE_NAME})
-STRING(REGEX REPLACE ":" "_" DEFINE_NAME ${DEFINE_NAME})
+  SET(OUTPUT_FILE ${TemporaryFile})
+  SET(DEFINE_NAME  "_${ShaderName}_h_")
+  STRING(REGEX REPLACE "/" "_" DEFINE_NAME ${DEFINE_NAME})
+  STRING(REGEX REPLACE "\\." "_" DEFINE_NAME ${DEFINE_NAME})
+  STRING(REGEX REPLACE ":" "_" DEFINE_NAME ${DEFINE_NAME})

-FILE(WRITE ${OUTPUT_FILE} "#ifndef bmia_${DEFINE_NAME}\n")
-FILE(APPEND ${OUTPUT_FILE} "#define bmia_${DEFINE_NAME}\n\n")
+  FILE(WRITE ${OUTPUT_FILE} "#ifndef bmia_${DEFINE_NAME}\n")
+  FILE(APPEND ${OUTPUT_FILE} "#define bmia_${DEFINE_NAME}\n\n")

-FILE(APPEND ${OUTPUT_FILE} "#define ${ShaderName} \"${FILE_CONTENTS}\"\n\n")
+  FILE(APPEND ${OUTPUT_FILE} "#define ${ShaderName} \"${FILE_CONTENTS}\"\n\n")

-FILE(APPEND ${OUTPUT_FILE} "#endif // bmia_${DEFINE_NAME}\n")
+  FILE(APPEND ${OUTPUT_FILE} "#endif // bmia_${DEFINE_NAME}\n")

-# Copy fresh header file only if contents differ from a previously generated version.
-EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TemporaryFile}" "${HeaderFile}")
+  # Copy fresh header file only if contents differ from a previously generated version.
+  EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${TemporaryFile}" "${HeaderFile}")

-ENDMACRO(SHADER_TO_HEADER)
+ENDMACRO()


Add LIBBPF_LIBRARIES to bpf_attach_kprobe build

When using libbcc-no-libbpf.so as bcc library,
we need to link the test also with libbpf.so,
otherwise the test compilation fails on missing
libbpf symbols.

/usr/bin/c++   -DLIBBCC_ATTACH_KPROBE_SIX_ARGS_SIGNATURE  \
 CMakeFiles/cmTC_ddd8d.dir/src.cxx.o  -o cmTC_ddd8d       \
 -Wl,-rpath,/opt/bcc/lib64 /opt/bcc/lib64/libbcc-no-libbpf.so
/usr/bin/ld: /opt/bcc/lib64/libbcc-no-libbpf.so: undefined reference to `ring_buffer__poll@LIBBPF_0.0.9'
/usr/bin/ld: /opt/bcc/lib64/libbcc-no-libbpf.so: undefined reference to `ring_buffer__new@LIBBPF_0.0.9'
/usr/bin/ld: /opt/bcc/lib64/libbcc-no-libbpf.so: undefined reference to `ring_buffer__add@LIBBPF_0.0.9'
/usr/bin/ld: /opt/bcc/lib64/libbcc-no-libbpf.so: undefined reference to `ring_buffer__consume@LIBBPF_0.0.9'
/usr/bin/ld: /opt/bcc/lib64/libbcc-no-libbpf.so: undefined reference to `ring_buffer__free@LIBBPF_0.0.9'

Signed-off-by: Jiri Olsa <2c6594f608aa3d41e98d48846a6328831f7084ad@redhat.com>

--- cmake/FindLibBcc.cmake
+++ cmake/FindLibBcc.cmake
@@ -81,7 +81,7 @@
   find_package(LibZ)
   SET(CMAKE_REQUIRED_LIBRARIES ${LIBBCC_BPF_LIBRARY_STATIC} ${LIBBPF_LIBRARIES} ${LIBELF_LIBRARIES} ${LIBZ_LIBRARIES})
 else()
-  SET(CMAKE_REQUIRED_LIBRARIES ${LIBBCC_LIBRARIES})
+  SET(CMAKE_REQUIRED_LIBRARIES ${LIBBCC_LIBRARIES} ${LIBBPF_LIBRARIES})
 endif()

 INCLUDE(CheckCXXSourceCompiles)


Add memory sanitizer

Add memory sanitizer

--- cmake/Sanitizers.cmake
+++ cmake/Sanitizers.cmake
@@ -13,6 +13,12 @@
     set(SANITIZERS "")
     if(ENABLE_SANITIZER_ADDRESS)
       list(APPEND SANITIZERS "address")
+    endif()
+
+    option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE)
+    set(SANITIZERS "")
+    if(ENABLE_SANITIZER_MEMORY)
+      list(APPEND SANITIZERS "memory")
     endif()

     option(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR


cmake: atomic rename to fix toolchain cache creation race

While this race seems unlikely and harmless let's play it safe and
implement the usual solution: temporary file + atomic rename.

The race is unlikely and maybe even harmless because:

- Only sanitycheck seems to invoke cmake concurrently.
- Users rarely delete their ~/.cache/zephyr/ToolchainCapabilityDatabase/
- All concurrent cmake processes write the same, single byte to the same
  files.
- Creating a single byte is at least very fast, so extremely short
  window for others to read an empty file.

For additional background see links in issue #9992

Signed-off-by: Marc Herbert <77e7c7d746b52c6eb01119b65a031ae1f650246d@intel.com>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -679,10 +679,30 @@

   # Populate the cache
   if(NOT (EXISTS ${key_path}))
+
+    # This is racy. As often with race conditions, this one can easily be
+    # made worse and demonstrated with a simple delay:
+    #    execute_process(COMMAND "sleep" "5")
+    # Delete the cache, add the sleep above and run sanitycheck with a
+    # large number of JOBS. Once it's done look at the log.txt file
+    # below and you will see that concurrent cmake processes created the
+    # same files multiple times.
+
+    # While there are a number of reasons why this race seems both very
+    # unlikely and harmless, let's play it safe anyway and write to a
+    # private, temporary file first. All modern filesystems seem to
+    # support at least one atomic rename API and cmake's file(RENAME
+    # ...) officially leverages that.
+    string(RANDOM LENGTH 8 tempsuffix)
+
     file(
       WRITE
-      ${key_path}
+      "${key_path}_tmp_${tempsuffix}"
       ${inner_check}
+      )
+    file(
+      RENAME
+      "${key_path}_tmp_${tempsuffix}" "${key_path}"
       )

     # Populate a metadata file (only intended for trouble shooting)


more fix for the libminizip issue for linux.

--- indra/cmake/LLPrimitive.cmake
+++ indra/cmake/LLPrimitive.cmake
@@ -24,6 +24,7 @@
     set(LLPRIMITIVE_LIBRARIES
         llprimitive
         collada14dom
+        minizip
         xml2
         pcrecpp
         pcre


Mathematica 12.1 compatibility

Mathematica 12.1 compatibility

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -245,7 +245,8 @@
 	set (_MathematicaApps "Mathematica" "Wolfram Desktop" "Wolfram Engine" "gridMathematica Server")
 	# Mathematica product versions in order of preference
 	set (_MathematicaVersions
-		"12.0" "11.3" "11.2" "11.1" "11.0"
+		"12.1" "12.0"
+		"11.3" "11.2" "11.1" "11.0"
 		"10.4" "10.3" "10.2" "10.1" "10.0"
 		"9.0" "8.0" "7.0" "6.0" "5.2")
 	# search for explicitly requested application version first
@@ -647,7 +648,17 @@
 endmacro()

 macro (_get_supported_systemIDs _version _outSystemIDs)
-	if (NOT "${_version}" VERSION_LESS "10.0")
+	if (NOT "${_version}" VERSION_LESS "12.1")
+		set (${_outSystemIDs}
+			"Windows-x86-64"
+			"Linux-x86-64" "Linux-ARM"
+			"MacOSX-x86-64")
+	elseif (NOT "${_version}" VERSION_LESS "11.3")
+		set (${_outSystemIDs}
+			"Windows" "Windows-x86-64"
+			"Linux-x86-64" "Linux-ARM"
+			"MacOSX-x86-64")
+	elseif (NOT "${_version}" VERSION_LESS "10.0")
 		set (${_outSystemIDs}
 			"Windows" "Windows-x86-64"
 			"Linux" "Linux-x86-64" "Linux-ARM"
@@ -704,8 +715,16 @@
 		else()
 			list (APPEND ${_outSystemIDs} "Windows-x86-64")
 		endif()
-		# Windows x64 can run x86 through WoW64
-		list (APPEND ${_outSystemIDs} "Windows")
+		if (Mathematica_VERSION)
+			# Mathematica 12.1 dropped support for x86
+			if ("${Mathematica_VERSION}" VERSION_LESS "12.1")
+				# Windows x64 can run x86 through WoW64
+				list (APPEND ${_outSystemIDs} "Windows")
+			endif()
+		else()
+			# Windows x64 can run x86 through WoW64
+			list (APPEND ${_outSystemIDs} "Windows")
+		endif()
 	elseif ("${_systemID}" MATCHES "MacOSX|Darwin")
 		if ("${_systemID}" MATCHES "MacOSX-x86")
 			if (Mathematica_VERSION)


Activate Wunused-parameters on gcc

Activate Wunused-parameters on gcc

--- Compiler.cmake
+++ Compiler.cmake
@@ -14,7 +14,8 @@
   set(CMAKE_COMPILER_IS_GNUCXX_PURE ON)
 endif()

-set(COMMON_GCC_FLAGS "-Wall -Wextra -Winvalid-pch -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter")
+set(COMMON_GCC_FLAGS
+  "-Wall -Wextra -Winvalid-pch -Winit-self -Wno-unknown-pragmas")

 # GCC (+clang)
 if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)


Make available C_DIALECT_OPT_XXX variables for selecting C dialect.

If known, Compiler.cmake sets the four variables C_DIALECT_OPT_C89,
C_DIALECT_OPT_C89EXT, C_DIALECT_OPT_C99 and C_DIALECT_OPT_C99EXT,
corresponding to the compiler options to set the corresponding
C dialects: C89/C90, C89/90 with compiler extensions, C99, and
C99 with compiler extensions.

This allows projects to specify C dialect on a per target or project
basis.

--- Compiler.cmake
+++ Compiler.cmake
@@ -11,6 +11,10 @@
 #
 # Output Variables
 # * GCC_COMPILER_VERSION The compiler version if gcc is used
+# * C_DIALECT_OPT_C89    Compiler flag to select C89 C dialect
+# * C_DIALECT_OPT_C89EXT Compiler flag to select C89 C dialect with extensions
+# * C_DIALECT_OPT_C99    Compiler flag to select C99 C dialect
+# * C_DIALECT_OPT_C99EXT Compiler flag to select C99 C dialect with extensions

 # Compiler name
@@ -74,6 +78,11 @@
     endif()
   endif()

+  set(C_DIALECT_OPT_C89    "-std=c89")
+  set(C_DIALECT_OPT_C89EXT "-std=gnu89")
+  set(C_DIALECT_OPT_C99    "-std=c99")
+  set(C_DIALECT_OPT_C99EXT "-std=gnu99")
+
 # icc
 elseif(CMAKE_COMPILER_IS_INTEL)
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_GCC_FLAGS}")
@@ -86,6 +95,11 @@
   if(NOT COMMON_USE_CXX03)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
   endif()
+
+  set(C_DIALECT_OPT_C89    "-std=c89")
+  set(C_DIALECT_OPT_C89EXT "-std=gnu89")
+  set(C_DIALECT_OPT_C99    "-std=c99")
+  set(C_DIALECT_OPT_C99EXT "-std=gnu99")

 # xlc/BlueGene/PPC
 elseif(CMAKE_COMPILER_IS_XLCXX)
@@ -105,6 +119,11 @@
       "-O3 -q64 -qstrict -qnostaticlink -qnostaticlink=libgcc -DNDEBUG")
     set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
   endif()
+
+  set(C_DIALECT_OPT_C89    "-qlanglvl=stdc89")
+  set(C_DIALECT_OPT_C89EXT "-qlanglvl=extc89")
+  set(C_DIALECT_OPT_C99    "-qlanglvl=stdc99")
+  set(C_DIALECT_OPT_C99EXT "-qlanglvl=extc99")
 endif()

 # Visual Studio


Fix OxConfig.cmake to work with GBA builds again

--- OxConfig.cmake
+++ OxConfig.cmake
@@ -1,9 +1,9 @@
-if(${CMAKE_FIND_ROOT_PATH})
+if("${CMAKE_FIND_ROOT_PATH}" STREQUAL "")
+	set(Ox_INCLUDE_DIRS /usr/local/include/)
+	set(OxStd_LIBRARY /usr/local/lib/ox/libOxStd.a)
+	set(OxFs_LIBRARY /usr/local/lib/ox/libOxFs.a)
+else("${CMAKE_FIND_ROOT_PATH}" STREQUAL "")
 	set(Ox_INCLUDE_DIRS ${CMAKE_FIND_ROOT_PATH}/include/)
 	set(OxStd_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxStd.a)
 	set(OxFs_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxFs.a)
-else(${CMAKE_FIND_ROOT_PATH})
-	set(Ox_INCLUDE_DIRS /usr/local/include/)
-	set(OxStd_LIBRARY /usr/local/lib/ox/libOxStd.a)
-	set(OxFs_LIBRARY /usr/local/lib/ox/libOxFs.a)
-endif(${CMAKE_FIND_ROOT_PATH})
+endif("${CMAKE_FIND_ROOT_PATH}" STREQUAL "")


Update deps/lua-openssl.cmake

Update deps/lua-openssl.cmake

--- deps/lua-openssl.cmake
+++ deps/lua-openssl.cmake
@@ -4,7 +4,8 @@
 endif()

 include_directories(
-  ${LUA_OPENSSL_DIR}/deps
+  ${LUA_OPENSSL_DIR}/deps/auxiliar
+  ${LUA_OPENSSL_DIR}/deps/lua-compat
   ${LUA_OPENSSL_DIR}/src
 )

@@ -30,7 +31,7 @@

 add_library(lua_openssl
   ${LUA_OPENSSL_DIR}/src/asn1.c
-  ${LUA_OPENSSL_DIR}/src/auxiliar.c
+  ${LUA_OPENSSL_DIR}/deps/auxiliar/auxiliar.c
   ${LUA_OPENSSL_DIR}/src/bio.c
   ${LUA_OPENSSL_DIR}/src/callback.c
   ${LUA_OPENSSL_DIR}/src/cipher.c


-no-inline-max-per-compile to icc compile flags to avoid inlining problems with the hybrid intersector

--- common/cmake/icc.cmake
+++ common/cmake/icc.cmake
@@ -27,8 +27,8 @@
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -std=c++11 -fvisibility-inlines-hidden -fvisibility=hidden -no-ansi-alias -fasm-blocks")

 SET(CMAKE_CXX_FLAGS_DEBUG          "-DDEBUG  -DTBB_USE_DEBUG -g -O0")
-SET(CMAKE_CXX_FLAGS_RELEASE        "-DNDEBUG                    -O3 -restrict -no-inline-max-total-size -inline-factor=200")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG  -DTBB_USE_DEBUG -g -O3 -restrict -no-inline-max-total-size -inline-factor=200")
+SET(CMAKE_CXX_FLAGS_RELEASE        "-DNDEBUG                    -O3 -restrict -no-inline-max-total-size -inline-factor=200 -no-inline-max-per-compile")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG  -DTBB_USE_DEBUG -g -O3 -restrict -no-inline-max-total-size -inline-factor=200 -no-inline-max-per-compile")

 # enable -static-intel and avoid to export ICC specific symbols from Embree
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-intel -no-intel-extensions")


removed Useviscl.cmake

removed Useviscl.cmake

--- Useviscl.cmake
+++ Useviscl.cmake
@@ -1,36 +0,0 @@
-# This CMake file may be included by projects outside viscl.  It
-# configures them to make use of viscl headers and libraries.
-#
-# The preferred way to use viscl from an outside project with Useviscl.cmake:
-#
-#  FIND_PACKAGE(viscl)
-#  IF(viscl_FOUND)
-#    INCLUDE(${viscl_CMAKE_DIR}/Useviscl.cmake)
-#  ELSE(viscl_FOUND)
-#    MESSAGE("viscl_DIR should be set to the viscl build directory.")
-#  ENDIF(viscl_FOUND)
-
-# Load the compiler settings used for viscling.
-IF(viscl_BUILD_SETTINGS_FILE)
-  INCLUDE(${CMAKE_ROOT}/Modules/CMakeImportBuildSettings.cmake)
-  CMAKE_IMPORT_BUILD_SETTINGS(${viscl_BUILD_SETTINGS_FILE})
-ENDIF(viscl_BUILD_SETTINGS_FILE)
-
-# Use the standard viscl include directories.
-INCLUDE_DIRECTORIES(${viscl_INCLUDE_DIR})
-
-# Use VXL.
-IF(NOT viscl_NO_USE_VXL)
-  SET(VXL_DIR ${viscl_VXL_DIR})
-  FIND_PACKAGE(VXL)
-  IF(VXL_FOUND)
-    INCLUDE(${VXL_CMAKE_DIR}/UseVXL.cmake)
-  ELSE(VXL_FOUND)
-    MESSAGE("VXL not found in viscl_VXL_DIR=\"${viscl_VXL_DIR}\".")
-  ENDIF(VXL_FOUND)
-ENDIF(NOT viscl_NO_USE_VXL)
-
-#find_package(Boost REQUIRED)
-#include_directories(${viscl_Boost_INCLUDE_DIR})
-
-


Updating ITK tag with a couple more patches with 4.10 release

Change-Id: I637e559ce826821c9469081186a77ec37a1f5cfc

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -40,7 +40,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG  b14b3488bd926c835a03ab12a5663bfc7eca3a92 ) # just after 4.10.0 release
+set(ITK_TAG_COMMAND GIT_TAG 1bf7263085f1d700518bf968248647a1ccb971df ) # just after 4.10.0 release

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


ENH: turn on 64-bit ids on windows

ENH: turn on 64-bit ids on windows

Enable 64-bit ids on windows by default. This case is detected with
size_t is 64-bits but long is 32-bits. The ITK_USE_64BITS_IDS in
enable by default in this case with the superbuild.

Change-Id: Ic1ae748a8116a53f8cda0066a32ba8bed4eefd99

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -3,6 +3,24 @@
 # Get and build itk

 get_cmake_property( _varNames VARIABLES )
+
+include(CheckTypeSize)
+
+check_type_size(size_t SITK_SIZEOF_SIZE_T)
+check_type_size(long SITK_SIZEOF_LONG)
+
+set(ITK_USE_64BITS_IDS_DEFAULT OFF)
+if(SITK_SIZEOF_SIZE_T EQUAL 8
+    AND NOT SITK_SIZEOF_LONG EQUAL 8 )
+  set(ITK_USE_64BITS_IDS_DEFAULT ON)
+endif()
+
+option(ITK_USE_64BITS_IDS "When ON, ITK will use 64 bits integers to
+ index pixels. This is needed for managing images larger than 4Gb in
+ some platforms."
+  ${ITK_USE_64BITS_IDS_DEFAULT})
+mark_as_advanced(ITK_USE_64BITS_IDS)
+

 foreach (_varName ${_varNames})
   if(_varName MATCHES "^ITK_" OR _varName MATCHES "FFTW")


Update ITK Superbuild version to 4.9rc3

Update ITK Superbuild version to 4.9rc3

Change-Id: I13ea0b05c2b8f42ec9de14f639b6b26586c4a5f7

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 189385780861b4a1ced5702a13f796d355255577)
+set(ITK_TAG_COMMAND GIT_TAG v4.9rc03 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


bugfix: delete (previously) generated files from the build directory if the runtime generator is not there

--- cmake_modules/ZorbaRuntimeGenerator.cmake
+++ cmake_modules/ZorbaRuntimeGenerator.cmake
@@ -26,9 +26,16 @@
   MESSAGE(STATUS "Zorba Command Line Utility was not found at \"${ZORBA_RUNTIME_GENERATOR}\".")
 ENDIF (EXISTS ${ZORBA_RUNTIME_GENERATOR})

-MACRO(CHECK_OUTPUT_EXISTS OUTPUT)
+MACRO(CHECK_OUTPUT_EXISTS OUTPUT BINARY_DIR_OUTPUT)
   IF (EXISTS "${OUTPUT}")
     MESSAGE(STATUS "Using the repository file for ${OUTPUT}. ")
+    # if (for whatever reason) the corresponding file in the build directory
+    # already exists, we delete it here. This way, we can make sure that the
+    # correct files are used. Otherwise the order of include paths would influence
+    # the decision made here (e.g. the one modified in src/compiler/parser/CMakeLists.txt)
+    IF (EXISTS "${BINARY_DIR_OUTPUT}")
+      FILE(REMOVE "${BINARY_DIR_OUTPUT}")
+    ENDIF (EXISTS "${BINARY_DIR_OUTPUT}")
   ELSE (EXISTS "${OUTPUT}")
     MESSAGE(FATAL_ERROR "Neither the Zorba Command Line Utility nor the files ${OUTPUT} are available. "
                         "Can't proceed building Zorba.")
@@ -70,8 +77,8 @@
                          DEPENDS ${HEADER_QUERY} ${SPEC_FILE}
                                  "${CMAKE_SOURCE_DIR}/src/runtime/spec/utils.xq")
   ELSE (ZORBA_WORKS)
-    CHECK_OUTPUT_EXISTS("${CPP_OUTPUT_SOURCE_DIR}")
-    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}")
+    CHECK_OUTPUT_EXISTS("${CPP_OUTPUT_SOURCE_DIR}" "${CPP_OUTPUT_BINARY_DIR}")
+    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}" "${H_OUTPUT_BINARY_DIR}")
   ENDIF (ZORBA_WORKS)
 ENDMACRO(RUNTIME_GENERATOR)

@@ -110,8 +117,8 @@
                                  "${CMAKE_SOURCE_DIR}/src/runtime/spec/utils.xq"
                          )
   ELSE (ZORBA_WORKS)
-    CHECK_OUTPUT_EXISTS("${CPP_OUTPUT_SOURCE_DIR}")
-    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}")
+    CHECK_OUTPUT_EXISTS("${CPP_OUTPUT_SOURCE_DIR}" "${CPP_OUTPUT_BINARY_DIR}")
+    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}" "${H_OUTPUT_BINARY_DIR}")
   ENDIF (ZORBA_WORKS)
 ENDMACRO(PRINTER_VISITOR_GENERATOR)

@@ -132,7 +139,7 @@
                          DEPENDS ${HEADER_QUERY} ${SPEC_FILES}
                                  "${CMAKE_SOURCE_DIR}/src/runtime/spec/utils.xq")
   ELSE (ZORBA_WORKS)
-    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}")
+    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}" "${H_OUTPUT_BINARY_DIR}")
   ENDIF (ZORBA_WORKS)
 ENDMACRO(PLANINTER_VISITOR_GENERATOR)

@@ -171,8 +178,8 @@
                          DEPENDS ${HEADER_QUERY} ${SPEC_FILE}
                                  "${CMAKE_SOURCE_DIR}/src/runtime/spec/utils.xq")
   ELSE (ZORBA_WORKS)
-    CHECK_OUTPUT_EXISTS("${CPP_OUTPUT_SOURCE_DIR}")
-    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}")
+    CHECK_OUTPUT_EXISTS("${CPP_OUTPUT_SOURCE_DIR}" "${CPP_OUTPUT_BINARY_DIR}")
+    CHECK_OUTPUT_EXISTS("${H_OUTPUT_SOURCE_DIR}" "${H_OUTPUT_BINARY_DIR}")
   ENDIF (ZORBA_WORKS)
 ENDMACRO(CODEGEN_GENERATOR)

@@ -193,6 +200,6 @@
                          DEPENDS ${HEADER_QUERY} ${SPEC_FILES}
                                  "${CMAKE_SOURCE_DIR}/src/runtime/spec/utils.xq")
   ELSE (ZORBA_WORKS)
-    CHECK_OUTPUT_EXISTS("${OUTPUT_SOURCE_DIR}")
+    CHECK_OUTPUT_EXISTS("${OUTPUT_SOURCE_DIR}" "${OUTPUT_BINARY_DIR}")
   ENDIF (ZORBA_WORKS)
 ENDMACRO(FUNCTION_ENUM_GENERATOR)


[cmake] make it possible to compile an individual component as static

--- cmake/LibraryProjectSetup.cmake
+++ cmake/LibraryProjectSetup.cmake
@@ -90,12 +90,14 @@
   include_directories(${${PROJECT_NAME}_LOCAL_INCLUDE_DIRECTORIES})
   # and for headers of external libraries
   include_directories(${SICONOS_INCLUDE_DIRECTORIES})
-
-  if(NOT BUILD_SHARED_LIBS)
+
+  if(BUILD_SHARED_LIBS AND NOT BUILD_${COMPONENT}_STATIC)
+    add_library(${COMPONENT} SHARED ${${COMPONENT}_SRCS})
+  else()
     add_library(${COMPONENT} STATIC ${${COMPONENT}_SRCS})
-  else()
-    add_library(${COMPONENT} SHARED ${${COMPONENT}_SRCS})
+    set_property(TARGET ${COMPONENT} PROPERTY POSITION_INDEPENDENT_CODE ON)
   endif()
+
   list(APPEND installed_targets ${COMPONENT})
   list(REMOVE_DUPLICATES installed_targets)
   set(installed_targets ${installed_targets}


make runtime deps for self contained windows only

--- cmake/RuntimeDependencies.cmake
+++ cmake/RuntimeDependencies.cmake
@@ -13,18 +13,22 @@

 if(OPTION_SELF_CONTAINED)

-    # Install 3rd-party runtime dependencies into runtime-component
-    # install(FILES ... COMPONENT runtime)
+    if(SYSTEM_WINDOWS)

-    find_file(DLLS_CPPASSIST cppassist.dll)
+        # Install 3rd-party runtime dependencies into runtime-component
+        # install(FILES ... COMPONENT runtime)

-    set(DLLS
-        ${DLLS_CPPASSIST}
-    )
-    set(PLATFORMS
-        ${DLLS_WIN}
-    )
-    install(FILES ${DLLS} DESTINATION ${INSTALL_BIN} COMPONENT examples)
-    install(FILES ${PLATFORMS} DESTINATION ${INSTALL_BIN}/platforms COMPONENT examples)
+        find_file(DLLS_CPPASSIST cppassist.dll)
+
+        set(DLLS
+            ${DLLS_CPPASSIST}
+        )
+        set(PLATFORMS
+            ${DLLS_WIN}
+        )
+        install(FILES ${DLLS} DESTINATION ${INSTALL_BIN} COMPONENT examples)
+        install(FILES ${PLATFORMS} DESTINATION ${INSTALL_BIN}/platforms COMPONENT examples)
+
+    endif()

 endif()


From Pere:
fix for finding Bonjour/Avahi libs, fixes issue 90397.

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

--- cmake/modules/FindBonjour.cmake
+++ cmake/modules/FindBonjour.cmake
@@ -18,7 +18,7 @@
     PATHS /opt/dnssd/include /usr/include  /usr/local/include
   )
   find_library(BONJOUR_LIBRARY
-    NAMES libdns_sd
+    NAMES dns_sd
     PATHS /opt/dnssd/lib /usr/lib /usr/local/lib
   )
   if(NOT BONJOUR_INCLUDE_DIR OR NOT BONJOUR_LIBRARY)
@@ -43,7 +43,7 @@
   # layer, also the other libraries must be in the same location.
   foreach(l client common core)
     find_library(AVAHI_${l}_LIBRARY
-      NAMES libavahi-${l}.so
+      NAMES avahi-${l}.so
       PATHS /opt/lib /usr/lib /usr/local/lib
     )
     if(AVAHI_${l}_LIBRARY)


MiniSat doesn't have pkg-config so no need to check for it

--- cmake/modules/Findminisat.cmake
+++ cmake/modules/Findminisat.cmake
@@ -6,8 +6,8 @@
 #  MINISAT_DEFINITIONS - Compiler switches required for using minisat

 find_package(PkgConfig)
-pkg_check_modules(PC_MINISAT QUIET minisat)
-set(MINISAT_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER})
+# pkg_check_modules(PC_MINISAT QUIET minisat) # MiniSat deoes not have pkg-config
+# set(MINISAT_DEFINITIONS if_needed_fill_here)

 find_path(MINISAT_INCLUDE_DIR minisat/core/Solver.h
           HINTS ${MINISAT_INCLUDE_DIRS}


Fix up CMake logic for version numbers associated with Itcl, Itk, and Iwidgets.

In preparation for making these variables accessible from the PLplot C
environment, replace ITCL_VERSION, ITK_VERSION, and IWIDGETS_VERSION
everywhere
with PLPLOT_ITCL_VERSION, PLPLOT_ITK_VERSION, and
PLPLOT_IWIDGETS_VERSION

Set PLPLOT_ITCL_VERSION to 0.0.0 to mark when this version number
should not be used (i.e., when enable_itcl if OFF).

Set PLPLOT_ITK_VERSION and PLPLOT_IWIDGETS_VERSION to 0.0.0 to mark
when these version numbers
should not be used (i.e., when enable_itk if OFF).

Drop plitcl_packagename, plikt_packagename, and pliwidgets_packagename
everywhere since the plan for making those variables accessible from
the PLplot C environment has been dropped.

svn path=/trunk/; revision=12676

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -42,7 +42,7 @@
 #TCL_LIBRARY
 #ITCL_INCLUDE_PATH
 #ITCL_LIBRARY
-#HAVE_ITCL   		(On when itcl header and library has been found.
+#HAVE_ITCL   		(On when itcl header and library have been found.
 #			 Otherwise, undefined.
 #			 Used for source file configuration.)
 #HAVE_ITCLDECLS_H 	(defined [actually as a path, but we don't use that]
@@ -52,9 +52,12 @@
 #TK_LIBRARY
 #ITK_INCLUDE_PATH
 #ITK_LIBRARY
-#HAVE_ITK   		(On when itcl header and library has been found.
+#HAVE_ITK   		(On when itcl header and library have been found.
 #			 Otherwise, undefined.
 #			 Used for source file configuration.)
+#PLPLOT_ITCL_VERSION     (Consistent Itcl version number found by PLplot).
+#PLPLOT_ITK_VERSION      (Consistent Itk version number found by PLplot).
+#PLPLOT_IWIDGETS_VERSION (Consistent Iwidgets version number found by PLplot).

 if(ENABLE_tcl)
   message(STATUS "Start determining consistent system data for Tcl and friends")
@@ -75,8 +78,11 @@
   else(TCL_FOUND)
     message(STATUS "Looking for include paths and libraries for Tcl - not found")
   endif(TCL_FOUND)
+
+  # Initially mark various quantities as as unfound in case that turns out to be the case.
   set(HAVE_ITCL OFF)
   set(HAVE_ITK OFF)
+
   if(TCL_FOUND AND TCL_TCLSH)
     if(ENABLE_itcl)
       if(USE_INCRTCL_VERSION_4)
@@ -89,16 +95,14 @@
       execute_process(
 	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_Available.tcl
 	RESULT_VARIABLE ITCL_RC
-	OUTPUT_VARIABLE ITCL_VERSION
+	OUTPUT_VARIABLE PLPLOT_ITCL_VERSION
 	ERROR_VARIABLE ITCL_STDERR
 	)
       if(NOT ITCL_RC)
-	set(ITCL_PACKAGE_NAME "Itcl ${ITCL_VERSION}")
-	message(STATUS "ITCL_PACKAGE_NAME = ${ITCL_PACKAGE_NAME}")
         message(STATUS "Looking for itcl.h")
 	if(NOT USE_INCRTCL_VERSION_4)
 	  # Search first for epa_build install location.
-          find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH}/itcl${ITCL_VERSION})
+          find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH}/itcl${PLPLOT_ITCL_VERSION})
 	endif(NOT USE_INCRTCL_VERSION_4)
         find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH})

@@ -107,8 +111,8 @@
 	  message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")

 	  message(STATUS "Checking for Itcl header version consistency")
-	  string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITCL_MAJOR_VERSION  "${ITCL_VERSION}")
-	  string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITCL_MINOR_VERSION  "${ITCL_VERSION}")
+	  string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITCL_MAJOR_VERSION  "${PLPLOT_ITCL_VERSION}")
+	  string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITCL_MINOR_VERSION  "${PLPLOT_ITCL_VERSION}")
 	  message(STATUS "ITCL_MAJOR_VERSION = ${ITCL_MAJOR_VERSION}")
 	  message(STATUS "ITCL_MINOR_VERSION = ${ITCL_MINOR_VERSION}")
 	  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITCL_VERSION.c
@@ -142,8 +146,8 @@
         if(ENABLE_itcl)
           message(STATUS "Looking for itcl library")
 	  # Search first for epa_build install location.
-          find_library(ITCL_LIBRARY itcl${ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH}/itcl${ITCL_VERSION})
-          find_library(ITCL_LIBRARY itcl${ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH})
+          find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH}/itcl${PLPLOT_ITCL_VERSION})
+          find_library(ITCL_LIBRARY itcl${PLPLOT_ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH})
           if(ITCL_LIBRARY)
             message(STATUS "Looking for itcl library - found")
 	    message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
@@ -162,16 +166,6 @@
       endif(NOT ITCL_RC)
     endif(ENABLE_itcl)

-    # ------------------------------------------------------------------------
-    # figure out how to build tclIndex
-    # ------------------------------------------------------------------------
-    set(MKTCLINDEX ${CMAKE_SOURCE_DIR}/scripts/mktclIndex)
-    if(ENABLE_itcl)
-      set(MKTCLINDEX_ARGS "-itcl")
-    else(ENABLE_itcl)
-      set(MKTCLINDEX_ARGS "-tcl")
-    endif(ENABLE_itcl)
-
     if(ENABLE_tk AND NOT TK_FOUND)
       message(STATUS "WARNING: Tk not found so disabling Tk interface code")
       set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
@@ -209,17 +203,14 @@
       execute_process(
 	COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_Available.tcl
 	RESULT_VARIABLE ITK_RC
-	OUTPUT_VARIABLE ITK_VERSION
+	OUTPUT_VARIABLE PLPLOT_ITK_VERSION
 	ERROR_VARIABLE ITK_STDERR
 	)
       if(NOT ITK_RC)
-	set(ITK_PACKAGE_NAME "Itk ${ITK_VERSION}")
-	message(STATUS "ITK_PACKAGE_NAME = ${ITK_PACKAGE_NAME}")
-
 	message(STATUS "Looking for itk.h")
 	if(NOT USE_INCRTCL_VERSION_4)
 	  # Search first for epa_build install location.
-          find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH}/itcl${ITCL_VERSION})
+          find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH}/itcl${PLPLOT_ITCL_VERSION})
 	endif(NOT USE_INCRTCL_VERSION_4)
 	find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH})

@@ -228,8 +219,8 @@
 	  message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}")

 	  message(STATUS "Checking for Itk header version consistency")
-	  string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITK_MAJOR_VERSION  "${ITK_VERSION}")
-	  string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITK_MINOR_VERSION  "${ITK_VERSION}")
+	  string(REGEX REPLACE "^([0-9]*)\\.[0-9]*.*$" "\\1" ITK_MAJOR_VERSION  "${PLPLOT_ITK_VERSION}")
+	  string(REGEX REPLACE "^[0-9]*\\.([0-9]*).*$" "\\1" ITK_MINOR_VERSION  "${PLPLOT_ITK_VERSION}")
 	  message(STATUS "ITK_MAJOR_VERSION = ${ITK_MAJOR_VERSION}")
 	  message(STATUS "ITK_MINOR_VERSION = ${ITK_MINOR_VERSION}")
 	  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CheckITK_VERSION.c
@@ -264,8 +255,8 @@
 	if(ENABLE_itk)
           message(STATUS "Looking for itk library")
 	  # Search first for epa_build install location.
-          find_library(ITK_LIBRARY itk${ITK_VERSION} HINTS ${TCL_LIBRARY_PATH}/itk${ITK_VERSION})
-          find_library(ITK_LIBRARY itk${ITK_VERSION} HINTS ${TCL_LIBRARY_PATH})
+          find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH}/itk${PLPLOT_ITK_VERSION})
+          find_library(ITK_LIBRARY itk${PLPLOT_ITK_VERSION} HINTS ${TCL_LIBRARY_PATH})
           if(ITK_LIBRARY)
             message(STATUS "Looking for itk library - found")
 	    message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
@@ -309,30 +300,19 @@
 	      list(GET IWIDGETS_VERSIONS_LIST 1 CONSISTENT_ITK_VERSION)
 	      list(GET IWIDGETS_VERSIONS_LIST 2 CONSISTENT_ITCL_VERSION)
 	      message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent")
-	      if(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION)
-		if(USE_INCRTCL_VERSION_4)
-		  set(IWIDGETS_PACKAGE_NAME "Iwidgets ${IWIDGETS_VERSION}")
-		else(USE_INCRTCL_VERSION_4)
-		  # Must use exact to distinguish from 4.1 version with
-                  # the same major version number.  This should not be
-                  # an issue after install since it is rare/nonexistent to
-                  # change the patch number of this really old version of
-                  # iwidgets between the build and post-install eras.
-		  set(IWIDGETS_PACKAGE_NAME "-exact Iwidgets ${IWIDGETS_VERSION}")
-		endif(USE_INCRTCL_VERSION_4)
+	      if(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
 		message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent - true")
-		message(STATUS "IWIDGETS_PACKAGE_NAME = ${IWIDGETS_PACKAGE_NAME}")
-	      else(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION)
+	      else(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
 		message(STATUS "IWIDGETS_VERSION = ${IWIDGETS_VERSION}")
-		message(STATUS "ITK_VERSION = ${ITK_VERSION}")
+		message(STATUS "PLPLOT_ITK_VERSION = ${PLPLOT_ITK_VERSION}")
 		message(STATUS "CONSISTENT_ITK_VERSION = ${CONSISTENT_ITK_VERSION}")
-		message(STATUS "ITCL_VERSION = ${ITCL_VERSION}")
+		message(STATUS "PLPLOT_ITCL_VERSION = ${PLPLOT_ITCL_VERSION}")
 		message(STATUS "CONSISTENT_ITCL_VERSION = ${CONSISTENT_ITCL_VERSION}")
 		message(STATUS "Checking that the Iwidgets, Itk, and Itcl packages are consistent - false")
 		message(STATUS "WARNING: Consistent combination of Iwidgets, Itk, and Itcl not found so disabling Itcl and Itk")
 		set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
 		set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
-	      endif(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION)
+	      endif(CONSISTENT_ITCL_VERSION STREQUAL PLPLOT_ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL PLPLOT_ITK_VERSION)
 	    else(NOT IWIDGETS_RC)
 	      message(STATUS "WARNING: Iwidgets could not be found so disabling Itcl and Itk")
 	      set(ENABLE_itcl OFF CACHE BOOL "Enable Itcl interface code" FORCE)
@@ -351,6 +331,16 @@
       endif(NOT ITK_RC)
     endif(ENABLE_itk)

+    # ------------------------------------------------------------------------
+    # figure out how to build tclIndex
+    # ------------------------------------------------------------------------
+    set(MKTCLINDEX ${CMAKE_SOURCE_DIR}/scripts/mktclIndex)
+    if(ENABLE_itcl)
+      set(MKTCLINDEX_ARGS "-itcl")
+    else(ENABLE_itcl)
+      set(MKTCLINDEX_ARGS "-tcl")
+    endif(ENABLE_itcl)
+
   else(TCL_FOUND AND TCL_TCLSH)
     message(STATUS "Tcl not found OR tclsh not found")
     message(STATUS "WARNING: Disabling everything that is Tcl/Tk related")
@@ -366,6 +356,13 @@
   set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
   set(ENABLE_itk OFF CACHE BOOL "Enable Itk interface code" FORCE)
 endif(ENABLE_tcl)
+
+if(NOT ENABLE_itcl)
+  set(PLPLOT_ITCL_VERSION 0.0.0)
+endif(NOT ENABLE_itcl)
+
 if(NOT ENABLE_itk)
   set(itk_true "#")
+  set(PLPLOT_ITK_VERSION 0.0.0)
+  set(PLPLOT_IWIDGETS_VERSION 0.0.0)
 endif(NOT ENABLE_itk)


Add non-CMAKE_FIND_ROOT_PATH paths to OxConfig.cmake

--- OxConfig.cmake
+++ OxConfig.cmake
@@ -1,3 +1,9 @@
-set(Ox_INCLUDE_DIRS ${CMAKE_FIND_ROOT_PATH}/include/)
-set(OxStd_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxStd.a)
-set(OxFs_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxFs.a)
+if(${CMAKE_FIND_ROOT_PATH})
+	set(Ox_INCLUDE_DIRS ${CMAKE_FIND_ROOT_PATH}/include/)
+	set(OxStd_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxStd.a)
+	set(OxFs_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxFs.a)
+else(${CMAKE_FIND_ROOT_PATH})
+	set(Ox_INCLUDE_DIRS /usr/local/include/)
+	set(OxStd_LIBRARY /usr/local/lib/ox/libOxStd.a)
+	set(OxFs_LIBRARY /usr/local/lib/ox/libOxFs.a)
+endif(${CMAKE_FIND_ROOT_PATH})


CMake: Bugfix, look for template-arguments at the right place

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@30709 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_expand_instantiations.cmake
+++ deal.II/cmake/macros/macro_expand_instantiations.cmake
@@ -41,10 +41,10 @@
     ADD_CUSTOM_COMMAND(
       OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
       DEPENDS expand_instantiations
-              ${CMAKE_BINARY_DIR}/cmake/config/template-arguments
+              ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
               ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
       COMMAND expand_instantiations
-      ARGS ${CMAKE_BINARY_DIR}/cmake/config/template-arguments
+      ARGS ${CMAKE_BINARY_DIR}/${DEAL_II_COMMON_RELDIR}/template-arguments
            < ${CMAKE_CURRENT_SOURCE_DIR}/${_inst_in_file}
            > ${CMAKE_CURRENT_BINARY_DIR}/${_inst_file}
       )


Updated FindMagnum.cmake.

Updated FindMagnum.cmake.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -16,7 +16,7 @@
 find_package(OpenGL REQUIRED)
 find_package(GLEW REQUIRED)

-if (MAGNUM_INCLUDE_DIR AND MAGNUM_LIBRARY AND MAGNUM_PRIMITIVES_LIBRARY)
+if (MAGNUM_INCLUDE_DIR AND MAGNUM_LIBRARY AND MAGNUM_PRIMITIVES_LIBRARY AND MAGNUM_MESHTOOLS_LIBRARY)

     # Already in cache
     set(MAGNUM_FOUND TRUE)
@@ -25,6 +25,7 @@
     # Libraries
     find_library(MAGNUM_LIBRARY Magnum)
     find_library(MAGNUM_PRIMITIVES_LIBRARY MagnumPrimitives)
+    find_library(MAGNUM_MESHTOOLS_LIBRARY MagnumMeshTools)

     # Paths
     find_path(MAGNUM_INCLUDE_DIR
@@ -37,6 +38,7 @@
         MAGNUM_INCLUDE_DIR
         MAGNUM_LIBRARY
         MAGNUM_PRIMITIVES_LIBRARY
+        MAGNUM_MESHTOOLS_LIBRARY
     )

 endif()


Fix Android toolchain file

Fix Android toolchain file

This got broken with the new Android SDK update, fix this.

--- toolchain-android.cmake
+++ toolchain-android.cmake
@@ -1,22 +1,44 @@
-if("$ENV{ARMv8}") # GCC 4.9
+if(BUILD_64_BIT) # ARMv8 with GCC 4.9
   set(BUILD_ANDROID64 1)
-  set(C_COMPILER aarch64-linux-android)
-  set(CXX_COMPILER aarch64-linux-android)
-  set(IDENTIFIER -4.9-aarch64)
-else() # GCC 4.8
-  set(BUILD_ANDROID 1)
+  set(ANDROID_NDK_TOOL_PREFIX aarch64-linux-android)
+  set(_ndk_suffix -4.9-aarch64)
+else() # GCC 4.8
   set(ARM_TARGET "armeabi-v7a")
-  set(C_COMPILER arm-linux-androideabi)
-  set(CXX_COMPILER arm-linux-androideabi)
+  set(ANDROID_NDK_TOOL_PREFIX arm-linux-androideabi)
 endif()
+set(BUILD_ANDROID 1)
 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_SYSTEM_PROCESSOR arm)
 set(CMAKE_SYSTEM_VERSION 1)
 set(BUILD_ARM 1)
-set(LOCAL_ARM_NEON "true")
-set(ANDROID_COMMON_FLAGS " --sysroot=${LLVM_ANDROID_TOOLCHAIN_DIR}${IDENTIFIER}/sysroot -B${LLVM_ANDROID_TOOLCHAIN_DIR}${IDENTIFIER} ")
-set(CMAKE_C_COMPILER ${LLVM_ANDROID_TOOLCHAIN_DIR}${IDENTIFIER}/bin/${C_COMPILER}-gcc)
-set(CMAKE_CXX_COMPILER ${LLVM_ANDROID_TOOLCHAIN_DIR}${IDENTIFIER}/bin/${CXX_COMPILER}-g++)
+
+if(MSYS)
+  set(_exe_suffix .exe)
+endif()
+
+#For reasons beyond my comprehension, this file is parsed multiple times
+#and in some of them, cache variables are not preserved so we have to store
+#this in an environmental variable...
+if(NOT LLVM_ANDROID_TOOLCHAIN_DIR)
+  set(LLVM_ANDROID_TOOLCHAIN_DIR $ENV{LLVM_ANDROID_TOOLCHAIN_DIR})
+else()
+  set(ENV{LLVM_ANDROID_TOOLCHAIN_DIR} ${LLVM_ANDROID_TOOLCHAIN_DIR} CACHE PATH)
+endif()
+
+find_path(ANDROID_NDK_ROOT bin/${ANDROID_NDK_TOOL_PREFIX}-gcc${_exe_suffix} PATHS
+  ${LLVM_ANDROID_TOOLCHAIN_DIR}${_ndk_suffix} #legacy variable
+  /opt/android-standalone-toolchain${_ndk_suffix}
+  ${LLVM_ANDROID_TOOLCHAIN_DIR}
+  /opt/android-standalone-toolchain
+)
+if(NOT ANDROID_NDK_ROOT)
+  message(FATAL_ERROR "ANDROID_NDK_ROOT could not be located. Have you installed the NDK?")
+endif()
+
+set(ANDROID_COMMON_FLAGS " --sysroot=${ANDROID_NDK_ROOT}/sysroot -B${ANDROID_NDK_ROOT} ")
+set(CMAKE_C_COMPILER ${ANDROID_NDK_ROOT}/bin/${ANDROID_NDK_TOOL_PREFIX}-gcc${_exe_suffix} CACHE FILEPATH "C Compiler" FORCE)
+set(CMAKE_CXX_COMPILER ${ANDROID_NDK_ROOT}/bin/${ANDROID_NDK_TOOL_PREFIX}-g++${_exe_suffix} CACHE FILEPATH "C++ Compiler" FORCE)
+set(ANDROID_STRIP_COMMAND ${ANDROID_NDK_ROOT}/bin/${ANDROID_NDK_TOOL_PREFIX}-strip)
 set(CMAKE_C_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_cflags" FORCE)
 set(CMAKE_CXX_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_cxxflags" FORCE)
 set(CMAKE_LINK_FLAGS "${ANDROID_COMMON_FLAGS}" CACHE STRING "toolchain_linkflags" FORCE)


build system: quote values in __build_write_properties

--- tools/cmake/build.cmake
+++ tools/cmake/build.cmake
@@ -265,7 +265,7 @@
     idf_build_get_property(build_properties __BUILD_PROPERTIES)
     foreach(property ${build_properties})
         idf_build_get_property(val ${property})
-        set(build_properties_text "${build_properties_text}\nset(${property} ${val})")
+        set(build_properties_text "${build_properties_text}\nset(${property} \"${val}\")")
     endforeach()
     file(WRITE ${output_file} "${build_properties_text}")
 endfunction()


Add missing dependency resolution for tests

--- BdeBuildSystem/BdeTargetUtils.cmake
+++ BdeBuildSystem/BdeTargetUtils.cmake
@@ -433,6 +433,7 @@
             bbs_import_target_dependencies(${target} ${${uor_name}_PCDEPS})

             if (NOT _SKIP_TESTS)
+                bbs_import_target_dependencies(${target} ${${uor_name}_TEST_PCDEPS})
                 if (NOT TARGET ${target}.t)
                     add_custom_target(${target}.t)
                 endif()
@@ -454,6 +455,7 @@

             bbs_import_target_dependencies(${target} ${${uor_name}_PCDEPS})
             if (NOT _SKIP_TESTS)
+                bbs_import_target_dependencies(${target} ${${uor_name}_TEST_PCDEPS})
                 bbs_configure_target_tests(${target}
                                            SOURCES    ${${uor_name}_TEST_SOURCES}
                                            TEST_DEPS  ${${uor_name}_PCDEPS}


Update binning/reduce for image shared_ptr

--- runtime/hipacc_cu.hpp.cmake
+++ runtime/hipacc_cu.hpp.cmake
@@ -1169,7 +1169,7 @@
 #endif
 template<typename T, typename T2, int NUM_BINS>
 T* hipaccApplyBinningSegmented(const void *kernel2D, std::string kernel2D_name,
-                                  HipaccAccessor &acc, unsigned int num_hist, unsigned int num_warps, const textureReference *tex) {
+                               HipaccAccessor &acc, unsigned int num_hist, unsigned int num_warps, const textureReference *tex) {
     T *output;  // GPU memory for reduction
     T *result = new T[NUM_BINS];   // host result

@@ -1181,12 +1181,12 @@

     //unsigned int idle_left = 0;
     //if ((acc.offset_x || acc.offset_y) &&
-    //    (acc.width!=acc.img.width || acc.height!=acc.img.height)) {
+    //    (acc.width!=acc.img->width || acc.height!=acc.img->height)) {
     //    // reduce iteration space by idle blocks
     //    idle_left = acc.offset_x / block.x;
-    //    unsigned int idle_right = (acc.img.width - (acc.offset_x+acc.width)) / block.x;
+    //    unsigned int idle_right = (acc.img->width - (acc.offset_x+acc.width)) / block.x;
     //    grid.x = (int)ceilf((float)
-    //            (acc.img.width - (idle_left + idle_right) * block.x) /
+    //            (acc.img->width - (idle_left + idle_right) * block.x) /
     //            (block.x*2));

     //    // update number of blocks
@@ -1196,10 +1196,10 @@
     size_t offset = 0;
     hipaccConfigureCall(grid, block);

-    switch (acc.img.mem_type) {
+    switch (acc.img->mem_type) {
         default:
         case Global:
-            hipaccSetupArgument(&acc.img.mem, sizeof(T2 *), offset);
+            hipaccSetupArgument(&acc.img->mem, sizeof(T2 *), offset);
             break;
         case Array2D:
             hipaccBindTexture<T>(Array2D, tex, acc.img);
@@ -1207,12 +1207,12 @@
     }

     hipaccSetupArgument(&output, sizeof(T *), offset);
-    hipaccSetupArgument(&acc.img.width, sizeof(unsigned int), offset);
-    hipaccSetupArgument(&acc.img.height, sizeof(unsigned int), offset);
-    hipaccSetupArgument(&acc.img.stride, sizeof(unsigned int), offset);
+    hipaccSetupArgument(&acc.img->width, sizeof(unsigned int), offset);
+    hipaccSetupArgument(&acc.img->height, sizeof(unsigned int), offset);
+    hipaccSetupArgument(&acc.img->stride, sizeof(unsigned int), offset);
     // check if the reduction is applied to the whole image
     //if ((acc.offset_x || acc.offset_y) &&
-    //    (acc.width!=acc.img.width || acc.height!=acc.img.height)) {
+    //    (acc.width!=acc.img->width || acc.height!=acc.img->height)) {
     //    hipaccSetupArgument(&acc.offset_x, sizeof(unsigned int), offset);
     //    hipaccSetupArgument(&acc.offset_y, sizeof(unsigned int), offset);
     //    hipaccSetupArgument(&acc.width, sizeof(unsigned int), offset);


CMake: store resources in bin directory of SDK

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -44,7 +44,7 @@
 set (DEST_INCLUDE_DIR include/Urho3D)
 set (DEST_BIN_DIR bin)
 set (DEST_SHARE_DIR share)
-set (DEST_RESOURCE_DIR ${DEST_SHARE_DIR}/Resources)
+set (DEST_RESOURCE_DIR ${DEST_BIN_DIR})
 set (DEST_BUNDLE_DIR ${DEST_SHARE_DIR}/Applications)
 set (DEST_LIBRARY_DIR lib${LIB_SUFFIX})
 set (DEST_PKGCONFIG_DIR lib${LIB_SUFFIX}/pkgconfig)


cmake: Add system specific information for Rocky Linux 8.

Signed-off-by: Oliver Freyermuth <297815a44ac0d229e08a814adf0f210787d04d87@googlemail.com>

--- build/cmake/macros/SystemSpecificInformations.cmake
+++ build/cmake/macros/SystemSpecificInformations.cmake
@@ -150,6 +150,15 @@
 	set(SYSTEM_NAME "centos${CMAKE_MATCH_1}")
 	set(RPM_SYSTEM_NAME "${SYSTEM_NAME}")
       endif(LINUX_ISSUE MATCHES "CentOS")
+      # Rocky case
+      # Rocky Linux release 8.4 (Green Obsidian)
+      if(LINUX_ISSUE MATCHES "Rocky Linux")
+	string(REGEX MATCH "release ([0-9]+\\.*[0-9]*)" ROCKY "${LINUX_ISSUE}")
+        set(LINUX_NAME "Rocky")
+	set(LINUX_VER "${CMAKE_MATCH_1}")
+	set(SYSTEM_NAME "rocky${CMAKE_MATCH_1}")
+	set(RPM_SYSTEM_NAME "${SYSTEM_NAME}")
+      endif(LINUX_ISSUE MATCHES "Rocky Linux")
       # Redhat case
       # Red Hat Enterprise Linux Server release 5 (Tikanga)
       if(LINUX_ISSUE MATCHES "Red Hat")


boards: qemu_cortex_r5: remove CI workaround

Now that we have SDK 0.11.0 as default, we don't need workaround for
finding qemu.

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

--- boards/arm/qemu_cortex_r5/board.cmake
+++ boards/arm/qemu_cortex_r5/board.cmake
@@ -1,18 +1,6 @@
 # Copyright (c) 2019 Lexmark International, Inc.
 #
 # SPDX-License-Identifier: Apache-2.0
-
-# FIXME++: This forces the CI to use the Xilinx QEMU included in the Zephyr SDK
-#          0.11.0-alpha-8 for testing. This should be removed once the Zephyr
-#          SDK 0.11.0 release is mainlined.
-set(CI_QEMU_PATH
-  /opt/sdk/zephyr-sdk-0.11.0-alpha-8/sysroots/x86_64-pokysdk-linux/usr/bin
-  )
-
-if(EXISTS ${CI_QEMU_PATH})
-  set(ENV{QEMU_BIN_PATH} ${CI_QEMU_PATH})
-endif()
-# FIXME--

 set(EMU_PLATFORM qemu)
 set(QEMU_ARCH xilinx-aarch64)


added: support for config/install of a version header

--- share/hugh/cmake/functions/cma_setup_library.cmake
+++ share/hugh/cmake/functions/cma_setup_library.cmake
@@ -113,5 +113,12 @@
             COMPONENT   ${${PROJECT_NAME}_HDR_COMPONENT_NAME})
   endif()

+  if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/version.hpp.in)
+    configure_file(version.hpp.in version.hpp @ONLY)
+    install(FILES       ${CMAKE_CURRENT_BINARY_DIR}/version.hpp
+            DESTINATION ${${PROJECT_NAME}_HEADER_DIRECTORY}/${LIB_INCDIR_INSTALL}
+            COMPONENT   ${${PROJECT_NAME}_HDR_COMPONENT_NAME})
+  endif()
+
   cma_add_target_to_list(${LIB_NAME} CMAKE_TARGET_LIST)
 endfunction()


ApplicationTools: Link in boo and hecl-light

Ensures that the include paths are always automatically added to the
shader targets.

--- hecl/ApplicationTools.cmake
+++ hecl/ApplicationTools.cmake
@@ -52,6 +52,7 @@
   add_stage_rep(shader_${name} ${CMAKE_CURRENT_BINARY_DIR}/${dir}/shader_${name}.hpp)
   add_pipeline_rep(shader_${name} ${CMAKE_CURRENT_BINARY_DIR}/${dir}/shader_${name}.hpp UNIVERSAL)
   add_library(shader_${name} ${CMAKE_CURRENT_BINARY_DIR}/${dir}/shader_${name}.hpp ${CMAKE_CURRENT_BINARY_DIR}/${dir}/shader_${name}.cpp)
+  target_link_libraries(shader_${name} PUBLIC boo hecl-light)
   add_shader_target(shader_${name})
 endfunction()

@@ -59,5 +60,6 @@
   add_stage_rep(${name} ${name}.hpp)
   add_pipeline_rep(${name} ${name}.hpp UNIVERSAL)
   add_library(${name} ${name}.hpp ${ARGN})
+  target_link_libraries(${name} PUBLIC boo hecl-light)
   add_shader_target(${name})
 endfunction()


cmake: allow to disable ADE build too (BUILD_opencv_gapi=OFF is not enough)

CMake option: WITH_ADE=OFF

--- modules/gapi/cmake/init.cmake
+++ modules/gapi/cmake/init.cmake
@@ -1,3 +1,9 @@
+OCV_OPTION(WITH_ADE "Enable ADE framework (required for Graph API module)" ON)
+
+if(NOT WITH_ADE)
+  return()
+endif()
+
 if (ade_DIR)
   # if ade_DIR is set, use ADE-supplied CMake script
   # to set up variables to the prebuilt ADE


Fix find script

Fix find script

--- globjects-config.cmake
+++ globjects-config.cmake
@@ -7,7 +7,7 @@

 # List of modules
 set(MODULE_NAMES
-    glbinding
+    globjects
 )


Ticket #3136 Fixes for non-proper building

--- build/cmake/macros/CondorUnitTest.cmake
+++ build/cmake/macros/CondorUnitTest.cmake
@@ -24,29 +24,38 @@

 		# we are dependent on boost unit testing framework.
 		include_directories(${BOOST_INCLUDE})
+		# the structure is a testing subdirectory, so set inlude to go up one level
+		include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../)

 		set ( LOCAL_${_CNDR_TARGET} ${_CNDR_TARGET} )

 		if ( WINDOWS )
 			string (REPLACE ".exe" "" ${LOCAL_${_CNDR_TARGET}} ${LOCAL_${_CNDR_TARGET}})
 		else()
-			## add_definitions(-DBOOST_TEST_DYN_LINK)
+			if (PROPER)
+			  # if you are proper then link the system .so (now .a's by def)
+			  add_definitions(-DBOOST_TEST_DYN_LINK)
+			endif()
 		endif( WINDOWS )

 		add_executable( ${LOCAL_${_CNDR_TARGET}} ${_SRCS})

+		if (BOOST_REF)
+		    add_dependencies( classads ${BOOST_REF} )
+		endif()
+
 		if ( WINDOWS )
-			set_property( TARGET ${LOCAL_${_CNDR_TARGET}} PROPERTY FOLDER "tests" )
-			target_link_libraries (${LOCAL_${_CNDR_TARGET}} optimized libboost_unit_test_framework-${MSVCVER}-mt-${BOOST_SHORTVER} )
-			target_link_libraries (${LOCAL_${_CNDR_TARGET}} debug libboost_unit_test_framework-${MSVCVER}-mt-gd-${BOOST_SHORTVER} )
+		  set_property( TARGET ${LOCAL_${_CNDR_TARGET}} PROPERTY FOLDER "tests" )
+		  #windows will require runtime to match so make certain we link the right one.
+		  target_link_libraries (${LOCAL_${_CNDR_TARGET}} optimized libboost_unit_test_framework-${MSVCVER}-mt-${BOOST_SHORTVER} )
+		  target_link_libraries (${LOCAL_${_CNDR_TARGET}} debug libboost_unit_test_framework-${MSVCVER}-mt-gd-${BOOST_SHORTVER} )
 		else()
-			target_link_libraries (${LOCAL_${_CNDR_TARGET}} -lboost_unit_test_framework )
+		  target_link_libraries (${LOCAL_${_CNDR_TARGET}}  -lboost_unit_test_framework )
 		endif ( WINDOWS )

 		condor_set_link_libs( ${LOCAL_${_CNDR_TARGET}} "${_LINK_LIBS}" )

-		add_test ( ${LOCAL_${_CNDR_TARGET}}_unit_test
-			   ${LOCAL_${_CNDR_TARGET}} )
+		add_test ( ${LOCAL_${_CNDR_TARGET}}_unit_test ${LOCAL_${_CNDR_TARGET}} )

 		APPEND_VAR( CONDOR_TESTS ${_CNDR_TARGET} )


[numerics] reduce the number of iteration for examples that fails in order to avoid timeout

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -545,10 +545,10 @@

   # --- Test from rock pile simulations using "time of birth" feature ---
   # failure in local solver with line search
-  NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 10000
+  NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 1000
     SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 1e-16 100 WILL_FAIL)
   #  an increasing number of newton iterations implies a failure
-  NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 10000
+  NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 1000
     SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 1e-16 1000 WILL_FAIL )
   # removing the line --search is worth
   NEW_FC_3D_TEST(RockPile_tob1.dat SICONOS_FRICTION_3D_NSGS 1e-3 2000


Enable rejit feature on all cpu architectures (#27576)

--- clrdefinitions.cmake
+++ clrdefinitions.cmake
@@ -194,9 +194,7 @@
 add_compile_definitions($<$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>:FEATURE_READYTORUN_COMPILER>)
 set(FEATURE_READYTORUN 1)

-if (CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
-  add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_REJIT>)
-endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_I386)
+add_compile_definitions($<$<NOT:$<BOOL:$<TARGET_PROPERTY:CROSSGEN_COMPONENT>>>:FEATURE_REJIT>)

 if (CLR_CMAKE_PLATFORM_UNIX OR CLR_CMAKE_TARGET_ARCH_ARM64)
     add_definitions(-DFEATURE_STUBS_AS_IL)


Enabling CLR implemented write watch on AMD64 on Windows. (#16516)

--- clrdefinitions.cmake
+++ clrdefinitions.cmake
@@ -205,10 +205,13 @@
   add_definitions(-DFEATURE_UNIX_AMD64_STRUCT_PASSING)
 endif (CLR_CMAKE_PLATFORM_UNIX_AMD64)
 add_definitions(-DFEATURE_USE_ASM_GC_WRITE_BARRIERS)
+if(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR (CLR_CMAKE_PLATFORM_ARCH_ARM64 AND NOT WIN32))
+  add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
+endif(CLR_CMAKE_PLATFORM_ARCH_AMD64 OR (CLR_CMAKE_PLATFORM_ARCH_ARM64 AND NOT WIN32))
 if((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)
   add_definitions(-DFEATURE_MANUALLY_MANAGED_CARD_BUNDLES)
-  add_definitions(-DFEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP)
 endif((CLR_CMAKE_PLATFORM_ARCH_AMD64 OR CLR_CMAKE_PLATFORM_ARCH_ARM64) AND NOT WIN32)
+
 if(WIN32)
     add_definitions(-DFEATURE_VERSIONING_LOG)
 endif(WIN32)


cmake: make cmake detection of LLVM match old-style makefile

--- cmake/FindLLVM.cmake
+++ cmake/FindLLVM.cmake
@@ -23,7 +23,12 @@
 # Once llvm-config is found, it will be used to query available components
 #
 if(NOT LLVM_FOUND AND NOT TARGET_LLVM)
-  find_program(LLVM_CONFIG_EXECUTABLE llvm-config)
+  if(NOT LLVM_CONFIG_EXECUTABLE)
+    # if an explicitly-versioned llvm-config (that we've tested with) is
+    #  available, use that
+    find_program(LLVM_CONFIG_EXECUTABLE NAMES llvm-config-3.5
+                                              llvm-config)
+  endif(NOT LLVM_CONFIG_EXECUTABLE)
   if(LLVM_CONFIG_EXECUTABLE)
     # Check components
     execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} --components
@@ -57,6 +62,11 @@
       OUTPUT_VARIABLE _LLVM_SYSTEM_LIBS
       OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
     )
+    # llvm-config --system-libs gives you all the libraries you might need for anything,
+    #  which includes things we don't need, and might not be installed
+    # for example, filter out libedit
+    string(REPLACE "-ledit" "" _LLVM_SYSTEM_LIBS "${_LLVM_SYSTEM_LIBS}")
+
     string(REPLACE "-l" "" _LLVM_SYSTEM_LIBS "${_LLVM_SYSTEM_LIBS}")
     string(REPLACE " " ";" _LLVM_SYSTEM_LIBS "${_LLVM_SYSTEM_LIBS}")
     list(APPEND _LLVM_LIBS ${_LLVM_SYSTEM_LIBS})
@@ -78,7 +88,7 @@

 if(LLVM_FOUND AND NOT TARGET LLVM::LLVM)
   add_library(LLVM::LLVM INTERFACE IMPORTED)
-  set_target_properties(LLVM PROPERTIES
+  set_target_properties(LLVM::LLVM PROPERTIES
     INTERFACE_COMPILE_OPTIONS "--std=c++11"
     INTERFACE_INCLUDE_DIRECTORIES "${_LLVM_INCLUDE}"
     INTERFACE_LINK_LIBRARIES "${_LLVM_LIBS}"


removed message

removed message

--- cmake/FindOgre.cmake
+++ cmake/FindOgre.cmake
@@ -111,7 +111,6 @@
     determine_ogre_static(OGRE_CONFIG_STATIC ${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h)
     determine_ogre_freeimage(OGRE_CONFIG_FREEIMAGE ${OGRE_H_BUILD_SETTINGS_PATH}/OgreBuildSettings.h)
     set(OGRE_STATIC ${OGRE_CONFIG_STATIC})
-    message(status " OGRE_CONFIG_FREEIMAGE : ${OGRE_CONFIG_FREEIMAGE}")
 endif ()

 if (OGRE_STATIC)
@@ -181,7 +180,7 @@
         endif()
     endif()

-    # look for required Ogre dependencies in case of static build
+    # look for required Ogre dependencies in case of static build
     if (OGRE_STATIC)
         set(OGRE_DEPS_FOUND TRUE)
         find_package(FreeImage QUIET)


Undo local, unneeded patch

Undo local, unneeded patch

--- cmake/Findllvm.cmake
+++ cmake/Findllvm.cmake
@@ -50,6 +50,7 @@
 NEED_TARGET("ARM")
 NEED_TARGET("BPF")
 NEED_TARGET("Hexagon")
+NEED_TARGET("Lanai")
 NEED_TARGET("Mips")
 NEED_TARGET("MSP430")
 NEED_TARGET("NVPTX")