Turn off flatc install given we are doing it by ourselves

--- build_tools/cmake/iree_copts.cmake
+++ build_tools/cmake/iree_copts.cmake
@@ -87,16 +87,15 @@
 set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
 set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "" FORCE)
 set(FLATBUFFERS_BUILD_GRPCTEST OFF CACHE BOOL "" FORCE)
+set(FLATBUFFERS_INSTALL OFF CACHE BOOL "" FORCE)
 set(FLATBUFFERS_INCLUDE_DIRS
   "${PROJECT_SOURCE_DIR}/third_party/flatbuffers/include/"
 )

 if(CMAKE_CROSSCOMPILING)
   set(FLATBUFFERS_BUILD_FLATC OFF CACHE BOOL "" FORCE)
-  set(FLATBUFFERS_INSTALL OFF CACHE BOOL "" FORCE)
 else()
   set(FLATBUFFERS_BUILD_FLATC ON CACHE BOOL "" FORCE)
-  set(FLATBUFFERS_INSTALL ON CACHE BOOL "" FORCE)
 endif()

 iree_select_compiler_opts(FLATBUFFERS_COPTS


Explicitly state source and result files for failing diffs so that it
is easier to find the right files when trying to update tests.

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

--- deal.II/cmake/macros/macro_add_test.cmake
+++ deal.II/cmake/macros/macro_add_test.cmake
@@ -152,7 +152,9 @@
                  ${_test_directory}/failing_diff
               && echo "${_test_full}: BUILD successful."
               && echo "${_test_full}: RUN successful."
-              && echo "${_test_full}: DIFF failed. Output:"
+              && echo "${_test_full}: DIFF failed. ------ Source: ${_comparison_file}"
+              && echo "${_test_full}: DIFF failed. ------ Result: ${_test_directory}/output"
+              && echo "${_test_full}: DIFF failed. ------ Diffs as follows:"
               && cat ${_test_directory}/failing_diff
               && exit 1)
         WORKING_DIRECTORY


[CMake] Fix source/DataFormatters/CMakeLists.txt include could not find load file SwiftAddCustomCommandTarget

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -8,7 +8,7 @@
   set(LLDB_PATH_TO_LLVM_BUILD "" CACHE PATH "Path to LLVM build tree")
   set(LLDB_PATH_TO_CLANG_BUILD "${LLDB_PATH_TO_LLVM_BUILD}" CACHE PATH "Path to Clang build tree")

-	# BEGIN Swift Mods
+  # BEGIN Swift Mods
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_LLVM_BUILD}" LLDB_PATH_TO_LLVM_BUILD)
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_CLANG_BUILD}" LLDB_PATH_TO_CLANG_BUILD)
   file(TO_CMAKE_PATH "${LLDB_PATH_TO_SWIFT_BUILD}" LLDB_PATH_TO_SWIFT_BUILD)
@@ -24,6 +24,11 @@

   # We set LLVM_CMAKE_PATH so that GetSVN.cmake is found correctly when building SVNVersion.inc
   set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules")
+
+  # BEGIN Swift Mods
+  # Required for SwiftAddCustomCommandTarget
+  list(APPEND CMAKE_MODULE_PATH "${LLDB_PATH_TO_SWIFT_SOURCE}/cmake/modules")
+  # END Swift Mods

   set(LLVM_MAIN_SRC_DIR ${LLVM_BUILD_MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
   set(LLVM_MAIN_INCLUDE_DIR ${LLVM_BUILD_MAIN_INCLUDE_DIR} CACHE PATH "Path to llvm/include")


Investigating bug on cluster

Investigating bug on cluster

Former-commit-id: 6d1c62d7f7eb9027c059d8f1a97ba67b884d8ba5

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -148,7 +148,7 @@
             BUILD_IN_SOURCE 1
             BUILD_COMMAND
                         export LD_LIBRARY_PATH=${GFORTRAN_PATH} &&
-                        export LDFLAGS=-L${GFORTRAN_PATH} -l${GFORTRAN_LIB} -l${QUADMATH_LIB} &&
+#                        export LDFLAGS=-L${GFORTRAN_PATH} -l${GFORTRAN_LIB} -l${QUADMATH_LIB} &&
                         $(MAKE) TARGET=SANDYBRIDGE
                         DYNAMIC_ARCH=1
                         USE_THREAD=${OpenBLAS_MULTITHREADED}


Remove quotes on gfortran flag

Remove quotes on gfortran flag

Per discussion here: https://github.com/OpenFAST/openfast/pull/595#issuecomment-767196369

The single quote on the `-fstack-reuse='none'` flag was creating issues in windows builds with gfortran.

--- cmake/OpenfastFortranOptions.cmake
+++ cmake/OpenfastFortranOptions.cmake
@@ -110,7 +110,7 @@
   # Disable stack reuse within routines: issues seen with gfortran 9.x, but others may also exhibit
   #   see section 3.16 of https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc.pdf
   #   and https://github.com/OpenFAST/openfast/pull/595
-  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-reuse='none'")
+  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fstack-reuse=none")

   # Deal with Double/Single precision
   if (DOUBLE_PRECISION)


Use a more sensible PLPLOT_TCL_VERSION value to quiet a warning message.

svn path=/trunk/; revision=12650

--- cmake/modules/plplot_version.cmake
+++ cmake/modules/plplot_version.cmake
@@ -5,6 +5,14 @@
 # Version data that need review and possible modification for each release.

 set(VERSION 5.9.10)
+
+# According to man package, PLPLOT_TCL_VERSION (used in the various
+# pkgIndex.tcl scripts) should be strictly numbers alternating with
+# decimal points with the first number (the major number) signifying
+# incompatible changes in the scripts.  To keep our life simple, let us
+# use the same as the VERSION above so long as it is strictly numerical.
+
+set(PLPLOT_TCL_VERSION ${VERSION})

 # CPack version numbers for release tarball name.
 set(CPACK_PACKAGE_VERSION_MAJOR 5)
@@ -71,11 +79,3 @@

 set(plplotada_SOVERSION 1)
 set(plplotada_VERSION ${plplotada_SOVERSION}.0.0)
-
-# According to man package, PLPLOT_TCL_VERSION (used in the various
-# pkgIndex.tcl scripts) should be strictly numbers alternativing with
-# decimal points with the first number (the major number) signifying
-# incompatible changes in the scripts.  To keep our life simple, let us
-# use the major number from the package version for now.
-
-set(PLPLOT_TCL_VERSION 5)


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/Buffer/hunter.cmake
+++ cmake/projects/Buffer/hunter.cmake
@@ -7,7 +7,7 @@
     PACKAGE_NAME
     Buffer
     VERSION
-    "0.1.3"
+    "0.1.4"
     URL
     "https://github.com/designerror/buffer/archive/v0.1.4.tar.gz"
     SHA1


Comment about tags

Comment about tags

--- cmake/projects/libigl/hunter.cmake
+++ cmake/projects/libigl/hunter.cmake
@@ -9,6 +9,8 @@
 include(hunter_download)
 include(hunter_pick_scheme)

+# Tags v1.3.3 and v2.0.0 are the same:
+# - https://github.com/hunter-packages/libigl/pull/1#issuecomment-495176368
 hunter_add_version(
     PACKAGE_NAME
     libigl


qi_stage_bin: create install rule for -config.cmake file

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

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -581,6 +581,12 @@
   set(_res "${_res} ${_vars}")
   set(_sdk_file "${QI_SDK_DIR}/${QI_SDK_CMAKE_MODULES}/${_l_target}-config.cmake")
   file(WRITE "${_sdk_file}" "${_res}")
+
+  set(_redist_file "${CMAKE_BINARY_DIR}/${QI_SDK_CMAKE_MODULES}/sdk/${_l_target}-config.cmake")
+  file(WRITE ${_redist_file} "
+find_program(${_U_target}_EXECUTABLE ${target})
+")
+  _qi_install_redist_file(${_redist_file} ${target} ${_l_target})
 endfunction()

 #


Don't add custom target or empty options if no resources are specified.

--- cmake/usFunctionAddResources.cmake
+++ cmake/usFunctionAddResources.cmake
@@ -124,6 +124,17 @@
     endforeach()
   endif()

+  if(NOT US_RESOURCE_FILES AND NOT _zip_args)
+    return()
+  endif()
+
+  if(US_RESOURCE_FILES)
+    set(_file_args -a ${US_RESOURCE_FILES})
+  endif()
+  if(_zip_args)
+    set(_zip_args -m ${_zip_args})
+  endif()
+
   # This command depends on the given resource files and creates a source
   # file which must be added to the source list of the related target.
   # This way, the following command is executed if the resources change
@@ -140,7 +151,7 @@
   add_custom_command(
     TARGET ${US_RESOURCE_TARGET}
     POST_BUILD
-    COMMAND ${resource_compiler} ${cmd_line_args} $<TARGET_FILE:${US_RESOURCE_TARGET}> ${US_RESOURCE_MODULE_NAME} -a ${US_RESOURCE_FILES} -m ${_zip_args}
+    COMMAND ${resource_compiler} ${cmd_line_args} $<TARGET_FILE:${US_RESOURCE_TARGET}> ${US_RESOURCE_MODULE_NAME} ${_file_args} ${_zip_args}
     WORKING_DIRECTORY ${US_RESOURCE_WORKING_DIRECTORY}
     COMMENT "Adding resources to ${US_RESOURCE_TARGET}"
     VERBATIM


Correctly set gtest 1.8 root directory (#1014)

In gtest version 1.8 or higher, there is a CMakeLists.txt in the
parent directory of the gtest source directory which we need to find.
This can be either /usr/src/googletest or
${CMAKE_SOURCE_DIR}/googletest.

The current version would only check in /usr/src/googletest even if
gtest was found in the project's src/ directory.

This would break the build on Ubuntu 18.04, where the system install of
gmock is version 1.8, if your project includes a newer version of gtest
in its src/ directory. The result would be that headers from src/ would
be used, but the test executables would be linked to the binaries from
/usr/src.

--- cmake/test/gtest.cmake
+++ cmake/test/gtest.cmake
@@ -280,9 +280,12 @@
   #In googletest 1.8, gmock and gtest where merged inside googletest
   #In this case, including gmock builds gmock twice, so instead we need to include googletest
   #which will include gtest and gmock once
-  set(_global_base_dir "${src_path}/googletest")
-  if(EXISTS "${_global_base_dir}/CMakeLists.txt")
-    set(${base_dir} ${_global_base_dir} PARENT_SCOPE)
+  if(_gtest_found)
+    get_filename_component(_gtest_base_dir_realpath ${_gtest_base_dir} REALPATH)
+    get_filename_component(_global_base_dir ${_gtest_base_dir_realpath} PATH)
+    if(EXISTS "${_global_base_dir}/CMakeLists.txt")
+      set(${base_dir} ${_global_base_dir} PARENT_SCOPE)
+    endif()
   endif()
 endfunction()


Don't hardcode version

Don't hardcode version

git-svn-id: 7928e23e4d58c5ca14aa7b47c53aeff82ee1dd0c@705092 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

--- bindings/c/taglib_c.pc.cmake
+++ bindings/c/taglib_c.pc.cmake
@@ -7,6 +7,6 @@
 Name: TagLib C Bindings
 Description: Audio meta-data library (C bindings)
 Requires: taglib
-Version: 1.4
+Version: ${TAGLIB_LIB_MAJOR_VERSION}.${TAGLIB_LIB_MINOR_VERSION}.${TAGLIB_LIB_PATCH_VERSION}
 Libs: -L${LIB_INSTALL_DIR} -ltag_c
 Cflags: -I=${INCLUDE_INSTALL_DIR}/taglib


BUG: Update VTK minimum version (for release)

If you look at the version number for VTK for the 19 april 2011,
the VTK version is set to 5.9.0, so this version number makes no sense.
I updated the version to 5.10.0, which is known to work with VTKGlue.

Bug reported by Norman K Williams on the ITK mailing list.

Change-Id: I55f13f539e9a47682f0ce5dcdb2bdd4b85f2f745

--- Modules/Bridge/VtkGlue/itk-module-init.cmake
+++ Modules/Bridge/VtkGlue/itk-module-init.cmake
@@ -3,7 +3,7 @@
 #

 # Needed VTK version
-set(VERSION_MIN "5.9.20110419")
+set(VERSION_MIN "5.10.0")

 # Look for VTK
 find_package(VTK REQUIRED)


Letting Elemental pass the build type

Letting Elemental pass the build type

--- external/elemental/cmake/elemental_sub.cmake
+++ external/elemental/cmake/elemental_sub.cmake
@@ -1,4 +1,5 @@
 set(LIBRARY_TYPE ${LIBRARY_TYPE} PARENT_SCOPE)
+string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)
 set(CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE} ${CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE}} PARENT_SCOPE)
 set(MPI_C_COMPILER ${MPI_C_COMPILER} PARENT_SCOPE)
 set(MPI_C_INCLUDE_PATH ${MPI_C_INCLUDE_PATH} PARENT_SCOPE)


android(toolchain): detailed error message

--- platforms/android/android.toolchain.cmake
+++ platforms/android/android.toolchain.cmake
@@ -810,7 +810,7 @@
 # validate
 list( FIND ANDROID_SUPPORTED_NATIVE_API_LEVELS "${ANDROID_NATIVE_API_LEVEL}" __levelIdx )
 if( __levelIdx EQUAL -1 )
- message( SEND_ERROR "Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain." )
+ message( SEND_ERROR "Specified Android native API level 'android-${ANDROID_NATIVE_API_LEVEL}' is not supported by your NDK/toolchain.\nSupported values of ANDROID_NATIVE_API_LEVEL: ${ANDROID_SUPPORTED_NATIVE_API_LEVELS}" )
 else()
  if( BUILD_WITH_ANDROID_NDK )
   __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )


[ci] fix allow_parallel_build option

[ci] fix allow_parallel_build option

--- ci_gitlab/ctest_common.cmake
+++ ci_gitlab/ctest_common.cmake
@@ -33,7 +33,10 @@
 cmake_host_system_information(RESULT fqdn QUERY FQDN)
 cmake_host_system_information(RESULT NP QUERY NUMBER_OF_LOGICAL_CORES)

-set(ALLOW_PARALLEL_BUILD 1 CACHE BOOL "Allow parallel build")
+if(NOT DEFINED ALLOW_PARALLEL_BUILD)
+  set(ALLOW_PARALLEL_BUILD ON)
+endif()
+option(ALLOW_PARALLEL_BUILD "Allow parallel build" ${ALLOW_PARALLEL_BUILD})
 if(NOT ALLOW_PARALLEL_BUILD)
   set(NP 1)
 endif()


Disable test-stressproof for the time being

--- test/CTestCustom.cmake
+++ test/CTestCustom.cmake
@@ -1,7 +1,8 @@
 #---Custom CTest settings---------------------------------------------------

-set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
-    test-stressgui)
+set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}
+    test-stressgui
+    test-stressproof)

 if(WIN32)
   set(CTEST_CUSTOM_TESTS_IGNORE ${CTEST_CUSTOM_TESTS_IGNORE}


Build System

Build System

Modifying the cmake module to add Boost test with fixture

--- cmake/BoostTestHelpers.cmake
+++ cmake/BoostTestHelpers.cmake
@@ -20,9 +20,20 @@
    endif()

     string(REGEX MATCHALL "BOOST_AUTO_TEST_CASE\\( *([A-Za-z_0-9]+) *\\)"
-           FOUND_TESTS ${SOURCE_FILE_CONTENTS})
+        FOUND_AUTO_TESTS ${SOURCE_FILE_CONTENTS})

