Update OptimizeForArchitecture.cmake

Update OptimizeForArchitecture.cmake

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -1872,7 +1872,7 @@

 macro(OptimizeForArchitecture)
    if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "i686.*|i386.*|x86.*|amd64.*|x86_64.*|AMD64.*")
-      set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used. Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. Setting the value to \"native\" bypasses all checks and uses \"-march=native\" or the compiler\'s equivalent flag. Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandybridge\", \"ivybridge\", \"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kabylake\", \"cannonlake\", \"cascadelake\", \"cooperlake\", \"icelake\", \"icelake-xeon\", \"tigerlake\", \"alderlake\", \"sapphirerapids\", \"bonnell\", \"silvermont\", \"goldmont\", \"goldmont-plus\", \"tremont\", \"knl\" (Knights Landing), \"knm\" (Knights Mill), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"steamroller\", \"excavator\", \"amd14h\", \"amd16h\", \"zen\", \"zen2\", \"zen3\"." )
+      set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used. Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. Setting the value to \"native\" bypasses all checks and uses \"-march=native\" or the compiler equivalent flag. Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandybridge\", \"ivybridge\", \"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kabylake\", \"cannonlake\", \"cascadelake\", \"cooperlake\", \"icelake\", \"icelake-xeon\", \"tigerlake\", \"alderlake\", \"sapphirerapids\", \"bonnell\", \"silvermont\", \"goldmont\", \"goldmont-plus\", \"tremont\", \"knl\" (Knights Landing), \"knm\" (Knights Mill), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"steamroller\", \"excavator\", \"amd14h\", \"amd16h\", \"zen\", \"zen2\", \"zen3\"." )
    elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(arm.*|ARM.*|aarch64.*|AARCH64.*)")
       set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used. Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. Other supported values are: \"none\", \"generic\", \"a64fx\", \"arm1020e\", \"arm1020t\", \"arm1022e\", \"arm1026ej-s\", \"arm10e\", \"arm10tdmi\", \"arm1136j-s\", \"arm1136jf-s\", \"arm1156t2-s\", \"arm1156t2f-s\", \"arm1176jz-s\", \"arm1176jzf-s\", \"arm710t\", \"arm720t\", \"arm740t\", \"arm7tdmi-s\", \"arm7tdmi\", \"arm810\", \"arm8\", \"arm920\", \"arm920t\", \"arm922t\", \"arm926ej-s\", \"arm940t\", \"arm946e-s\", \"arm966e-s\", \"arm968e-s\", \"arm9\", \"arm9e\", \"arm9tdmi\", \"brahma-b15\", \"brahma-b53\", \"carmel\", \"cortex-a12\", \"cortex-a15.cortex-a7\", \"cortex-a15\", \"cortex-a17.cortex-a7\", \"cortex-a17\", \"cortex-a32\", \"cortex-a34\", \"cortex-a35\", \"cortex-a53\", \"cortex-a55\", \"cortex-a57.cortext-a53\", \"cortex-a57\", \"cortex-a5\", \"cortex-a72.cortext-a53\", \"cortex-a72\", \"cortex-a73.cortext-a35\", \"cortex-a73.cortext-a53\", \"cortex-a73\", \"cortex-a75.cortext-a55\", \"cortex-a75\", \"cortex-a76.cortext-a55\", \"cortex-a76\", \"cortex-a76ae\", \"cortex-a77\", \"cortex-a7\", \"cortex-a8\", \"cortex-a9\", \"cortex-m0\", \"cortex-m0plus\", \"cortex-m1\", \"cortex-m23\", \"cortex-m33\", \"cortex-m35p\", \"cortex-m3\", \"cortex-m4\", \"cortex-m55\", \"cortex-m7\", \"cortex-r4\", \"cortex-r4f\", \"cortex-r52\", \"cortex-r5\", \"cortex-r7\", \"cortex-r8\", \"denver2\", \"denver\", \"exynos-m1\", \"fa526\", \"fa606te\", \"fa626\", \"fa626te\", \"fa726te\", \"falkor\", \"fmp626\", \"generic-armv7-a\", \"i80200\", \"i80321-400-b0\", \"i80321-400\", \"i80321-600-b0\", \"i80321-600\", \"ipx1200\", \"ipx425-266\", \"ipx425-400\", \"ipx425-533\", \"iwmmxt2\", \"iwmmxt\", \"krait\", \"kryo2\", \"kryo\", \"marvell-f\", \"marvell-pj4\", \"mpcore\", \"neoverse-e1\", \"neoverse-n1\", \"pxa210a\", \"pxa210b\", \"pxa210c\", \"pxa250a\", \"pxa250b\", \"pxa250c\", \"pxa27x\", \"pxa30x\", \"pxa31x\", \"pxa32x\", \"pxa930\", \"sa1110\", \"saphira\", \"scorpion\", \"strongarm1100\", \"strongarm110\", \"strongarm\", \"thunderx2\", \"thunderx2t99\", \"thunderx\", \"thunderxt81\", \"thunderxt83\", \"thunderxt88\", \"tsv110\", \"xgene1\", \"xscale\".")
    elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "^(powerpc|ppc)64.*")


Bump LT_CURRENT.

Bump LT_CURRENT.

This should have been included in v1.4.3.

Fixes https://github.com/google/draco/issues/754

--- cmake/draco_build_definitions.cmake
+++ cmake/draco_build_definitions.cmake
@@ -60,7 +60,7 @@
   # passed to libtool.
   #
   # We set DRACO_SOVERSION = [c-a].a.r
-  set(LT_CURRENT 1)
+  set(LT_CURRENT 2)
   set(LT_REVISION 0)
   set(LT_AGE 0)
   math(EXPR DRACO_SOVERSION_MAJOR "${LT_CURRENT} - ${LT_AGE}")


translations: Fix external translations logic

- Don't try to remove non existing files (If the file doesn't exists
ex_result will contain an error message and fail.)

- Make sure git init doesn't fail (If ${TR_TRANSLATION_DIR} doesn't
exist, git init will fail.)

--- cmake/modules/LXQtTranslateTs.cmake
+++ cmake/modules/LXQtTranslateTs.cmake
@@ -168,14 +168,19 @@
         endif ()
         if (NOT EXISTS "${TR_TRANSLATION_DIR}/${TR_REPO_SUBDIR}")
             message(STATUS "Setting git repository in the translations dir '${TR_TRANSLATION_DIR}' ...")
