[CMake] [Darwin] [macho_embedded] Specify the version min explicitly.

We need to set the OS X deployment target on the macho_embedded libraries to match the outputs from the autoconf build system.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -376,6 +376,7 @@
       string(TOLOWER "${float_type}_${type}" lib_suffix)
       foreach(arch ${DARWIN_${float_type}_FLOAT_ARCHS})
         set(DARWIN_macho_embedded_SYSROOT ${DARWIN_osx_SYSROOT})
+        set(DARWIN_macho_embedded_BUILTIN_MIN_VER_FLAG ${DARWIN_osx_BUILTIN_MIN_VER_FLAG})
         if(${arch} MATCHES "^arm")
           set(DARWIN_macho_embedded_SYSROOT ${DARWIN_ios_SYSROOT})
         endif()


Update seperate travis script for building

--- cmake/Toolchain-clang-arm-none-eabi.cmake
+++ cmake/Toolchain-clang-arm-none-eabi.cmake
@@ -34,14 +34,20 @@

 set(CMAKE_SYSTEM_NAME Generic)

-set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
-
 if (NOT CMAKE_C_COMPILER OR NOT ${CMAKE_C_COMPILER} MATCHES "clang*")
     set(CMAKE_C_COMPILER clang)
 endif()

 if (NOT CMAKE_CXX_COMPILER OR NOT ${CMAKE_CXX_COMPILER} MATCHES "clang*")
     set(CMAKE_CXX_COMPILER clang++)
+endif()
+
+if(CMAKE_VERSION VERSION_LESS "3.6.0")
+    include(CMakeForceCompiler)
+    cmake_force_c_compiler(${CMAKE_C_COMPILER} Clang)
+    cmake_force_cxx_compiler(${CMAKE_CXX_COMPILER} Clang)
+else()
+    set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
 endif()

 set(CMAKE_LINKER arm-none-eabi-ld CACHE STRING "GNU ARM linker")


[t:4871] forgot global generates GSYMS too

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

--- cmake_modules/TokuBuildTagDatabases.cmake
+++ cmake_modules/TokuBuildTagDatabases.cmake
@@ -82,12 +82,14 @@
       OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GTAGS"
       OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GRTAGS"
       OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GPATH"
+      OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/GSYMS"
       COMMAND ${GTAGS} --gtagsconf "${CMAKE_CURRENT_SOURCE_DIR}/.globalrc"
       DEPENDS ${all_srcs} ${all_hdrs} install_tdb_h generate_config_h generate_log_code
       WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
     add_custom_target(build_GTAGS ALL DEPENDS
       "${CMAKE_CURRENT_SOURCE_DIR}/GTAGS"
       "${CMAKE_CURRENT_SOURCE_DIR}/GRTAGS"
-      "${CMAKE_CURRENT_SOURCE_DIR}/GPATH")
+      "${CMAKE_CURRENT_SOURCE_DIR}/GPATH"
+      "${CMAKE_CURRENT_SOURCE_DIR}/GSYMS")
   endif ()
-endif ()+endif ()


Added an -O2 options if FORTIFY_SOURCE since some GCC versions requires it

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -56,7 +56,7 @@

     check_c_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
     if (WITH_FORTIFY_SOURCE)
-      add_definitions(-D_FORTIFY_SOURCE=2)
+      add_definitions(-D_FORTIFY_SOURCE=2 -O2)
     endif (WITH_FORTIFY_SOURCE)
   endif (CMAKE_COMPILER_IS_GNUCC OR COMPILER_IS_CLANG)
 endif (UNIX)


plugins: explictely depends en Evas

plugins: explictely depends en Evas

The plugins should already by implicitely linked to Evas via Elementary,
but making this explicit should not harm.

This could fix #15.

--- cmake/Modules/plugin.cmake
+++ cmake/Modules/plugin.cmake
@@ -9,12 +9,14 @@
    target_include_directories(${Plugin}
       SYSTEM PRIVATE
       ${EINA_INCLUDE_DIRS}
+      ${EVAS_INCLUDE_DIRS}
       ${ELEMENTARY_INCLUDE_DIRS}
       ${MSGPACK_INCLUDE_DIRS}
       ${EOVIM_INCLUDE_DIRS}
    )
    target_link_libraries(${Plugin}
       ${EINA_LIBRARIES}
+      ${EVAS_LIBRARIES}
       ${ELEMENTARY_LIBRARIES}
       ${MSGPACK_LIBRARIES}
       libeovim


Copied breakpad libs into the wrong directory

--- cmake/modules/BuildGoogleBreakpad.cmake
+++ cmake/modules/BuildGoogleBreakpad.cmake
@@ -68,7 +68,7 @@
     install-breakpad
     DEPENDEES build
     DEPENDERS install
-    COMMAND ${CMAKE_SCRIPT_PATH}/robocopy.bat "<SOURCE_DIR>/src/" "<INSTALL_DIR>/lib" "*.lib"
+    COMMAND ${CMAKE_SCRIPT_PATH}/robocopy.bat "<SOURCE_DIR>/src/" "<INSTALL_DIR>/lib/breakpad" "*.lib"
     COMMAND ${CMAKE_SCRIPT_PATH}/robocopy.bat "<SOURCE_DIR>/src/" "<INSTALL_DIR>/bin" "*.dll"
   )
 else()


Squashed '3rdparty/github/cmake-utils-remote/' changes from f60f488..4522e8e

4522e8e Fix CMAKE_MODULE_PATH

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 4522e8ea91899a6bae2837cd7f7830e13003aa42

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -34,11 +34,11 @@
   #
   # Paths
   #