-    foreach(HIT ${FOUND_TESTS})
+    foreach(HIT ${FOUND_AUTO_TESTS})
+        string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+) *\\).*" "\\1" TEST_NAME ${HIT})
+
+        add_test(NAME "${TEST_EXECUTABLE_NAME}.${TEST_NAME}"
+                 COMMAND ${TEST_EXECUTABLE_NAME}
+                 --run_test=${SUITE_NAME}/${TEST_NAME} --catch_system_error=yes)
+    endforeach()
+
+    string(REGEX MATCHALL "BOOST_FIXTURE_TEST_CASE\\( *([A-Za-z_0-9]+) *\\)"
+        FOUND_FIXTURE_TESTS ${SOURCE_FILE_CONTENTS})
+
+    foreach(HIT ${FOUND_FIXTURE_TESTS})
         string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+) *\\).*" "\\1" TEST_NAME ${HIT})

         add_test(NAME "${TEST_EXECUTABLE_NAME}.${TEST_NAME}"


pch update

pch update

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@9047 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/CMakePCHCompiler.cmake
+++ cmake/CMakePCHCompiler.cmake
@@ -11,6 +11,10 @@

 # Create precompiled header
 function(add_precompiled_header pch_target header)
+       # Relocate file
+       configure_file(${header} ${CMAKE_CURRENT_BINARY_DIR}/${pch_target}.h COPYONLY)
+       set(header ${CMAKE_CURRENT_BINARY_DIR}/${pch_target}.h)
+
        set(lang ${CMAKE_PCH_COMPILER_LANGUAGE})
        if(NOT MSVC AND
 	  NOT CMAKE_COMPILER_IS_GNU${lang} AND
@@ -34,9 +38,10 @@

 	add_library(${pch_target} OBJECT ${header})
 	set_target_properties(${pch_target} PROPERTIES
-        COMPILE_DEFINITIONS gismo_EXPORTS
+	#COMPILE_DEFINITIONS ${preDefs} # exports
 	POSITION_INDEPENDENT_CODE ON # bug: no effect, need fPIC later
-        LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${pch_target}.dir")
+	LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${pch_target}.dir"
+	)

 	if(MSVC)
 		# ensure pdb goes to the same location, otherwise we get C2859
@@ -52,11 +57,8 @@
 		COMPILE_FLAGS "${CMAKE_CXX_COMPILE_OPTIONS_PIC} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" )
 	endif()

-        set_source_files_properties(
-		${header}
-		PROPERTIES
-		LANGUAGE ${lang}PCH
-		COMPILE_FLAGS ${flags} )
+        set_source_files_properties(${header} PROPERTIES
+		LANGUAGE ${lang}PCH COMPILE_FLAGS ${flags} )
 endfunction()

 # Use precompiled header
@@ -73,23 +75,27 @@
 		return()
 	endif()
         add_dependencies(${target} ${pch_target})
-	get_target_property(target_hdr ${pch_target} SOURCES)
+	get_target_property(header_name ${pch_target} SOURCES)
+	get_filename_component(header_name "${header_name}" NAME)
+
+	get_target_property(pre_defs ${target} COMPILE_DEFINITIONS)
+	set_target_properties(${pch_target} PROPERTIES COMPILE_DEFINITIONS "${pre_defs}")
+
 	get_target_property(target_dir ${pch_target} LIBRARY_OUTPUT_DIRECTORY)
         # Note: modification in pch file will not trigger target
 	# re-compilation without the next lines:
         #add_custom_target(${target}-pch DEPENDS ${target_hdr})
         #add_dependencies(${target} ${target}-pch)
 	if(MSVC)
-		get_filename_component(win_header "${target_hdr}" NAME)
-		file(TO_NATIVE_PATH "${target_dir}/${target_hdr}" win_pch)
+		file(TO_NATIVE_PATH "${target_dir}/${header_name}" win_pch)
 		# /Yu - use given include as precompiled header
 		# /Fp - exact location for precompiled header
 		# /FI - force include of precompiled header
-		set(flags "/Yu${win_header} /Fp${win_pch} /FI${win_header}")
-	else()
-		#Note: ${target_dir}/${target_hdr} does not exist, so PCH is used
+		set(flags "/Yu${header_name} /Fp${win_pch} /FI${heaeder_name}")
+	else()
+		#Note: ${target_dir}/${header_name} does not exist, so PCH is used
 		# -H: "!" used OK, "x" not used
-		set(flags "-Winvalid-pch -include ${target_dir}/${target_hdr}") # -H
+		set(flags "-Winvalid-pch -include ${target_dir}/${header_name} -H")
 	endif()
 	set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${flags}")
 endfunction()


Clang fix

Clang fix

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -10,7 +10,8 @@
 endif()

-if (CMAKE_CXX_COMPILER_ID MATCHES clang)
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+	message (STATUS "Detected Clang compiler")
 	set (CXX_EXTRA "${CXX_EXTRA} -Wno-error=non-pod-varargs")
 endif()


Less output when building OpenSSL.

Less output when building OpenSSL.

--- cmake/external/OpenSSL.cmake
+++ cmake/external/OpenSSL.cmake
@@ -11,8 +11,8 @@
         URL_HASH SHA256=${OpenSSL_SHA256}
         CONFIGURE_COMMAND perl Configure VC-WIN64A "--prefix=${OpenSSL_PREFIX}"
         BUILD_IN_SOURCE 1
-        BUILD_COMMAND "ms\\do_win64a.bat"
-            COMMAND nmake -f "ms\\ntdll.mak"
+        BUILD_COMMAND "ms\\do_win64a.bat" >NUL
+            COMMAND nmake -S -f "ms\\ntdll.mak"
         INSTALL_COMMAND nmake -f "ms\\ntdll.mak" install
     )
 else()
@@ -22,9 +22,9 @@
         URL_HASH SHA256=${OpenSSL_SHA256}
         CONFIGURE_COMMAND perl Configure VC-WIN32 "--prefix=${OpenSSL_PREFIX}"
         BUILD_IN_SOURCE 1
-        BUILD_COMMAND "ms\\do_ms.bat"
-            COMMAND "ms\\do_nasm.bat"
-            COMMAND nmake -f "ms\\ntdll.mak"
+        BUILD_COMMAND "ms\\do_ms.bat" >NUL
+            COMMAND "ms\\do_nasm.bat" >NUL
+            COMMAND nmake -S -f "ms\\ntdll.mak"
         INSTALL_COMMAND nmake -f "ms\\ntdll.mak" install
     )
 endif()


build: remove `PRIVATE_LINK_LIBRARIES` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -755,7 +755,6 @@
         INCORPORATE_OBJECT_LIBRARIES_SHARED_ONLY
         LINK_FLAGS
         LLVM_LINK_COMPONENTS
-        PRIVATE_LINK_LIBRARIES
         SWIFT_COMPILE_FLAGS)

   cmake_parse_arguments(SWIFTLIB_SINGLE
@@ -1142,36 +1141,6 @@
     ${link_libraries})
   target_link_directories(${target} PRIVATE
     ${library_search_directories})
-
-  # Adjust the linked libraries for windows targets.  On Windows, the link is
-  # performed against the import library, and the runtime uses the dll.  Not
-  # doing so will result in incorrect symbol resolution and linkage.  We created
-  # import library targets when the library was added.  Use that to adjust the
-  # link libraries.
-  if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
-    foreach(library_list PRIVATE_LINK_LIBRARIES)
-      set(import_libraries)
-      foreach(library ${SWIFTLIB_SINGLE_${library_list}})
-        # Ensure that the library is a target.  If an absolute path was given,
-        # then we do not have an import library associated with it.  This occurs
-        # primarily with ICU (which will be an import library).  Import
-        # libraries are only associated with shared libraries, so add an
-        # additional check for that as well.
-        set(import_library ${library})
-        if(TARGET ${library})
-          get_target_property(type ${library} TYPE)
-          if(${type} STREQUAL "SHARED_LIBRARY")
-            set(import_library ${library}_IMPLIB)
-          endif()
-        endif()
-        list(APPEND import_libraries ${import_library})
-      endforeach()
-      set(SWIFTLIB_SINGLE_${library_list} ${import_libraries})
-    endforeach()
-  endif()
-
-  target_link_libraries("${target}" PRIVATE
-      ${SWIFTLIB_SINGLE_PRIVATE_LINK_LIBRARIES})

   # NOTE(compnerd) use the C linker language to invoke `clang` rather than
   # `clang++` as we explicitly link against the C++ runtime.  We were previously


When compiling with lto enabled, use -gline-tables-only instead of -g when debugging is enabled.

-g uses too much memory. -g-line-stables at least lets you get stack traces,
etc.

This is also what clang does IIRC.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -136,7 +136,11 @@

   is_build_type_with_debuginfo("${CFLAGS_BUILD_TYPE}" debuginfo)
   if(debuginfo)
-    list(APPEND result "-g")
+    if(SWIFT_ENABLE_LTO)
+      list(APPEND result "-gline-tables-only")
+    else()
+      list(APPEND result "-g")
+    endif()
   else()
     list(APPEND result "-g0")
   endif()