-
-            execute_process(COMMAND rm -Rf .git
-                WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
-                RESULT_VARIABLE ex_result
-                )
-            if (NOT "${ex_result}" EQUAL 0)
-                message(FATAL_ERROR "Initialization(cleanup) of translations dir failed!")
-            endif ()
+            if (EXISTS "${TR_TRANSLATION_DIR}/.git")
+                execute_process(COMMAND rm -Rf .git
+                    WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"
+                    RESULT_VARIABLE ex_result
+                    )
+
+                if (NOT "${ex_result}" EQUAL 0)
+                    message(FATAL_ERROR "Initialization(cleanup) of translations dir failed!")
+                endif ()
+            endif()
+
+            # make sure the dir exist, otherwise git init will fail
+            file(MAKE_DIRECTORY "${TR_TRANSLATION_DIR}")

             execute_process(COMMAND "${GIT_EXECUTABLE}" init
                 WORKING_DIRECTORY  "${TR_TRANSLATION_DIR}"


Fix wasm static lib in sub-project (#11671)

* wasm_static_lib_global

Signed-off-by: daquexian <f5f37435e17c9e411096cd88a2a730c74bd07a78@gmail.com>

* make wasm static lib global

Signed-off-by: daquexian <f5f37435e17c9e411096cd88a2a730c74bd07a78@gmail.com>

* fix the property

Signed-off-by: daquexian <f5f37435e17c9e411096cd88a2a730c74bd07a78@gmail.com>

* add code missing after merge

Signed-off-by: daquexian <f5f37435e17c9e411096cd88a2a730c74bd07a78@gmail.com>

--- cmake/onnxruntime_webassembly.cmake
+++ cmake/onnxruntime_webassembly.cmake
@@ -71,12 +71,15 @@
     add_dependencies(bundling_target ${target_name})
   endforeach()

-  add_library(${bundled_target_name} STATIC IMPORTED)
+  add_library(${bundled_target_name} STATIC IMPORTED GLOBAL)
+  set_target_properties(${bundled_target_name}
+    PROPERTIES
+      IMPORTED_LOCATION ${bundled_target_full_name})
   foreach(target_name IN ITEMS ${ARGN})
-    set_target_properties(${bundled_target_name}
-      PROPERTIES
-        IMPORTED_LOCATION ${bundled_target_full_name}
-        INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${target_name},INTERFACE_INCLUDE_DIRECTORIES>)
+    set_property(TARGET ${bundled_target_name} APPEND
+      PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${target_name},INTERFACE_INCLUDE_DIRECTORIES>)
+    set_property(TARGET ${bundled_target_name} APPEND
+      PROPERTY INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${target_name},INTERFACE_COMPILE_DEFINITIONS>)
   endforeach()
   add_dependencies(${bundled_target_name} bundling_target)
 endfunction()


Enabled large address aware flag for 32bit windows

--- cmake/platform/win32/platform.cmake
+++ cmake/platform/win32/platform.cmake
@@ -61,6 +61,11 @@
   message("-- detected 32bit")
 endif()

+if(64BIT)
+else()
+  add_linker_flags(/LARGEADDRESSAWARE)
+endif()
+
 macro(SetSharedRuntime target)
   if(DEBUG)
     set_target_properties(${target} PROPERTIES COMPILE_FLAGS "/MDd")


ARROW-5333: [C++] Clamp build option summary width to 90

@pitrou how does this look:

```
-- Compile and link options:
--
--   ARROW_CXXFLAGS                                                        [default=""] ""
--       Compiler flags to append when compiling Arrow
--
--   ARROW_BUILD_STATIC                                                   [default=ON] OFF
--       Build static libraries
--
--   ARROW_BUILD_SHARED                                                   [default=ON] OFF
--       Build shared libraries
--
--   ARROW_NO_DEPRECATED_API                                             [default=OFF] OFF
--       Exclude deprecated APIs from build
```

I don't *think* I touched anything but formatting, but... This is a draft because I'm getting an error:
```
CMake Error: INSTALL(EXPORT) given unknown export "arrow_targets"
```

Closes #5844 from bkietz/5333-Fit-build-option-summary- and squashes the following commits:

1045594bf <Benjamin Kietzman> ensure multiline strings are quoted when passed as parameters
0fe9fd2aa <Benjamin Kietzman> run-cmake-format.py
56b8242a9 <Benjamin Kietzman> ARROW-5333:  Clamp build option summary width to 90

Authored-by: Benjamin Kietzman <be26f8d5d161e4d7965ee00602589fb2b74149f2@gmail.com>
Signed-off-by: Antoine Pitrou <9359a4d812173b65a3a0094cd86363e79731a3c2@python.org>

--- cpp/cmake_modules/DefineOptions.cmake
+++ cpp/cmake_modules/DefineOptions.cmake
@@ -20,13 +20,16 @@
   list(APPEND "ARROW_OPTION_CATEGORIES" ${name})
 endmacro()

-macro(define_option name description default)
-  option(${name} ${description} ${default})
-  list(APPEND "ARROW_${ARROW_OPTION_CATEGORY}_OPTION_NAMES" ${name})
-  set("${name}_OPTION_DESCRIPTION" ${description})
-  set("${name}_OPTION_DEFAULT" ${default})
-  set("${name}_OPTION_TYPE" "bool")
-endmacro()
+function(check_description_length name description)
+  foreach(description_line ${description})
+    string(LENGTH ${description_line} line_length)
+    if(${line_length} GREATER 80)
+      message(FATAL_ERROR "description for ${name} contained a\n\
+        line ${line_length} characters long!\n\
+        (max is 80). Split it into more lines with semicolons")
+    endif()
+  endforeach()
+endfunction()

 function(list_join lst glue out)
   if("${${lst}}" STREQUAL "")
@@ -42,14 +45,30 @@
   set(${out} ${joined} PARENT_SCOPE)
 endfunction()

+macro(define_option name description default)
+  check_description_length(${name} ${description})
+  list_join(description "\n" multiline_description)
+
+  option(${name} "${multiline_description}" ${default})
+
+  list(APPEND "ARROW_${ARROW_OPTION_CATEGORY}_OPTION_NAMES" ${name})
+  set("${name}_OPTION_DESCRIPTION" ${description})
+  set("${name}_OPTION_DEFAULT" ${default})
+  set("${name}_OPTION_TYPE" "bool")
+endmacro()
+
 macro(define_option_string name description default)
-  set(${name} ${default} CACHE STRING ${description})
+  check_description_length(${name} ${description})
+  list_join(description "\n" multiline_description)
+
+  set(${name} ${default} CACHE STRING "${multiline_description}")
+
   list(APPEND "ARROW_${ARROW_OPTION_CATEGORY}_OPTION_NAMES" ${name})
   set("${name}_OPTION_DESCRIPTION" ${description})
   set("${name}_OPTION_DEFAULT" "\"${default}\"")
   set("${name}_OPTION_TYPE" "string")
-
   set("${name}_OPTION_ENUM" ${ARGN})
+
   list_join("${name}_OPTION_ENUM" "|" "${name}_OPTION_ENUM")
   if(NOT ("${${name}_OPTION_ENUM}" STREQUAL ""))
     set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
@@ -279,7 +298,7 @@
   set_option_category("Parquet")

   define_option(PARQUET_MINIMAL_DEPENDENCY
-                "Depend only on Thirdparty headers to build libparquet. \
+                "Depend only on Thirdparty headers to build libparquet.;\
 Always OFF if building binaries" OFF)

   define_option(
@@ -300,7 +319,7 @@
   # ARROW-3860: Temporary workaround
   define_option(
     ARROW_GANDIVA_STATIC_LIBSTDCPP
-    "Include -static-libstdc++ -static-libgcc when linking with Gandiva static libraries"
+    "Include -static-libstdc++ -static-libgcc when linking with;Gandiva static libraries"
     OFF)

   define_option_string(ARROW_GANDIVA_PC_CXX_FLAGS
@@ -314,8 +333,8 @@
                 "Compile with extra error context (line numbers, code)" OFF)

   define_option(ARROW_OPTIONAL_INSTALL
-                "If enabled install ONLY targets that have already been built. Please be \
-advised that if this is enabled 'install' will fail silently on components \
+                "If enabled install ONLY targets that have already been built. Please be;\
+advised that if this is enabled 'install' will fail silently on components;\
 that have not been built" OFF)

   option(ARROW_BUILD_CONFIG_SUMMARY_JSON "Summarize build configuration in a JSON file"
@@ -341,52 +360,35 @@

     message(STATUS)
     message(STATUS "${category} options:")
+    message(STATUS)

     set(option_names ${ARROW_${category}_OPTION_NAMES})

-    set(max_value_length 0)
     foreach(name ${option_names})
-      string(LENGTH "\"${${name}}\"" value_length)
-      if(${max_value_length} LESS ${value_length})
-        set(max_value_length ${value_length})
+      set(value "${${name}}")
+      if("${value}" STREQUAL "")
+        set(value "\"\"")
       endif()
-    endforeach()
-
-    foreach(name ${option_names})
-      if("${${name}_OPTION_TYPE}" STREQUAL "string")
-        set(value "\"${${name}}\"")
+
+      set(description ${${name}_OPTION_DESCRIPTION})
+
+      if(NOT ("${${name}_OPTION_ENUM}" STREQUAL ""))
+        set(summary "[default=${${name}_OPTION_ENUM}] ${value}")
       else()
-        set(value "${${name}}")
+        set(summary "[default=${${name}_OPTION_DEFAULT}] ${value}")
       endif()

-      set(default ${${name}_OPTION_DEFAULT})
-      set(description ${${name}_OPTION_DESCRIPTION})
-      string(LENGTH ${description} description_length)
-      if(${description_length} LESS 70)
-        string(
-          SUBSTRING
-            "                                                                     "
-            ${description_length} -1 description_padding)
-      else()
-        set(description_padding "
-                                                                           ")
-      endif()
-
-      set(comment "[${name}]")
-
-      if("${value}" STREQUAL "${default}")
-        set(comment "[default] ${comment}")
-      endif()
-
-      if(NOT ("${${name}_OPTION_ENUM}" STREQUAL ""))
-        set(comment "${comment} [${${name}_OPTION_ENUM}]")
-      endif()
-
-      string(
-        SUBSTRING "${value}                                                             "
-                  0 ${max_value_length} value)
-
-      message(STATUS "  ${description} ${description_padding} ${value} ${comment}")
+      string(LENGTH "${summary}" summary_length)
+      string(LENGTH "${name}" name_length)
+      math(EXPR padding_length "${summary_length} + ${name_length}")
+      string(SUBSTRING "                                                \
+                                    ${summary}" ${padding_length} -1 right_padded_summary)
+
+      message(STATUS "  ${name} ${right_padded_summary}")
+      foreach(description_line ${description})
+        message(STATUS "      ${description_line}")
+      endforeach()
+      message(STATUS)
     endforeach()

   endforeach()
@@ -422,6 +424,10 @@
   foreach(category ${ARROW_OPTION_CATEGORIES})
     file(APPEND ${path} "\n\n## ${category} options:")
     foreach(name ${ARROW_${category}_OPTION_NAMES})
+      set(description ${${name}_OPTION_DESCRIPTION})
+      foreach(description_line ${description})
+        file(APPEND ${path} "\n### ${description_line}")
+      endforeach()
       file(APPEND ${path} "\nset(${name} \"${${name}}\")")
     endforeach()
   endforeach()


Fix copy error in FindCMOCKA.cmake

Fix copy error in FindCMOCKA.cmake

--- cmake/FindCMOCKA.cmake
+++ cmake/FindCMOCKA.cmake
@@ -1,6 +1,6 @@
 find_package(PkgConfig)
 if (PKG_CONFIG_FOUND)
-  pkg_check_modules(SHARED_CMOCKA REQUIRED libsodium)
+  pkg_check_modules(SHARED_CMOCKA REQUIRED cmocka)
 endif()

 find_path(CMOCKA_INCLUDE_DIR cmocka.h


cleanup

cleanup

--- cmake/FindLibzip.cmake
+++ cmake/FindLibzip.cmake
@@ -18,24 +18,23 @@

 if (UNIX)

+    find_package(ZLIB REQUIRED)
     find_package(BZip2 REQUIRED)
     find_package(OpenSSL REQUIRED)
-    find_package(ZLIB REQUIRED)

     FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBZIP
             REQUIRED_VARS LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR ZLIB_LIBRARIES BZIP2_LIBRARIES OPENSSL_LIBRARIES)

-
-    set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR})
-    set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARY} ${BZIP2_LIBRARIES} ${OPENSSL_LIBRARIES})
+    set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${OPENSSL_LIBRARIES})

 else()

     FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBZIP
             REQUIRED_VARS LIBZIP_LIBRARY LIBZIP_INCLUDE_DIR)

-    set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR})
     set(LIBZIP_LIBRARIES ${LIBZIP_LIBRARY})

 endif()