-  SET (CMAKE_MODULE_PATH      "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/3rdparty/github/cmake-utils/cmake") # General module search path
-  SET (INCLUDE_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/include")                                                  # General include output path
-  SET (LIBRARY_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/lib")                                                      # General library output path
-  SET (BINARY_OUTPUT_PATH     "${PROJECT_SOURCE_DIR}/output/bin")                                                      # General binary output path
-  SET (3RDPARTY_OUTPUT_PATH   "${PROJECT_SOURCE_DIR}/output/3rdparty")                                                 # General 3rdparty output path
+  SET (CMAKE_MODULE_PATH      "${PROJECT_SOURCE_DIR}/cmake" "${PROJECT_SOURCE_DIR}/3rdparty/github/cmake-utils-remote/cmake") # General module search path
+  SET (INCLUDE_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/include")                                                         # General include output path
+  SET (LIBRARY_OUTPUT_PATH    "${PROJECT_SOURCE_DIR}/output/lib")                                                             # General library output path
+  SET (BINARY_OUTPUT_PATH     "${PROJECT_SOURCE_DIR}/output/bin")                                                             # General binary output path
+  SET (3RDPARTY_OUTPUT_PATH   "${PROJECT_SOURCE_DIR}/output/3rdparty")                                                        # General 3rdparty output path
   #
   # Output directories
   # C.f. http://stackoverflow.com/questions/7747857/in-cmake-how-do-i-work-around-the-debug-and-release-directories-visual-studio-2


Fix sha sum of lib-cpp-pre v1.3.2

Fix sha sum of lib-cpp-pre v1.3.2

--- cmake/projects/lib-cpp-pre/hunter.cmake
+++ cmake/projects/lib-cpp-pre/hunter.cmake
@@ -19,7 +19,7 @@
     PACKAGE_NAME lib-cpp-pre
     VERSION "1.3.2"
     URL "https://github.com/daminetreg/lib-cpp-pre/archive/v1.3.2.tar.gz"
-    SHA1 8afe8c9d58a3f82dae5a92b2865cf243f3dc2f71
+    SHA1 e91a1364d88087d162b9fb05309cb47702ec25a2
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)


Including minimum libzmq and czmq versions for pkg_check_modules.

--HG--
branch : improve_zmq_detection

--- cmake/SearchForStuff.cmake
+++ cmake/SearchForStuff.cmake
@@ -34,8 +34,7 @@

 #################################################
 # Find ZeroMQ.
-# TODO, which version is the minimun to work with this software
-pkg_check_modules(zmq libzmq)
+pkg_check_modules(zmq libzmq>=3.2.0)

 if (NOT zmq_FOUND)
   message (STATUS "Looking for zmq pkgconfig file - not found")
@@ -47,8 +46,7 @@

 #################################################
 # Find czmq.:
-# TODO, which version is the minimun to work with this software
-pkg_check_modules(czmq libczmq)
+pkg_check_modules(czmq libczmq>=1.4.0)

 if (NOT czmq_FOUND)
   message (STATUS "Looking for czmq pkgconfig file - not found")


PARQUET-931: Add option to pin Arrow version with environment variable

Also added console output to show the version to help with debugging. I need this to help with pinning the Arrow version in conda-forge without necessarily making Arrow itself a build dependency (since it's cheap to build Arrow)

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #300 from wesm/PARQUET-931 and squashes the following commits:

0887958 [Wes McKinney] Do not build ARROW_IPC in thirdparty Arrow
98cae5a [Wes McKinney] Add option to pin Arrow version with $PARQUET_ARROW_VERSION environment variable. Upgrade default to current Arrow master

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -372,9 +372,16 @@
     -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
     -DCMAKE_INSTALL_PREFIX=${ARROW_PREFIX}
     -DARROW_JEMALLOC=OFF
+    -DARROW_IPC=OFF
     -DARROW_BUILD_TESTS=OFF)

-  set(ARROW_VERSION "c2f28cd07413e262fa0b741c286f86d5c7277c56")
+  if ("$ENV{PARQUET_ARROW_VERSION}" STREQUAL "")
+    set(ARROW_VERSION "bb8514cc9d7068c8b62d346577370751d68221d8")
+  else()
+    set(ARROW_VERSION "$ENV{PARQUET_ARROW_VERSION}")
+  endif()
+  message(STATUS "Building Apache Arrow from commit: ${ARROW_VERSION}")
+
   set(ARROW_URL "https://github.com/apache/arrow/archive/${ARROW_VERSION}.tar.gz")

   if (CMAKE_VERSION VERSION_GREATER "3.2")


[cmake] master: 3.9.0

[cmake] master: 3.9.0

--- cmake/SiconosVersion.cmake
+++ cmake/SiconosVersion.cmake
@@ -1,6 +1,6 @@
 # --- set siconos current version ---
 # This file is also required for examples.
 set(MAJOR_VERSION 3)
-set(MINOR_VERSION 8)
+set(MINOR_VERSION 9)
 set(PATCH_VERSION 0)
 set(SICONOS_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")


[CMake][Fuchsia] Include check-lld in the list of bootstrap targets

This allows running lld tests when doing 2-stage toolchain build.

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

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

--- cmake/caches/Fuchsia.cmake
+++ cmake/caches/Fuchsia.cmake
@@ -82,14 +82,17 @@
   check-all
   check-llvm
   check-clang
+  check-lld
   llvm-config
   test-suite
   test-depends
   llvm-test-depends
   clang-test-depends
+  lld-test-depends
   distribution
   install-distribution
   install-distribution-stripped
+  install-distribution-toolchain
   clang CACHE STRING "")

 get_cmake_property(variableNames VARIABLES)


relax depends check (#813)

relax depends check (#813)

--- cmake/catkin_package.cmake
+++ cmake/catkin_package.cmake
@@ -159,9 +159,9 @@
           #message(WARNING "catkin_package() DEPENDS on catkin package '${depend_name}' which is deprecated. Use CATKIN_DEPENDS for catkin packages instead.")
           list(APPEND _PROJECT_CATKIN_DEPENDS ${depend_name})
         else()
-          if(NOT ${depend_name}_FOUND)
-            message(FATAL_ERROR "catkin_package() DEPENDS on '${depend_name}' which must be find_package()-ed before. If it is a catkin package it can be declared as CATKIN_DEPENDS instead without find_package()-ing it.")
-          endif()
+          # the dependency might not come from a CMake config / module file
+          # but from e.g. PkgConfig / pkg_search_module
+          # therefore this can't expect ${depend_name}_FOUND to be defined
           if(NOT DEFINED ${depend_name}_INCLUDE_DIRS AND NOT DEFINED ${depend_name}_LIBRARIES)
             message(WARNING "catkin_package() DEPENDS on '${depend_name}' but neither '${depend_name}_INCLUDE_DIRS' nor '${depend_name}_LIBRARIES' is defined.")
           endif()


Make GetSVN.cmake do its VCS queries with native CMake code.
This lets the queries work on Windows as well as Linux.

This does mean make and cmake aren't using the same scripts to do the
queries (again), but at least GetSVN.cmake understands git and git-svn
as well as svn now.

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

--- cmake/modules/GetSVN.cmake
+++ cmake/modules/GetSVN.cmake
@@ -19,13 +19,78 @@
 # Handle strange terminals
 set(ENV{TERM} "dumb")

+macro(get_source_info_svn path revision repository)
+  # FindSubversion does not work with symlinks. See PR 8437
+  if (NOT IS_SYMLINK "${path}")
+    find_package(Subversion)
+  endif()
+  if (Subversion_FOUND)
+    subversion_wc_info( ${path} Project )
+    if (Project_WC_REVISION)
+      set(${revision} ${Project_WC_REVISION} PARENT_SCOPE)
+    endif()
+    if (Project_WC_URL)
+      set(${repository} ${Project_WC_URL} PARENT_SCOPE)
+    endif()
+  endif()
+endmacro()
+
+macro(get_source_info_git_svn path revision repository)
+  find_program(git_executable NAMES git git.exe git.cmd)
+  if (git_executable)
+    execute_process(COMMAND ${git_executable} svn info
+      WORKING_DIRECTORY ${path}
+      TIMEOUT 5
+      RESULT_VARIABLE git_result
+      OUTPUT_VARIABLE git_output)
+    if (git_result EQUAL 0)
+      string(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
+        "\\2" git_svn_rev "${git_output}")
+      set(${revision} ${git_svn_rev} PARENT_SCOPE)
+      string(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
+        "\\2" git_url "${git_output}")
+      set(${repository} ${git_url} PARENT_SCOPE)
+    endif()
+  endif()
+endmacro()
+
+macro(get_source_info_git path revision repository)
+  find_program(git_executable NAMES git git.exe git.cmd)
+  if (git_executable)
+    execute_process(COMMAND ${git_executable} log -1 --pretty=format:%H
+      WORKING_DIRECTORY ${path}
+      TIMEOUT 5
+      RESULT_VARIABLE git_result
+      OUTPUT_VARIABLE git_output)
+    if (git_result EQUAL 0)
+      set(${revision} ${git_output} PARENT_SCOPE)
+    endif()
+    execute_process(COMMAND ${git_executable} remote -v
+      WORKING_DIRECTORY ${path}
+      TIMEOUT 5
+      RESULT_VARIABLE git_result
+      OUTPUT_VARIABLE git_output)
+    if (git_result EQUAL 0)
+      string(REGEX REPLACE "^(.*\n)?[^ \t]+[ \t]+([^ \t\n]+)[ \t]+\\(fetch\\).*"
+        "\\2" git_url "${git_output}")
+      set(${repository} "${git_url}" PARENT_SCOPE)
+    endif()
+  endif()
+endmacro()
+
+function(get_source_info path revision repository)
+  if (EXISTS "${path}/.svn")
+    get_source_info_svn("${path}" revision repository)
+  elseif (EXISTS "${path}/.git/svn")
+    get_source_info_git_svn("${path}" revision repository)
+  elseif (EXISTS "${path}/.git")
+    get_source_info_git("${path}" revision repository)
+  endif()
+endfunction()
+
 function(append_info name path)
-  execute_process(COMMAND "${LLVM_DIR}/utils/GetSourceVersion" "${path}"
-    OUTPUT_VARIABLE revision)
+  get_source_info("${path}" revision repository)
   string(STRIP "${revision}" revision)
-  execute_process(COMMAND "${LLVM_DIR}/utils/GetRepositoryPath" "${path}"
-    OUTPUT_VARIABLE repository
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
   string(STRIP "${repository}" repository)
   file(APPEND "${HEADER_FILE}.txt"
     "#define ${name}_REVISION \"${revision}\"\n")


Output which bash version is being used.

svn path=/trunk/; revision=11358

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -133,6 +133,7 @@
 else(SH_EXECUTABLE)
   find_program(SH_EXECUTABLE sh)
 endif(SH_EXECUTABLE)
+message(STATUS "SH_EXECUTABLE = ${SH_EXECUTABLE}")

 if(NOT SH_EXECUTABLE)
    message(STATUS


build: update sysdig shasum

build: update sysdig shasum

Signed-off-by: Lorenzo Fontana <0189fb5ac8a393aa741cf57f29cfe3228fcad081@gmail.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -28,7 +28,7 @@
 # In case you want to test against another sysdig version just pass the variable - ie., `cmake -DSYSDIG_VERSION=dev ..`
 if(NOT SYSDIG_VERSION)
   set(SYSDIG_VERSION "build/jq-update") # todo(fntlnz): revert this before merging
-  set(SYSDIG_CHECKSUM "SHA256=7a775966ed72b239561707b73ac59e8b11a586aee4c5baa6a8c39fd9b8e38f8d")
+  set(SYSDIG_CHECKSUM "SHA256=12541bcf2f3122c3e03bc71e5f39511d679c378d06d7c976527d13901d029410")
 endif()
 set(PROBE_VERSION "${SYSDIG_VERSION}")


Disable optimizations on ppc_macos_10.4.

With optimizations enabled, the compile crashes when building
condor_submit.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -82,7 +82,13 @@
 	if (_DEBUG)
 	  set( CMAKE_BUILD_TYPE Debug )
 	else()
-	  set( CMAKE_BUILD_TYPE RelWithDebInfo ) # = -O2 -g (package will strip the info)
+	  # Using -O2 crashes the compiler on ppc mac os x when compiling
+	  # condor_submit
+	  if ( ${OS_NAME} STREQUAL "DARWIN" AND ${SYS_ARCH} STREQUAL "POWERPC" )
+	    set( CMAKE_BUILD_TYPE RelWithDebInfo ) # = -g (package will strip the info)
+	  else()
+	    set( CMAKE_BUILD_TYPE RelWithDebInfo ) # = -O2 -g (package will strip the info)
+	  endif()
 	endif()

 	set( CMAKE_SUPPRESS_REGENERATION FALSE )


adding missing windowspecific libraries

adding missing windowspecific libraries

--- cmake-modules/FindSDL2.cmake
+++ cmake-modules/FindSDL2.cmake
@@ -149,6 +149,12 @@
 		SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
 	ENDIF(NOT APPLE)

+  IF(WIN32)
+    # https://forums.libsdl.org/viewtopic.php?p=39921
+    MESSAGE(STATUS "Including win32 libraries")
+    SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} version.lib imm32.lib winmm.lib)
+  ENDIF(WIN32)
+
 	# For MinGW library
 	IF(MINGW)
 		SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})


Fixed lib paths for LinkedIn's glib

Fixed lib paths for LinkedIn's glib

--- cmake/Modules/LinkedIn.cmake
+++ cmake/Modules/LinkedIn.cmake
@@ -1,2 +1,15 @@
-set( CMAKE_LIBRARY_PATH /usr/local/lib/wsh/lib )
-set( CMAKE_INCLUDE_PATH /usr/local/lib/wsh/include )
+set( CMAKE_LIBRARY_PATH
+	/usr/lib64/wsh/lib64
+	/usr/lib/wsh/lib
+	/usr/pkg/lib/wsh/lib
+	/usr/local/lib/wsh/lib
+	/usr/local/lib64/wsh/lib64
+)
+
+set( CMAKE_INCLUDE_PATH
+	/usr/lib64/wsh/include
+	/usr/lib/wsh/include
+	/usr/pkg/lib/wsh/include
+	/usr/local/lib/wsh/include
+	/usr/local/lib64/wsh/include
+)


cmake: add generate_test stub + cleanup

cmake: add generate_test stub + cleanup

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -352,6 +352,12 @@
         message(STATUS "Arduino ${ARDUINO_BOARD} Board:")
         print_settings(${ARDUINO_BOARD})
     endif()
+endfunction()
+
+function(GENERATE_TEST INPUT_NAME)
+    message(STATUS "Generating ${INPUT_NAME}")
+
+
 endfunction()

 #=============================================================================#
@@ -1112,17 +1118,18 @@
                                 -P ${ARDUINO_SIZE_SCRIPT}
                         COMMENT "Calculating image size"
                         VERBATIM)
-if (SIZE_TARGETS)
+
     # Create ${TARGET_NAME}-size target
-    add_custom_target(${TARGET_NAME}-size
-                        COMMAND ${CMAKE_COMMAND}
-                                -DFIRMWARE_IMAGE=${TARGET_PATH}.elf
-                                -DMCU=${${BOARD_ID}.build.mcu}
-                                -DEEPROM_IMAGE=${TARGET_PATH}.eep
-                                -P ${ARDUINO_SIZE_SCRIPT}
-                        DEPENDS ${TARGET_NAME}
-                        COMMENT "Calculating ${TARGET_NAME} image size")
-endif()
+    if(SIZE_TARGETS)
+        add_custom_target(${TARGET_NAME}-size
+                            COMMAND ${CMAKE_COMMAND}
+                                    -DFIRMWARE_IMAGE=${TARGET_PATH}.elf
+                                    -DMCU=${${BOARD_ID}.build.mcu}
+                                    -DEEPROM_IMAGE=${TARGET_PATH}.eep
+                                    -P ${ARDUINO_SIZE_SCRIPT}
+                            DEPENDS ${TARGET_NAME}
+                            COMMENT "Calculating ${TARGET_NAME} image size")
+    endif()
 endfunction()

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


build: inline the ICU handling into the CFLAGS handling

Rather than have the ICU handling be pushed down into the library handling, this
will move it into the CFLAGS calulation which was being augmented previously.
It is a cleanup that makes it easier to reason about the flags handling.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -316,6 +316,30 @@
     foreach(path ${${CFLAGS_ARCH}_INCLUDE})
       list(APPEND result "\"${CMAKE_INCLUDE_FLAG_C}${path}\"")
     endforeach()
+  endif()
+
+  set(ICU_UC_INCLUDE_DIR ${SWIFT_${CFLAGS_SDK}_${CFLAGS_ARCH}_ICU_UC_INCLUDE})
+  if(NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "" AND
+     NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "/usr/include" AND
+     NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}/include" AND
+     NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
+   if(SWIFT_COMPILER_IS_MSVC_LIKE)
+     list(APPEND result -I;${ICU_UC_INCLUDE_DIR})
+   else()
+     list(APPEND result -isystem;${ICU_UC_INCLUDE_DIR})
+   endif()
+  endif()
+
+  set(ICU_I18N_INCLUDE_DIR ${SWIFT_${CFLAGS_SDK}_${CFLAGS_ARCH}_ICU_I18N_INCLUDE})
+  if(NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "" AND
+     NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "/usr/include" AND
+     NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}/include" AND
+     NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
+   if(SWIFT_COMPILER_IS_MSVC_LIKE)
+     list(APPEND result -I;${ICU_I18N_INCLUDE_DIR})
+   else()
+     list(APPEND result -isystem;${ICU_I18N_INCLUDE_DIR})
+   endif()
   endif()

   set("${CFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)
@@ -1203,29 +1227,6 @@
     "${SWIFTLIB_SINGLE_FORCE_BUILD_OPTIMIZED_keyword}"
     RESULT_VAR_NAME c_compile_flags
     )
-
-  if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
-    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
-     if(SWIFT_COMPILER_IS_MSVC_LIKE)
-       list(APPEND c_compile_flags -I;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE})
-     else()
-       list(APPEND c_compile_flags -isystem;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE})
-     endif()
-    endif()
-    if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
-       NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
-     if(SWIFT_COMPILER_IS_MSVC_LIKE)
-       list(APPEND c_compile_flags -I;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE})
-     else()
-       list(APPEND c_compile_flags -isystem;${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE})
-     endif()
-    endif()
-  endif()

   if(SWIFTLIB_IS_STDLIB)
     # We don't ever want to link against the ABI-breakage checking symbols


build: correctly check if we are cross-compiling to Windows

The `-sdk` parameter to the swift compiler causes problems when
cross-compiling to Windows on Linux.  Because the host follows the
traditional unix layout but the headers do not correspond to the target
environment, there are conflicting definitions and incorrect definitions
of basic types imported from C.  Ensure that we do not pass the `-sdk`
parameter to allow correctly building the libraries for the target.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -303,7 +303,7 @@
   set(result ${${result_var_name}})

   # On Windows, we don't set SWIFT_SDK_WINDOWS_PATH_ARCH_{ARCH}_PATH, so don't include it.
-  if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+  if (NOT "${sdk}" STREQUAL "WINDOWS")
     list(APPEND result "-sdk" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}")
   endif()


NFC. Documenting Native tablegen dependency

Adding documentation explaining why this dependency is required and should not be removed again.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -125,6 +125,9 @@

   if(LLVM_USE_HOST_TOOLS)
     if( ${${project}_TABLEGEN} STREQUAL "${target}" )
+      # The NATIVE tablegen executable *must* depend on the current target one
+      # otherwise the native one won't get rebuilt when the tablgen sources
+      # change, and we end up with incorrect builds.
       build_native_tool(${target} ${project}_TABLEGEN_EXE DEPENDS ${target})
       set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN_EXE} PARENT_SCOPE)


cmake: create test_interface interface library

Creating a test_interface allows more complex unittest projects to
create additional libraries, for example mock libs, that can be re-used
between test projects.

To support the possibility of such libs to build with same flags as the
testbinary the test_interface is now populated with the public compile
and include flags from testbinary.

testbinary has been updated to use test_interface.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/modules/unittest.cmake
+++ cmake/modules/unittest.cmake
@@ -38,10 +38,12 @@
 endif()

 add_executable(testbinary ${SOURCES})
+add_library(test_interface INTERFACE)
+target_link_libraries(testbinary PRIVATE test_interface)

 set(KOBJ_TYPES_H_TARGET kobj_types_h_target)
 include(${ZEPHYR_BASE}/cmake/kobj.cmake)
