arch/arc: Add -mcpu flag to TOOLCHAIN_LD_FLAGS

Make sure the linker knows what the target is, in case it needs to find
additional target-specific libraries (like picolibc).

Signed-off-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>

--- cmake/compiler/gcc/target_arc.cmake
+++ cmake/compiler/gcc/target_arc.cmake
@@ -9,4 +9,4 @@
 endif()

 list(APPEND TOOLCHAIN_C_FLAGS -mcpu=${GCC_ARC_TUNED_CPU})
-
+list(APPEND TOOLCHAIN_LD_FLAGS -mcpu=${GCC_ARC_TUNED_CPU})


[wasm] remove deprecated prefix 'EXTRA_' in emcc flags (#9211)

--- cmake/onnxruntime_webassembly.cmake
+++ cmake/onnxruntime_webassembly.cmake
@@ -39,20 +39,20 @@
   re2::re2
 )

-set(EXTRA_EXPORTED_RUNTIME_METHODS "['stackAlloc','stackRestore','stackSave','UTF8ToString','stringToUTF8','lengthBytesUTF8']")
+set(EXPORTED_RUNTIME_METHODS "['stackAlloc','stackRestore','stackSave','UTF8ToString','stringToUTF8','lengthBytesUTF8']")

-set_target_properties(onnxruntime_webassembly PROPERTIES LINK_FLAGS "                         \
-                      -s \"EXTRA_EXPORTED_RUNTIME_METHODS=${EXTRA_EXPORTED_RUNTIME_METHODS}\" \
-                      -s WASM=1                                                               \
-                      -s NO_EXIT_RUNTIME=0                                                    \
-                      -s ALLOW_MEMORY_GROWTH=1                                                \
-                      -s MODULARIZE=1                                                         \
-                      -s EXPORT_ALL=0                                                         \
-                      -s LLD_REPORT_UNDEFINED                                                 \
-                      -s VERBOSE=0                                                            \
-                      -s NO_FILESYSTEM=1                                                      \
-                      -s MALLOC=${onnxruntime_WEBASSEMBLY_MALLOC}                             \
-                      --closure 1                                                             \
+set_target_properties(onnxruntime_webassembly PROPERTIES LINK_FLAGS "             \
+                      -s \"EXPORTED_RUNTIME_METHODS=${EXPORTED_RUNTIME_METHODS}\" \
+                      -s WASM=1                                                   \
+                      -s NO_EXIT_RUNTIME=0                                        \
+                      -s ALLOW_MEMORY_GROWTH=1                                    \
+                      -s MODULARIZE=1                                             \
+                      -s EXPORT_ALL=0                                             \
+                      -s LLD_REPORT_UNDEFINED                                     \
+                      -s VERBOSE=0                                                \
+                      -s NO_FILESYSTEM=1                                          \
+                      -s MALLOC=${onnxruntime_WEBASSEMBLY_MALLOC}                 \
+                      --closure 1                                                 \
                       --no-entry")

 if (CMAKE_BUILD_TYPE STREQUAL "Debug")


Split off 8.6.14

Split off 8.6.14

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 6 )
-set ( HPCC_POINT 13 )
+set ( HPCC_POINT 15 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Set version to 1.5.0 (#40)

Set version to 1.5.0 (#40)

--- version.cmake
+++ version.cmake
@@ -1,4 +1,4 @@
 # Copyright (C) 2017 Prism Skylabs
 set(ConnectSDK_VERSION_MAJOR 1)
-set(ConnectSDK_VERSION_MINOR 4)
+set(ConnectSDK_VERSION_MINOR 5)
 set(ConnectSDK_VERSION_REVISION 0)


Split off closedown-4.0.x

Split off closedown-4.0.x

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -2,8 +2,8 @@
 ## Version Information
 ###
 set ( HPCC_PROJECT "community" )
-set ( HPCC_MAJOR 3 )
-set ( HPCC_MINOR 11 )
+set ( HPCC_MAJOR 4 )
+set ( HPCC_MINOR 1 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "trunk" )
 set ( HPCC_SEQUENCE 1 )


Bugfix: Only try to extract the metis version number out of a file if it is
actually found.

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@26644 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/modules/FindMETIS.cmake
+++ deal.II/cmake/modules/FindMETIS.cmake
@@ -13,21 +13,20 @@
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

-#
-# Extract the version number out of metis.h
-#
-FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MAJOR_STRING
-  REGEX "METIS_VER_MAJOR")
-STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_MAJOR "${METIS_MAJOR_STRING}")
-
-FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MINOR_STRING
-  REGEX "METIS_VER_MINOR")
-STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_MINOR "${METIS_MINOR_STRING}")
-
-
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(METIS DEFAULT_MSG METIS_LIBRARY METIS_INCLUDE_DIR)

 IF(METIS_FOUND)
