Don't search for RootTestDriver.cmake

Don't search for RootTestDriver.cmake

The file is always in the same directory as RootMacros.cmake,
so the search is not necessary.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -7,8 +7,6 @@
 #---------------------------------------------------------------------------------------------------
 #  RootMacros.cmake
 #---------------------------------------------------------------------------------------------------
-
-set(THISDIR ${CMAKE_CURRENT_LIST_DIR})

 if(WIN32)
   set(libprefix lib)
@@ -1270,6 +1268,10 @@
   install(CODE "EXECUTE_PROCESS(COMMAND ${merge_rootmap_cmd} --do-merge --input-file ${srcRootMap} --merged-file ${mergedRootMap})")
 endfunction()

+# Need to set this outside of the function so that ${CMAKE_CURRENT_LIST_DIR}
+# is for RootMacros.cmake and not for the file currently calling the function.
+set(ROOT_TEST_DRIVER ${CMAKE_CURRENT_LIST_DIR}/RootTestDriver.cmake)
+
 #----------------------------------------------------------------------------
 # function ROOT_ADD_TEST( <name> COMMAND cmd [arg1... ]
 #                        [PRECMD cmd [arg1...]] [POSTCMD cmd [arg1...]]
@@ -1405,11 +1407,6 @@
     set(_command ${_command} -DCOPY=${_copy_files})
   endif()

-  #- Locate the test driver
-  find_file(ROOT_TEST_DRIVER RootTestDriver.cmake PATHS ${THISDIR} ${CMAKE_MODULE_PATH} NO_DEFAULT_PATH)
-  if(NOT ROOT_TEST_DRIVER)
-    message(FATAL_ERROR "ROOT_ADD_TEST: RootTestDriver.cmake not found!")
-  endif()
   set(_command ${_command} -P ${ROOT_TEST_DRIVER})

   if(ARG_WILLFAIL)


CommonCPack fix

CommonCPack fix

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -94,7 +94,7 @@
 if(CPACK_GENERATOR STREQUAL "RPM")
   set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
   set(CPACK_RPM_PACKAGE_LICENSE "LGPL")
-  set(CPACK_RPM_PACKAGE_RELEASE ${UPPER_PROJECT_NAME}_PACKAGE_VERSION)
+  set(CPACK_RPM_PACKAGE_RELEASE ${${UPPER_PROJECT_NAME}_PACKAGE_VERSION})
   set(CPACK_RPM_PACKAGE_VERSION ${VERSION})
 else()
   if(${UPPER_PROJECT_NAME}_PACKAGE_VERSION)


ENH: Changed urls to www.itk.org

ENH: Changed urls to www.itk.org

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -3,7 +3,7 @@
 SET (NIGHTLY_START_TIME "1:00:00 EST")

 # Dart server to submit results (used by client)
-SET (DROP_SITE "public.kitware.com")
+SET (DROP_SITE "www.itk.org")
 SET (DROP_LOCATION "/incoming")
 SET (DROP_SITE_USER "ftpuser")
 SET (DROP_SITE_PASSWORD "public")
@@ -11,7 +11,7 @@
        "http://${DROP_SITE}/cgi-bin/Submit-Insight-TestingResults.pl")

 # Dart server configuration
-SET (CVS_WEB_URL "http://${DROP_SITE}/cgi-bin/itkcvsweb.cgi/Insight/")
+SET (CVS_WEB_URL "http://${DROP_SITE}/cgi-bin/cvsweb.cgi/Insight/")
 SET (CVS_WEB_CVSROOT "Insight")

 OPTION(BUILD_DOXYGEN "Build source documentation using doxygen" "On")


Remove DoxygenLayout.xml configuration

Remove DoxygenLayout.xml configuration

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -8,8 +8,6 @@
 find_package(Git)
 include(GithubOrganization)

-configure_file(doc/DoxygenLayout.xml ${CMAKE_BINARY_DIR}/doc/DoxygenLayout.xml
-  @ONLY)
 configure_file(doc/Doxyfile ${CMAKE_BINARY_DIR}/doc/Doxyfile @ONLY)

 get_property(INSTALL_DEPENDS GLOBAL PROPERTY ALL_DEP_TARGETS)


Use Requires.private instead of Requires, patch by Rex Dieter

git-svn-id: 95f3c568a8d713c8a134cac44d96183059969c76@10326 b0b80210-5d09-0410-99dd-b4bd03f891c0

--- libmusicbrainz3.pc.cmake
+++ libmusicbrainz3.pc.cmake
@@ -7,7 +7,7 @@
 Description: The Musicbrainz Client Library.
 URL: http://musicbrainz.org/doc/libmusicbrainz
 Version: ${PROJECT_VERSION}
-Requires: neon >= 0.25, libdiscid
+Requires.private: neon >= 0.25, libdiscid
 Libs: -L${LIB_INSTALL_DIR} -lmusicbrainz3
 Cflags: -I${INCLUDE_INSTALL_DIR}


ilastik-gui: Don't include chatty.  It didn't belong here in the first place, and doesn't build on Mac.

--- ilastik-gui.cmake
+++ ilastik-gui.cmake
@@ -20,13 +20,12 @@
 include (pyqt4)
 include (qimage2ndarray)
 include (vtk)
-include (chatty)
 include (cylemon)

 set (ilastik-gui_NAME ${ilastik_NAME}-gui)

 # Add a few dependencies to GUI ilastik build
-add_dependencies( ${ilastik_NAME} ${qt4_NAME} ${pyqt4_NAME} ${qimage2ndarray_NAME} ${vtk_NAME} ${chatty_NAME} ${cylemon_NAME} )
+add_dependencies( ${ilastik_NAME} ${qt4_NAME} ${pyqt4_NAME} ${qimage2ndarray_NAME} ${vtk_NAME} ) ${cylemon_NAME} )

 add_custom_target (${ilastik-gui_NAME} ALL
     DEPENDS     ${ilastik_NAME}


Fix OpenSSL when not cross compiling

Fix OpenSSL when not cross compiling

--- deps/OpenSSL/OpenSSL.cmake
+++ deps/OpenSSL/OpenSSL.cmake
@@ -2,9 +2,11 @@
 include(ProcessorCount)
 ProcessorCount(NPROC)

+set(_conf_cmd "./config")
 set(_cross_arch "")
 set(_cross_comp_prefix_line "")
 if (CMAKE_CROSSCOMPILING)
+    set(_conf_cmd "./Configure")
     set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}-")

     if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
@@ -21,7 +23,7 @@
     URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d
     DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
     BUILD_IN_SOURCE ON
-    CONFIGURE_COMMAND ./Configure ${_cross_arch}
+    CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
         "--prefix=${DESTDIR}/usr/local"
         ${_cross_comp_prefix_line}
         no-shared


Fix bug that made CMake to failed generating project for VS2017. If version_info.cc is only available when not in Win32 then tf_version_srcs should indeed only exist when not in Win32

--- tensorflow/contrib/cmake/tf_core_framework.cmake
+++ tensorflow/contrib/cmake/tf_core_framework.cmake
@@ -275,9 +275,8 @@
       COMMAND ${PYTHON_EXECUTABLE} ${tensorflow_source_dir}/tensorflow/tools/git/gen_git_source.py
       ARGS --raw_generate ${VERSION_INFO_CC} --source_dir ${tensorflow_source_dir} --git_tag_override=${GIT_TAG_OVERRIDE}
       DEPENDS __force_rebuild)
-endif()
-
-set(tf_version_srcs ${tensorflow_source_dir}/tensorflow/core/util/version_info.cc)
+  set(tf_version_srcs ${tensorflow_source_dir}/tensorflow/core/util/version_info.cc)
+endif()

 ########################################################
 # tf_core_framework library


don't match against start of input in SKIP_REGULAR_EXPRESSION

We mustn't do that now that we print out the stderr of the test.

--- test/cmake/ATFTestAddTests.cmake
+++ test/cmake/ATFTestAddTests.cmake
@@ -27,7 +27,7 @@
           -D \"TIMEOUT=${_timeout}\"
           -P \"${TEST_RUN_SCRIPT}\")
 set_tests_properties(${_name} PROPERTIES TIMEOUT 0)
-set_tests_properties(${_name} PROPERTIES SKIP_REGULAR_EXPRESSION \"^-- result: 0, skipped.*$\")
+set_tests_properties(${_name} PROPERTIES SKIP_REGULAR_EXPRESSION \"-- result: 0, skipped.*$\")
 ")

   set(script


support AMD processor on winXp

support AMD processor on winXp

--- Build.cmake
+++ Build.cmake
@@ -65,6 +65,11 @@

    # ERROR level conflicts with windows.h
    ADD_DEFINITIONS (-DNOGDI)
+   # support AMD proc on vc2015
+   if(${CMAKE_CL_64} STREQUAL "0")
+       set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:IA32")
+   endif()
+
 ENDIF()

    # GENERIC STEPS


Reordered logs in git-download.cmake, printing out output from git diff --shortstat in case changes exists.

--- src/cmake/git-download.cmake
+++ src/cmake/git-download.cmake
@@ -29,17 +29,6 @@
     set(multiValueArgs "")
     cmake_parse_arguments(args "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    # Determine if there are local changes, then we need to stash save & pop
-    execute_git(
-        COMMAND diff --shortstat
-        OUTPUT_VARIABLE GIT_HAVE_CHANGES
-    )
-
-    if(GIT_HAVE_CHANGES)
-        message(AUTHOR_WARNING "Local changes detected, skipping download.\n\tGit subtree requires a clean directory; please commit changes before running this.")
-        return()
-    endif()
-
     # If no tag is specified, default to master
     if(NOT args_TAG)
         set(args_TAG master)
@@ -55,7 +44,19 @@
     # Make clone-dir path relative to git-root
     string(REPLACE ${GIT_ROOT}/ "" RELATIVE_CLONE_DIR ${args_CLONE_DIR})

-    message("Cloning branch ${args_TAG} from ${args_URL} into relative directory ${RELATIVE_CLONE_DIR}:")
+    message("Cloning branch ${args_TAG} from ${args_URL} into relative directory ${RELATIVE_CLONE_DIR}...")
+
+    # Determine if there are local changes, then we need to stash save & pop
+    execute_git(
+        COMMAND diff --shortstat
+        OUTPUT_VARIABLE GIT_HAVE_CHANGES
+    )
+
+    if(GIT_HAVE_CHANGES)
+        message(WARNING "Local changes detected, skipping download.\n\tGit subtree requires a clean directory; please commit changes before running this.\n\t${GIT_HAVE_CHANGES}")
+        return()
+    endif()
+
     set(MERGE_MESSAGE "Merged branch ${args_TAG} in repository ${args_URL}.")
     if(NOT EXISTS ${args_CLONE_DIR})
         message("\tAdding...")


More release notes work

More release notes work

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[x] Documentation

--- GPUSD.cmake
+++ GPUSD.cmake
@@ -1,5 +1,5 @@

-find_package(GPUSD)
+find_package(GPUSD 1.0.0)
 if(EQUALIZER_RELEASE)
   return()
 endif()


Add /bigobj option for VS2015

Add /bigobj option for VS2015

--- CMakeModules/CompilerSettings.cmake
+++ CMakeModules/CompilerSettings.cmake
@@ -16,7 +16,7 @@

 # Visual Studio
 if(MSVC OR MSVC90 OR MSVC10)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1 /bigobj")
     if(FCL_TREAT_WARNINGS_AS_ERRORS)
         add_definitions(/WX)
     endif(FCL_TREAT_WARNINGS_AS_ERRORS)


CMake developer warnings.

CMake developer warnings.

--- CMake/FindBTK.cmake
+++ CMake/FindBTK.cmake
@@ -49,8 +49,8 @@
     /usr/lib/share

     # Look in standard Windows install locations.
-    C:\\Program Files\\BTK-debug\\share\\btk-0.1\\CMake
-    C:\\Program Files (x86)\\BTK
+    "C:\\Program Files\\BTK-debug\\share\\btk-0.1\\CMake"
+    "C:\\Program Files (x86)\\BTK"

     # Read from the CMakeSetup registry entries.  It is likely that
     # BTK will have been recently built.


Updated dashboard host info.

Updated dashboard host info.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,9 +1,15 @@
-MESSAGE(STATUS "Setting up dashboard client...")
+## This file should be placed in the root directory of your project.
+## Then modify the CMakeLists.txt file in the root directory of your
+## project to incorporate the testing dashboard.
+##
+## # The following are required to submit to the CDash dashboard:
+##   ENABLE_TESTING()
+##   INCLUDE(CTest)
+
 set(CTEST_PROJECT_NAME "FRENSIE")
-set(CTEST_NIGHTLY_START_TIME "02:00:00 UTC")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "128.104.184.29")
-set(CTEST_DROP_LOCATION "/CDash/submit.php?project=FRENSIE")
+set(CTEST_DROP_SITE "cdash.ep.wisc.edu")
+set(CTEST_DROP_LOCATION "/submit.php?project=FRENSIE")
 set(CTEST_DROP_SITE_CDASH TRUE)
-MESSAGE(STATUS "Setting up dashboard client...done")


enable our own ctest dashboard

enable our own ctest dashboard

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -5,9 +5,9 @@
 ##   ENABLE_TESTING()
 ##   INCLUDE(CTest)
 set(CTEST_PROJECT_NAME "Eigen")
-set(CTEST_NIGHTLY_START_TIME "05:00:00 UTC")
+set(CTEST_NIGHTLY_START_TIME "06:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=Eigen")
+set(CTEST_DROP_SITE "eigen.tuxfamily.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen")
 set(CTEST_DROP_SITE_CDASH TRUE)


closes #5340 exclude log_print.cc from coverage report

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -185,6 +185,8 @@
   list(APPEND CTEST_CUSTOM_TESTS_IGNORE ${long_running_tests})
 endif()

+## ignore log_print.cc in coverage report
+list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE "log_print.cc")

 list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
   "xz-4.999.9beta/src/liblzma"              # don't complain about warnings in xz source


Update for Matlab R2019a

Update for Matlab R2019a


Fix wrong NAG compiler version returned by cmake

CMake 3.9 started returning 0.0.0.0 for NAG versions older than 6.1
instead of NOT_FOUND which breaks our custom module for getting the
version number.

--- cmake/Modules/NAGFortranCompilerVersion.cmake
+++ cmake/Modules/NAGFortranCompilerVersion.cmake
@@ -10,7 +10,7 @@
 # the compiler with the "-version" flag.

 if(CMAKE_Fortran_COMPILER_ID MATCHES NAG)
-  if(NOT CMAKE_Fortran_COMPILER_VERSION)
+  if(NOT CMAKE_Fortran_COMPILER_VERSION OR CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL "0.0.0.0")
     execute_process(COMMAND ${CMAKE_Fortran_COMPILER} -V ERROR_VARIABLE _info)
     if(${_info} MATCHES "([0-9]+)\\.([0-9]+)\\.?([0-9]+)?")
       set(_major "${CMAKE_MATCH_1}")


(split) COMP: Do not build upstream FLTK examples.

This avoid build errors on older linux systems related to linking to pthreads.

Change-Id: I697ca6bcbd9031492bcfdb730154f9fece423cc6

--- External-FLTK.cmake
+++ External-FLTK.cmake
@@ -25,6 +25,7 @@
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
     ${ep_common_args}
+    -DOPTION_BUILD_EXAMPLES:BOOL=OFF
     -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}/FLTK-install
 )


Let the user choose the path to the license file for CPack.

And report how to do it when no file is found.

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -27,6 +27,12 @@
   message(FATAL_ERROR "Missing CPACK_PACKAGE_LICENSE")
 endif()