-add_dependencies(testbinary ${KOBJ_TYPES_H_TARGET})
+add_dependencies(test_interface ${KOBJ_TYPES_H_TARGET})
 gen_kobj(KOBJ_GEN_DIR)

 list(APPEND INCLUDE
@@ -67,7 +69,7 @@

 endif()

-target_compile_options(testbinary PRIVATE
+target_compile_options(test_interface INTERFACE
   -imacros ${AUTOCONF_H}
   -Wall
   -I ${KOBJ_GEN_DIR}
@@ -86,7 +88,7 @@
   )

 if(COVERAGE)
-  target_compile_options(testbinary PRIVATE
+  target_compile_options(test_interface INTERFACE
     -fno-default-inline
     -fno-inline
     -fprofile-arcs
@@ -116,10 +118,10 @@
       )
 endif()

-target_compile_definitions(testbinary PRIVATE ZTEST_UNITTEST)
+target_compile_definitions(test_interface INTERFACE ZTEST_UNITTEST)

 foreach(inc ${INCLUDE})
-  target_include_directories(testbinary PRIVATE ${ZEPHYR_BASE}/${inc})
+  target_include_directories(test_interface INTERFACE ${ZEPHYR_BASE}/${inc})
 endforeach()

 find_program(VALGRIND_PROGRAM valgrind)


Fix the mac build with the PHP binding Approved: Paul J. Lucas, William Candillon

--- cmake_modules/FindPHP5.cmake
+++ cmake_modules/FindPHP5.cmake
@@ -102,6 +102,8 @@
     __object_init
     __zend_hash_add_or_update
     _php_strtolower
+    _executor_globals
+    _call_user_function
     )
     SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")


Update compiler.cmake

Update compiler.cmake

Fix for clang-cl

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -211,7 +211,9 @@
      endif ()
      string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
              ${MSVC_DISABLED_WARNINGS_LIST})
-     string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+     if (NOT CLANG)
+         string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+     endif ()
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 ${MSVC_DISABLED_WARNINGS_STR}")

      message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")


Try to make odbc cmake script windows compatible

--- cmake_scripts/Findodbc.cmake
+++ cmake_scripts/Findodbc.cmake
@@ -1,36 +1,39 @@
 # This script provides include and link directories for unixODBC
+if( WIN32 )
+    set(Odbc_LIBRARIES odbc32)
+else()
+    message(STATUS "Detecting unixODBC library")

-message(STATUS "Detecting unixODBC library")
+    find_path(
+        Odbc_INCLUDE_DIR
+        sql.h
+        HINTS
+            ENV UNIXODBC_INCLUDE_DIR

-find_path(
-    Odbc_INCLUDE_DIR
-    sql.h
-    HINTS
-        ENV UNIXODBC_INCLUDE_DIR
-
-    DOC "Path to the unixODBC headers"
-)
+        DOC "Path to the unixODBC headers"
+    )

-if("${Odbc_INCLUDE_DIR}" STREQUAL "Odbc_INCLUDE_DIR-NOTFOUND")
-    message(SEND_ERROR " Could not find unixODBC header files")
-else()
-    message(STATUS "  Found header files at: ${Odbc_INCLUDE_DIR}")
-endif()
+    if("${Odbc_INCLUDE_DIR}" STREQUAL "Odbc_INCLUDE_DIR-NOTFOUND")
+        message(SEND_ERROR " Could not find unixODBC header files")
+    else()
+        message(STATUS "  Found header files at: ${Odbc_INCLUDE_DIR}")
+    endif()

-find_library(
-    Odbc_LIBRARIES
-    odbc
-    HINTS
-        ENV UNIXODBC_LIB_DIR
-
-    DOC "The unixODBC library"
-)
+    find_library(
+        Odbc_LIBRARIES
+        odbc
+        HINTS
+            ENV UNIXODBC_LIB_DIR

-if("${Odbc_LIBRARIES}" STREQUAL "Odbc_LIBRARIES-NOTFOUND")
-    message(FATAL_ERROR " Could not find unixODBC library")
-else()
-    message(STATUS "  Found library at: ${Odbc_LIBRARIES}")
-endif()
+        DOC "The unixODBC library"
+    )

-get_filename_component(Odbc_LIBRARY_DIRS "${Odbc_LIBRARIES}" PATH)
+    if("${Odbc_LIBRARIES}" STREQUAL "Odbc_LIBRARIES-NOTFOUND")
+        message(FATAL_ERROR " Could not find unixODBC library")
+    else()
+        message(STATUS "  Found library at: ${Odbc_LIBRARIES}")
+    endif()
+
+    get_filename_component(Odbc_LIBRARY_DIRS "${Odbc_LIBRARIES}" PATH)
+endif()


M: remove setting BOOST_ROOT from finddeps.cmake

--- cmake_support/FindDeps.cmake
+++ cmake_support/FindDeps.cmake
@@ -6,10 +6,7 @@
             add_definitions( -DBOOST_THREAD_USE_LIB )
         endif(MINGW)
 endif(WIN32)
-if(NOT DEFINED BOOST_ROOT)
-    set(BOOST_ROOT ${REAPING2_DEPS_INSTALL_DIR})
-    set(Boost_ADDITIONAL_VERSIONS 1.59 1.60)
-endif()
+set(Boost_ADDITIONAL_VERSIONS 1.59 1.60)
 find_package( Boost 1.59 COMPONENTS filesystem system thread date_time program_options atomic serialization chrono )

 if( NOT Boost_FOUND )


Fix linux build

Fix linux build

--- modules/nanomsg.cmake
+++ modules/nanomsg.cmake
@@ -7,7 +7,7 @@

   # Setup new compiler flags
   if(NOT MSVC)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wstrict-aliasing=n")
+    set(CMAKE_C_FLAGS "")
     message(${CMAKE_C_FLAGS})
   else()
     # Disable some compile warnings


fix for macOS

fix for macOS

--- components/ospcommon/cmake/macros.cmake
+++ components/ospcommon/cmake/macros.cmake
@@ -364,7 +364,8 @@
   elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
     set(OSPRAY_COMPILER_GCC TRUE)
     include(gcc)
-  elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
+  elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR
+          ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
     set(OSPRAY_COMPILER_CLANG TRUE)
     include(clang)
   elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")


Modify CheckCXXLibraryExists to use CMakeFiles directory.

--- cmake/CheckCXXLibraryExists.cmake
+++ cmake/CheckCXXLibraryExists.cmake
@@ -50,10 +50,10 @@
         ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
     endif()
     configure_file(${CMAKE_ROOT}/Modules/CheckFunctionExists.c
-                   ${CMAKE_BINARY_DIR}/CheckFunctionExists.cxx COPYONLY)
+                   ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cxx COPYONLY)
     try_compile(${VARIABLE}
       ${CMAKE_BINARY_DIR}
-      ${CMAKE_BINARY_DIR}/CheckFunctionExists.cxx
+      ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckFunctionExists.cxx
       COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
       LINK_LIBRARIES ${CHECK_LIBRARY_EXISTS_LIBRARIES}
       CMAKE_FLAGS


[CMake] Provide an option to use relative paths in debug info

CMake always uses absolute file paths in the generated compiler
invocation which results in absolute file paths being embedded in debug
info. This is undesirable when building a toolchain e.g. on bots as the
debug info may embed the bot source checkout path which is meaningless
anywhere else.

This change introduces the LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO which uses
-fdebug-prefix-map (where supported) options to rewrite paths embedded
into debug info with relative ones. Additionally, LLVM_SOURCE_PREFIX can
be used to override the path to source directory with a different one.

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

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

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -15,6 +15,7 @@
 set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
 set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
 set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
+set(LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO ON CACHE BOOL "")

 set(CLANG_DEFAULT_CXX_STDLIB libc++ CACHE STRING "")
 if(NOT APPLE)


[cmake] Allow C++20, fwiw given llvm9.

[cmake] Allow C++20, fwiw given llvm9.

--- cmake/modules/CheckCompiler.cmake
+++ cmake/modules/CheckCompiler.cmake
@@ -166,7 +166,7 @@
   unset(cxx11 CACHE)
 endif()

-if(NOT CMAKE_CXX_STANDARD MATCHES "11|14|17")
+if(NOT CMAKE_CXX_STANDARD MATCHES "11|14|17|20")
   message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
 endif()


Add back lldb-framework-headers target

Add back lldb-framework-headers target

In r338058 we removed the target `lldb-framework-headers`, which mean
lldb-framework no longer depended on `framework_headers`, so they never
actually got generated. This is a partial revert of r338058: I added
back the lldb-framework-headers target, but the framework-header-fix.sh
script still runs on the copied headers.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338074 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -12,6 +12,8 @@
                      COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
   list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
 endforeach()
+
+add_custom_target(lldb-framework-headers DEPENDS ${framework_headers})

 add_custom_command(TARGET lldb-framework POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
@@ -38,4 +40,5 @@
   PUBLIC_HEADER "${framework_headers}")

 add_dependencies(lldb-framework
+  lldb-framework-headers
   lldb-suite)


Added protection for ROOT-5428

Added protection for ROOT-5428

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -536,11 +536,13 @@
 #---ROOT_CHECK_OUT_OF_SOURCE_BUILD( )
 #---------------------------------------------------------------------------------------------------
 macro(ROOT_CHECK_OUT_OF_SOURCE_BUILD)
- string(COMPARE EQUAL ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} insource)
-  if(insource)
+  get_filename_component(bindir_parent ${CMAKE_BINARY_DIR} PATH)
+  if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
      file(REMOVE_RECURSE ${CMAKE_SOURCE_DIR}/Testing)
      file(REMOVE ${CMAKE_SOURCE_DIR}/DartConfiguration.tcl)
-     message(FATAL_ERROR "ROOT should be installed as an out of source build, to keep the source directory clean. Please create a extra build directory and run the command 'cmake <path_to_source_dir>' in this newly created directory. You have also to delete the directory CMakeFiles and the file CMakeCache.txt in the source directory. Otherwise cmake will complain even if you run it from an out-of-source directory.")
+     message(FATAL_ERROR "ROOT should be built as an out of source build, to keep the source directory clean. Please create a extra build directory and run the command 'cmake <path_to_source_dir>' in this newly created directory. You have also to delete the directory CMakeFiles and the file CMakeCache.txt in the source directory. Otherwise cmake will complain even if you run it from an out-of-source directory.")
+  elseif(IS_SYMLINK ${CMAKE_BINARY_DIR} AND CMAKE_SOURCE_DIR STREQUAL bindir_parent)
+     message(FATAL_ERROR "ROOT cannot be built from a sub-directory of the source tree that is a symlink. This is a current limitation of CMake. Please create a real build directory and run the command 'cmake <path_to_source_dir>' in this newly created directory.")
   endif()
 endmacro()


Attempt to fix issue#17. Find EGL shared lib explicitly.

--- Source/CMake/Modules/FindBCM_VC.cmake
+++ Source/CMake/Modules/FindBCM_VC.cmake
@@ -38,12 +38,13 @@
     find_path (BCM_VC_INCLUDE_DIR bcm_host.h ${BCM_VC_INC_SEARCH_PATH})

     # Assume all the other libs are installed at the same relative path as libbcm_host.so
-    find_library (BCM_VC_LIB_BCM_HOST bcm_host ${BCM_VC_LIB_SEARCH_PATH})
-    find_library (BCM_VC_LIB_GLES2 GLESv2 ${BCM_VC_LIB_SEARCH_PATH})
+    find_library (BCM_VC_LIB_BCM_HOST bcm_host PATHS ${BCM_VC_LIB_SEARCH_PATH} PATH_SUFFIXES vc)
+    find_library (BCM_VC_LIB_EGL EGL PATHS ${BCM_VC_LIB_SEARCH_PATH} PATH_SUFFIXES vc)
+    find_library (BCM_VC_LIB_GLES2 GLESv2 PATHS ${BCM_VC_LIB_SEARCH_PATH} PATH_SUFFIXES vc)

-    if (BCM_VC_INCLUDE_DIR AND BCM_VC_LIB_BCM_HOST AND BCM_VC_LIB_GLES2)
+    if (BCM_VC_INCLUDE_DIR AND BCM_VC_LIB_BCM_HOST AND BCM_VC_LIB_EGL AND BCM_VC_LIB_GLES2)
         set (BCM_VC_INCLUDE_DIR ${BCM_VC_INCLUDE_DIR} ${BCM_VC_INCLUDE_DIR}/interface/vcos/pthreads)
-        set (BCM_VC_LIBRARIES ${BCM_VC_LIB_BCM_HOST} ${BCM_VC_LIB_GLES2})
+        set (BCM_VC_LIBRARIES ${BCM_VC_LIB_BCM_HOST} ${BCM_VC_LIB_EGL} ${BCM_VC_LIB_GLES2})
         set (BCM_VC_FOUND 1)
     endif ()


SuperBuild: make sure shark library goes to install/lib

--- SuperBuild/CMake/External_shark.cmake
+++ SuperBuild/CMake/External_shark.cmake
@@ -45,6 +45,7 @@
   -DENABLE_HDF5:BOOL=OFF
   -DENABLE_CBLAS:BOOL=OFF
   -DENABLE_OPENMP:BOOL=${OTB_USE_OPENMP}
+  -DSHARK_INSTALL_LIB_DIR:STRING=lib/
   ${SHARK_SB_CONFIG}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}
   LOG_DOWNLOAD 1


Delete cmake_install.cmake

Delete cmake_install.cmake