+  #
+  # Extract the version number out of metis.h
+  #
+  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MAJOR_STRING
+    REGEX "METIS_VER_MAJOR")
+  STRING(REGEX REPLACE "^.*METIS_VER_MAJOR.* ([0-9]+).*" "\\1" METIS_MAJOR "${METIS_MAJOR_STRING}")
+
+  FILE(STRINGS "${METIS_INCLUDE_DIR}/metis.h" METIS_MINOR_STRING
+    REGEX "METIS_VER_MINOR")
+  STRING(REGEX REPLACE "^.*METIS_VER_MINOR.* ([0-9]+).*" "\\1" METIS_MINOR "${METIS_MINOR_STRING}")
+
   MARK_AS_ADVANCED(
     METIS_LIBRARY
     METIS_INCLUDE_DIR


CMake: FindP4EST.cmake now export VERSION numbers as well

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

--- deal.II/cmake/modules/FindP4EST.cmake
+++ deal.II/cmake/modules/FindP4EST.cmake
@@ -21,6 +21,11 @@
 #   P4EST_LIBRARIES
 #   P4EST_INCLUDE_DIRS
 #   P4EST_WITH_MPI
+#   P4EST_VERSION
+#   P4EST_VERSION_MAJOR
+#   P4EST_VERSION_MINOR
+#   P4EST_VERSION_SUBMINOR
+#   P4EST_VERSION_POINT
 #

 INCLUDE(FindPackageHandleStandardArgs)
@@ -50,7 +55,7 @@
 # given, take what we chose for p4est.
 #

-FIND_PATH(P4EST_INCLUDE_DIR p4est.h
+FIND_PATH(P4EST_INCLUDE_DIR p4est_config.h
   HINTS
     ${P4EST_DIR}
   PATH_SUFFIXES
@@ -121,6 +126,27 @@
     SET(P4EST_WITH_MPI TRUE)
   ENDIF()

+  #
+  # Extract version numbers:
+  #
+  FILE(STRINGS "${P4EST_INCLUDE_DIR}/p4est_config.h" P4EST_VERSION
+    REGEX "#define P4EST_VERSION \"")
+  STRING(REGEX REPLACE "^.*P4EST_VERSION.*\"([0-9]+.*)\".*" "\\1"
+    P4EST_VERSION "${P4EST_VERSION}"
+    )
+  STRING(REGEX REPLACE
+    "^([0-9]+).*$" "\\1"
+    P4EST_VERSION_MAJOR "${P4EST_VERSION}")
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.([0-9]+).*$" "\\1"
+    P4EST_VERSION_MINOR "${P4EST_VERSION}")
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+    P4EST_VERSION_SUBMINOR "${P4EST_VERSION}")
+  STRING(REGEX REPLACE
+    "^[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1"
+    P4EST_VERSION_POINT "${P4EST_VERSION}")
+
   MARK_AS_ADVANCED(P4EST_DIR)
 ELSE()
   SET(P4EST_DIR "" CACHE PATH


COMP: Fix inconsistent dll linkage error on windows

This commit addresses a regression introduced in 53edc736d (COMP: Fix
configuration updating ITKSetStandardCompilerFlags) and disable the
setting of BUILD_SHARED_LIBS. This caused the ShapePopulationViewer module
to be incorrectly built statically.

Co-authored-by: Jared Vicory <5df7de1969e5e4a0f58a4b29d80033bf2061b10c@kitware.com>

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -240,18 +240,18 @@
         set(CMAKE_EXE_LINKER_FLAGS "-Wl,--enable-auto-import")
       endif()
     else()
-      # if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then
-      # BUILD_SHARED_LIBS works as it would on other systems
-      if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
-        if(BUILD_SHARED_LIBS)
-          set(ITK_LIBRARY_BUILD_TYPE "SHARED")
-        else()
-          set(ITK_LIBRARY_BUILD_TYPE "STATIC")
-        endif()
-        # turn off BUILD_SHARED_LIBS as ITK_LIBRARY_BUILD_TYPE
-        # is used on the libraries that have markup.
-        set(BUILD_SHARED_LIBS OFF)
-      endif()
+#      # if CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS is on, then
+#      # BUILD_SHARED_LIBS works as it would on other systems
+#      if(NOT CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS)
+#        if(BUILD_SHARED_LIBS)
+#          set(ITK_LIBRARY_BUILD_TYPE "SHARED")
+#        else()
+#          set(ITK_LIBRARY_BUILD_TYPE "STATIC")
+#        endif()
+#        # turn off BUILD_SHARED_LIBS as ITK_LIBRARY_BUILD_TYPE
+#        # is used on the libraries that have markup.
+#        set(BUILD_SHARED_LIBS OFF)
+#      endif()
     endif()
   endif()
   #-----------------------------------------------------------------------------


[generation] link to TAO_Strategies to get all supported protocols

--- lib/orocos/templates/config/OrocosComponent.cmake
+++ lib/orocos/templates/config/OrocosComponent.cmake
@@ -71,7 +71,7 @@
 TARGET_LINK_LIBRARIES(<%= component.name %> <%= component.name %>-tasks-${OROCOS_TARGET})
 <% end %>
 <% if component.corba_enabled? %>
-TARGET_LINK_LIBRARIES(<%= component.name %> ${OrocosCORBA_LIBS})
+TARGET_LINK_LIBRARIES(<%= component.name %> ${OrocosCORBA_LIBS} TAO_Strategies)
 <% end %>

 INSTALL(TARGETS <%= component.name %>


Only add visibility flags if compiling with gcc

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -38,10 +38,12 @@
   if (OGRE_STATIC)
     # add static prefix, if compiling static version
     set_target_properties(${LIBNAME} PROPERTIES OUTPUT_NAME ${LIBNAME}Static)
-  else ()
-    # add GCC visibility flags to shared library build
-    set_target_properties(${LIBNAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
-  endif ()
+  else (OGRE_STATIC)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      # add GCC visibility flags to shared library build
+      set_target_properties(${LIBNAME} PROPERTIES COMPILE_FLAGS "${OGRE_GCC_VISIBILITY_FLAGS}")
+	endif (CMAKE_COMPILER_IS_GNUCXX)
+  endif (OGRE_STATIC)
   install(TARGETS ${LIBNAME}
     RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}"
       CONFIGURATIONS Release MinSizeRel RelWithDebInfo None


toolbox: add todo

toolbox: add todo

--- lib/cmake/compiler.cmake
+++ lib/cmake/compiler.cmake
@@ -2,6 +2,7 @@

+#TODO for gcc-4.6 set -std=c++0x
 # STANDARDS
 set(CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -std=c99")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")


ENH: Added more Dart variables to excludes

--- UseITK.cmake
+++ UseITK.cmake
@@ -13,6 +13,8 @@
     MAKECOMMAND
     SITE
     BUILDNAME
+    CVS_UPDATE_OPTIONS
+    DART_TESTING_TIMEOUT
     INCLUDE_INTERNALS
     ITK_BINARY_DIR
     ITK_LIBRARY_PATH


COMP: Use - instead of / in Visual Studio project names

--- CMake/mitkFunctionCompileSnippets.cmake
+++ CMake/mitkFunctionCompileSnippets.cmake
@@ -22,7 +22,7 @@
     # Uset the top-level directory name as the executable name
     string(REPLACE "/" ";" main_cpp_dir_tokens "${main_cpp_dir}")
     list(GET main_cpp_dir_tokens -1 snippet_exec_name)
-    set(snippet_target_name "Snippet/${snippet_exec_name}")
+    set(snippet_target_name "Snippet-${snippet_exec_name}")
     add_executable(${snippet_target_name} ${snippet_src_files})
     if(ARGN)
       target_link_libraries(${snippet_target_name} ${ARGN})
@@ -30,6 +30,8 @@
     set_target_properties(${snippet_target_name} PROPERTIES
       LABELS Documentation
       RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/snippets"
+      ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/snippets"
+      LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/snippets"
       OUTPUT_NAME ${snippet_exec_name}
     )


blas.cmake: Changed default to WITH_ATLAS=1, since openblas can be tricky to build in many cases: - janelia cluster - mac os x - compatibility issues with projects that use OpenMP

--- blas.cmake
+++ blas.cmake
@@ -1,7 +1,7 @@

 # select the desired blas implementation
 IF(NOT DEFINED WITH_ATLAS)
-    SET(WITH_ATLAS "OFF")
+    SET(WITH_ATLAS 1)
 ENDIF()
 SET(WITH_ATLAS ${WITH_ATLAS}
     CACHE BOOL "Use ATLAS (WITH_ATLAS=1) or openBLAS (WITH_ATLAS=0) ?"


Fixup kata RELEASE build handling.

Fixup kata RELEASE build handling.

- the RELEASE setting is a boolean, correct cmake check
- explicitly force log-level=0 & debug=true in cargo profile.dev entries

NB: to switch between RELEASE + non-RELEASE builds do "m clean",
  change easy-settings.cmake, then "m kata"
Change-Id: If56cd855a9f30313e264a808c0c12df0532194a0
GitOrigin-RevId: b15be5feba41a19a71ff86f00fee0b7bd0942049

--- apps/system/rust.cmake
+++ apps/system/rust.cmake
@@ -12,7 +12,7 @@
   -Z unstable-options
   -Z avoid-dev-deps)

-if(NOT "${RELEASE}" STREQUAL "")
+if("${RELEASE}")
     list(APPEND CARGO_OPTIONS "--release")
 endif()


ilastik: Updated to latest tag (flyem-20130207)

--- ilastik.cmake
+++ ilastik.cmake
@@ -27,7 +27,7 @@
 include (greenlet)

 external_git_repo (ilastik
-    flyem-20130206B
+    flyem-20130207
     http://github.com/janelia-flyem/flyem-ilastik)

 message ("Installing ${ilastik_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")


ilastik.cmake: Updated git tag.

ilastik.cmake: Updated git tag.

--- ilastik.cmake
+++ ilastik.cmake
@@ -27,7 +27,7 @@
 include (greenlet)

 external_git_repo (ilastik
-    flyem-20130221
+    flyem-20130701
     http://github.com/janelia-flyem/flyem-ilastik)

 message ("Installing ${ilastik_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")


minor fix

minor fix

--- SM/SM.cmake
+++ SM/SM.cmake
@@ -26,10 +26,10 @@
 if(WITH_FEAT)
 	message(STATUS "OpenCV_VERSION: ${OpenCV_VERSION}")
 	if(OpenCV_VERSION MATCHES "^3")
-		message(STATUS "OpenCV 3 found")
+		# message(STATUS "OpenCV 3 found")
 		findSubPart("${OpenCV_LIBRARIES}" "opencv_xfeatures2d" CV_NONFREE_FOUND)
 	else()
-		message(STATUS "OpenCV 2 found")
+		# message(STATUS "OpenCV 2 found")
 		findSubPart("${OpenCV_LIBRARIES}" "opencv_nonfree" CV_NONFREE_FOUND)
 	endif()
 	if(CV_NONFREE_FOUND)


Fix in cat-parts.cmake

Fix in cat-parts.cmake

Some versions of CMake require these quotes to be here, or else the string contents are regarded as CMake code and parsing fails.

--- programs/build_helpers/cat-parts.cmake
+++ programs/build_helpers/cat-parts.cmake
@@ -19,9 +19,9 @@
 if( EXISTS ${HARDFORK_FILE} )
   file( READ ${HARDFORK_FILE} HFF )

-  if( ${HFF} STREQUAL ${HARDFORK_CONTENT} )
+  if( "${HFF}" STREQUAL "${HARDFORK_CONTENT}" )
     set( HARDFORK_REGENERATE FALSE )
-  endif( ${HFF} STREQUAL ${HARDFORK_CONTENT} )
+  endif( "${HFF}" STREQUAL "${HARDFORK_CONTENT}" )
 endif( EXISTS ${HARDFORK_FILE} )

 if( HARDFORK_REGENERATE )


- Removed uneeded commas in modules.cmake

--- modules.cmake
+++ modules.cmake
@@ -49,7 +49,7 @@
 		add_definitions(-DHAVE_MOD_STD_CONCURRENT)
 		clever_use_lib(PTHREAD)
 	else (PTHREAD_FOUND)
-		clever_module_msg(std_concurrent, "Posix Threads are not present on this system")
+		clever_module_msg(std_concurrent "Posix Threads are not present on this system")
 		set(MOD_STD_CONCURRENT OFF)
 	endif (PTHREAD_FOUND)
 endif (MOD_STD_CONCURRENT)
@@ -61,7 +61,7 @@
 	if (CONCURRENCY_FOUND)
 		add_definitions(-DHAVE_MOD_STD_EVENTS)
 	else (CONCURRENCY_FOUND)
-		clever_module_msg(std_events, "Posix Threads are not present on this system")
+		clever_module_msg(std_events "Posix Threads are not present on this system")
 		set(MOD_STD_EVENTS OFF)
 	endif (CONCURRENCY_FOUND)
 endif (MOD_STD_EVENTS)


Unconditionally rebuild "CTK-build" inner project. Restore commit 1be215aef3

See #32

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -53,3 +53,13 @@
     ${CTK_DEPENDENCIES}
   STEP_TARGETS configure
   )
+
+# This custom external project step forces the build and later
+# steps to run whenever a top level build is done...
+ExternalProject_Add_Step(${proj} forcebuild
+  COMMAND ${CMAKE_COMMAND} -E echo_append ""
+  COMMENT "Forcing build step for '${proj}'"
+  DEPENDEES configure
+  DEPENDERS build
+  ALWAYS 1
+  )


Revert resetting of CMAKE_DEBUG_POSTFIX when Python is enabled

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -184,11 +184,11 @@
   -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_MODULE_LINKER_FLAGS}
 )

-set(DCMTK_CMAKE_DEBUG_POSTFIX )
-
-# python libraries wont work with it
-if(NOT MITK_USE_Python3)
-  list(APPEND ep_common_args -DCMAKE_DEBUG_POSTFIX:STRING=d)
+if(MSVC_VERSION)
+  list(APPEND ep_common_args
+    -DCMAKE_DEBUG_POSTFIX:STRING=d
+  )
+
   set(DCMTK_CMAKE_DEBUG_POSTFIX d)
 endif()


(split) Merge topic 'SuperbuildPropagateCMakeArgs2'

a9cbc29 BUG: Propagate build, linker, and OSX settings to external projects

--- Superbuild.cmake
+++ Superbuild.cmake
@@ -16,14 +16,24 @@

 include( ExternalProject )

-# Compute -G arg for configuring external projects with the same CMake gener    ator:
+# Compute -G arg for configuring external projects with the same CMake generator:
 if(CMAKE_EXTRA_GENERATOR)
   set(gen "${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
 else()
   set(gen "${CMAKE_GENERATOR}" )
 endif()

+set(CMAKE_OSX_EXTERNAL_PROJECT_ARGS)
+if(APPLE)
+  list(APPEND CMAKE_OSX_EXTERNAL_PROJECT_ARGS
+    -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
+    -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET}
+    -DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT}
+  )
+endif(APPLE)
+
 set(ep_common_args
+  -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
   -DCMAKE_CXX_COMPILER:PATH=${CMAKE_CXX_COMPILER}
   -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
   -DCMAKE_C_COMPILER:PATH=${CMAKE_C_COMPILER}
@@ -31,6 +41,7 @@
   -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_EXE_LINKER_FLAGS}
   -DCMAKE_GENERATOR:STRING=${CMAKE_GENERATOR}
   -DCMAKE_EXTRA_GENERATOR:STRING=${CMAKE_EXTRA_GENERATOR}
+  ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
   )

 set( ITKApps_DEPENDENCIES )


cmake: fix popcnt detection with Intel Compiler

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -238,7 +238,7 @@
     ocv_intel_compiler_optimization_option(FP16 "-mavx" "/arch:AVX")
     ocv_intel_compiler_optimization_option(AVX "-mavx" "/arch:AVX")
     ocv_intel_compiler_optimization_option(FMA3 "" "")
-    ocv_intel_compiler_optimization_option(POPCNT "" "")
+    ocv_intel_compiler_optimization_option(POPCNT "-mpopcnt" "")  # -mpopcnt is available since ICC 19.0.0
     ocv_intel_compiler_optimization_option(SSE4_2 "-msse4.2" "/arch:SSE4.2")
     ocv_intel_compiler_optimization_option(SSE4_1 "-msse4.1" "/arch:SSE4.1")
     ocv_intel_compiler_optimization_option(SSE3 "-msse3" "/arch:SSE3")


added workspace marker

added workspace marker

--- cmake/catkin_generate_environment.cmake
+++ cmake/catkin_generate_environment.cmake
@@ -1,9 +1,10 @@
 function(catkin_generate_environment)
-  set(CATKIN_WORKSPACES $ENV{CATKIN_WORKSPACES})
-
   # buildspace
   set(SETUP_DIR ${catkin_BUILD_PREFIX})
   set(CURRENT_WORKSPACE ${catkin_BUILD_PREFIX}:${CMAKE_SOURCE_DIR})
+
+  # create workspace marker
+  file(WRITE ${catkin_BUILD_PREFIX}/CATKIN_WORKSPACE "")
   # copy setup.py
   file(COPY ${catkin_EXTRAS_DIR}/templates/setup.py
     DESTINATION ${catkin_BUILD_PREFIX})
@@ -41,7 +42,10 @@
   # installspace
   set(SETUP_DIR ${CMAKE_INSTALL_PREFIX})
   set(CURRENT_WORKSPACE ${CMAKE_INSTALL_PREFIX})
+
   if(NOT CATKIN_BUILD_BINARY_PACKAGE OR "${PROJECT_NAME}" STREQUAL "catkin")
+    # create workspace marker
+    file(WRITE ${CMAKE_INSTALL_PREFIX}/CATKIN_WORKSPACE "")
     # install setup.py
     install(PROGRAMS
       ${catkin_EXTRAS_DIR}/templates/setup.py


Specify paths for strip and objcopy for CMake

- Without these, sometimes CMake decides to use the host toolchain
(which is probably not ARM).

Change-Id: I2b6f43284392509cf8765f20f968e1c4fdb17598
GitOrigin-RevId: 92e96203f1795c3ece04d845fa24c3a8f4f9fd3f

--- cmake/toolchain-arm-none-eabi-gcc.cmake
+++ cmake/toolchain-arm-none-eabi-gcc.cmake
@@ -6,6 +6,8 @@

 get_filename_component(CMAKE_C_COMPILER ${CMAKE_SOURCE_DIR}/third_party/toolchain/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-gcc REALPATH CACHE)
 get_filename_component(CMAKE_CXX_COMPILER ${CMAKE_SOURCE_DIR}/third_party/toolchain/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-g++ REALPATH CACHE)
+get_filename_component(CMAKE_OBJCOPY ${CMAKE_SOURCE_DIR}/third_party/toolchain/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-objcopy REALPATH CACHE)
+get_filename_component(CMAKE_STRIP ${CMAKE_SOURCE_DIR}/third_party/toolchain/gcc-arm-none-eabi-9-2020-q2-update/bin/arm-none-eabi-strip REALPATH CACHE)

 execute_process(
     COMMAND ${CMAKE_C_COMPILER} -print-libgcc-file-name


PARQUET-927: Specify shared library version of Apache Arrow C++

It reduces readlink() calls.

This requires apache/arrow#451.

Author: Kouhei Sutou <kou@clear-code.com>

Closes #277 from kou/extract-so-version-from-pc and squashes the following commits:

9aff91e [Kouhei Sutou] Specify shared library version of Apache Arrow C++

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -354,13 +354,26 @@
   set(ARROW_INCLUDE_DIR ${ARROW_INCLUDE_DIRS})
   set(ARROW_LIBS ${ARROW_LIBRARY_DIRS})

+  pkg_get_variable(ARROW_ABI_VERSION arrow abi_version)
+  pkg_get_variable(ARROW_IO_ABI_VERSION arrow-io abi_version)
+  if (ARROW_ABI_VERSION STREQUAL "")
+    set(ARROW_SHARED_LIB_SUFFIX "")
+  else()
+    set(ARROW_SHARED_LIB_SUFFIX ".${ARROW_ABI_VERSION}")
+  endif()
+  if (ARROW_IO_ABI_VERSION STREQUAL "")
+    set(ARROW_IO_SHARED_LIB_SUFFIX "")
+  else()
+    set(ARROW_IO_SHARED_LIB_SUFFIX ".${ARROW_ABI_VERSION}")
+  endif()
+
   set(ARROW_LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}arrow)
   set(ARROW_IO_LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}arrow_io)

-  set(ARROW_SHARED_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+  set(ARROW_SHARED_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_SHARED_LIB_SUFFIX})
   set(ARROW_STATIC_LIB ${ARROW_LIBS}/${ARROW_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})

-  set(ARROW_IO_SHARED_LIB ${ARROW_LIBS}/${ARROW_IO_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
+  set(ARROW_IO_SHARED_LIB ${ARROW_LIBS}/${ARROW_IO_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}${ARROW_IO_SHARED_LIB_SUFFIX})
   set(ARROW_IO_STATIC_LIB ${ARROW_LIBS}/${ARROW_IO_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX})
 else()
   find_package(Arrow)


Add update target for doc repos to default targets

--- CommonDocumentation.cmake
+++ CommonDocumentation.cmake
@@ -21,7 +21,7 @@
 #   regular release build using Buildyard, which can be very time consuming.

 function(COMMON_DOCUMENTATION)
-  add_custom_target(${PROJECT_NAME}_doxygit
+  add_custom_target(${PROJECT_NAME}_doxygit ALL
     COMMAND ${CMAKE_COMMAND}
     -DPROJECT_NAME="${PROJECT_NAME}"
     -DDOXYGIT_TOC_POST:STRING="${DOXYGIT_TOC_POST}"
@@ -32,7 +32,7 @@

   # For meta project, separate doxygit and ${PROJECT_NAME}_doxygit
   if(NOT TARGET doxygit)
-    add_custom_target(doxygit)
+    add_custom_target(doxygit ALL)
   endif()
   add_dependencies(doxygit ${PROJECT_NAME}_doxygit)


package name : with build type

package name : with build type

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@1198 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/SiconosProject.cmake
+++ Numerics/cmake/SiconosProject.cmake
@@ -186,7 +186,7 @@
   SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")

   IF(PIPOL_IMAGE)
-    SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_PACKAGE_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-r${SVN_REVISION}-${PIPOL_IMAGE_NAME}")
+    SET(CPACK_PACKAGE_FILE_NAME "${PROJECT_PACKAGE_NAME}-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-r${SVN_REVISION}-${CMAKE_BUILD_TYPE}-${PIPOL_IMAGE_NAME}")
   ENDIF(PIPOL_IMAGE)
   SET(CPACK_PACKAGE_NAME "${PROJECT_PACKAGE_NAME}")


ManageTranslate: fix pot file targets

ManageTranslate: fix pot file targets

--- Modules/ManageTranslation.cmake
+++ Modules/ManageTranslation.cmake
@@ -456,7 +456,7 @@
     ## Otherwise it won't build when pot files is in sub CMakeLists.txt
     FOREACH(potFile ${MANAGE_TRANSLATION_GETTEXT_POT_FILES})
 	MANAGE_POT_FILE_OBTAIN_TARGET_NAME(targetName "${potFile}")
-	ADD_DEPENDENCIES(pot_files pot_file_${targetName}_no_force)
+	ADD_DEPENDENCIES(pot_files ${targetName}_no_force)
     ENDFOREACH(potFile)

     ## Target update_po


Windows: silenced the 'structure was padded due to alignment specifier' warning.

--- toolchains/msvc.toolchain.cmake
+++ toolchains/msvc.toolchain.cmake
@@ -19,7 +19,7 @@

 set( TNUN_compiler_release_flags /DNDEBUG /Bt /Ox /Ob2 /Oy /GF /Gw /Gm- /GS- /Gy /Qpar )

-add_compile_options( /MP /Oi /W4 /Zc:threadSafeInit- )
+add_compile_options( /MP /Oi /W4 /Zc:threadSafeInit- /wd4324 ) # w4324 = 'structure was padded due to alignment specifier'
 add_definitions(
     -D_CRT_SECURE_NO_WARNINGS
     -D_SBCS


fix openMP conflict

fix openMP conflict

--- include/pass_bits/config.hpp.cmake
+++ include/pass_bits/config.hpp.cmake
@@ -5,7 +5,6 @@
 #define ARMA_DONT_USE_BLAS
 #define ARMA_DONT_USE_LAPACK
 #define ARMA_USE_CXX11
-#define ARMA_USE_OPENMP
 #include <armadillo>

 // MPI support must be added via CMake, to ensure that we also link against it.


SuperBuild: geotiff patch not needed

SuperBuild: geotiff patch not needed

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -85,9 +85,9 @@
       BUILD_COMMAND $(MAKE) bin_PROGRAMS=
       INSTALL_COMMAND $(MAKE) install bin_PROGRAMS=
       DEPENDS ${${proj}_DEPENDENCIES}
-      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-        ${CMAKE_SOURCE_DIR}/patches/${proj}/configure
-        ${GEOTIFF_SB_SRC}
+      #PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+      #  ${CMAKE_SOURCE_DIR}/patches/${proj}/configure
+      #  ${GEOTIFF_SB_SRC}
       )

     ExternalProject_Add_Step(${proj} copy_source


Hide BUILTIN_FOO option if FOO is disabled

--- cmake/Extensions.cmake
+++ cmake/Extensions.cmake
@@ -72,29 +72,6 @@
         mark_as_advanced(CLEAR ENABLE_${upper_name})
     endif()

-    # Add options that the extention is either external to libpython or
-    # builtin.  These will be marked as advanced unless different from default
-    # values
-    if(NOT ADD_PYTHON_EXTENSION_BUILTIN)
-        set(ADD_PYTHON_EXTENSION_BUILTIN ${BUILD_EXTENSIONS_AS_BUILTIN})
-    endif()
-    option(BUILTIN_${upper_name}
-           "If this is set the \"${name}\" extension will be compiled in to libpython"
-           ${ADD_PYTHON_EXTENSION_BUILTIN}
-    )
-    if((BUILTIN_${upper_name} AND BUILD_EXTENSIONS_AS_BUILTIN)
-       OR (NOT BUILTIN_${upper_name} AND NOT BUILD_EXTENSIONS_AS_BUILTIN))
-        mark_as_advanced(FORCE BUILTIN_${upper_name})
-    else()
-        mark_as_advanced(CLEAR BUILTIN_${upper_name})
-    endif()
-
-    # HACK _ctypes_test should always be shared
-    if(${name} STREQUAL "_ctypes_test")
-        unset(BUILTIN_${upper_name} CACHE)
-        set(BUILTIN_${upper_name} 0)
-    endif()
-
     # Check all the things we require are found.
     set(missing_deps "")
     foreach(dep ${ADD_PYTHON_EXTENSION_REQUIRES} ENABLE_${upper_name})
@@ -103,6 +80,34 @@
             set(missing_deps "${missing_deps}${dep} ")
         endif(NOT (${list_dep}))
     endforeach(dep)
+
+    # Add options that the extention is either external to libpython or
+    # builtin.  These will be marked as advanced unless different from default
+    # values
+    if(NOT ADD_PYTHON_EXTENSION_BUILTIN)
+        set(ADD_PYTHON_EXTENSION_BUILTIN ${BUILD_EXTENSIONS_AS_BUILTIN})
+    endif()
+    cmake_dependent_option(
+        BUILTIN_${upper_name}
+        "If this is set the \"${name}\" extension will be compiled in to libpython"
+        ${ADD_PYTHON_EXTENSION_BUILTIN}
+        "NOT missing_deps"
+        OFF
+    )
+    if(NOT missing_deps)
+        if((BUILTIN_${upper_name} AND BUILD_EXTENSIONS_AS_BUILTIN)
+            OR (NOT BUILTIN_${upper_name} AND NOT BUILD_EXTENSIONS_AS_BUILTIN))
+            mark_as_advanced(FORCE BUILTIN_${upper_name})
+        else()
+            mark_as_advanced(CLEAR BUILTIN_${upper_name})
+        endif()
+    endif()
+
+    # HACK _ctypes_test should always be shared
+    if(${name} STREQUAL "_ctypes_test")
+        unset(BUILTIN_${upper_name} CACHE)
+        set(BUILTIN_${upper_name} 0)
+    endif()

     # If any dependencies were missing don't include this extension.
     if(missing_deps)


Fix typo in cmake/FindARPREC.cmake

Fix typo in cmake/FindARPREC.cmake

--- cmake/FindARPREC.cmake
+++ cmake/FindARPREC.cmake
@@ -7,7 +7,7 @@
 if (CMAKE_VERSION LESS 2.8.3)
   find_package_handle_standard_args (ARPREC DEFAULT_MSG ARPREC_LIBRARIES ARPREC_INCLUDE_DIR)
 else ()
-  find_package_handle_standard_args (ColPack REQUIRED_VARS ARPREC_LIBRARIES ARPREC_INCLUDE_DIR)
+  find_package_handle_standard_args (ARPREC REQUIRED_VARS ARPREC_LIBRARIES ARPREC_INCLUDE_DIR)
 endif ()

 mark_as_advanced(ARPREC_INCLUDE_DIR ARPREC_LIBRARIES)


fixes #12 on @katyhuff's computer.

fixes #12 on @katyhuff's computer.

--- cmake/FindCyclus.cmake
+++ cmake/FindCyclus.cmake
@@ -40,10 +40,16 @@
   /usr/local/cyclus /opt/local/cyclus
   PATH_SUFFIXES cyclus/include include include/cyclus include/cyclus/tests cyclus/include/tests)

-SET(
-  CYCLUS_CORE_TEST_INCLUDE_DIR ${CYCLUS_CORE_TEST_INCLUDE_DIR}
-  ${CYCLUS_CORE_TEST_INCLUDE_DIR}/../gtest
-  )
+# find the directory containing gtest
+FIND_PATH(CYCLUS_GTEST_INCLUDE_DIR gtest/gtest.h
+  HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}"
+  "${CYCLUS_ROOT_DIR}/include"
+  "${CYCLUS_ROOT_DIR}/include/cyclus"
+  /usr/local/cyclus /opt/local/cyclus
+  PATH_SUFFIXES cyclus/include include include/cyclus)
+
+SET(CYCLUS_CORE_TEST_INCLUDE_DIR ${CYCLUS_CORE_TEST_INCLUDE_DIR}
+  ${CYCLUS_GTEST_INCLUDE_DIR})

 # Add the root dir to the hints
 SET(CYCLUS_ROOT_DIR "${CYCLUS_CORE_INCLUDE_DIR}/../..")


Updating FindGear2D

Updating FindGear2D

--- cmake/FindGear2D.cmake
+++ cmake/FindGear2D.cmake
@@ -11,25 +11,36 @@
 if (NOT Gear2D_FOUND)

 if (WIN32)
+	message(STATUS "Trying windoze $ENV{PROGRAMFILES}")
 	find_path(Gear2D_INCLUDE_DIR gear2d.h
 		HINTS
 		$ENV{GEAR2DDIR}
 		PATHS
-		"C:\\$ENV{PROGRAMFILES}\\Gear2D\\include"
-		"C:\\$ENV{PROGRAMFILES(X86)}\\Gear2D\\include"
+		"$ENV{PROGRAMFILES}\\Gear2D\\include"
+		"$ENV{PROGRAMFILES(X86)}\\Gear2D\\include"
 		"C:\\Gear2D\\include"
-		"C:\\$ENV{PROGRAMFILES}\\Gear2D\\include\\gear2d"
-		"C:\\$ENV{PROGRAMFILES(X86)}\\Gear2D\\include\\gear2d"
+		"$ENV{PROGRAMFILES}\\Gear2D\\include\\gear2d"
+		"$ENV{PROGRAMFILES(X86)}\\Gear2D\\include\\gear2d"
 		"C:\\Gear2D\\include\\gear2d"
 	)

 	find_library(
 		Gear2D_LIBRARY gear2d
 		PATHS
-		"C:\\$ENV{PROGRAMFILES}\\Gear2D\\bin"
-		"C:\\$ENV{PROGRAMFILES(x86)}\\Gear2D\\bin"
+		"$ENV{PROGRAMFILES}\\Gear2D\\bin"
+		"$ENV{PROGRAMFILES(x86)}\\Gear2D\\bin"
 		"C:\\Gear2D\\bin"
 	)
+
+  find_program(
+    Gear2D_EXECUTABLE gear2d.exe
+    HINTS
+    $ENV{GEAR2DDIR}
+    PATHS
+    "$ENV{PROGRAMFILES}\\Gear2D\\bin"
+		"$ENV{PROGRAMFILES(x86)}\\Gear2D\\bin"
+		"C:\\Gear2D\\bin"
+  )
 else ()
 	find_path(Gear2D_INCLUDE_DIR gear2d.h
 		HINTS
@@ -62,17 +73,35 @@
 		/usr/local
 		/usr
 	)
+
+  find_program(
+    Gear2D_EXECUTABLE gear2d
+		HINTS
+		$ENV{GEAR2DDIR}
+		PATH_SUFFIXES bin
+		PATHS
+		/usr/local/
+		/usr/
+		/opt/local/
+		/opt
+  )
 endif(WIN32)

-IF(Gear2D_INCLUDE_DIR AND Gear2D_LIBRARY)
-	SET(Gear2D_FOUND TRUE)
-ENDIF(Gear2D_INCLUDE_DIR AND Gear2D_LIBRARY)
+IF(Gear2D_INCLUDE_DIR)
+	IF(Gear2D_LIBRARY)
+		SET(Gear2D_FOUND TRUE)
+	ELSE(Gear2D_LIBRARY)
+		message(ERROR "Missing Gear2D_LIBRARY")
+	ENDIF(Gear2D_LIBRARY)
+ELSE(Gear2D_INCLUDE_DIR)
+	message(ERROR "Missing Gear2D_INCLUDE_DIR")
+ENDIF(Gear2D_INCLUDE_DIR)

 IF(Gear2D_FOUND)
 	get_filename_component(Gear2D_LINK_DIR ${Gear2D_LIBRARY} PATH)
-    execute_process(COMMAND gear2d -v OUTPUT_VARIABLE Gear2D_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+    execute_process(COMMAND ${Gear2D_EXECUTABLE} -v OUTPUT_VARIABLE Gear2D_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
 	SET(Gear2D_COMPONENT_PREFIX ${Gear2D_LINK_DIR}/../lib/gear2d/component)
 	IF (NOT Gear2D_FIND_QUIETLY)
 		MESSAGE(STATUS "Found Gear2D: ${Gear2D_LIBRARY} version ${Gear2D_VERSION}")
@@ -80,7 +109,7 @@
 	ENDIF (NOT Gear2D_FIND_QUIETLY)
 ELSE(Gear2D_FOUND)
 	IF (Gear2D_FIND_REQUIRED)
-		MESSAGE(FATAL_ERROR "Could not find Gear2D")
+		MESSAGE(FATAL_ERROR "Could not find Gear2D.")
 	ENDIF (Gear2D_FIND_REQUIRED)
 ENDIF(Gear2D_FOUND)


FindXERCES.cmake be really QUIET when asked

--- cmake/FindXERCES.cmake
+++ cmake/FindXERCES.cmake
@@ -11,8 +11,10 @@
     "${XERCES_DIR}\\include"
     "C:/Program\ Files\ (x86)/CodeSynthesis\ XSD\ 3.3/include"
  )
-
-MESSAGE(STATUS "XERCES Include Dir ${XERCES_INCLUDE_DIR}")
+
+if (NOT XERCES_FIND_QUIETLY)
+    MESSAGE(STATUS "XERCES Include Dir ${XERCES_INCLUDE_DIR}")
+endif()

 if(CMAKE_SIZEOF_VOID_P EQUAL 8) #64bit compilation
     FIND_LIBRARY(XERCES_LIBRARY
@@ -80,8 +82,10 @@
   )
 endif()

+if (NOT XERCES_FIND_QUIETLY)
   MESSAGE(STATUS "XERCES Lib Dir ${XERCES_LIBRARY}")
-
+endif()
+
 IF (XERCES_LIBRARY AND XERCES_INCLUDE_DIR)
     SET(XERCES_LIBRARIES ${XERCES_LIBRARY})
     if(XERCES_LIBRARY_DEBUG)


Exclude vtkRenderingExternal from BUILD_ALL_MODULES

Change-Id: I48a5df59cda6538a17451186dd3fe2af9b4ef198

--- Rendering/External/module.cmake
+++ Rendering/External/module.cmake
@@ -4,4 +4,5 @@
     vtkRenderingOpenGL
   TEST_DEPENDS
     vtkTestingRendering
+  EXCLUDE_FROM_ALL
   )


Make sure glm is found so including the glm prefix

--- cmake-modules/FindGLM.cmake
+++ cmake-modules/FindGLM.cmake
@@ -1,5 +1,5 @@
-find_path(GLM_INCLUDE_DIR glm.hpp
-	PATH_SUFFIXES include/glm include
+find_path(GLM_INCLUDE_DIR glm/glm.hpp
+	PATH_SUFFIXES include
 )

 mark_as_advanced(GLM_INCLUDE_DIR)


Use GNU install directories, and rpath

Use GNU install directories, and rpath

Use the GNU install directories, and ensure the install rpath is set to
match. Warning - the prefix directory will need to be removed as lib is
always found before any other location (with CMake 2.8.11.1 at least).

Change-Id: I03e8fcd4a18a20bf5f8723c971faa90b50d31dd9

--- cmake/InstallLocation.cmake
+++ cmake/InstallLocation.cmake
@@ -4,27 +4,47 @@
 #
 # These paths attempt to adhere to the FHS, and are similar to those provided
 # by autotools and used in many Linux distributions.
+#
+# Use GNU install directories
+include(GNUInstallDirs)
 if(NOT INSTALL_RUNTIME_DIR)
-  set(INSTALL_RUNTIME_DIR "bin")
+  set(INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}")
 endif()
 if(NOT INSTALL_LIBRARY_DIR)
-  set(INSTALL_LIBRARY_DIR "lib")
+  set(INSTALL_LIBRARY_DIR "${CMAKE_INSTALL_LIBDIR}")
 endif()
 if(NOT INSTALL_ARCHIVE_DIR)
-  set(INSTALL_ARCHIVE_DIR "lib")
+  set(INSTALL_ARCHIVE_DIR "${CMAKE_INSTALL_LIBDIR}")
 endif()
 if(NOT INSTALL_INCLUDE_DIR)
-  set(INSTALL_INCLUDE_DIR "include")
+  set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
 endif()
 if(NOT INSTALL_DATA_DIR)
-  set(INSTALL_DATA_DIR "share")
+  set(INSTALL_DATA_DIR "${CMAKE_INSTALL_DATAROOTDIR}")
 endif()
 if(NOT INSTALL_DOC_DIR)
-  set(INSTALL_DOC_DIR "${INSTALL_DATA_DIR}/doc")
+  set(INSTALL_DOC_DIR "${CMAKE_INSTALL_DOCDIR}")
+endif()
+if(NOT INSTALL_MAN_DIR)
+  set(INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}")
+endif()
+if(UNIX AND NOT APPLE)
+  if(NOT INSTALL_XDG_APP_DIR)
+    set(INSTALL_XDG_APPS_DIR "${INSTALL_DATA_DIR}/applications")
+  endif()
+  if(NOT INSTALL_XDG_ICON_DIR)
+    set(INSTALL_XDG_ICON_DIR "${INSTALL_DATA_DIR}/pixmaps")
+  endif()
 endif()

 # Set up RPATH for the project too.
 option(ENABLE_RPATH "Enable rpath support on Linux and Mac" ON)
+if(NOT CMAKE_INSTALL_RPATH)
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
+endif()
+if(APPLE AND NOT CMAKE_INSTALL_NAME_DIR)
+  set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
+endif()
 if(UNIX AND ENABLE_RPATH)
   set(CMAKE_SKIP_BUILD_RPATH FALSE)
   set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)


Improve CMake module for GLM

Improve CMake module for GLM

* Parse version number from setup.hpp
* Document output variables
* Update advanced variables

--- cmake/Modules/FindGLM.cmake
+++ cmake/Modules/FindGLM.cmake
@@ -5,12 +5,33 @@
 # See LICENSE file.
 ##############################################################################

+# This will define:
+#
+# GLM_FOUND
+# GLM_INCLUDE_DIR
+# GLM_VERSION
+
 find_path(GLM_INCLUDE_DIR "glm/glm.hpp")
+find_file(GLM_SETUP_HPP NAMES "glm/core/setup.hpp" "glm/detail/setup.hpp")
+
+if(GLM_SETUP_HPP)
+	file(STRINGS
+		${GLM_SETUP_HPP}
+		GLM_VERSION_DEFINES
+		REGEX "#define[ \t]+GLM_VERSION_[A-Z]+[ \t]+[0-9]+$"
+	)
+	if(GLM_VERSION_DEFINES)
+		foreach(item IN ITEMS MAJOR MINOR PATCH REVISION)
+			string(REGEX REPLACE ".*#define[ \t]+GLM_VERSION_${item}[ \t]+([0-9]+).*" "\\1" GLM_VERSION_${item} ${GLM_VERSION_DEFINES})
+		endforeach()
+	endif()
+	set(GLM_VERSION "${GLM_VERSION_MAJOR}.${GLM_VERSION_MINOR}.${GLM_VERSION_PATCH}.${GLM_VERSION_REVISION}")
+endif()

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(GLM
-	REQUIRED_VARS GLM_INCLUDE_DIR
-	FAIL_MESSAGE "Failed to find GLM header"
+	REQUIRED_VARS GLM_INCLUDE_DIR GLM_SETUP_HPP
+	VERSION_VAR GLM_VERSION
 )

-mark_as_advanced(GLM_INCLUDE_DIR)
+mark_as_advanced(GLM_FOUND GLM_INCLUDE_DIR GLM_SETUP_HPP GLM_VERSION_MAJOR GLM_VERSION_MINOR GLM_VERSION_PATCH GLM_VERSION_REVISION GLM_VERSION)


Squashed '3rdparty/github/cmake-utils-remote/' changes from 09fb2f1..8923133

8923133 Install of export file bis

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 89231332a81d1e2fcbc01a191fedeb25d24c80dc

--- cmake/MyPackageExport.cmake
+++ cmake/MyPackageExport.cmake
@@ -11,6 +11,6 @@
     STATIC_DEFINE ${PROJECT_NAME}_STATIC)
   ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
   INSTALL(FILES ${_file} DESTINATION ${_dir})
-  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION ${PROJECT_NAME})
+  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION include/${PROJECT_NAME}/)

 ENDMACRO()


Removed all slashes after ${OpenCV_INSTALL_BINARIES_PREFIX}.

If it's followed by a slash and OpenCV_INSTALL_BINARIES_PREFIX is empty,
then the resulting path becomes absolute.

Fixes <http://code.opencv.org/issues/3350>.

--- cmake/OpenCVGenConfig.cmake
+++ cmake/OpenCVGenConfig.cmake
@@ -134,11 +134,11 @@
   configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" IMMEDIATE @ONLY)
   configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" IMMEDIATE @ONLY)
   if(BUILD_SHARED_LIBS)
-    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/lib")
-    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/lib" FILE OpenCVModules${modules_file_suffix}.cmake)
+    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib")
+    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake)
   else()
-    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/staticlib")
-    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}/staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
+    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib")
+    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake)
   endif()
   install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}")
   install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/")