+if(NOT CPACK_RESOURCE_FILE_LICENSE)
+  set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt)
+endif()
+if(NOT EXISTS ${CPACK_RESOURCE_FILE_LICENSE})
+  message(AUTHOR_WARNING "${CPACK_RESOURCE_FILE_LICENSE} file not found, provide one or set CPACK_RESOURCE_FILE_LICENSE to point to an existing one.")
+endif()

 if(NOT CPACK_PACKAGE_CONTACT)
   set(CPACK_PACKAGE_CONTACT ${${UPPER_PROJECT_NAME}_MAINTAINER})
@@ -62,7 +68,6 @@
 set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
 set(CPACK_PACKAGE_VERSION ${VERSION})
-set(CPACK_RESOURCE_FILE_LICENSE ${PROJECT_SOURCE_DIR}/LICENSE.txt)
 if(NOT CPACK_DEBIAN_BUILD_DEPENDS)
   # setup'd by Buildyard config, same as for travis CI
   set(CPACK_DEBIAN_BUILD_DEPENDS ${${UPPER_PROJECT_NAME}_BUILD_DEBS})


ヘッダのコピースクリプトを修正(サブディレクトリ周り)

ヘッダのコピースクリプトを修正(サブディレクトリ周り)

--- CopyHeaders.cmake
+++ CopyHeaders.cmake
@@ -19,18 +19,28 @@
 	endif()
 endforeach()
 list(REMOVE_DUPLICATES HEADERS_DIR)
-# ルートディレクトリ内のヘッダを出力
 # サブディレクトリ内のヘッダを出力
 foreach(DIRNAME IN LISTS HEADERS_DIR)
 	unset(HEADER_LIST)
 	foreach(HEADER IN LISTS HEADERS)
-		string(REGEX MATCH ".*/${COPYHEADERS_MY_DIR}/(${DIRNAME})/.*" DUMMY ${HEADER})
-		if(CMAKE_MATCH_1)
+		string(REGEX MATCH ".*/${COPYHEADERS_MY_DIR}/${DIRNAME}/.*" ISMATCHED ${HEADER})
+		if(ISMATCHED)
+			# サブディレクトリ内のファイルとして追加
 			list(APPEND HEADER_LIST ${HEADER})
-		else()
-			list(APPEND ROOTHEADER_LIST ${HEADER})
 		endif()
 	endforeach()
 	install(FILES ${HEADER_LIST} DESTINATION include/${COPYHEADERS_MY_DIR}/${DIRNAME})
 endforeach()
+# ルートディレクトリ内のヘッダを出力
+foreach(HEADER IN LISTS HEADERS)
+	unset(ROOTHEADER_LIST)
+	foreach(HEADER IN LISTS HEADERS)
+		string(REGEX MATCH ".*/${COPYHEADERS_MY_DIR}/[^/\\\\]+\\.hpp" ISMATCHED ${HEADER})
+		if(ISMATCHED)
+			# ルートディレクトリのファイルとして追加
+			list(APPEND ROOTHEADER_LIST ${HEADER})
+		endif()
+	endforeach()
+endforeach()
 install(FILES ${ROOTHEADER_LIST} DESTINATION include/${COPYHEADERS_MY_DIR})
+


Added support for the new Intel Compiler 12 (Intel Composer XE)

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -140,11 +140,18 @@
 		OUTPUT_VARIABLE CXX_COMPILER_VERSION
 	)
 	STRING(STRIP ${CXX_COMPILER_VERSION} CXX_COMPILER_VERSION)
+
+	## just to make sure that the compiler version has 3 numbers and 2 dots
+	## (sometimes, g++ gives, e.g., 4.4 instead of 4.4.0)
+	STRING(REGEX REPLACE "^([0-9][0-9])\\.([0-9])$" "\\1.\\2.0"
+		CXX_COMPILER_VERSION ${CXX_COMPILER_VERSION})

-	STRING(REGEX REPLACE "([0-9])\\.([0-9])" "\\1"
+	STRING(REGEX REPLACE "([0-9][0-9])\\.([0-9])\\.([0-9])$" "\\1"
 		CXX_COMPILER_VERSION_MAJOR ${CXX_COMPILER_VERSION})
-	STRING(REGEX REPLACE "([0-9])\\.([0-9])" "\\2"
+	STRING(REGEX REPLACE "([0-9][0-9])\\.([0-9])\\.([0-9])$" "\\2"
 		CXX_COMPILER_VERSION_MINOR ${CXX_COMPILER_VERSION})
+	STRING(REGEX REPLACE "([0-9][0-9])\\.([0-9])\\.([0-9])$" "\\3"
+		CXX_COMPILER_VERSION_MINOR_MINOR ${CXX_COMPILER_VERSION})

 ELSEIF(CMAKE_CXX_COMPILER MATCHES "clang")
 	SET(CXX_COMPILER_ID "LLVM")


haskell-build-fixes: improve description of SHARED_ONLY

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -245,9 +245,7 @@
 #  ; -> " " is not yet implemented)
 #
 # ONLY_SHARED:
-#  Add this plugin only to shared builds of elektra (BUILD_SHARED) and not to full or
-#  static builds in case both BUILD_SHARED and one or both of BUILD_FULL and BUILD_STATIC
-#  is enabled.
+#  Do not include this plugin in FULL or STATIC builds.
 #
 # ADD_TEST:
 #  Add a plugin test case written in C (alternatively you can use add_gtest)


allow cmake build with CMA-ES support without pkg-config nor full install of libcmaes

--- cmake/modules/FindLibCmaes.cmake
+++ cmake/modules/FindLibCmaes.cmake
@@ -24,12 +24,14 @@
 # in the FIND_PATH() and FIND_LIBRARY() calls
 if( NOT WIN32 )
   find_package(PkgConfig)
+  pkg_check_modules(PC_LIBCMAES QUIET libcmaes)

-  pkg_check_modules(PC_LIBCMAES REQUIRED libcmaes)
+  if( PKG_CONFIG_FOUND )
+    set(LIBCMAES_INCLUDE_DIR ${PC_LIBCMAES_INCLUDE_DIRS})
+    set(LIBCMAES_LIBRARIES ${PC_LIBCMAES_LIBRARY_DIRS})
+    set(LIBCMAES_DEFINITIONS ${PC_LIBCMAES_CFLAGS_OTHER})
+  endif( PKG_CONFIG_FOUND )

-  set(LIBCMAES_INCLUDE_DIR ${PC_LIBCMAES_INCLUDE_DIRS})
-  set(LIBCMAES_LIBRARIES ${PC_LIBCMAES_LIBRARY_DIRS})
-  set(LIBCMAES_DEFINITIONS ${PC_LIBCMAES_CFLAGS_OTHER})
 endif( NOT WIN32 )

 find_path(LIBCMAES_INCLUDE_DIR NAMES cmaes.h


Compatibility fix for cmake <= 2.8.11

Compatibility fix for cmake <= 2.8.11

See https://cmake.org/cmake/help/v3.0/command/get_filename_component.html
Fixes Aarch64 builds.

--- cmake/modules/Findtcmalloc.cmake
+++ cmake/modules/Findtcmalloc.cmake
@@ -36,4 +36,4 @@
   get_filename_component(TCMALLOC_LIBRARY_DIRS ${TCMALLOC_profiler_LIBRARY} PATH)
 endif()

-get_filename_component(TCMALLOC_LIBRARY_PATH ${TCMALLOC_tcmalloc_LIBRARY} DIRECTORY)
+get_filename_component(TCMALLOC_LIBRARY_PATH ${TCMALLOC_tcmalloc_LIBRARY} PATH)


WRG: try warning fixes from diapotb

WRG: try warning fixes from diapotb

--- Modules/Remote/diapotb.remote.cmake
+++ Modules/Remote/diapotb.remote.cmake
@@ -22,5 +22,5 @@
 otb_fetch_module(DiapOTBModule
   "OTB module for SAR processing in Diapason."
   GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
-  GIT_TAG f6e6d39e8c4f5d2182720cfb64295d1b03218258
+  GIT_TAG 04628a9c183883b461114ff5b099943197431f5a
 )


disable output compression since this feature seems to be broken

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -146,7 +146,7 @@
 endif(NOT EIGEN_NO_UPDATE)

 # which ctest command to use for running the dashboard
-SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}")
+SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE} --no-compress-output")
 if($ENV{EIGEN_CTEST_ARGS})
 SET (CTEST_COMMAND "${CTEST_COMMAND} $ENV{EIGEN_CTEST_ARGS}")
 endif($ENV{EIGEN_CTEST_ARGS})


update cdash testsuite file to use mercurial

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -39,7 +39,7 @@
 # VERSION=opensuse-11.1
 # WORK_DIR=/home/gael/Coding/eigen2/cdash
 # # get the last version of the script
-# svn cat svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2/test/testsuite.cmake > $WORK_DIR/testsuite.cmake
+# wget http://bitbucket.org/eigen/eigen2/raw/tip/test/testsuite.cmake -o $WORK_DIR/testsuite.cmake
 # COMMON="ctest -S $WORK_DIR/testsuite.cmake,EIGEN_WORK_DIR=$WORK_DIR,EIGEN_SITE=$SITE,EIGEN_MODE=$1,EIGEN_BUILD_STRING=$OS_VERSION-$ARCH"
 # $COMMON-gcc-3.4.6,EIGEN_CXX=g++-3.4
 # $COMMON-gcc-4.0.1,EIGEN_CXX=g++-4.0.1
@@ -132,8 +132,8 @@

 ## mandatory variables (the default should be ok in most cases):

-SET (CTEST_CVS_COMMAND "svn")
-SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} co svn://anonsvn.kde.org/home/kde/trunk/kdesupport/eigen2 \"${CTEST_SOURCE_DIRECTORY}\"")
+SET (CTEST_CVS_COMMAND "hg")
+SET (CTEST_CVS_CHECKOUT "${CTEST_CVS_COMMAND} clone http://bitbucket.org/eigen/eigen2 \"${CTEST_SOURCE_DIRECTORY}\"")

 # which ctest command to use for running the dashboard
 SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}")


Revert "Added lost parameter to FPHSA in FindMagnum.cmake."

It shouldn't probably be there.

This reverts commit 64b6c6d6b5985dc3ead455aedb23e23922cb4e90.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -160,7 +160,7 @@
 endforeach()

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Magnum DEFAULT_MSG
+find_package_handle_standard_args(Magnum
     REQUIRED_VARS MAGNUM_INCLUDE_DIR MAGNUM_LIBRARY
     HANDLE_COMPONENTS)


Improved the FindPoppler cmake script (component-based, not dependant on QT_MAJOR_VERSION being set)

--- FindPoppler.cmake
+++ FindPoppler.cmake
@@ -1,27 +1,34 @@
-# - Try to find Poppler and Poppler-Qt4
+# - Try to find Poppler and specified components (Qt4, Qt5)
 # Once done this will define
 #
-#  POPPLER_FOUND - system has Poppler and Poppler-Qt4
+#  POPPLER_FOUND - system has Poppler and specified components
+#  POPPLER_INCLUDE_DIRS - The include directories for Poppler headers
+#  POPPLER_LIBRARIES - Link these to use Poppler
+#  POPPLER_NEEDS_FONTCONFIG - A boolean indicating if libpoppler depends on libfontconfig
 #  POPPLER_HAS_XPDF - A boolean indicating if Poppler XPDF headers are available
-#  POPPLER_NEEDS_FONTCONFIG - A boolean indicating if libpoppler depends on libfontconfig
 #  POPPLER_XPDF_INCLUDE_DIR - the include directory for Poppler XPDF headers
-#  POPPLER_QT_INCLUDE_DIR - the include directory for Poppler-Qt4 headers
-#  POPPLER_QT_LIBRARIES  - Link this to use only libpoppler-Qt4
-#  POPPLER_LIBRARIES - Link these to use Poppler and Poppler-Qt4
-#
-# Note: the Poppler-cpp include directory is currently not needed by TeXworks
 #
 # Redistribution and use of this file is allowed according to the terms of the
 # MIT license. For details see the file COPYING-CMAKE-MODULES.

-if ( POPPLER_LIBRARIES )
+if( POPPLER_LIBRARIES )
    # in cache already
-   SET(Poppler_FIND_QUIETLY TRUE)
-endif ( POPPLER_LIBRARIES )
+   SET( Poppler_FIND_QUIETLY TRUE )
+endif( POPPLER_LIBRARIES )

-if (NOT QT_VERSION_MAJOR)
-  message(SEND_ERROR "QT_VERSION_MAJOR is undefined. Run find_package(Qt) before find_package(Poppler).")
-  return()
+# Check which components we need to find
+list(FIND Poppler_FIND_COMPONENTS "Qt4" FIND_POS)
+if(${FIND_POS} EQUAL -1)
+  set(FIND_QT4 FALSE)
+else()
+  set(FIND_QT4 TRUE)
+endif()
+
+list(FIND Poppler_FIND_COMPONENTS "Qt5" FIND_POS)
+if(${FIND_POS} EQUAL -1)
+  set(FIND_QT5 FALSE)
+else()
+  set(FIND_QT5 TRUE)
 endif()

 # use pkg-config to get the directories and then use these values
@@ -30,94 +37,89 @@
   find_package(PkgConfig)

   pkg_check_modules(POPPLER_PKG QUIET poppler)
-  pkg_check_modules(POPPLER_QT_PKG QUIET poppler-qt${QT_VERSION_MAJOR})
+if( FIND_QT4 )
+  pkg_check_modules(POPPLER_QT_PKG QUIET poppler-qt4)
+endif()
+if( FIND_QT5 )
+  pkg_check_modules(POPPLER_QT_PKG QUIET poppler-qt5)
+endif()
 endif( NOT WIN32 )

 # Check for Poppler XPDF headers (optional)
-FIND_PATH(POPPLER_XPDF_INCLUDE_DIR NAMES poppler-config.h
-  PATHS
-    /usr/local/include
-    /usr/include
-  HINTS
-    ${POPPLER_PKG_INCLUDE_DIRS} # Generated by pkg-config
-  PATH_SUFFIXES
-    poppler
-)
-
+FIND_PATH(POPPLER_XPDF_INCLUDE_DIR NAMES poppler-config.h PATH_SUFFIXES poppler)
 IF( NOT(POPPLER_XPDF_INCLUDE_DIR) )
-  IF ( NOT Poppler_FIND_QUIETLY )
+  IF( NOT Poppler_FIND_QUIETLY )
     MESSAGE( STATUS "Could not find poppler-config.h, disabling support for Xpdf headers." )
-  ENDIF ( NOT Poppler_FIND_QUIETLY )
+  ENDIF( NOT Poppler_FIND_QUIETLY )
   SET( POPPLER_HAS_XPDF false )
 ELSE( NOT(POPPLER_XPDF_INCLUDE_DIR) )
   SET( POPPLER_HAS_XPDF true )
 ENDIF( NOT(POPPLER_XPDF_INCLUDE_DIR) )

+# Find Poppler headers
+FIND_PATH(POPPLER_INCLUDE_DIR NAMES poppler-version.h PATH_SUFFIXES cpp poppler/cpp)
+
 # Find libpoppler, libpoppler-qt4 and associated header files (Required)