--- examples/myCodes/test/cmake_install.cmake
+++ examples/myCodes/test/cmake_install.cmake
@@ -1,44 +0,0 @@
-# Install script for directory: /home/lisa/Desktop/dealii/examples/myCodes/test
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "Debug")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-# Install shared libraries without execute permission?
-IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  SET(CMAKE_INSTALL_SO_NO_EXE "1")
-ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-
-IF(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-ELSE(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-ENDIF(CMAKE_INSTALL_COMPONENT)
-
-FILE(WRITE "/home/lisa/Desktop/dealii/examples/myCodes/test/${CMAKE_INSTALL_MANIFEST}" "")
-FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/home/lisa/Desktop/dealii/examples/myCodes/test/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-ENDFOREACH(file)


Disable OpenPhySyn Submodule Installation

--- src/OpenPhySyn/cmake/Transforms.cmake
+++ src/OpenPhySyn/cmake/Transforms.cmake
@@ -39,40 +39,60 @@

 if (${OPENPHYSYN_TRANSFORM_HELLO_TRANSFORM_ENABLED})
 add_subdirectory(src/StandardTransforms/HelloTransform)
+
+if(NOT ${OPENPHYSYN_TRANSFORM_AUTO_LINK_TRANSFORMS})
 install(
   TARGETS hello_transform
   DESTINATION ${PSN_TRANSFORM_INSTALL_PATH}
 )
 endif()

+endif()
+
 if (${OPENPHYSYN_TRANSFORM_BUFFER_FANOUT_ENABLED})
 add_subdirectory(src/StandardTransforms/BufferFanoutTransform)
+
+if(NOT ${OPENPHYSYN_TRANSFORM_AUTO_LINK_TRANSFORMS})
 install(
   TARGETS buffer_fanout
   DESTINATION ${PSN_TRANSFORM_INSTALL_PATH}
 )
 endif()

+endif()
+
 if (${OPENPHYSYN_TRANSFORM_GATE_CLONE_ENABLED})
 add_subdirectory(src/StandardTransforms/GateCloningTransform)
+
+if(NOT ${OPENPHYSYN_TRANSFORM_AUTO_LINK_TRANSFORMS})
 install(
   TARGETS gate_clone
   DESTINATION ${PSN_TRANSFORM_INSTALL_PATH}
 )
 endif()

+endif()
+
 if (${OPENPHYSYN_TRANSFORM_PIN_SWAP_ENABLED})
 add_subdirectory(src/StandardTransforms/PinSwapTransform)
+
+if(NOT ${OPENPHYSYN_TRANSFORM_AUTO_LINK_TRANSFORMS})
 install(
   TARGETS pin_swap
   DESTINATION ${PSN_TRANSFORM_INSTALL_PATH}
 )
 endif()

+endif()
+
 if (${OPENPHYSYN_TRANSFORM_CONSTANT_PROPAGATION_ENABLED})
 add_subdirectory(src/StandardTransforms/ConstantPropagationTransform)
+
+if(NOT ${OPENPHYSYN_TRANSFORM_AUTO_LINK_TRANSFORMS})
 install(
   TARGETS constant_propagation
   DESTINATION ${PSN_TRANSFORM_INSTALL_PATH}
 )
+endif()
+
 endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- ITK/Utilities/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ ITK/Utilities/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   10)
+SET(KWSYS_DATE_STAMP_DAY   11)


ENH: display ITK version in cmake configuration when building with external ITK

--- CMake/ImportITK.cmake
+++ CMake/ImportITK.cmake
@@ -32,7 +32,7 @@
   # Build shared libraries for otb
   # By default, if otb use an external itk import the option from the ITK configuration
   set(BUILD_SHARED_LIBS ${ITK_BUILD_SHARED})
-  message(STATUS "  Using ITK external version")
+  message(STATUS "  Using ITK external version " ${ITK_VERSION})

 else()


Fix working dir for XMOD

Fix working dir for XMOD

--- test/claw_reference_test.cmake
+++ test/claw_reference_test.cmake
@@ -55,8 +55,8 @@
   set(executable_transformed transformed_code_${claw_add_basic_test_NAME})

   # Define directory for build
-  set(XMOD_DIR "${CMAKE_CURRENT_BINARY_DIR}/__xmod__")
-  set(OMNI_TMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/__omni_tmp__")
+  set(XMOD_DIR "${claw_add_basic_test_WORKING_DIRECTORY}/__xmod__")
+  set(OMNI_TMP_DIR "${claw_add_basic_test_WORKING_DIRECTORY}/__omni_tmp__")

   # Directory where OMNI Compiler xmod files will be placed
   if (NOT EXISTS ${XMOD_DIR})


haskell-build-fixes: fix argument name

haskell-build-fixes: fix argument name

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -243,7 +243,7 @@
 	# compile or install anything
 	execute_process (COMMAND ${CABAL_EXECUTABLE} sandbox init --sandbox "${HASKELL_SHARED_SANDBOX}" -v0
 			 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-	foreach (SANDBOX_ADD_SOURCE ${SANDBOX_ADD_SOURCES})
+	foreach (SANDBOX_ADD_SOURCE ${ARG_SANDBOX_ADD_SOURCES})

 		# our custom libs are all to be processed by cmake before we can add them, so enforce that,
 		# the build is more stable this way


Improve CMake-based bootstrapper

Improve CMake-based bootstrapper

--- bootstrap/windows.cmake
+++ bootstrap/windows.cmake
@@ -1,32 +1,47 @@
 cmake_minimum_required(VERSION 3.3)

-string(REPLACE "," ";" PACKAGES ${BUILD})
+string(REPLACE "," ";" PACKAGES "${BUILD}")
 set(BUILD_DIR ${CMAKE_BINARY_DIR}/build)
 set(CACHE_DIR ${CMAKE_BINARY_DIR}/cache)
 set(GENERATOR "Visual Studio 15 2017 Win64")

-function(y_download _url _sha1)
+function(y_cmake _dir)
+  cmake_parse_arguments(_arg "" "" "OPTIONS" ${ARGN})
+  execute_process(COMMAND ${CMAKE_COMMAND} -G ${GENERATOR} ${BUILD_DIR}/${_dir} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} ${_arg_OPTIONS}
+    WORKING_DIRECTORY ${BUILD_DIR}/${_dir})
+  execute_process(COMMAND ${CMAKE_COMMAND} --build ${BUILD_DIR}/${_dir} --config Release --target INSTALL -- /nologo /verbosity:minimal
+    WORKING_DIRECTORY ${BUILD_DIR}/${_dir})
+endfunction()
+
+function(y_download _url)
+  cmake_parse_arguments(_arg "" "SHA1" "" ${ARGN})
   string(REGEX REPLACE "^.*/([^/]+)$" "\\1" _name ${_url})
-  message(STATUS "Downloading ${_name}")
+  message(STATUS "Downloading: ${_name}")
   set(_path ${CACHE_DIR}/${_name})
   if(EXISTS ${_path})
-    file(SHA1 ${_path} _existing_sha1)
-    if(${_sha1} STREQUAL ${_existing_sha1})
-      return()
+    if(_arg_SHA1)
+      file(SHA1 ${_path} _existing_sha1)
+      if(${_arg_SHA1} STREQUAL ${_existing_sha1})
+        return()
+      endif()
     endif()
     file(REMOVE ${_path})
   endif()
-  file(DOWNLOAD ${_url} ${_path} TLS_VERIFY ON EXPECTED_HASH SHA1=${_sha1})
+  if(_arg_SHA1)
+    file(DOWNLOAD ${_url} ${_path} TLS_VERIFY ON EXPECTED_HASH SHA1=${_arg_SHA1})
+  else()
+    file(DOWNLOAD ${_url} ${_path} TLS_VERIFY ON)
+  endif()
 endfunction()

 function(y_extract _name)
   file(MAKE_DIRECTORY ${BUILD_DIR})
   cmake_parse_arguments(_arg "" "DIR" "" ${ARGN})
   if(_arg_DIR AND EXISTS ${BUILD_DIR}/${_arg_DIR})
-    message(STATUS "Removing ${_arg_DIR}")
+    message(STATUS "Removing: ${_arg_DIR}")
     file(REMOVE_RECURSE ${_arg_DIR})
   endif()
-  message(STATUS "Extracting ${_name}")
+  message(STATUS "Extracting: ${_name}")
   execute_process(COMMAND ${CMAKE_COMMAND} -E tar xz ${CACHE_DIR}/${_name} WORKING_DIRECTORY ${BUILD_DIR})
 endfunction()

@@ -65,37 +80,49 @@
 y_package(zlib)

 if("nasm" IN_LIST _y_packages)
-  y_download("https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/win64/nasm-2.13.03-win64.zip" "149a814fa53980976a7fc081231f59cfbcd02543")
-  y_extract("nasm-2.13.03-win64.zip" DIR "nasm-2.13.03")
-  file(INSTALL ${BUILD_DIR}/nasm-2.13.03/nasm.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
+  set(_version "2.13.03")
+  y_download("https://www.nasm.us/pub/nasm/releasebuilds/${_version}/win64/nasm-${_version}-win64.zip" SHA1 "149a814fa53980976a7fc081231f59cfbcd02543")
+  y_extract("nasm-${_version}-win64.zip" DIR "nasm-${_version}")
+  file(INSTALL ${BUILD_DIR}/nasm-${_version}/nasm.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
 endif()

 if("openal" IN_LIST _y_packages)
-  y_download("https://openal.org/downloads/oalinst.zip" "45e08368c6755c58902b7746ff3e51ad2df8a8b8")
-  y_download("http://openal-soft.org/openal-binaries/openal-soft-1.18.2-bin.zip" "0d2edd1b77cbb998f12e064d0eefea3508446776")
-  y_extract("openal-soft-1.18.2-bin.zip")
-  file(INSTALL ${BUILD_DIR}/openal-soft-1.18.2-bin/include DESTINATION ${CMAKE_BINARY_DIR})
-  file(INSTALL ${BUILD_DIR}/openal-soft-1.18.2-bin/libs DESTINATION ${CMAKE_BINARY_DIR})
+  set(_version "1.18.2")
+  y_download("http://openal-soft.org/openal-binaries/openal-soft-${_version}-bin.zip" SHA1 "0d2edd1b77cbb998f12e064d0eefea3508446776")
+  y_download("https://openal.org/downloads/oalinst.zip" SHA1 "45e08368c6755c58902b7746ff3e51ad2df8a8b8")
+  y_extract("openal-soft-${_version}-bin.zip")
+  file(INSTALL ${BUILD_DIR}/openal-soft-${_version}-bin/include DESTINATION ${CMAKE_BINARY_DIR})
+  file(INSTALL ${BUILD_DIR}/openal-soft-${_version}-bin/libs DESTINATION ${CMAKE_BINARY_DIR})
   y_extract("oalinst.zip")
   execute_process(COMMAND ${BUILD_DIR}/oalinst.exe /s)
 endif()

+if("opengl" IN_LIST _y_packages)
+  y_download("https://khronos.org/registry/OpenGL/api/GL/glext.h")
+  y_download("https://khronos.org/registry/OpenGL/api/GL/wglext.h")
+  y_download("https://khronos.org/registry/EGL/api/KHR/khrplatform.h")
+  file(INSTALL ${CACHE_DIR}/glext.h DESTINATION ${CMAKE_BINARY_DIR}/include/GL)
+  file(INSTALL ${CACHE_DIR}/wglext.h DESTINATION ${CMAKE_BINARY_DIR}/include/GL)
+  file(INSTALL ${CACHE_DIR}/khrplatform.h DESTINATION ${CMAKE_BINARY_DIR}/include/KHR)
+endif()
+
 if("zlib" IN_LIST _y_packages)
-  y_download("https://zlib.net/zlib-1.2.11.tar.xz" "e1cb0d5c92da8e9a8c2635dfa249c341dfd00322")
-  y_extract("zlib-1.2.11.tar.xz" DIR "zlib-1.2.11")
-  set(_dir ${BUILD_DIR}/zlib-1.2.11)
-  execute_process(COMMAND ${CMAKE_COMMAND} -G ${GENERATOR} ${_dir} -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR} -DSKIP_INSTALL_FILES=ON
-    WORKING_DIRECTORY ${_dir})
-  execute_process(COMMAND ${CMAKE_COMMAND} --build ${_dir} --config Release --target INSTALL -- /nologo /verbosity:minimal
-    WORKING_DIRECTORY ${_dir})
+  set(_version "1.2.11")
+  y_download("https://zlib.net/zlib-${_version}.tar.xz" SHA1 "e1cb0d5c92da8e9a8c2635dfa249c341dfd00322")
+  y_extract("zlib-${_version}.tar.xz" DIR "zlib-${_version}")
+  y_cmake("zlib-${_version}" OPTIONS -DSKIP_INSTALL_FILES=ON)
 endif()

 if("libjpeg" IN_LIST _y_packages)
-  y_download("https://downloads.sourceforge.net/project/libjpeg-turbo/1.5.3/libjpeg-turbo-1.5.3.tar.gz" "87ebf4cab2bb27fcb8e7ccb18ec4eb680e1f2c2d")
-  y_extract("libjpeg-turbo-1.5.3.tar.gz" DIR "libjpeg-turbo-1.5.3")
+  set(_version "1.5.3")
+  y_download("https://downloads.sourceforge.net/project/libjpeg-turbo/${_version}/libjpeg-turbo-${_version}.tar.gz" SHA1 "87ebf4cab2bb27fcb8e7ccb18ec4eb680e1f2c2d")
+  y_extract("libjpeg-turbo-${_version}.tar.gz" DIR "libjpeg-turbo-${_version}")
+  y_cmake("libjpeg-turbo-${_version}" OPTIONS -DWITH_TURBOJPEG=OFF)
 endif()

 if("libpng" IN_LIST _y_packages)
-  y_download("https://downloads.sourceforge.net/project/libpng/libpng16/1.6.35/libpng-1.6.35.tar.xz" "0df1561aa1da610e892239348970d574b14deed0")
-  y_extract("libpng-1.6.35.tar.xz" DIR "libpng-1.6.35")
+  set(_version "1.6.35")
+  y_download("https://downloads.sourceforge.net/project/libpng/libpng16/${_version}/libpng-${_version}.tar.xz" SHA1 "0df1561aa1da610e892239348970d574b14deed0")
+  y_extract("libpng-${_version}.tar.xz" DIR "libpng-${_version}")
+  y_cmake("libpng-${_version}" OPTIONS -DPNG_TESTS=OFF -DSKIP_INSTALL_EXECUTABLES=ON -DSKIP_INSTALL_EXPORT=ON -DSKIP_INSTALL_FILES=ON -DSKIP_INSTALL_PROGRAMS=ON)
 endif()


cmake-rust: merge two RustStaticLibrary.cmake and add feature support

Summary:
We somehow have two different RustStaticLibrary.cmake in different places (one in eden repo and the other one in the shared opensource builder).

This diff merges them and switches Eden into using the shared CMake function (for the features option).

This diff also adds the features option for rust_executable funciton, which will be used in the next diff.

Reviewed By: kmancini

Differential Revision: D39038491

fbshipit-source-id: 99d61a1d5450010b345107a9ec5c761b62004aa6

--- build/fbcode_builder/CMake/RustStaticLibrary.cmake
+++ build/fbcode_builder/CMake/RustStaticLibrary.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) Facebook, Inc. and its affiliates.
+# Copyright (c) Meta Platforms, Inc. and affiliates.

 include(FBCMakeParseArgs)

@@ -26,7 +26,7 @@

 if("${GENERATE_CARGO_VENDOR_CONFIG}" STREQUAL "AUTO")
   set(GENERATE_CARGO_VENDOR_CONFIG "${USE_CARGO_VENDOR}")
-endif()
+endif()

 if(GENERATE_CARGO_VENDOR_CONFIG)
   if(NOT EXISTS "${RUST_VENDORED_CRATES_DIR}")
@@ -78,7 +78,7 @@
 # Cargo build static library.
 #
 # ```cmake
-# rust_static_library(<TARGET> [CRATE <CRATE_NAME>])
+# rust_static_library(<TARGET> [CRATE <CRATE_NAME>] [FEATURES <FEATURE_NAME>])
 # ```
 #
 # Parameters:
@@ -88,6 +88,8 @@
 # - CRATE_NAME:
 #   Name of the crate. This parameter is optional. If unspecified, it will
 #   fallback to `${TARGET}`.
+# - FEATURE_NAME:
+#   Name of the Rust feature to enable.
 #
 # This function creates two targets:
 # - "${TARGET}": an interface library target contains the static library built
@@ -99,12 +101,17 @@
 # headers with the interface library.
 #
 function(rust_static_library TARGET)
-  fb_cmake_parse_args(ARG "" "CRATE" "" "${ARGN}")
+  fb_cmake_parse_args(ARG "" "CRATE;FEATURES" "" "${ARGN}")

   if(DEFINED ARG_CRATE)
     set(crate_name "${ARG_CRATE}")
   else()
     set(crate_name "${TARGET}")
+  endif()
+  if(DEFINED ARG_FEATURES)
+    set(features --features ${ARG_FEATURES})
+  else()
+    set(features )
   endif()

   set(cargo_target "${TARGET}.cargo")
@@ -117,7 +124,11 @@
     set(cargo_cmd cargo.exe)
   endif()

-  set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  if(DEFINED ARG_FEATURES)
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
+  else()
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  endif()
   if(USE_CARGO_VENDOR)
     set(extra_cargo_env "CARGO_HOME=${RUST_CARGO_HOME}")
     set(cargo_flags ${cargo_flags})
@@ -156,16 +167,18 @@
   )
 endfunction()

-# This function instructs cmake to define a target that will use `cargo build`
+# This function instructs CMake to define a target that will use `cargo build`
 # to build a bin crate referenced by the Cargo.toml file in the current source
 # directory.
 # It accepts a single `TARGET` parameter which will be passed as the package
 # name to `cargo build -p TARGET`. If binary has different name as package,
 # use optional flag BINARY_NAME to override it.
-# The cmake target will be registered to build by default as part of the
+# It also accepts a `FEATURES` parameter if you want to enable certain features
+# in your Rust binary.
+# The CMake target will be registered to build by default as part of the
 # ALL target.
 function(rust_executable TARGET)
-  fb_cmake_parse_args(ARG "" "BINARY_NAME" "" "${ARGN}")
+  fb_cmake_parse_args(ARG "" "BINARY_NAME;FEATURES" "" "${ARGN}")

   set(crate_name "${TARGET}")
   set(cargo_target "${TARGET}.cargo")
@@ -174,7 +187,12 @@
   if(DEFINED ARG_BINARY_NAME)
     set(executable_name "${ARG_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
   else()
-      set(executable_name "${crate_name}${CMAKE_EXECUTABLE_SUFFIX}")
+    set(executable_name "${crate_name}${CMAKE_EXECUTABLE_SUFFIX}")
+  endif()
+  if(DEFINED ARG_FEATURES)
+    set(features --features ${ARG_FEATURES})
+  else()
+    set(features )
   endif()

   set(cargo_cmd cargo)
@@ -182,7 +200,11 @@
     set(cargo_cmd cargo.exe)
   endif()

-  set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  if(DEFINED ARG_FEATURES)
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
+  else()
+    set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name})
+  endif()
   if(USE_CARGO_VENDOR)
     set(extra_cargo_env "CARGO_HOME=${RUST_CARGO_HOME}")
     set(cargo_flags ${cargo_flags})