Small fix with boost integration

Small fix with boost integration

--- cmake/UseDOFileSystem.cmake
+++ cmake/UseDOFileSystem.cmake
@@ -19,10 +19,7 @@
 endmacro (do_list_filesystem_source_files)

 macro (do_load_packages_for_filesystem_library)
-  if (APPLE)
-    set(BOOST_LIBRARYDIR /usr/local/lib)
-  endif ()
-  set(Boost_USE_STATIC_LIBS OFF)
+  set(Boost_USE_STATIC_LIBS ON)
   set(Boost_USE_MULTITHREADED ON)
   set(Boost_USE_STATIC_RUNTIME OFF)
   if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND APPLE)


CMake: factor out a function that returns the expected directory for unit test

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -155,14 +155,20 @@
   endif()
 endmacro(add_llvm_external_project)

+# Returns directory where unittest should reside.
+function(get_unittest_directory dir)
+  if (CMAKE_BUILD_TYPE)
+   set(result ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
+  else()
+   set(result ${CMAKE_CURRENT_BINARY_DIR})
+  endif()
+  set(${dir} ${result} PARENT_SCOPE)
+endfunction()
+
 # Generic support for adding a unittest.
 function(add_unittest test_suite test_name)
-  if (CMAKE_BUILD_TYPE)
-    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
-      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
-  else()
-    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-  endif()
+  get_unittest_directory(OUTPUT_DIR)
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
   if( NOT LLVM_BUILD_TESTS )
     set(EXCLUDE_FROM_ALL ON)
   endif()


Fixes file extension for loadable modules on OS X.

Patch by Wesley Peck!

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -36,7 +36,13 @@
     add_custom_target(${name})
   else()
     llvm_process_sources( ALL_FILES ${ARGN} )
-    add_library( ${name} MODULE ${ALL_FILES} )
+    if (MODULE)
+      set(libkind MODULE)
+    else()
+      set(libkind SHARED)
+    endif()
+
+    add_library( ${name} ${libkind} ${ALL_FILES} )
     set_target_properties( ${name} PROPERTIES PREFIX "" )

     if (APPLE)


[CMake] Use if(... IN_LIST ...) instead of list(FIND...)

NFC. This is just a little code cleanup to make things easier to read and understand.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -775,8 +775,7 @@
   endif()
   add_llvm_executable(${name} ${ARGN})

-  list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL)
-  if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+  if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     if( LLVM_BUILD_TOOLS )
       install(TARGETS ${name}
               EXPORT LLVMExports
@@ -1261,20 +1260,13 @@
     add_custom_target(${name} ALL DEPENDS ${output_path})
     set_target_properties(${name} PROPERTIES FOLDER Tools)

-    # Make sure the parent tool is a toolchain tool, otherwise exclude this tool
-    list(FIND LLVM_TOOLCHAIN_TOOLS ${dest} LLVM_IS_${dest}_TOOLCHAIN_TOOL)
-    if (NOT LLVM_IS_${dest}_TOOLCHAIN_TOOL GREATER -1)
-      set(LLVM_IS_${name}_TOOLCHAIN_TOOL ${LLVM_IS_${dest}_TOOLCHAIN_TOOL})
-    else()
-      list(FIND LLVM_TOOLCHAIN_TOOLS ${name} LLVM_IS_${name}_TOOLCHAIN_TOOL)
-    endif()
-
-    # LLVM_IS_${name}_TOOLCHAIN_TOOL will only be greater than -1 if both this
-    # tool and its parent tool are in LLVM_TOOLCHAIN_TOOLS
-    if (LLVM_IS_${name}_TOOLCHAIN_TOOL GREATER -1 OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
-      if( LLVM_BUILD_TOOLS )
-        llvm_install_symlink(${name} ${dest})
-      endif()
+    # Make sure both the link and target are toolchain tools
+    if (NOT ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS)
+      return()
+    endif()
+
+    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_TOOLS )
+      llvm_install_symlink(${name} ${dest})
     endif()
   endif()
 endfunction()


[CMake] Support symlinks even with LLVM_INSTALL_TOOLCHAIN_ONLY

When LLVM_INSTALL_TOOLCHAIN_ONLY is used and LLVM_TOOLCHAIN_TOOLS
contains a tool which is a symlink, it would be ignored. This already
worked before but got broken in r282510.

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1264,11 +1264,11 @@
     set_target_properties(${target_name} PROPERTIES FOLDER Tools)

     # Make sure both the link and target are toolchain tools
-    if (NOT ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS)
-      return()
-    endif()
-
-    if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_TOOLS )
+    if (${name} IN_LIST LLVM_TOOLCHAIN_TOOLS AND ${dest} IN_LIST LLVM_TOOLCHAIN_TOOLS)
+      set(TOOL_IS_TOOLCHAIN ON)
+    endif()
+
+    if ((TOOL_IS_TOOLCHAIN OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) AND LLVM_BUILD_TOOLS)
       llvm_install_symlink(${name} ${dest})
     endif()
   endif()