+set(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR})
+


Fix linux flags

Fix linux flags

--- cmake/FindPython.cmake
+++ cmake/FindPython.cmake
@@ -121,8 +121,7 @@
         configure_file(${CMAKE_SOURCE_DIR}/cmake/version_script.txt
             ${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt @ONLY)
         set_target_properties(${name} PROPERTIES
-            LINK_FLAGS "-flat_namespace -undefined suppress "
-                "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt")
+            LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/version_script_${name}.txt")
     ELSE
         add_library(${name} SHARED ${ARGN})
     ENDIF()


turn back on strict mode for googletest as it no longer breaks

--- cmake/GoogleTest.cmake
+++ cmake/GoogleTest.cmake
@@ -29,9 +29,6 @@

 include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)

-# TODO(dominic): See #1202. Remove if https://github.com/google/googletest/pull/3492 lands upstream.
-add_compile_options(-w)
-
 # Add googletest directly to our build. This defines
 # the gtest and gtest_main targets.
 add_subdirectory(${GOOGLETEST_SOURCE_DIR}


Download libs in CMake

Download libs in CMake

--- cmake/TaichiCore.cmake
+++ cmake/TaichiCore.cmake
@@ -41,9 +41,13 @@

 if (NOT WIN32)
     target_link_libraries(${CORE_LIBRARY_NAME} pthread stdc++)
-    target_link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libembree.so.2)
-    target_link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbb.so.2)
-    target_link_libraries(${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbbmalloc.so.2)
+    if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/external/lib)
+    else()
+        execute_process(COMMAND git clone https://github.com/yuanming-hu/taichi_runtime ${CMAKE_CURRENT_SOURCE_DIR}/external/lib)
+    endif()
+    target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libembree.so.2)
+    target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbb.so.2)
+    target_link_libraries(${CORE_LIBRARY_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/external/lib/libtbbmalloc.so.2)
 endif ()
 if (MINGW)
     target_link_libraries(${CORE_LIBRARY_NAME} ws2_32)


cmake: extensions: add internal DT helpers

Add a couple of helper functions we'll use to make some other
improvements.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -2997,6 +2997,77 @@
     set(${var} PARENT_SCOPE)
   else()
     set(${var} ${${var}} PARENT_SCOPE)
+  endif()
+endfunction()
+
+# Internal helper. Canonicalizes a path 'path' into the output
+# variable 'var'. This resolves aliases, if any. Child nodes may be
+# accessed via alias as well. 'var' is left undefined if the path does
+# not refer to an existing node.
+#
+# Example devicetree:
+#
+#   / {
+#           foo {
+#                   my-label: bar {
+#                           baz {};
+#                   };
+#           };
+#           aliases {
+#                   my-alias = &my-label;
+#           };
+#   };
+#
+# Example usage:
+#
+#   dt_path_internal(ret "/foo/bar")     # sets ret to "/foo/bar"
+#   dt_path_internal(ret "my-alias")     # sets ret to "/foo/bar"
+#   dt_path_internal(ret "my-alias/baz") # sets ret to "/foo/bar/baz"
+#   dt_path_internal(ret "/blub")        # ret is undefined
+function(dt_path_internal var path)
+  string(FIND "${path}" "/" slash_index)
+
+  if("${slash_index}" EQUAL 0)
+    # If the string starts with a slash, it should be an existing
+    # canonical path.
+    dt_path_internal_exists(check "${path}")
+    if (check)
+      set(${var} "${path}" PARENT_SCOPE)
+      return()
+    endif()
+  else()
+    # Otherwise, try to expand a leading alias.
+    string(SUBSTRING "${path}" 0 "${slash_index}" alias_name)
+    dt_alias(alias_path PROPERTY "${alias_name}")
+
+    # If there is a leading alias, append the rest of the string
+    # onto it and see if that's an existing node.
+    if (DEFINED alias_path)
+      set(rest)
+      if (NOT "${slash_index}" EQUAL -1)
+        string(SUBSTRING "${path}" "${slash_index}" -1 rest)
+      endif()
+      dt_path_internal_exists(expanded_path_exists "${alias_path}${rest}")
+      if (expanded_path_exists)
+        set(${var} "${alias_path}${rest}" PARENT_SCOPE)
+        return()
+      endif()
+    endif()
+  endif()
+
+  # Failed search; ensure return variable is undefined.
+  set(${var} PARENT_SCOPE)
+endfunction()
+
+# Internal helper. Set 'var' to TRUE if a canonical path 'path' refers
+# to an existing node. Set it to FALSE otherwise. See
+# dt_path_internal for a definition and examples of 'canonical' paths.
+function(dt_path_internal_exists var path)
+  get_target_property(path_prop devicetree_target "DT_NODE|${path}")
+  if (path_prop)
+    set(${var} TRUE PARENT_SCOPE)
+  else()
+    set(${var} FALSE PARENT_SCOPE)
   endif()
 endfunction()


Remove unused

Remove unused

--- gitenv/paths.cmake
+++ gitenv/paths.cmake
@@ -1,27 +0,0 @@
-# Copyright (c) 2013, Ruslan Baratov
-# All rights reserved.
-
-if(DEFINED GITENV_GITENV_PATHS_CMAKE_)
-  return()
-else()
-  set(GITENV_GITENV_PATHS_CMAKE_ 1)
-endif()
-
-if(NOT GITENV_ROOT)
-  set(GITENV_ROOT $ENV{GITENV_ROOT})
-endif()
-
-macro(_gitenv_path_setup macro_name gitenv_location)
-  # First check cmake variable. If not empty - nothing need to be done
-  if(NOT ${macro_name})
-    # If cmake variable is not set, try to check environment variable
-    set(${macro_name} $ENV{${macro_name}})
-    # If environment variable is not setted too, set from gitenv
-    if(NOT ${macro_name} AND GITENV_ROOT)
-      set(${macro_name} "${GITENV_ROOT}/${gitenv_location}/${GITENV_INSTALL_PREFIX}")
-    endif()
-  endif()
-endmacro()
-
-_gitenv_path_setup(LIBCXX_ROOT "llvm/libcxx")
-_gitenv_path_setup(GTEST_ROOT "google/gtest")


Bump to latest ParaView master version

Bump to latest ParaView master version

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


Fix CMAKE_MODULE_INSTALL_PATH for Windows

--- Common.cmake
+++ Common.cmake
@@ -43,8 +43,13 @@
 file(MAKE_DIRECTORY ${OUTPUT_INCLUDE_DIR})
 include_directories(BEFORE ${CMAKE_SOURCE_DIR} ${OUTPUT_INCLUDE_DIR})

-string(REGEX REPLACE ".*\\/(share\\/.*)" "\\1/Modules" CMAKE_MODULE_INSTALL_PATH
-  ${CMAKE_ROOT})
+if(MSVC)
+  set(CMAKE_MODULE_INSTALL_PATH
+    "../CMake ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules")
+else()
+  string(REGEX REPLACE ".*\\/(share\\/.*)" "\\1/Modules"
+    CMAKE_MODULE_INSTALL_PATH ${CMAKE_ROOT})
+endif()

 # Boost settings
 if(MSVC)


Pass `${CMAKE_CXX_COMPILER}` to pugixml (#49)

--- external/ImportPugiXML.cmake
+++ external/ImportPugiXML.cmake
@@ -14,7 +14,7 @@
   ExternalProject_Add(pugixml_external
     PREFIX ${EXTERNAL_BUILD_DIR}/pugixml
     GIT_REPOSITORY https://github.com/zeux/pugixml
-    CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>"
+    CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>" "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
     UPDATE_COMMAND ""
     INSTALL_COMMAND ""
     BUILD_BYPRODUCTS ${EXTERNAL_BUILD_DIR}/pugixml/src/pugixml_external-build/libpugixml${CMAKE_STATIC_LIBRARY_SUFFIX}


CMake: update foreach in cpp.cmake

CMake: update foreach in cpp.cmake

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -254,13 +254,13 @@

 # Get Protobuf include dir
 get_target_property(protobuf_dirs protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES)
-foreach(dir ${protobuf_dirs})
+foreach(dir IN LISTS protobuf_dirs)
   if ("${dir}" MATCHES "BUILD_INTERFACE")
     list(APPEND PROTO_DIRS "\"--proto_path=${dir}\"")
   endif()
 endforeach()

-foreach (PROTO_FILE ${proto_files})
+foreach(PROTO_FILE IN LISTS proto_files)
   #message(STATUS "protoc proto(cc): ${PROTO_FILE}")
   get_filename_component(PROTO_DIR ${PROTO_FILE} DIRECTORY)
   get_filename_component(PROTO_NAME ${PROTO_FILE} NAME_WE)


COMP:  find_package ordering seems to be important

When find_package(SlicerExecutionModel) follows
find_pack(ITK), then for some reason the ITK_INCLUDE_DIRS
is very truncated.

--- DTIReg.cmake
+++ DTIReg.cmake
@@ -1,16 +1,5 @@
-
-
 set(MODULE_NAME ${EXTENSION_NAME}) # Do not use 'project()'
 set(MODULE_TITLE ${MODULE_NAME})
-
-#-----------------------------------------------------------------------------
-find_package(SlicerExecutionModel NO_MODULE REQUIRED GenerateCLP)
-include(${GenerateCLP_USE_FILE})
-include(${SlicerExecutionModel_USE_FILE})
-
-include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
-
-SETIFEMPTY(INSTALL_RUNTIME_DESTINATION bin)

 #-----------------------------------------------------------------------------
 # Update CMake module path
@@ -36,8 +25,17 @@
 include(${ITK_USE_FILE})

 #-----------------------------------------------------------------------------
+find_package(SlicerExecutionModel NO_MODULE REQUIRED GenerateCLP)
+include(${GenerateCLP_USE_FILE})
+include(${SlicerExecutionModel_USE_FILE})
+
+
+#-----------------------------------------------------------------------------
 find_package(BatchMake REQUIRED)
 include(${BatchMake_USE_FILE})
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+SETIFEMPTY(INSTALL_RUNTIME_DESTINATION bin)

 configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/DTI-Reg_Config.h.in"
                 "${CMAKE_CURRENT_BINARY_DIR}/DTI-Reg_Config.h")


Fixed bug where MATLAB/Octave tests would fail

I fixed a bug where MATLAB/Octave tests would fail when being run as a
script rather than as a function.

--- src/cmake/Modules/AddOptizelleTestMatlab.cmake
+++ src/cmake/Modules/AddOptizelleTestMatlab.cmake
@@ -5,7 +5,7 @@
     set (extra_macro_args ${ARGN})
     list(LENGTH extra_macro_args num_extra_args)
     if (${num_extra_args} GREATER 0)
-        list(GET extra_macro_args 0 is_script)
+        set (is_script "TRUE")
     else()
         set (is_script "FALSE")
     endif()


CDRIVER-3594 build Sphinx docs without parallelism

--- build/cmake/SphinxBuild.cmake
+++ build/cmake/SphinxBuild.cmake
@@ -40,7 +40,7 @@
       ${CMAKE_COMMAND} -E env
       "PYTHONDONTWRITEBYTECODE=1"
       ${SPHINX_EXECUTABLE}
-         -j ${NPROCS} -qEW -b html
+         -qEW -b html
          -c "${CMAKE_CURRENT_SOURCE_DIR}"
          "${CMAKE_CURRENT_SOURCE_DIR}"
          "${SPHINX_HTML_DIR}"
@@ -133,7 +133,7 @@
       ${CMAKE_COMMAND} -E env
       "PYTHONDONTWRITEBYTECODE=1"
       ${SPHINX_EXECUTABLE}
-         -j ${NPROCS} -qEW -b man
+         -qEW -b man
          -c "${CMAKE_CURRENT_SOURCE_DIR}"
          "${CMAKE_CURRENT_SOURCE_DIR}"
          "${SPHINX_MAN_DIR}"


Add conference option to specfile.

Add conference option to specfile.

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -20,6 +20,7 @@
 %define     transcoder %{?_without_transcoder:0}%{!?_without_transcoder:1}
 %define     snmp       %{?_without_snmp:0}%{!?_without_snmp:1}
 %define     presence   %{?_with_presence:1}%{!?_with_presence:0}
+%define     conference %{?_with_conference:1}%{!?_with_conference:0}
 %define     pkg_prefix %{?_with_bc:bc-}%{!?_with_bc:}
 %define     soci       %{?_without_soci:0}%{!?_without_soci:1}
 %{?_with_bc: %define    _prefix         /opt/belledonne-communications}
@@ -120,6 +121,7 @@
 	-DENABLE_SOCI=%{soci} \
 	-DENABLE_TRANSCODER=%{transcoder} \
 	-DENABLE_PRESENCE=%{presence} \
+	-DENABLE_CONFERENCE=%{conference} \
 	-DENABLE_PUSHNOTIFICATIN=%{push} \
         -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir}


Move golay23 into codec2 library.

Move golay23 into codec2 library.

git-svn-id: 31cbfd89c62d6b8b302bb3be5c74ebef9d32ffd0@1295 01035d8c-6547-0410-b346-abe4f91aad63

--- README.cmake
+++ README.cmake
@@ -2,7 +2,7 @@
 this time but has been thouroughly tested on Fedora Linux and will likely work
 well on most *nix systems and has many advanages over the autotools config.

-- Builds against system libraries (default).
+- Builds against system libraries (by default).
 - Or optionally download, build, and statically link with required libraries on
   an individual basis. See USE_STATIC_??? options.
 - Has experimental NSIS packaing support for Windows (WIN32) targets. *nix


Fix packaging external modules when ZORBA_MODULES_DIR contains ..

--- test/remote/SvnPackage.cmake
+++ test/remote/SvnPackage.cmake
@@ -80,14 +80,17 @@
 macro (svn_package srcdir tmpdir changelist resultfile)
   find_prereqs ()

+  # Canonicalize srcdir
+  get_filename_component (abssrcdir "${srcdir}" ABSOLUTE)
+
   # Start by making our working directory
   set (chgdir "${tmpdir}/changes")
   file (MAKE_DIRECTORY "${chgdir}")

   # Write out the "svn info" and "svn status" information
-  execute_process (COMMAND "${svn}" --xml info "${srcdir}"
+  execute_process (COMMAND "${svn}" --xml info "${abssrcdir}"
                    OUTPUT_FILE "${chgdir}/svn-info.xml")
-  execute_process (COMMAND "${svn}" --xml status "${srcdir}"
+  execute_process (COMMAND "${svn}" --xml status "${abssrcdir}"
                    OUTPUT_FILE "${chgdir}/svn-status.xml")

   # Also save the named of the changelist for the remote queue to use
@@ -108,11 +111,11 @@
     file (MAKE_DIRECTORY "${chgdir}/files")
     foreach (filepath ${copyfiles})
       if (NOT IS_DIRECTORY "${filepath}")
-        message ("Copying ${filepath}..")
         file (TO_CMAKE_PATH "${filepath}" filepath)
-        file (RELATIVE_PATH relpath "${srcdir}" "${filepath}")
+        file (RELATIVE_PATH relpath "${abssrcdir}" "${filepath}")
         get_filename_component (reldir "${relpath}" PATH)
         file (MAKE_DIRECTORY "${chgdir}/files/${reldir}")
+        message ("Copying ${filepath} to ${chgdir}/files/${reldir}..")
         execute_process (COMMAND "${CMAKE_COMMAND}" -E copy
           "${filepath}" "${chgdir}/files/${reldir}")
       endif (NOT IS_DIRECTORY "${filepath}")


Reformat new CMake logic.

Reformat new CMake logic.

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- xc7/make/project_xray.cmake
+++ xc7/make/project_xray.cmake
@@ -153,16 +153,10 @@
     list(APPEND ARCH_INCLUDE_FILES ${MODEL_XML} ${INCLUDE_FILES})
   endforeach()

-  set(OUTPUTS arch.xml channels.db)
   set(ROI_ARG "")
+  set(ROI_ARG_FOR_CREATE_EDGES "")
+
   if(NOT "${PROJECT_XRAY_ARCH_USE_ROI}" STREQUAL "")
-    set(OUTPUTS arch.xml channels.db)
-    set(ROI_ARG --use_roi ${PROJECT_XRAY_ARCH_USE_ROI} --synth_tiles ${CMAKE_CURRENT_BINARY_DIR}/synth_tiles.json)
-    list(APPEND DEPS ${PROJECT_XRAY_ARCH_USE_ROI} synth_tiles.json)
-
-    set(ROI_ARG_FOR_CREATE_EDGES --synth_tiles ${CMAKE_CURRENT_BINARY_DIR}/synth_tiles.json)
-    list(APPEND CHANNELS_DEPS synth_tiles.json)
-
     add_custom_command(
       OUTPUT synth_tiles.json
       COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${PRJXRAY_DIR}:${symbiflow-arch-defs_SOURCE_DIR}/utils
@@ -175,12 +169,17 @@
         ${PROJECT_XRAY_ARCH_USE_ROI}
         ${PYTHON3} ${PYTHON3_TARGET}
         )
-    if(NOT "${PROJECT_XRAY_ARCH_USE_ROI}" STREQUAL "")
-      add_file_target(FILE synth_tiles.json GENERATED)
-      set_target_properties(${ARCH_TARGET} PROPERTIES USE_ROI TRUE)
-      set_target_properties(${ARCH_TARGET} PROPERTIES
-          SYNTH_TILES ${CMAKE_CURRENT_SOURCE_DIR}/synth_tiles.json)
-    endif()
+
+    add_file_target(FILE synth_tiles.json GENERATED)
+    set_target_properties(${ARCH_TARGET} PROPERTIES USE_ROI TRUE)
+    set_target_properties(${ARCH_TARGET} PROPERTIES
+        SYNTH_TILES ${CMAKE_CURRENT_SOURCE_DIR}/synth_tiles.json)
+
+    set(ROI_ARG --use_roi ${PROJECT_XRAY_ARCH_USE_ROI} --synth_tiles ${CMAKE_CURRENT_BINARY_DIR}/synth_tiles.json)
+    list(APPEND DEPS ${PROJECT_XRAY_ARCH_USE_ROI} synth_tiles.json)
+
+    set(ROI_ARG_FOR_CREATE_EDGES --synth_tiles ${CMAKE_CURRENT_BINARY_DIR}/synth_tiles.json)
+    list(APPEND CHANNELS_DEPS synth_tiles.json)
   endif()

   append_file_dependency(DEPS ${symbiflow-arch-defs_SOURCE_DIR}/xc7/archs/${PART}/pin_assignments.json)
@@ -229,6 +228,7 @@
     ${PYTHON3} ${PYTHON3_TARGET} ${CREATE_EDGES}
       ${CHANNELS_DEPS}
     )
+
   add_file_target(FILE channels.db GENERATED)
 endfunction()


remove whitespace from package description

--- cmake/CPackDebianConfig.cmake
+++ cmake/CPackDebianConfig.cmake
@@ -32,7 +32,7 @@
 SET(CPACK_DEBIAN_PACKAGE_PRIORITY    "optional")
 SET(CPACK_DEBIAN_PACKAGE_SECTION     "devel")
 SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open Source Routing Machine (OSRM) is a high-performance routing engine.
-  It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
+It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap."
 )
 SET(CPACK_DEBIAN_PACKAGE_DEPENDS     "libc6-dev, libprotobuf-dev, libosmpbf-dev, libbz2-1.0, libstxxl1, libxml2, libzip2, liblua5.1-0, libtbb2, libboost-all-dev")


Update FindMySQL.cmake

Update FindMySQL.cmake

--- cmake/Modules/FindMySQL.cmake
+++ cmake/Modules/FindMySQL.cmake
@@ -14,15 +14,24 @@
             "/usr/local/include/mysql"
             "/usr/mysql/include/mysql")