[cmake] FindElpa search either for elpa or elpa_openmp

--- cmake/modules/FindElpa.cmake
+++ cmake/modules/FindElpa.cmake
@@ -3,7 +3,7 @@
 include(FindPackageHandleStandardArgs)
 find_package(PkgConfig)

-pkg_search_module(_ELPA elpa)
+pkg_search_module(_ELPA elpa elpa_openmp)

 find_library(ELPA_LIBRARIES
   NAMES elpa elpa_openmp


fix: allow gRPC to take protobuf from custom pkgconfig path

Co-Authored-By: Leonardo Di Donato <2012e0ca99d70aa6c893822ff73002216e5dba72@gmail.com>
Signed-off-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>

--- cmake/modules/FindGRPC.cmake
+++ cmake/modules/FindGRPC.cmake
@@ -15,6 +15,7 @@
        "Build a static version of gRPC (useful for building in Operating Systems that don't have the gRPC package)" OFF)

 if(NOT BUILD_STATIC_GRPC)
+  # todo(fntlnz, leodido): check that gRPC version is greater or equal than 1.8.0
   find_path(GRPCXX_INCLUDE NAMES grpc++/grpc++.h)
   if(GRPCXX_INCLUDE)
     set(GRPC_INCLUDE ${GRPCXX_INCLUDE})
@@ -56,6 +57,7 @@
     CONFIGURE_COMMAND ""
     BUILD_COMMAND
       CFLAGS=-Wno-implicit-fallthrough
+      PKG_CONFIG_PATH=${PROTOBUF_SRC}
       PKG_CONFIG=${PKG_CONFIG_EXECUTABLE}
       make
       grpc_cpp_plugin


small fix in FindROOT.cmake

small fix in FindROOT.cmake

--- cmake/modules/FindROOT.cmake
+++ cmake/modules/FindROOT.cmake
@@ -145,7 +145,6 @@
   String(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}")
   Set(OUTFILES ${OUTFILE} ${bla})
 #Remove file from dictionary building
-  list(REMOVE_ITEM INFILES "SORNotifier.h")
   Foreach (_current_FILE ${INFILES})
 #Remove file from dictionary generations
     if(NOT ${_current_FILE} STREQUAL "SORNotifier.h")


[cmake] Don't set install rules for tblgen if building utils is disabled

Summary:
This is a follow up to D64032. Afterwards if building utils is disabled
and cross compilation is attempted, CMake will complain that adding
`install()` directives to targets with EXCLUDE_FROM_ALL set is "undefined".
Indeed, it appears depending on the CMake version and the selected
Generator, the install rule will error because the underlying target isn't
built. Fix that by not adding the install rule if building utils is not
requested. Note that this doesn't prevent building tblgen as a
dependency in not cross-build, even if building tools is disabled.

Reviewed By: smeenai
Differential Revision: https://reviews.llvm.org/D64225

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -147,7 +147,7 @@
     endif()
   endif()

-  if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+  if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
     set(export_to_llvmexports)
     if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
         NOT LLVM_DISTRIBUTION_COMPONENTS)


On Android, do not set CUSTOM_MEMORY_MANAGEMENT to 1 if it is already set to 0.

--- cmake/platform/android.cmake
+++ cmake/platform/android.cmake
@@ -1,7 +1,7 @@

 macro(verify_tools)
     # TODO: don't do this if the user is supplying their own curl/openssl/zlib
-    # minimum version of cmake that
+    # minimum version of cmake that
     #   (1) supports ExternalProject_Add URL_HASH
     #   (2) correctly extracts OPENSSL's version number from openssl/opensslv.h in version 1.0.2d
     cmake_minimum_required (VERSION 3.1.2)
@@ -41,7 +41,7 @@

         # With gnustl, API level can go as low as 3, but let's make a reasonably modern default
         if(NOT ANDROID_NATIVE_API_LEVEL)
-            set(ANDROID_NATIVE_API_LEVEL "android-19")
+            set(ANDROID_NATIVE_API_LEVEL "android-19")
         endif()

         set(STANDALONE_TOOLCHAIN_STL "gnustl")
@@ -170,7 +170,7 @@
                 set(__MAKE_TOOLCHAIN_OPTIONS "${__MAKE_TOOLCHAIN_OPTIONS} --ndk-dir=${NDK_DIR} --toolchain=${__TOOLCHAIN} ${LLVM_OPTIONS} --platform=${ANDROID_NATIVE_API_LEVEL}")

                 execute_process(
-                    COMMAND ${TOOLCHAIN_SCRIPT_HOST} ${NDK_DIR}/build/tools/make-standalone-toolchain.sh --ndk-dir=${NDK_DIR} --toolchain=${__TOOLCHAIN} ${LLVM_OPTIONS}
+                    COMMAND ${TOOLCHAIN_SCRIPT_HOST} ${NDK_DIR}/build/tools/make-standalone-toolchain.sh --ndk-dir=${NDK_DIR} --toolchain=${__TOOLCHAIN} ${LLVM_OPTIONS}
                     --platform=${ANDROID_NATIVE_API_LEVEL} --stl=${STANDALONE_TOOLCHAIN_STL} --install-dir=${STANDALONE_TOOLCHAIN_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                 )
             else()
@@ -204,7 +204,10 @@
     set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/platform/android.toolchain.cmake)

     # android-specific required overrrides
-    set(CUSTOM_MEMORY_MANAGEMENT "1")
+    if (NOT DEFINED CUSTOM_MEMORY_MANAGEMENT)
+        set(CUSTOM_MEMORY_MANAGEMENT "1")
+    endif()
+
     set(ANDROID_STL_FORCE_FEATURES "OFF")

     # android-specific parameter defaults


add dbus path

add dbus path

--- cmake_modules/FindDBus.cmake
+++ cmake_modules/FindDBus.cmake
@@ -71,6 +71,7 @@
     PATHS
     /usr/lib/dbus-1.0/include
     /usr/lib/i386-linux-gnu/dbus-1.0/include/
+    /usr/lib/x86_64-linux-gnu/dbus-1.0/include/
     include/
     include/dbus-1.0/
     dbus-1.0/


idl-config: qi_create_interface

idl-config: qi_create_interface

Change-Id: Idd766ae60b0525d06e8d4a806a2a089d8494891b
Reviewed-on: http://gerrit.aldebaran.lan:8080/17223
Reviewed-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>
Tested-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -36,6 +36,21 @@
       -c ${class_name}
       -o ${output_dir}/${_filename}
       -m proxyFuture)
+endfunction()
+
+function(qi_create_interface idl class_name output_dir _out)
+  _qi_find_idl(IDL)
+  string(TOLOWER ${class_name} _filename)
+  set(_filename "${_filename}_interface.hpp")
+  message("tgt ${output_dir}/${_filename}")
+  set(${_out} ${output_dir}/${_filename} PARENT_SCOPE)
+  qi_generate_src(${output_dir}/${_filename}
+    SRC ${idl}
+    COMMAND ${_python_executable} ${IDL}
+      ${idl}
+      -c ${class_name}
+      -o ${output_dir}/${_filename}
+      -m interface)
 endfunction()

 #! Create an IDL file by parsing C++ header files.


fixes cmake find script

fixes cmake find script

--- cmake/Modules/FindJSONBOX.cmake
+++ cmake/Modules/FindJSONBOX.cmake
@@ -17,8 +17,8 @@
     /opt/local
     /opt/csw
     /opt
-    "/Program Files (x86)/JsonBox"
-    "/Program Files/JsonBox")
+    "/Program Files (x86)"
+    "/Program Files")

 if(JSONBOX_ROOT)
 	SET(JSONBOX_INCLUDE_DIR "${JSONBOX_ROOT}/include")
@@ -43,7 +43,7 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(JSONBOX DEFAULT_MSG JSONBOX_LIBRARY JSONBOX_INCLUDE_DIR)

-set(JSONBOX_INCLUDE_DIR "${JSONBOX_INCLUDE_DIR}")
+set(JSONBOX_INCLUDE_DIR "${JSONBOX_INCLUDE_DIR}/JsonBox/include")
 set(JSONBOX_LIBRARIES optimized "${JSONBOX_LIBRARY}" debug "${JSONBOX_LIBRARY_DEBUG}")

 if(NOT JSONBOX_FOUND)


fixed FindSQLite3.cmake FIND_LIBRARY name

--- cmake/Modules/FindSQLite3.cmake
+++ cmake/Modules/FindSQLite3.cmake
@@ -19,7 +19,7 @@
 FIND_PATH(SQLITE3_INCLUDE_DIR NAMES sqlite3.h)

 # Look for the library.
-FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite)
+FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)

 # Handle the QUIETLY and REQUIRED arguments and set SQLITE3_FOUND to TRUE if all listed variables are TRUE.
 INCLUDE(FindPackageHandleStandardArgs)


Forward additional arguments for 3rdparty add macro.

--- cmake/ProjectGlobalMacros.cmake
+++ cmake/ProjectGlobalMacros.cmake
@@ -53,12 +53,12 @@

 # Add 3rdparty for main file
 macro(project_add_3rdparty name)
-  add_subdirectory(3rdparty/${name})
+  add_subdirectory(3rdparty/${name} ${ARGN})
 endmacro(project_add_3rdparty)

 # Add module for main file
 macro(project_add_module name)
-  add_subdirectory(src/${name})
+  add_subdirectory(src/${name} ${ARGN})
 endmacro(project_add_module)

 # Enable coverage


Cmake: use old style cxx flags

Cmake: use old style cxx flags

--- cmake/SuperStrictWarnings.cmake
+++ cmake/SuperStrictWarnings.cmake
@@ -2,15 +2,6 @@

 else()

-	add_compile_options( -Woverloaded-virtual -Wctor-dtor-privacy -Wconversion
-                      -Wformat=2 -Winit-self -Winline -Wmissing-include-dirs
-                      -Wredundant-decls -Wshadow -Wstack-protector
-                      -Wstrict-null-sentinel -Wswitch-default -Winvalid-pch
-                      -Wstrict-aliasing=2 -Wunknown-pragmas -Wundef
-                      -Wpointer-arith -Wcast-qual -Wwrite-strings
-                      -Wvolatile-register-var -Wno-unused-parameter
-                      -Wno-variadic-macros -Wunreachable-code -Wcast-align
-                      #-Wzero-as-null-pointer-constant #commented because Cmake generate crappy code
-					  -Wold-style-cast)
+	SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS}  -Woverloaded-virtual -Wctor-dtor-privacy -Wconversion -Wformat=2 -Winit-self -Winline     -Wmissing-include-dirs-Wredundant-decls -Wshadow -Wstack-protector -Wstrict-null-sentinel -Wswitch-default -Winvalid-pch -Wstrict-aliasing=2 -Wunknown-pragmas -Wundef -Wpointer-arith -Wcast-qual -Wwrite-strings -Wvolatile-register-var -Wno-unused-parameter -Wno-variadic-macros -Wunreachable-code -Wcast-align -Wold-style-cast")

 endif()


Use post-build event for size() function

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -97,12 +97,12 @@
 endfunction()

 #
-# Prints size of ELF file named `elfFilename`.
+# Prints size of output file of `target`.
 #