-FIND_LIBRARY(POPPLER_LIBRARIES NAMES poppler ${POPPLER_PKG_LIBRARIES}
-  PATHS
-    /usr/local
-    /usr
-  HINTS
-    ${POPPLER_PKG_LIBRARY_DIRS} # Generated by pkg-config
-  PATH_SUFFIXES
-    lib64
-    lib
-)
-IF ( NOT(POPPLER_LIBRARIES) )
+FIND_LIBRARY(POPPLER_LIBRARY NAMES poppler ${POPPLER_PKG_LIBRARIES})
+IF ( NOT(POPPLER_LIBRARY) )
   IF ( NOT Poppler_FIND_QUIETLY )
     MESSAGE(STATUS "Could not find libpoppler." )
   ENDIF ( NOT Poppler_FIND_QUIETLY )
-ELSE( NOT(POPPLER_LIBRARIES) )
+ELSE( NOT(POPPLER_LIBRARY) )
   # Scan poppler libraries for dependencies on Fontconfig
   INCLUDE(GetPrerequisites)
   MARK_AS_ADVANCED(gp_cmd)
-  GET_PREREQUISITES("${POPPLER_LIBRARIES}" POPPLER_PREREQS 1 0 "" "")
+  GET_PREREQUISITES("${POPPLER_LIBRARY}" POPPLER_PREREQS 1 0 "" "")
   IF ("${POPPLER_PREREQS}" MATCHES "fontconfig")
     SET(POPPLER_NEEDS_FONTCONFIG TRUE)
   ELSE ()
     SET(POPPLER_NEEDS_FONTCONFIG FALSE)
   ENDIF ()

+  # Qt4 Component
+  IF( FIND_QT4 )
+    FIND_PATH(POPPLER_QT4_INCLUDE_DIR NAMES poppler-qt4.h poppler-link.h
+              PATH_SUFFIXES qt4 poppler/qt4)
+    IF ( NOT(POPPLER_QT4_INCLUDE_DIR) )
+      IF ( NOT Poppler_FIND_QUIETLY )
+        MESSAGE(STATUS "Could not find Poppler-Qt4 headers." )
+      ENDIF ( NOT Poppler_FIND_QUIETLY )
+    ENDIF ()
+    FIND_LIBRARY(POPPLER_QT4_LIBRARY NAMES poppler-qt4 ${POPPLER_QT_PKG_LIBRARIES})
+    IF ( NOT(POPPLER_QT4_LIBRARY) )
+      IF ( NOT Poppler_FIND_QUIETLY )
+        MESSAGE(STATUS "Could not find libpoppler-qt4." )
+      ENDIF ( NOT Poppler_FIND_QUIETLY )
+    ENDIF ()
+  ENDIF()

-  FIND_PATH(POPPLER_QT_INCLUDE_DIR NAMES poppler-qt${QT_VERSION_MAJOR}.h poppler-link.h
-    PATHS
-      /usr/local/include
-      /usr/include
-    HINTS
-      ${POPPLER_QT_PKG_INCLUDE_DIRS} # Generated by pkg-config
-    PATH_SUFFIXES
-      poppler
-      qt${QT_VERSION_MAJOR}
-      poppler/qt${QT_VERSION_MAJOR}
-  )
-  IF ( NOT(POPPLER_QT_INCLUDE_DIR) )
-    IF ( NOT Poppler_FIND_QUIETLY )
-      MESSAGE(STATUS "Could not find Poppler-Qt${QT_VERSION_MAJOR} headers." )
-    ENDIF ( NOT Poppler_FIND_QUIETLY )
-  ENDIF ()
-  FIND_LIBRARY(POPPLER_QT_LIBRARIES NAMES poppler-qt${QT_VERSION_MAJOR} ${POPPLER_QT_PKG_LIBRARIES}
-    PATHS
-      /usr/local
-      /usr
-    HINTS
-      ${POPPLER_PKG_LIBRARY_DIRS} # Generated by pkg-config
-    PATH_SUFFIXES
-      lib64
-      lib
-  )
-  IF ( NOT(POPPLER_QT_LIBRARIES) )
-    IF ( NOT Poppler_FIND_QUIETLY )
-      MESSAGE(STATUS "Could not find libpoppler-qt${QT_VERSION_MAJOR}." )
-    ENDIF ( NOT Poppler_FIND_QUIETLY )
-  ENDIF ()
-  LIST(INSERT POPPLER_LIBRARIES 0 ${POPPLER_QT_LIBRARIES})
-ENDIF ( NOT(POPPLER_LIBRARIES) )
+  # Qt5 Component
+  IF( FIND_QT5 )
+    FIND_PATH(POPPLER_QT5_INCLUDE_DIR NAMES poppler-qt5.h poppler-link.h
+              PATH_SUFFIXES qt5 poppler/qt5)
+    IF ( NOT(POPPLER_QT5_INCLUDE_DIR) )
+      IF ( NOT Poppler_FIND_QUIETLY )
+        MESSAGE(STATUS "Could not find Poppler-Qt5 headers." )
+      ENDIF ( NOT Poppler_FIND_QUIETLY )
+    ENDIF ()
+    FIND_LIBRARY(POPPLER_QT5_LIBRARY NAMES poppler-qt5 ${POPPLER_QT_PKG_LIBRARIES})
+    IF ( NOT(POPPLER_QT5_LIBRARY) )
+      IF ( NOT Poppler_FIND_QUIETLY )
+        MESSAGE(STATUS "Could not find libpoppler-qt5." )
+      ENDIF ( NOT Poppler_FIND_QUIETLY )
+    ENDIF ()
+  ENDIF()
+ENDIF ( NOT(POPPLER_LIBRARY) )
+
+LIST(APPEND POPPLER_INCLUDE_DIRS ${POPPLER_INCLUDE_DIR}
+     ${POPPLER_QT4_INCLUDE_DIR} ${POPPLER_QT5_INCLUDE_DIR})
+
+LIST(APPEND POPPLER_LIBRARIES ${POPPLER_LIBRARY}
+     ${POPPLER_QT4_LIBRARY} ${POPPLER_QT5_LIBRARY})

 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Poppler DEFAULT_MSG POPPLER_LIBRARIES POPPLER_QT_INCLUDE_DIR )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Poppler DEFAULT_MSG POPPLER_LIBRARIES POPPLER_INCLUDE_DIRS)

-
-# show the POPPLER_(XPDF/QT4)_INCLUDE_DIR and POPPLER_LIBRARIES variables only in the advanced view
-MARK_AS_ADVANCED(POPPLER_XPDF_INCLUDE_DIR POPPLER_QT_INCLUDE_DIR POPPLER_LIBRARIES POPPLER_QT_LIBRARIES)
-
+MARK_AS_ADVANCED(POPPLER_XPDF_INCLUDE_DIR POPPLER_INCLUDE_DIR
+                 POPPLER_QT4_INCLUDE_DIR POPPLER_QT5_INCLUDE_DIR
+                 POPPLER_LIBRARIES POPPLER_QT4_LIBRARY POPPLER_QT5_LIBRARY)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


BUG: Not using the absolute path anymore (not valid for install)

--- Wrapping/ExplicitITK/CreateExplicitInstantiations.cmake
+++ Wrapping/ExplicitITK/CreateExplicitInstantiations.cmake
@@ -211,7 +211,7 @@

     # And add the h file to the list of includes.
     SET(WRAPPER_EXPLICIT_INSTANTIATION_INCLUDES
-      ${WRAPPER_EXPLICIT_INSTANTIATION_INCLUDES} "${h_file}")
+      ${WRAPPER_EXPLICIT_INSTANTIATION_INCLUDES} "${module_name}${mangled_suffix}.h")
     SET(WRAPPER_EXPLICIT_INSTANTIATION_SOURCES
       ${WRAPPER_EXPLICIT_INSTANTIATION_SOURCES} ${cxx_file})
   ENDFOREACH(wrap)


Fixed variable name dereference

Fixed variable name dereference

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -178,7 +178,7 @@

 MACRO(SETUP_COMMANDLINE_APPLICATION APPLICATION_NAME)

-    SETUP_APPLICATION(APPLICATION_NAME 1)
+    SETUP_APPLICATION(${APPLICATION_NAME} 1)

 ENDMACRO(SETUP_COMMANDLINE_APPLICATION)

@@ -202,6 +202,6 @@

 MACRO(SETUP_COMMANDLINE_EXAMPLE EXAMPLE_NAME)

-    SETUP_EXAMPLE(EXAMPLE_NAME 1)
+    SETUP_EXAMPLE(${EXAMPLE_NAME} 1)

 ENDMACRO(SETUP_COMMANDLINE_EXAMPLE)


Deprecated IOS_ARCH in favor for ARCHS.

Deprecated IOS_ARCH in favor for ARCHS.

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -81,7 +81,7 @@
 #
 # ENABLE_VISIBILITY: (1|0) Enables or disables symbol visibility support. Default 0 (false, visibility hidden by default)
 #
-# IOS_ARCH: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM
+# ARCHS: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM
 #    OS = armv7 armv7s arm64 (if applicable)
 #    OS64 = arm64 (if applicable)
 #    SIMULATOR = i386
@@ -115,6 +115,7 @@
 # IOS_DEPLOYMENT_TARGET: (Deprecated) Alias to DEPLOYMENT_TARGET
 # CMAKE_IOS_DEVELOPER_ROOT: (Deprecated) Alias to CMAKE_DEVELOPER_ROOT
 # IOS_PLATFORM: (Deprecated) Alias to PLATFORM
+# IOS_ARCH: (Deprecated) Alias to ARCHS
 #
 # *****************************************************************************
 #
@@ -157,6 +158,11 @@
 if(DEFINED CMAKE_IOS_DEVELOPER_ROOT)
   set(CMAKE_DEVELOPER_ROOT ${CMAKE_IOS_DEVELOPER_ROOT})
   message(DEPRECATION "CMAKE_IOS_DEVELOPER_ROOT argument is DEPRECATED. Consider using the new CMAKE_DEVELOPER_ROOT argument instead.")
+endif()
+
+if(DEFINED IOS_ARCH)
+  set(ARCHS ${IOS_ARCH})
+  message(DEPRECATION "IOS_ARCH argument is DEPRECATED. Consider using the new ARCHS argument instead.")
 endif()

 ######## END ALIASES
@@ -195,30 +201,30 @@
 # from the specified PLATFORM name.
 if(PLATFORM_INT STREQUAL "OS")
   set(SDK_NAME iphoneos)
-  if(NOT IOS_ARCH)
+  if(NOT ARCHS)
     if (XCODE_VERSION VERSION_GREATER 10.0)