pull deps

pull deps

--- src/stx/cmake/CompileProtobuf.cmake
+++ src/stx/cmake/CompileProtobuf.cmake
@@ -42,7 +42,7 @@
       OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.cc"
              "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.h"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
-      ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} --proto_path ${PROTOBUF_INCLUDE_DIR} --proto_path ${STX_SOURCE_DIR}/stx ${PROTOC_ARGS} ${ABS_FIL}
+      ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} --proto_path ${PROTOBUF_INCLUDE_DIR} ${PROTOC_ARGS} ${ABS_FIL}
       DEPENDS ${ABS_FIL}
       COMMENT "Running C++ protocol buffer compiler on ${FIL}"
       VERBATIM )


Fixed some insane CMake issue.

Fixed some insane CMake issue.

--- test/HalideGenerator.cmake
+++ test/HalideGenerator.cmake
@@ -18,6 +18,8 @@
   # Determine a scratch directory to build and execute the generator. ${target}
   # will include the generated header from this directory.
   halide_generator_output_path(${gen_name} SCRATCH_DIR)
+  file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/" NATIVE_INT_DIR)
+  file(MAKE_DIRECTORY "${NATIVE_INT_DIR}scratch_${gen_name}")

   # CMake 2.8 doesn't have string(CONCAT), so fake it like so:
   string(REPLACE ".lib" "${CMAKE_STATIC_LIBRARY_SUFFIX}" FILTER_LIB "${func_name}.lib" )