-function(size elfFilename)
-	add_custom_target(${elfFilename}-size ALL
-			COMMAND ${CMAKE_SIZE} -B ${elfFilename}
-			DEPENDS ${elfFilename}
+function(size target)
+	add_custom_command(TARGET ${target} POST_BUILD
+			COMMAND ${CMAKE_SIZE} -B $<TARGET_FILE:${target}>
+			VERBATIM
 			USES_TERMINAL)
 endfunction()


cmake: Search dependencies for mongo-cxx-driver stuff. Use include dir rather than mongo dir for finding the include directory.

--- cmake/modules/FindMongoDB.cmake
+++ cmake/modules/FindMongoDB.cmake
@@ -17,10 +17,11 @@

 else(MONGO_INCLUDE_DIR AND MONGO_LIBRARIES)

-	find_path(MONGO_INCLUDE_DIR client/dbclient.h
-	  /usr/include/mongo
-	  /usr/local/include/mongo
-	  /opt/local/include/mongo
+	find_path(MONGO_INCLUDE_DIR mongo/client/dbclient.h
+	  /usr/include
+	  /usr/local/include
+	  /opt/local/include
+	  ${PROJECT_SOURCE_DIR}/dependencies/mongo-cxx-driver/include
     )

   find_library(MONGO_LIBRARIES NAMES mongoclient  libmongoclient
@@ -28,6 +29,7 @@
     /usr/lib
     /usr/local/lib
     /opt/local/lib
+    ${PROJECT_SOURCE_DIR}/dependencies/mongo-cxx-driver/lib
     )

   GET_FILENAME_COMPONENT(MONGO_LIBRARY_DIR ${MONGO_LIBRARIES} PATH)


s/ZSTRING/STRING/

s/ZSTRING/STRING/

--- include/zorba/config.h.cmake
+++ include/zorba/config.h.cmake
@@ -153,7 +153,7 @@

 // Zorba parser configuration
 #cmakedefine ZORBA_DEBUG_PARSER
-#cmakedefine ZORBA_DEBUG_ZSTRING
+#cmakedefine ZORBA_DEBUG_STRING

 // Zorba runtime configuration parameters
 #define ZORBA_BATCHING_TYPE         ${ZORBA_BATCHING_TYPE}


cmake(android): update zlib alias condition

To use 'z' in Android.mk instead of absolute path from the build machine.

--- cmake/OpenCVFindLibsGrfmt.cmake
+++ cmake/OpenCVFindLibsGrfmt.cmake
@@ -8,8 +8,7 @@
 else()
   find_package(ZLIB "${MIN_VER_ZLIB}")
   if(ZLIB_FOUND AND ANDROID)
-    if(ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib/libz.so" OR
-        ZLIB_LIBRARIES STREQUAL "${ANDROID_SYSROOT}/usr/lib64/libz.so")
+    if(ZLIB_LIBRARIES MATCHES "/usr/(lib|lib32|lib64)/libz.so$")
       set(ZLIB_LIBRARIES z)
     endif()
   endif()


Add support for DEPENDENTS to distortosSetConfiguration(BOOLEAN ...)

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -116,7 +116,7 @@
 #

 function(distortosSetBooleanConfiguration name help)
-	cmake_parse_arguments(PARSE_ARGV 2 BOOL "FORCE;INTERNAL" "" "")
+	cmake_parse_arguments(PARSE_ARGV 2 BOOL "FORCE;INTERNAL" "" "DEPENDENTS")
 	list(LENGTH BOOL_UNPARSED_ARGUMENTS length)
 	if(NOT length EQUAL 1)
 		message(FATAL_ERROR "Invalid arguments: \"${BOOL_UNPARSED_ARGUMENTS}\"")
@@ -129,6 +129,13 @@
 		set(force FORCE)
 	else()
 		unset(force)
+	endif()
+
+	if(NOT ${name} AND BOOL_DEPENDENTS)
+		string(REPLACE ";" ", " dependents "${BOOL_DEPENDENTS}")
+		message(STATUS "Auto-enabling ${name}. Dependents: ${dependents}")
+		set(defaultValue ON)
+		set(force FORCE)
 	endif()

 	if(NOT BOOL_INTERNAL)
@@ -259,9 +266,9 @@
 #
 # Sets new distortos cache configuration named `name` with type `type`.
 #
-# `distortosSetConfiguration(BOOLEAN name defaultValue [generic-options])`
+# `distortosSetConfiguration(BOOLEAN name defaultValue [DEPENDENTS [dependent1 [dependent2 [...]]]] [generic-options])`
 # `distortosSetConfiguration(INTEGER name defaultValue [MIN min] [MAX max] [generic-options])`
-# `distortosSetConfiguration(STRING name string1 [[[string2] string3] ...] [generic-options])`
+# `distortosSetConfiguration(STRING name string1 [string2 [string3 [...]]] [generic-options])`
 #
 # generic options:
 # - `[FORCE]` - forces the value of cache entry to `defaultValue`;
@@ -277,7 +284,8 @@
 # is omitted; must not be used with `NO_OUTPUT`;
 #
 # `BOOLEAN` variant
-# `defaultValue` must be either `ON` or `OFF`.
+# `defaultValue` must be either `ON` or `OFF`. If `DEPENDENTS` is a non-empty list, then this option will be
+# auto-enabled.
 #
 # `INTEGER` variant
 # `defaultValue`, `min` and `max` must be decimal integers in [-2147483648; 2147483647] range. -2147483648 is used as


Fix some CMake conditions in `distortosSetConfiguration()` handling

When using `cmake_parse_arguments()` checking for keywords should be
done with `if(DEFINED <prefix>_<keyword>)`. Using just
`if(<prefix>_<keyword>)` will result in FALSE when the keyword is
defined but its value is 0.

This is a problem in case of `distortosSetConfiguration(INTEGER ...)`,
where `MIN` or `MAX` may be set to zero.

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -122,7 +122,7 @@
 		message(FATAL_ERROR "Invalid arguments: \"${BOOL_UNPARSED_ARGUMENTS}\"")
 	endif()

-	if(BOOL_DEPENDENTS AND BOOL_OFF_DEPENDENTS)
+	if(DEFINED BOOL_DEPENDENTS AND DEFINED BOOL_OFF_DEPENDENTS)
 		message(FATAL_ERROR "Only one of DEPENDENTS and OFF_DEPENDENTS may be used")
 	endif()

@@ -135,13 +135,13 @@
 		unset(force)
 	endif()

-	if(NOT ${name} AND BOOL_DEPENDENTS)
+	if(NOT ${name} AND DEFINED BOOL_DEPENDENTS)
 		string(REPLACE ";" ", " dependents "${BOOL_DEPENDENTS}")
 		message(STATUS "Auto-enabling ${name}. Dependents: ${dependents}")
 		set(defaultValue ON)
 		set(force FORCE)
 	endif()
-	if(${name} AND BOOL_OFF_DEPENDENTS)
+	if(${name} AND DEFINED BOOL_OFF_DEPENDENTS)
 		string(REPLACE ";" ", " offDependents "${BOOL_OFF_DEPENDENTS}")
 		message(STATUS "Auto-disabling ${name}. Off-dependents: ${offDependents}")
 		set(defaultValue OFF)
@@ -177,10 +177,10 @@
 		message(FATAL_ERROR "Invalid arguments: \"${INTEGER_UNPARSED_ARGUMENTS}\"")
 	endif()

-	if(NOT INTEGER_MIN)
+	if(NOT DEFINED INTEGER_MIN)
 		set(INTEGER_MIN -2147483648)
 	endif()
-	if(NOT INTEGER_MAX)
+	if(NOT DEFINED INTEGER_MAX)
 		set(INTEGER_MAX 2147483647)
 	endif()

@@ -315,16 +315,16 @@
 	endif()

 	cmake_parse_arguments(PARSE_ARGV 2 PREFIX "NO_OUTPUT" "HELP;OUTPUT_NAME" "OUTPUT_TYPES")
-	if(NOT PREFIX_HELP)
+	if(NOT DEFINED PREFIX_HELP)
 		set(PREFIX_HELP "")
 	endif()
-	if(PREFIX_NO_OUTPUT AND (PREFIX_OUTPUT_NAME OR PREFIX_OUTPUT_TYPES))
+	if(PREFIX_NO_OUTPUT AND (DEFINED PREFIX_OUTPUT_NAME OR DEFINED PREFIX_OUTPUT_TYPES))
 		message(FATAL_ERROR "Output name and/or type given for \"no output\" configuration variable \"${name}\"")
 	endif()
-	if(NOT PREFIX_OUTPUT_NAME AND NOT PREFIX_NO_OUTPUT)
+	if(NOT DEFINED PREFIX_OUTPUT_NAME AND NOT PREFIX_NO_OUTPUT)
 		set(PREFIX_OUTPUT_NAME "${name}")
 	endif()
-	if(NOT PREFIX_OUTPUT_TYPES AND NOT PREFIX_NO_OUTPUT)
+	if(NOT DEFINED PREFIX_OUTPUT_TYPES AND NOT PREFIX_NO_OUTPUT)
 		set(PREFIX_OUTPUT_TYPES ${type})
 	endif()


Add support for `FORCE` option to distortosSetConfiguration()

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -1,7 +1,7 @@
 #
 # file: distortos-utilities.cmake
 #
-# author: Copyright (C) 2018 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
+# author: Copyright (C) 2018-2019 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
 #
 # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
 # distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
@@ -116,7 +116,7 @@
 #

 function(distortosSetBooleanConfiguration name help)
-	cmake_parse_arguments(PARSE_ARGV 2 BOOL "INTERNAL" "" "")
+	cmake_parse_arguments(PARSE_ARGV 2 BOOL "FORCE;INTERNAL" "" "")
 	list(LENGTH BOOL_UNPARSED_ARGUMENTS length)
 	if(NOT length EQUAL 1)
 		message(FATAL_ERROR "Invalid arguments: \"${BOOL_UNPARSED_ARGUMENTS}\"")
@@ -125,13 +125,19 @@
 	set(defaultValue ${BOOL_UNPARSED_ARGUMENTS})
 	distortosCheckBoolean("${name}.DEFAULT" ${defaultValue})

+	if(BOOL_FORCE)
+		set(force FORCE)
+	else()
+		unset(force)
+	endif()
+
 	if(NOT BOOL_INTERNAL)
 		set(type BOOL)
 	else()
 		set(type INTERNAL)
 	endif()

-	set("${name}" "${defaultValue}" CACHE ${type} "")
+	set("${name}" "${defaultValue}" CACHE ${type} "" ${force})
 	set_property(CACHE "${name}" PROPERTY HELPSTRING "${help}")
 	get_property(currentType CACHE "${name}" PROPERTY TYPE)
 	if(NOT currentType STREQUAL type)
@@ -148,7 +154,7 @@
 #

 function(distortosSetIntegerConfiguration name help)
-	cmake_parse_arguments(PARSE_ARGV 2 INTEGER "INTERNAL" "MIN;MAX" "")
+	cmake_parse_arguments(PARSE_ARGV 2 INTEGER "FORCE;INTERNAL" "MIN;MAX" "")
 	list(LENGTH INTEGER_UNPARSED_ARGUMENTS length)
 	if(NOT length EQUAL 1)
 		message(FATAL_ERROR "Invalid arguments: \"${INTEGER_UNPARSED_ARGUMENTS}\"")
@@ -170,6 +176,12 @@
 	set(defaultValue ${INTEGER_UNPARSED_ARGUMENTS})
 	distortosCheckInteger("${name}.DEFAULT" ${defaultValue} ${INTEGER_MIN} ${INTEGER_MAX})

+	if(INTEGER_FORCE)
+		set(force FORCE)
+	else()
+		unset(force)
+	endif()
+
 	if(NOT INTEGER_INTERNAL)
 		set(type STRING)
 	else()
@@ -180,7 +192,7 @@
 		string(APPEND help "\n\nAllowed range: [${INTEGER_MIN}; ${INTEGER_MAX}]")
 	endif()

-	set("${name}" "${defaultValue}" CACHE ${type} "")
+	set("${name}" "${defaultValue}" CACHE ${type} "" ${force})
 	set_property(CACHE "${name}" PROPERTY HELPSTRING "${help}")
 	get_property(currentType CACHE "${name}" PROPERTY TYPE)
 	if(NOT currentType STREQUAL type)
@@ -197,7 +209,7 @@
 #

 function(distortosSetStringConfiguration name help)
-	cmake_parse_arguments(PARSE_ARGV 2 STRING "INTERNAL" "" "")
+	cmake_parse_arguments(PARSE_ARGV 2 STRING "FORCE;INTERNAL" "" "")

 	list(FIND STRING_UNPARSED_ARGUMENTS DEFAULT index)
 	if(NOT index EQUAL -1)
@@ -216,13 +228,19 @@
 		message(FATAL_ERROR "No string values provided")
 	endif()

+	if(STRING_FORCE)
+		set(force FORCE)
+	else()
+		unset(force)
+	endif()
+
 	if(NOT STRING_INTERNAL)
 		set(type STRING)
 	else()
 		set(type INTERNAL)
 	endif()

-	set("${name}" "${defaultValue}" CACHE ${type} "")
+	set("${name}" "${defaultValue}" CACHE ${type} "" ${force})
 	set_property(CACHE "${name}" PROPERTY HELPSTRING "${help}")
 	set_property(CACHE "${name}" PROPERTY STRINGS "${STRING_UNPARSED_ARGUMENTS}")
 	get_property(currentType CACHE "${name}" PROPERTY TYPE)
@@ -246,6 +264,7 @@
 # `distortosSetConfiguration(STRING name string1 [[[string2] string3] ...] [generic-options])`
 #
 # generic options:
+# - `[FORCE]` - forces the value of cache entry to `defaultValue`;
 # - `[HELP "help message ..."]` - help message displayed in the GUI; all whitespace after newlines is removed, so the
 # message may be indented to match other code;
 # - `[INTERNAL]` - causes the cache entry to be hidden in the GUI;


Continue to rationalize and strengthen Itcl, Itk, and Iwidgets
detection and consistency checking.

Tested by Alan W. Irwin <airwin@users.sourceforge.net> on Linux using
the output from cmake configuration of PLplot.  The cases tested were as
follows:

1. Ordinary PATH variable, use (the default)
-DUSE_INCRTCL_VERSION_4=OFF.

2. Identical to (1.), except specify -DUSE_INCRTCL_VERSION_4=ON.

3. Identical to (1.), except the PATH was modified to put a special install location used by
epa_build (a.k.a., build_projects) on the PATH.  The result was the
tclsh version built by epa_build was used for this test.

4. Identical to (3.), except specify -DUSE_INCRTCL_VERSION_4=ON.

The result for (1.) was consistent data for Tcl8.5, Tk8.5, version 3
of Itcl and Itk, and version 4.0.1 of Iwidgets were found
corresponding to the (old) Debian wheezy packages that have been
installed on my system.  The result for (2.) smoothly dropped Itcl,
Itk, and Iwidgets (as expected since Debian wheezy does not give
access to version 4 of Itcl and friends).  The result for (3.) was
consistent data for Tcl8.6, Tk8.6, version 3 of Itcl and Itk (both
built against Tcl/Tk8.6), and version 4.0.1 of Iwidgets were found
corresponding to the epa_build for version 3 of itcl and friends. The
result for (4.) was consistent data for Tcl8.6, Tk8.6, version 4 of
Itcl and Itk (both built against Tcl/Tk8.6), and version 4.1.0 of
Iwidgets were found corresponding to the epa_build for version 3 of
itcl and friends.

So a simple manipulation of the PATH and/or the
-DUSE_INCRTCL_VERSION_4 cmake option gives consistent results
in all cases.

svn path=/trunk/; revision=12672

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -57,17 +57,15 @@
 #			 Used for source file configuration.)

 if(ENABLE_tcl)
-  message(STATUS "Looking for include paths and libraries for Tcl/Tk")
-  find_package(TCL)
-  # Supplement those results with iTcl and iTk include paths and libraries.
+  message(STATUS "Use system introspection to determine data for Tcl and friends")
+  find_package(TCL QUIET)
   if(TCL_FOUND)
-    message(STATUS
-      "Looking for include paths and libraries for Tcl/Tk - found"
-      )
+    message(STATUS "Looking for include paths and libraries for Tcl - found")
+    message(STATUS "TCL_INCLUDE_PATH = ${TCL_INCLUDE_PATH}")
+    message(STATUS "TCL_LIBRARY = ${TCL_LIBRARY}")
     get_filename_component(TCL_LIBRARY_PATH ${TCL_LIBRARY} PATH)
-
-    message(STATUS "Looking for tclsh")
-    include(FindTclsh)
+    message(STATUS "TCL_LIBRARY_PATH = ${TCL_LIBRARY_PATH}")
+
     if(TCL_TCLSH)
       message(STATUS "Looking for tclsh - found")
       message(STATUS "TCL_TCLSH = ${TCL_TCLSH}")
@@ -75,13 +73,11 @@
       message(STATUS "Looking for tclsh - not found")
     endif(TCL_TCLSH)
   else(TCL_FOUND)
-    message(STATUS
-      "Looking for include paths and libraries for Tcl/Tk - not found"
-      )
+    message(STATUS "Looking for include paths and libraries for Tcl - not found")
   endif(TCL_FOUND)
+  set(HAVE_ITCL OFF)
+  set(HAVE_ITK OFF)
   if(TCL_FOUND AND TCL_TCLSH)
-    message(STATUS "TCL_INCLUDE_PATH = ${TCL_INCLUDE_PATH}")
-    message(STATUS "TCL_LIBRARY = ${TCL_LIBRARY}")
     if(ENABLE_itcl)
       if(USE_INCRTCL_VERSION_4)
 	set(SUGGESTED_ITCL_VERSION 4)
@@ -97,19 +93,26 @@
 	ERROR_VARIABLE ITCL_STDERR
 	)
       if(NOT ITCL_RC)
-	set(ITCL_PACKAGE_NAME "-exact Itcl ${ITCL_VERSION}")
+	set(ITCL_PACKAGE_NAME "Itcl ${ITCL_VERSION}")
 	message(STATUS "ITCL_PACKAGE_NAME = ${ITCL_PACKAGE_NAME}")
         message(STATUS "Looking for itcl.h")
-        find_path(ITCL_INCLUDE_PATH itcl.h ${TCL_INCLUDE_PATH})
+	if(NOT USE_INCRTCL_VERSION_4)
+	  # Search first for epa_build install location.
+          find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH}/itcl${ITCL_VERSION})
+	endif(NOT USE_INCRTCL_VERSION_4)
+        find_path(ITCL_INCLUDE_PATH itcl.h HINTS ${TCL_INCLUDE_PATH})
         if(ITCL_INCLUDE_PATH)
           message(STATUS "Looking for itcl.h - found")