-      set(IOS_ARCH armv7 armv7s arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
+      set(ARCHS armv7 armv7s arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
     else()
-      set(IOS_ARCH armv7 armv7s arm64)
+      set(ARCHS armv7 armv7s arm64)
     endif()
   endif()
 elseif(PLATFORM_INT STREQUAL "OS64")
   set(SDK_NAME iphoneos)
-  if(NOT IOS_ARCH)
+  if(NOT ARCHS)
     if (XCODE_VERSION VERSION_GREATER 10.0)
-      set(IOS_ARCH arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
+      set(ARCHS arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
     else()
-      set(IOS_ARCH arm64)
+      set(ARCHS arm64)
     endif()
   endif()
 elseif(PLATFORM_INT STREQUAL "OS64COMBINED")
   set(SDK_NAME iphoneos)
   if(MODERN_CMAKE)
-    if(NOT IOS_ARCH)
+    if(NOT ARCHS)
       if (XCODE_VERSION VERSION_GREATER 10.0)
-        set(IOS_ARCH arm64 x86_64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
+        set(ARCHS arm64 x86_64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
       else()
-        set(IOS_ARCH arm64 x86_64)
+        set(ARCHS arm64 x86_64)
       endif()
     endif()
   else()
@@ -226,51 +232,51 @@
   endif()
 elseif(PLATFORM_INT STREQUAL "SIMULATOR")
   set(SDK_NAME iphonesimulator)
-  if(NOT IOS_ARCH)
-    set(IOS_ARCH i386)
+  if(NOT ARCHS)
+    set(ARCHS i386)
   endif()
   message(DEPRECATION "SIMULATOR IS DEPRECATED. Consider using SIMULATOR64 instead.")
 elseif(PLATFORM_INT STREQUAL "SIMULATOR64")
   set(SDK_NAME iphonesimulator)
-  if(NOT IOS_ARCH)
-    set(IOS_ARCH x86_64)
+  if(NOT ARCHS)
+    set(ARCHS x86_64)
   endif()
 elseif(PLATFORM_INT STREQUAL "TVOS")
   set(SDK_NAME appletvos)
-  if(NOT IOS_ARCH)
-    set(IOS_ARCH arm64)
+  if(NOT ARCHS)
+    set(ARCHS arm64)
   endif()
 elseif (PLATFORM_INT STREQUAL "TVOSCOMBINED")
   set(SDK_NAME appletvos)
   if(MODERN_CMAKE)
-    if(NOT IOS_ARCH)
-      set(IOS_ARCH arm64 x86_64)
+    if(NOT ARCHS)
+      set(ARCHS arm64 x86_64)
     endif()
   else()
     message(FATAL_ERROR "Please make sure that you are running CMake 3.14+ to make the TVOSCOMBINED setting work")
   endif()
 elseif(PLATFORM_INT STREQUAL "SIMULATOR_TVOS")
   set(SDK_NAME appletvsimulator)
-  if(NOT IOS_ARCH)
-    set(IOS_ARCH x86_64)
+  if(NOT ARCHS)
+    set(ARCHS x86_64)
   endif()
 elseif(PLATFORM_INT STREQUAL "WATCHOS")
   set(SDK_NAME watchos)
-  if(NOT IOS_ARCH)
+  if(NOT ARCHS)
     if (XCODE_VERSION VERSION_GREATER 10.0)
-      set(IOS_ARCH armv7k arm64_32)
+      set(ARCHS armv7k arm64_32)
     else()
-      set(IOS_ARCH armv7k)
+      set(ARCHS armv7k)
     endif()
   endif()
 elseif(PLATFORM_INT STREQUAL "WATCHOSCOMBINED")
   set(SDK_NAME watchos)
   if(MODERN_CMAKE)
-    if(NOT IOS_ARCH)
+    if(NOT ARCHS)
       if (XCODE_VERSION VERSION_GREATER 10.0)
-        set(IOS_ARCH armv7k arm64_32 i386)
+        set(ARCHS armv7k arm64_32 i386)
       else()
-        set(IOS_ARCH armv7k i386)
+        set(ARCHS armv7k i386)
       endif()
     endif()
   else()
@@ -278,14 +284,14 @@
   endif()
 elseif(PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
   set(SDK_NAME watchsimulator)
-  if(NOT IOS_ARCH)
-    set(IOS_ARCH i386)
+  if(NOT ARCHS)
+    set(ARCHS i386)
   endif()
 else()
   message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}")
 endif()
 message(STATUS "Configuring iOS build for platform: ${PLATFORM_INT}, "
-  "architecture(s): ${IOS_ARCH}")
+  "architecture(s): ${ARCHS}")

 if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
   message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode")
@@ -332,7 +338,7 @@
   message(STATUS "Using the default min-version since DEPLOYMENT_TARGET not provided!")
 endif()
 # Use bitcode or not
-if(NOT DEFINED ENABLE_BITCODE AND NOT IOS_ARCH MATCHES "((^|, )(i386|x86_64))+")
+if(NOT DEFINED ENABLE_BITCODE AND NOT ARCHS MATCHES "((^|, )(i386|x86_64))+")
   # Unless specified, enable bitcode support by default
   message(STATUS "Enabling bitcode support by default. ENABLE_BITCODE not provided!")
   set(ENABLE_BITCODE TRUE)
@@ -435,7 +441,7 @@
 set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
 set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
 # Set the architectures for which to build.
-set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS")
+set(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS")
 # Change the type of target generated for try_compile() so it'll work when cross-compiling
 set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
 # All iOS/Darwin specific settings - some may be redundant.
@@ -454,7 +460,7 @@
 set(CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
 set(CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

-if(IOS_ARCH MATCHES "((^|, )(arm64|arm64e|x86_64))+")
+if(ARCHS MATCHES "((^|, )(arm64|arm64e|x86_64))+")
   set(CMAKE_C_SIZEOF_DATA_PTR 8)
   set(CMAKE_CXX_SIZEOF_DATA_PTR 8)
   message(STATUS "Using a data_ptr size of 8")


[cmake] force dynamic lib on debian

[cmake] force dynamic lib on debian

--- Numerics/cmake/FindLpSolve.cmake
+++ Numerics/cmake/FindLpSolve.cmake
@@ -1,6 +1,15 @@
 #Please note that we are using lpsolve 5.5
 FIND_PATH(LpSolve_INCLUDE_DIR lpsolve/lp_lib.h)
-FIND_LIBRARY(LpSolve_LIBRARY lpsolve55)
+
+# debian nonsense: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503314
+if(EXISTS "/etc/debian_version")
+  FIND_LIBRARY(LpSolve_LIBRARY lpsolve55 PATH_SUFFIXES "lp_solve")
+  IF(LpSolve_LIBRARY AND "${LpSolve_LIBRARY}" MATCHES ".a$" AND NOT I_WANT_STATIC_LPSOLVE)
+    SET(LpSolve_LIBRARY FALSE)
+  ENDIF()
+ELSE()
+  FIND_LIBRARY(LpSolve_LIBRARY lpsolve55)
+ENDIF()

 IF (NOT LpSolve_INCLUDE_DIR)
   MESSAGE("Cannot find LPSOLVE headers!")


Add VS 17 2022 support (#350)

Add VS 17 2022 support (#350)

--- conan.cmake
+++ conan.cmake
@@ -55,6 +55,8 @@
         set(${result} 15 PARENT_SCOPE)
     elseif(NOT MSVC_VERSION VERSION_LESS 1920 AND MSVC_VERSION VERSION_LESS 1930)
         set(${result} 16 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1930 AND MSVC_VERSION VERSION_LESS 1940)
+        set(${result} 17 PARENT_SCOPE)
     else()
         message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]")
     endif()


install here is wrong, this a tool

install here is wrong, this a tool

--- catkin.cmake
+++ catkin.cmake
@@ -12,10 +12,8 @@

 catkin_package(ros)

-install(PROGRAMS
-  bin/roscore
+install(PROGRAMS
   bin/rosrun
-  bin/roslaunch
   bin/rostopic
   bin/rxconsole
   bin/rosbag


Switched to using CMAKE_COMMAND instead of cmake.

--- scripts/external-package.cmake
+++ scripts/external-package.cmake
@@ -9,7 +9,7 @@
     set(generator_flag "-G")
   endif ()

-  execute_process(COMMAND cmake ${generator_flag} ${generator} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/bin/${key} ../../cmake
+  execute_process(COMMAND ${CMAKE_COMMAND} ${generator_flag} ${generator} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/bin/${key} ../../cmake
     WORKING_DIRECTORY ${build_path}
     RESULT_VARIABLE output
     )
@@ -20,7 +20,7 @@
     set(config_value RELWITHDEBINFO)
   endif ()

-  execute_process(COMMAND cmake --build . ${config_flag} ${config_value}
+  execute_process(COMMAND ${CMAKE_COMMAND} --build . ${config_flag} ${config_value}
     WORKING_DIRECTORY ${build_path}
     RESULT_VARIABLE output
     )


cmake: fix manual version with git

cmake: fix manual version with git

--- manual/CMakeModules/gitid.cmake
+++ manual/CMakeModules/gitid.cmake
@@ -13,7 +13,7 @@
   endif()
   message("Current git revision is ${MANUAL_GIT_ID}")
   set(MANUAL_GIT_ID "gitid: ${MANUAL_GIT_ID}")
-  set(MANUAL_GIT_ID "(MANUAL_GIT_ID)")
+  set(MANUAL_GIT_ID "(${MANUAL_GIT_ID})")
 else()
   set (MANUAL_GIT_ID)
 endif()


not using openblas

not using openblas

--- cmake/External/eigen.cmake
+++ cmake/External/eigen.cmake
@@ -5,7 +5,7 @@

 set( Eigen3_VERSION "3.3.3" )

-add_definitions(-DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE)
+#add_definitions(-DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE)
 find_package(BLAS REQUIRED)
 ExternalProject_Add(eigen
     PREFIX ${EIGEN_PREFIX}


cmake/macros: fix install_external_library for dlls

--- cmake/Modules/Macros.cmake
+++ cmake/Modules/Macros.cmake
@@ -55,7 +55,13 @@

 function(install_external_library target)
   foreach(file ${ARGN})
-    install(CODE "get_filename_component(resolved_file \"${file}\" REALPATH)\n get_filename_component(file_name \"${file}\" NAME)\n file(INSTALL DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} TYPE FILE RENAME \${file_name} FILES \"\${resolved_file}\" )")
+    get_filename_component(resolved_file "${file}" REALPATH)
+    get_filename_component(file_name "${file}" NAME)
+    if((NOT WIN32 AND "${file_name}" MATCHES ".*${CMAKE_SHARED_LIBRARY_SUFFIX}$") OR "${file_name}" MATCHES ".*${CMAKE_IMPORT_LIBRARY_SUFFIX}$" OR "${file_name}" MATCHES ".*${CMAKE_STATIC_LIBRARY_SUFFIX}$" OR "${file_name}" MATCHES ".*${CMAKE_LINK_LIBRARY_SUFFIX}$")
+      install(FILES ${resolved_file} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} RENAME ${file_name})
+    elseif("${file_name}" MATCHES ".*${CMAKE_EXECUTABLE_SUFFIX}$" OR (WIN32 AND "${file_name}" MATCHES ".*${CMAKE_SHARED_LIBRARY_SUFFIX}$"))
+      install(FILES ${resolved_file} DESTINATION ${CMAKE_INSTALL_FULL_BINDIR} RENAME ${file_name})
+    endif()
   endforeach()
 endfunction()


Revert "Un-break build on clang."

Revert "Un-break build on clang."

This reverts commit b3c351c539332b25f47ffd1f6a7bccfa0f512ab1.

--- cmake/Modules/cflags.cmake
+++ cmake/Modules/cflags.cmake
@@ -25,7 +25,7 @@
 	if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
 		set(HAVE_COMPILER_CLANG "1")
 		test_c11()
-		add_definitions("${SGHERM_C_STANDARD} -Wpedantic -Wall -Wextra")
+		list(APPEND CMAKE_C_FLAGS "${SGHERM_C_STANDARD} -Wpedantic -Wall -Wextra")
 		if(HAVE_POSIX)
 			list(APPEND CMAKE_CXX_FLAGS_DEBUG "-g3")
 			list(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO "-g3")
@@ -33,7 +33,7 @@
 	elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
 		set(HAVE_COMPILER_GCC "1")
 		test_c11()
-		add_definitions("${SGHERM_C_STANDARD} -pedantic -Wall -Wextra")
+		list(APPEND CMAKE_C_FLAGS "${SGHERM_C_STANDARD} -pedantic -Wall -Wextra")
 		if(HAVE_POSIX)
 			list(APPEND CMAKE_CXX_FLAGS_DEBUG "-ggdb")
 			list(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO "-ggdb")
@@ -41,10 +41,10 @@
 	elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel")
 		set(HAVE_COMPILER_INTEL "1")
 		test_c11()
-		add_definitions("${SGHERM_C_STANDARD} -Wall -Wextra")
+		list(APPEND CMAKE_C_FLAGS "${SGHERM_C_STANDARD} -Wall -Wextra")
 	elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
 		set(HAVE_COMPILER_MSVC "1")
-		add_definitions("/G5 /Gr /D _CRT_SECURE_NO_WARNINGS")
+		list(APPEND CMAKE_CXX_FLAGS "/G5 /Gr /D _CRT_SECURE_NO_WARNINGS")
 		# /G5 - Enable Pentium optimisations
 		# /Gr - __fastcall as deafult
 		# /D _CRT_NO_SECURE_WARNINGS - disable whining about fopen and friends


Boost: Add more variants for search

Boost: Add more variants for search

Prepare for Boost 1.69.0 release

--- cmake/find/FindBoost.cmake
+++ cmake/find/FindBoost.cmake
@@ -1030,6 +1030,19 @@
     ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION}
     ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}
     ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
+
+  # In Hunter it's possible to have only one variant in root,
+  # so it's okay to add all of them to search.
+  foreach(__type i x a m)
+    foreach(__bit 32 64)
+      list(
+          APPEND
+          _boost_RELEASE_NAMES
+          ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${__type}${__bit}
+      )
+    endforeach()
+  endforeach()
+
   if(_boost_STATIC_RUNTIME_WORKAROUND)
     set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}")
     list(APPEND _boost_RELEASE_NAMES
@@ -1072,6 +1085,19 @@
     ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}
     ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}
     ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT} )
+
+  # In Hunter it's possible to have only one variant in root,
+  # so it's okay to add all of them to search.
+  foreach(__type i x a m)
+    foreach(__bit 32 64)
+      list(
+          APPEND
+          _boost_DEBUG_NAMES
+          ${Boost_LIB_PREFIX}${Boost_NAMESPACE}_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${__type}${__bit}
+      )
+    endforeach()
+  endforeach()
+
   if(_boost_STATIC_RUNTIME_WORKAROUND)
     set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}")
     list(APPEND _boost_DEBUG_NAMES


cmake: support relocating of a board folder

Fixes: #49116

During development of out-of-tree boards and applications it is not
uncommon to refactor / restructure code.

To allow developers more freedom, let's check that board's defconfig
still exists during a CMake re-run.
If the defconfig no longer exists, either because it's been moved or
deleted, then warn the user and set BOARD_DIR to NOTFOUND.

The NOTFOUND will request CMake to search for the new location in all
board roots. If the board has not been found, as example it's deleted,
then the existing error is printed later.

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

--- cmake/modules/boards.cmake
+++ cmake/modules/boards.cmake
@@ -104,6 +104,12 @@
       message("Board alias ${BOARD_ALIAS} is hiding the real board of same name")
     endif()
   endif()
+  if(BOARD_DIR AND NOT EXISTS ${BOARD_DIR}/${BOARD}_defconfig)
+    message(WARNING "BOARD_DIR: ${BOARD_DIR} has been moved or deleted. "
+                    "Trying to find new location."
+    )
+    set(BOARD_DIR BOARD_DIR-NOTFOUND CACHE PATH "Path to a file." FORCE)
+  endif()
   find_path(BOARD_DIR
     NAMES ${BOARD}_defconfig
     PATHS ${root}/boards/*/*


build: dependencies for sinsp target

build: dependencies for sinsp target

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

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -11,55 +11,11 @@
 # specific language governing permissions and limitations under the License.
 #

-
 set(SYSDIG_WORKING_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/sysdig-repo")
 set(SYSDIG_REPO_DIR "${CMAKE_BINARY_DIR}/sysdig-repo")
-# execute_process(COMMAND cmake -E make_directory ${SYSDIG_REPO_DIR})
 execute_process(COMMAND "${CMAKE_COMMAND}" -B ${SYSDIG_REPO_DIR} WORKING_DIRECTORY "${SYSDIG_WORKING_DIR}")
 execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${SYSDIG_REPO_DIR}")
 set(SYSDIG_SOURCE_DIR "${SYSDIG_REPO_DIR}/sysdig-prefix/src/sysdig")
-
-# if(NOT SYSDIG_VERSION)
-#   set(SYSDIG_VERSION "dev")
-# endif()
-
-# ExternalProject_Add(
-#   sysdig
-#   GIT_REPOSITORY https://github.com/draios/sysdig.git
-#   GIT_TAG ${SYSDIG_VERSION}
-#   CONFIGURE_COMMAND ""
-#   BUILD_COMMAND ""
-#   INSTALL_COMMAND ""
-#   TEST_COMMAND "")
-
-# # Fetch the sysdig source directory
-# ExternalProject_Get_Property(sysdig SOURCE_DIR)
-# set(SYSDIG_SOURCE_DIR "${SOURCE_DIR}")
-# unset(SOURCE_DIR)
-# message(STATUS "Source directory of sysdig: ${SYSDIG_SOURCE_DIR}")
-# message(STATUS "Sysdig version: ${SYSDIG_VERSION}")
-
-# set(LIBSCAP_CXX_FLAGS "${CMAKE_CXX_FLAGS}") set(LIBSCAP_C_FLAGS "${CMAKE_C_FLAGS}")
-
-# ExternalProject_Add( libscap DOWNLOAD_COMMAND "" INSTALL_COMMAND "" SOURCE_DIR
-# "${SYSDIG_SOURCE_DIR}/userspace/libscap" CMAKE_ARGS -DCMAKE_CXX_FLAGS=${LIBSCAP_CXX_FLAGS}
-# -DCMAKE_C_FLAGS=${LIBSCAP_C_FLAGS} -DZLIB_INCLUDE=${ZLIB_INCLUDE} -DZLIB_LIB=${ZLIB_LIB} -DBUILD_LIBSCAP_EXAMPLES=OFF
-# -DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH} ) target_compile_options(libscap -DPLATFORM_NAME="${CMAKE_SYSTEM_NAME}")
-
-# set(LIBSINPS_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHAS_CAPTURE") set(LIBSINPS_C_FLAGS "${CMAKE_C_FLAGS}")
-
-# ExternalProject_Add( libsinsp DEPENDS sysdig DOWNLOAD_COMMAND "" INSTALL_COMMAND "" SOURCE_DIR
-# "${SYSDIG_SOURCE_DIR}/userspace/libsinsp" CMAKE_ARGS -DCMAKE_CXX_FLAGS=${LIBSINPS_CXX_FLAGS}
-# -DCMAKE_C_FLAGS=${LIBSINPS_C_FLAGS} -DPROTOBUF_INCLUDE=${PROTOBUF_INCLUDE} -DB64_INCLUDE=${B64_INCLUDE}
-# -DJSONCPP_INCLUDE=${JSONCPP_INCLUDE} -DLUAJIT_INCLUDE=${LUAJIT_INCLUDE} -DTBB_INCLUDE_DIR=${TBB_INCLUDE_DIR}
-# -DCURSES_INCLUDE_DIR=${CURSES_INCLUDE_DIR} -DGRPC_INCLUDE=${GRPC_INCLUDE} -DJQ_INCLUDE=${JQ_INCLUDE}
-# -DOPENSSL_INCLUDE_DIR=${OPENSSL_INCLUDE_DIR} -DCURL_INCLUDE_DIR=${CURL_INCLUDE_DIR} -DCURL_LIBRARIES=${CURL_LIBRARIES}
-# -DJSONCPP_LIB=${JSONCPP_LIB} -DTBB_LIB=${TBB_LIB} -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_OPENSSL=OFF
-# -DUSE_BUNDLED_CURL=OFF -DUSE_BUNDLED_TBB=OFF -DUSE_BUNDLED_GRPC=OFF -DGRPC_CPP_PLUGIN=${GRPC_CPP_PLUGIN}
-# -DPROTOC=${PROTOC} -DOPENSSL_LIBRARIES=${OPENSSL_LIBRARIES} -DLUAJIT_LIB=${LUAJIT_LIB} )
-
-# list(APPEND CMAKE_MODULE_PATH "${SYSDIG_SOURCE_DIR}/cmake/modules")
-#

 # jsoncpp
 set(JSONCPP_SRC "${SYSDIG_SOURCE_DIR}/userspace/libsinsp/third-party/jsoncpp")
@@ -74,3 +30,4 @@

 # Add libsinsp directory
 add_subdirectory("${SYSDIG_SOURCE_DIR}/userspace/libsinsp" "${PROJECT_BINARY_DIR}/userspace/libsinsp")
+add_dependencies(sinsp tbb b64 luajit)


BUG: Creating initial cache should only be done after download

--- CMake/EXAMPLE_Windows_Build.cmake
+++ CMake/EXAMPLE_Windows_Build.cmake
@@ -48,7 +48,7 @@
 #
 # The following advanced variables should only be changed by experts
 #
-set( TUBETK_SCRIPT_DIR "${TUBETK_BINARY_DIR}/CMake" )
+set( TUBETK_SCRIPT_DIR "${TUBETK_SOURCE_DIR}/CMake" )

 set( SITE_CTEST_MODE "Experimental" )

@@ -94,26 +94,30 @@
 set( QT_QMAKE_EXECUTABLE "${SITE_QMAKE_COMMAND}" )

 if( NOT EXISTS "${TUBETK_SOURCE_DIR}/CMakeLists.txt" )
+
   execute_process( COMMAND
     "${SITE_GIT_COMMAND}"
     clone "${TUBETK_GIT_REPOSITORY}" "${TUBETK_SOURCE_DIR}" )
   ctest_run_script()
+
+else()
+
+  set( CTEST_BUILD_NAME "${SITE_BUILD_NAME}-BuildTest-New" )
+  configure_file(
+    ${TUBETK_SCRIPT_DIR}/InitCMakeCache.cmake.in
+    ${TUBETK_BINARY_DIR}/InitCMakeCache.cmake IMMEDIATE @ONLY )
+  set( CTEST_NOTES_FILES "${TUBETK_BINARY_DIR}/InitCMakeCache.cmake" )
+
+  ctest_start( "Experimental" )
+  ctest_update( SOURCE "${TUBETK_SOURCE_DIR}" )
+  ctest_configure( BUILD "${TUBETK_BINARY_DIR}"
+    SOURCE "${TUBETK_SOURCE_DIR}"
+    OPTIONS "-C${TUBETK_BINARY_DIR}/InitCMakeCache.cmake" )
+  ctest_read_custom_files( "${TUBETK_BINARY_DIR}" )
+  ctest_build( BUILD "${TUBETK_BINARY_DIR}" )
+  ctest_test( BUILD "${TUBETK_BINARY_DIR}/TubeTK-Build" )
+  ctest_submit( PARTS Notes Update Configure Build Test )
+
 endif()

-set( CTEST_BUILD_NAME "${SITE_BUILD_NAME}-BuildTest-New" )
-configure_file(
-  ${TUBETK_SCRIPT_DIR}/InitCMakeCache.cmake.in
-  ${TUBETK_BINARY_DIR}/InitCMakeCache.cmake IMMEDIATE @ONLY )
-set( CTEST_NOTES_FILES "${TUBETK_BINARY_DIR}/InitCMakeCache.cmake" )
-
-ctest_start( "Experimental" )
-ctest_update( SOURCE "${TUBETK_SOURCE_DIR}" )
-ctest_configure( BUILD "${TUBETK_BINARY_DIR}"
-  SOURCE "${TUBETK_SOURCE_DIR}"
-  OPTIONS "-C${TUBETK_BINARY_DIR}/InitCMakeCache.cmake" )
-ctest_read_custom_files( "${TUBETK_BINARY_DIR}" )
-ctest_build( BUILD "${TUBETK_BINARY_DIR}" )
-ctest_test( BUILD "${TUBETK_BINARY_DIR}/TubeTK-Build" )
-ctest_submit( PARTS Notes Update Configure Build Test )
-
 set(CTEST_RUN_CURRENT_SCRIPT 0)


updated common.cmake

updated common.cmake

--- jdksavdecc-c/common.cmake
+++ jdksavdecc-c/common.cmake
@@ -63,8 +63,12 @@

 include_directories( include  )

-file(GLOB PROJECT_INCLUDES "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
-file(GLOB PROJECT_SRC "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")
+set(PROJECT_INCLUDES_GLOBS ${PROJECT_INCLUDES_GLOBS} "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
+
+set(PROJECT_SRC_GLOBS ${PROJECT_SRC_GLOBS} "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")
+
+file(GLOB PROJECT_INCLUDES ${PROJECT_INCLUDES_GLOBS} )
+file(GLOB PROJECT_SRC ${PROJECT_SRC_GLOBS} )

 add_library (${PROJECT} ${PROJECT_SRC} ${PROJECT_INCLUDES})


cmake: removing discouraged flags MSVC10 & co. Using MSVC_VERSION instead

--- CXX11.cmake
+++ CXX11.cmake
@@ -22,7 +22,7 @@
 macro(check_for_cxx11_compiler _VAR)
     message(STATUS "Checking for C++11 compiler")
     set(${_VAR})
-    if((MSVC AND (MSVC10 OR MSVC11 OR MSVC12 OR MSVC14)) OR
+    if((MSVC AND NOT ( MSVC_VERSION LESS 1600)) OR
        (CMAKE_COMPILER_IS_GNUCXX AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8.1) OR
        (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.1))
         set(${_VAR} 1)


minor fix

minor fix

--- SM/SM.cmake
+++ SM/SM.cmake
@@ -23,14 +23,14 @@
 	set(SEARCH_METHODS_NT ${SEARCH_METHODS_NT} GridTrackerFlow RKLT)
 	set(SEARCH_PARAMS ${SEARCH_PARAMS} GridTrackerFlow RKLT)
 endif(WITH_GRID_TRACKERS)
-if(WITH_FEAT)
+if(WITH_FEAT)
+	message(STATUS "OpenCV_VERSION: ${OpenCV_VERSION}")
 	if(NOT "${OpenCV_VERSION}" STREQUAL "3")̀
 	# message(STATUS "OpenCV_LIBRARIES: ${OpenCV_LIBRARIES}")
 		findSubPart("${OpenCV_LIBRARIES}" "opencv_nonfree" CV_NONFREE_FOUND)
 	else()
 		findSubPart("${OpenCV_LIBRARIES}" "opencv_xfeatures2d" CV_NONFREE_FOUND)
-	endif()
-	message(STATUS "OpenCV_VERSION: ${OpenCV_VERSION}")
+	endif()
 	if(CV_NONFREE_FOUND)
 		message(STATUS "Feature based grid tracker is enabled")
 		set(COMPOSITE_SEARCH_METHODS ${COMPOSITE_SEARCH_METHODS} FeatureTracker)


rust.cmake: fix RELEASE handling

rust.cmake: fix RELEASE handling

Cmake's list operator operates on the current scope so we were not
setting --release on the cargo cmd line.

Change-Id: I91aa8489869c3190d60c3f2dee374b3d9388ebda
GitOrigin-RevId: 36fa241862c1cb94b736be89d09e8127fefdfc4d

--- apps/system/rust.cmake
+++ apps/system/rust.cmake
@@ -15,10 +15,6 @@
   -Z unstable-options
   -Z avoid-dev-deps
   CACHE INTERNAL "cargo cmd line arguments")
-
-if("${RELEASE}")
-    list(APPEND CARGO_OPTIONS "--release")
-endif()

 # add_library but for rust libraries. Invokes cargo in the SOURCE_DIR that is provided,
 # all build output is placed in BUILD_DIR or CMAKE_CURRENT_BINARY_DIR if BUILD_DIR isn't provided.
@@ -46,6 +42,10 @@
         set(RUST_TARGET "riscv32imac-unknown-none-elf")
     endif()

+    if("${RELEASE}")
+        set(CARGO_RELEASE "--release")
+    endif()
+
     add_custom_target(
         ${lib_name}_custom
         BYPRODUCTS
@@ -57,7 +57,7 @@
             ${CMAKE_COMMAND} -E env RUSTFLAGS=${RUSTFLAGS}
             cargo +nightly-2021-08-05 build
             --target ${RUST_TARGET}
-            ${CARGO_OPTIONS}
+            ${CARGO_OPTIONS} ${CARGO_RELEASE}
             --target-dir ${RUST_BUILD_DIR}
             --out-dir ${RUST_BUILD_DIR}
     )


Ask for separate debug and release libraries only on windows systems.

--- src/unit_VEHICLE/cmake/FindChronoVehicle.cmake
+++ src/unit_VEHICLE/cmake/FindChronoVehicle.cmake
@@ -22,10 +22,16 @@

-SET (CH_VEHICLE_SDKDIR         "" CACHE PATH "Where is your ChronoVehicle SDK source installed")
-SET (CH_VEHICLE_LIBDIR_DEBUG   "" CACHE PATH "Where are your ChronoVehicle DEBUG libraries (ChronoVehicle.lib) installed?")
-SET (CH_VEHICLE_LIBDIR_RELEASE "" CACHE PATH "Where are your ChronoVehicle RELEASE libraries (ChronoVehicle.lib) installed?")
+SET (CH_VEHICLE_SDKDIR "" CACHE PATH "Where is your ChronoVehicle SDK source installed")

+IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+	SET (CH_VEHICLE_LIBDIR_DEBUG   "" CACHE PATH "Where is the ChronoVehicle DEBUG library (ChronoVehicle.lib) installed?")
+	SET (CH_VEHICLE_LIBDIR_RELEASE "" CACHE PATH "Where is the ChronoVehicle RELEASE library (ChronoVehicle.lib) installed?")
+ELSE()
+	SET (CH_VEHICLE_LIBDIR "" CACHE PATH "Where is the ChronoVehicle library (ChronoVehicle.lib) installed?")
+	SET(CH_VEHICLE_LIBDIR_DEBUG ${CH_VEHICLE_LIBDIR})
+	SET(CH_VEHICLE_LIBDIR_RELEASE ${CH_VEHICLE_LIBDIR})
+ENDIF()

 # ================================================================================
 # Generic definitions that can be useful later


warn on missing return type and compare on different signed types

--- toolchains/darwin.cmake
+++ toolchains/darwin.cmake
@@ -4,7 +4,8 @@
 check_unsupported_compiler_version()

 # options
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -stdlib=libc++ -std=c++1y")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -std=c++1y")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wreturn-type -Wsign-compare")
 set(CXX_FLAGS_DEBUG "-g -O0")


ENH: Update MGHIO to be shared lib

ENH: Update MGHIO to be shared lib

This makes MGHIO consistent with Slicer environment
and the rest of the image IO mechanism.

This patch was tested within the Slicer environment.

--- Modules/Remote/MGHIO.remote.cmake
+++ Modules/Remote/MGHIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(MGHIO
   "MGHIO ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
-  GIT_TAG 662e79fe283ed7ee85fb6d80dab3739fc75eb763
+  GIT_TAG dc1f16c73d497ca2d1d7e1c77096817f8a82eb21
   )


CMake: Fix Cortex-A9 flags for GCC_ARM toolchain

The -mcpu=cortex-a9 flag conflicts with the march=armv7-a flag.
Opted to keep mcpu=cortex-a9 as it is more specific and
allows GCC to perform better optimization.

The compiler is also changed to use soft-float ABI as it
was necessary to successfully build. Without it the application
appears to be built with soft-float ABI and it conflicts with
the previous setting which was built with hard-float ABI.
This may be related to: https://gitlab.kitware.com/cmake/cmake/-/issues/21173

--- tools/cmake/cores/Cortex-A9.cmake
+++ tools/cmake/cores/Cortex-A9.cmake
@@ -5,9 +5,8 @@
     list(APPEND common_options
         "-mthumb-interwork"
         "-marm"
-        "-march=armv7-a"
         "-mfpu=vfpv3"
-        "-mfloat-abi=hard"
+        "-mfloat-abi=softfp"
         "-mno-unaligned-access"
         "-mcpu=cortex-a9"
     )


fix registering resources with content

fix registering resources with content

--- ament_cmake_core/cmake/index/ament_index_register_resource.cmake
+++ ament_cmake_core/cmake/index/ament_index_register_resource.cmake
@@ -26,7 +26,7 @@
       "ament_index_register_resource() called without a 'resource_type'")
   endif()

-  cmake_parse_arguments(ARG "" "PACKAGE_NAME;CONTENT;CONTENT_FILE" "" ${ARGN})
+  cmake_parse_arguments(ARG "" "PACKAGE_NAME;CONTENT_FILE" "CONTENT" ${ARGN})
   if(ARG_UNPARSED_ARGUMENTS)
     message(FATAL_ERROR "ament_index_register_resource() called with unused "
       "arguments: ${ARG_UNPARSED_ARGUMENTS}")


Revert "CMAKE: Disable ctest_submit"

Revert "CMAKE: Disable ctest_submit"

This reverts commit 198ae21b6c9491035541a2ba6176079dc3cd105e.
Should fix issue #304 (Our CDash dashboard no longer displays Test results)

--- CTest.cmake
+++ CTest.cmake
@@ -58,7 +58,7 @@
 # Added ctest_update() to ensure that the commit SHA will be passed to CDash, and GitHub.
 ctest_update()
 ctest_test(RETURN_VALUE RES)
-# ctest_submit( PARTS Test Update )
+ctest_submit( PARTS Test Update )

 if (RES)
   message(FATAL_ERROR "Unit tests have return code != 0")


Fix typo in conan.cmake (#143)

Fix typo in conan.cmake (#143)

--- conan.cmake
+++ conan.cmake
@@ -509,7 +509,7 @@
         set(CONAN_INDEX_ARG "-i ${CONAN_INDEX}")
     endif()

-    message(STATUS "Conan: Adding ${CONAN_NAME} remote repositoy (${CONAN_URL})")
+    message(STATUS "Conan: Adding ${CONAN_NAME} remote repository (${CONAN_URL})")
     execute_process(COMMAND ${CONAN_CMD} remote add ${CONAN_NAME} ${CONAN_URL}
       ${CONAN_INDEX_ARG} -f)
 endmacro()


QtConcurrent is required for non GUI builds too

--- cMake/FreeCAD_Helpers/SetupQt.cmake
+++ cMake/FreeCAD_Helpers/SetupQt.cmake
@@ -64,13 +64,13 @@
     find_package(Qt5Network REQUIRED)
     find_package(Qt5Xml REQUIRED)
     find_package(Qt5XmlPatterns REQUIRED)
+    find_package(Qt5Concurrent REQUIRED)
     if(BUILD_GUI)
         find_package(Qt5Widgets REQUIRED)
         find_package(Qt5PrintSupport REQUIRED)
         find_package(Qt5OpenGL REQUIRED)
         find_package(Qt5Svg REQUIRED)
         find_package(Qt5UiTools REQUIRED)
-        find_package(Qt5Concurrent REQUIRED)
         if (BUILD_WEB)
             if (${FREECAD_USE_QTWEBMODULE} MATCHES "Qt Webkit")
                 find_package(Qt5WebKitWidgets REQUIRED)


Remove obsolete cmake file

Remove obsolete cmake file

--- cmake/GenerateConfigHeader.cmake
+++ cmake/GenerateConfigHeader.cmake
@@ -1,84 +0,0 @@
-# Generate autotools-like config header
-FIND_PACKAGE(Bonjour)
-FIND_PACKAGE(Cg)
-IF(NOT ${CMAKE_VERSION} VERSION_LESS 2.8)
-  FIND_PACKAGE(CUDA)
-ENDIF(NOT ${CMAKE_VERSION} VERSION_LESS 2.8)
-FIND_PACKAGE(GLEW REQUIRED)
-FIND_PACKAGE(GLUT)
-FIND_PACKAGE(NORM)
-FIND_PACKAGE(OpenGL REQUIRED)
-FIND_PACKAGE(Qt)
-FIND_PACKAGE(X11)
-FIND_PACKAGE(FFMPEG)
-FIND_PACKAGE(SNAPPY)
-FIND_PACKAGE(VolPack)
-
-IF(BONJOUR_FOUND)
-  SET(HAVE_BONJOUR 1)
-ENDIF(BONJOUR_FOUND)
-
-IF(CG_FOUND)
-  SET(HAVE_CG 1)
-  SET(HAVE_CG_CG_H 1)
-ENDIF(CG_FOUND)
-
-IF(CUDA_FOUND)
-  SET(HAVE_CUDA 1)
-  SET(HAVE_CUDA_H 1)
-ENDIF(CUDA_FOUND)
-
-IF(NORM_FOUND)
-  SET(HAVE_NORM 1)
-  SET(HAVE_NORM_H 1)
-ENDIF(NORM_FOUND)
-
-IF(OPENGL_FOUND)
-  SET(HAVE_GL 1)
-ENDIF(OPENGL_FOUND)
-
-IF(GLEW_FOUND)
-  SET(HAVE_GLEW 1)
-ENDIF(GLEW_FOUND)
-
-IF(OPENGL_GLU_FOUND)
-  SET(HAVE_GLU 1)
-ENDIF(OPENGL_GLU_FOUND)
-
-IF(QT_FOUND)
-  SET(HAVE_QT 1)
-ENDIF(QT_FOUND)
-
-IF(GLUT_FOUND)
-  SET(HAVE_GLUT 1)
-ENDIF(GLUT_FOUND)
-
-IF(X11_FOUND)
-  SET(HAVE_X11 1)
-  SET(HAVE_X11_X_H 1)
-ENDIF(X11_FOUND)
-
-IF(FFMPEG_FOUND)
-  SET(HAVE_FFMPEG 1)
-ENDIF(FFMPEG_FOUND)
-
-IF(SNAPPY_FOUND)
-  SET(HAVE_SNAPPY 1)
-ENDIF(SNAPPY_FOUND)
-
-IF(VOLPACK_FOUND)
-  SET(HAVE_VOLPACK 1)
-ENDIF(VOLPACK_FOUND)
-
-ADD_DEFINITIONS(-DHAVE_CONFIG_H)
-
-SET(VIRVO_CONFIG_DIR
-  ${CMAKE_CURRENT_BINARY_DIR}
-)
-
-SET(VIRVO_CONFIG_H
-  vvconfig.h
-)
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmakeconfig.h.in ${VIRVO_CONFIG_DIR}/${VIRVO_CONFIG_H})
-INCLUDE_DIRECTORIES(${VIRVO_CONFIG_DIR})


Work around grep 2.23 new behaviour

Work around grep 2.23 new behaviour

--- cmake/LXQtTranslateDesktop.cmake
+++ cmake/LXQtTranslateDesktop.cmake
@@ -71,13 +71,13 @@
         set(_pattern "'\\[.*]\\s*='")
         if (_translations)
             add_custom_command(OUTPUT ${_outFile}
-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
-                COMMAND grep -h ${_pattern} ${_translations} >> ${_outFile}
+                COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
+                COMMAND grep -h -a ${_pattern} ${_translations} >> ${_outFile}
                 COMMENT "Generating ${_fileName}${_fileExt}"
             )
         else()
             add_custom_command(OUTPUT ${_outFile}
-                COMMAND grep -v "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
+                COMMAND grep -v -a "'#TRANSLATIONS_DIR='" ${_inFile} > ${_outFile}
                 COMMENT "Generating ${_fileName}${_fileExt}"
             )
         endif()


modified

modified

--- cmake/Modules/FindCppUTest.cmake
+++ cmake/Modules/FindCppUTest.cmake
@@ -3,28 +3,56 @@
 # It defines:
 # CPPUTEST_FOUND               If the CPPUTest is found
 # CPPUTEST_INCLUDE_DIRS        PATH to the include directory
+# CPPUTEST_LIBRARY_DIRS        path to the libraries directories
 # CPPUTEST_LIBRARIES           libraries
 #
 # CPPUTEST_DIR is used for guessing the installed path.
 #

+message("-- Detecting CppUTest package")
+
 find_package(PkgConfig QUIET)
+pkg_check_modules(PC_CPPUTEST QUIET cpputest)

-pkg_check_modules(PC_CPPUTEST cpputest QUIET)
+set(CPPUTEST_FOUND 1)

-find_path(CPPUTEST_INCLUDE_DIR CppUTest/CppUTestConfig.h
-  HINTS ${PC_CPPUTEST_INCLUDEDIR} ${PC_CPPUTEST_INCLUDE_DIRS}
-  ${CPPUTEST_DIR}/include
-)
+# find include path
+find_path(CPPUTEST_INCLUDE_DIRS CppUTest/CppUTestConfig.h
+  HINTS ${CPPUTEST_DIR}/include ${PC_CPPUTEST_INCLUDE_DIRS})
+if(CPPUTEST_INCLUDE_DIRS MATCHES "^.*-NOTFOUND")
+  set(CPPUTEST_FOUND 0)
+endif()

-find_library(CPPUTEST_LIBRARY NAMES CppUTest libCppUTest
-  HINTS ${PC_CPPUTEST_LIBDIR} ${PC_CPPUTEST_LIBRARY_DIRS}
-  ${CPPUTEST_DIR}/lib ${CPPUTEST_DIR}/lib64
-)
+# find library path
+find_path(CPPUTEST_LIBRARY_DIRS libCppUTest.a
+  HINTS  ${CPPUTEST_DIR}/lib ${CPPUTEST_DIR}/lib64
+         ${PC_CPPUTEST_LIBRARY_DIRS})
+if(CPPUTEST_LIBRARY_DIRS MATCHES "^.*-NOTFOUND")
+  set(CPPUTEST_FOUND 0)
+endif()

+# find library
+find_library(CPPUTEST_LIB1 NAMES CppUTest PATHS ${CPPUTEST_LIBRARY_DIRS})
+if(CPPUTEST_LIB1 MATCHES "^.*-NOTFOUND")
+  set(CPPUTEST_FOUND 0)
+endif()
+
+find_library(CPPUTEST_LIB2 NAMES CppUTestExt PATHS ${CPPUTEST_LIBRARY_DIRS})
+if(CPPUTEST_LIB2 MATCHES "^.*-NOTFOUND")
+  set(CPPUTEST_FOUND 0)
+endif()
+
+if (CPPUTEST_FOUND)
+  set(CPPUTEST_LIBRARIES stdc++ CppUTest CPPUTestExt)
+endif()
+
+#
 include(FindPackageHandleStandardArgs)

 find_package_handle_standard_args(CppUTest DEFAULT_MSG
-  CPPUTEST_LIBRARY CPPUTEST_INCLUDE_DIR)
+  CPPUTEST_INCLUDE_DIRS CPPUTEST_LIBRARY_DIRS CPPUTEST_LIBRARIES)

-mark_as_advanced(CPPUTEST_INCLUDE_DIR CPPUTEST_LIBRARY)
+mark_as_advanced(CPPUTEST_INCLUDE_DIRS
+  CPPUTEST_LIBRARY_DIRS CPPUTEST_LIBRARIES)
+
+message("-- Detecting CppUTest package - done")


Create tbag_flags__append cmake function.

--- cmake/Modules/TbagCxxFlags.cmake
+++ cmake/Modules/TbagCxxFlags.cmake
@@ -39,6 +39,16 @@
     # update result.
     set (${__result} ${${__result}} PARENT_SCOPE)
 endfunction ()
+
+#/// Append flags.
+#///
+#/// @param __value [in] Append value name.
+#/// @param ...     [in] List of flags.
+macro (tbag_flags__append __value)
+    foreach (__flag_cursor ${ARGN})
+        set (${__value} "${${__value}} ${__flag_cursor}")
+    endforeach ()
+endmacro ()

 #/// Assign Position Independent Code.
 macro (tbag_cxx_flags__set_position_independent_code)


Fix quotation mark bug in cmake file

Fix quotation mark bug in cmake file

--- cmake/MunkeiVersionFromGit.cmake
+++ cmake/MunkeiVersionFromGit.cmake
@@ -60,7 +60,7 @@

   # Git describe
   execute_process(
-    COMMAND           "${GIT_EXECUTABLE}" describe --match 'v[0-9]*.[0-9]*.[0-9]*' --tags
+    COMMAND           "${GIT_EXECUTABLE}" describe --match "v[0-9]*.[0-9]*.[0-9]*" --tags
     WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
     RESULT_VARIABLE   git_result
     OUTPUT_VARIABLE   git_describe
@@ -76,7 +76,7 @@

   # Get Git tag
   execute_process(
-    COMMAND           "${GIT_EXECUTABLE}" describe --match 'v[0-9]*.[0-9]*.[0-9]*' --tags --abbrev=0
+    COMMAND           "${GIT_EXECUTABLE}" describe --match "v[0-9]*.[0-9]*.[0-9]*" --tags --abbrev=0
     WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
     RESULT_VARIABLE   git_result
     OUTPUT_VARIABLE   git_tag


Force SYSTEM keyword in ament_target_dependencies() at the start. (#303)

Signed-off-by: Michel Hidalgo <2c7f9fd20fbeb41ce8894ec4653d66fa7f3b6e1a@ekumenlabs.com>

--- ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake
+++ ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake
@@ -27,13 +27,12 @@
 #
 # :param target: the target name
 # :type target: string
-# :param ARGN: a list of package names, which can optionally start with an
-#   INTERFACE or PUBLIC keyword.
-#   If it starts with INTERFACE or PUBLIC, this keyword is used in the
-#   target_* calls.
-#   SYSTEM keyword.
-#   If the SYSTEM keyword is specified, it will be added to the
-#   target_include_directories calls.
+# :param ARGN: a list of package names, which can optionally start
+#   with a SYSTEM keyword, followed by an INTERFACE or PUBLIC keyword.
+#   If it starts with a SYSTEM keyword, it will be used in
+#   target_include_directories() calls.
+#   If it starts (or follows) with an INTERFACE or PUBLIC keyword,
+#   this keyword will be used in the target_*() calls.
 # :type ARGN: list of strings
 #
 # @public
@@ -44,24 +43,29 @@
   endif()
   if(${ARGC} GREATER 0)
     cmake_parse_arguments(ARG "INTERFACE;PUBLIC;SYSTEM" "" "" ${ARGN})
+    set(ARGVIND 1)
+    set(system_keyword "")
     set(optional_keyword "")
     set(required_keyword "PUBLIC")
+    if(ARG_SYSTEM)
+      if(NOT "${ARGV${ARGVIND}}" STREQUAL "SYSTEM")
+        message(FATAL_ERROR "ament_target_dependencies() SYSTEM keyword is only allowed before the package names and other keywords")
+      endif()
+      set(system_keyword SYSTEM)
+      math(EXPR ARGVIND "${ARGVIND} + 1")
+    endif()
     if(ARG_INTERFACE)
-      if(NOT "${ARGV1}" STREQUAL "INTERFACE")
+      if(NOT "${ARGV${ARGVIND}}" STREQUAL "INTERFACE")
         message(FATAL_ERROR "ament_target_dependencies() INTERFACE keyword is only allowed before the package names")
       endif()
       set(optional_keyword INTERFACE)
       set(required_keyword INTERFACE)
     endif()
     if(ARG_PUBLIC)
-      if(NOT "${ARGV1}" STREQUAL "PUBLIC")
+      if(NOT "${ARGV${ARGVIND}}" STREQUAL "PUBLIC")
         message(FATAL_ERROR "ament_target_dependencies() PUBLIC keyword is only allowed before the package names")
       endif()
       set(optional_keyword PUBLIC)
-    endif()
-    set(system_keyword "")
-    if(ARG_SYSTEM)
-      set(system_keyword SYSTEM)
     endif()
     set(definitions "")
     set(include_dirs "")


interface targets don't support compile definitions and LINK_FLAGS (#247)

Signed-off-by: Dirk Thomas <19795c8185177e940eedd30ceb2b716a54a3d5dc@users.noreply.github.com>

--- ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake
+++ ament_cmake_target_dependencies/cmake/ament_target_dependencies.cmake
@@ -88,18 +88,22 @@
         list_append_unique(link_flags ${${package_name}_LINK_FLAGS})
       endif()
     endforeach()
-    target_compile_definitions(${target}
-      ${required_keyword} ${definitions})
+    if(NOT ARG_INTERFACE)
+      target_compile_definitions(${target}
+        ${required_keyword} ${definitions})
+    endif()
     ament_include_directories_order(ordered_include_dirs ${include_dirs})
     target_link_libraries(${target}
       ${optional_keyword} ${interfaces})
     target_include_directories(${target}
       ${required_keyword} ${ordered_include_dirs})
-    ament_libraries_deduplicate(unique_libraries ${libraries})
-    target_link_libraries(${target}
-      ${optional_keyword} ${unique_libraries})
-    foreach(link_flag IN LISTS link_flags)
-      set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${link_flag} ")
-    endforeach()
+    if(NOT ARG_INTERFACE)
+      ament_libraries_deduplicate(unique_libraries ${libraries})
+      target_link_libraries(${target}
+        ${optional_keyword} ${unique_libraries})
+      foreach(link_flag IN LISTS link_flags)
+        set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " ${link_flag} ")
+      endforeach()
+    endif()
   endif()
 endfunction()


update to 0.17.0-dev

update to 0.17.0-dev

--- conan.cmake
+++ conan.cmake
@@ -33,7 +33,7 @@
 # but it is only necessary on the end-user side. It is not necessary to create conan
 # packages, in fact it shouldn't be use for that. Check the project documentation.

-# version: 0.16.0
+# version: 0.17.0-dev

 include(CMakeParseArguments)


Fix dependencies for custom header parser/generator

--- scripts/header_gen.cmake
+++ scripts/header_gen.cmake
@@ -31,15 +31,19 @@
 function(generate_http_header_parser_generator INFILE)
     add_custom_command(
         OUTPUT header_names_parser.cpp
-        DEPENDS filtered_headers ${GEN_HEADER_PARSER}
+        DEPENDS filtered_headers ${GEN_HEADER_PARSER} ${INFILE}
         COMMENT "Generate HTTP header names parser"
         COMMAND cat ${INFILE} | ${GEN_HEADER_PARSER} > header_names_parser.cpp
     )

     add_custom_command(
         OUTPUT header_names_generator.cpp
-        DEPENDS filtered_headers ${GEN_HEADER_GENERATOR}
+        DEPENDS filtered_headers ${GEN_HEADER_GENERATOR} ${INFILE}
         COMMENT "Generate HTTP header names generator"
         COMMAND cat ${INFILE} | ${GEN_HEADER_GENERATOR} > header_names_generator.cpp
     )
+    add_custom_target(
+        http_header_parser_generator
+        DEPENDS filtered_headers header_names_parser.cpp header_names_generator.cpp
+    )
 endfunction()


Update ExternalProjectDependency based on commontk/Artichoke@0fff214

$ git shortlog 5ee3d50..0fff214 --no-merges
Jean-Christophe Fillion-Robin (1):
      ExternalProjectDependency: Improve check for USES_TERMINAL support

--- CMake/ctkMacroCheckExternalProjectDependency.cmake
+++ CMake/ctkMacroCheckExternalProjectDependency.cmake
@@ -350,7 +350,7 @@
     list(APPEND _ep_arguments CMAKE_GENERATOR_PLATFORM ${_sb_CMAKE_GENERATOR_PLATFORM})
   endif()
   list(APPEND _ep_arguments CMAKE_GENERATOR_TOOLSET ${_sb_CMAKE_GENERATOR_TOOLSET})
-  if(CMAKE_VERSION VERSION_GREATER "3.3")
+  if(CMAKE_VERSION VERSION_EQUAL "3.4" OR CMAKE_VERSION VERSION_GREATER "3.4")
     # USES_TERMINAL_* options were introduced in CMake 3.4
     foreach(step IN ITEMS DOWNLOAD UPDATE CONFIGURE BUILD TEST INSTALL)
       list(APPEND _ep_arguments


build: when using GCC, link to libgcc

build: when using GCC, link to libgcc

--- build/cmake/arch.cmake
+++ build/cmake/arch.cmake
@@ -8,6 +8,9 @@
   )

   add_executable(kernel ${ARCH_SRC} ${KERNEL_COMMON_SRC})
+  if(NOT CLANG)
+    target_link_libraries(kernel gcc)
+  endif()
   target_link_libraries(kernel lox-kernel)
   set_target_properties(kernel PROPERTIES OUTPUT_NAME "kernel.elf")
 endfunction()


Fix FindLIBSSH2.cmake

Fix FindLIBSSH2.cmake

--- modules/FindLIBSSH2.cmake
+++ modules/FindLIBSSH2.cmake
@@ -22,7 +22,7 @@
     set (CMAKE_FIND_FRAMEWORK NEVER)

     find_library(LIBSSH2_LIBRARIES
-        NAMES libssh2
+        NAMES ssh2
         HINTS ${LIBSSH2_LOCATION}
         ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib
         ${CMAKE_INSTALL_PREFIX}/Grid/epel/*/${PLATFORM}/lib64


cmake: Allow thread checks to fail and fall back to nothreads

Closes: #2155

git-svn-id: 3ec853389310512053d525963cab269c063bb453@1843653 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/XercesMutexMgrSelection.cmake
+++ cmake/XercesMutexMgrSelection.cmake
@@ -19,11 +19,15 @@

 # mutexmgr selection

-option(threads "Threading support" ON)
+set(xerces_thread_default ON)
+find_package(Threads)
+if(NOT TARGET Threads::Threads)
+  set(xerces_thread_default ON)
+endif()
+
+option(threads "Threading support" ${xerces_thread_default})

 include(CheckCXXSourceCompiles)
-
-find_package(Threads REQUIRED)

 function(thread_test outvar)
   set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})


Add tag to download project name

Add tag to download project name

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -92,6 +92,8 @@
     )
   endif()

+  set(HUNTER_PACKAGE_NAME "${HUNTER_PACKAGE_NAME}_${HUNTER_INSTALL_TAG}")
+
   hunter_status_debug("Add package: ${HUNTER_PACKAGE_NAME}")
   hunter_status_debug("Url: ${HUNTER_PACKAGE_URL}")
   hunter_status_debug("SHA1: ${HUNTER_PACKAGE_SHA1}")


Allow relative path to toolchain file

Allow relative path to toolchain file

Path to not existing toolchain file now causes a fatal error
Removing unnecessary includes

Change-Id: I69e38ec2e2d3ed899af7dd80f75be9c73d657ceb

--- cmake/acme.cmake
+++ cmake/acme.cmake
@@ -29,11 +29,14 @@
 # that all variables are set as early as possible.
 #--------------------------------------------------------------------------
 IF (NOT "${CMAKE_TOOLCHAIN_FILE}" STREQUAL "" )
+	IF(NOT IS_ABSOLUTE "${CMAKE_TOOLCHAIN_FILE}")
+		SET(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}")
+	ENDIF()
 	IF (EXISTS "${CMAKE_TOOLCHAIN_FILE}")
-		INCLUDE(${CMAKE_TOOLCHAIN_FILE})
-		MESSAGE(VERBOSE "Using toolchain file: " ${CMAKE_TOOLCHAIN_FILE})
+		INCLUDE("${CMAKE_TOOLCHAIN_FILE}")
+		MESSAGE(STATUS "Using toolchain file: " ${CMAKE_TOOLCHAIN_FILE})
 	ELSE()
-		MESSAGE(WARNING "toolchain file not found: " ${CMAKE_TOOLCHAIN_FILE})
+		MESSAGE(FATAL_ERROR "WARNING: toolchain file not found: " ${CMAKE_TOOLCHAIN_FILE})
 	ENDIF()
 ENDIF()

@@ -43,9 +46,6 @@

 INCLUDE(${ACME_PATH}/internal/config.cmake)
 INCLUDE(${ACME_PATH}/internal/functions.cmake)
-#INCLUDE(${ACME_PATH}/test/test.cmake)
-#INCLUDE(${ACME_PATH}/test/testcases.cmake)
-

 #--------------------------------------------------------------------------
 # Functions provided by ACME


[cmake] added proper superlu and eigen checks

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -211,6 +211,15 @@
 INCLUDE_SYS_DIR(${Boost_INCLUDE_DIRS})
 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

+find_package(SuperLU)
+if(SUPERLU_FOUND)
+  include_directories(${SUPERLU_INCLUDES})
+  link_directories(${SUPERLU_LIBRARY_DIRS})
+  pkg_check_modules(Eigen3, eigen3)
+  if(EIGEN3_FOUND)
+    include_directories(${EIGEN3_INCLUDE_DIR})
+  endif(EIGEN3_FOUND)
+endif(SUPERLU_FOUND)

 if(ENABLE_MPI)
 	find_package(MPI REQUIRED)


Upgrad default CMSIS path with latest STM32Cube version.

--- cmake/FindCMSIS.cmake
+++ cmake/FindCMSIS.cmake
@@ -20,7 +20,7 @@

 IF(STM32_FAMILY STREQUAL "F1")
     IF(NOT STM32Cube_DIR)
-        SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.1.0")
+        SET(STM32Cube_DIR "/opt/STM32Cube_FW_F1_V1.2.0")
         MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR})
     ENDIF()

@@ -29,7 +29,7 @@
     SET(CMSIS_DEVICE_SOURCES system_stm32f1xx.c)
 ELSEIF(STM32_FAMILY STREQUAL "F2")
     IF(NOT STM32Cube_DIR)
-        SET(STM32Cube_DIR "/opt/STM32Cube_FW_F2_V1.1.0")
+        SET(STM32Cube_DIR "/opt/STM32Cube_FW_F2_V1.1.1")
         MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR})
     ENDIF()

@@ -41,7 +41,7 @@
     SET(CMSIS_DEVICE_SOURCES system_stm32f2xx.c)
 ELSEIF(STM32_FAMILY STREQUAL "F4")
     IF(NOT STM32Cube_DIR)
-        SET(STM32Cube_DIR "/opt/STM32Cube_FW_F4_V1.6.0")
+        SET(STM32Cube_DIR "/opt/STM32Cube_FW_F4_V1.8.0")
         MESSAGE(STATUS "No STM32Cube_DIR specified, using default: " ${STM32Cube_DIR})
     ENDIF()


add doc comment about custom headers var to macro

--- cmake/UseCyclus.cmake
+++ cmake/UseCyclus.cmake
@@ -37,6 +37,10 @@
 #   lib_dir : the directory to install the module or agent into.
 #   test_driver : (optional) the custom test driver to use with unit tests,
 #                 or NONE
+#
+# The CYCLUS_CUSTOM_HEADERS variable can optionally be set to contain one or
+# more (space separated) header files before calling the USE_CYCLUS
+# macro to add shared headers used by the archetype library being built.
 #
 # The following vars are updated.
 #


Do not link directly on Mac OSX. Issue #8.

Instead, the symbols will be resolved from the python interpreter
when it loads the module.

Suggested-by: Justin Israel <04db19236134b92cb86f15992d62219972e70792@gmail.com>

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -242,7 +242,11 @@
   compile_pyx( ${_name} generated_file ${pyx_module_sources} )
   include_directories( ${PYTHON_INCLUDE_DIRS} )
   python_add_module( ${_name} ${generated_file} ${other_module_sources} )
-  target_link_libraries( ${_name} ${PYTHON_LIBRARIES} )
+  if( APPLE )
+    set_target_properties( ${_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup" )
+  else()
+    target_link_libraries( ${_name} ${PYTHON_LIBRARIES} )
+  endif()
 endfunction()

 include( CMakeParseArguments )


[cmake] don’t use pct on Xcode

[cmake] don’t use pct on Xcode

Xcode adds a lot of compiler flag on its own, so it’s hard to create a proper command line for building the pch by hand.

--- cmake/axl_utils.cmake
+++ cmake/axl_utils.cmake
@@ -839,7 +839,10 @@
 	)
 	if (MSVC AND MSVC_USE_PCH)
 		axl_set_pch_msvc (${_TARGET} ${_PCH_H} ${_PCH_CPP} ${ARGN})
-	elseif (GCC AND GCC_USE_PCH)
+	elseif (GCC AND GCC_USE_PCH AND NOT CMAKE_GENERATOR MATCHES "Xcode")
+		# Xcode adds a lot of compiler flags on its own, so it's hard to create
+		# a proper command line by hand
+
 		axl_set_pch_gcc (${_TARGET} ${_PCH_CPP} ${ARGN})
 	endif ()
 endmacro ()


Fixed error in test cmake scripts

Fixed error in test cmake scripts

--- cmake/dev/gtest.cmake
+++ cmake/dev/gtest.cmake
@@ -8,22 +8,22 @@
                 string(REGEX REPLACE ["\) \(,"] ";" GTEST_NAME ${GTEST_NAME})
                 list(GET GTEST_NAME 1 GTEST_GROUP_NAME)
                 list(GET GTEST_NAME 3 GTEST_NAME)
-                add_test(${GTEST_GROUP_NAME}.${GTEST_NAME}
-                    ${test}
+                add_test(NAME ${GTEST_GROUP_NAME}.${GTEST_NAME}
+                    COMMAND ${test}
                     --gtest_filter=${GTEST_GROUP_NAME}.${GTEST_NAME})
                 # Add environment
                 if(WIN32)
                     set_tests_properties(${GTEST_GROUP_NAME}.${GTEST_NAME} PROPERTIES ENVIRONMENT
-                        "PATH=${PROJECT_BINARY_DIR}/lib\\;$ENV{PATH}")
+                        "PATH=$<TARGET_FILE_DIR:${PROJECT_NAME}>\\;$ENV{PATH}")
                 endif()
             endforeach()
         endforeach()
     else()
-        add_test(${test} ${test})
+        add_test(NAME ${test} COMMAND ${test})
         # Add environment
         if(WIN32)
             set_tests_properties(${test} PROPERTIES ENVIRONMENT
-                "PATH=${PROJECT_BINARY_DIR}/lib\\;$ENV{PATH}")
+                "PATH=$<TARGET_FILE_DIR:${PROJECT_NAME}>\\;$ENV{PATH}")
         endif()
     endif()
 endmacro()


r9343/sofa : cmake: removed debug cmake messages + minimum version of cmake set to 2.8.8

Former-commit-id: 569d09706362d1ac249674e8ae2a78b4d5c82a42

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.8)

 # group files
 macro(GroupFiles fileGroup topGroup)