+if (WIN32)
 find_library(MYSQL_LIBRARY
     NAMES "libmysql" "libmysql_r"
     PATHS "$ENV{ProgramFiles}/MySQL/*/lib"
             "$ENV{ProgramW6432}/MySQL/*/lib"
-            "$ENV{SystemDrive}/MySQL/*/lib"
-            "/usr/lib"
-            "/usr/lib/mysql"
-            "/usr/local/lib"
-            "/usr/mysql/lib/mysql")
+            "$ENV{SystemDrive}/MySQL/*/lib")
+
+else (WIN32)
+find_library(MYSQL_LIBRARY
+    NAMES "mysqlclient" "mysqlclient_r"
+    PATHS "/usr/lib"
+        "/usr/lib/mysql"
+		"/usr/local/lib"
+		"/usr/local/mysql/lib"
+		"/usr/local/lib/mysql"
+		"/opt/local/lib/mysql5/mysql")
+
+endif (WIN32)

 if (MYSQL_LIBRARY)
     if (MYSQL_INCLUDE_DIR)


Minor changes to binarytochararray.cmake.

--- cmake/binarytochararray.cmake
+++ cmake/binarytochararray.cmake
@@ -14,11 +14,9 @@

 # This script requires CMake version 3.18 to run hence why it is not directly part of the build configuration.
 # usage:
-#  cmake -P binarytochararray.cmake <full-path-to-xhtml-math11-f.dtd>
+#  cmake -P binarytochararray.cmake <full-path-to-compressed-xhtml-math11-f.dtd> 391336
 #
-# Err, not quite working like that just yet.
-#
-# Currently we have to compress the DTD and then we generate the header and implementation file
+# Currently, we have to compress the DTD and then we generate the header and implementation file
 # in the source tree.  We also pass the compressed data and original size of the DTD to this script.
 # It would be prefereble for this not to happen.  Generating the DTD in the build tree is the preferred option
 # but this can't happen until the minimum CMake version can be set to 3.18.


CMake: make sure that the version of ClangFormat is properly determined.

At least on macOS when using the Homebrew version of ClangFormat.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -143,7 +143,7 @@
   execute_process(COMMAND ${CLANG_FORMAT_EXE} -version
                   OUTPUT_VARIABLE CLANG_FORMAT_VERSION
                   ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-  string(REGEX REPLACE "clang-format version ([.0-9]+).*" "\\1" CLANG_FORMAT_VERSION "${CLANG_FORMAT_VERSION}")
+  string(REGEX REPLACE "^.*clang-format version ([.0-9]+).*" "\\1" CLANG_FORMAT_VERSION "${CLANG_FORMAT_VERSION}")

   if(CLANG_FORMAT_VERSION VERSION_LESS CLANG_FORMAT_VERSION_MINIMUM)
     message(STATUS "ClangFormat ${CLANG_FORMAT_VERSION} was found, but version ${CLANG_FORMAT_VERSION_MINIMUM}+ is needed to run the ClangFormat test")


Add boost unit test as the unit test framework

We automatically link against boost unit test for our unit test

--- cmake/includes/UnitTest.cmake
+++ cmake/includes/UnitTest.cmake
@@ -16,6 +16,10 @@
     set(multiValueArgs INCLUDES LIBRARIES)
     cmake_parse_arguments(TEST "${options}" "${oneValueArgs}"
         "${multiValueArgs}" ${ARGN})
+
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_TEST_DYN_LINK")
+    find_package(Boost 1.55.0 COMPONENTS unit_test_framework REQUIRED)
+    include_directories(${Boost_INCLUDE_DIRS})

     if ("${TEST_NAME}" STREQUAL "")
         message(FATAL_ERROR "Set NAME parameter to the project name")
@@ -42,11 +46,12 @@
     set_target_properties(${TEST_NAME}-test PROPERTIES
         RUNTIME_OUTPUT_DIRECTORY test)

-    if (TEST_LIBRARIES)
-        target_link_libraries(${TEST_NAME}-test ${TEST_LIBRARIES})
-    endif()
+    target_link_libraries(${TEST_NAME}-test
+        ${Boost_LIBRARIES}
+        ${TEST_NAME}
+        ${TEST_LIBRARIES})

-    add_test(${TEST_NAME}-test test/${TEST_NAME}-test)
+    add_test(${TEST_NAME}-test test/${TEST_NAME}-test --log_level=all)
     add_dependencies(check-${TEST_NAME} ${TEST_NAME}-test)
     add_dependencies(check check-${TEST_NAME})


Fix cmake script

Fix cmake script

--- cmake_scripts/Findnumpy.cmake
+++ cmake_scripts/Findnumpy.cmake
@@ -7,7 +7,7 @@
         $ENV{VIRTUAL_ENV}/lib/*/site-packages/numpy/core/include
         ENV PYTHON_INCLUDE_DIR
         /usr/local/lib/python2.7/dist-packages/numpy/core/include
-        $ENV{PYTHON}/lib/site-packages\numpy\core\include
+        $ENV{PYTHON}/lib/site-packages/numpy/core/include
     DOC "Path to the numpy headers"
 )


BOOST_ROOT: Some minor things to previous.

--- cmake/ConfigurePackages.cmake
+++ cmake/ConfigurePackages.cmake
@@ -24,13 +24,13 @@

     # Set BOOST_ROOT to our deps if not defined so the FindBoost.cmake
     # macro is used in a any situation inside sagase_configure_package().
-    if (WIN32 AND "${ENV_BOOST_ROOT}" STREQUAL "")
+    if (MSVC AND "${ENV_BOOST_ROOT}" STREQUAL "")
         if (WIN32)
-            # Fallback to the deps boost if a overriding env variable is not set
+            # Fallback to the deps boost if a overriding env variable is not set.
             SET (BOOST_ROOT ${ENV_TUNDRA_DEP_PATH}/Boost)
         else ()
-            # For linux boost is found from system, if not there it will anyway
-            # fallback to brute force search to ENV_TUNDRA_DEP_PATH
+            # For linux etc. boost is found from system. If not it will anyway
+            # fallback to brute force search to ENV_TUNDRA_DEP_PATH like before.
             SET (BOOST_ROOT "")
         endif ()
     else ()


use hints instead of paths as it is higher priority

--- cmake/FindPythonLibsNew.cmake
+++ cmake/FindPythonLibsNew.cmake
@@ -165,7 +165,7 @@
     # information the python interpreter itself gave us were more complete.
     find_library(PYTHON_LIBRARY
         NAMES "python${PYTHON_LIBRARY_SUFFIX}"
-        PATHS ${_PYTHON_LIBS_SEARCH}
+        HINTS ${_PYTHON_LIBS_SEARCH}
         NO_SYSTEM_ENVIRONMENT_PATH)
     message(STATUS "Found Python lib ${PYTHON_LIBRARY}")
 endif()


Update: enable finding debug libraries and source generated libraries
Note: naming rules of CMakeLists.txt of qhull are a bit weird

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@710 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindQhull.cmake
+++ cmake/Modules/FindQhull.cmake
@@ -1,5 +1,5 @@
 ###############################################################################
-# Find QHULL
+# Find QHULL 2011.1
 #
 # This sets the following variables:
 # QHULL_FOUND - True if QHULL was found.
@@ -7,24 +7,34 @@
 # QHULL_LIBRARIES - Libraries needed to use QHULL.
 # QHULL_DEFINITIONS - Compiler flags for QHULL.

+set(QHULL_MAJOR_VERSION 6)
+
 find_path(QHULL_INCLUDE_DIR qhull.h
           HINTS ${QHULL_ROOT}
           PATH_SUFFIXES qhull src/libqhull libqhull)

-find_library(QHULL_LIBRARY qhull
+find_library(QHULL_LIBRARY qhull qhull${QHULL_MAJOR_VERSION}
              HINTS ${QHULL_ROOT}
-             PATH_SUFFIXES project)
+             PATH_SUFFIXES project build bin)
+
+find_library(QHULL_LIBRARY_DEBUG qhull_d qhull_d${QHULL_MAJOR_VERSION}
+             HINTS ${QHULL_ROOT}
+             PATH_SUFFIXES project build bin)

 set(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIR})
-set(QHULL_LIBRARIES ${QHULL_LIBRARY})
+if(QHULL_LIBRARY_DEBUG)
+	set(QHULL_LIBRARIES optimized ${QHULL_LIBRARY} debug ${QHULL_LIBRARY_DEBUG})
+else(QHULL_LIBRARY_DEBUG)
+	set(QHULL_LIBRARIES ${QHULL_LIBRARY})
+endif(QHULL_LIBRARY_DEBUG)
+

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Qhull DEFAULT_MSG QHULL_LIBRARY
     QHULL_INCLUDE_DIR)

-mark_as_advanced(QHULL_LIBRARY QHULL_INCLUDE_DIR)
+mark_as_advanced(QHULL_LIBRARY QHULL_LIBRARY_DEBUG QHULL_INCLUDE_DIR)

 if(QHULL_FOUND)
   message(STATUS "QHULL found (include: ${QHULL_INCLUDE_DIRS}, lib: ${QHULL_LIBRARIES})")
 endif(QHULL_FOUND)
-


add compiler definitions HAVE_{modulename} to all components (only needed for network image sink at the moment)

--- cmake/UbiTrackComponent.cmake
+++ cmake/UbiTrackComponent.cmake
@@ -178,6 +178,12 @@
 #   ut_create_multi_component(<extra link dependencies>)
 macro(ut_create_multi_component)
 	foreach(fpath ${UBITRACK_COMPONENT_${the_component}_SOURCES})
+
+		foreach(m ${UBITRACK_MODULES_BUILD})
+		  string(TOUPPER ${m} m_)
+		  add_definitions("-DHAVE_${m_}")
+		endforeach()
+
 		GET_FILENAME_COMPONENT(fname ${fpath} NAME_WE)

 		add_library(${fname} SHARED ${UBITRACK_COMPONENT_${the_component}_HEADERS} ${fpath})
@@ -262,6 +268,12 @@
 # Usage:
 #   ut_create_single_component(<extra link dependencies>)
 macro(ut_create_single_component)
+
+	foreach(m ${UBITRACK_MODULES_BUILD})
+	  string(TOUPPER ${m} m_)
+	  add_definitions("-DHAVE_${m_}")
+	endforeach()
+
 	add_library(${the_component} SHARED ${UBITRACK_COMPONENT_${the_component}_HEADERS} ${UBITRACK_COMPONENT_${the_component}_SOURCES})

 	set(UBITRACK_COMPONENT_${the_component}_COMPILE_DEFINITIONS)