+	  message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")
           message(STATUS "Looking for itcl library")
-          find_library(ITCL_LIBRARY itcl${ITCL_VERSION} PATHS ${TCL_LIBRARY_PATH}
-            PATH_SUFFIXES itcl${ITCL_VERSION})
+	  # Search first for epa_build install location.
+          find_library(ITCL_LIBRARY itcl${ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH}/itcl${ITCL_VERSION})
+          find_library(ITCL_LIBRARY itcl${ITCL_VERSION} HINTS ${TCL_LIBRARY_PATH})
           if(ITCL_LIBRARY)
             message(STATUS "Looking for itcl library - found")
+	    message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
             set(HAVE_ITCL ON)
-            find_path(HAVE_ITCLDECLS_H itclDecls.h ${TCL_INCLUDE_PATH})
+            find_path(HAVE_ITCLDECLS_H itclDecls.h HINTS ${ITCL_INCLUDE_PATH})
           else(ITCL_LIBRARY)
             message(STATUS "Looking for itcl library - not found")
             message(STATUS "WARNING: Disabling incr Tcl interface code")
@@ -123,14 +126,10 @@
       else(NOT ITCL_RC)
         message(STATUS "Itcl not available or not compatible with current Tcl shell")
         message(STATUS "WARNING: Disabling incr Tcl interface code")
-        set(HAVE_ITCL OFF)
         set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
       endif(NOT ITCL_RC)
     endif(ENABLE_itcl)
-    if(ENABLE_itcl)
-      message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")
-      message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
-    endif(ENABLE_itcl)
+
     # ------------------------------------------------------------------------
     # figure out how to build tclIndex
     # ------------------------------------------------------------------------
@@ -141,28 +140,32 @@
       set(MKTCLINDEX_ARGS "-tcl")
     endif(ENABLE_itcl)

+    if(ENABLE_tk AND NOT TK_FOUND)
+      message(STATUS "WARNING: Tk not found so disabling Tk interface code")
+      set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
+    endif(ENABLE_tk AND NOT TK_FOUND)
+
     if(ENABLE_tk AND NOT X11_FOUND)
-      message(STATUS "WARNING: X11 not found, disabling Tk interface code")
+      message(STATUS "WARNING: X11 not found so disabling Tk interface code")
       set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
     endif(ENABLE_tk AND NOT X11_FOUND)
+
     if(ENABLE_tk)
-      get_filename_component(TK_LIBRARY_PATH ${TK_LIBRARY} PATH)
-      if(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
-	message(STATUS "TCL_LIBRARY_PATH = ${TCL_LIBRARY_PATH}")
-	message(STATUS "TK_LIBRARY_PATH = ${TK_LIBRARY_PATH}")
-	message(STATUS "WARNING: the Tcl and Tk library locations are inconsistent so those libraries are likely not compatible")
-      endif(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
-    endif(ENABLE_tk)
-    if(ENABLE_tk)
+      message(STATUS "Looking for include paths and libraries for Tk - found")
       set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${X11_INCLUDE_DIR})
       message(STATUS "TK_INCLUDE_PATH = ${TK_INCLUDE_PATH}")
       message(STATUS "TK_LIBRARY = ${TK_LIBRARY}")
+
+      get_filename_component(TK_LIBRARY_PATH ${TK_LIBRARY} PATH)
+      message(STATUS "TK_LIBRARY_PATH = ${TK_LIBRARY_PATH}")
+      if(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
+	message(STATUS "WARNING: the Tcl and Tk library locations are inconsistent so those libraries are likely not compatible")
+      endif(NOT ${TK_LIBRARY_PATH} STREQUAL ${TCL_LIBRARY_PATH})
     else(ENABLE_tk)
-      message(STATUS
-	"WARNING: Because Tk is disabled must disable incr Tk as well"
-	)
+      message(STATUS "WARNING: Because Tk is disabled must disable incr Tk as well")
       set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)
     endif(ENABLE_tk)
+
     if(ENABLE_itk)
       if(USE_INCRTCL_VERSION_4)
 	set(SUGGESTED_ITK_VERSION 4)
@@ -178,18 +181,27 @@
 	ERROR_VARIABLE ITK_STDERR
 	)
       if(NOT ITK_RC)
-	set(ITK_PACKAGE_NAME "-exact Itk ${ITK_VERSION}")
+	set(ITK_PACKAGE_NAME "Itk ${ITK_VERSION}")
 	message(STATUS "ITK_PACKAGE_NAME = ${ITK_PACKAGE_NAME}")
+
 	message(STATUS "Looking for itk.h")
-	find_path(ITK_INCLUDE_PATH itk.h ${TK_INCLUDE_PATH})
+	if(NOT USE_INCRTCL_VERSION_4)
+	  # Search first for epa_build install location.
+          find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH}/itcl${ITCL_VERSION})
+	endif(NOT USE_INCRTCL_VERSION_4)
+	find_path(ITK_INCLUDE_PATH itk.h HINTS ${TCL_INCLUDE_PATH})
 	if(ITK_INCLUDE_PATH)
           message(STATUS "Looking for itk.h - found")
+	  message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}")
+
           message(STATUS "Looking for itk library")
-          find_library(ITK_LIBRARY itk${ITK_VERSION} PATHS ${TCL_LIBRARY_PATH}
-            PATH_SUFFIXES itk${ITK_VERSION})
+	  # Search first for epa_build install location.
+          find_library(ITK_LIBRARY itk${ITK_VERSION} HINTS ${TCL_LIBRARY_PATH}/itk${ITK_VERSION})
+          find_library(ITK_LIBRARY itk${ITK_VERSION} HINTS ${TCL_LIBRARY_PATH})
           if(ITK_LIBRARY)
             message(STATUS "Looking for itk library - found")
-            set(HAVE_ITK ON)
+	    message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
+	    set(HAVE_ITK ON)

 	    # Test version consistency between iwidgets, itk, and itcl.
 	    if(USE_INCRTCL_VERSION_4)
@@ -211,8 +223,8 @@
 	      # inaccessible to my google searches or privately made
 	      # available before all development of iwidgets4.0
 	      # stopped. So add 4.0.2 to the list just in case.