cmake: fix upload

cmake: fix upload

--- cmake/Arduino.cmake
+++ cmake/Arduino.cmake
@@ -230,8 +230,8 @@
 #=============================================================================#
 #
 # ARDUINO_SDK_PATH            - Arduino SDK Path
-# AVR_AVRDUDE_PROGRAM     - Full path to avrdude programmer
-# AVR_AVRDUDE_CONFIG_PATH - Full path to avrdude configuration file
+# AVRDUDE_PROGRAM     - Full path to avrdude programmer
+# AVRDUDE_CONFIG_PATH - Full path to avrdude configuration file
 #
 # AVR_C_FLAGS             - C compiler flags
 # AVR_CXX_FLAGS           - C++ compiler flags
@@ -622,22 +622,22 @@
                                 -o ${TARGET_PATH}.elf
                                 ${COMPILE_FLAGS}
                         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-                        COMMENT "Compiling elf"
+                        COMMENT "Compiling ELF"
                         VERBATIM)

     # Copy and translate object files
     add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
                         COMMAND ${AVR_OBJCOPY}
-                        ARGS     ${ARDUINO_OBJCOPY_EEP_FLAGS}
-                                 ${TARGET_PATH}.elf
-                                 ${TARGET_PATH}.eep
+                                ${AVR_OBJCOPY_EEP_FLAGS}
+                                ${TARGET_PATH}.elf
+                                ${TARGET_PATH}.eep
                         COMMENT "Generating EEP image"
                         VERBATIM)

     # Convert firmware image to ASCII HEX format
     add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
                         COMMAND ${AVR_OBJCOPY}