ctest: nicer capitalization MinGW (as on 0.7 branch)

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -154,7 +154,7 @@
    set(compiler "Open64")
 elseif(COMPILER_VERSION MATCHES "g\\+\\+" OR COMPILER_VERSION_COMPLETE MATCHES "Free Software Foundation, Inc.")
    if(WIN32)
-      set(compiler "mingw")
+      set(compiler "MinGW")
    else()
       set(compiler "GCC")
    endif()
@@ -193,7 +193,7 @@
 	 set(CMAKE_MAKE_PROGRAM "nmake")
 	 set(MAKE_ARGS "-I")
       endif()
-   elseif("${compiler}" STREQUAL "mingw")
+   elseif("${compiler}" STREQUAL "MinGW")
       set(CTEST_CMAKE_GENERATOR "MSYS Makefiles")
       set(CMAKE_MAKE_PROGRAM "make")
    else()


hunter_process_dependency_node: use hunter_create_dependency_entry

--- cmake/modules/hunter_process_dependency_node.cmake
+++ cmake/modules/hunter_process_dependency_node.cmake
@@ -3,6 +3,7 @@

 include(CMakeParseArguments) # cmake_parse_arguments

+include(hunter_create_dependency_entry)
 include(hunter_internal_error)
 include(hunter_test_string_not_empty)

@@ -33,21 +34,11 @@
     hunter_internal_error("Unparsed: ${x_UNPARSED_ARGUMENTS}")
   endif()

-  set(top_dir "${HUNTER_TOOLCHAIN_ID_PATH}/Build")
-
-  set(dep_dir "${top_dir}/${x_PACKAGE}")
+  set(dep_dir "${HUNTER_TOOLCHAIN_ID_PATH}/Build/${x_PACKAGE}")
   if(has_component)
     set(dep_dir "${dep_dir}/__${x_COMPONENT}")
   endif()
-  set(cache_file "${dep_dir}/cache.sha1")
   set(dep_dir "${dep_dir}/Dependencies")
-
-  if(NOT EXISTS "${cache_file}")
-    hunter_fatal_error(
-        "Not found: ${cache_file}" WIKI "error.cache.file.not.found"
-    )
-  endif()
-  file(READ "${cache_file}" x_SHA1)

   set(package_dependencies "")
   set(depends_all "")
@@ -62,34 +53,25 @@
       # format: <package> <sha1>
       list(GET curr_dep_dir 0 package)
       set(component "")
-      set(curr_has_component FALSE)
     else()
       # format: <package> <component> <sha1>
       list(GET curr_dep_dir 0 package)
       list(GET curr_dep_dir 1 component)
-      set(curr_has_component TRUE)
     else()
       hunter_internal_error("Incorrect directory")
     endif()

-    set(cache_file "${top_dir}/${package}")
-    if(curr_has_component)
-      set(cache_file "${top_dir}/${package}/__${component}")
-    endif()
-    set(cache_file "${cache_file}/cache.sha1")
-
-    if(NOT EXISTS "${cache_file}")
+    hunter_create_dependency_entry(
+        PACKAGE "${package}" COMPONENT "${component}" RESULT current_item
+    )
+    if(current_item STREQUAL "")
       hunter_fatal_error(
-          "Not found: ${cache_file}" WIKI "error.cache.file.not.found"
+          "Cache not found: ${package}/${component}"
+          WIKI "error.cache.file.not.found"
       )
     endif()
-    file(READ "${cache_file}" cache_sha1)

-    if(curr_has_component)
-      list(APPEND package_dependencies "${package} ${component} ${cache_sha1}")
-    else()
-      list(APPEND package_dependencies "${package} ${cache_sha1}")
-    endif()
+    list(APPEND package_dependencies ${current_item})

     hunter_process_dependency_node(
         PACKAGE "${package}"
@@ -108,10 +90,14 @@

   list(REMOVE_ITEM package_dependencies ${x_READY} "")

-  if(has_component)
-    set(this_item "${x_PACKAGE} ${x_COMPONENT} ${x_SHA1}")
-  else()
-    set(this_item "${x_PACKAGE} ${x_SHA1}")
+  hunter_create_dependency_entry(
+      PACKAGE "${x_PACKAGE}" COMPONENT "${x_COMPONENT}" RESULT this_item
+  )
+  if(this_item STREQUAL "")
+    hunter_fatal_error(
+        "Cache not found: ${x_PACKAGE}/${x_COMPONENT}"
+        WIKI "error.cache.file.not.found"
+    )
   endif()

   list(LENGTH package_dependencies dep_len)


Fix haka-test-fix file for pcap

Fix haka-test-fix file for pcap

--- build/TestPcapRun.cmake
+++ build/TestPcapRun.cmake
@@ -78,7 +78,7 @@
 	message("Generated pcap file is ${CMAKE_CURRENT_SOURCE_DIR}/${DST}.pcap")
 	message("Original pcap file is ${REFPCAP}")
 	if(HAD_ERROR)
-		if(ENV{HAKA_TEST_FIX})
+		if(NOT "$ENV{HAKA_TEST_FIX}" STREQUAL "")
 			execute_process(COMMAND echo cp ${CMAKE_CURRENT_SOURCE_DIR}/${DST}.pcap ${REFPCAP} OUTPUT_FILE $ENV{HAKA_TEST_FIX})
 		endif()
 		message(FATAL_ERROR "Pcap different")


[windows] remove redundant .bat

[windows] remove redundant .bat

--- ament_cmake_export_libraries/ament_cmake_export_libraries-extras.cmake
+++ ament_cmake_export_libraries/ament_cmake_export_libraries-extras.cmake
@@ -13,7 +13,7 @@
       set(_ext .sh)
     endif()
     ament_environment_hooks(
-      "${ament_cmake_export_libraries_DIR}/environment/library_path.bat${_ext}")
+      "${ament_cmake_export_libraries_DIR}/environment/library_path${_ext}")
     unset(_ext)
   endif()
 endmacro()


Be somewhat more verbose

Be somewhat more verbose

--- Buildyard.cmake
+++ Buildyard.cmake
@@ -32,7 +32,7 @@
 add_subdirectory("${CMAKE_BINARY_DIR}/Buildyard" # source
   "${CMAKE_BINARY_DIR}/Buildyard.bin" )          # binary
 if(MSVC)
-  message(STATUS "Build 00_Main->${CMAKE_PROJECT_NAME} to bootstrap and TBD after bootstrap")
+  message(STATUS "Build 00_Main->${CMAKE_PROJECT_NAME} to bootstrap and TBD after bootstrap\n")
 else()
-  message(STATUS "Use 'make -jN' to bootstrap and 'make -jN buildall' after bootstrap")
+  message(STATUS "Use 'make -jN' to bootstrap and 'make -jN buildall' after bootstrap\n")
 endif()


Give FindMEDFile a path hint so that it works with the standard Fedora 28 med-devel package.

--- cMake/FindMEDFile.cmake
+++ cMake/FindMEDFile.cmake
@@ -40,7 +40,7 @@
   LIST(APPEND CMAKE_PREFIX_PATH "${MEDFILE_ROOT_DIR}")
 ENDIF(MEDFILE_ROOT_DIR)

-FIND_PATH(MEDFILE_INCLUDE_DIRS med.h)
+FIND_PATH(MEDFILE_INCLUDE_DIRS med.h PATH_SUFFIXES med)
 #FIND_PROGRAM(MDUMP mdump)
 FIND_LIBRARY(MEDFILE_C_LIBRARIES NAMES medC)
 FIND_LIBRARY(MEDFILE_F_LIBRARIES NAMES med)


MOD: Don't version the demo executables.

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -60,7 +60,6 @@
     endif()

     add_executable(${CEGUI_TARGET_NAME} ${CORE_SOURCE_FILES} ${CORE_HEADER_FILES})
-    set_target_properties(${CEGUI_TARGET_NAME} PROPERTIES VERSION ${CEGUI_VERSION})

     # append the _d (or whatever) for debug builds as needed.
     if (CEGUI_HAS_BUILD_SUFFIX AND CEGUI_BUILD_SUFFIX)


Add formatting targets to IDE folder

Add formatting targets to IDE folder

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -79,8 +79,8 @@
         COMMAND "${CMAKE_COMMAND}" -E remove ${TOUCH_PATHS}
         COMMENT "Clearing format dependencies"
     )
-    set_target_properties(${TARGET}-format PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True FOLDER format)
-    set_target_properties(${TARGET}-reformat PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True FOLDER reformat)
+    set_target_properties(${TARGET}-format PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True FOLDER CMakePredefinedTargets/format)
+    set_target_properties(${TARGET}-reformat PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD True FOLDER CMakePredefinedTargets/reformat)

     add_dependencies(format ${TARGET}-format)
     add_dependencies(reformat ${TARGET}-reformat)


improve FindCholmod

improve FindCholmod

--- cmake/FindCholmod.cmake
+++ cmake/FindCholmod.cmake
@@ -22,9 +22,9 @@
   find_library(AMD_LIBRARY amd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
   if (AMD_LIBRARY)
     set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${AMD_LIBRARY})
-  else (AMD_LIBRARY)
+  else ()
     set(CHOLMOD_LIBRARIES FALSE)
-  endif (AMD_LIBRARY)
+  endif ()

 endif(CHOLMOD_LIBRARIES)

@@ -33,9 +33,9 @@
   find_library(COLAMD_LIBRARY colamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
   if (COLAMD_LIBRARY)
     set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${COLAMD_LIBRARY})
-  else (COLAMD_LIBRARY)
+  else ()
     set(CHOLMOD_LIBRARIES FALSE)
-  endif (COLAMD_LIBRARY)
+  endif ()

 endif(CHOLMOD_LIBRARIES)

@@ -44,20 +44,29 @@
   find_library(CAMD_LIBRARY camd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
   if (CAMD_LIBRARY)
     set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CAMD_LIBRARY})
-  else (CAMD_LIBRARY)
+  else ()
     set(CHOLMOD_LIBRARIES FALSE)
-  endif (CAMD_LIBRARY)
+  endif ()

 endif(CHOLMOD_LIBRARIES)

 if(CHOLMOD_LIBRARIES)

-  find_library(CCOLAMD_LIBRARY colamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+  find_library(CCOLAMD_LIBRARY ccolamd PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
   if (CCOLAMD_LIBRARY)
     set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CCOLAMD_LIBRARY})
-  else (CCOLAMD_LIBRARY)
+  else ()
     set(CHOLMOD_LIBRARIES FALSE)