@@ -214,11 +214,11 @@
 			# retrieve its dependencies and intersect with the known ones (which may be currently disabled)
 			listIntersection(dependencies GLOBAL_PROJECT_DEPENDENCIES_${projectName} GLOBAL_DEPENDENCIES)

-			message(STATUS "${offset} + ${projectName}")
+                        #message(STATUS "${offset} + ${projectName}")
 			foreach(dependency ${dependencies})
 				ComputeDependencies(${dependency} true "${offset} ")
 			endforeach()
-			message(STATUS "${offset} - ${projectName}")
+                        #message(STATUS "${offset} - ${projectName}")

 			# retrieve include directories
 			list(APPEND includeDirs ${${projectName}_INCLUDE_DIR})
@@ -235,11 +235,6 @@
 			if(TARGET ${projectName})
 				#set_property(TARGET ${projectName} PROPERTY INCLUDE_DIRECTORIES ${${projectName}_INCLUDE_DIR})
 				set_target_properties(${projectName} PROPERTIES INCLUDE_DIRECTORIES "${${projectName}_INCLUDE_DIR}")
-				if(projectName STREQUAL "SofaVolumetricData")
-                                        get_target_property(dirs ${projectName} INCLUDE_DIRECTORIES)
-                                        message(STATUS "${projectName}_INCLUDE_DIR = ${${projectName}_INCLUDE_DIR}")
-                                        message(STATUS "INCLUDE_DIRECTORIES = ${dirs}")
-                                endif()
 			endif()
 		endif()
 	endif()


