[UPD] FindMatlab updated to detected Matlab r2014a version.

--- CMake/FindMatlab.cmake
+++ CMake/FindMatlab.cmake
@@ -3,7 +3,7 @@
 #   a macro to help the build of MEX-functions.
 #
 # This module detects a Matlab's version between Matlab 7.0 (R14)
-# and Matlab 8.2 (r2013b).
+# and Matlab 8.3 (r2014a).
 #
 # This module defines:
 #  MATLAB_ROOT:               Matlab installation path
@@ -34,6 +34,7 @@
 IF(WIN32)
   # Default paths
   SET(MATLAB_PATHS
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\8.3;MATLABROOT]"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\8.2;MATLABROOT]"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\8.1;MATLABROOT]"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\8.0;MATLABROOT]"
@@ -57,6 +58,7 @@
   # Paths for Matlab 32-bit under Windows 64-bit
   IF(NOT MATLAB_ROOT)
     SET(MATLAB_PATHS
+      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MathWorks\\MATLAB\\8.3;MATLABROOT]"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MathWorks\\MATLAB\\8.2;MATLABROOT]"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MathWorks\\MATLAB\\8.1;MATLABROOT]"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MathWorks\\MATLAB\\8.0;MATLABROOT]"


Upgraded Qt to version 5.15.5 with OpenSSL support on windows

--- cmake/Depdendencies.cmake
+++ cmake/Depdendencies.cmake
@@ -47,11 +47,15 @@
         # Let FAST build Qt 5
         if(WIN32)
             fast_download_dependency(qt5
-                    5.14.0
-                    280fbfac2e2c1ad918d5c4efc043b7cc0ec13a149e37f29492215d69968bec7e
+                    5.15.5
+                    0e253ac91463f3d722f100402c24b8ec2363bb28954636068d0b5bd30e0476a0
                     Qt5Core.lib Qt5Gui.lib Qt5Widgets.lib Qt5OpenGL.lib Qt5Multimedia.lib Qt5MultimediaWidgets.lib Qt5Network.lib Qt5PrintSupport.lib Qt5SerialPort.lib
             )
-	elseif(APPLE)
+            fast_download_dependency(openssl
+                    1.1.1
+                    e0f9b5d26627c70abbfa9e3b0d731a81995bdd2af2177eebf1c4b32691643c9e
+            )
+      	elseif(APPLE)
             fast_download_dependency(qt5
                     5.14.0
                     9751aa43880c0193c59836410cbb6b343796b1b4cd5f86861300370014eac162


Disable LTCG on dev builds.

Disable LTCG on dev builds.

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -57,11 +57,12 @@
 	if (MSVC_VERSION GREATER_EQUAL 1910)
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /permissive-")
 	endif ()
-	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL /sdl /Oi /Ot /Oy /Ob2 /Zi")
+	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /sdl /Oi /Ot /Oy /Ob2 /Zi")
 	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /sdl /Oi /Ot /Ob2")
 	set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")

 	if(DEV_BUILD EQUAL 0)
+		set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
 		set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
 	endif()


Embed metal

Embed metal

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -352,6 +352,14 @@
 	)
 endif ()