-                        ARGS    ${ARDUINO_OBJCOPY_HEX_FLAGS}
+                                ${AVR_OBJCOPY_HEX_FLAGS}
                                 ${TARGET_PATH}.elf
                                 ${TARGET_PATH}.hex
                         COMMENT "Generating HEX image"
@@ -646,7 +646,7 @@
     # Display target size
     add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
                         COMMAND ${CMAKE_COMMAND}
-                        ARGS    -DFIRMWARE_IMAGE=${TARGET_PATH}.elf
+                                -DFIRMWARE_IMAGE=${TARGET_PATH}.elf
                                 -DMCU=${${BOARD_ID}.build.mcu}
                                 -DEEPROM_IMAGE=${TARGET_PATH}.eep
                                 -P ${ARDUINO_SIZE_SCRIPT}
@@ -881,7 +881,7 @@
     list(APPEND AVRDUDE_ARGS "-Ueeprom:w:${TARGET_PATH}.eep:i")
     add_custom_target(${UPLOAD_TARGET}
                      ${AVRDUDE_PROGRAM}
-                     ARGS ${AVRDUDE_ARGS}
+                     ${AVRDUDE_ARGS}
                      DEPENDS ${TARGET_NAME})

     # Global upload target
@@ -1021,7 +1021,7 @@
         message(FATAL_ERROR "This should not happen")
     endif()

-    list(APPEND AVRDUDE_ARGS "-C${ARDUINO_AVRDUDE_CONFIG_PATH}")
+    list(APPEND AVRDUDE_ARGS "-C${AVRDUDE_CONFIG_PATH}")

     #TODO: Check mandatory settings before continuing
     if(NOT ${PROGRAMMER}.protocol)
@@ -1075,7 +1075,7 @@
     endif()

     list(APPEND AVRDUDE_ARGS
-        "-C${ARDUINO_AVRDUDE_CONFIG_PATH}"  # avrdude config
+        "-C${AVRDUDE_CONFIG_PATH}"  # avrdude config
         "-p${${BOARD_ID}.build.mcu}"        # MCU Type
         )

@@ -1728,11 +1728,10 @@
 #=============================================================================#
 #                         Avr flags Settings
 #=============================================================================#