-  endif (CCOLAMD_LIBRARY)
+  endif ()
+
+endif(CHOLMOD_LIBRARIES)
+
+if(CHOLMOD_LIBRARIES)
+
+  find_library(CHOLMOD_METIS_LIBRARY metis PATHS ${CHOLMOD_LIBDIR} $ENV{CHOLMODDIR} ${LIB_INSTALL_DIR})
+  if (CHOLMOD_METIS_LIBRARY)
+    set(CHOLMOD_LIBRARIES ${CHOLMOD_LIBRARIES} ${CHOLMOD_METIS_LIBRARY})
+  endif ()

 endif(CHOLMOD_LIBRARIES)


fix build config

fix build config

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

--- cmake/FindCppUnit.cmake
+++ cmake/FindCppUnit.cmake
@@ -55,7 +55,7 @@
    message(STATUS "Found cppunit: ${CPPUNIT_LIBRARIES}")
   endif(NOT CppUnit_FIND_QUIETLY)

-  MACRO_ENSURE_VERSION ("1.12.0" ${CPPUNIT_INSTALLED_VERSION} CPPUNIT_INSTALLED_VERSION_OK)
+  MACRO_ENSURE_VERSION ("${CPPUNIT_MIN_VERSION}" ${CPPUNIT_INSTALLED_VERSION} CPPUNIT_INSTALLED_VERSION_OK)
   if (NOT CPPUNIT_INSTALLED_VERSION_OK)
    message ("CppUnit version is too old: found ${CPPUNIT_INSTALLED_VERSION} installed, ${CPPUNIT_MIN_VERSION} or major is required")
    SET(CppUnit_FOUND FALSE)


mingw: Fix FindOpenVDB

mingw: Fix FindOpenVDB

Signed-off-by: Mehdi Chinoune <08b1b5066d15debe5d520804537f768887925fd1@hotmail.com>

--- cmake/FindOpenVDB.cmake
+++ cmake/FindOpenVDB.cmake
@@ -655,8 +655,8 @@
   if(WIN32)
     # @note OPENVDB_OPENEXR_STATICLIB is old functionality and should be removed
     if(OPENEXR_USE_STATIC_LIBS OR
-        (${ILMBASE_LIB_TYPE} STREQUAL STATIC_LIBRARY) OR
-        (${IMATH_LIB_TYPE} STREQUAL STATIC_LIBRARY))
+        ("${ILMBASE_LIB_TYPE}" STREQUAL "STATIC_LIBRARY") OR
+        ("${IMATH_LIB_TYPE}" STREQUAL "STATIC_LIBRARY"))
       list(APPEND OpenVDB_DEFINITIONS OPENVDB_OPENEXR_STATICLIB)
     endif()
   endif()


Fixed wayland library detection.

Fixed wayland library detection.

--- cmake/FindWayland.cmake
+++ cmake/FindWayland.cmake
@@ -53,7 +53,7 @@
 )

 if (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)