+if (USE_METAL)
+set(HALLEY_PROJECT_LIBS
+	optimized halley-metal
+	debug halley-metal_d
+	${HALLEY_PROJECT_LIBS}
+	)
+endif ()
+
 if (USE_WINRT)
 set(HALLEY_PROJECT_LIBS
 	optimized halley-winrt
@@ -457,6 +465,9 @@
 		if (USE_ANDROID)
 			target_link_libraries(${name} halley-android)
 		endif ()
+		if (USE_METAL)
+			target_link_libraries(${name} halley-metal)
+		endif()
 	else ()
 		target_link_libraries(${name} ${HALLEY_PROJECT_LIBS})
 	endif ()


Fix syntax error for windows

Fix syntax error for windows

--- cmake/InstallMacros.cmake
+++ cmake/InstallMacros.cmake
@@ -12,7 +12,7 @@
 # Global macros ----------------------------------------------------------------
 macro (generate_root_config name)
   FILE(READ ${PROJECT_SOURCE_DIR}/etc/arangodb3/${name}.conf.in FileContent)
-  STRING(REPLACE "@PKGDATADIR@" "@ROOTDIR@$/{CMAKE_INSTALL_DATAROOTDIR_ARANGO}"
+  STRING(REPLACE "@PKGDATADIR@" "@ROOTDIR@$/${CMAKE_INSTALL_DATAROOTDIR_ARANGO}"
     FileContent "${FileContent}")
   STRING(REPLACE "@LOCALSTATEDIR@" "@ROOTDIR@/var"
     FileContent "${FileContent}")


enable C binding

enable C binding

--- cmake/InstallThrift.cmake
+++ cmake/InstallThrift.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(thrift
     URL                 http://www-us.apache.org/dist/thrift/${THRIFT_VERSION_STRING}/thrift-0.10.0.tar.gz
     URL_MD5             ${THRIFT_URL_MD5}
-    CONFIGURE_COMMAND   <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --with-openssl=${OPENSSL_ROOT_DIR} --with-boost=${BOOST_ROOT} --without-c_glib --without-csharp --without-python --without-java --without-nodejs --without-lua --without-ruby --without-php --without-erlang --without-go --without-nodejs --without-qt4 --without-qt5
+    CONFIGURE_COMMAND   <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --with-openssl=${OPENSSL_ROOT_DIR} --with-boost=${BOOST_ROOT} --without-csharp --without-python --without-java --without-nodejs --without-lua --without-ruby --without-php --without-erlang --without-go --without-nodejs --without-qt4 --without-qt5
     BUILD_COMMAND       make
     INSTALL_COMMAND     make install
 )


Forgot changes to cmake/ZincPackaging.cmake file.  OS X PackageMaker does not support restructured text format, changing to .txt instead.  https://tracker.physiomeproject.org/show_bug.cgi?id=3556

git-svn-id: b9baf8c2d14a71b3ba9c27a102eb6e792fc13348@9713 3c1deb5b-d424-0410-962d-aba41a686d42

--- cmake/ZincPackaging.cmake
+++ cmake/ZincPackaging.cmake
@@ -42,7 +42,7 @@
 	MESSAGE( STATUS "Please implement NSIS installer for me." )
 	SET( CPACK_GENERATOR "Zip" )
 ELSEIF( APPLE )
-	SET( CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/distrib/osx/welcome.rst" )
+	SET( CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/distrib/osx/welcome.txt" )
 	LIST( LENGTH LENGTH_ARCHS CMAKE_OSX_ARCHITECTURES )
 	message(STATUS "la=${LENGTH_ARCHS}-${CMAKE_OSX_ARCHITECTURES}")
 	message(STATUS "la=${CMAKE_SYSTEM_NAME}-${CMAKE_OSX_ARCHITECTURES}")
@@ -61,7 +61,7 @@

 SET( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE" )
 SET( CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README" )
-SET( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/distrib/description.rst" )
+SET( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/distrib/description.txt" )
 SET( CPACK_PACKAGE_VENDOR "physiomeproject" )

 message(STATUS "CPack package name: 'zinc-${ZINC_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}'" )


qibuild test: do not guess if test is NIGHTLY.

Now we have an explicit 'NIGHTLY' flag

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

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -30,8 +30,8 @@
 # \arg:name the name of the test and the target
 # \group:SRC  sources of the test
 # \group:DEPENDS the dependencies of the test
-# \param:TIMEOUT the timeout of the test. Not that TIMEOUT >= 20 causes
-#                the test to be disabled unless QI_NIGHTLY_TESTS is ON
+# \param:TIMEOUT the timeout of the test.
+# \flag: NIGHTLY: only compiled (and thus run) if QI_NIGHTLY_TESTS is ON
 # \group:ARGUMENTS arguments to be passed to the executable
 # \argn: source files (will be merged with the SRC group of arguments)
 function(qi_create_test name)
@@ -40,11 +40,9 @@
     qi_set_global(QI_${name}_TARGET_DISABLED TRUE)
     return()
   endif()
-  cmake_parse_arguments(ARG "" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})
-  if("${ARG_TIMEOUT}" GREATER 19)
-    if(NOT ${QI_NIGHTLY_TESTS})
-      return()
-    endif()
+  cmake_parse_arguments(ARG "NIGHTLY" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})
+  if(ARG_NIGHTLY AND NOT ${QI_NIGHTLY_TESTS})
+    return()
   endif()
   qi_create_bin(${name} SRC ${ARG_SRC} ${ARG_UNPARSED_ARGUMENTS} NO_INSTALL)
   if(ARG_DEPENDS)
@@ -74,6 +72,7 @@
 #
 # \arg:name name of the test
 # \flag:NO_ADD_TEST Do not call add_test, just create the binary
+# \flag: NIGHTLY: only compiled (and thus run) if QI_NIGHTLY_TESTS is ON
 # \argn: source files, like the SRC group, argn and SRC will be merged
 # \param:TIMEOUT The timeout of the test
 # \group:SRC Sources
@@ -122,11 +121,9 @@

   # create tests_results folder if it does not exist
   file(MAKE_DIRECTORY "${_TESTS_RESULTS_FOLDER}")
-  cmake_parse_arguments(ARG "NO_ADD_TEST" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})
-  if("${ARG_TIMEOUT}" GREATER 19)
-    if(NOT ${QI_NIGHTLY_TESTS})
-      return()
-    endif()
+  cmake_parse_arguments(ARG "NO_ADD_TEST;NIGHTLY" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})
+  if(ARG_NIGHTLY AND NOT ${QI_NIGHTLY_TESTS})
+    return()
   endif()

   # First, create the target
@@ -172,14 +169,12 @@
 # \arg:test_name The name of the test
 # \arg:target_name The name of the binary to use
 # \param:TIMEOUT The timeout of the test
+# \flag: NIGHTLY: only compiled (and thus run) if QI_NIGHTLY_TESTS is ON
 # \group:ARGUMENTS Arguments to be passed to the executable
 function(qi_add_test test_name target_name)
-  cmake_parse_arguments(ARG "" "TIMEOUT" "ARGUMENTS" ${ARGN})
-
-  if("${ARG_TIMEOUT}" GREATER 19)
-    if(NOT ${QI_NIGHTLY_TESTS})
-      return()
-    endif()
+  cmake_parse_arguments(ARG "NIGHTLY" "TIMEOUT" "ARGUMENTS" ${ARGN})
+  if(ARG_NIGHTLY AND NOT ${QI_NIGHTLY_TESTS})
+    return()
   endif()

   if(NOT ARG_TIMEOUT)


added cmake macro for finding pcl16

added cmake macro for finding pcl16

--- cmake/rosbuild_lite.cmake
+++ cmake/rosbuild_lite.cmake
@@ -76,8 +76,8 @@
     endif()
   endif()

-  find_program(ROSPACK_EXECUTABLE rospack PATHS ${ROS_ROOT}/bin DOC "the rospack executable." NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
-  find_program(ROSMSG_EXECUTABLE rosmsg PATHS ${ROS_ROOT}/bin DOC "rosmsg executable" NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
+  find_program(ROSPACK_EXECUTABLE rospack PATHS ${ROS_ROOT}/bin /opt/ros/fuerte/bin DOC "the rospack executable." NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
+  find_program(ROSMSG_EXECUTABLE rosmsg PATHS ${ROS_ROOT}/bin /opt/ros/fuerte/bin DOC "rosmsg executable" NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)

   if (ROSPACK_EXECUTABLE)
     set(ROS_FOUND TRUE)
@@ -256,3 +256,16 @@
   endif()
 endif()
 endmacro()
+
+# find the (unstable) pcl16 package. uses rosbuild, even on fuerte,
+# since perception_pcl_fuerte_unstable isn't yet catkinized
+macro(find_pcl16_package)
+  rosbuild_lite_init()
+  unset(PCL16_LIBRARIES)
+  find_ros_package(std_msgs)
+  find_ros_package(pcl16)
+  set(PCL16_FOUND TRUE)
+  set(PCL16_LIBRARIES ${pcl16_LIBRARIES})
+  set(PCL16_INCLUDE_DIRS ${pcl16_INCLUDE_DIRS})
+  message(STATUS "+   ${pcl16_libraries} libraries, ${pcl16_include_dirs} include directories")
+endmacro()


SuperBuild: glew building utils needs patch

--- SuperBuild/CMake/External_glew.cmake
+++ SuperBuild/CMake/External_glew.cmake
@@ -10,7 +10,7 @@
     DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
     CONFIGURE_COMMAND
-     ${SB_CMAKE_COMMAND} ${GLEW_SB_SRC}/build/cmake/ ${SB_CMAKE_CACHE_ARGS}
+     ${SB_CMAKE_COMMAND} ${GLEW_SB_SRC}/build/cmake/ ${SB_CMAKE_CACHE_ARGS} -DBUILD_UTILS:BOOL=OFF
     )

 set(_SB_GLEW_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)


cmake: fix installation of python extra code

--- modules/python/common.cmake
+++ modules/python/common.cmake
@@ -232,8 +232,9 @@
       if(extra_py_files)
         list(SORT extra_py_files)
         foreach(f ${extra_py_files})
+          get_filename_component(__dir "${f}" DIRECTORY)
           configure_file("${__base}/${f}" "${__loader_path}/cv2/_extra_py_code/${f}" COPYONLY)
-          install(FILES "${__base}/${f}" DESTINATION "${OPENCV_PYTHON_INSTALL_PATH}/cv2/_extra_py_code/${f}" COMPONENT python)
+          install(FILES "${__base}/${f}" DESTINATION "${OPENCV_PYTHON_INSTALL_PATH}/cv2/_extra_py_code/${__dir}/" COMPONENT python)
         endforeach()
       else()
         message(WARNING "Module ${m} has no .py files in misc/python/package")


build: check if spidermonkey compiles at all before further tests

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -60,12 +60,26 @@

 set(SPIDERMONKEY_LIBRARIES ${SPIDERMONKEY_LIBRARY})

+set(CMAKE_REQUIRED_INCLUDES ${SPIDERMONKEY_INCLUDE_DIR})
+set(CMAKE_REQUIRED_DEFINITIONS ${SPIDERMONKEY_DEFINITIONS})
+set(CMAKE_REQUIRED_LIBRARIES ${SPIDERMONKEY_LIBRARY})
+check_cxx_source_runs(
+    "#include <js/jsapi.h>
+     int main() {
+        JSRuntime *rt = JS_NewRuntime(8L * 1024L * 1024L);
+        if (!rt)
+            return 1;
+        return 0;
+     }"
+    SPIDERMONKEY_RUNS)
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(
     Spidermonkey
     DEFAULT_MSG
     SPIDERMONKEY_LIBRARIES
-    SPIDERMONKEY_INCLUDE_DIR)
+    SPIDERMONKEY_INCLUDE_DIR
+    SPIDERMONKEY_RUNS)

 if(SPIDERMONKEY_FOUND)
     set(CMAKE_REQUIRED_INCLUDES ${SPIDERMONKEY_INCLUDE_DIR})


增加两个OSX的继承选项

增加两个OSX的继承选项

--- project/cmake/modules/ProjectBuildTools.cmake
+++ project/cmake/modules/ProjectBuildTools.cmake
@@ -19,7 +19,7 @@
     CMAKE_ASM_COMPILER CMAKE_ASM_COMPILER_LAUNCHER CMAKE_ASM_COMPILER_AR CMAKE_ASM_COMPILER_RANLIB CMAKE_ASM_LINK_LIBRARY_SUFFIX
     CMAKE_SYSTEM_NAME PROJECT_ATFRAME_TARGET_CPU_ABI
     CMAKE_SYSROOT CMAKE_SYSROOT_COMPILE # CMAKE_SYSTEM_LIBRARY_PATH # CMAKE_SYSTEM_LIBRARY_PATH ninja里解出的参数不对，原因未知
-    CMAKE_OSX_SYSROOT CMAKE_OSX_ARCHITECTURES
+    CMAKE_OSX_SYSROOT CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_MACOSX_RPATH
     ANDROID_TOOLCHAIN ANDROID_ABI ANDROID_STL ANDROID_PIE ANDROID_PLATFORM ANDROID_CPP_FEATURES
     ANDROID_ALLOW_UNDEFINED_SYMBOLS ANDROID_ARM_MODE ANDROID_ARM_NEON ANDROID_DISABLE_NO_EXECUTE ANDROID_DISABLE_RELRO
     ANDROID_DISABLE_FORMAT_STRING_CHECKS ANDROID_CCACHE


Remove unused header file references.

Remove unused header file references.

--- project_template/cmake/LuaNativeObjects.cmake
+++ project_template/cmake/LuaNativeObjects.cmake
@@ -12,15 +12,13 @@
 	foreach(_src_file ${${_src_files_var}})
 		if(_src_file MATCHES ".nobj.lua")
 			string(REGEX REPLACE ".nobj.lua" ".nobj.c" _src_file_out ${_src_file})
-			string(REGEX REPLACE ".nobj.lua" ".nobj.h" _header_file_out ${_src_file})
 			string(REGEX REPLACE ".nobj.lua" ".nobj.ffi.lua" _ffi_file_out ${_src_file})
-			add_custom_command(OUTPUT ${_src_file_out} ${_header_file_out} ${_ffi_file_out}
+			add_custom_command(OUTPUT ${_src_file_out} ${_ffi_file_out}
 				COMMAND lua ${LUA_NATIVE_OBJECTS_PATH}/native_objects.lua -outpath ${CMAKE_CURRENT_BINARY_DIR} -gen lua ${_src_file}
 				WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 				DEPENDS ${_src_file}
 			)
 			set_source_files_properties(${_src_file_out} PROPERTIES GENERATED TRUE)
-			set_source_files_properties(${_header_file_out} PROPERTIES GENERATED TRUE)
 			set_source_files_properties(${_ffi_file_out} PROPERTIES GENERATED TRUE)
 			string(REGEX REPLACE ".nobj.lua" "" _doc_base ${_src_file})
 			string(REGEX REPLACE ".nobj.lua" ".luadoc" _doc_file_out ${_src_file})


syntax for forcing removal of existing sym links

--- phSolver/incompressible/test/testing.cmake
+++ phSolver/incompressible/test/testing.cmake
@@ -2,7 +2,7 @@
 add_test(copyInpCfg
   cp ${PHASTA_SOURCE_DIR}/phSolver/common/input.config ${CDIR})
 add_test(linkProcsDir
-  ln -f -s ${CDIR}/4-procs_case-SyncIO-2 ${CDIR}/4-procs_case)
+  ln -snf ${CDIR}/4-procs_case-SyncIO-2 ${CDIR}/4-procs_case)
 add_test(resetNumStart
   cp ${CDIR}/numstart.dat ${CDIR}/4-procs_case/numstart.dat)
 add_test(


Add support for libusb.

Add support for libusb.

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -256,6 +256,7 @@
 add_target(LIBMHASH libmhash)
 add_target(LIBPNG libpng)
 add_target(LIBRSVG librsvg)
+add_target(LIBUSB libusb)
 add_target(LIBXML libxml)
 add_target(MARISA_TRIE marisa_trie)
 add_target(MAVEN maven)
@@ -403,6 +404,7 @@
 set_libraries(libcxxabi ${LIBCXXABI_PREFIX}/lib c++abi)
 set_libraries(libffi ${LIBFFI_PREFIX}/lib ffi)
 set_libraries(libpng ${LIBPNG_PREFIX}/lib png)
+set_libraries(libusb ${LIBUSB_PREFIX}/lib libusb-1.0)
 if (IS_IOS)
   set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
   set(BUILD_SHARED_LIBS ON)
@@ -734,6 +736,7 @@
 set_include_directories(libcxx ${LIBCXX_PREFIX}/include/c++/v1)
 set_include_directories(libffi ${LIBFFI_PREFIX}/include)
 set_include_directories(libpng ${LIBPNG_PREFIX}/include)
+set_include_directories(libusb ${LIBUSB_PREFIX}/include)
 if (IS_IOS)
   set_include_directories(
       libxml ${CMAKE_IOS_SDK_ROOT}/usr/include
@@ -2627,6 +2630,26 @@
 add_target_dependencies(LIBRSVG ${LIBPNG_TARGET})
 add_target_dependencies(LIBRSVG ${PANGO_TARGET})
 add_target_dependencies(LIBRSVG ${PIXMAN_TARGET})
+
+################################################################################
+# libusb.
+add_external_project(
+  ${LIBUSB_TARGET}
+  PREFIX ${LIBUSB_PREFIX}
+  DOWNLOAD_COMMAND
+      ${GIT} clone --depth 1 git://git.libusb.org/libusb.git ${LIBUSB_TARGET}
+  CONFIGURE_COMMAND
+      <SOURCE_DIR>/autogen.sh --prefix=${LIBUSB_PREFIX} ${HOST} ${SYSROOT}
+          CC=${CMAKE_C_COMPILER}
+          CXX=${CMAKE_CXX_COMPILER}
+          CFLAGS=${CMAKE_C_FLAGS_WITH_ARCHS}
+          CXXFLAGS=${CMAKE_CXX_FLAGS_WITH_ARCHS}
+          LDFLAGS=${CMAKE_SHARED_LINKER_FLAGS}
+          ${CONFIGURE_LIB_TYPE}
+  INSTALL_COMMAND
+      make install &&
+      mv -f <INSTALL_DIR>/include/libusb-1.0 <INSTALL_DIR>/include/libusb
+  BUILD_IN_SOURCE 1)

 ################################################################################
 # libxml.


Rely on InstallRequiredSystemLibraries to handle runtime DLLs

- Remove broken redist location detection code
- Make sure to install OpenMP DLLs as well if enabled
- Introduce MITK_CREATE_NSIS_INSTALLER as an option to turn of NSIS package generation

--- CMake/mitkSetupCPack.cmake
+++ CMake/mitkSetupCPack.cmake
@@ -8,12 +8,15 @@
       DOC "Where is makensis.exe located"
       )

-    if(NOT NSIS_MAKENSIS)
-      set(CPACK_GENERATOR ZIP)
-    else()
-      set(CPACK_GENERATOR "NSIS;ZIP")
+    set(CPACK_GENERATOR ZIP)

-    endif(NOT NSIS_MAKENSIS)
+    if(NSIS_MAKENSIS)
+      set(MITK_CREATE_NSIS_INSTALLER ON CACHE BOOL "Create NSIS installer in addition to ZIP archive")
+      mark_as_advanced(MITK_CREATE_NSIS_INSTALLER)
+      if(MITK_CREATE_NSIS_INSTALLER)
+        list(APPEND CPACK_GENERATOR NSIS)
+      endif()
+    endif()
   else()
     if(APPLE)
       set(CPACK_GENERATOR DragNDrop)
@@ -21,51 +24,6 @@
       set(CPACK_GENERATOR TGZ)
     endif()
   endif()
-endif(NOT CPACK_GENERATOR)
-
-# Set Redistributable information for windows
-if(${CMAKE_SYSTEM_NAME} MATCHES Windows)
-  include(mitkFunctionGetMSVCVersion)
-  mitkFunctionGetMSVCVersion()
-  set(CPACK_VISUAL_STUDIO_VERSION_MAJOR "${VISUAL_STUDIO_VERSION_MAJOR}")
-  set(CPACK_VISUAL_STUDIO_PRODUCT_NAME "${VISUAL_STUDIO_PRODUCT_NAME}")
-  set(CPACK_LIBRARY_ARCHITECTURE "${CMAKE_LIBRARY_ARCHITECTURE}")
-
-  # Visual Studio 2017 already comes with redistributable installers.
-  # Try to find the right one.
-
-  set(vswhere "$ENV{PROGRAMFILES\(X86\)}\\Microsoft Visual Studio\\Installer\\vswhere.exe")
-
-  if(EXISTS ${vswhere})
-    execute_process(COMMAND ${vswhere} -latest -property installationPath
-      OUTPUT_VARIABLE installationPath
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-    file(TO_CMAKE_PATH "${installationPath}" installationPath)
-    set(redistPath "${installationPath}/VC/Redist/MSVC")
-    file(GLOB redistPath "${installationPath}/VC/Redist/MSVC/*")
-    list(LENGTH redistPath length)
-    if(length EQUAL 1)
-      if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-        set(redistPath "${redistPath}/vc_redist.x64.exe")
-      else()
-        set(redistPath "${redistPath}/vc_redist.x86.exe")
-      endif()
-      if(EXISTS ${redistPath})
-        set(CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE ${redistPath} CACHE FILEPATH "Path to the appropriate Microsoft Visual Studio Redistributable")
-      endif()
-    endif()
-  endif()
-
-  if(NOT DEFINED CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE)
-    set(CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE "" CACHE FILEPATH "Path to the appropriate Microsoft Visual Studio Redistributable")
-  endif()
-endif()
-
-if(EXISTS ${CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE} )
-  install(PROGRAMS ${CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE}
-          DESTINATION thirdpartyinstallers)
-
-  get_filename_component(CPACK_REDISTRIBUTABLE_FILE_NAME ${CMAKE_${CPACK_VISUAL_STUDIO_PRODUCT_NAME}_REDISTRIBUTABLE} NAME )
 endif()

 # On windows set default install directory appropriately for 32 and 64 bit
@@ -79,8 +37,8 @@
 endif()

 # By default, do not warn when built on machines using only VS Express
-if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
-  set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+if(MITK_USE_OpenMP)
+  set(CMAKE_INSTALL_OPENMP_LIBRARIES ON)
 endif()

 # include required mfc libraries
@@ -137,6 +95,3 @@
 endif()

 set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_ARCH}")
-
-
-


ENH: added comment for used DCMTK revision

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -24,7 +24,7 @@
 endif()

 if(NOT DEFINED DCMTK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
-  set(revision_tag efe1a177eac040b6d41aae0db7714cd970e12bc5)
+  set(revision_tag efe1a177eac040b6d41aae0db7714cd970e12bc5) # DCMTK-3.6.1_201610.12
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()


SuperBuild: comment out warning on qt4 linux

--- SuperBuild/CMake/External_qt4.cmake
+++ SuperBuild/CMake/External_qt4.cmake
@@ -1,10 +1,14 @@
 INCLUDE_ONCE_MACRO(QT4)

 SETUP_SUPERBUILD(PROJECT QT4)
-message(STATUS "  Using Qt4 SuperBuild version")
-if(UNIX AND NOT APPLE)
-  message(STATUS "  SuperBuild may fail to compile Qt4. If so, you should install it via package manager.")
-endif()
+
+#RK: are we ready for QT4 build on linux?.
+#This comment here scares me away.
+#Installing QT4 from packages also need sqlite otherwise there is issue
+
+# if(UNIX AND NOT APPLE)
+#   message(STATUS "  SuperBuild may fail to compile Qt4. If so, you should install it via package manager.")
+# endif()

 if(NOT DEFINED git_protocol)
   set(git_protocol "git")


contour extraction moved to seek

contour extraction moved to seek

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@3315 3d70eeeb-363e-0410-a505-8a46323a89f2

--- src/limn/sources.cmake
+++ src/limn/sources.cmake
@@ -17,7 +17,6 @@
   splineMethods.c
   splineEval.c
   enumsLimn.c
-  contour.c
   polydata.c
   )


CastXML 0.4.0

CastXML 0.4.0

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
-set(CastXML_VERSION_MINOR 3)
-set(CastXML_VERSION_PATCH 20200901)
+set(CastXML_VERSION_MINOR 4)
+set(CastXML_VERSION_PATCH 0)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


Redo library renaming

Redo library renaming

--- Superbuild/UseBoost.cmake
+++ Superbuild/UseBoost.cmake
@@ -31,11 +31,11 @@
   elseif(CMAKE_GENERATOR MATCHES "Makefiles")
     set(FULL_LIB_NAME "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   else()
-    #if(${lib} MATCHES "boost_python-mt")
-	#	set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python34-mt${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	#else()
+    if(${lib} MATCHES "boost_python-mt")
+		set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python3-mt${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	else()
 		set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	#endif()
+	endif()
     set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   endif()


Merging branches

Merging branches

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -202,6 +202,7 @@
 add_target(ICU icu)
 add_target(IMAGEMAGICK imagemagick)
 add_target(IMAP_2007F imap-2007f)
+add_target(INTEL_PCM intel_pcm)
 add_target(IOS_NTP ios_ntp)
 add_target(ISO_3166 iso_3166)
 add_target(ISO_639 iso_639)
@@ -353,6 +354,7 @@
 set_libraries(icu_test ${ICU_PREFIX}/lib icutest)
 set_libraries(icu_tu ${ICU_PREFIX}/lib icutu)
 set_libraries(icu_uc ${ICU_PREFIX}/lib icuuc)
+set_libraries(intel_pcm ${INTEL_PCM_PREFIX}/lib intel_pcm)
 set_libraries(ios_ntp ${IOS_NTP_PREFIX}/lib ios_ntp)
 set_libraries(imagemagick ${IMAGEMAGICK_PREFIX}/lib
               Magick++ MagickCore MagickWand)
@@ -553,6 +555,7 @@
 add_library_dependencies(boost_iostreams ${BZ2_LIB})
 add_framework_dependencies(formatter_kit AddressBook AddressBookUI CoreLocation)
 add_library_dependencies(gtest pthread)
+add_library_dependencies(intel_pcm pthread)
 add_framework_dependencies(ios_ntp CFNetwork CoreGraphics UIKit)
 add_framework_dependencies(mw_photo_browser AssetsLibrary MapKit MessageUI)
 add_library_dependencies(openssl third_party.gmp)
@@ -678,6 +681,7 @@
 set_include_directories(httpxx ${HTTPXX_PREFIX}/include)
 set_include_directories(icu ${ICU_PREFIX}/include)
 set_include_directories(imagemagick ${IMAGEMAGICK_PREFIX}/include/ImageMagick-6)
+set_include_directories(intel_pcm ${INTEL_PCM_PREFIX}/include)
 set_include_directories(
     ios_ntp ${IOS_NTP_PREFIX}/include ${IOS_NTP_PREFIX}/include/ios-ntp)
 set_include_directories(jsoncpp ${JSONCPP_PREFIX}/include)
@@ -893,7 +897,7 @@
   PREFIX ${APR_PREFIX}
   DOWNLOAD_DIR ${APR_PREFIX}/download
   DOWNLOAD_COMMAND
-      wget -O apr-1.5.0.tar.bz2 http://www.mirrorservice.org/sites/ftp.apache.org//apr/apr-1.5.0.tar.bz2 &&
+      wget -O apr-1.5.0.tar.bz2 https://archive.apache.org/dist/apr/apr-1.5.0.tar.bz2 &&
       gpg --verify ${THIRD_PARTY_SOURCE_DIR}/apr-1.5.0.tar.bz2.asc
           apr-1.5.0.tar.bz2 &&
       cd <SOURCE_DIR> &&
@@ -911,7 +915,7 @@
   PREFIX ${APR_UTIL_PREFIX}
   DOWNLOAD_DIR ${APR_UTIL_PREFIX}/download
   DOWNLOAD_COMMAND
-      wget -O apr-util-1.5.3.tar.bz2 http://www.mirrorservice.org/sites/ftp.apache.org//apr/apr-util-1.5.3.tar.bz2 &&
+      wget -O apr-util-1.5.3.tar.bz2 https://archive.apache.org/dist/apr/apr-util-1.5.3.tar.bz2 &&
       gpg --verify ${THIRD_PARTY_SOURCE_DIR}/apr-util-1.5.3.tar.bz2.asc
           apr-util-1.5.3.tar.bz2 &&
       cd <SOURCE_DIR> &&
@@ -1909,7 +1913,7 @@
   PREFIX ${HTTPD_PREFIX}
   DOWNLOAD_DIR ${HTTPD_PREFIX}/download
   DOWNLOAD_COMMAND
-      wget -O httpd-2.4.7.tar.bz2 http://mirrors.ukfast.co.uk/sites/ftp.apache.org//httpd/httpd-2.4.7.tar.bz2 &&
+      wget -O httpd-2.4.7.tar.bz2 http://archive.apache.org/dist/httpd/httpd-2.4.7.tar.bz2 &&
       gpg --verify ${THIRD_PARTY_SOURCE_DIR}/httpd-2.4.7.tar.bz2.asc
           httpd-2.4.7.tar.bz2 &&
       cd <SOURCE_DIR> &&
@@ -1983,6 +1987,24 @@
           ${ICU_PREFIX}/download/icu4c-52_1-src.tgz
   CONFIGURE_COMMAND echo "${ICU_BUILD_COMMAND}" | sh)
 add_install_name_step(ICU)
+
+################################################################################
+# Intel PCM library.
+add_external_project(
+  ${INTEL_PCM_TARGET}
+  PREFIX ${INTEL_PCM_PREFIX}
+  DOWNLOAD_COMMAND
+    git clone --depth 1 git://github.com/QuentinFiard/intel_pcm ${INTEL_PCM_TARGET}
+  CMAKE_ARGS
+      -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+      -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+      -DCMAKE_BUILD_TYPE=RELEASE
+      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+      -DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
+      -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
+      -DCMAKE_OSX_ARCHITECTURES=${ARCHS}
+      -DCMAKE_INSTALL_PREFIX=${INTEL_PCM_PREFIX})

 ################################################################################
 # ImageMagick. TODO(qfiard): Make portable.
@@ -2555,7 +2577,7 @@
   PREFIX ${MAVEN_PREFIX}
   DOWNLOAD_DIR ${MAVEN_PREFIX}/download
   DOWNLOAD_COMMAND
-      wget -O apache-maven-3.1.1-src.tar.gz ftp://mirrors.ircam.fr/pub/apache/maven/maven-3/3.1.1/source/apache-maven-3.1.1-src.tar.gz &&
+      wget -O apache-maven-3.1.1-src.tar.gz http://archive.apache.org/dist/maven/maven-3/3.1.1/source/apache-maven-3.1.1-src.tar.gz &&
       gpg --verify ${THIRD_PARTY_SOURCE_DIR}/apache-maven-3.1.1-src.tar.gz.asc
           apache-maven-3.1.1-src.tar.gz &&
       cd <SOURCE_DIR> &&
@@ -2700,7 +2722,7 @@
   PREFIX ${MOD_JK_PREFIX}
   DOWNLOAD_DIR ${MOD_JK_PREFIX}/download
   DOWNLOAD_COMMAND
-      wget -O tomcat-connectors-1.2.37-src.tar.gz http://www.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz &&
+      wget -O tomcat-connectors-1.2.37-src.tar.gz http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.37-src.tar.gz &&
       gpg --verify ${THIRD_PARTY_SOURCE_DIR}/tomcat-connectors-1.2.37-src.tar.gz.sig
           tomcat-connectors-1.2.37-src.tar.gz &&
       cd <SOURCE_DIR> &&


Hacky solution to enforce passing our stdlib flag to the linker through libtool without breaking anything else in the configure script.

--- ilmbase.cmake
+++ ilmbase.cmake
@@ -39,8 +39,9 @@
     PATCH_COMMAND       ${ilmbase_PATCH_COMMAND}
     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${ilmbase_SRC_DIR}/configure
         --prefix=${BUILDEM_DIR}
-        "LDFLAGS=${BUILDEM_LDFLAGS} ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
-        "CPPFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
+        "LDFLAGS=${BUILDEM_LDFLAGS}"
+        "LIBS=-Wc,${BUILDEM_ADDITIONAL_CXX_FLAGS}"
+        "CXXFLAGS=-I${BUILDEM_DIR}/include ${BUILDEM_ADDITIONAL_CXX_FLAGS}"
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)
     INSTALL_COMMAND     ${BUILDEM_ENV_STRING} $(MAKE) install
 )


cmake: fix merge mistake

cmake: fix merge mistake

--- cmake/configs/qurt_sdflight_default.cmake
+++ cmake/configs/qurt_sdflight_default.cmake
@@ -60,7 +60,7 @@
 	# PX4 drivers
 	#
 	drivers/gps
-	drivers/uart_esc
+	drivers/pwm_out_rc_in
 	drivers/qshell/qurt

 	#


qibuild: fix zeromq-config on linux

qibuild: fix zeromq-config on linux

--- cmake/qibuild/modules/zeromq-config.cmake
+++ cmake/qibuild/modules/zeromq-config.cmake
@@ -3,7 +3,7 @@
 clean(ZEROMQ)
 fpath(ZEROMQ zmq.h)
 flib(ZEROMQ OPTIMIZED NAMES libzmq zmq)
-flib(ZEROMQ DEBUG     NAMES libzmq zmq_d)
+flib(ZEROMQ DEBUG     NAMES libzmq zmq zmq_d)
 if(UNIX)
   qi_set_global(ZEROMQ_DEPENDS "UUID")
 else()


proto

proto

--- msvc_override.cmake
+++ msvc_override.cmake
@@ -1,4 +1,3 @@
-

 if(MSVC)

@@ -16,4 +15,4 @@

     endforeach(flag_var)

-endif(MSVC)+endif(MSVC)


[ci skip] Fix WARN_AS_ERROR_FLAGS is not working properly

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -3,7 +3,7 @@
 #

 # Set warnings as errors flag
-option(CUBBYFLOW_WARNINGS_AS_ERRORS ON)
+option(CUBBYFLOW_WARNINGS_AS_ERRORS "Treat all warnings as errors" ON)
 if(CUBBYFLOW_WARNINGS_AS_ERRORS)
 	if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
 		set(WARN_AS_ERROR_FLAGS	"/WX")
@@ -82,7 +82,6 @@
 		# /wd4592     # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
 		# /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
 		# /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)
-		/wd4717       # -> disable warning: recursive on all control paths, function will cause runtime stack overflow (wrong warning)

 		#$<$<CONFIG:Debug>:
 		#/RTCc        # -> value is assigned to a smaller data type and results in a data loss


fix the explicit use of conan-center in ConanInline

--- cmake/ConanInline.cmake
+++ cmake/ConanInline.cmake
@@ -64,6 +64,5 @@
 	endif()
 	conan_cmake_install(PATH_OR_REFERENCE .
 	                    BUILD missing
-	                    REMOTE conan-center
 	                    SETTINGS ${settings})
 endmacro()


Try fix for clang-cl build.

Try fix for clang-cl build.

--- cmake/FindDbgHelp.cmake
+++ cmake/FindDbgHelp.cmake
@@ -5,5 +5,4 @@
 # it directly.

 add_library(DbgHelp::DbgHelp UNKNOWN IMPORTED)
-set_target_properties(DbgHelp::DbgHelp PROPERTIES
-    IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "dbghelp.lib")
+set_target_properties(DbgHelp::DbgHelp PROPERTIES INTERFACE_LINK_LIBRARIES "dbghelp.lib")


Fix a comment

Fix a comment

--- cmake/FindGObject.cmake
+++ cmake/FindGObject.cmake
@@ -1,4 +1,4 @@
-# - Try to find
+# - Try to find GObject
 # Once done, this will define
 #
 # GObject_FOUND - system has GObject


Find FindPackageHandleStandardArgs.cmake in CMake's root directory

--- cmake/FindSQLite3.cmake
+++ cmake/FindSQLite3.cmake
@@ -48,6 +48,7 @@
     unset(_ver_line)
 endif()

+include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake")
 find_package_handle_standard_args(SQLite3
     REQUIRED_VARS SQLite3_INCLUDE_DIR SQLite3_LIBRARY
     VERSION_VAR SQLite3_VERSION)


ProjectLLVM: Do not build LLVM tools

ProjectLLVM: Do not build LLVM tools

--- cmake/ProjectLLVM.cmake
+++ cmake/ProjectLLVM.cmake
@@ -69,7 +69,8 @@
                        -DLLVM_ENABLE_TERMINFO=OFF  # Disable terminal color support
                        -DLLVM_ENABLE_ZLIB=OFF      # Disable compression support -- not needed at all
                        -DLLVM_TARGETS_TO_BUILD=X86
-                       -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_EXAMPLES=OFF
+                       -DLLVM_INCLUDE_TOOLS=OFF
+                       -DLLVM_INCLUDE_EXAMPLES=OFF
                        -DLLVM_INCLUDE_TESTS=OFF
             LOG_CONFIGURE TRUE
             BUILD_COMMAND   ${BUILD_COMMAND}


Properly parse the BUNDLE option in PCL_ADD_EXECUTABLE.

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -270,7 +270,12 @@
   set(multiValueArgs SOURCES)
   cmake_parse_arguments(ADD_LIBRARY_OPTION "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-  add_executable(${_name} ${ADD_LIBRARY_OPTION_SOURCES})
+  if(ADD_LIBRARY_OPTION_BUNDLE AND APPLE AND VTK_USE_COCOA)
+    add_executable(${_name} MACOSX_BUNDLE ${ADD_LIBRARY_OPTION_SOURCES})
+  else()
+    add_executable(${_name} ${ADD_LIBRARY_OPTION_SOURCES})
+  endif()
+
   # must link explicitly against boost.
   if(UNIX AND NOT ANDROID)
     target_link_libraries(${_name} ${Boost_LIBRARIES} pthread m ${CLANG_LIBRARIES})


export all GTEST_* vars

export all GTEST_* vars

--- cmake/tools/gtest.cmake
+++ cmake/tools/gtest.cmake
@@ -29,4 +29,10 @@
 find_package(GTest QUIET)
 if(NOT GTEST_FOUND)
   message(WARNING "GTest not found; C++ tests will fail to build.")
+else()
+  set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE)
+  set(GTEST_LIBRARIES ${GTEST_LIBRARIES} PARENT_SCOPE)
+  set(GTEST_MAIN_LIBRARIES ${GTEST_MAIN_LIBRARIES} PARENT_SCOPE)
+  set(GTEST_BOTH_LIBRARIES ${GTEST_BOTH_LIBRARIES} PARENT_SCOPE)
+  set(GTEST_FOUND ${GTEST_FOUND} PARENT_SCOPE)
 endif()


Separate executable build

Separate executable build

--- test/module_test.cmake
+++ test/module_test.cmake
@@ -1,10 +1,15 @@
 # Base test definition
 # Perform code transformation and compare the output with a reference

+set (CPU_DIR __cpu__)
+set (GPU_DIR __gpu__)
+
 # Define input and output file name
 set (ORIGINAL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/mo_column.f90)
-set (OUTPUT_FILE_CPU ${CMAKE_CURRENT_SOURCE_DIR}/transformed_code_cpu.f90)
-set (OUTPUT_FILE_GPU ${CMAKE_CURRENT_SOURCE_DIR}/transformed_code_gpu.f90)
+set (OUTPUT_FILE_CPU ${CMAKE_CURRENT_SOURCE_DIR}/${CPU_DIR}/transformed_code_cpu.f90)
+set (OUTPUT_FILE_GPU ${CMAKE_CURRENT_SOURCE_DIR}/${GPU_DIR}/transformed_code_gpu.f90)
+set (MAIN_CPU ${CMAKE_CURRENT_SOURCE_DIR}/${CPU_DIR}/main.f90)
+set (MAIN_GPU ${CMAKE_CURRENT_SOURCE_DIR}/${GPU_DIR}/main.f90)
 set (REFERENCE_FILE_CPU ${CMAKE_CURRENT_SOURCE_DIR}/reference_cpu.f90)
 set (REFERENCE_FILE_GPU ${CMAKE_CURRENT_SOURCE_DIR}/reference_gpu.f90)

@@ -20,6 +25,18 @@
 # Directory where OMNI xmod files will be placed
 if (NOT EXISTS ${XMOD_DIR})
   file(MAKE_DIRECTORY ${XMOD_DIR})
+endif()
+
+if (NOT EXISTS ${XMOD_DIR})
+  file(MAKE_DIRECTORY ${XMOD_DIR})
+endif()
+
+if (NOT EXISTS ${CPU_DIR})
+  file(MAKE_DIRECTORY ${CPU_DIR})
+endif()
+
+if (NOT EXISTS ${GPU_DIR})
+  file(MAKE_DIRECTORY ${GPU_DIR})
 endif()

 # Create intermediate representation in XcodeML Fortran format
@@ -45,6 +62,17 @@
   COMMENT "Translating CLAW directive with ${CLAWFC} for GPU target"
 )

+add_custom_command(
+  OUTPUT  ${MAIN_CPU}
+  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.f90 ${MAIN_CPU}
+  COMMENT "Copy main.f90 to ${MAIN_CPU}"
+)
+add_custom_command(
+  OUTPUT  ${MAIN_GPU}
+  COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.f90 ${MAIN_GPU}
+  COMMENT "Copy main.f90 to ${MAIN_GPU}"
+)
+
 # Target for the transformation
 add_custom_target(
   transform-${TEST_NAME}
@@ -62,6 +90,14 @@
   clean-mod-file-${TEST_NAME}
   COMMAND rm -f *.mod
 )
+add_custom_target(
+  clean-mod-file-${TEST_NAME}-gpu
+  COMMAND rm -f *.mod
+)
+add_custom_target(
+  clean-mod-file-${TEST_NAME}-cpu
+  COMMAND rm -f *.mod
+)

 # Add target to the global build/clean target
 add_dependencies(${BUILD_TEST_TARGET} transform-${TEST_NAME})
@@ -71,15 +107,15 @@
 set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${CLAW_TEST_FFP_FLAGS}")

 # Build the original code and the transformed code
-add_executable (${EXECUTABLE_ORIGINAL} EXCLUDE_FROM_ALL ${ORIGINAL_FILE} main.f90)
-add_executable (${EXECUTABLE_TRANSFORMED_CPU} EXCLUDE_FROM_ALL ${OUTPUT_FILE_CPU} main.f90)
+add_executable (${EXECUTABLE_ORIGINAL} EXCLUDE_FROM_ALL "${ORIGINAL_FILE}" "main.f90")
+add_executable (${EXECUTABLE_TRANSFORMED_CPU} EXCLUDE_FROM_ALL "${OUTPUT_FILE_CPU}" "${CMAKE_CURRENT_SOURCE_DIR}/${CPU_DIR}/main.f90")
 target_compile_definitions(${EXECUTABLE_TRANSFORMED_CPU} PRIVATE -D_CLAW)
-add_executable (${EXECUTABLE_TRANSFORMED_GPU} EXCLUDE_FROM_ALL ${OUTPUT_FILE_GPU} main.f90)
+add_executable (${EXECUTABLE_TRANSFORMED_GPU} EXCLUDE_FROM_ALL "${OUTPUT_FILE_GPU}" "${CMAKE_CURRENT_SOURCE_DIR}/${GPU_DIR}/main.f90")
 target_compile_definitions(${EXECUTABLE_TRANSFORMED_GPU} PRIVATE -D_CLAW)

 add_dependencies(${EXECUTABLE_ORIGINAL} clean-mod-file-${TEST_NAME})
-add_dependencies(${EXECUTABLE_TRANSFORMED_CPU} clean-mod-file-${TEST_NAME})
-add_dependencies(${EXECUTABLE_TRANSFORMED_GPU} clean-mod-file-${TEST_NAME})
+add_dependencies(${EXECUTABLE_TRANSFORMED_CPU} clean-mod-file-${TEST_NAME}-cpu)
+add_dependencies(${EXECUTABLE_TRANSFORMED_GPU} clean-mod-file-${TEST_NAME}-gpu)

 if(NOT IGNORE_TEST)
   # Compare reference transformed code and output of the transformation


CMake: hardcode mem map name to "application" for Gcc Arm

We need to fix linker script differently, it should not need APP_TARGET. This is a series of
commits fixing APP_TARGET in our tree. We should not require it.

The linker script preprocessing will be fixed differently. "application" prefix is temporary until
we clean this up completely.

--- tools/cmake/set_linker_script.cmake
+++ tools/cmake/set_linker_script.cmake
@@ -35,10 +35,11 @@
         set(LinkerScriptTarget ${input_target}LinkerScript)
         add_custom_target(${LinkerScriptTarget} DEPENDS ${LINKER_SCRIPT_PATH} VERBATIM)
         add_dependencies(${input_target} ${LinkerScriptTarget})
+        # We hardcore mmemory file to "application"
         target_link_options(${input_target}
             INTERFACE
             "-T" "${LINKER_SCRIPT_PATH}"
-            "-Wl,-Map=${CMAKE_BINARY_DIR}/${APP_TARGET}${CMAKE_EXECUTABLE_SUFFIX}.map"
+            "-Wl,-Map=${CMAKE_BINARY_DIR}/application${CMAKE_EXECUTABLE_SUFFIX}.map"
         )
     elseif(MBED_TOOLCHAIN STREQUAL "ARM")
         target_link_options(${input_target}


fpta-cmake: drop old-style C11/C++14 options.

--- cmake.fpta/compiler.cmake
+++ cmake.fpta/compiler.cmake
@@ -89,90 +89,6 @@
 endif()
 unset(tmp_lxx_probe_version)
 unset(tmp_lxx_probe_result)
-
-#
-# Check supported standards
-#
-if((NOT HAVE_STD_C11 AND NOT HAVE_STD_C99 AND NOT HAVE_STD_GNU99 AND NOT HAVE_STD_GNU11) OR
-    (NOT HAVE_STD_CXX11 AND NOT HAVE_STD_GNUXX0X))
-  set(CMAKE_REQUIRED_FLAGS "-std=c11")
-  check_c_source_compiles("
-    #if __STDC_VERSION__ < 201112L
-    #   error C11 not available
-    #endif
-    /*
-    * FreeBSD 10 ctype.h header fail to compile on gcc4.8 in c11 mode.
-    * Make sure we aren't affected.
-    */
-    #include <ctype.h>
-    int main(void) { return 0; }
-    " HAVE_STD_C11)
-
-  set(CMAKE_REQUIRED_FLAGS "-std=gnu11")
-  check_c_source_compiles("
-    #if __STDC_VERSION__ < 201112L
-    #   error GNU C11 not available
-    #endif
-    /*
-    * FreeBSD 10 ctype.h header fail to compile on gcc4.8 in c11 mode.
-    * Make sure we aren't affected.
-    */
-    #include <ctype.h>
-    /* Check for GNU C extension for VA_ARGS */
-    static inline void probe(int anchor, ...) { (void) anchor; }
-    #define PROBE(...) probe(42, ##__VA_ARGS__)
-    int main(void) {
-    PROBE(); PROBE(1); PROBE(2,2); PROBE(3,3,3);
-    return 0;
-    }
-    " HAVE_STD_GNU11)
-
-  set(CMAKE_REQUIRED_FLAGS "-std=c99")
-  check_c_source_compiles("
-    #if (__STDC_VERSION__ < 199901L) && (_MSC_FULL_VER < 180040629)
-    #   error C99 not available
-    #endif
-    int main(void) { return 0; }
-    " HAVE_STD_C99)
-
-  set(CMAKE_REQUIRED_FLAGS "-std=gnu99")
-  check_c_source_compiles("
-    #if __STDC_VERSION__ < 199901L
-    #   error C99 not available
-    #endif
-    /* Check for GNU C extension for VA_ARGS */
-    static inline void probe(int anchor, ...) { (void) anchor; }
-    #define PROBE(...) probe(42, ##__VA_ARGS__)
-    int main(void) {
-    PROBE(); PROBE(1); PROBE(2,2); PROBE(3,3,3);
-    return 0;
-    }
-    " HAVE_STD_GNU99)
-
-  set(CMAKE_REQUIRED_FLAGS "-std=c++11")
-  check_cxx_source_compiles("
-    #if (__cplusplus < 201103L) && (_MSC_FULL_VER < 180040629)
-    #   error C++11 not available
-    #endif
-    int main(void) { return 0; }
-    " HAVE_STD_CXX11)
-  set(CMAKE_REQUIRED_FLAGS "-std=gnu++0x")
-
-  check_cxx_source_compiles("
-    #if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__)
-    #   error GNU C++0x not available
-    #endif
-    int main(void) { return 0; }
-    " HAVE_STD_GNUXX0X)
-  set(CMAKE_REQUIRED_FLAGS "")
-endif()
-if((NOT HAVE_STD_C11 AND NOT HAVE_STD_C99 AND NOT HAVE_STD_GNU99) OR
-    (NOT HAVE_STD_CXX11 AND NOT HAVE_STD_GNUXX0X))
-  message(FATAL_ERROR
-    "${CMAKE_C_COMPILER} should support -std=c11 or -std=c99. "
-    "${CMAKE_CXX_COMPILER} should support -std=c++11 or -std=gnu++0x. "
-    "Please consider upgrade to gcc 4.5+ or clang 3.2+.")
-endif()

 if(MSVC)
   check_c_compiler_flag("/WX" CC_HAS_WERROR)
@@ -476,24 +392,6 @@
     if(CC_HAS_FNO_STACK_PROTECTOR)
       add_compile_flags("C;CXX" "-fno-stack-protector")
     endif()
-  endif()
-
-  # Set standard
-  if(HAVE_STD_GNU11)
-    add_compile_flags("C" "-std=gnu11")
-  elseif(HAVE_STD_C11)
-    add_compile_flags("C" "-std=c11")
-  elseif(HAVE_STD_GNU99)
-    add_compile_flags("C" "-std=gnu99")
-  elseif(HAVE_STD_C99 AND NOT MSVC)
-    add_compile_flags("C" "-std=c99")
-  endif()
-
-  if(HAVE_STD_CXX11 AND NOT MSVC)
-    add_compile_flags("CXX" "-std=c++11")
-  elseif(HAVE_STD_GNUXX0X)
-    add_compile_flags("CXX" "-std=gnu++0x")
-    add_definitions("-Doverride=")
   endif()

   if(MSVC)


search jpegturbo in externlibs

search jpegturbo in externlibs

--- cmake/FindJPEGTURBO.cmake
+++ cmake/FindJPEGTURBO.cmake
@@ -9,6 +9,11 @@
 )

 set(paths
+  $ENV{EXTERNLIBS}/libjpeg-turbo
+  $ENV{EXTERNLIBS}/libjpeg
+  $ENV{LIB_BASE_PATH}/
+  $ENV{LIB_BASE_PATH}/libjpeg-turbo
+  $ENV{LIB_BASE_PATH}/libjpeg
   /usr
   /usr/local
 )


RooUnfold: add `WITH_ROOUNFOLD` definition

When a library links to the `RooUnfold::RooUnfold` CMake target, the compiler is
invoked with `-DWITH_ROOUNFOLD`, allowing source code to have conditional
sections:

    #ifdef WITH_ROOUNFOLD
    ...
    #endif

Note: it has to be verified whether `rootcling` is automatically getting those
definitions as well.

--- cmake/FindRooUnfold.cmake
+++ cmake/FindRooUnfold.cmake
@@ -35,7 +35,8 @@
 add_library(RooUnfold::RooUnfold SHARED IMPORTED)
 set_target_properties(RooUnfold::RooUnfold PROPERTIES
   INTERFACE_INCLUDE_DIRECTORIES "${ROOUNFOLD_INCLUDE_DIR}"
-  IMPORTED_LOCATION             "${ROOUNFOLD_LIBPATH}")
+  IMPORTED_LOCATION             "${ROOUNFOLD_LIBPATH}"
+  INTERFACE_COMPILE_DEFINITIONS "WITH_ROOUNFOLD")

 # Unset RooUnfold variables
 unset(ROOUNFOLD_LIBPATH)


Updated XLink with Android build fixes

Updated XLink with Android build fixes

--- cmake/Hunter/config.cmake
+++ cmake/Hunter/config.cmake
@@ -8,8 +8,8 @@
 hunter_config(
     XLink
     VERSION "luxonis-2021.4-master"
-    URL "https://github.com/luxonis/XLink/archive/1a7ae5704e40756b06a3f05c4ab560a3d28fe445.tar.gz"
-    SHA1 "b1db49ddc3c8b86e912241616b87646808bb539e"
+    URL "https://github.com/luxonis/XLink/archive/16d82cd74099be621797ebc451fa06441ea88b73.tar.gz"
+    SHA1 "383b92b086c657c7bc720499e1da340943b3248a"
 )

 hunter_config(


rm libmklml_gnu.so

rm libmklml_gnu.so

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -69,11 +69,11 @@
       SRCS ${CBLAS_INSTALL_DIR}/lib ${CBLAS_INSTALL_DIR}/include
       DSTS ${dst_dir} ${dst_dir}
     )
-else()
+elseif (WITH_MKLML)
     set(dst_dir "${CMAKE_INSTALL_PREFIX}/third_party/install/mklml")
     copy(mklml_lib
-      SRCS ${MKLML_LIB_DIR} ${MKLML_INC_DIR}
-      DSTS ${dst_dir} ${dst_dir}
+      SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR}
+      DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}
     )
 endif()


[NFC][CMake] Improve Status message in the iOS toolchain file

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

--- cmake/platforms/iOS.cmake
+++ cmake/platforms/iOS.cmake
@@ -25,7 +25,7 @@
    OUTPUT_VARIABLE CMAKE_C_COMPILER
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  message(STATUS "Using c compiler ${CMAKE_C_COMPILER}")
+  message(STATUS "Using C compiler ${CMAKE_C_COMPILER}")
 ENDIF()

 IF(NOT CMAKE_CXX_COMPILER)
@@ -33,7 +33,7 @@
    OUTPUT_VARIABLE CMAKE_CXX_COMPILER
    ERROR_QUIET
    OUTPUT_STRIP_TRAILING_WHITESPACE)
-  message(STATUS "Using c compiler ${CMAKE_CXX_COMPILER}")
+  message(STATUS "Using C++ compiler ${CMAKE_CXX_COMPILER}")
 ENDIF()

 IF(NOT CMAKE_AR)


Fix compilation on macOS

Fix compilation on macOS

--- src/trivia/config.h.cmake
+++ src/trivia/config.h.cmake
@@ -85,6 +85,7 @@

 #ifndef HAVE_FDATASYNC
 #if defined(__APPLE__)
+#include <fcntl.h>
 #define fdatasync(fd) fcntl(fd, F_FULLFSYNC)
 #else
 #define fdatasync fsync


CMake: better summary of SIMD options

CMake: better summary of SIMD options

--- cmakemodules/script_show_final_summary.cmake
+++ cmakemodules/script_show_final_summary.cmake
@@ -72,8 +72,14 @@
 MESSAGE(STATUS "")
 MESSAGE(STATUS " __________________________ OPTIONS _____________________________")
 SHOW_CONFIG_LINE("Build MRPT as a shared library?  " CMAKE_MRPT_BUILD_SHARED_LIB_ONOFF)
-SHOW_CONFIG_LINE("Use SSE2?                        " CMAKE_MRPT_HAS_SSE2)
-SHOW_CONFIG_LINE("Use SSE3/SSSE3?                  " CMAKE_MRPT_HAS_SSE3)
+
+IF(MRPT_AUTODETECT_SSE)
+	set(STR_SSE_DETECT_MODE "Automatic")
+ELSE(MRPT_AUTODETECT_SSE)
+	set(STR_SSE_DETECT_MODE "Manually set")
+ENDIF(MRPT_AUTODETECT_SSE)
+MESSAGE(STATUS " Use SIMD optimizations?           : SSE2=" ${CMAKE_MRPT_HAS_SSE2} " SSE3=" ${CMAKE_MRPT_HAS_SSE3} " SSE4=" ${CMAKE_MRPT_HAS_SSE4} " ["${STR_SSE_DETECT_MODE} "]")
+
 IF($ENV{VERBOSE})
 	SHOW_CONFIG_LINE("Additional checks even in Release  " CMAKE_MRPT_ALWAYS_CHECKS_DEBUG)
 	SHOW_CONFIG_LINE("Additional matrix checks           " CMAKE_MRPT_ALWAYS_CHECKS_DEBUG_MATRICES)


fix the warning caused by mistach arguments of flags.cmake (#19576)

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -215,4 +215,4 @@
         string(REGEX REPLACE "(^| )/W[0-9]( |$)" " " ${flag_var} "${${flag_var}}")
         set(flag_var "${flag_var} /w")
     endforeach(flag_var)
-endif(WIN32)
+endif()


Avoid leading dot slash in cmake target. (#570)

Including shaderc in project that declares multiple build configurations
and then using generator that doesn't support multi-configuration would
result in a target path with a leading dot slash.  Ninja doesn't work
in that case.

Prepend CMAKE_CURRENT_BINARY_DIR in order to get an absolute path and
make ninja happy.  This works in all cases so we remove code specific
to multi-configuration.

Fixes #568.

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -161,15 +161,7 @@
   shaderc_get_transitive_libs(${target} all_libs)

   set(libname
-      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${new_target}${CMAKE_STATIC_LIBRARY_SUFFIX})
-
-  if (CMAKE_CONFIGURATION_TYPES)
-    list(LENGTH CMAKE_CONFIGURATION_TYPES num_configurations)
-    if (${num_configurations} GREATER 1)
-      set(libname
-          ${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${new_target}${CMAKE_STATIC_LIBRARY_SUFFIX})
-    endif()
-  endif()
+      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${new_target}${CMAKE_STATIC_LIBRARY_SUFFIX})

   if (MSVC)
     string(REPLACE ";" ">;$<TARGET_FILE:" temp_string "${all_libs}")


Change default Dashboard build type

Change default Dashboard build type

Set the default dashboard build to experimental rather than nightly.

Change-Id: I80c55a3863a004afe713b045449519d42b802db8

--- Scripts/Install/Ubuntu/test.cmake
+++ Scripts/Install/Ubuntu/test.cmake
@@ -3,6 +3,9 @@

 # Hardset buildname with {OS}-{Mplatform}(platform) convention
 set(CTEST_BUILD_NAME "Ubuntu12.04-GTMV6.0-002(x86)")
+
+# Set build type to experimental by default
+set(dashboard_model "Experimental")

 # Build CMakeCache
 set(dashboard_CMakeCache "#Path to a program.


:lipstick: Breaking up implementation of lookup

Using separate macros to find and to do actual lookup. Simplifies the layout of the main macro a
bit.

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -7,7 +7,10 @@
   set(EXTERNAL_ROOT ${CMAKE_BINARY_DIR}/external)
 endif(NOT EXTERNAL_ROOT)
 # Makes sure external projects are found by cmake
-list(APPEND CMAKE_PREFIX_PATH ${EXTERNAL_ROOT})
+list(FIND CMAKE_PREFIX_PATH "${EXTERNAL_ROOT}" has_external_root)
+if(has_external_root EQUAL -1)
+    list(APPEND CMAKE_PREFIX_PATH "${EXTERNAL_ROOT}")
+endif()

 include(Utilities)
 add_to_envvar(PKG_CONFIG_PATH "${EXTERNAL_ROOT}/lib/pkgconfig" PREPEND OS UNIX)
@@ -68,8 +71,6 @@
     endforeach()
     set(_save_root_path "${CMAKE_FIND_ROOT_PATH}")
     set(CMAKE_FIND_ROOT_PATH "${PATH}")
-    foreach(save MODE_PACKAGE MODE_INCLUDE MODE_PROGRAM MODE_LIBRARY)
-    endforeach()
 endmacro()

 # Unchanges the root path
@@ -80,19 +81,8 @@
     set(CMAKE_FIND_ROOT_PATH "${_save_root_path}")
 endmacro()

-# Looks for a lookup package file and includes it.
-macro(lookup_package package)
+macro(_find_package_for_lookup package REQUIRED QUIET DOWNLOAD CHECK)
     string(TOUPPER "${package}" PACKAGE)
-    set(solitos "DOWNLOAD_BY_DEFAULT;REQUIRED;QUIET;KEEP;NOFIND;CHECK_EXTERNAL")
-    set(multiplos "ARGUMENTS;COMPONENTS")
-    cmake_parse_arguments(${package} "${solitos}" "" "${multiplos}" ${ARGN})
-
-    # Reappends components
-    if(${package}_COMPONENTS)
-        list(APPEND ${package}_UNPARSED_ARGUMENTS COMPONENTS)
-        list(APPEND ${package}_UNPARSED_ARGUMENTS ${${package}_COMPONENTS})
-    endif()
-    # Check whether recursive
     unset(recursive)
     _get_sane_name(${package} SANENAME)
     if(${SANENAME}_RECURSIVE)
@@ -103,8 +93,8 @@
     endif()
     # First try and find package (unless downloading by default)
     set(dolook TRUE)
-    if(${package}_DOWNLOAD_BY_DEFAULT AND NOT recursive)
-        if(${package}_CHECK_EXTERNAL)
+    if(DOWNLOAD AND NOT recursive)
+        if(CHECK)
             set(do_rootchange TRUE)
         endif()
         set(dolook FALSE)
@@ -114,11 +104,11 @@
     endif()
     # Figure out whether to add REQUIRED and QUIET keywords
     set(required "")
-    if(recursive AND ${package}_REQUIRED)
+    if(recursive AND REQUIRED)
         set(required REQUIRED)
     endif()
     set(quiet "")
-    if(${package}_QIET)
+    if(QIET)
         set(quiet QUIET)
     elseif(NOT recursive)
         set(quiet QUIET)
@@ -127,7 +117,7 @@
         if(do_rootchange)
             _set_root_path("${EXTERNAL_ROOT}" ONLY)
         endif()
-        find_package(${package} ${${package}_UNPARSED_ARGUMENTS}
+        find_package(${package} ${ARGN}
             ${required} ${quiet}
         )
         if(do_rootchange)
@@ -139,6 +129,66 @@
             endif()
         endif()
     endif()
+endmacro()
+
+macro(_perform_actual_lookup package)
+    _find_lookup_recipe(${package} ${package}_LOOKUP_RECIPE)
+    if(NOT ${package}_LOOKUP_RECIPE_FILE)
+        # Checks if package is required
+        set(msg "Could not find recipe to lookup "
+                "${package} -- ${${package}_RECIPE_DIR}")
+        if(${package}_REQUIRED)
+            message(FATAL_ERROR ${msg})
+        elseif(NOT ${package}_QUIET)
+            message(STATUS ${msg})
+        endif()
+    else()
+        if(NOT ${package}_QUIET AND NOT ${package}_DOWNLOAD_BY_DEFAULT)
+            message(STATUS "Will attempt to download and install ${package}")
+        elseif(NOT ${package}_QUIET)
+            message(STATUS "Will download, build,"
+               " and install a local version of ${package}")
+        endif()
+        set(CURRENT_LOOKUP_DIRECTORY "${${package}_LOOKUP_RECIPE_DIR}")
+        if(${package}_KEEP)
+            set(${package}_LOOKUP_BUILD TRUE CACHE BOOL
+                "Whether package is obtained from a lookup build"
+                FORCE
+            )
+        else()
+            set(${package}_LOOKUP_BUILD FALSE CACHE BOOL
+                "Whether package is obtained from a lookup build"
+                FORCE
+            )
+        endif()
+        include(${${package}_LOOKUP_RECIPE_FILE})
+        unset(CURRENT_LOOKUP_DIRECTORY)
+        add_dependencies(lookup_dependencies ${package})
+    endif()
+endmacro()
+
+# Looks for a lookup package file and includes it.
+macro(lookup_package package)
+    string(TOUPPER "${package}" PACKAGE)
+    cmake_parse_arguments(${package}
+        "DOWNLOAD_BY_DEFAULT;REQUIRED;QUIET;KEEP;NOFIND;CHECK_EXTERNAL"
+        ""
+        "ARGUMENTS;COMPONENTS"
+        ${ARGN}
+    )
+
+    # Reappends components
+    if(${package}_COMPONENTS)
+        list(APPEND ${package}_UNPARSED_ARGUMENTS COMPONENTS)
+        list(APPEND ${package}_UNPARSED_ARGUMENTS ${${package}_COMPONENTS})
+    endif()
+    # First try and locate package
+    _find_package_for_lookup(${package}
+        "${${package}_REQUIRED}" "${${package}_QUIET}"
+        "${${package}_DOWNLOAD_BY_DEFAULT}" "${${package}_CHECK_EXACT}"
+        ${${package}_UNPARSED_ARGUMENTS}
+    )
+
     # Sets lower and upper case versions.
     # Otherwise some package will be registered as not found.
     # This is a problem with changing cmake practices.
@@ -147,35 +197,7 @@
     endif()
     # If package is not found, then look for a recipe to download and build it
     if(NOT ${package}_FOUND OR ${package}_LOOKUP_BUILD)
-        _find_lookup_recipe(${package} ${package}_LOOKUP_RECIPE)
-        if(NOT ${package}_LOOKUP_RECIPE_FILE)
-            # Checks if package is required
-            set(msg "Could not find recipe to lookup "
-                    "${package} -- ${${package}_RECIPE_DIR}")
-            if(${package}_REQUIRED)
-                message(FATAL_ERROR ${msg})
-            elseif(NOT ${package}_QUIET)
-                message(STATUS ${msg})
-            endif()
-        else()
-            if(NOT ${package}_QUIET AND NOT ${package}_DOWNLOAD_BY_DEFAULT)
-                message(STATUS "Will attempt to download and install ${package}")
-            elseif(NOT ${package}_QUIET)
-                message(STATUS "Will download, build,"
-                   " and install a local version of ${package}")
-            endif()
-            set(CURRENT_LOOKUP_DIRECTORY "${${package}_LOOKUP_RECIPE_DIR}")
-            if(${package}_KEEP)
-                set(${package}_LOOKUP_BUILD TRUE CACHE BOOL
-                    "Whether package is obtained from a lookup build")
-            else()
-                set(${package}_LOOKUP_BUILD FALSE CACHE BOOL
-                    "Whether package is obtained from a lookup build")
-            endif()
-            include(${${package}_LOOKUP_RECIPE_FILE})
-            unset(CURRENT_LOOKUP_DIRECTORY)
-            add_dependencies(lookup_dependencies ${package})
-        endif()
+        _perform_actual_lookup(${package})
     endif()
 endmacro()


FIX: allow spaces in source and binary directories (#193)

--- cmake/FindGengetopt.cmake
+++ cmake/FindGengetopt.cmake
@@ -15,13 +15,12 @@
 endif()

 # Create a cmake script to cat a list of files
-file(WRITE ${CMAKE_BINARY_DIR}/cat.cmake "
-file(WRITE \${OUTPUT} \"\")
-set(LIST_INPUTS \${INPUTS})
-separate_arguments(LIST_INPUTS)
-foreach(INPUT \${LIST_INPUTS})
-  file(READ \${INPUT} CONTENT)
-  file(APPEND \${OUTPUT} \"\${CONTENT}\")
+file(WRITE "${CMAKE_BINARY_DIR}/cat.cmake" "
+file(WRITE \"\${OUTPUT}\" \"\")
+foreach(INPUT \${INPUTS})
+  string(REPLACE \";\" \" \" INPUT \"\${INPUT}\")
+  file(READ \"\${INPUT}\" CONTENT)
+  file(APPEND \"\${OUTPUT}\" \"\${CONTENT}\")
 endforeach()
 ")

@@ -33,17 +32,18 @@
   # Convert list of a file in a list with absolute file names
   foreach(GGO_FILE ${ARGN})
     get_filename_component(GGO_FILE_ABS ${GGO_FILE} ABSOLUTE)
-    list(APPEND GGO_FILES_ABS ${GGO_FILE_ABS})
+    list(APPEND GGO_FILES_ABS "${GGO_FILE_ABS}")
   endforeach()

   # Append to a new ggo file containing all files
   list(GET GGO_FILES_ABS 0 FIRST_GGO_FILE)
   get_filename_component(FIRST_GGO_BASEFILENAME ${FIRST_GGO_FILE} NAME)
+  separate_arguments(GGO_FILES_ABS_LIST NATIVE_COMMAND "${GGO_FILES_ABS}")
   add_custom_command(
       OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIRST_GGO_BASEFILENAME}"
-      COMMAND ${CMAKE_COMMAND} -D INPUTS="${GGO_FILES_ABS}"
+      COMMAND ${CMAKE_COMMAND} -D INPUTS="${GGO_FILES_ABS_LIST}"
                                -D OUTPUT=${CMAKE_CURRENT_BINARY_DIR}/${FIRST_GGO_BASEFILENAME}
-                               -P ${CMAKE_BINARY_DIR}/cat.cmake
+                               -P "${CMAKE_BINARY_DIR}/cat.cmake"
       DEPENDS ${GGO_FILES_ABS}
   )
   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${FIRST_GGO_BASEFILENAME} PROPERTIES GENERATED TRUE)


Include dirs in tests.

Include dirs in tests.

--- cmake/OpenSimMacros.cmake
+++ cmake/OpenSimMacros.cmake
@@ -197,6 +197,8 @@

             add_executable(${TEST_NAME} ${test_program}
                 ${OSIMADDTESTS_SOURCES})
+            target_include_directories(${TEST_NAME}
+                PRIVATE ${OpenSim_SOURCE_DIR} ${OpenSim_SOURCE_DIR}/Vendors)
             target_link_libraries(${TEST_NAME} ${OSIMADDTESTS_LINKLIBS})
             add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})
             set_target_properties(${TEST_NAME} PROPERTIES


fix infer compile bug (#26641)

fix infer compile bug (#26641)

--- cmake/inference_lib.cmake
+++ cmake/inference_lib.cmake
@@ -189,7 +189,7 @@
         SRCS  ${CMAKE_BINARY_DIR}/paddle/fluid/framework/framework.pb.h
         DSTS  ${FLUID_INFERENCE_INSTALL_DIR}/paddle/include/internal)
 copy(inference_lib_dist
-        SRCS  ${CMAKE_BINARY_DIR}/../paddle/fluid/framework/io/crypto/cipher.h
+        SRCS  ${PADDLE_SOURCE_DIR}/paddle/fluid/framework/io/crypto/cipher.h
         DSTS  ${FLUID_INFERENCE_INSTALL_DIR}/paddle/include/crypto/)
 include_directories(${CMAKE_BINARY_DIR}/../paddle/fluid/framework/io)


Get cocaopods from bundler (#1544)

Get cocaopods from bundler (#1544)

--- cmake/podspec_rules.cmake
+++ cmake/podspec_rules.cmake
@@ -29,6 +29,7 @@

     execute_process(
       COMMAND
+        bundle exec
         ${FIREBASE_SOURCE_DIR}/cmake/podspec_cmake.rb
         ${PODSPEC_FILE}
         ${CMAKE_CURRENT_BINARY_DIR}/${_properties_file}


osx.cmake: add -Wno-expansion-to-defined (new default warning in Xcode 9.3)

--- cmake-toolchains/osx.cmake
+++ cmake-toolchains/osx.cmake
@@ -59,11 +59,11 @@
 endif()

 # compiler flags
-set(CMAKE_CXX_FLAGS "-std=c++11 ${FIPS_OSX_COMMON_FLAGS} ${FIPS_OSX_CXX_FLAGS} -fstrict-aliasing -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings")
+set(CMAKE_CXX_FLAGS "-std=c++11 ${FIPS_OSX_COMMON_FLAGS} ${FIPS_OSX_CXX_FLAGS} -fstrict-aliasing -Wno-expansion-to-defined -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings")
 set(CMAKE_CXX_FLAGS_RELEASE "-O3 -msse3 -DNDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1 -ggdb")

-set(CMAKE_C_FLAGS "${FIPS_OSX_COMMON_FLAGS} ${FIPS_OSX_C_FLAGS} -fstrict-aliasing -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue  -Wno-deprecated-writable-strings")
+set(CMAKE_C_FLAGS "${FIPS_OSX_COMMON_FLAGS} ${FIPS_OSX_C_FLAGS} -fstrict-aliasing -Wno-multichar -Wall -Wextra -Wno-expansion-to-defined -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue  -Wno-deprecated-writable-strings")
 set(CMAKE_C_FLAGS_RELEASE "-O3 -msse3 -DNDEBUG")
 set(CMAKE_C_FLAGS_DEBUG "-O0 -D_DEBUG_ -D_DEBUG -DFIPS_DEBUG=1 -g")


Added check for getpwuid() function

Added check for getpwuid() function

--- cmake/CheckFunctions.cmake
+++ cmake/CheckFunctions.cmake
@@ -21,3 +21,4 @@
 CHECK_FUNCTION_EXISTS (nl_langinfo HAVE_NL_LANGINFO)
 CHECK_FUNCTION_EXISTS (setlocale HAVE_SETLOCALE)
 CHECK_FUNCTION_EXISTS (poll HAVE_POLL)
+CHECK_FUNCTION_EXISTS (getpwuid HAVE_GETPWUID)


disable RTCc

disable RTCc

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -78,9 +78,9 @@
         # /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
         # /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)

-        $<$<CONFIG:Debug>:
-        /RTCc         # -> value is assigned to a smaller data type and results in a data loss
-        >
+        #$<$<CONFIG:Debug>:
+        #/RTCc         # -> value is assigned to a smaller data type and results in a data loss
+        #>

         $<$<CONFIG:Release>:
         /Gw           # -> whole program global optimization


fix images download regex

fix images download regex

the download page changed from plain directory listing to a more
complex page, with css and so on. Therefore we need a more restrictive
regex to get just image files.

patch done by @michaelld

--- cmake/DownloadImages.cmake
+++ cmake/DownloadImages.cmake
@@ -15,7 +15,7 @@
 set(SOURCE_URL "http://downloads.myriadrf.org/project/limesuite/${VERSION_MAJOR}.${VERSION_MINOR}")
 set(TEMP_DEST "${CMAKE_CURRENT_BINARY_DIR}/images/${VERSION_MAJOR}.${VERSION_MINOR}")
 set(INSTALL_DEST "share/LimeSuite/images/${VERSION_MAJOR}.${VERSION_MINOR}")
-set(HREF_MATCHER "href=\\\"([\\._A-Za-z_0-9-]+)\\\"")
+set(HREF_MATCHER "href=\\\"/project/limesuite/${VERSION_MAJOR}.${VERSION_MINOR}/([\\._A-Za-z_0-9-]+(.rpd|.rbf|.img))\\\"")

 #conditional download when file is missing
 function(DOWNLOAD_URL url file)


Add docstrings to FindQScintilla

Add docstrings to FindQScintilla

--- cmake/FindQScintilla.cmake
+++ cmake/FindQScintilla.cmake
@@ -73,11 +73,13 @@
   NAMES Qsci qsciglobal.h
   PATHS "${Qt5Core_INCLUDE_DIRS}" "${PC_QSCINTILLA_INCLUDE_DIRS}" "${QSCINTILLA_BREW_INCLUDE_DIR}" /usr/include/x86_64-linux-gnu/qt5
   PATH_SUFFIXES Qsci
+  DOC "Directory that contains 'Qsci', which in turn contains QScintilla's headers."
 )

 find_library(QSCINTILLA_LIBRARY
   NAMES qt5scintilla2 libqt5scintilla2 "${PC_QSCINTILLA_LIBRARIES}"
   PATHS "${Qt5Core_LIBRARIES}" "${PC_QSCINTILLA_LIBRARY_DIRS}" "${QSCINTILLA_BREW_LIBRARY}"
+  DOC "Path to the QScintilla library."
 )

 set(QSCINTILLA_LIBRARIES "${QSCINTILLA_LIBRARY}")


[siconos] 4.0.0

[siconos] 4.0.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 9)
+set(MAJOR_VERSION 4)
+set(MINOR_VERSION 0)
 set(PATCH_VERSION 0)
 set(SICONOS_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")


Change strequals to strequal

Change strequals to strequal

--- cmake/external_rules.cmake
+++ cmake/external_rules.cmake
@@ -143,13 +143,13 @@
   elseif(MSVC)
     # Propagate MSVC build flags.
     if(MSVC_RUNTIME_LIBRARY_STATIC)
-      if (CMAKE_BUILD_TYPE STREQUALS "Debug")
+      if (CMAKE_BUILD_TYPE STREQUAL "Debug")
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MTd")
       else()
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MT")
       endif()
     else()
-      if (CMAKE_BUILD_TYPE STREQUALS "Debug")
+      if (CMAKE_BUILD_TYPE STREQUAL "Debug")
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MDd")
       else()  # build type
         set(SUBBUILD_MSVC_RUNTIME_FLAG "/MD")


Corrects test binary paths in the CMake build script.

--- cmake/internal_utils.cmake
+++ cmake/internal_utils.cmake
@@ -184,7 +184,7 @@
     # only at ctest runtime (by calling ctest -c <Configuration>), so
     # we have to escape $ to delay variable substitution here.
     add_test(${name}
-      ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/test/${name}.py
-          --build_dir=${CMAKE_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
+      ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
+          --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
   endif()
 endfunction()


cmake px4_add_module MAIN is always present (required)

--- cmake/px4_add_module.cmake
+++ cmake/px4_add_module.cmake
@@ -185,11 +185,12 @@
 		target_compile_options(${MODULE} PRIVATE -Wframe-larger-than=${STACK_MAX})
 	endif()

+	# MAIN
 	if(MAIN)
 		target_compile_definitions(${MODULE} PRIVATE PX4_MAIN=${MAIN}_app_main)
 		target_compile_definitions(${MODULE} PRIVATE MODULE_NAME="${MAIN}")
 	else()
-		target_compile_definitions(${MODULE} PRIVATE MODULE_NAME="${MODULE}")
+		message(FATAL_ERROR "MAIN required")
 	endif()

 	if(COMPILE_FLAGS)