-set(AVR_OBJCOPY_EEP_FLAGS   "-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load
-    --no-change-warnings --change-section-lma .eeprom=0"         CACHE STRING "")
-set(AVR_OBJCOPY_HEX_FLAGS   "-O ihex -R .eeprom"                 CACHE STRING "")
-set(AVRDUDE_FLAGS           "-V"                                 CACHE STRING "")
-set(AVR_LIB_PATH            "${CMAKE_BINARY_DIR}/lib/avr/"      CACHE STRING "")
+set(AVR_OBJCOPY_EEP_FLAGS   -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0         CACHE STRING "")
+set(AVR_OBJCOPY_HEX_FLAGS   -O ihex -R .eeprom                 CACHE STRING "")
+set(AVRDUDE_FLAGS           -V                                 CACHE STRING "")
+set(AVR_LIB_PATH            ${CMAKE_BINARY_DIR}/avr-lib/       CACHE STRING "")
 file(MAKE_DIRECTORY ${AVR_LIB_PATH})

 #=============================================================================#
@@ -1829,7 +1828,7 @@
         ARDUINO_BOARDS_PATH
         ARDUINO_PROGRAMMERS_PATH
         ARDUINO_VERSION_PATH
-        ARDUINO_AVRDUDE_CONFIG_PATH
+        AVRDUDE_CONFIG_PATH
         AVRDUDE_FLAGS
         AVRDUDE_PROGRAM
         AVR_OBJCOPY_EEP_FLAGS


Use _TBB_DEFAULT_INSTALL_DIR as a single-value variable

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -57,7 +57,7 @@
 if (WIN32)
     # has em64t/vc8 em64t/vc9
     # has ia32/vc7.1 ia32/vc8 ia32/vc9
-    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
+    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB")
     set(_TBB_LIB_NAME "tbb")
     set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
     set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
@@ -102,7 +102,7 @@
         endif(NOT TBB_ARCHITECTURE)
     else (APPLE)
         # LINUX
-        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
+        set(_TBB_DEFAULT_INSTALL_DIR "/usr")
         set(_TBB_LIB_NAME "tbb")
         set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
         set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")


Complete redo of FindZMQ.cmake

Complete redo of FindZMQ.cmake

--- cmake/FindZMQ.cmake
+++ cmake/FindZMQ.cmake
@@ -15,143 +15,220 @@
 cmake_minimum_required (VERSION 2.8.11)

-# The following function generates a list of version names on the form
-# [3,4]_[0,9]_[0,9], excluding versions lower than verMajor_verMinor_verPatch.
-function (_generateVersionNames targetVarName verMajor verMinor verPatch)
-    set (${targetVarName} "" PARENT_SCOPE)
-    foreach (i RANGE ${verMajor} 4)
-        if (j EQUAL verMajor)
-            set (jMin ${verMinor})
-        else ()
-            set (jMin 0)
-        endif ()
-        foreach (j RANGE ${jMin} 9)
-            if ((i EQUAL verMajor) AND (j EQUAL verMinor))
-                set (kMin ${verPatch})
-            else ()
-                set (kMin 0)
-            endif ()
-            foreach (k RANGE ${kMin} 9)
-                list (APPEND ${targetVarName} "${i}_${j}_${k}")
-            endforeach()
-        endforeach ()
+# A function which prefixes all items in a list with a string.
+function (_prefixStrings targetVarName prefix)
+    set (v)
+    foreach (s ${ARGN})
+        list (APPEND v "${prefix}${s}")
     endforeach ()
-endfunction ()
-
-# This function prefixes all strings in a list with a string.
-function (_prefixStrings targetVarName prefix)
-    set (${targetVarName} "" PARENT_SCOPE)
-    foreach (s ${ARGN})
-        list (APPEND ${targetVarName} "${prefix}${s}")
+    set (${targetVarName} ${v} PARENT_SCOPE)
+endfunction ()
+
+# Generates a HINTS directive for a find_XXX command, based on
+# a known file path.
+function (_getHintsDirective targetVarName knownPath)
+    if (existingPath)
+        get_filename_component (d "${knownPath}" DIRECTORY)
+        set (${targetVarName} "HINTS" "${d}/.." PARENT_SCOPE)
+    else ()
+        set (${targetVarName} "" PARENT_SCOPE)
+    endif ()
+endfunction ()
+
+
+# The function which searches for the DLLs, their corresponding import
+# libraries, and include files on Windows.
+function (_findWinLibs releaseDll releaseLib debugDll debugLib includeDir)
+    set (canFind TRUE)
+
+    # Extra search paths (typically "C:/Program Files/ZeroMQ ...")
+    set (extraPrefixPaths)
+    foreach (p ${CMAKE_SYSTEM_PREFIX_PATH})
+        file (GLOB d "${p}/zeromq*" "${p}/zmq*")
+        list (APPEND extraPrefixPaths ${d})
     endforeach ()
-endfunction ()
-
-# On Windows, ZMQ uses a library file naming scheme that includes
-# compiler versions, release/debug mode, etc.  In addition, libraries
-# are typically installed in subfolders of the standard prefix path(s).
-set (_canFind TRUE)
-set (_extraPrefixPaths)
-if (WIN32)
-    # Compiler versions
+
+    # Supported compilers
     if (MSVC90)
-        set (_compiler "v90")
+        set (compiler "v90")
     elseif (MSVC10)
-        set (_compiler "v100")
+        set (compiler "v100")
     elseif (MSVC11)
-        set (_compiler "v110")
+        set (compiler "v110")
     elseif (MSVC12)
-        set (_compiler "v120")
-    else ()
-        set (_canFind FALSE)
-        message (WARNING "Compiler version not supported by the FindZMQ module; ZMQ not found.")
-    endif ()
-
-    # Extra search paths
-    foreach (_prefix ${CMAKE_SYSTEM_PREFIX_PATH})
-        file (GLOB _dirs "${_prefix}/zeromq*" "${_prefix}/zmq*")
-        list (APPEND _extraPrefixPaths ${_dirs})
-        unset (_dirs)
-    endforeach ()
-
-    # Version names
+        set (compiler "v120")
+    else ()
+        set (compiler "NOTFOUND")
+        set (canFind FALSE)
+        message (WARNING "Compiler version not supported by the FindZMQ module")
+    endif ()
+
+    # If no version is requested, start at 3.0.0.
     if (NOT ZMQ_FIND_VERSION)
         set (ZMQ_FIND_VERSION_MAJOR 3)
         set (ZMQ_FIND_VERSION_MINOR 0)
         set (ZMQ_FIND_VERSION_PATCH 0)
     endif ()
-    if ((ZMQ_FIND_VERSION_MAJOR GREATER 2) AND (ZMQ_FIND_VERSION_MAJOR LESS 5))
-        _generateVersionNames(_versionNames
-            ${ZMQ_FIND_VERSION_MAJOR} ${ZMQ_FIND_VERSION_MINOR} ${ZMQ_FIND_VERSION_PATCH})
-        _prefixStrings(_releaseLibs "libzmq-${_compiler}-mt-"    ${_versionNames})
-        _prefixStrings(_debugLibs   "libzmq-${_compiler}-mt-gd-" ${_versionNames})
-        message (STATUS "Searching for ZMQ. This may take a while...")
-    else ()
-        set (_canFind FALSE)
+
+    # Make a list of possible version names, starting with the one we are
+    # asked to search for.
+    set (versionNames)
+    if (ZMQ_FIND_VERSION_MAJOR EQUAL 3)
+        foreach (m RANGE ${ZMQ_FIND_VERSION_MINOR} 2)
+            set (pMin 0)
+            if (m EQUAL ZMQ_FIND_VERSION_MINOR)
+                set (pMin ${ZMQ_FIND_VERSION_PATCH})
+            endif ()
+            foreach (p RANGE ${pMin} 5)
+                list (APPEND versionNames "3_${m}_${p}")
+            endforeach()
+        endforeach ()
+    endif ()
+    set (mMin 0)
+    if (ZMQ_FIND_VERSION_MAJOR EQUAL 4)
+        set (mMin ${ZMQ_FIND_VERSION_MINOR})
+    endif ()
+    foreach (m RANGE ${mMin} 4)
+        set (pMin 0)
+        if ((ZMQ_FIND_VERSION_MAJOR EQUAL 4) AND (m EQUAL ZMQ_FIND_VERSION_MINOR))
+            set (pMin ${ZMQ_FIND_VERSION_PATCH})
+        endif ()
+        foreach (p RANGE ${pMin} 9)
+            list (APPEND versionNames "4_${m}_${p}")
+        endforeach()
+    endforeach ()
+
+    # Generate possible library file names
+    if ((ZMQ_FIND_VERSION_MAJOR GREATER 2) AND (ZMQ_FIND_VERSION_MINOR LESS 5))
+        _prefixStrings(releaseLibNames "libzmq-${compiler}-mt-"    ${versionNames})
+        _prefixStrings(debugLibNames   "libzmq-${compiler}-mt-gd-" ${versionNames})
+    else ()
+        set (canFind FALSE)
         message (WARNING "ZMQ version not supported by the FindZMQ module: ${ZMQ_FIND_VERSION}")
     endif ()
-else ()
-    # We don't need any special adaptations on *NIX.
-    set (_releaseLibs "zmq")
-    unset (_debugLibs)
-endif ()
+
+    if (canFind)
+        message (STATUS "Searching for ZMQ files. This may take a while...")
+        set (CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
+        find_library (ZMQ_RELEASE_LIB
+            NAMES ${releaseLibNames}
+            PATHS $ENV{ZMQ_DIR} ${extraPrefixPaths}
+            PATH_SUFFIXES "lib")
+        _getHintsDirective(hints ${ZMQ_RELEASE_LIB})
+        find_library (ZMQ_DEBUG_LIB
+            NAMES ${debugLibNames}
+            ${hints}
+            PATHS $ENV{ZMQ_DIR} ${extraPrefixPaths}
+            PATH_SUFFIXES "lib")
+        set (CMAKE_FIND_LIBRARY_SUFFIXES ".dll")
+        find_library (ZMQ_RELEASE_DLL
+            NAMES ${releaseLibNames}
+            ${hints}
+            PATHS $ENV{ZMQ_DIR} ${extraPrefixPaths}
+            PATH_SUFFIXES "bin" "lib")
+        find_library (ZMQ_DEBUG_DLL
+            NAMES ${debugLibNames}
+            ${hints}
+            PATHS $ENV{ZMQ_DIR} ${extraPrefixPaths}
+            PATH_SUFFIXES "bin" "lib")
+        find_path (ZMQ_HEADER_DIR "zmq.h"
+            ${_hints}
+            PATHS $ENV{ZMQ_DIR} ${extraPrefixPaths}
+            PATH_SUFFIXES "include")
+
+        set (${releaseDll} "${ZMQ_RELEASE_DLL}" PARENT_SCOPE)
+        set (${releaseLib} "${ZMQ_RELEASE_LIB}" PARENT_SCOPE)
+        set (${debugDll}   "${ZMQ_DEBUG_DLL}"   PARENT_SCOPE)
+        set (${debugLib}   "${ZMQ_DEBUG_LIB}"   PARENT_SCOPE)
+        set (${includeDir} "${ZMQ_HEADER_DIR}"  PARENT_SCOPE)
+    else ()
+        set (${releaseDll} "NOTFOUND" PARENT_SCOPE)
+        set (${releaseLib} "NOTFOUND" PARENT_SCOPE)
+        set (${debugDll}   "NOTFOUND" PARENT_SCOPE)
+        set (${debugLib}   "NOTFOUND" PARENT_SCOPE)
+        set (${includeDir} "NOTFOUND" PARENT_SCOPE)
+    endif ()
+endfunction ()
+
+# The function which searches for the libraries and headers on *NIX.
+function (_findUnixLibs releaseLib debugLib includeDir)
+    find_library (ZMQ_RELEASE_LIB
+        NAMES ${releaseLibNames}
+        PATHS $ENV{ZMQ_DIR}
+        PATH_SUFFIXES "lib")
+    _getHintsDirective(hints ${ZMQ_RELEASE_LIB})
+    find_library (ZMQ_DEBUG_LIB
+        NAMES ${debugLibNames}
+        ${hints}
+        PATHS $ENV{ZMQ_DIR}
+        PATH_SUFFIXES "lib")
+    find_path (ZMQ_HEADER_DIR "zmq.h"
+        ${_hints}
+        PATHS $ENV{ZMQ_DIR}
+        PATH_SUFFIXES "include")
+    set (${releaseLib} "${ZMQ_RELEASE_LIB}" PARENT_SCOPE)
+    set (${debugLib}   "${ZMQ_DEBUG_LIB}"   PARENT_SCOPE)
+    set (${includeDir} "${ZMQ_HEADER_DIR}"  PARENT_SCOPE)
+endfunction ()
+
+# A function which extracts the ZMQ version from macro definitions in zmq.h.
+function (_getZMQVersion targetVarName includeDir)
+    file (STRINGS "${includeDir}/zmq.h" versionDefines REGEX "define +ZMQ_VERSION_")
+    if (versionDefines)
+        string (REGEX REPLACE
+            ".*MAJOR ([0-9]+).*MINOR ([0-9]+).*PATCH ([0-9]+).*"
+            "\\1.\\2.\\3" versionString "${versionDefines}")
+    endif ()
+    set (${targetVarName} "${versionString}" PARENT_SCOPE)
+endfunction ()
+

 unset (ZMQ_LIBRARIES)
 unset (ZMQ_INCLUDE_DIRS)
 unset (ZMQ_VERSION_STRING)
-if (_canFind)
-    # Find "normal" library
-    find_library (_libzmq_release
-        NAMES ${_releaseLibs}
-        PATHS $ENV{ZMQ_DIR} ${_extraPrefixPaths}
-        PATH_SUFFIXES "lib")
-
-    # Find "debug" library (Windows only)
-    unset (_libzmq_debug)
-    if (_debugLibs)
-        find_library (_libzmq_debug
-            NAMES ${_debugLibs}
-            PATHS $ENV{ZMQ_DIR} ${_extraPrefixPaths}
-            PATH_SUFFIXES "lib")
-    endif ()
-
-    # Find include directory
-    find_path (ZMQ_INCLUDE_DIRS "zmq.h"
-        PATHS $ENV{ZMQ_DIR} ${_extraPrefixPaths}
-        PATH_SUFFIXES "include")
-
-    if (_libzmq_release OR _libzmq_debug)
-        add_library("zmq" SHARED IMPORTED)
-        set_target_properties ("zmq" PROPERTIES
-            INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIRS}"
-        )
-        if (_libzmq_release)
-            set_property (TARGET "zmq" APPEND PROPERTY IMPORTED_CONFIGURATIONS "RELEASE")
-            set_target_properties ("zmq" PROPERTIES
-                IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
-                IMPORTED_LOCATION_RELEASE "${_libzmq_release}"
-            )
-        endif ()
-        if (_libzmq_debug)
-            set_property (TARGET "zmq" APPEND PROPERTY IMPORTED_CONFIGURATIONS "DEBUG")
-            set_target_properties ("zmq" PROPERTIES
-                IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
-                IMPORTED_LOCATION_DEBUG "${_libzmq_debug}"
-            )
-        endif ()
-        set (ZMQ_LIBRARIES "zmq")
-    endif ()
-    unset (_libzmq_release)
-    unset (_libzmq_debug)
+
+if (WIN32)
+    _findWinLibs(_releaseLocation _releaseImplib _debugLocation _debugImplib ZMQ_INCLUDE_DIRS)
+    set (_releaseLinkLib _releaseImplib)
+    set (_debugLinkLib _debugImplib)
+else ()
+    _findUnixLibs(_releaseLocation _debugLocation ZMQ_INCLUDE_DIRS)
+    unset (_releaseImplib)
+    unset (_debugImplib)
+    set (_releaseLinkLib _releaseLocation)
+    set (_debugLinkLib _debugLocation)
 endif ()

-# Determine ZMQ version from the #defines in zmq.h
+if (_releaseLinkLib OR _debugLinkLib)
+    add_library ("zmq" SHARED IMPORTED)
+    set (ZMQ_LIBRARIES "zmq")
+    set_target_properties ("zmq" PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ZMQ_INCLUDE_DIRS}"
+    )
+    if (_releaseLinkLib)
+        set_property (TARGET "zmq" APPEND PROPERTY IMPORTED_CONFIGURATIONS "RELEASE")
+        set_property (TARGET "zmq" PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C")
+        if (_releaseLocation)
+            set_property (TARGET "zmq" PROPERTY IMPORTED_LOCATION_RELEASE "${_releaseLocation}")
+        endif ()
+        if (_releaseImplib)
+            set_property (TARGET "zmq" PROPERTY IMPORTED_IMPLIB_RELEASE "${_releaseImplib}")
+        endif ()
+    endif ()
+    if (_debugLinkLib)
+        set_property (TARGET "zmq" APPEND PROPERTY IMPORTED_CONFIGURATIONS "DEBUG")
+        set_property (TARGET "zmq" PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C")
+        if (_debugLocation)
+            set_property (TARGET "zmq" PROPERTY IMPORTED_LOCATION_DEBUG "${_debugLocation}")
+        endif ()
+        if (_debugImplib)
+            set_property (TARGET "zmq" PROPERTY IMPORTED_IMPLIB_DEBUG "${_debugImplib}")
+        endif ()
+    endif ()
+endif ()
+
 if (ZMQ_INCLUDE_DIRS)
-    file (STRINGS "${ZMQ_INCLUDE_DIRS}/zmq.h" _versionDefines REGEX "define +ZMQ_VERSION_")
-    if (_versionDefines)
-        string (REGEX REPLACE
-            ".*MAJOR ([0-9]+).*MINOR ([0-9]+).*PATCH ([0-9]+).*"
-            "\\1.\\2.\\3" ZMQ_VERSION_STRING "${_versionDefines}")
-    endif ()
+    _getZMQVersion(ZMQ_VERSION_STRING "${ZMQ_INCLUDE_DIRS}")
 endif ()

 include (FindPackageHandleStandardArgs)


Update Findre2.cmake

Update Findre2.cmake


cmake: generate SPIR-V text output for glsl

--- cmake/glslang.cmake
+++ cmake/glslang.cmake
@@ -74,6 +74,7 @@
                 COMMAND ${CMAKE_COMMAND} -E make_directory ${OUTPUT_SPIRV_PATH}
                 COMMAND ${VULKAN_GLSLANGVALIDATOR_EXEC} --target-env spirv1.3 -g -V ${INPUT_SHADER} -o ${OUTPUT_SPIRV}.unoptimized
                 COMMAND ${VULKAN_SPIRV_OPT_EXEC} ${OUTPUT_SPIRV}.unoptimized -Os -o ${OUTPUT_SPIRV}
+                COMMAND ${VULKAN_SPIRV_DIS_EXEC} ${OUTPUT_SPIRV} -o ${OUTPUT_SPIRV}.txt
                 COMMAND ${VULKAN_SPIRV_VAL_EXEC} ${OUTPUT_SPIRV}
                 MAIN_DEPENDENCY ${INPUT_SHADER}
                 COMMENT "Compiling GLSL shader ${INPUT_SHADER_REL} to SPIR-V (${OUTPUT_SPIRV_NAME})"


cmake: don't change baseline compiler flags in 'detection' mode

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -448,7 +448,9 @@
       if(NOT ";${CPU_BASELINE_FINAL};" MATCHES ";${OPT};")
         list(APPEND CPU_BASELINE_FINAL ${OPT})
       endif()
-      ocv_append_optimization_flag(CPU_BASELINE_FLAGS ${OPT})
+      if(NOT CPU_BASELINE_DETECT)  # Don't change compiler flags in 'detection' mode
+        ocv_append_optimization_flag(CPU_BASELINE_FLAGS ${OPT})
+      endif()
     endif()
   endif()
 endforeach()


cmake: Handle ESPPORT environment variable correctly

Closes https://github.com/espressif/esp-idf/issues/2553

--- components/esptool_py/run_esptool.cmake
+++ components/esptool_py/run_esptool.cmake
@@ -17,10 +17,11 @@
 # Note: we can't expand these environment variables in the main IDF CMake build,
 # because we want to expand them at flashing time not at CMake runtime (so they can change
 # without needing a CMake re-run)
-if(NOT ENV{ESPPORT})
+set(ESPPORT $ENV{ESPPORT})
+if(NOT ESPPORT)
     message("Note: esptool.py will search for a serial port. To specify a port, set the ESPPORT environment variable.")
 else()
-    set(port_arg "-p $ENV{ESPPORT}")
+    set(port_arg "-p ${ESPPORT}")
 endif()

 set(ESPBAUD $ENV{ESPBAUD})


FindMagnum.cmake: NaCl application has also dependencies.

Although these are needed only with static build.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -185,7 +185,10 @@
             endif()
         endif()

-        # NaCl application has no additional dependencies
+        # NaCl application dependencies
+        if(${component} STREQUAL NaClApplication)
+            set(_MAGNUM_${_COMPONENT}_LIBRARIES ppapi_cpp ppapi ${_WINDOWCONTEXT_MAGNUM_LIBRARIES_DEPENDENCY})
+        endif()

         # GLX application dependencies
         if(${component} STREQUAL GlxApplication)


find make properly

find make properly

git-svn-id: fe3cd4388a6e5a968b09397a3d721fe124e8117a@161 5b54908e-ead4-fc18-b48a-0285e6dbc711

--- package.cmake
+++ package.cmake
@@ -148,6 +148,7 @@
 set(CTEST_COMMAND "${CTEST_EXECUTABLE_NAME}")
 if (UNIX OR NOT arg_use_nmake)
   set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+  find_program(MAKE_COMMAND make DOC "make command")
   if (have_cygwin)
     # seeing errors building in parallel: pdb collision?
     set(CTEST_BUILD_COMMAND "${MAKE_COMMAND} -j2")


build(Emscripten): Export writeArrayToMemory, writeAsciiToMemory

--- src/docker/itk-wasm/ITKWebAssemblyInterface.cmake
+++ src/docker/itk-wasm/ITKWebAssemblyInterface.cmake
@@ -35,7 +35,7 @@
     _add_executable(${umd_target} ${ARGN})

     get_property(_link_flags TARGET ${target} PROPERTY LINK_FLAGS)
-    set(common_link_flags " -s FORCE_FILESYSTEM=1 -s EXPORTED_RUNTIME_METHODS='[\"callMain\",\"cwrap\",\"ccall\"]' -s EXPORTED_FUNCTIONS='[\"_main\",\"_itk_wasm_input_array_alloc\",\"_itk_wasm_input_json_alloc\",\"_itk_wasm_output_json_address\",\"_itk_wasm_output_json_size\",\"_itk_wasm_output_array_address\",\"_itk_wasm_output_array_size\",\"_itk_wasm_free_all\"]' -flto -s WASM=1 -lnodefs.js -s WASM_ASYNC_COMPILATION=1 -s EXPORT_NAME=${target} -s MODULARIZE=1 -s EXIT_RUNTIME=0 -s INVOKE_RUN=0 --pre-js /ITKWebAssemblyInterface/src/emscripten-module/itkJSPipelinePre.js --post-js /ITKWebAssemblyInterface/src/emscripten-module/itkJSPost.js ${_link_flags}")
+    set(common_link_flags " -s FORCE_FILESYSTEM=1 -s EXPORTED_RUNTIME_METHODS='[\"callMain\",\"cwrap\",\"ccall\",\"writeArrayToMemory\",\"writeAsciiToMemory\"]' -s EXPORTED_FUNCTIONS='[\"_main\",\"_itk_wasm_input_array_alloc\",\"_itk_wasm_input_json_alloc\",\"_itk_wasm_output_json_address\",\"_itk_wasm_output_json_size\",\"_itk_wasm_output_array_address\",\"_itk_wasm_output_array_size\",\"_itk_wasm_free_all\"]' -flto -s WASM=1 -lnodefs.js -s WASM_ASYNC_COMPILATION=1 -s EXPORT_NAME=${target} -s MODULARIZE=1 -s EXIT_RUNTIME=0 -s INVOKE_RUN=0 --pre-js /ITKWebAssemblyInterface/src/emscripten-module/itkJSPipelinePre.js --post-js /ITKWebAssemblyInterface/src/emscripten-module/itkJSPost.js ${_link_flags}")
     set_property(TARGET ${wasm_target} PROPERTY LINK_FLAGS "${common_link_flags} -s EXPORT_ES6=1 -s USE_ES6_IMPORT_META=0")
     set_property(TARGET ${umd_target} PROPERTY LINK_FLAGS "${common_link_flags}")


BUG: fix typeo in ITK hash update

BUG: fix typeo in ITK hash update

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -17,7 +17,7 @@
 # NOTE: it is very important to update the ITK_DIR path with the
 # current version of ITK
 # This hash is the 4.2.1 pre-release
-set(ITK_TAG_COMMAND GIT_TAG v29630df6c85fb217b26bbee21711ca66111a2562 )
+set(ITK_TAG_COMMAND GIT_TAG 29630df6c85fb217b26bbee21711ca66111a2562 )

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


Libpng fixes merged to master.

Libpng fixes merged to master.

--- Superbuild/LibPNGExternal.cmake
+++ Superbuild/LibPNGExternal.cmake
@@ -25,7 +25,7 @@
 #  DEALINGS IN THE SOFTWARE.

 SET_PROPERTY(DIRECTORY PROPERTY "EP_BASE" ${ep_base})
-SET(libpng_GIT_TAG "origin/vs_build_fix")
+SET(libpng_GIT_TAG "origin/master")
 SET(libpng_DEPENDENCIES "Zlib_external")

 # If CMake ever allows overriding the checkout command or adding flags,