-    list(INSERT WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB})
+	list(APPEND WAYLAND_LIBS ${WAYLAND_CLIENT_LIB} ${WAYLAND_CURSOR_LIB})
 endif (WAYLAND_CLIENT_LIB AND WAYLAND_CURSOR_LIB)

 find_path(XKBCOMMON_INCLUDE_DIR xkbcommon/xkbcommon.h


Install Qt include folders for Apple

Install Qt include folders for Apple

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -120,6 +120,7 @@
     list(APPEND INCLUDE_FOLDERS
         ActiveQt
     )
+elseif(APPLE)
 else()
     list(APPEND INCLUDE_FOLDERS
         QtGlxSupport


fix build without IPP (and empty 3rdparty)

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -824,7 +824,7 @@
   endif()

   # split 3rdparty libs and modules
-  list(REMOVE_ITEM ${_modules} ${${_3rdparty}} ${${_extra}})
+  list(REMOVE_ITEM ${_modules} ${${_3rdparty}} ${${_extra}} non_empty_list)

   # convert CMake lists to makefile literals
   foreach(lst ${_modules} ${_3rdparty} ${_extra})


r9329/sofa : cmake: Resetting GLOBAL_COMPILER_DEFINES at the start of each generation, otherwise it accumulates the same defines each time.

Former-commit-id: 02179748d12fa8e8bf7fa9892b91959dbbc44e1b

--- cmake/environment.cmake
+++ cmake/environment.cmake
@@ -18,6 +18,9 @@
 set(SOFA_APPLICATIONS_DEV_PLUGINS_DIR "${SOFA_APPLICATIONS_DEV_DIR}/plugins" CACHE INTERNAL "Path to the Sofa applications-dev plugin directory")
 set(SOFA_TOOLS_DIR "${SOFA_SRC_DIR}/tools" CACHE INTERNAL "Path to the Sofa tools directory")

+# clear cached variables that we regenerate each time
+set(GLOBAL_COMPILER_DEFINES "")
+
 ## os-specific
 if(WIN32)
 	list(APPEND GLOBAL_COMPILER_DEFINES "UNICODE")


Fix the declaration of DARWIN_PREFER_PUBLIC_SDK cmake variable (move before the return).

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -5,11 +5,12 @@
 # the current Xcode.
 function(find_darwin_sdk_dir var sdk_name)
   set(DARWIN_${sdk_name}_CACHED_SYSROOT "" CACHE STRING "Darwin SDK path for SDK ${sdk_name}.")
+  set(DARWIN_PREFER_PUBLIC_SDK OFF CACHE BOOL "Prefer Darwin public SDK, even when an internal SDK is present.")
+
   if(DARWIN_${sdk_name}_CACHED_SYSROOT)
     set(${var} ${DARWIN_${sdk_name}_CACHED_SYSROOT} PARENT_SCOPE)
     return()
   endif()
-  set(DARWIN_PREFER_PUBLIC_SDK OFF CACHE BOOL "Prefer Darwin public SDK, even when an internal SDK is present.")
   if(NOT DARWIN_PREFER_PUBLIC_SDK)
     # Let's first try the internal SDK, otherwise use the public SDK.
     execute_process(


COMP: MSVC AVX flag fix

COMP: MSVC AVX flag fix

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -145,7 +145,10 @@
   if(MSVC)
       set(InstructionSetOptimizationFlags
          # https://docs.microsoft.com/en-us/cpp/build/reference/arch-x64?view=vs-2015
-         /arch:SSE /arch:SSE2 /arch:/AVX ) # /arch:/AVX2 AVX2 circa 2013
+         /arch:SSE /arch:SSE2 /arch:AVX) # AVX2 support circa 2013 hardware
+      if(MSVC_VERSION GREATER_EQUAL 1800)
+        list(APPEND InstructionSetOptimizationFlags /arch:AVX2)
+      endif()
   else()
     if (${CMAKE_C_COMPILER} MATCHES "icc.*$")
       set(USING_INTEL_ICC_COMPILER TRUE)
@@ -154,7 +157,7 @@
       set(USING_INTEL_ICC_COMPILER TRUE)
     endif()
     if(USING_INTEL_ICC_COMPILER)
-      set(InstructionSetOptimizationFlags "" )
+      set(InstructionSetOptimizationFlags "")
     else()
       set(InstructionSetOptimizationFlags "")
     endif ()


Updated CMake script with the fixed one from https://github.com/urho3d/Urho3D/commit/ff1278051f1f3cb745aec7727e4c1c68946c2c4b.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -111,7 +111,56 @@
     set (NEON TRUE)
 endif ()
 cmake_dependent_option (URHO3D_NEON "Enable NEON instruction set (ARM platforms with NEON only)" TRUE "NEON" FALSE)
+# The URHO3D_OPENGL option is not defined on non-Windows platforms as they should always use OpenGL
+if (MSVC)
+    # On MSVC compiler, default to false (i.e. prefers Direct3D)
+    # OpenGL can be manually enabled with -DURHO3D_OPENGL=1, but Windows graphics card drivers are usually better optimized for Direct3D
+    set (DEFAULT_OPENGL FALSE)
+else ()
+    # On non-MSVC compiler on Windows platform, default to true to enable use of OpenGL instead of Direct3D
+    # Direct3D can be manually enabled with -DURHO3D_OPENGL=0, but it is likely to fail unless the MinGW-w64 distribution is used due to dependency to Direct3D headers and libs
+    set (DEFAULT_OPENGL TRUE)
+endif ()
+cmake_dependent_option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" ${DEFAULT_OPENGL} "WIN32" TRUE)      # Force the variable to TRUE when not WIN32
+# On Windows platform Direct3D11 can be optionally chosen
+# Using Direct3D11 on non-MSVC compiler may require copying and renaming Microsoft official libraries (.lib to .a), else link failures or non-functioning graphics may result
+cmake_dependent_option (URHO3D_D3D11 "Use Direct3D11 instead of Direct3D9 (Windows platform only); overrides URHO3D_OPENGL option" FALSE "WIN32" FALSE)
+if (CMAKE_HOST_WIN32)
+    if (NOT DEFINED URHO3D_MKLINK)
+        # Test whether the host system is capable of setting up symbolic link
+        execute_process (COMMAND cmd /C mklink test-link CMakeCache.txt RESULT_VARIABLE MKLINK_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+        if (MKLINK_EXIT_CODE EQUAL 0)
+            set (URHO3D_MKLINK TRUE)
+            file (REMOVE ${CMAKE_BINARY_DIR}/test-link)
+        else ()
+            set (URHO3D_MKLINK FALSE)
+            message (WARNING "Could not use MKLINK to setup symbolic links as this Windows user account does not have the privilege to do so. "
+                "When MKLINK is not available then the build system will fallback to use file/directory copy of the library headers from source tree to build tree. "
+                "In order to prevent stale headers being used in the build, this file/directory copy will be redone also as a post-build step for each library targets. "
+                "This may slow down the build unnecessarily or even cause other unforseen issues due to incomplete or stale headers in the build tree. "
+                "Request your Windows Administrator to grant your user account to have privilege to create symlink via MKLINK command. "
+                "You are NOT advised to use the Administrator account directly to generate build tree in all cases.")
+        endif ()
+        set (URHO3D_MKLINK ${URHO3D_MKLINK} CACHE INTERNAL "MKLINK capability on the Windows host system")
+    endif ()
+    set (NULL_DEVICE nul)
+else ()
+    set (NULL_DEVICE /dev/null)
+endif ()
+# Find Direct3D include & library directories in MS Windows SDK or DirectX SDK when not using OpenGL.
+if (WIN32 AND NOT URHO3D_OPENGL)
+    find_package (Direct3D REQUIRED)
+    if (DIRECT3D_INCLUDE_DIRS)
+        include_directories (${DIRECT3D_INCLUDE_DIRS})
+    endif ()
+endif ()
+# For Raspbery Pi, find Broadcom VideoCore IV firmware
+if (RPI)
+    find_package (BCM_VC REQUIRED)
+    include_directories (${BCM_VC_INCLUDE_DIRS})
+endif ()
 if (CMAKE_PROJECT_NAME STREQUAL Urho3D)
+    set (URHO3D_LIB_TYPE STATIC CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED")
     cmake_dependent_option (URHO3D_LUAJIT_AMALG "Enable LuaJIT amalgamated build (LuaJIT only)" FALSE "URHO3D_LUAJIT" FALSE)
     cmake_dependent_option (URHO3D_SAFE_LUA "Enable Lua C++ wrapper safety checks (Lua/LuaJIT only)" FALSE "URHO3D_LUA OR URHO3D_LUAJIT" FALSE)
     if (CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_CONFIGURATION_TYPES)
@@ -138,9 +187,15 @@
         cmake_dependent_option (URHO3D_USE_LIB_DEB "Enable 64-bit DEB CPack generator using /usr/lib and disable all other generators (Redhat-based host only)" FALSE "URHO3D_64BIT AND HAS_LIB64" FALSE)
     endif ()
 else ()
-    set (URHO3D_HOME "" CACHE PATH "Path to Urho3D build tree or SDK installation location (external project only)")
-    if (URHO3D_PCH OR URHO3D_UPDATE_SOURCE_TREE)
-        # Just reference it to suppress "unused variable" CMake warning on external projects using this CMake module
+    set (URHO3D_LIB_TYPE "" CACHE STRING "Specify Urho3D library type, possible values are STATIC and SHARED")
+    set (URHO3D_HOME "" CACHE PATH "Path to Urho3D build tree or SDK installation location (downstream project only)")
+    if (URHO3D_PCH OR URHO3D_UPDATE_SOURCE_TREE OR URHO3D_TOOLS OR URHO3D_EXTRAS)
+        # Just reference it to suppress "unused variable" CMake warning on downstream projects using this CMake module
+    endif ()
+    # All Urho3D downstream projects require Urho3D library, so find Urho3D library here now
+    if (NOT CMAKE_PROJECT_NAME MATCHES ^Urho3D-ExternalProject-)
+        find_package (Urho3D REQUIRED)
+        include_directories (${URHO3D_INCLUDE_DIRS})
     endif ()
 endif ()
 option (URHO3D_PACKAGING "Enable resources packaging support, on Emscripten default to 1, on other platforms default to 0" ${EMSCRIPTEN})
@@ -167,46 +222,9 @@
         unset (EMSCRIPTEN_EMRUN_BROWSER CACHE)
     endif ()
 endif ()
-# The URHO3D_OPENGL option is not defined on non-Windows platforms as they should always use OpenGL
-if (MSVC)
-    # On MSVC compiler, default to false (i.e. prefers Direct3D)
-    # OpenGL can be manually enabled with -DURHO3D_OPENGL=1, but Windows graphics card drivers are usually better optimized for Direct3D
-    set (DEFAULT_OPENGL FALSE)
-else ()
-    # On non-MSVC compiler on Windows platform, default to true to enable use of OpenGL instead of Direct3D
-    # Direct3D can be manually enabled with -DURHO3D_OPENGL=0, but it is likely to fail unless the MinGW-w64 distribution is used due to dependency to Direct3D headers and libs
-    set (DEFAULT_OPENGL TRUE)
-endif ()
-cmake_dependent_option (URHO3D_OPENGL "Use OpenGL instead of Direct3D (Windows platform only)" ${DEFAULT_OPENGL} "WIN32" TRUE)      # Force the variable to TRUE when not WIN32
-# On Windows platform Direct3D11 can be optionally chosen
-# Using Direct3D11 on non-MSVC compiler may require copying and renaming Microsoft official libraries (.lib to .a), else link failures or non-functioning graphics may result
-cmake_dependent_option (URHO3D_D3D11 "Use Direct3D11 instead of Direct3D9 (Windows platform only); overrides URHO3D_OPENGL option" FALSE "WIN32" FALSE)
-if (CMAKE_HOST_WIN32)
-    if (NOT DEFINED URHO3D_MKLINK)
-        # Test whether the host system is capable of setting up symbolic link
-        execute_process (COMMAND cmd /C mklink test-link CMakeCache.txt RESULT_VARIABLE MKLINK_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
-        if (MKLINK_EXIT_CODE EQUAL 0)
-            set (URHO3D_MKLINK TRUE)
-            file (REMOVE ${CMAKE_BINARY_DIR}/test-link)
-        else ()
-            set (URHO3D_MKLINK FALSE)
-            message (WARNING "Could not use MKLINK to setup symbolic links as this Windows user account does not have the privilege to do so. "
-                "When MKLINK is not available then the build system will fallback to use file/directory copy of the library headers from source tree to build tree. "
-                "In order to prevent stale headers being used in the build, this file/directory copy will be redone also as a post-build step for each library targets. "
-                "This may slow down the build unnecessarily or even cause other unforseen issues due to incomplete or stale headers in the build tree. "
-                "Request your Windows Administrator to grant your user account to have privilege to create symlink via MKLINK command. "
-                "You are NOT advised to use the Administrator account directly to generate build tree in all cases.")
-        endif ()
-        set (URHO3D_MKLINK ${URHO3D_MKLINK} CACHE INTERNAL "MKLINK capability on the Windows host system")
-    endif ()
-    set (NULL_DEVICE nul)
-else ()
-    set (NULL_DEVICE /dev/null)
-endif ()
 cmake_dependent_option (URHO3D_STATIC_RUNTIME "Use static C/C++ runtime libraries and eliminate the need for runtime DLLs installation (VS only)" FALSE "MSVC" FALSE)
 cmake_dependent_option (URHO3D_WIN32_CONSOLE "Use console main() as entry point when setting up Windows executable targets (Windows platform only)" FALSE "WIN32" FALSE)
 cmake_dependent_option (URHO3D_MACOSX_BUNDLE "Use MACOSX_BUNDLE when setting up Mac OS X executable targets (Xcode native build only)" FALSE "XCODE AND NOT IOS" FALSE)
-set (URHO3D_LIB_TYPE STATIC CACHE STRING "Specify Urho3D library type, possible values are STATIC (default) and SHARED")
 if (CMAKE_CROSSCOMPILING AND NOT ANDROID)
     set (URHO3D_SCP_TO_TARGET "" CACHE STRING "Use scp to transfer executables to target system (non-Android cross-compiling build only), SSH digital key must be setup first for this to work, typical value has a pattern of usr@tgt:remote-loc")
 else ()
@@ -370,11 +388,6 @@
     add_definitions (-DURHO3D_THREADING)
 endif ()

-# If not on Windows platform, enable Unix mode for kNet library
-if (NOT WIN32)
-    add_definitions (-DKNET_UNIX)
-endif ()
-
 # Add definitions for Emscripten
 if (EMSCRIPTEN)
     add_definitions (-DNO_POPEN)
@@ -402,7 +415,9 @@
 endif ()
 if (NOT URHO3D_LIB_TYPE STREQUAL SHARED)
     set (URHO3D_LIB_TYPE STATIC)
-    add_definitions (-DURHO3D_STATIC_DEFINE)
+    if (NOT MSVC)   # This define will be baked into the export header for MSVC compiler
+        add_definitions (-DURHO3D_STATIC_DEFINE)
+    endif ()
 endif ()

 # Add definition for AngelScript
@@ -461,27 +476,13 @@
     add_definitions (-DURHO3D_DATABASE -DURHO3D_DATABASE_SQLITE)
 endif ()

-# Find Direct3D include & library directories in MS Windows SDK or DirectX SDK when not using OpenGL.
-if (WIN32 AND NOT URHO3D_OPENGL)
-    find_package (Direct3D REQUIRED)
-    if (DIRECT3D_INCLUDE_DIRS)
-        include_directories (${DIRECT3D_INCLUDE_DIRS})
-    endif ()
-endif ()
-
-# For Raspbery Pi, find Broadcom VideoCore IV firmware
-if (RPI)
-    find_package (BCM_VC REQUIRED)
-    include_directories (${BCM_VC_INCLUDE_DIRS})
-endif ()
-
 # Platform and compiler specific options
 if (URHO3D_C++11)
-    add_definitions (-DURHO3D_CPP11)   # Note the define is NOT 'URHO3D_C++11'!
+    add_definitions (-DURHO3D_CXX11)   # Note the define is NOT 'URHO3D_C++11'!
     if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
         # Use gnu++11/gnu++0x instead of c++11/c++0x as the latter does not work as expected when cross compiling
         foreach (STANDARD gnu++11 gnu++0x)  # Fallback to gnu++0x on older GCC version
-            execute_process (COMMAND echo COMMAND ${CMAKE_CXX_COMPILER} -E - RESULT_VARIABLE GCC_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
+            execute_process (COMMAND ${CMAKE_COMMAND} -E echo COMMAND ${CMAKE_CXX_COMPILER} -std=${STANDARD} -E - RESULT_VARIABLE GCC_EXIT_CODE OUTPUT_QUIET ERROR_QUIET)
             if (GCC_EXIT_CODE EQUAL 0)
                 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=${STANDARD}")
                 break ()
@@ -511,6 +512,8 @@
     set (CMAKE_OSX_SYSROOT iphoneos)    # Set Base SDK to "Latest iOS"
     execute_process (COMMAND xcodebuild -version -sdk ${CMAKE_OSX_SYSROOT} Path OUTPUT_VARIABLE IOS_SYSROOT OUTPUT_STRIP_TRAILING_WHITESPACE)   # Obtain iOS sysroot path
     set (CMAKE_FIND_ROOT_PATH ${IOS_SYSROOT})
+    # Ensure the CMAKE_OSX_DEPLOYMENT_TARGET is set to empty
+    unset (CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
 elseif (XCODE)
     # MacOSX-Xcode-specific setup
     if (NOT URHO3D_64BIT)
@@ -577,9 +580,11 @@
         else ()
             if (NOT XCODE AND NOT EMSCRIPTEN)
                 # This may influence the effective SSE level when URHO3D_SSE is on as well
-                set (URHO3D_DEPLOYMENT_TARGET native CACHE STRING "Specify the minimum CPU type on which the target binaries are to be deployed (Linux, MinGW, and non-Xcode OSX native build only), see GCC/Clang's -march option for possible values")
-                set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${URHO3D_DEPLOYMENT_TARGET}")
-                set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${URHO3D_DEPLOYMENT_TARGET}")
+                set (URHO3D_DEPLOYMENT_TARGET native CACHE STRING "Specify the minimum CPU type on which the target binaries are to be deployed (Linux, MinGW, and non-Xcode OSX native build only), see GCC/Clang's -march option for possible values; Use 'generic' for targeting a wide range of generic processors")
+                if (NOT URHO3D_DEPLOYMENT_TARGET STREQUAL generic)
+                    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=${URHO3D_DEPLOYMENT_TARGET}")
+                    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${URHO3D_DEPLOYMENT_TARGET}")
+                endif ()
             endif ()
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffast-math")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
@@ -1029,7 +1034,7 @@
             endforeach ()
         endif ()
     endif ()
-    # Need to check if the destination variable is defined first because this macro could be called by external project that does not wish to install anything
+    # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
     if (DEST_RUNTIME_DIR)
         if (EMSCRIPTEN)
             # todo: Just use generator-expression when CMake minimum version is 3.0
@@ -1170,7 +1175,7 @@
     if (NOT RESOURCE_DIRS)
         # If the macro caller has not defined the resource dirs then set them based on Urho3D project convention
         foreach (DIR ${CMAKE_SOURCE_DIR}/bin/CoreData ${CMAKE_SOURCE_DIR}/bin/Data)
-            # Do not assume external project always follows Urho3D project convention, so double check if this directory exists before using it
+            # Do not assume downstream project always follows Urho3D project convention, so double check if this directory exists before using it
             if (IS_DIRECTORY ${DIR})
                 list (APPEND RESOURCE_DIRS ${DIR})
             endif ()
@@ -1187,7 +1192,7 @@
                 set_source_files_properties (${RESOURCE_${DIR}_PATHNAME} PROPERTIES EMCC_OPTION preload-file EMCC_FILE_ALIAS "@/${NAME}.pak --use-preload-cache")
             endif ()
         endforeach ()
-        # Urho3D project builds the PackageTool as required; external project uses PackageTool found in the Urho3D build tree or Urho3D SDK
+        # Urho3D project builds the PackageTool as required; downstream project uses PackageTool found in the Urho3D build tree or Urho3D SDK
         find_Urho3d_tool (PACKAGE_TOOL PackageTool
             HINTS ${CMAKE_BINARY_DIR}/bin/tool ${URHO3D_HOME}/bin/tool
             DOC "Path to PackageTool" MSG_MODE WARNING)
@@ -1197,7 +1202,7 @@
         set (PACKAGING_COMMENT " and packaging")
         set_property (SOURCE ${RESOURCE_PAKS} PROPERTY GENERATED TRUE)
         if (EMSCRIPTEN)
-            # Check if shell-file is already added in source files list by external project
+            # Check if shell-file is already added in source files list by downstream project
             if (NOT CMAKE_PROJECT_NAME STREQUAL Urho3D)
                 foreach (FILE ${SOURCE_FILES})
                     get_property (EMCC_OPTION SOURCE ${FILE} PROPERTY EMCC_OPTION)
@@ -1218,6 +1223,10 @@
                 set (SHARED_RESOURCE_JS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_PROJECT_NAME}.js)
                 list (APPEND SOURCE_FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data)
                 set_source_files_properties (${SHARED_RESOURCE_JS} PROPERTIES GENERATED TRUE EMCC_OPTION pre-js)
+                # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
+                if (DEST_BUNDLE_DIR)
+                    install (FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
+                endif ()
             endif ()
         endif ()
     endif ()
@@ -1248,7 +1257,7 @@
         endif ()
         # Add SDL native init function, SDL_Main() entry point must be defined by one of the source files in ${SOURCE_FILES}
         find_Urho3D_file (ANDROID_MAIN_C_PATH SDL_android_main.c
-            HINTS ${URHO3D_HOME}/include/${PATH_SUFFIX}/ThirdParty/SDL/android ${CMAKE_SOURCE_DIR}/Source/ThirdParty/SDL/src/main/android
+            HINTS ${URHO3D_HOME}/include/Urho3D/ThirdParty/SDL/android ${CMAKE_SOURCE_DIR}/Source/ThirdParty/SDL/src/main/android
             DOC "Path to SDL_android_main.c" MSG_MODE FATAL_ERROR)
         list (APPEND SOURCE_FILES ${ANDROID_MAIN_C_PATH})
         # Setup shared library output path
@@ -1397,7 +1406,7 @@

 # Macro for defining external library dependencies
 # The purpose of this macro is emulate CMake to set the external library dependencies transitively
-# It works for both targets setup within Urho3D project and outside Urho3D project that uses Urho3D as external static/shared library
+# It works for both targets setup within Urho3D project and downstream projects that uses Urho3D as external static/shared library
 macro (define_dependency_libs TARGET)
     # ThirdParty/SDL external dependency
     if (${TARGET} MATCHES SDL|Urho3D)
@@ -1591,7 +1600,7 @@
 #  BASE <value> - An absolute base path to be prepended to the destination path when installing to build tree, default to build tree
 #  DESTINATION <value> - A relative destination path to be installed to
 macro (install_header_files)
-    # Need to check if the destination variable is defined first because this macro could be called by external project that does not wish to install anything
+    # Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
     if (DEST_INCLUDE_DIR)
         # Parse the arguments for the underlying install command for the SDK
         cmake_parse_arguments (ARG "FILES_MATCHING;USE_FILE_SYMLINK;BUILD_TREE_ONLY" "BASE;DESTINATION" "FILES;DIRECTORY;PATTERN" ${ARGN})
@@ -1683,6 +1692,7 @@
         file (REMOVE ${ANDROID_LIBRARY_OUTPUT_PATH}/gdbserver)
     endif ()
     # Create symbolic links in the build tree
+    file (MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/Android/assets)
     foreach (I CoreData Data)
         if (NOT EXISTS ${CMAKE_SOURCE_DIR}/Android/assets/${I})
             create_symlink (${CMAKE_SOURCE_DIR}/bin/${I} ${CMAKE_SOURCE_DIR}/Android/assets/${I} FALLBACK_TO_COPY)


- pkg-config generation: added libdir to the linker flags

--- common/CommonAPICodeGenCommonConfig.cmake
+++ common/CommonAPICodeGenCommonConfig.cmake
@@ -107,7 +107,7 @@
 Description: ${interface} Common-API Service
 Version:
 Requires: CommonAPI
-Libs: -Wl,--no-as-needed,-l${LIBRARY_NAME}_Backend,--as-needed -l${LIBRARY_NAME}_Backend @DEVELOPMENT_LIBRARY_PATH@
+Libs: -L\${libdir} -Wl,--no-as-needed,-l${LIBRARY_NAME}_Backend,--as-needed -l${LIBRARY_NAME}_Backend @DEVELOPMENT_LIBRARY_PATH@
 Cflags: @DEVELOPMENT_INCLUDE_PATH@ -I\${includedir}/CommonAPIServices
 ")


CopyDlls.cmake: use quoting syntax for file generate

--- cmake/CopyDlls.cmake
+++ cmake/CopyDlls.cmake
@@ -63,9 +63,9 @@
 	set(_copy_dlls_name "copy_dlls-$<CONFIG>")
 	set(_list_file "${_copy_dlls_name}.list")
 	file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_list_file}"
-		CONTENT ${_deb_dlls} CONDITION $<CONFIG:Debug>)
+		CONTENT "${_deb_dlls}" CONDITION $<CONFIG:Debug>)
 	file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_list_file}"
-		CONTENT ${_opt_dlls} CONDITION $<NOT:$<CONFIG:Debug>>)
+		CONTENT "${_opt_dlls}" CONDITION $<NOT:$<CONFIG:Debug>>)

 	add_custom_command(
 		TARGET ${TARGET}


Bugfix in key postprocessing.

Bugfix in key postprocessing.

EASYTEST_RUN was always set to 'sh -c <command>', even if EASYTEST_RUN was not
set.

--- cmake/easytest.cmake
+++ cmake/easytest.cmake
@@ -169,7 +169,9 @@
 	# Postprocess RUN key, as add_test needs a list of arguments, but RUN is a
 	# string. To accomplish this and to allow pipes in the command, the whole
 	# string will be used as argument for sh.
-	set(EASYTEST_RUN sh -c "${EASYTEST_RUN}")
+	if (EASYTEST_RUN)
+		set(EASYTEST_RUN sh -c "${EASYTEST_RUN}")
+	endif ()

 	# Call the hooks for compile and test creation.


Set NSHighResolutionCapable plist.info property for OSX (Retina support)

--- cmake/fips_osx.cmake
+++ cmake/fips_osx.cmake
@@ -165,6 +165,8 @@
             "    <string>1</string>\n"
             "    <key>LSMinimumSystemVersion</key>\n"
             "    <string>\${MACOSX_DEPLOYMENT_TARGET}</string>\n"
+            "    <key>NSHighResolutionCapable</key>\n"
+            "    <true/>\n"
             "  </dict>\n"
             "</plist>\n")
     endif()


Enable detection of gismo_dev_EXTENSIONS (#203)

--- cmake/gismoUse.cmake
+++ cmake/gismoUse.cmake
@@ -26,7 +26,7 @@
     get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
     add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
     #message(STATUS "exec (pure template): ${FNAME}")
-    add_executable(${FNAME} ${FILE} ${gismo_SOURCES} ${gismo_EXTENSIONS})
+    add_executable(${FNAME} ${FILE} ${gismo_SOURCES} ${gismo_EXTENSIONS} ${gismo_dev_EXTENSIONS})
     target_link_libraries(${FNAME} gismo_static)
     if(UNIX AND NOT APPLE)
     	target_link_libraries(${FNAME} dl)


flags/sanitize_address: update C flags too

--- flags/sanitize_address.cmake
+++ flags/sanitize_address.cmake
@@ -8,6 +8,7 @@
 endif()

 include(polly_add_cache_flag)
+
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=address")
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-g")

@@ -19,3 +20,15 @@
     "C++ compiler flags"
     FORCE
 )
+
+polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=address")
+polly_add_cache_flag(CMAKE_C_FLAGS "-g")
+
+set(
+    CMAKE_C_FLAGS_RELEASE
+    "-O1"
+    CACHE
+    STRING
+    "C compiler flags"
+    FORCE
+)


Only set -pthread for cc compiler.

Only set -pthread for cc compiler.

--- tests/Makefile.cmake
+++ tests/Makefile.cmake
@@ -1,8 +1,7 @@
 # Configuration
 HIPACC_DIR     ?= @CMAKE_INSTALL_PREFIX@
 COMPILER       ?= $(HIPACC_DIR)/bin/hipacc
-COMMON_INC     ?= @PTHREAD@ \
-                  -I@OPENCV_INCLUDE_DIR@ \
+COMMON_INC     ?= -I@OPENCV_INCLUDE_DIR@ \
                   -I$(TEST_CASE) \
                   -I/usr/include
 COMPILER_INC   ?= -std=c++11 $(COMMON_INC) \
@@ -17,7 +16,7 @@
                   -Xptxas -v @NVCC_COMP@ #-keep
 OFLAGS          = -O3

-CC_CC           = @CMAKE_CXX_COMPILER@ -std=c++11 -Wall -Wunused
+CC_CC           = @CMAKE_CXX_COMPILER@ -std=c++11 @PTHREAD@ -Wall -Wunused
 CU_CC           = @NVCC@ $(NVCC_FLAGS) -Xcompiler -Wall -Xcompiler -Wunused
 CC_LINK         = -lm -ldl -lstdc++ @TIME_LINK@
 CU_LINK         = $(CC_LINK) @CUDA_LINK@


Fixed standalone FFmpeg search with pkg-config

--- modules/videoio/cmake/detect_ffmpeg.cmake
+++ modules/videoio/cmake/detect_ffmpeg.cmake
@@ -31,6 +31,18 @@
     if(FFMPEG_libavresample_FOUND)
       list(APPEND FFMPEG_LIBRARIES ${FFMPEG_libavresample_LIBRARIES})
     endif()
+
+    # rewrite libraries to absolute paths
+    foreach(lib ${FFMPEG_LIBRARIES})
+      find_library(FFMPEG_ABSOLUTE_${lib} "${lib}" PATHS "${FFMPEG_lib${lib}_LIBDIR}" NO_DEFAULT_PATH)
+      if(FFMPEG_ABSOLUTE_${lib})
+        list(APPEND ffmpeg_abs_libs "${FFMPEG_ABSOLUTE_${lib}}")
+      else()
+        list(APPEND ffmpeg_abs_libs "${lib}")
+      endif()
+    endforeach()
+    set(FFMPEG_LIBRARIES "${ffmpeg_abs_libs}" CACHE INTERNAL "" FORCE)
+
     set(HAVE_FFMPEG TRUE)
   endif()
 endif()
@@ -42,7 +54,6 @@
       "${OpenCV_BINARY_DIR}"
       "${OpenCV_SOURCE_DIR}/cmake/checks/ffmpeg_test.cpp"
       CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${FFMPEG_INCLUDE_DIRS}"
-                  "-DLINK_DIRECTORIES:STRING=${FFMPEG_LIBRARY_DIRS}"
                   "-DLINK_LIBRARIES:STRING=${FFMPEG_LIBRARIES}"
       OUTPUT_VARIABLE TRY_OUT
   )