-	      foreach(SUGGESTED_ITK_VERSION 4.0.2 4.0.1 4.0.0)
-		file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
+	      foreach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
+		file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl "puts -nonewline \"[package require -exact Iwidgets ${SUGGESTED_IWIDGETS_VERSION}];[package require Itk];[package require Itcl]\";exit")
 		execute_process(
 		  COMMAND ${TCL_TCLSH} ${CMAKE_CURRENT_BINARY_DIR}/determine_versions.tcl
 		  RESULT_VARIABLE IWIDGETS_RC
@@ -222,16 +234,30 @@
 		if(NOT IWIDGETS_RC)
 		  break()
 		endif(NOT IWIDGETS_RC)
-	      endforeach(SUGGESTED_ITK_VERSION 4.0.2 4.0.1 4.0.0)
+	      endforeach(SUGGESTED_IWIDGETS_VERSION 4.0.2 4.0.1 4.0.0)
 	    endif(USE_INCRTCL_VERSION_4)
 	    if(NOT IWIDGETS_RC)
 	      list(GET IWIDGETS_VERSIONS_LIST 0 IWIDGETS_VERSION)
 	      list(GET IWIDGETS_VERSIONS_LIST 1 CONSISTENT_ITK_VERSION)
 	      list(GET IWIDGETS_VERSIONS_LIST 2 CONSISTENT_ITCL_VERSION)
 	      if(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION)
-		set(IWIDGETS_PACKAGE_NAME "-exact Iwidgets ${IWIDGETS_VERSION}")
+		if(USE_INCRTCL_VERSION_4)
+		  set(IWIDGETS_PACKAGE_NAME "Iwidgets ${IWIDGETS_VERSION}")
+		else(USE_INCRTCL_VERSION_4)
+		  # Must use exact to distinguish from 4.1 version with
+                  # the same major version number.  This should not be
+                  # an issue after install since it is rare/nonexistent to
+                  # change the patch number of this really old version of
+                  # iwidgets between the build and post-install eras.
+		  set(IWIDGETS_PACKAGE_NAME "-exact Iwidgets ${IWIDGETS_VERSION}")
+		endif(USE_INCRTCL_VERSION_4)
 		message(STATUS "IWIDGETS_PACKAGE_NAME = ${IWIDGETS_PACKAGE_NAME}")
 	      else(CONSISTENT_ITCL_VERSION STREQUAL ITCL_VERSION AND CONSISTENT_ITK_VERSION STREQUAL ITK_VERSION)
+		message(STATUS "IWIDGETS_VERSION = ${IWIDGETS_VERSION}")
+		message(STATUS "ITK_VERSION = ${ITK_VERSION}")
+		message(STATUS "CONSISTENT_ITK_VERSION = ${CONSISTENT_ITK_VERSION}")
+		message(STATUS "ITCL_VERSION = ${ITCL_VERSION}")
+		message(STATUS "CONSISTENT_ITCL_VERSION = ${CONSISTENT_ITCL_VERSION}")
 		message(STATUS "WARNING: Consistent combination of Iwidgets, Itk, and Itcl not found so disabling Itcl and Itk")
 		set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
 		set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)
@@ -254,27 +280,21 @@
       else(NOT ITK_RC)
         message(STATUS "Itk not available or not compatible with current Tcl shell")
         message(STATUS "WARNING: Disabling incr Tk interface code")
-        set(HAVE_ITK OFF)
         set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)
       endif(NOT ITK_RC)
     endif(ENABLE_itk)

-    if(ENABLE_itk)
-      message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}")
-      message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
-    endif(ENABLE_itk)
   else(TCL_FOUND AND TCL_TCLSH)
+    message(STATUS "Tcl not found OR tclsh not found")
     message(STATUS "WARNING: Disabling everything that is Tcl/Tk related")
     set(ENABLE_tcl OFF CACHE BOOL "Enable Tcl bindings" FORCE)
     set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
     set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
     set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)
   endif(TCL_FOUND AND TCL_TCLSH)
+  message(STATUS "Finished system introspection to determine data for Tcl and friends")
 else(ENABLE_tcl)
-  message(STATUS
-    "ENABLE_tcl is OFF so disabling everything else that "
-    "is Tcl/Tk related"
-    )
+  message(STATUS "WARNING: ENABLE_tcl is OFF so disabling everything else that is Tcl/Tk related")
   set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
   set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
   set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)


swig: fix swig for cross-compilation

swig: fix swig for cross-compilation

--- cmake/qibuild/swig/python.cmake
+++ cmake/qibuild/swig/python.cmake
@@ -16,9 +16,14 @@
 function(qi_swig_wrap_python module_name interface_file)
   cmake_parse_arguments(ARG "" "" "SRC;DEPENDS" ${ARGN})

-  # Basic configurations
-  find_package(SWIG REQUIRED)
-  include(${SWIG_USE_FILE})
+  # we search for the SWIG_EXECUTABLE by yourself, because FindSWIG call find_file
+  # be when we are cross-compiling and we want to use swig from the system
+  # then CMAKE_FIND_ROOT_PATH prevent find_file from working.
+  find_program(SWIG_EXECUTABLE swig)
+  include("UseSWIG")
+  #find_package(SWIG REQUIRED)
+  #include(${SWIG_USE_FILE})
+
   set_source_files_properties(${interface_file} PROPERTIES CPLUSPLUS ON)
   # tell swig that the generated module name is ${module_name}.py
   # without this property, it assumes that it is ${interface_file}.py


qibuild: swig/pyhon.cmake: fixed for visual studio.

--- cmake/qibuild/swig/python.cmake
+++ cmake/qibuild/swig/python.cmake
@@ -65,10 +65,23 @@

   qi_use_lib(${_swig_target} PYTHON ${ARG_DEPENDS})

-  set_target_properties(${_swig_target}
-    PROPERTIES
-      LIBRARY_OUTPUT_DIRECTORY "${QI_SDK_DIR}/${QI_SDK_LIB}"
-  )
+  # Mimic the behavior of qi_create_lib()
+  # if visual studio: put the .pyd in sdk/Debug/_foo_d.pyd,
+  # else put the .so in sdk/lib/_foo.so
+  # Warning: since foo.py will be generated in sdk/lib/foo.py, you
+  # will have to deal with PYTHONPATH yourself. (for instance using
+  # qi::path)
+  if(MSVC)
+    set_target_properties(${_swig_target}
+      PROPERTIES
+        LIBRARY_OUTPUT_DIRECTORY "${QI_SDK_DIR}/"
+    )
+  else()
+    set_target_properties(${_swig_target}
+      PROPERTIES
+        LIBRARY_OUTPUT_DIRECTORY "${QI_SDK_DIR}/${QI_SDK_LIB}"
+    )
+  endif()

   if (WIN32)
   # Be sure a .pyd file gets created.


Don't dialyze time_compat module.

Don't dialyze time_compat module.

Because depending on Erlang version it might complain about missing
functions.

Change-Id: I1412adabf949456d5ede02547b0860e45f886091
Reviewed-on: http://review.couchbase.org/87205
Tested-by: Aliaksey Artamonau <ce14b1c16e0fd654f926118eb8addbec5aff4ffa@couchbase.com>
Well-Formed: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Artem Stemkovski <15a0730a27c69f62ab86f2b6c639fca202166c02@couchbase.com>

--- cmake_modules/do-dialyzer.cmake
+++ cmake_modules/do-dialyzer.cmake
@@ -22,6 +22,7 @@
 # Compute list of .beam files
 FILE (GLOB beamfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" ebin/*.beam)
 STRING (REGEX REPLACE "ebin/(couch_api_wrap(_httpc)?).beam\;?" "" beamfiles "${beamfiles}")
+STRING (REGEX REPLACE "ebin/time_compat.beam\;?" "" beamfiles "${beamfiles}")

 FILE (GLOB couchdb_beamfiles RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" deps/ns_couchdb/ebin/*.beam)
 STRING (REGEX REPLACE "deps/ns_couchdb/ebin/couch_log.beam\;?" "" couchdb_beamfiles "${couchdb_beamfiles}")


omnibus: (temporarily) disable the topic listener

To reduce flash usage, until we can disable the FW & VTOL modules.

--- cmake/configs/nuttx_omnibus-f4sd_default.cmake
+++ cmake/configs/nuttx_omnibus-f4sd_default.cmake
@@ -43,7 +43,7 @@
 	systemcmds/reboot
 	systemcmds/sd_bench
 	systemcmds/top
-	systemcmds/topic_listener
+	#systemcmds/topic_listener
 	systemcmds/tune_control
 	systemcmds/ver


fixed: typo in collada configuration (prce lib debug mode)

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@2142 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/ConfigurePackages.cmake
+++ CMake/ConfigurePackages.cmake
@@ -385,7 +385,7 @@
           SET(COLLADA_PCRE_LIBRARY_RELEASE ${OSG_SUPPORT_ROOT}/lib/libosgpcre.lib)
         ENDIF()
         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/libosgpcreD.lib)
-          SET(COLLADA_PCRELIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgpcreD.lib)
+          SET(COLLADA_PCRE_LIBRARY_DEBUG ${OSG_SUPPORT_ROOT}/lib/libosgpcreD.lib)
         ENDIF()
       ELSE(OSG_USE_STATIC_SUPPORT_LIBS)
         IF(EXISTS ${OSG_SUPPORT_ROOT}/lib/osgcollada14dom22.lib)
@@ -406,9 +406,9 @@
         ENDIF()
       ENDIF()

-      OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_LIBRARY)
-
       IF(COLLADA_FOUND)
+        OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_LIBRARY)
+
         IF(OSG_USE_STATIC_SUPPORT_LIBS)
           OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_XML2_LIBRARY)
           OSG_ADD_IMPORT_LIB(OSG_COLLADA_TARGETS COLLADA_PCRECPP_LIBRARY)
@@ -540,11 +540,11 @@

     ENDIF(OSG_USE_OSGSUPPORT_LIBS AND WIN32)

-    IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLEW_FOUND)
-
-      OSG_FIND_PACKAGE(GLEW)
-
-    ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLEW_FOUND)
+#    IF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLEW_FOUND)
+#
+#      OSG_FIND_PACKAGE(GLEW)
+#
+#    ENDIF(NOT OSG_USE_OSGSUPPORT_LIBS OR NOT GLEW_FOUND)

 ENDMACRO(OSG_CONFIGURE_GLEW)


CMake: Added Static postfix to libs in static build

--- CMake/Utils/OgreInstall.cmake
+++ CMake/Utils/OgreInstall.cmake
@@ -11,10 +11,16 @@
 endif ()

 function(ogre_install_lib LIBNAME)