fixing a typo, my bad

fixing a typo, my bad

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@2809 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -69,7 +69,7 @@
     # add documentation
     if(BUILD_documentation)
         set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} doc")
-    if(BUILD_documentation)
+    endif(BUILD_documentation)
     # add PCLConfig
     set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} pclconfig")
     set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_PCLCONFIG_GROUP \"PCL\")\n")


set unit tests by default to be ON. The user can set them OFF if desired

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

--- cmake/pcl_tests.cmake
+++ cmake/pcl_tests.cmake
@@ -1,16 +1,17 @@
 # Test management

 # Need GTest to build the tests
-find_package(GTest)
-if(GTEST_FOUND)
-    set(REASON)
-    set(DEFAULT ON)
-else(GTEST_FOUND)
-    set(REASON "GTest was not found.")
-    set(DEFAULT OFF)
-endif(GTEST_FOUND)
+#find_package(GTest)
+#if(GTEST_FOUND)
+#    set(REASON)
+#    set(DEFAULT ON)
+#else(GTEST_FOUND)
+#    set(REASON "GTest was not found.")
+#    set(DEFAULT OFF)
+#endif(GTEST_FOUND)

 # Add an option so the user can turn tests off
+set(DEFAULT ON)
 option(BUILD_TESTS "Build the library tests" ${DEFAULT})

 # Print a suitable status message