updating kinect pod to provide the kinect map control type

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -65,7 +65,7 @@
 set(velodyne_depends common_utils)

 set(kinect_url https://svn.csail.mit.edu/rrg_pods/drivers/kinect)
-set(kinect_revision 963)
+set(kinect_revision 964)
 set(kinect_depends libbot-drc)

 set(microstrain_comm_url https://svn.csail.mit.edu/rrg_pods/drivers/microstrain_comm)


update vicon external to fix compile error

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -69,7 +69,7 @@
 set(estimate-pose_depends fovis)

 set(vicon_url https://github.com/mitdrc/vicon.git)
-set(vicon_revision 9d42432a278d9e07394d11ab5a5c23b07e307c2c)
+set(vicon_revision 867d2f1192ad37b2c37ad3d7611e40ef27ff349d)
 set(vicon_depends libbot)

 set(apriltags_url https://github.com/psiorx/apriltags-pod.git)


Refactor run_testsuite.cmake slightly:

Refactor run_testsuite.cmake slightly:

  - Inject compiler name and version by hand into xml files
  - Same for SVN revision

git-svn-id: 59f82343654cec32357d3b049d399063e4e4cfc7@30937 0785d39b-7218-0410-832d-ea1e28bc413d

--- tests/run_testsuite.cmake
+++ tests/run_testsuite.cmake
@@ -258,6 +258,8 @@
     "^.*CMAKE_CXX_COMPILER:     \(.*\) on platform.*$" "\\1"
     _compiler_id ${_compiler_id}
     )
+  STRING(REGEX REPLACE "^\(.*\) .*$" "\\1" _compiler_name ${_compiler_id})
+  STRING(REGEX REPLACE "^.* " "" _compiler_version ${_compiler_id})
   STRING(REGEX REPLACE " " "-" _compiler_id ${_compiler_id})
   IF( NOT "${_compiler_id}" STREQUAL "" OR
       _compiler_id MATCHES "CMAKE_CXX_COMPILER" )
@@ -266,7 +268,7 @@
 ENDIF()

 #
-# Append subversion information to CTEST_BUILD_NAME:
+# Append subversion branch to CTEST_BUILD_NAME:
 #

 EXECUTE_PROCESS(
@@ -279,7 +281,7 @@
   STRING(REGEX REPLACE "^${_svn_WC_ROOT}/" "" _branch ${_svn_WC_URL})
   STRING(REGEX REPLACE "^branches/" "" _branch ${_branch})
   STRING(REGEX REPLACE "/deal.II$" "" _branch ${_branch})
-  SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}-r${_svn_WC_REVISION}")
+  SET(CTEST_BUILD_NAME "${CTEST_BUILD_NAME}-${_branch}")
 ENDIF()

 #
@@ -366,12 +368,38 @@
     # Only run tests if the build was successful:

     EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND}
-      --build ${CTEST_BINARY_DIRECTORY} --target setup_test
-      OUTPUT_QUIET
+     --build ${CTEST_BINARY_DIRECTORY} --target setup_test
+      OUTPUT_QUIET RESULT_VARIABLE _res
       )
+    IF(NOT "${_res}" STREQUAL "0")
+      MESSAGE(FATAL_ERROR "\"setup_test\" target exited with an error. Bailing out.")
+    ENDIF()

     CTEST_TEST()
   ENDIF()
 ENDIF()

+#
+# Inject compiler information and svn revision into xml files:
+#
+
+FILE(STRINGS ${CTEST_BINARY_DIRECTORY}/Testing/TAG _tag LIMIT_COUNT 1)
+SET(_path "${CTEST_BINARY_DIRECTORY}/Testing/${_tag}")
+IF(NOT EXISTS ${_path})
+  MESSAGE(FATAL_ERROR "Unable to determine test submission files from TAG. Bailing out.")
+ENDIF()
+FILE(GLOB _xml_files ${_path}/*.xml)
+EXECUTE_PROCESS(COMMAND sed -i -e
+  s/CompilerName=\"\"/CompilerName=\"${_compiler_name}\"\\n\\tCompilerVersion=\"${_compiler_version}\"\\n\\tSVNRevision=\"${_svn_WC_REVISION}\"/g
+  ${_xml_files}
+  OUTPUT_QUIET RESULT_VARIABLE  _res
+  )
+IF(NOT "${_res}" STREQUAL "0")
+  MESSAGE(FATAL_ERROR "\"sed\" failed. Bailing out.")
+ENDIF()
+
+#
+# And finally submit:
+#
+
 CTEST_SUBMIT()


Update sugar_expected_number_of_arguments.cmake

--- cmake/utility/sugar_expected_number_of_arguments.cmake
+++ cmake/utility/sugar_expected_number_of_arguments.cmake
@@ -6,18 +6,6 @@

 include(sugar_fatal_error)

-# By default number of arguments passed to a function not controlled.
-# i.e. |function(my_function A B)| can be called with 3 arguments.
-# This function help to check this.
-#
-# Example:
-#     function(my_function A B)
-#       sugar_expected_number_of_arguments(${ARGC} 2)
-#       # ...
-#     endfunction()
-#
-#     my_function(1 2) # OK
-#     my_function(1 2 3) # ERROR
 function(sugar_expected_number_of_arguments given expected)
   # Do some self check.
   if(NOT ${ARGC} EQUAL 2)


Added git function to retrieve current hash.

--- cmake/GetGitRevisionDescription.cmake
+++ cmake/GetGitRevisionDescription.cmake
@@ -40,6 +40,7 @@
 get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)

 function(get_git_head_revision _refspecvar _hashvar)
+
 	set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
 	set(GIT_DIR "${GIT_PARENT_DIR}/.git")
 	while(NOT EXISTS "${GIT_DIR}")	# .git dir not found, search parent directories
@@ -73,6 +74,34 @@
 	set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
 endfunction()

+function(git_rev_parse _var)
+	if(NOT GIT_FOUND)
+		find_package(Git QUIET)
+	endif()
+	if(NOT GIT_FOUND)
+		set(${_var} "n/a" PARENT_SCOPE)
+		return()
+	endif()
+	get_git_head_revision(refspec hash)
+	if(NOT hash)
+		set(${_var} "n/a" PARENT_SCOPE)
+		return()
+	endif()
+
+	execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse ${ARGN} ${hash}
+		WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+		RESULT_VARIABLE res
+		OUTPUT_VARIABLE out
+		ERROR_QUIET
+		OUTPUT_STRIP_TRAILING_WHITESPACE)
+	if(NOT res EQUAL 0)
+		set(out "n/a")
+	endif()
+
+	set(${_var} "${out}" PARENT_SCOPE)
+endfunction()
+
+
 function(git_describe _var)
 	if(NOT GIT_FOUND)
 		find_package(Git QUIET)


Remove remnant of my experimentation with CMake.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -102,8 +102,6 @@
   endif( LLVM_BUILD_32_BITS )
 endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )

-message(STATUS "uno"
-"dos")
 if( MSVC_IDE AND ( MSVC90 OR MSVC10 ) )
   # Only Visual Studio 2008 and 2010 officially supports /MP.
   # Visual Studio 2005 do support it but it's experimental there.


Adding -fcolor-diagnostics is causing problem to users that parse the build
output. Peter Collingbourne also reports that it is showing up in
$(llvm-config --cflags).

Revert this for now since I don't know enough cmake to fix it properly.

This reverts commit 18efed7adc79c1970f307bb5b015d199012ba872.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -190,10 +190,6 @@
     if( SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG )
       add_llvm_definitions( -Wcovered-switch-default )
     endif()
-    check_cxx_compiler_flag("-Werror -fcolor-diagnostics" SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG)
-    if( SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG )
-      add_llvm_definitions( -fcolor-diagnostics )
-    endif()
   endif (LLVM_ENABLE_WARNINGS)
   if (LLVM_ENABLE_WERROR)
     add_llvm_definitions( -Werror )