+  # add static prefix, if compiling static version
+  if (OGRE_STATIC)
+    set_target_properties(${LIBNAME} PROPERTIES
+      OUTPUT_NAME ${LIBNAME}Static
+    )
+  endif ()
   install(TARGETS ${LIBNAME}
     RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo
-	LIBRARY DESTINATION "lib" CONFIGURATIONS Release MinSizeRel RelWithDebInfo
-	ARCHIVE DESTINATION "lib" CONFIGURATIONS Release MinSizeRel RelWithDebInfo
+	LIBRARY DESTINATION "lib" CONFIGURATIONS Release MinSizeRel RelWithDebInfo None
+	ARCHIVE DESTINATION "lib" CONFIGURATIONS Release MinSizeRel RelWithDebInfo None
   )
   install(TARGETS ${LIBNAME}
     RUNTIME DESTINATION "bin${OGRE_DEBUG_PATH}" CONFIGURATIONS DEBUG
@@ -24,10 +30,16 @@
 endfunction(ogre_install_lib)

 function(ogre_install_plugin PLUGINNAME)
+  # add static prefix, if compiling static version
+  if (OGRE_STATIC)
+    set_target_properties(${PLUGINNAME} PROPERTIES
+      OUTPUT_NAME ${PLUGINNAME}Static
+    )
+  endif ()
   install(TARGETS ${PLUGINNAME}
     RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo
-	LIBRARY DESTINATION "lib${OGRE_PLUGIN_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo
-	ARCHIVE DESTINATION "lib${OGRE_PLUGIN_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo
+	LIBRARY DESTINATION "lib${OGRE_PLUGIN_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo None
+	ARCHIVE DESTINATION "lib${OGRE_PLUGIN_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo None
   )
   install(TARGETS ${PLUGINNAME}
     RUNTIME DESTINATION "bin${OGRE_DEBUG_PATH}" CONFIGURATIONS DEBUG
@@ -39,7 +51,7 @@
 function(ogre_install_sample SAMPLENAME)
   if (OGRE_INSTALL_SAMPLES)
     install(TARGETS ${SAMPLENAME}
-      RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo OPTIONAL
+      RUNTIME DESTINATION "bin${OGRE_RELEASE_PATH}" CONFIGURATIONS Release MinSizeRel RelWithDebInfo None OPTIONAL
     )
     install(TARGETS ${SAMPLENAME}
       RUNTIME DESTINATION "bin${OGRE_DEBUG_PATH}" CONFIGURATIONS DEBUG OPTIONAL


COMP: Shorten hash to match manually constructed file on mbits, hopefully

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

 if(BUILD_TESTING)

-  set(revision_tag ab6c5213c778de18f1600975e8818541fd988803)
+  set(revision_tag ab6c5213)
   #if(${proj}_REVISION_TAG)
   #  set(revision_tag ${${proj}_REVISION_TAG})
   #endif()


Add fix for PythonQt mac build error related C standard lib macros to main header

See issue #157 / https://github.com/commontk/PythonQt/commit/47738f9c8c5d3ffa77c8f2e1844f899e5b548f0c

--- CMakeExternals/PythonQt.cmake
+++ CMakeExternals/PythonQt.cmake
@@ -44,7 +44,7 @@
         message(FATAL_ERROR "error: Python is required to build ${PROJECT_NAME}")
       endif()

-      set(revision_tag 9104fa924859f4a865016f2138c06ec856f449d4)
+      set(revision_tag 47738f9c8c5d3ffa77c8f2e1844f899e5b548f0c)
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


Use new git revision in PythonQt fixing VS2010/Debug problem.

--- CMakeExternals/PythonQt.cmake
+++ CMakeExternals/PythonQt.cmake
@@ -55,7 +55,7 @@
           -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET})
       endif()

-      set(revision_tag 3171a94e16ba9bfee137)
+      set(revision_tag 7e1e07f34b2420e420e2858e5ea9a49fe1e0d235)
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


qRestAPI upgrade

qRestAPI upgrade

--- CMakeExternals/qRestAPI.cmake
+++ CMakeExternals/qRestAPI.cmake
@@ -23,7 +23,7 @@

     if(NOT DEFINED qRestAPI_DIR)

-      set(revision_tag "e71c0d625dd")
+      set(revision_tag "94a106e2860")
       if(${proj}_REVISION_TAG)
         set(revision_tag ${${proj}_REVISION_TAG})
       endif()


Fixed paths in code coverage

Fixed paths in code coverage

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -74,12 +74,12 @@
                 COMMAND ${_testrunner} ${ARGV3}

                 # Capturing lcov counters and generating report
-                COMMAND ${LCOV_PATH} --directory .. --capture --output-file ${_outputname}.info
+                COMMAND ${LCOV_PATH} --directory ../.. --capture --output-file ${_outputname}.info
                 COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' 'thirdparty/*' '/usr/*' --output-file ${_outputname}.info.cleaned
-                COMMAND ${GENHTML_PATH} -o ../${_outputname} ${_outputname}.info.cleaned
+                COMMAND ${GENHTML_PATH} -o ../../${_outputname} ${_outputname}.info.cleaned
                 COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned

-                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests
+                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/unittests
                 COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
         )

@@ -105,7 +105,7 @@
         ADD_CUSTOM_TARGET(${_targetname}
                 # Run tests
                 COMMAND ${_testrunner} ${ARGV3}
-                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/
+                WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tests/unittests
                 COMMENT "Running coverage tests."
         )


Update CodeCoverage.cmake

Update CodeCoverage.cmake

[ci skip]

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -4,10 +4,16 @@
     FIND_PROGRAM(GCOV_PATH gcov)
 ENDIF()

+IF(DEFINED ENV{LCOV_PATH})
+    SET(LCOV_PATH $ENV{LCOV_PATH})
+ELSE()
+    FIND_PROGRAM(LCOV_PATH lcov)
+ENDIF()
+
+FIND_PROGRAM(GENHTML_PATH genhtml)
+
 MESSAGE(STATUS "GCOV_PATH="${GCOV_PATH})
-
-FIND_PROGRAM(LCOV_PATH lcov)
-FIND_PROGRAM(GENHTML_PATH genhtml)
+MESSAGE(STATUS "LCOV_PATH="${LCOV_PATH})

 IF(NOT GCOV_PATH)
     MESSAGE(FATAL_ERROR "gcov not found! Aborting...")


build: use correct version when finding liburing

* use URING_PC as the prefix passed to pkg_search_module()
* use LibUring_FOUND when checking if LibUring is found. as this is the
  "FOUND_VAR" used by `find_package_handle_standard_args()`, and hence
  should be used as the authentic indicator.

without this change, if `pkg_search_module(URING liburing)` finds a
liburing with lower version than specified version, it is still accepted
as long as `pkg_search_module()` is able to find any liburing.pc. as
`URING_FOUND` is used as the indicator of the existence of the qualified
liburing library.

after this change, the `URING_PC` is used instead of `URING`. so
`find_package(LibUring...)` can do its job and find liburing if its
.pc file is found and its version is greater than 2.0. and
`LibUring_FOUND` is used so we don't accept liburing with unexpected
version anymore.

Signed-off-by: Kefu Chai <cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>

--- cmake/FindLibUring.cmake
+++ cmake/FindLibUring.cmake
@@ -22,7 +22,7 @@

 find_package (PkgConfig REQUIRED)

-pkg_search_module (URING liburing)
+pkg_search_module (URING_PC liburing)

 find_library (URING_LIBRARY
   NAMES uring
@@ -64,7 +64,7 @@
 set (URING_LIBRARIES ${URING_LIBRARY})
 set (URING_INCLUDE_DIRS ${URING_INCLUDE_DIR})

-if (URING_FOUND AND NOT (TARGET URING::uring))
+if (LibUring_FOUND AND NOT (TARGET URING::uring))
   add_library (URING::uring UNKNOWN IMPORTED)

   set_target_properties (URING::uring


To fully support multithreading, g++ compatible compilers need the -pthread flag (compiler and linker)

--- cmake/FindPthreads.cmake
+++ cmake/FindPthreads.cmake
@@ -68,6 +68,12 @@
   set(Pthreads_LIBRARIES ${Pthreads_LIBRARY})
 endif()

+# TODO:
+# Command line option -lpthread gets defined twice...
+if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+  set(Pthreads_PACKAGE_CXX_FLAGS "-pthread")
+endif()
+
 find_package_handle_standard_args(Pthreads DEFAULT_MSG
   Pthreads_INCLUDE_DIR
   Pthreads_LIBRARY


[cmake] add site_name in build notes

[cmake] add site_name in build notes

--- cmake/SiconosTools.cmake
+++ cmake/SiconosTools.cmake
@@ -274,6 +274,8 @@
     FILE(APPEND ${CMAKE_BINARY_DIR}/Testing/Notes/Build "cmake version : ${CMAKE_VERSION}\n")
     # the default buildname
     FILE(APPEND ${CMAKE_BINARY_DIR}/Testing/Notes/Build "System name : ${CMAKE_SYSTEM_NAME}\n")
+    site_name(_SITE_NAME)
+    FILE(APPEND ${CMAKE_BINARY_DIR}/Testing/Notes/Build "Site Name: ${_SITE_NAME}\n")
     FILE(APPEND ${CMAKE_BINARY_DIR}/Testing/Notes/Build "Processor   : ${CMAKE_SYSTEM_PROCESSOR}\n")
     FILE(APPEND ${CMAKE_BINARY_DIR}/Testing/Notes/Build "C compiler : ${CMAKE_C_COMPILER}\n")
     FILE(APPEND ${CMAKE_BINARY_DIR}/Testing/Notes/Build "C compiler version : ${CMAKE_C_COMPILER_VERSION}\n")


CMake: use forked glm to prevent install.

--- cmake/dependencies.cmake
+++ cmake/dependencies.cmake
@@ -82,7 +82,7 @@
   message(STATUS "Using glm from git")
   if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glm")

-    execute_process(COMMAND "${GIT}" clone "https://github.com/g-truc/glm"
+    execute_process(COMMAND "${GIT}" clone "https://github.com/ranjak/glm"
       WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty"
     )
   else()
@@ -90,6 +90,8 @@
       WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glm"
     )
   endif()
+
+  set(GLM_INSTALL_ENABLE OFF CACHE BOOL "" FORCE)

   add_subdirectory("3rdparty/glm" ${CMAKE_CURRENT_BINARY_DIR}/glm)


Minor CMake fix.

Minor CMake fix.

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -993,39 +993,49 @@
         endif()
       endif()

-      #--------------------------------------------------------------------
-      # Add dependcy package variables to this package if shared build
-      #if(NOT BUILD_SHARED_LIBS)
-          #--------------------------------------------------------------------
-          # Append library directories to project list
-          set(uniqueNewLibDirs ${${u_package}_LIBRARY_DIR})
-          remove_from_list(uniqueNewLibDirs "${${u_package}_LIBRARY_DIR}" ${_allLibsDir})
-          set(${u_package}_LIBRARY_DIR ${uniqueNewLibDirs})
-          list(APPEND _allLibsDir ${${u_package}_LIBRARY_DIR})
-
-          #--------------------------------------------------------------------
-          # Append includes to project list
-          set(uniqueNewLibs ${${u_package}_LIBRARIES})
-          remove_library_list(uniqueNewLibs "${${u_package}_LIBRARIES}" ${_allLibs})
-          set(${u_package}_LIBRARIES ${uniqueNewLibs})
-          list (APPEND _allLibs ${${u_package}_LIBRARIES})
-
-          #--------------------------------------------------------------------
-          # Append definitions to project list
-          set(uniqueNewDefs ${${u_package}_DEFINITIONS})
-          remove_from_list(uniqueNewDefs "${${u_package}_DEFINITIONS}" ${_allDefinitions})
-          set(${u_package}_DEFINITIONS ${uniqueNewDefs})
-          list (APPEND _allDefinitions ${${u_package}_DEFINITIONS})
-
-          #--------------------------------------------------------------------
-          # Append link flags to project list
-          set(uniqueNewLinkFlags ${${u_package}_LINK_FLAGS})
-          remove_from_list(uniqueNewLinkFlags "${${u_package}_LINK_FLAGS}" ${_allLinkFlags})
-          set(${u_package}_LINK_FLAGS ${uniqueNewLinkFlags})
-          if(NOT "${${u_package}_LINK_FLAGS}" STREQUAL "")
-              list (APPEND _allLinkFlags "\"${${u_package}_LINK_FLAGS}\"")
-          endif()
-      #endif()
+	  #--------------------------------------------------------------------
+	  # Append library directories to project list
+	  set(uniqueNewLibDirs ${${u_package}_LIBRARY_DIR})
+	  remove_from_list(uniqueNewLibDirs "${${u_package}_LIBRARY_DIR}" ${_allLibsDir})
+	  list(APPEND _allLibsDir ${${u_package}_LIBRARY_DIR})
+
+	  foreach (libDir ${${u_package}_LIBRARY_DIRS})
+		remove_from_list(uniqueNewLibDirs ${libDir} ${_allLibsDir})
+		list(APPEND _allLibsDir ${libDir})
+	  endforeach()
+
+	  set(${u_package}_LIBRARY_DIRS ${uniqueNewLibDirs})
+
+	  #--------------------------------------------------------------------
+	  # Append includes to project list
+	  if(NOT DEFINED ${u_package}_LIBRARIES  AND DEFINED ${u_package}_LIBRARY)
+		if(DEFINED ${u_package}_LIBRARY_DEBUG)
+			set(${u_package}_LIBRARIES optimized "${${u_package}_LIBRARY}" debug "${${u_package}_LIBRARY_DEBUG}")
+		else()
+			set(${u_package}_LIBRARIES "${${u_package}_LIBRARY}")
+		endif()
+	  endif()
+
+	  set(uniqueNewLibs ${${u_package}_LIBRARIES})
+	  remove_library_list(uniqueNewLibs "${${u_package}_LIBRARIES}" ${_allLibs})
+	  set(${u_package}_LIBRARIES ${uniqueNewLibs})
+	  list (APPEND _allLibs ${${u_package}_LIBRARIES})
+
+	  #--------------------------------------------------------------------
+	  # Append definitions to project list
+	  set(uniqueNewDefs ${${u_package}_DEFINITIONS})
+	  remove_from_list(uniqueNewDefs "${${u_package}_DEFINITIONS}" ${_allDefinitions})
+	  set(${u_package}_DEFINITIONS ${uniqueNewDefs})
+	  list (APPEND _allDefinitions ${${u_package}_DEFINITIONS})
+
+	  #--------------------------------------------------------------------
+	  # Append link flags to project list
+	  set(uniqueNewLinkFlags ${${u_package}_LINK_FLAGS})
+	  remove_from_list(uniqueNewLinkFlags "${${u_package}_LINK_FLAGS}" ${_allLinkFlags})
+	  set(${u_package}_LINK_FLAGS ${uniqueNewLinkFlags})
+	  if(NOT "${${u_package}_LINK_FLAGS}" STREQUAL "")
+		  list (APPEND _allLinkFlags "\"${${u_package}_LINK_FLAGS}\"")
+	  endif()

       #--------------------------------------------------------------------
       # Set includes and append to list
@@ -1036,7 +1046,6 @@

       #--------------------------------------------------------------------
       # Set directory links
-      link_directories(${${u_package}_LIBRARY_DIR})
 	  link_directories(${${u_package}_LIBRARY_DIRS})

       #--------------------------------------------------------------------
@@ -1053,15 +1062,7 @@
       endif(BUILD_${u_package})

       #--------------------------------------------------------------------
-      # Link library
-      if(NOT DEFINED ${u_package}_LIBRARIES  AND DEFINED ${u_package}_LIBRARY)
-        if(DEFINED ${u_package}_LIBRARY_DEBUG)
-            set(${u_package}_LIBRARIES optimized "${${u_package}_LIBRARY}" debug "${${u_package}_LIBRARY_DEBUG}")
-        else()
-            set(${u_package}_LIBRARIES "${${u_package}_LIBRARY}")
-        endif()
-      endif()
-
+      # Link library
        target_link_libraries(${_projectName} ${${u_package}_LIBRARIES})

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


build: fix cares include path

build: fix cares include path

Co-Authored-By: Lorenzo Fontana <0189fb5ac8a393aa741cf57f29cfe3228fcad081@gmail.com>
Signed-off-by: Leonardo Grasso <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@leonardograsso.com>

--- cmake/modules/gRPC.cmake
+++ cmake/modules/gRPC.cmake
@@ -96,12 +96,17 @@
   # that zlib will be very outdated
   set(ZLIB_INCLUDE "${GRPC_SRC}/third_party/zlib")
   set(ZLIB_LIB "${GRPC_LIBS_ABSOLUTE}/libz.a")
+  # we tell gRPC to compile c-ares for us because when a gRPC package is not available, like on CentOS, it's very likely
+  # that c-ares will be very outdated
+  set(CARES_INCLUDE "${GRPC_SRC}/third_party/cares/cares")
+  set(CARES_LIB "${GRPC_LIBS_ABSOLUTE}/libares.a")

   message(STATUS "Using bundled gRPC in '${GRPC_SRC}'")
   message(
     STATUS
       "Bundled gRPC comes with protobuf: compiler: ${PROTOC}, include: ${PROTOBUF_INCLUDE}, lib: ${PROTOBUF_LIB}")
   message(STATUS "Bundled gRPC comes with zlib: include: ${ZLIB_INCLUDE}, lib: ${ZLIB_LIB}}")
+  message(STATUS "Bundled gRPC comes with cares: include: ${CARES_INCLUDE}, lib: ${CARES_LIB}}")
   message(STATUS "Bundled gRPC comes with gRPC C++ plugin: include: ${GRPC_CPP_PLUGIN}")

   get_filename_component(PROTOC_DIR ${PROTOC} PATH)


AWM-7685 auto generate aw/world.mo

AWM-7685 auto generate aw/world.mo

--- cmake/scripts/l10n.cmake
+++ cmake/scripts/l10n.cmake
@@ -100,7 +100,7 @@
             COMMENT "Compile translation file domain ${DOMAIN} language ${lang} to binary format"
             DEPENDS ${po_file}
             COMMAND ${CMAKE_COMMAND} -E make_directory ${mo_dir}
-            COMMAND ${MSGFMT} --output-file=${mo_file} ${po_file}
+            COMMAND ${MSGFMT} --use-fuzzy --output-file=${mo_file} ${po_file}
         )
         add_custom_target(
             ${DOMAIN}.${lang}.l10n
@@ -146,7 +146,7 @@
             COMMENT "Compile translation file domain ${DOMAIN} language ${lang} to binary format"
             DEPENDS ${po_file}
             COMMAND ${CMAKE_COMMAND} -E make_directory ${mo_dir}
-            COMMAND ${MSGFMT} --output-file=${mo_file} ${po_file}
+            COMMAND ${MSGFMT} --use-fuzzy --output-file=${mo_file} ${po_file}
         )
         add_custom_target(
             ${DOMAIN}.${lang}.l10n


Handle Android environments that identify as Linux (#1898)

* Handle Android environments that identify as Linux

termux terminal emulator does this, causing build failures through missed defines in common.h

--- cmake/system_check.cmake
+++ cmake/system_check.cmake
@@ -9,6 +9,16 @@
 if (${HOST_OS} STREQUAL "WINDOWS")
   set(HOST_OS WINNT)
 endif ()
+
+if (${HOST_OS} STREQUAL "LINUX")
+# check if we're building natively on Android (TERMUX)
+    EXECUTE_PROCESS( COMMAND uname -o COMMAND tr -d '\n' OUTPUT_VARIABLE OPERATING_SYSTEM)
+      if(${OPERATING_SYSTEM} MATCHES "Android")
+        set(HOST_OS ANDROID)
+      endif(${OPERATING_SYSTEM} MATCHES "Android")
+endif()
+
+

 if(CMAKE_COMPILER_IS_GNUCC AND WIN32)
     execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine


Add support for ccache on Windows

Add support for ccache on Windows

Ccache has support for windows. This seems to work with the Windows
binaries of the ccache program with the Ninja generator. I don't
think this is working in Visual Studio.

--- CMakeModules/config_ccache.cmake
+++ CMakeModules/config_ccache.cmake
@@ -1,42 +1,41 @@
 # picked up original content from https://crascit.com/2016/04/09/using-ccache-with-cmake/

-if (UNIX)
-  find_program(CCACHE_PROGRAM ccache)
+find_program(CCACHE_PROGRAM ccache)

-  set(CCACHE_FOUND OFF)
-  if(CCACHE_PROGRAM)
-    set(CCACHE_FOUND ON)
+set(CCACHE_FOUND OFF)
+if(CCACHE_PROGRAM)
+  set(CCACHE_FOUND ON)
+endif()
+
+option(AF_USE_CCACHE "Use ccache when compiling" ${CCACHE_FOUND})
+
+if(${AF_USE_CCACHE})
+  message(STATUS "ccache FOUND: ${CCACHE_PROGRAM}")
+  # Set up wrapper scripts
+  set(C_LAUNCHER   "${CCACHE_PROGRAM}")
+  set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
+  set(NVCC_LAUNCHER "${CCACHE_PROGRAM}")
+  configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-c.in   launch-c)
+  configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-cxx.in launch-cxx)
+  configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-nvcc.in launch-nvcc)
+  execute_process(COMMAND chmod a+rx
+      "${ArrayFire_BINARY_DIR}/launch-c"
+      "${ArrayFire_BINARY_DIR}/launch-cxx"
+      "${ArrayFire_BINARY_DIR}/launch-nvcc"
+    )
+  if(CMAKE_GENERATOR STREQUAL "Xcode")
+    # Set Xcode project attributes to route compilation and linking
+    # through our scripts
+    set(CMAKE_XCODE_ATTRIBUTE_CC         "${ArrayFire_BINARY_DIR}/launch-c")
+    set(CMAKE_XCODE_ATTRIBUTE_CXX        "${ArrayFire_BINARY_DIR}/launch-cxx")
+    set(CMAKE_XCODE_ATTRIBUTE_LD         "${ArrayFire_BINARY_DIR}/launch-c")
+    set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${ArrayFire_BINARY_DIR}/launch-cxx")
+  else()
+    # Support Unix Makefiles and Ninja
+    set(CMAKE_C_COMPILER_LAUNCHER   "${CCACHE_PROGRAM}")
+    set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
+    set(CUDA_NVCC_EXECUTABLE ${CCACHE_PROGRAM} "${CUDA_NVCC_EXECUTABLE}")
   endif()
-
-  option(AF_USE_CCACHE "Use ccache when compiling" ${CCACHE_FOUND})
-
-  if(${AF_USE_CCACHE})
-    # Set up wrapper scripts
-    set(C_LAUNCHER   "${CCACHE_PROGRAM}")
-    set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
-    set(NVCC_LAUNCHER "${CCACHE_PROGRAM}")
-    configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-c.in   launch-c)
-    configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-cxx.in launch-cxx)
-    configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-nvcc.in launch-nvcc)
-    execute_process(COMMAND chmod a+rx
-        "${ArrayFire_BINARY_DIR}/launch-c"
-        "${ArrayFire_BINARY_DIR}/launch-cxx"
-        "${ArrayFire_BINARY_DIR}/launch-nvcc"
-      )
-    if(CMAKE_GENERATOR STREQUAL "Xcode")
-      # Set Xcode project attributes to route compilation and linking
-      # through our scripts
-      set(CMAKE_XCODE_ATTRIBUTE_CC         "${ArrayFire_BINARY_DIR}/launch-c")
-      set(CMAKE_XCODE_ATTRIBUTE_CXX        "${ArrayFire_BINARY_DIR}/launch-cxx")
-      set(CMAKE_XCODE_ATTRIBUTE_LD         "${ArrayFire_BINARY_DIR}/launch-c")
-      set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${ArrayFire_BINARY_DIR}/launch-cxx")
-    else()
-      # Support Unix Makefiles and Ninja
-      set(CMAKE_C_COMPILER_LAUNCHER   "${ArrayFire_BINARY_DIR}/launch-c")
-      set(CMAKE_CXX_COMPILER_LAUNCHER "${ArrayFire_BINARY_DIR}/launch-cxx")
-      set(CUDA_NVCC_EXECUTABLE "${ArrayFire_BINARY_DIR}/launch-nvcc")
-    endif()
-  endif()
-  mark_as_advanced(CCACHE_PROGRAM)
-  mark_as_advanced(AF_USE_CCACHE)
 endif()
+mark_as_advanced(CCACHE_PROGRAM)
+mark_as_advanced(AF_USE_CCACHE)


ilastik.cmake: Added nose dependency

ilastik.cmake: Added nose dependency

--- ilastik.cmake
+++ ilastik.cmake
@@ -29,6 +29,7 @@
 include (yapsy)
 include (pgmlink)
 include (scikit-learn)
+include (nose)

 # select the desired ilastik commit
 set(DEFAULT_ILASTIK_VERSION "20131205")
@@ -60,7 +61,7 @@

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

-set (ilastik_dependencies ${vigra_NAME} ${h5py_NAME} ${psutil_NAME}
+set (ilastik_dependencies ${vigra_NAME} ${h5py_NAME} ${psutil_NAME} ${nose_NAME}
                             ${blist_NAME} ${greenlet_NAME} ${yapsy_NAME}
                             ${cylemon_NAME} ${scikit-learn_NAME})


Use llvm 10 on darwin.

Use llvm 10 on darwin.

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


i#1701 port to Android: avoid DT_RPATH on Android

Since the Android loader does not support DT_RPATH, we remove it from
standalone clients and other users of our cmake utilities.

Review-URL: https://codereview.appspot.com/285280043

--- make/utils_exposed.cmake
+++ make/utils_exposed.cmake
@@ -1,5 +1,5 @@
 ## **********************************************************
-## Copyright (c) 2012-2014 Google, Inc.    All rights reserved.
+## Copyright (c) 2012-2016 Google, Inc.    All rights reserved.
 ## **********************************************************
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -77,7 +77,7 @@
 # the loader will be able to find the libraries.  We assume that the layout
 # is the same in the build and install directories.
 function (DynamoRIO_add_rel_rpaths target)
-  if (UNIX)
+  if (UNIX AND NOT ANDROID) # No DT_RPATH support on Android
     # Turn off the default CMake rpath setting and add our own LINK_FLAGS.
     set_target_properties(${target} PROPERTIES SKIP_BUILD_RPATH ON)
     foreach (lib ${ARGN})
@@ -106,7 +106,7 @@
         endif ()
       endif ()
     endforeach ()
-  endif (UNIX)
+  endif ()
 endfunction (DynamoRIO_add_rel_rpaths)

 # Check if we're using GNU gold.  We use CMAKE_C_COMPILER in