CMake: we don't need to if() on old llvm versions

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -193,11 +193,10 @@
   "${LLVM_OBJ_ROOT}/tools/clang/include")

 # Llvm-config does not include clang libs
-set(CLANG_LIBNAMES clangFrontendTool clangFrontend clangDriver clangSerialization clangCodeGen clangParse clangSema)
-if(LLVM_MINOR GREATER 4)
-  list(APPEND CLANG_LIBNAMES clangRewrite)
-endif()
-list(APPEND CLANG_LIBNAMES clangRewriteFrontend clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers clangStaticAnalyzerCore clangAnalysis clangEdit clangAST clangLex clangBasic)
+set(CLANG_LIBNAMES clangFrontendTool clangFrontend clangDriver clangSerialization
+    clangCodeGen clangParse clangSema clangRewrite clangRewriteFrontend
+    clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers
+    clangStaticAnalyzerCore clangAnalysis clangEdit clangAST clangLex clangBasic)

 foreach(LIBNAME ${CLANG_LIBNAMES})
   find_library(C_LIBFILE_${LIBNAME} NAMES "${LIBNAME}" HINTS "${LLVM_LIBDIR}")


bump required ISPC to be 1.9.0+

bump required ISPC to be 1.9.0+

--- cmake/ispc.cmake
+++ cmake/ispc.cmake
@@ -15,13 +15,9 @@
 ## ======================================================================== ##

 # ISPC versions to look for, in decending order (newest first)
-IF(WIN32)
-  SET(ISPC_VERSION_WORKING "1.9.0" "1.8.2")
-ELSE()
-  SET(ISPC_VERSION_WORKING "1.9.0" "1.8.2" "1.8.1")
-ENDIF()
+SET(ISPC_VERSION_WORKING "1.9.1" "1.9.0")
 LIST(GET ISPC_VERSION_WORKING -1 ISPC_VERSION_REQUIRED)
-SET(ISPC_VERSION_RECOMMENDED_KNC "1.8.1")
+SET(ISPC_VERSION_RECOMMENDED_KNC "1.9.0")

 IF (NOT ISPC_EXECUTABLE)
   # try sibling folder as hint for path of ISPC


Fixed spelling error.

Fixed spelling error.

--- cmake/sfml.cmake
+++ cmake/sfml.cmake
@@ -6,6 +6,6 @@

 add_subdirectory("${SFML_ROOT_DIR}" "sfml")
 target_include_directories("sfml-graphics" PUBLIC "${SFML_SOURCE_DIR}/include")
-if(NOT BUILD_SHARED_LIBRARIES)
+if(NOT BUILD_SHARED_LIBS)
   add_definitions("-DSFML_STATIC")
 endif()


Fixing SQLite3 External project populating SQLITE3_LIBRARY

--- cmake/External_SQLite3.cmake
+++ cmake/External_SQLite3.cmake
@@ -58,4 +58,4 @@
     set(suffix ".a")
 endif()

-set(SQLITE3_LIBRARIES "${SQLITE3_LIBRARIES_DIR}/${prefix}sqlite3${suffix}" CACHE INTERNAL "")
+set(SQLITE3_LIBRARY "${SQLITE3_LIBRARIES_DIR}/${prefix}sqlite3${suffix}" CACHE INTERNAL "")


Enable linker dead stripping on Darwin (#22839)

* Enable linker dead stripping on Darwin

See r://48283130. This shaves 6MB+ off of swift and SourceKitService,
26.8MB off of swift-llvm-opt, 29.4MB off sil-passpipeline-dumper, etc.

* Disable dead stripping in Debug builds

It can hide linker errors caused by dependency cycles.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -485,6 +485,20 @@
     elseif(SWIFT_ENABLE_GOLD_LINKER AND
        "${SWIFT_SDK_${LFLAGS_SDK}_OBJECT_FORMAT}" STREQUAL "ELF")
       list(APPEND result "-fuse-ld=gold")
+    endif()
+  endif()
+
+  # Enable dead stripping. Portions of this logic were copied from llvm's
+  # `add_link_opts` function (which, perhaps, should have been used here in the
+  # first place, but at this point it's hard to say whether that's feasible).
+  #
+  # TODO: Evaluate/enable -f{function,data}-sections --gc-sections for bfd,
+  # gold, and lld.
+  if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
+    if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+      # See rdar://48283130: This gives 6MB+ size reductions for swift and
+      # SourceKitService, and much larger size reductions for sil-opt etc.
+      list(APPEND result "-Wl,-dead_strip")
     endif()
   endif()


Fixup omitting frame pointers on various compilers and architectures (#7626)

* Omit leaf frame pointers on i686 architectures

This is x86. See the root CMakeLists.txt file
```
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86")
set(SWIFT_HOST_VARIANT_ARCH_default "i686")
```

* Use the correct flags to omit leaf frame pointers with clang-cl and MSVC

* Don't omit leaf frame pointers on 64 bit architectures

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -181,9 +181,13 @@
   if(optimized OR CFLAGS_FORCE_BUILD_OPTIMIZED)
     list(APPEND result "-O2")

-    # Add -momit-leaf-frame-pointer on x86.
-    if("${CFLAGS_ARCH}" STREQUAL "i386" OR "${CFLAGS_ARCH}" STREQUAL "x86_64")
-      list(APPEND result "-momit-leaf-frame-pointer")
+    # Omit leaf frame pointers on x86.
+    if("${CFLAGS_ARCH}" STREQUAL "i386" OR "${CFLAGS_ARCH}" STREQUAL "i686")
+      if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+        list(APPEND result "-momit-leaf-frame-pointer")
+      else()
+        list(APPEND result "/Oy")
+      endif()
     endif()
   else()
     if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)


[Build System: CMake] Check that targets exist before adding them to the global exports.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -2092,6 +2092,9 @@
       # Add the arch-specific library targets to the global exports.
       foreach(arch ${SWIFT_SDK_${sdk}_ARCHITECTURES})
         set(_variant_name "${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
+        if(NOT TARGET "${_variant_name}")
+          continue()
+        endif()

         if(is_installing)
           set_property(GLOBAL APPEND
@@ -2104,13 +2107,12 @@

       # Add the swiftmodule-only targets to the lipo target depdencies.
       foreach(arch ${SWIFT_SDK_${sdk}_MODULE_ARCHITECTURES})
-        set(_variant_name
-          "${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
-
-        if(TARGET "${_variant_name}")
-          add_dependencies("${lipo_target}"
-            "${_variant_name}")
+        set(_variant_name "${name}-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch}")
+        if(NOT TARGET "${_variant_name}")
+          continue()
         endif()
+
+        add_dependencies("${lipo_target}" "${_variant_name}")
       endforeach()

       # If we built static variants of the library, create a lipo target for


Consistently use list(APPEND for adding linker arguments

The Xlinker flags were getting globbed into a single string since
we started adding current/compatibility version arguments to the
linker.

rdar://problem/24622276

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -786,15 +786,15 @@
   # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
   if(SWIFT_EMBED_BITCODE_SECTION AND NOT SWIFTLIB_DONT_EMBED_BITCODE)
     if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "IOS" OR "${SWIFTLIB_SINGLE_SDK}" STREQUAL "TVOS" OR "${SWIFTLIB_SINGLE_SDK}" STREQUAL "WATCHOS")
-      set(SWIFTLIB_SINGLE_C_COMPILE_FLAGS "${SWIFTLIB_SINGLE_C_COMPILE_FLAGS}" "-fembed-bitcode")
-      set(SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS "${SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS}" "-embed-bitcode")
-      set(SWIFTLIB_SINGLE_LINK_FLAGS "${SWIFTLIB_SINGLE_LINK_FLAGS}" "-Xlinker -bitcode_bundle -Xlinker -bitcode_hide_symbols -Xlinker -lto_library -Xlinker ${LLVM_LIBRARY_DIR}/libLTO.dylib")
+      list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS "-fembed-bitcode")
+      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS "-embed-bitcode")
+      list(APPEND SWIFTLIB_SINGLE_LINK_FLAGS "-Xlinker" "-bitcode_bundle" "-Xlinker" "-bitcode_hide_symbols" "-Xlinker" "-lto_library" "-Xlinker" "${LLVM_LIBRARY_DIR}/libLTO.dylib")
     endif()
   endif()

   if (SWIFT_COMPILER_VERSION)
     if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
-      set(SWIFTLIB_SINGLE_LINK_FLAGS "${SWIFTLIB_SINGLE_LINK_FLAGS}" "-Xlinker" "-current_version" "-Xlinker" "${SWIFT_COMPILER_VERSION}" "-Xlinker" "-compatibility_version" "-Xlinker" "1")
+      list(APPEND SWIFTLIB_SINGLE_LINK_FLAGS "-Xlinker" "-current_version" "-Xlinker" "${SWIFT_COMPILER_VERSION}" "-Xlinker" "-compatibility_version" "-Xlinker" "1")
     endif()
   endif()


unittest: Only add main.c if it exists

unittest: Only add main.c if it exists

Downstream it's easier to write tests that use target_sources after
including the unittest package instead of specifying a list of sources
before. But if we do that, currently, main.c is added and the build
breaks because it doesn't exist.

Signed-off-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@google.com>

--- cmake/modules/unittest.cmake
+++ cmake/modules/unittest.cmake
@@ -33,7 +33,7 @@
   set(ZEPHYR_BASE ${ENV_ZEPHYR_BASE} CACHE PATH "Zephyr base")
 endif()

-if(NOT SOURCES)
+if(NOT SOURCES AND EXISTS main.c)
   set(SOURCES main.c)
 endif()


Fixed finding of version.h.

Fixed finding of version.h.

--- cmake_modules/FindGeos.cmake
+++ cmake_modules/FindGeos.cmake
@@ -50,40 +50,40 @@
 SET(GEOS_INCLUDE_DIRS)
 IF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)

-	FIND_FILE(GEOS_VERSION_H version.h PATHS ${GEOS_INCLUDE_DIR} NO_DEFAULT_PATH)
-	IF(GEOS_VERSION_H AND EXISTS ${GEOS_VERSION_H})
-	  FILE(READ ${GEOS_VERSION_H} GEOS_VERSION_CONTENT)
+  FIND_FILE(GEOS_VERSION_H version.h
+    PATHS "${GEOS_INCLUDE_DIR}" "${GEOS_INCLUDE_DIR}/geos" NO_DEFAULT_PATH)
+  IF(GEOS_VERSION_H AND EXISTS ${GEOS_VERSION_H})
+    FILE(READ ${GEOS_VERSION_H} GEOS_VERSION_CONTENT)

-		STRING(REGEX MATCH "#define GEOS_VERSION_MAJOR [0-9]+" GEOVERMAJ
-			${GEOS_VERSION_CONTENT})
-		STRING(REGEX MATCH "#define GEOS_VERSION_MINOR [0-9]+" GEOVERMIN
-			${GEOS_VERSION_CONTENT})
-		STRING(REGEX MATCH "#define GEOS_VERSION_PATCH [0-9]+" GEOVERREV
-			${GEOS_VERSION_CONTENT})
-
-		STRING(REGEX REPLACE "#define GEOS_VERSION_MAJOR " ""
-			GEOVERMAJ ${GEOVERMAJ})
-		STRING(REGEX REPLACE "#define GEOS_VERSION_MINOR " ""
-			GEOVERMIN ${GEOVERMIN})
-		STRING(REGEX REPLACE "#define GEOS_VERSION_PATCH " ""
-			GEOVERREV ${GEOVERREV})
-
-		MESSAGE(STATUS "Found GEOS library ${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV} -- " ${GEOS_LIBRARY})
-		MESSAGE(STATUS "Found GEOS include path -- " ${GEOS_INCLUDE_DIR})
-
-		COMPARE_VERSION_STRINGS("${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV}" "3.2.2" GEOVERSIONCOMP)
-	  IF(${GEOVERSIONCOMP} LESS 0)
-
-			MESSAGE(STATUS "GEOS library ${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV} is too old. Version 3.2.2 or better 3.3.0 or up is needed. Building Geo module is now disabled.")
+    STRING(REGEX MATCH "#define GEOS_VERSION_MAJOR [0-9]+" GEOVERMAJ
+      ${GEOS_VERSION_CONTENT})
+    STRING(REGEX MATCH "#define GEOS_VERSION_MINOR [0-9]+" GEOVERMIN
+      ${GEOS_VERSION_CONTENT})
+    STRING(REGEX MATCH "#define GEOS_VERSION_PATCH [0-9]+" GEOVERREV
+      ${GEOS_VERSION_CONTENT})
+
+    STRING(REGEX REPLACE "#define GEOS_VERSION_MAJOR " ""
+      GEOVERMAJ ${GEOVERMAJ})
+    STRING(REGEX REPLACE "#define GEOS_VERSION_MINOR " ""
+      GEOVERMIN ${GEOVERMIN})
+    STRING(REGEX REPLACE "#define GEOS_VERSION_PATCH " ""
+      GEOVERREV ${GEOVERREV})
+
+    MESSAGE(STATUS "Found GEOS library ${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV} -- " ${GEOS_LIBRARY})
+    MESSAGE(STATUS "Found GEOS include path -- " ${GEOS_INCLUDE_DIR})
+
+    COMPARE_VERSION_STRINGS("${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV}" "3.2.2" GEOVERSIONCOMP)
+    IF(${GEOVERSIONCOMP} LESS 0)
+
+      MESSAGE(STATUS "GEOS library ${GEOVERMAJ}.${GEOVERMIN}.${GEOVERREV} is too old. Version 3.2.2 or better 3.3.0 or up is needed. Building Geo module is now disabled.")
       SET(GEOS_INCLUDE_DIR)
       SET(GEOS_LIBRARY)
-	  ELSE(${GEOVERSIONCOMP} LESS 0)
-
-			SET(GEOS_FOUND 1)
-			SET(GEOS_LIBRARIES ${GEOS_LIBRARY})
-			SET(GEOS_INCLUDE_DIRS ${GEOS_INCLUDE_DIR})
-	  ENDIF(${GEOVERSIONCOMP} LESS 0)
-	ENDIF(GEOS_VERSION_H AND EXISTS ${GEOS_VERSION_H})
-
-ELSE (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)
+    ELSE(${GEOVERSIONCOMP} LESS 0)
+
+      SET(GEOS_FOUND 1)
+      SET(GEOS_LIBRARIES ${GEOS_LIBRARY})
+      SET(GEOS_INCLUDE_DIRS ${GEOS_INCLUDE_DIR})
+    ENDIF(${GEOVERSIONCOMP} LESS 0)
+  ENDIF(GEOS_VERSION_H AND EXISTS ${GEOS_VERSION_H})
+
 ENDIF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)


fptu-cmake: fix message for case when no git's tags available.

--- cmake.fptu/utils.cmake
+++ cmake.fptu/utils.cmake
@@ -52,7 +52,7 @@
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       RESULT_VARIABLE rc)
     if(rc OR "${name}_GIT_DESCRIBE" STREQUAL "")
-      message(FATAL_ERROR "Please install latest version of git ('describe --tags --long --dirty' failed)")
+      message(FATAL_ERROR "Please fetch tags and/or install latest version of git ('describe --tags --long --dirty' failed)")
     endif()

     execute_process(COMMAND ${GIT} show --no-patch --format=%cI HEAD


Disable warning C4350 when using SOFA-MISC_NO_EXCEPTIONS on Windows due to Microsoft STL doing try catch even if we deactivate exception handling

Former-commit-id: 16b42918907347918f5f9425398db03d1679ee94

--- cmake/buildFlags.cmake
+++ cmake/buildFlags.cmake
@@ -99,6 +99,8 @@

 	if(MSVC)
 	STRING(REPLACE "/EHsc" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+	# due to default microsoft STL using always a try catch block, we have to deactivate the warning C4530
+	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4530")
 	endif()

 	if(XBOX)


CMake better cache variable properties options for sanitizers

Makes it easier for CMake GUI interfaces to know this is a variable that
takes in different strings instead of a boolean.

--- cmake/sanitizers.cmake
+++ cmake/sanitizers.cmake
@@ -76,7 +76,8 @@
 macro(process_sanitizer prefix)

   # Add options for the project to use sanitizers
-  option(${prefix}_USE_SANITIZER "Enable building with sanitizer support. Options are: Address, HWAddress, Memory, MemoryWithOrigins, Undefined, Thread, DataFlow, Leak, 'Address,Undefined'" false)
+  set(${prefix}_USE_SANITIZER "false" CACHE STRING "Enable building with sanitizer support.")
+  set_property(CACHE ${prefix}_USE_SANITIZER PROPERTY STRINGS Address HWAddress Memory MemoryWithOrigins Undefined Thread DataFlow Leak "Address,Undefined")
   if (UNIX)
     option(${prefix}_OPTIMIZE_SANITIZED_BUILDS "Optimize builds that use sanitization" false)
     option(${prefix}_BLACKLIST_FILE "Path to blacklist file for sanitizers" "")