[Build] Added support for RMOL and AirInv in the CMake framework.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -120,7 +120,11 @@
   if (NOT EXISTS ${DOC_INSTALL_FILE})
     unset (DOC_INSTALL_FILE)
   endif (NOT EXISTS ${DOC_INSTALL_FILE})
-  set (BASICDOC_FILES AUTHORS NEWS README ${DOC_INSTALL_FILE})
+  set (DOC_NEWS_FILE NEWS)
+  if (NOT EXISTS ${DOC_NEWS_FILE})
+    unset (DOC_NEWS_FILE)
+  endif (NOT EXISTS ${DOC_NEWS_FILE})
+  set (BASICDOC_FILES AUTHORS ${DOC_NEWS_FILE} README ${DOC_INSTALL_FILE})
   set (BASICDOC_PATH "share/doc/${PACKAGE}-${PACKAGE_VERSION}")

 endmacro (set_project_options)
@@ -291,9 +295,49 @@
       get_stdair (${_arg_version})
     endif (${_arg_lower} STREQUAL "stdair")

+    if (${_arg_lower} STREQUAL "sevmgr")
+      get_sevmgr (${_arg_version})
+    endif (${_arg_lower} STREQUAL "sevmgr")
+
+    if (${_arg_lower} STREQUAL "trademgen")
+      get_trademgen (${_arg_version})
+    endif (${_arg_lower} STREQUAL "trademgen")
+
+    if (${_arg_lower} STREQUAL "travelccm")
+      get_travelccm (${_arg_version})
+    endif (${_arg_lower} STREQUAL "travelccm")
+
+    if (${_arg_lower} STREQUAL "airsched")
+      get_airsched (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airsched")
+
     if (${_arg_lower} STREQUAL "airrac")
       get_airrac (${_arg_version})
     endif (${_arg_lower} STREQUAL "airrac")
+
+    if (${_arg_lower} STREQUAL "rmol")
+      get_rmol (${_arg_version})
+    endif (${_arg_lower} STREQUAL "rmol")
+
+    if (${_arg_lower} STREQUAL "airinv")
+      get_airinv (${_arg_version})
+    endif (${_arg_lower} STREQUAL "airinv")
+
+    if (${_arg_lower} STREQUAL "avlcal")
+      get_avlcal (${_arg_version})
+    endif (${_arg_lower} STREQUAL "avlcal")
+
+    if (${_arg_lower} STREQUAL "simfqt")
+      get_simfqt (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simfqt")
+
+    if (${_arg_lower} STREQUAL "simlfs")
+      get_simlfs (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simlfs")
+
+    if (${_arg_lower} STREQUAL "simcrs")
+      get_simcrs (${_arg_version})
+    endif (${_arg_lower} STREQUAL "simcrs")

     if (${_arg_lower} STREQUAL "doxygen")
       get_doxygen (${_arg_version})
@@ -577,6 +621,70 @@
   endif (AirRAC_FOUND)

 endmacro (get_airrac)
+
+# ~~~~~~~~~~ RMOL ~~~~~~~~~
+macro (get_rmol)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires RMOL-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires RMOL without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (RMOL ${_required_version} REQUIRED
+	HINTS ${WITH_RMOL_PREFIX})
+  if (RMOL_FOUND)
+    #
+    message (STATUS "Found RMOL version: ${RMOL_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${RMOL_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${RMOL_LIBRARIES})
+
+  else (RMOL_FOUND)
+    set (ERROR_MSG "The RMOL library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_RMOL_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<RMOL install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (RMOL_FOUND)
+
+endmacro (get_rmol)
+
+# ~~~~~~~~~~ Airinv ~~~~~~~~~
+macro (get_airinv)
+  unset (_required_version)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Airinv-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Airinv without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  find_package (Airinv ${_required_version} REQUIRED
+	HINTS ${WITH_AIRINV_PREFIX})
+  if (Airinv_FOUND)
+    #
+    message (STATUS "Found Airinv version: ${AIRINV_VERSION}")
+
+    # Update the list of include directories for the project
+    include_directories (${AIRINV_INCLUDE_DIRS})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${AIRINV_LIBRARIES})
+
+  else (Airinv_FOUND)
+    set (ERROR_MSG "The Airinv library cannot be found. If it is installed in")
+    set (ERROR_MSG "${ERROR_MSG} a in a non standard directory, just invoke")
+    set (ERROR_MSG "${ERROR_MSG} 'cmake' specifying the -DWITH_AIRINV_PREFIX=")
+    set (ERROR_MSG "${ERROR_MSG}<Airinv install path> variable.")
+    message (FATAL_ERROR "${ERROR_MSG}")
+  endif (Airinv_FOUND)
+
+endmacro (get_airinv)

 ##############################################
@@ -1572,6 +1680,34 @@
     message (STATUS "  - AIRRAC_INCLUDE_DIRS ........ : ${AIRRAC_INCLUDE_DIRS}")
   endif (AirRAC_FOUND)
 endmacro (display_airrac)
+
+# RMOL
+macro (display_rmol)
+  if (RMOL_FOUND)
+    message (STATUS)
+    message (STATUS "* RMOL:")
+    message (STATUS "  - RMOL_VERSION ............... : ${RMOL_VERSION}")
+    message (STATUS "  - RMOL_BINARY_DIRS ........... : ${RMOL_BINARY_DIRS}")
+    message (STATUS "  - RMOL_EXECUTABLES ........... : ${RMOL_EXECUTABLES}")
+    message (STATUS "  - RMOL_LIBRARY_DIRS .......... : ${RMOL_LIBRARY_DIRS}")
+    message (STATUS "  - RMOL_LIBRARIES ............. : ${RMOL_LIBRARIES}")
+    message (STATUS "  - RMOL_INCLUDE_DIRS .......... : ${RMOL_INCLUDE_DIRS}")
+  endif (RMOL_FOUND)
+endmacro (display_rmol)
+
+# Airinv
+macro (display_airinv)
+  if (Airinv_FOUND)
+    message (STATUS)
+    message (STATUS "* Airinv:")
+    message (STATUS "  - AIRINV_VERSION ............. : ${AIRINV_VERSION}")
+    message (STATUS "  - AIRINV_BINARY_DIRS ......... : ${AIRINV_BINARY_DIRS}")
+    message (STATUS "  - AIRINV_EXECUTABLES ......... : ${AIRINV_EXECUTABLES}")
+    message (STATUS "  - AIRINV_LIBRARY_DIRS ........ : ${AIRINV_LIBRARY_DIRS}")
+    message (STATUS "  - AIRINV_LIBRARIES ........... : ${AIRINV_LIBRARIES}")
+    message (STATUS "  - AIRINV_INCLUDE_DIRS ........ : ${AIRINV_INCLUDE_DIRS}")
+  endif (Airinv_FOUND)
+endmacro (display_airinv)

 ##
 macro (display_status_all_modules)
@@ -1658,6 +1794,8 @@
   display_soci ()
   display_stdair ()
   display_airrac ()
+  display_rmol ()
+  display_airinv ()
   #
   message (STATUS)
   message (STATUS "Change a value with: cmake -D<Variable>=<Value>" )


Make sure there is at least something retured for the PROJECT_SOURCE_VERSION.

--- cmake/MacroDefinitions.cmake
+++ cmake/MacroDefinitions.cmake
@@ -99,6 +99,8 @@
 			FILE(READ "${PROJECT_SOURCE_DIR}/.git/${PROJECT_GIT_REF}" PROJECT_SOURCE_VERSION)
 		ENDIF()
 		STRING(STRIP "${PROJECT_SOURCE_VERSION}" PROJECT_SOURCE_VERSION)
+        ELSE()
+            SET(PROJECT_SOURCE_VERSION AABBBII)
 	ENDIF()
 ENDMACRO()


Removed doxygen target from "make all". The doxygen implementation needs to be revisited.

--- cmake/Programs/Doxygen.cmake
+++ cmake/Programs/Doxygen.cmake
@@ -44,7 +44,7 @@
             configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/${DOXYGEN_IN} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)

             # Add a build step to build doxygen
-            add_custom_target(doc ALL
+            add_custom_target(doc
                 ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
                 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                 COMMENT "Generating API documentation with Doxygen" VERBATIM)


build: add a workaround for android NDK[<21]

The clang in the android NDK (as well as the current stable Clang in
Swift) have a bug with Android x86_64 targets where the CPU's 16-byte
(double-word) CAS instruction feature is disabled resulting in the
double word CAS being lowered to a libcall
(`__sync_val_compare_and_swap_16`) rather than the CPU instruction
(`cmpxchg16b`).  This results in the inability to link the content.
Work around this by enabling the feature manually in the build for now.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -285,6 +285,21 @@
     # undefined symbols from the standard library.
     if(NOT CMAKE_BUILD_TYPE STREQUAL Debug)
       list(APPEND result "-U_DEBUG")
+    endif()
+  endif()
+
+  if(CFLAGS_SDK STREQUAL ANDROID)
+    if(CFLAGS_ARCH STREQUAL x86_64)
+      # NOTE(compnerd) Android NDK 21 or lower will generate library calls to
+      # `__sync_val_compare_and_swap_16` rather than lowering to the CPU's
+      # `cmpxchg16b` instruction as the `cx16` feature is disabled due to a bug
+      # in Clang.  This is being fixed in the current master Clang and will
+      # hopefully make it into Clang 9.0.  In the mean time, workaround this in
+      # the build.
+      if(CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_VERSION
+          VERSION_LESS 9.0.0)
+        list(APPEND result -mcx16)
+      endif()
     endif()
   endif()


Find Ruby 2.5

Find Ruby 2.5

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -21,7 +21,7 @@
 #   RUBY_LIBDIR=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"libdir"@:>@)'`
 #   RUBY_LIBRUBYARG=`$RUBY -r rbconfig -e 'printf("%s",RbConfig::CONFIG@<:@"LIBRUBYARG_SHARED"@:>@)'`

-FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby ruby22 ruby21 ruby20 ruby19 ruby1.8 ruby18 )
+FIND_PROGRAM(RUBY_EXECUTABLE NAMES ruby.ruby2.5 ruby.ruby2.4 ruby.ruby2.3 ruby.ruby2.2 ruby ruby22 ruby21 ruby20 ruby19 ruby1.8 ruby18 )

 EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['MAJOR']"
    OUTPUT_VARIABLE RUBY_VERSION_MAJOR)
@@ -91,7 +91,7 @@
    /usr/lib/ruby/1.8/i586-linux-gnu/ )

 FIND_LIBRARY(RUBY_LIBRARY
-  NAMES ruby ruby1.9 ruby1.8
+  NAMES ruby2.5 ruby2.4 ruby2.3 ruby2.2 ruby2.1 ruby ruby1.9 ruby1.8
   PATHS
    ${RUBY_POSSIBLE_LIB_PATH}
    ${RUBY_RUBY_LIB_PATH}


Add -ldl linker flag for jenkins build.

Add -ldl linker flag for jenkins build.

--- cmake_modules/FindLlvm.cmake
+++ cmake_modules/FindLlvm.cmake
@@ -60,7 +60,7 @@
 # CMake really doesn't like adding link directories and wants absolute paths
 # Reconstruct it with LLVM_MODULE_LIBS and LLVM_LIBRARY_DIR
 string(REPLACE " " ";" LIBS_LIST ${LLVM_MODULE_LIBS})
-set (LLVM_MODULE_LIBS "")
+set (LLVM_MODULE_LIBS "-ldl")
 foreach (LIB ${LIBS_LIST})
   set(LLVM_MODULE_LIBS ${LLVM_MODULE_LIBS} "${LLVM_LIBRARY_DIR}/${LIB}")
 endforeach(LIB)


Update compiler.cmake

Update compiler.cmake

- removed -stdlib=libstdc++ for windows clang build

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -73,8 +73,10 @@
      set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
      if (APPLE)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libc++")
-     else ()
+     elseif (NOT WIN32)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
+     else()
+         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11")
      endif ()
      set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")


BUG: MIDAS+CTest macro: paths with directories were broken on linux

SVN-Revision: 3384

--- Application/CMakeScript/MIDAS.cmake
+++ Application/CMakeScript/MIDAS.cmake
@@ -134,9 +134,10 @@

 # Create a human-readable file name for the data.
 file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/${base_filepath}\")
-file(REMOVE \"${MIDAS_DATA_DIR}/${testName}_${base_filename}\")
-execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${cmake_symlink} \"MIDAS_Hashes/${checksum}\" \"${MIDAS_DATA_DIR}/${testName}_${base_filename}\" WORKING_DIRECTORY \"${MIDAS_DATA_DIR}\")
-file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${base_filename}\" \"${MIDAS_DATA_DIR}/${base_filename}\")
+file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/${testName}_${base_filepath}\")
+file(REMOVE \"${MIDAS_DATA_DIR}/${testName}_${base_file}\")
+execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${cmake_symlink} \"MIDAS_Hashes/${checksum}\" \"${MIDAS_DATA_DIR}/${testName}_${base_file}\" WORKING_DIRECTORY \"${MIDAS_DATA_DIR}\")
+file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${base_file}\" \"${MIDAS_DATA_DIR}/${base_file}\")
 ")

       list(APPEND downloadScripts "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake")


Don't install sample dlls unless OGRE_INSTALL_SAMPLES is true

--HG--
branch : v1-7

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -288,7 +288,9 @@
     # disable "lib" prefix on Unix
     set_target_properties(${SAMPLENAME} PROPERTIES PREFIX "")
   endif (CMAKE_COMPILER_IS_GNUCXX)
-  ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)
+  if (OGRE_INSTALL_SAMPLES)
+	ogre_install_target(${SAMPLENAME} ${OGRE_SAMPLE_PATH} FALSE)
+  endif()

 endfunction(ogre_config_sample_common)


partial fix for issue #192

partial fix for issue #192

--- CMakeModules/CompilerSettings.cmake
+++ CMakeModules/CompilerSettings.cmake
@@ -13,7 +13,7 @@
 endif()

 if(MSVC OR MSVC90 OR MSVC10)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1 /D_ITERATOR_DEBUG_LEVEL=0")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /MP /W1")
 endif(MSVC OR MSVC90 OR MSVC10)

 if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")


Fix version number from CMake into librsync

It was passing only the patch version, ie the least-significant
component

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -169,7 +169,7 @@

 /* Version number of package */
-#define VERSION "${LIBRSYNC_PATCH_VERSION}"
+#define VERSION "${LIBRSYNC_VERSION}"

 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */


Fix bad library presence/location check.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -142,7 +142,7 @@
     if( NOT "${LIBRESOLV_PATH}" MATCHES "-NOTFOUND" )
       set(HAVE_LIBRESOLV ON)
     endif()
-	find_library( LIBDL_PATH resolv )
+	find_library( LIBDL_PATH dl )
     if( NOT "${LIBDL_PATH}" MATCHES "-NOTFOUND" )
       set(HAVE_LIBDL ON)
     endif()


Unset internal variable in RealSense finder script


Bugfix for code generation in imported projects

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -131,6 +131,9 @@

     # write empty target files (will be populated in the fips_end macros)
     fips_reset_targets_list()
+
+    # initialize code generation
+    fips_begin_gen()

     # load project-local fips-include.cmake if exists
     if (EXISTS "${FIPS_PROJECT_DIR}/fips-include.cmake")
@@ -144,7 +147,6 @@
     endif()
     set(FIPS_IMPORT)

-    fips_begin_gen()
 endmacro()

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


Redistribute freeglut again on Windows (was lost with new apps)

--- cmake/glut.cmake
+++ cmake/glut.cmake
@@ -41,15 +41,10 @@
     NAMES freeglut glut glut32
     HINTS ${GLUT_INCLUDE_DIR}/../lib/${ARCH} ${FREEGLUT_ROOT_PATH}/lib/${ARCH} ${DEPRECIATED_WIN32_RELEASE}
   )
-  FIND_FILE(GLUT_DLL
-    NAMES freeglut.dll
-    HINTS ${GLUT_INCLUDE_DIR}/../bin/${ARCH} ${FREEGLUT_ROOT_PATH}/bin/${ARCH}
-  )
   SET(GLUT_LIBRARIES ${GLUT_glut_LIBRARY})
   MARK_AS_ADVANCED(
     GLUT_INCLUDE_DIR
     GLUT_glut_LIBRARY
-    GLUT_DLL
   )
   IF (NOT GLUT_INCLUDE_DIR OR NOT GLUT_glut_LIBRARY)
     MESSAGE(FATAL_ERROR "Could not find GLUT library. You could fetch freeglut from http://www.transmissionzero.co.uk/software/freeglut-devel/ and set the FREEGLUT_ROOT_PATH variable in cmake.")
@@ -84,3 +79,17 @@
 ENDIF()

 INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${GLUT_INCLUDE_DIR})
+
+
+##############################################################
+# redistribute freeglut on Windows
+##############################################################
+
+IF (WIN32)
+  FIND_FILE(GLUT_DLL
+    NAMES freeglut.dll
+    HINTS ${GLUT_INCLUDE_DIR}/../bin/${ARCH} ${FREEGLUT_ROOT_PATH}/bin/${ARCH}
+  )
+  MARK_AS_ADVANCED(GLUT_DLL)
+  INSTALL(PROGRAMS ${GLUT_DLL} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT apps) # 3rd party?
+ENDIF()


cmake 'half' version as option, do not look in default paths.

--- cmake/half.cmake
+++ cmake/half.cmake
@@ -1,13 +1,15 @@
 cmake_minimum_required(VERSION 3.7)

-set(GEARSHIFFT_HALF_VERSION "1.12.0")
+set(GEARSHIFFT_HALF_VERSION "1.12.0" CACHE STRING "'half' version to be built.")
+set_property(CACHE GEARSHIFFT_HALF_VERSION PROPERTY STRINGS "1.12.0")

 find_path(half_INCLUDE_DIR
   NAMES half-${GEARSHIFFT_HALF_VERSION}.zip
-  PATHS ${GEARSHIFFT_EXT_DIR}/half/src)
+  PATHS ${GEARSHIFFT_EXT_DIR}/half/src
+  NO_DEFAULT_PATH)

 if((NOT half_INCLUDE_DIR) OR (NOT EXISTS ${half_INCLUDE_DIR}))
-  # we couldn't find the header files for FOO or they don't exist
+
   message("'half' library could not be found, so [make] will download it.")

   include(ExternalProject)


Windows. Do not compile with /GS by default. /GS can eat quite a few CPU cycles in hot code path.

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -83,7 +83,7 @@
         /DDOM_DYNAMIC
         /DUNICODE
         /D_UNICODE
-        /GS
+#        /GS
         /TP
         /W3
         /c
@@ -100,7 +100,7 @@
         /DDOM_DYNAMIC
         /DUNICODE
         /D_UNICODE
-        /GS
+#        /GS
         /TP
         /W3
         /c
@@ -113,7 +113,13 @@
         )
   endif (USE_AVX_OPTIMIZATION)
 # </FS:Ansariel> [AVX Optimization]
-
+
+  # <FS:ND> Only compile with /GS if requested. /GS can cause a penalty in often called functions
+  if( ND_USE_BUFFER_SECURITY_CHECKS )
+    add_definitions( /GS )
+  endif( ND_USE_BUFFER_SECURITY_CHECKS )
+  # </FS:ND>
+
   # Are we using the crummy Visual Studio KDU build workaround?
   if (NOT VS_DISABLE_FATAL_WARNINGS)
     add_definitions(/WX)


Upgrade GDCM from version 3.0.10 to 3.0.18

Also changed the download method of GDCM to Git clone.

--- CMakeExternals/GDCM.cmake
+++ CMakeExternals/GDCM.cmake
@@ -41,8 +41,9 @@

   ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
-     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/gdcm-3.0.10.tar.gz
-     URL_MD5 28c70d02c2005a8c9d2a5847c8ba3c00
+     GIT_REPOSITORY https://github.com/malaterre/GDCM.git
+     GIT_TAG v3.0.18
+     GIT_SUBMODULES ""
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS


Also print exit message when killing heaptrack via CTRL+C.

--- heaptrack.sh.cmake
+++ heaptrack.sh.cmake
@@ -139,6 +139,10 @@
 function cleanup {
     rm -f "$pipe"
     kill "$debuggee" 2> /dev/null
+
+    echo "Heaptrack finished! Now run the following to investigate the data:"
+    echo
+    echo "  heaptrack_print $output | less"
 }
 trap cleanup EXIT

@@ -164,8 +168,4 @@

 wait $debuggee

-echo "Heaptrack finished! Now run the following to investigate the data:"
-echo
-echo "  heaptrack_print $output | less"
-
 # kate: hl Bash


Work on CMake for nF API Namespaces

Work on CMake for nF API Namespaces

- Rearrange options and code in NF_API_Namespaces
- Add missing option definition for System.Net

Signed-off-by: josesimoes <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>

--- CMake/Modules/NF_API_Namespaces.cmake
+++ CMake/Modules/NF_API_Namespaces.cmake
@@ -10,14 +10,15 @@
 # and the namespace designation is 'Windows.Devices.Gpio'
 ###########################################################################################

-option(API_Windows.Devices.Gpio "option for Windows.Devices.Gpio API")
-option(API_Windows.Devices.Spi "option for Windows.Devices.Spi API")
-option(API_Windows.Devices.I2c "option for Windows.Devices.I2c API")
-option(API_Windows.Devices.Pwm "option for Windows.Devices.Pwm API")
-option(API_Windows.Devices.Adc "option for Windows.Devices.Adc API")
-option(API_Windows.Devices.SerialCommunication "option for Windows.Devices.SerialCommunication API")
-option(API_nanoFramework.Runtime.Events "option for nanoFramework.Runtime.Events API")
-option(API_Windows.Networking.Sockets "option for Windows.Networking.Sockets")
+option(API_nanoFramework.Runtime.Events         "option for nanoFramework.Runtime.Events API")
+option(API_System.Net                           "option for System.Net")
+option(API_Windows.Devices.Adc                  "option for Windows.Devices.Adc API")
+option(API_Windows.Devices.Gpio                 "option for Windows.Devices.Gpio API")
+option(API_Windows.Devices.I2c                  "option for Windows.Devices.I2c API")
+option(API_Windows.Devices.Pwm                  "option for Windows.Devices.Pwm API")
+option(API_Windows.Devices.SerialCommunication  "option for Windows.Devices.SerialCommunication API")
+option(API_Windows.Devices.Spi                  "option for Windows.Devices.Spi API")
+option(API_Windows.Networking.Sockets           "option for Windows.Networking.Sockets")

 #################################################################
@@ -59,18 +60,37 @@
 ############################################################################################

 macro(ParseApiOptions)
-
+
+    # nanoFramework.Runtime.Events
+    if(API_nanoFramework.Runtime.Events)
+        ##### API name here (doted name)
+        PerformSettingsForApiEntry("nanoFramework.Runtime.Events")
+
+        # this one is special because it requires also another assembly for events that is internal (doens't have a managed end)
+
+        # append to list of declaration for Interop Assemblies table
+        list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs;")
+        # append to list of entries for Interop Assemblies table
+        list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs,")
+
+    endif()
+
+    # System.Net
+    if(API_System.Net)
+        ##### API name here (doted name)
+        PerformSettingsForApiEntry("System.Net")
+    endif()
+
+    # Windows.Devices.Adc
+    if(API_Windows.Devices.Adc)
+        ##### API name here (doted name)
+        PerformSettingsForApiEntry("Windows.Devices.Adc")
+    endif()
+
     # Windows.Devices.Gpio
     if(API_Windows.Devices.Gpio)
         ##### API name here (doted name)
         PerformSettingsForApiEntry("Windows.Devices.Gpio")
-    endif()
-
-
-    # Windows.Devices.Spi
-    if(API_Windows.Devices.Spi)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.Spi")
     endif()

 	# Windows.Devices.I2c
@@ -85,42 +105,22 @@
         PerformSettingsForApiEntry("Windows.Devices.Pwm")
     endif()

-    # Windows.Devices.Adc
-    if(API_Windows.Devices.Adc)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.Adc")
-    endif()
-
     # Windows.Devices.SerialCommunication
     if(API_Windows.Devices.SerialCommunication)
         ##### API name here (doted name)
         PerformSettingsForApiEntry("Windows.Devices.SerialCommunication")
     endif()

-    # nanoFramework.Runtime.Events
-    if(API_nanoFramework.Runtime.Events)
+    # Windows.Devices.Spi
+    if(API_Windows.Devices.Spi)
         ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Runtime.Events")
-
-        # this one is special because it requires also another assembly for events that is internal (doens't have a managed end)
-
-        # append to list of declaration for Interop Assemblies table
-        list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs;")
-        # append to list of entries for Interop Assemblies table
-        list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs,")
-
+        PerformSettingsForApiEntry("Windows.Devices.Spi")
     endif()

-     # Windows.Networking.Sockets
+    # Windows.Networking.Sockets
      if(API_Windows.Networking.Sockets)
         ##### API name here (doted name)
         PerformSettingsForApiEntry("Windows.Networking.Sockets")
-    endif()
-
-    # System.Net
-    if(API_System.Net)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.Net")
     endif()


PKG: enable diapotb in SuperBuild with RemoteModules

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -150,7 +150,7 @@

 set(OTB_MODULES_CONFIG)
 if(WITH_REMOTE_MODULES)
-  foreach(remote_module SertitObject Mosaic otbGRM OTBFFSforGMM)
+  foreach(remote_module SertitObject Mosaic otbGRM OTBFFSforGMM DiapOTBModule)
     list(APPEND OTB_MODULES_CONFIG -DModule_${remote_module}:BOOL=ON)
   endforeach()


Go Travis

Go Travis

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -137,6 +137,9 @@
         -Wsign-conversion
         # -Wmisleading-indentation

+        # clang
+        -stdlib=libc++
+
         $<$<CXX_COMPILER_ID:GNU>:
             -Wmaybe-uninitialized


Change msvc warning level to "Wall"

Change msvc warning level to "Wall"

NOTE: we have made a pretty good job in solving warnings, now its time to take the next step ;)

--- cmake/Compilers/msvc.cmake
+++ cmake/Compilers/msvc.cmake
@@ -25,8 +25,8 @@
 # enable/disable warnings
 # dll warning 4251 disabled by default.
 if (BUILD_WITH_WARNINGS)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4251")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4251")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Wall /wd4251")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall /wd4251")
 else ()
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W0")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W0")


Fixing errors in installer

Fixing errors in installer

Former-commit-id: a87bedf130a1a0329e5378fe9a3bf338449bc175

--- cmake/InstallPackage.cmake
+++ cmake/InstallPackage.cmake
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 3.15)
+include(cmake/CheckCompile.cmake)

 # Dumps cached variables to DMRG_INIT_CACHE_FILE so that we can propagate
 # the current build configuration to dependencies
@@ -21,7 +22,6 @@
 endfunction()

 function(pkg_check_compile pkg_name target_name)
-    include(cmake/CheckCompile.cmake)
     check_compile(${pkg_name} ${target_name} ${PROJECT_SOURCE_DIR}/cmake/compile/${pkg_name}.cpp)
     if(NOT check_compile_${pkg_name} AND DMRG_PRINT_CHECKS AND EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
         file(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log" ERROR_LOG)
@@ -214,8 +214,7 @@
     endif()

     if(PKG_CHECK)
-        include(cmake/CheckCompile.cmake)
-        check_compile(${pkg_name} ${target_name} ${PROJECT_SOURCE_DIR}/cmake/external_${pkg_name}/test.cpp)
+        pkg_check_compile(${pkg_name} ${target_name})
     endif()
 endfunction()


Squashed '3rdparty/github/cmake-utils/' changes from fe1ec0eea..15c01187b

15c01187b cmake/MyPackageStart.cmake: Added a missing ADD_DEFINITIONS()

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: 15c01187b88e32e766eded3bbe7fe0ade9a7665a

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -103,6 +103,7 @@
         IF (MYPACKAGE_DEBUG)
           MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] Adding compile definition ${_definition}")
         ENDIF ()
+        ADD_DEFINITIONS("-D${_definition}")
         LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D${_definition})
       ENDIF ()
     ENDFOREACH ()


whitespace

whitespace


[cmake] ABI -> SO_current 6

[cmake] ABI -> SO_current 6

--- cmake/SiconosVersion.cmake
+++ cmake/SiconosVersion.cmake
@@ -33,7 +33,7 @@
 # If any interfaces have been removed since the last public release, then set
 # age to 0.

-set(SO_current 5)
+set(SO_current 6)
 set(SO_revision 0)
 set(SO_age 0)


Fix to FFTW cmake to build on cx2

Fix to FFTW cmake to build on cx2

--- cmake/ThirdPartyFFTW.cmake
+++ cmake/ThirdPartyFFTW.cmake
@@ -24,7 +24,7 @@
         )
         SET(FFTW_LIB fftw3)
         MARK_AS_ADVANCED(FFTW_LIB)
-        INCLUDE_DIRECTORIES(${TPDIST}/include)
+	SET(FFTW_INCLUDE_DIR ${TPDIST}/include)
         MESSAGE(STATUS "Build FFTW: ${TPDIST}/lib/lib${FFTW_LIB}.so")
     ELSE ()
         INCLUDE (FindFFTW)


build_system: Add a define for iOS

build_system: Add a define for iOS

--- cmake/compiler_flags.cmake
+++ cmake/compiler_flags.cmake
@@ -39,6 +39,10 @@
     add_definitions("-DAPPLE")
 endif()

+if(IOS)
+    add_definitions("-DIOS")
+endif()
+
 if(UNIX AND NOT APPLE)
     add_definitions("-DLINUX")
 endif()


Do not accept invalid INSTALL_LAYOUT parameter

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -59,13 +59,16 @@
 # - INSTALL_SUPPORTFILESDIR (various extra support files)
 #
 # - INSTALL_MYSQLDATADIR    (data directory)
+#
+# When changing this page,  _please_ do not forget to update public Wiki
+# http://forge.mysql.com/wiki/CMake#Fine-tuning_installation_paths

 IF(NOT INSTALL_LAYOUT)
   SET(DEFAULT_INSTALL_LAYOUT "STANDALONE")
 ENDIF()

 SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}"
-CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer) or UNIX")
+CACHE STRING "Installation directory layout. Options are: STANDALONE (as in zip or tar.gz installer), RPM, DEB, SVR4")

 IF(UNIX)
   IF(INSTALL_LAYOUT MATCHES "RPM")
@@ -83,6 +86,13 @@
     SET(CMAKE_INSTALL_PREFIX ${default_prefix}
       CACHE PATH "install prefix" FORCE)
   ENDIF()
+  SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR5")
+  LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
+  IF(ind EQUAL -1)
+    MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."
+    " Choose between ${VALID_INSTALL_LAYOUTS}" )
+  ENDIF()
+
   SET(SYSCONFDIR "${CMAKE_INSTALL_PREFIX}/etc"
     CACHE PATH "config directory (for my.cnf)")
   MARK_AS_ADVANCED(SYSCONFDIR)


Fix FindV8 libplatform

Fix FindV8 libplatform

--- cmake/modules/FindV8.cmake
+++ cmake/modules/FindV8.cmake
@@ -114,7 +114,7 @@
 )

 find_library (V8_LIBPLATFORM_LIBRARY
-	NAMES v8_libplatform libv8_libbase
+	NAMES v8_libplatform libv8_libplatform
 	PATHS
 		$ENV{V8_DIR}
 		$ENV{V8_DIR}/lib


Updated find_python_module function

Updated find_python_module function

--- cmake/modules/macros.cmake
+++ cmake/modules/macros.cmake
@@ -348,7 +348,7 @@
     # A module's location is usually a directory, but for binary modules
     # it's a .so file.
     execute_process(
-            COMMAND "${Python_EXECUTABLE}" "-c" "import sys, ${module}; sys.stdout.write(${module}.__version__.replace('.', ';'))"
+            COMMAND Python::Interpreter "-c" "import sys, ${module}; sys.stdout.write(${module}.__version__.replace('.', ';'))"
             RESULT_VARIABLE _${module}_status
             OUTPUT_VARIABLE _${module}_location
             ERROR_QUIET


bump version number

bump version number

[ci skip]

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

 SET(OSPRAY_VERSION_MAJOR 1)
 SET(OSPRAY_VERSION_MINOR 2)
-SET(OSPRAY_VERSION_PATCH 0)
+SET(OSPRAY_VERSION_PATCH 1)
 SET(OSPRAY_VERSION_GITHASH 0)
 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
   FIND_PACKAGE(Git)


Fix: boost optional components finding break the build on UNIX

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@4037 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -14,18 +14,16 @@
 # Disable the config mode of find_package(Boost)
 set(Boost_NO_BOOST_CMAKE ON)

-# Optional boost modules
-find_package(Boost 1.40.0 COMPONENTS mpi serialization)
-
 # Required boost modules
 find_package(Boost 1.40.0 REQUIRED COMPONENTS system filesystem thread date_time iostreams)

 if(Boost_FOUND)
   set(BOOST_FOUND TRUE)
+	# Optional boost modules
+	find_package(Boost 1.40.0 COMPONENTS mpi serialization)
   # Obtain diagnostic information about Boost's automatic linking outputted
   # during compilation time.
   add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
-
   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})
 endif(Boost_FOUND)


disable AMENT_CMAKE_SYMLINK_INSTALL by default

--- ament_cmake_symlink_install/ament_cmake_symlink_installConfig.cmake
+++ ament_cmake_symlink_install/ament_cmake_symlink_installConfig.cmake
@@ -8,7 +8,7 @@

 option(AMENT_CMAKE_SYMLINK_INSTALL
   "Replace the CMake install command with a custom implementation using symlinks instead of copying resources"
-  ON)
+  OFF)

 if(AMENT_CMAKE_SYMLINK_INSTALL)
   message(STATUS "Override CMake install command with custom implementation "


BUG: ManagedITK and WrapITK don't use the same var names - it breaks RGBAPixel wrapping

--- Wrapping/WrapITK/WrapITKTypes.cmake
+++ Wrapping/WrapITK/WrapITKTypes.cmake
@@ -120,7 +120,7 @@
     WRAP_TEMPLATE("${ITKM_US}" "${ITKT_US}")
   ENDIF(WRAP_rgba_unsigned_short)
 END_WRAP_TYPE()
-SET(itk_Wrap_RGBAPixel ${WRAP_TEMPLATE_LIST})
+SET(itk_Wrap_RGBAPixel ${WRAPPER_TEMPLATES})

 WRAP_TYPE("std::complex" "C")
   IF(WRAP_complex_float)


COMP: Install tclap into a sandbox directory in the install dir.

TCLAP likes to add the prefix/include to the include path so its headers are used like <tclap/CmdLine.h>.  However, this causes conflict with superbuild as we don't want to use the installed version of the parent project development headers.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -41,7 +41,7 @@
   SVN_REPOSITORY "http://svn.slicer.org/Slicer3/trunk/Libs/tclap"
   CMAKE_GENERATOR ${gen}
   CMAKE_ARGS
-    -DCMAKE_INSTALL_PREFIX:PATH=${prefix}
+    -DCMAKE_INSTALL_PREFIX:PATH=${prefix}/tclapsandbox
     -DCMAKE_BUILD_TYPE:STRING=${build_type}
     -DBUILD_EXAMPLES:BOOL=OFF
     -DBUILD_SHARED_LIBS:BOOL=${shared}
@@ -93,7 +93,7 @@
     -DBUILD_SHARED_LIBS:BOOL=${shared}
     -DBUILD_TESTING:BOOL=OFF
     -DITK_DIR:PATH=${ITK_DIR}
-    -DTCLAP_DIR:PATH=${prefix}/lib/tclap
+    -DTCLAP_DIR:PATH=${prefix}/tclapsandbox/lib/tclap
     -DModuleDescriptionParser_DIR:PATH=${prefix}/lib/ModuleDescriptionParser
   DEPENDS
     "tclap"


Fix cmake prepend for a list

Fix cmake prepend for a list


COMP: fix Expat library name on Windows (libexpat.lib is the default name)

--- SuperBuild/CMake/External_expat.cmake
+++ SuperBuild/CMake/External_expat.cmake
@@ -43,7 +43,7 @@

 set(_SB_EXPAT_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
 if(WIN32)
-  set(_SB_EXPAT_LIBRARY ${SB_INSTALL_PREFIX}/lib/expat.lib)
+  set(_SB_EXPAT_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat.lib)
 elseif(UNIX)
   set(_SB_EXPAT_LIBRARY ${SB_INSTALL_PREFIX}/lib/libexpat${CMAKE_SHARED_LIBRARY_SUFFIX})
 endif()


On OSX: also set c++ exception and rtti flags on cmd line, this is needed when using make/ninja instead of xcodebuild

--- cmake-toolchains/osx.cmake
+++ cmake-toolchains/osx.cmake
@@ -25,22 +25,26 @@
 if (FIPS_EXCEPTIONS)
     message("C++ exceptions are enabled")
     set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS "YES")
+    set(FIPS_OSX_EXCEPTION_FLAGS "")
 else()
     message("C++ exceptions are disabled")
     set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS "NO")
+    set(FIPS_OSX_EXCEPTION_FLAGS "-fno-exceptions")
 endif()

 # rtti on/off?
 if (FIPS_RTTI)
     message("C++ RTTI is enabled")
     set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI "YES")
+    set(FIPS_OSX_RTTI_FLAGS "")
 else()
     message("C++ RTTI is disabled")
     set(CMAKE_XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI "NO")
+    set(FIPS_OSX_RTTI_FLAGS "-fno-rtti")
 endif()

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


Documented FindFF cmake script

Documented FindFF cmake script

--- cmake.modules/FindFF.cmake
+++ cmake.modules/FindFF.cmake
@@ -1,7 +1,38 @@
+# @version		GrPPI v0.3
+# @copyright		Copyright (C) 2017 Universidad Carlos III de Madrid. All rights reserved.
+# @license		GNU/GPL, see LICENSE.txt
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You have received a copy of the GNU General Public License in LICENSE.txt
+# also available in <http://www.gnu.org/licenses/gpl.html>.
+#
+# See COPYRIGHT.txt for copyright notices and details.
+
+# Find FF
+# -------
+#
+# Find the include directories for FastFlow library
+#
+# Use:
+#
+#   find_package(FF)
+#
 # Modifying the following variables directs where search is performed
 #
 #   - FF_INCLUDE_DIR Directory for FF includes
-
+#
+# This module sets the following variables:
+#  * FF_FOUND Set to TRUE if FastFlow was found or FALSE otherwise
+#  * FF_INCLUDE_DIRS Directory where FastFlow includes where found
+#
 set(FF_FOUND FALSE)

 set(FF_SEARCH_DIR $ENV{FF_ROOT})


Improve FindLibTooling.

Improve FindLibTooling.

--- cmake/FindLibTooling.cmake
+++ cmake/FindLibTooling.cmake
@@ -5,53 +5,101 @@
 # - LIBTOOLING_FOUND - system has LibTooling libraries
 # - LIBTOOLING_INCLUDE_DIRS - include directories
 # - LIBTOOLING_LIBRARIES - libraries to link
+# - LIBTOOLING_CXXFLAGS - flags to use for the compiler
+# - LIBTOOLING_SYSTEM_LIBRARIES - system libraries needed to link

 # Set the libraries that need to be found:
-set(LIBTOOLING_REQUIRED_LIBS
+set(LIBTOOLING_REQUIRED_LIBRARIES
     "clangTooling" "clangFrontend" "clangSerialization" "clangDriver"
     "clangRewriteFrontend" "clangRewriteCore" "clangParse" "clangSema"
     "clangAnalysis" "clangAST" "clangASTMatchers" "clangEdit" "clangLex"
-    "clangBasic")
+    "clangBasic"
+    "LLVMCore" "LLVMOption" "LLVMMC" "LLVMObject" "LLVMBitReader"
+    "LLVMSupport" "LLVMAsmParser" "LLVMMCParser" "LLVMTransformUtils")

-# First, find LLVM
-find_program(LLVM_CONFIG_EXECUTABLE "llvm-config" DOC "llvm-config executable")
-mark_as_advanced(LLVM_CONFIG_EXECUTABLE)
-if(LLVM_CONFIG_EXECUTABLE)
-  message(STATUS "llvm-config executable found: ${LLVM_CONFIG_EXECUTABLE}")
-else()
-  message(FATAL_ERROR "The `llvm-config` executable was not found. Please "
-                      "install LLVM/clang and/or make it available to CMake.")
+# First, find LLVM by way of the `llvm-config` executable
+if(NOT LLVM_CONFIG_EXECUTABLE)
+  find_program(LLVM_CONFIG_EXECUTABLE "llvm-config" DOC "llvm-config executable")
+  mark_as_advanced(LLVM_CONFIG_EXECUTABLE)
+  if(LLVM_CONFIG_EXECUTABLE)
+    message(STATUS "llvm-config executable found: ${LLVM_CONFIG_EXECUTABLE}")
+  else()
+    message(FATAL_ERROR "The `llvm-config` executable was not found. Please "
+                        "install LLVM/clang and/or make it available to CMake.")
+  endif()
+  set(LLVM_CONFIG_EXECUTABLE_PREV ${LLVM_CONFIG_EXECUTABLE} CACHE INTERNAL
+      "Previous value (saved to detect changes)")
 endif()

-# Get version
-execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--version"
-    OUTPUT_VARIABLE LIBTOOLING_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-message(STATUS "LibTooling version: ${LIBTOOLING_VERSION}")
+# Check if LLVM has changed
+if((LLVM_CONFIG_EXECUTABLE STREQUAL LLVM_CONFIG_EXECUTABLE_PREV) AND
+   FIND_LIBTOOLING_INITIALIZED)
+  set(LLVM_HAS_CHANGED False)
+else()
+  set(LLVM_HAS_CHANGED True)
+  set(LLVM_CONFIG_EXECUTABLE_PREV ${LLVM_CONFIG_EXECUTABLE} CACHE INTERNAL
+      "Previous value (saved to detect changes)")
+endif()

-# Get include dir
-execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--includedir"
-    OUTPUT_VARIABLE LIBTOOLING_INCLUDE_DIR
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-message(STATUS "LibTooling include directory: ${LIBTOOLING_INCLUDE_DIR}")
+# If LLVM has changed, update all configuration variables
+if(LLVM_HAS_CHANGED)
+  # Get version
+  execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--version"
+      OUTPUT_VARIABLE LIBTOOLING_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+  message(STATUS "LibTooling version: ${LIBTOOLING_VERSION}")

-# Get library dir
-execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--libdir"
-    OUTPUT_VARIABLE LIBTOOLING_LIBRARY_DIR
-    OUTPUT_STRIP_TRAILING_WHITESPACE)
-message(STATUS "LibTooling library directory: ${LIBTOOLING_LIBRARY_DIR}")
+  # Get include dir
+  execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--includedir"
+      OUTPUT_VARIABLE LIBTOOLING_INCLUDE_DIR
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  message(STATUS "LibTooling include directory: ${LIBTOOLING_INCLUDE_DIR}")

-# Find all required libraries
-foreach(_lib ${LIBTOOLING_REQUIRED_LIBS})
-  set(varname "${_lib}_LIBRARY")
-  find_library(${varname} NAME ${_lib} HINTS ${LIBTOOLING_LIBRARY_DIR})
-  mark_as_advanced(${varname})
-  if(${varname})
-    message(STATUS "Found library `${_lib}`: ${${varname}}")
-    set(LIBTOOLING_LIBRARY ${LIBTOOLING_LIBRARY} ${${varname}})
-  else()
-    message(FATAL_ERROR "The library `${_lib}` was not found.")
-  endif()
-endforeach()
+  # Get library dir
+  execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--libdir"
+      OUTPUT_VARIABLE LIBTOOLING_LIBRARY_DIR
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  message(STATUS "LibTooling library directory: ${LIBTOOLING_LIBRARY_DIR}")
+
+  # Get CXX flags
+  execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--cxxflags"
+      OUTPUT_VARIABLE LIBTOOLING_CXXFLAGS
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  message(STATUS "LibTooling CXXFLAGS: ${LIBTOOLING_CXXFLAGS}")
+
+  # Get system libraries
+  execute_process(COMMAND ${LLVM_CONFIG_EXECUTABLE} "--system-libs"
+      OUTPUT_VARIABLE LIBTOOLING_SYSTEM_LIBRARIES
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+  string(STRIP "${LIBTOOLING_SYSTEM_LIBRARIES}" LIBTOOLING_SYSTEM_LIBRARIES)
+  message(STATUS "LibTooling system libaries: ${LIBTOOLING_SYSTEM_LIBRARIES}")
+
+  # Find all required libraries
+  unset(LIBTOOLING_LIBRARY)
+  foreach(_lib ${LIBTOOLING_REQUIRED_LIBRARIES})
+    set(varname "${_lib}_LIBRARY")
+    find_library(${varname} NAME ${_lib} HINTS ${LIBTOOLING_LIBRARY_DIR})
+    mark_as_advanced(${varname})
+    if(${varname})
+      message(STATUS "Found library `${_lib}`: ${${varname}}")
+      set(LIBTOOLING_LIBRARY ${LIBTOOLING_LIBRARY} ${${varname}})
+    else()
+      message(FATAL_ERROR "The library `${_lib}` was not found.")
+    endif()
+  endforeach()
+
+  # Save vars to cache that should be user-modifiable
+  set(LIBTOOLING_FOUND ${LIBTOOLING_FOUND}
+      CACHE INTERNAL "Save if LibTooling was found.")
+  set(LIBTOOLING_LIBRARY ${LIBTOOLING_LIBRARY}
+      CACHE FILEPATH "The LibTooling libraries.")
+  set(LIBTOOLING_INCLUDE_DIR ${LIBTOOLING_INCLUDE_DIR}
+      CACHE FILEPATH "The LibTooling include directory.")
+  set(LIBTOOLING_CXXFLAGS ${LIBTOOLING_CXXFLAGS}
+      CACHE STRING "C++ compiler flags to use for the LibTooling library.")
+  set(LIBTOOLING_SYSTEM_LIBRARIES ${LIBTOOLING_SYSTEM_LIBRARIES}
+      CACHE STRING "System libraries to link for the LibTooling library.")
+  mark_as_advanced(LIBTOOLING_FOUND LIBTOOLING_LIBRARY LIBTOOLING_INCLUDE_DIR)
+endif()

 # Set include directories and libraries
 set(LIBTOOLING_INCLUDE_DIRS ${LIBTOOLING_INCLUDE_DIR})
@@ -63,11 +111,6 @@
     REQUIRED_VARS LIBTOOLING_LIBRARY LIBTOOLING_INCLUDE_DIR
     VERSION_VAR LIBTOOLING_VERSION)

-# Save vars to cache that should be user-modifiable
-set(LIBTOOLING_FOUND ${LIBTOOLING_FOUND}
-    CACHE INTERNAL "Save if LibTooling was found.")
-set(LIBTOOLING_LIBRARY ${LIBTOOLING_LIBRARY}
-    CACHE FILEPATH "The LibTooling libraries.")
-set(LIBTOOLING_INCLUDE_DIR ${LIBTOOLING_INCLUDE_DIR}
-    CACHE FILEPATH "The LibTooling include directory.")
-mark_as_advanced(LIBTOOLING_FOUND LIBTOOLING_LIBRARY LIBTOOLING_INCLUDE_DIR)
+# Set variable so we know that this it not the first run anymore
+set(FIND_LIBTOOLING_INITIALIZED True CACHE INTERNAL
+    "Variable set after first run.")


[CMake][Fuchsia] Pass -ldl -lpthread LDFLAGS to second stage

We're using static libc++ for the second stage which requires explicitly
linking -ldl and -lpthread.

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

--- cmake/caches/Fuchsia.cmake
+++ cmake/caches/Fuchsia.cmake
@@ -74,6 +74,12 @@
   endif()
 endif()

+if(UNIX)
+  set(BOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
+  set(BOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
+  set(BOOTSTRAP_CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread" CACHE STRING "")
+endif()
+
 set(BOOTSTRAP_LLVM_ENABLE_LTO ON CACHE BOOL "")
 if(NOT APPLE)
   set(BOOTSTRAP_LLVM_ENABLE_LLD ON CACHE BOOL "")


Fuzz build mode: drop -fsanitize-coverage=edge

MUCH slower, and upcoming clang's -fsanitize=fuzzer
only has these three coverage options enabled.

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -100,7 +100,7 @@
     CMAKE_C_FLAGS_SANITIZE )

 set(fuzz "-O3 -ffast-math")
-set(fuzz "${fuzz} ${asan} ${ubsan} -fsanitize-coverage=edge,indirect-calls,trace-pc-guard,trace-cmp")
+set(fuzz "${fuzz} ${asan} ${ubsan} -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp")
 set(fuzz "${fuzz} -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION")
 SET(CMAKE_CXX_FLAGS_FUZZ
     "${fuzz}"


Link shared CRT libs when building with MSVC

--- cmake/internal_utils.cmake
+++ cmake/internal_utils.cmake
@@ -32,7 +32,7 @@
         # preferable to use CRT as static libraries, as we don't have to rely
         # on CRT DLLs being available. CMake always defaults to using shared
         # CRT libraries, so we override that default here.
-        string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
+        # string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
       endif()

       # We prefer more strict warning checking for building Google Test.


made improvements to libraries.cmake

made improvements to libraries.cmake

--- libraries/libraries.cmake
+++ libraries/libraries.cmake
@@ -4,7 +4,25 @@
     find_library(${VARIABLE} NAMES ${ARGN} PATHS ${Jatta_DEPENDENCY_LIBRARY_DIRS})
 endmacro()

+macro(jatta_check_shared NAME MODULE)
+    message(STATUS "Checking module ${MODULE}")
+    get_filename_component(${NAME}_EXTENSION ${MODULE} EXT)
+    string(TOLOWER "${${NAME}_EXTENSION}" ${NAME}_EXTENSION)
+    if("${${NAME}_EXTENSION}" STREQUAL ".a" OR "${${NAME}_EXTENSION}" STREQUAL ".lib")
+        set(${NAME}_SHARED OFF CACHE BOOL "Is ${NAME} a shared library?")
+        set(${NAME}_PACKAGE ON CACHE BOOL "Package ${NAME} with installation?")
+    else()
+        set(${NAME}_SHARED ON CACHE BOOL "Is ${NAME} a shared library?")
+        set(${NAME}_PACKAGE OFF CACHE BOOL "Package ${NAME} with installation?")
+    endif()
+endmacro()
+
 macro(jatta_find_package LIBRARY)
+    if(Jatta_REFRESH_LIBRARIES)
+        unset(${LIBRARY}_LIBRARY CACHE)
+        unset(${LIBRARY}_DEBUG_LIBRARY CACHE)
+        unset(${LIBRARY}_SHARED CACHE)
+    endif()
     if(NOT DEFINED ${LIBRARY}_LIBRARY)
         message(STATUS "Looking for library ${LIBRARY}")

@@ -117,12 +135,14 @@
         add_library(${LIBRARY} STATIC IMPORTED)
         if(${${LIBRARY}_RELEASE_FOUND})
             set_target_properties(${LIBRARY} PROPERTIES IMPORTED_LOCATION "${${LIBRARY}_LIBRARY}")
+            jatta_check_shared(${LIBRARY} ${${LIBRARY}_LIBRARY})
         else()
             set_target_properties(${LIBRARY} PROPERTIES IMPORTED_LOCATION "${${LIBRARY}_DEBUG_LIBRARY}")
         endif()
         add_library(${LIBRARY}d STATIC IMPORTED)
         if(${${LIBRARY}_DEBUG_FOUND})
             set_target_properties(${LIBRARY}d PROPERTIES IMPORTED_LOCATION "${${LIBRARY}_DEBUG_LIBRARY}")
+            jatta_check_shared(${LIBRARY}_DEBUG ${${LIBRARY}_DEBUG_LIBRARY})
         else()
             set_target_properties(${LIBRARY}d PROPERTIES IMPORTED_LOCATION "${${LIBRARY}_LIBRARY}")
         endif()
@@ -148,7 +168,7 @@
 function(jatta_define_feature NAME DOC)
     set(ENABLED ON)
     foreach(dependency ${ARGN})
-        if(NOT ${dependency}_FOUND)
+        if(NOT ${dependency}_FOUND OR ${dependency}_IGNORED)
             set(ENABLED OFF)
         endif()
     endforeach()


add SIBLINGS to serialize patching of subprojects

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -156,7 +156,7 @@
 function(xpPatch)
   set(options NPM_INSTALL)
   set(oneValueArgs NAME PARENT SUBDIR PATCH PATCH_STRIP DLURL DLMD5 DLNAME)
-  set(multiValueArgs NPM_FLAGS)
+  set(multiValueArgs NPM_FLAGS SIBLINGS)
   cmake_parse_arguments(P "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
   string(TOLOWER ${P_NAME} prj)
   if(DEFINED P_PARENT)
@@ -201,7 +201,7 @@
   endif()
   if(DEFINED P_PARENT)
     set(depsOpt DEPENDS)
-    list(APPEND depsList ${P_PARENT})
+    list(APPEND depsList ${P_PARENT} ${P_SIBLINGS})
     set(srcDirOpt SOURCE_DIR)
     ExternalProject_Get_Property(${P_PARENT} SOURCE_DIR)
     if(DEFINED P_SUBDIR)
@@ -252,7 +252,9 @@
     foreach(sub ${R_SUBPRO})
       string(TOUPPER ${sub} SUB)
       string(TOLOWER ${R_NAME} super)
-      xpPatch(${PRO_${SUB}} PARENT ${super})
+      xpPatch(${PRO_${SUB}} PARENT ${super} SIBLINGS ${siblings})
+      string(TOLOWER ${super}_${sub} sibling)
+      list(APPEND siblings ${sibling})
     endforeach()
   endif()
 endfunction()


Check dependencies for all targets (not only enabled ones)

We need the ${target_project_name}_DEPENDENCIES variable to be set
for all targets. Previously, if one target had a dependency which
got enabled by the macro, the ${target_project_name}_DEPENDENCIES
variable for that target was not set. This could lead to missing
include paths when compiling the enabled target. This applies
for external projects using the CTK macro or a non-superbuild CTK.

Additionally, missing dependencies are now reported for all targets,
not only enabled ones.

--- CMake/ctkMacroValidateBuildOptions.cmake
+++ CMake/ctkMacroValidateBuildOptions.cmake
@@ -124,70 +124,70 @@
     endif()
     #message(STATUS target_project_name:${target_project_name})

-    if(${${option_name}})
-      # Obtain dependency path
-      ctkMacroSetPaths("${QT_INSTALLED_LIBRARY_DIR}")
-      execute_process(
-        COMMAND "${executable}" "${dir}/DGraphInput-alldep-withext.txt" -sort ${target_project_name}
-        WORKING_DIRECTORY ${dir}
-        RESULT_VARIABLE RESULT_VAR
-        OUTPUT_VARIABLE dep_path
-        ERROR_VARIABLE error
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-        )
-      if(RESULT_VAR)
-        message(FATAL_ERROR "Failed to obtain dependence path of ${target_project_name}.\n${RESULT_VAR}\n${CTK_BINARY_DIR}\n${error}")
-      endif()
-
-      # Set a variable for each target containing its dependencies
-      # Needed for setting individual include directories for plugins,
-      # depending on other plugins.
-      set(${target_project_name}_DEPENDENCIES )
-
-      # Convert 'dep_path' to a list
-      string(REPLACE " " "\\;" dep_path_list ${dep_path})
-      set(dep_path_list ${dep_path_list})
-      list(REMOVE_ITEM dep_path_list ${target_project_name})
-      list(APPEND ${target_project_name}_DEPENDENCIES ${dep_path_list})
-
-      #message("path for ${target_project_name} is: ${dep_path_list}")
-
-      # Check if all internal CTK targets included in the dependency path are enabled
-      set(int_dep_path_list )
-      set(ext_dep_path_list ${dep_path_list})
-      ctkMacroGetAllProjectTargetLibraries("${dep_path_list}" int_dep_path_list)
-      if(int_dep_path_list)
-        list(REMOVE_ITEM ext_dep_path_list ${int_dep_path_list})
-      endif()
-
-      if(ext_dep_path_list)
-        list(APPEND EXTERNAL_TARGETS ${ext_dep_path_list})
-        # If this macro is called from inside CTK itself, we add the external
-        # targets to the list of known targets (for external projects calling
-        # this macro, targets external to the calling project should be listed
-        # in CTK_LIBRARIES or CTK_EXTERNAL_PLUGIN_LIBRARIES
-        if(CTK_SOURCE_DIR)
-          if(${CMAKE_SOURCE_DIR} STREQUAL ${CTK_SOURCE_DIR})
-            list(APPEND known_targets ${ext_dep_path_list})
-          endif()
+    # Obtain dependency path
+    ctkMacroSetPaths("${QT_INSTALLED_LIBRARY_DIR}")
+    execute_process(
+      COMMAND "${executable}" "${dir}/DGraphInput-alldep-withext.txt" -sort ${target_project_name}
+      WORKING_DIRECTORY ${dir}
+      RESULT_VARIABLE RESULT_VAR
+      OUTPUT_VARIABLE dep_path
+      ERROR_VARIABLE error
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      )
+    if(RESULT_VAR)
+      message(FATAL_ERROR "Failed to obtain dependence path of ${target_project_name}.\n${RESULT_VAR}\n${CTK_BINARY_DIR}\n${error}")
+    endif()
+
+    # Set a variable for each target containing its dependencies
+    # Needed for setting individual include directories for plugins,
+    # depending on other plugins.
+    set(${target_project_name}_DEPENDENCIES )
+
+    # Convert 'dep_path' to a list
+    string(REPLACE " " "\\;" dep_path_list ${dep_path})
+    set(dep_path_list ${dep_path_list})
+    list(REMOVE_ITEM dep_path_list ${target_project_name})
+    list(APPEND ${target_project_name}_DEPENDENCIES ${dep_path_list})
+
+    #message("path for ${target_project_name} is: ${dep_path_list}")
+
+    # Check if all internal CTK targets included in the dependency path are enabled
+    set(int_dep_path_list )
+    set(ext_dep_path_list ${dep_path_list})
+    ctkMacroGetAllProjectTargetLibraries("${dep_path_list}" int_dep_path_list)
+    if(int_dep_path_list)
+      list(REMOVE_ITEM ext_dep_path_list ${int_dep_path_list})
+    endif()
+
+    if(ext_dep_path_list)
+      list(APPEND EXTERNAL_TARGETS ${ext_dep_path_list})
+      # If this macro is called from inside CTK itself, we add the external
+      # targets to the list of known targets (for external projects calling
+      # this macro, targets external to the calling project should be listed
+      # in CTK_LIBRARIES or CTK_EXTERNAL_PLUGIN_LIBRARIES
+      if(CTK_SOURCE_DIR)
+        if(${CMAKE_SOURCE_DIR} STREQUAL ${CTK_SOURCE_DIR})
+          list(APPEND known_targets ${ext_dep_path_list})
         endif()
       endif()
-
-      foreach(dep ${int_dep_path_list})
-        list(FIND known_targets ${dep} dep_found)
-        if(dep_found LESS 0)
-          message(FATAL_ERROR "${target_project_name} depends on ${dep}, which does not exist")
-        endif()
-
-        ctkMacroGetOptionName("${target_directories_with_target_name}" ${dep} dep_option)
-        if(NOT ${${dep_option}})
-          # Enable option
-          message(STATUS "Enabling option [${dep_option}] required by [${target_project_name}]")
-          set(${dep_option} ON CACHE BOOL "Enable ${target_project_name} library" FORCE)
-        endif()
-      endforeach()
-
-      # Check if all external targets included in the dependency path are available
+    endif()
+
+    foreach(dep ${int_dep_path_list})
+      list(FIND known_targets ${dep} dep_found)
+      if(dep_found LESS 0)
+        message(FATAL_ERROR "${target_project_name} depends on ${dep}, which does not exist")
+      endif()
+
+      ctkMacroGetOptionName("${target_directories_with_target_name}" ${dep} dep_option)
+      if(${${option_name}} AND NOT ${${dep_option}})
+        # Enable option
+        message(STATUS "Enabling option [${dep_option}] required by [${target_project_name}]")
+        set(${dep_option} ON CACHE BOOL "Enable ${target_project_name} library" FORCE)
+      endif()
+    endforeach()
+
+    # For enabled targets, check if all external targets included in the dependency path are available
+    if(${${option_name}})
       foreach(dep ${ext_dep_path_list})
         list(FIND known_targets ${dep} dep_found)
         if(dep_found LESS 0)


Use the full path to the PostgreSQL library when linking (#102)


OSX: create Qt5::QMultimediaDeclarativeModule target

--- cmake/Qt5Multimedia_QMultimediaDeclarativeModulePlugin.cmake
+++ cmake/Qt5Multimedia_QMultimediaDeclarativeModulePlugin.cmake
@@ -20,7 +20,7 @@
   return()
 endif()

-if(IOS)
+if(IOS OR APPLE)
   add_library(Qt5::QMultimediaDeclarativeModule MODULE IMPORTED)

   set(_release_lib "${_qt_install_prefix}/qml/QtMultimedia/libdeclarative_multimedia.a")


ignore missing config header on some libxml++ installs

--- cmake/Modules/Findlibxml++.cmake
+++ cmake/Modules/Findlibxml++.cmake
@@ -18,7 +18,11 @@
     FIND_LIBRARY(libxml++_LIBRARY NAMES xml++ xml++-2.6 HINTS ${PC_LIBXMLPP_LIBDIR} ${PC_LIBXMLPP_LIBRARY_DIRS})

     SET(libxml++_LIBRARIES ${libxml++_LIBRARY} ${PC_LIBXMLPP_PKGCONF_LIBRARIES} ${glibmm_LIBRARIES} ${LIBXML2_LIBRARIES})
+IF(libxml++config_INCLUDE_DIR)
     SET(libxml++_INCLUDE_DIRS ${libxml++_INCLUDE_DIR} ${PC_LIBXMLPP_PKGCONF_INCLUDE_DIRS} ${libxml++config_INCLUDE_DIR} ${glibmm_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR})
+ELSE(libxml++config_INCLUDE_DIR)
+    SET(libxml++_INCLUDE_DIRS ${libxml++_INCLUDE_DIR} ${PC_LIBXMLPP_PKGCONF_INCLUDE_DIRS} ${glibmm_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR})
+ENDIF(libxml++config_INCLUDE_DIR)

 ENDIF(GLIBMM_FOUND AND LIBXML2_FOUND)


Use the FindGrantlee from the current grantlee git tree.

svn path=/branches/work/akonadi-ports/kdepim/; revision=1035254

--- cmake/modules/FindGrantlee.cmake
+++ cmake/modules/FindGrantlee.cmake
@@ -1,12 +1,140 @@
+###### LibFindMacro.cmake -- from http://zi.fi/cmake/Modules/LibFindMacros.cmake
+# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
+# used for the current package. For this to work, the first parameter must be the
+# prefix of the current package, then the prefix of the new package etc, which are
+# passed to find_package.
+macro (libfind_package PREFIX)
+  set (LIBFIND_PACKAGE_ARGS ${ARGN})
+  if (${PREFIX}_FIND_QUIETLY)
+    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
+  endif (${PREFIX}_FIND_QUIETLY)
+  if (${PREFIX}_FIND_REQUIRED)
+    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
+  endif (${PREFIX}_FIND_REQUIRED)
+  find_package(${LIBFIND_PACKAGE_ARGS})
+endmacro (libfind_package)

-find_package(Qt4 REQUIRED)
+# Damn CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
+# where they added pkg_check_modules. Consequently I need to support both in my scripts
+# to avoid those deprecated warnings. Here's a helper that does just that.
+# Works identically to pkg_check_modules, except that no checks are needed prior to use.
+macro (libfind_pkg_check_modules PREFIX PKGNAME)
+  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+    include(UsePkgConfig)
+    pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
+  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+    find_package(PkgConfig)
+    if (PKG_CONFIG_FOUND)
+      pkg_check_modules(${PREFIX} ${PKGNAME})
+    endif (PKG_CONFIG_FOUND)
+  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
+endmacro (libfind_pkg_check_modules)

-find_path(GRANTLEE_INCLUDE_DIR NAMES grantlee/grantlee.h )
+# Do the final processing once the paths have been detected.
+# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
+# all the variables, each of which contain one include directory.
+# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
+# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
+# Also handles errors in case library detection was required, etc.
+macro (libfind_process PREFIX)
+  # Skip processing if already processed during this run
+  if (NOT ${PREFIX}_FOUND)
+    # Start with the assumption that the library was found
+    set (${PREFIX}_FOUND TRUE)

-find_library(GRANTLEE_LIBRARY NAMES grantlee_core_library )
+    # Process all includes and set _FOUND to false if any are missing
+    foreach (i ${${PREFIX}_PROCESS_INCLUDES})
+      if (${i})
+        set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
+        mark_as_advanced(${i})
+      else (${i})
+        set (${PREFIX}_FOUND FALSE)
+      endif (${i})
+    endforeach (i)

-if( GRANTLEE_LIBRARY AND GRANTLEE_INCLUDE_DIR )
-  set(Grantlee_FOUND true)
-  set(GRANTLEE_LIBRARIES ${GRANTLEE_LIBRARY} )
-endif( GRANTLEE_LIBRARY AND GRANTLEE_INCLUDE_DIR  )
+    # Process all libraries and set _FOUND to false if any are missing
+    foreach (i ${${PREFIX}_PROCESS_LIBS})
+      if (${i})
+        set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
+        mark_as_advanced(${i})
+      else (${i})
+        set (${PREFIX}_FOUND FALSE)
+      endif (${i})
+    endforeach (i)

+    # Print message and/or exit on fatal error
+    if (${PREFIX}_FOUND)
+      if (NOT ${PREFIX}_FIND_QUIETLY)
+        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
+      endif (NOT ${PREFIX}_FIND_QUIETLY)
+    else (${PREFIX}_FOUND)
+      if (${PREFIX}_FIND_REQUIRED)
+        foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
+          message("${i}=${${i}}")
+        endforeach (i)
+        message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
+      endif (${PREFIX}_FIND_REQUIRED)
+    endif (${PREFIX}_FOUND)
+  endif (NOT ${PREFIX}_FOUND)
+endmacro (libfind_process)
+
+macro(libfind_library PREFIX basename)
+  set(TMP "")
+  if(MSVC80)
+    set(TMP -vc80)
+  endif(MSVC80)
+  if(MSVC90)
+    set(TMP -vc90)
+  endif(MSVC90)
+  set(${PREFIX}_LIBNAMES ${basename}${TMP})
+  if(${ARGC} GREATER 2)
+    set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
+    string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
+    set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
+  endif(${ARGC} GREATER 2)
+  find_library(${PREFIX}_LIBRARY
+    NAMES ${${PREFIX}_LIBNAMES}
+    PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
+  )
+endmacro(libfind_library)
+###### End
+
+
+# - Try to find Grantlee
+# Once done, this will define
+#
+#  Grantlee_FOUND - system has Grantlee
+#  Grantlee_INCLUDE_DIRS - the Grantlee include directories
+#  Grantlee_LIBRARIES - link these to use Grantlee
+
+# Grantlee depends on Qt, find it
+libfind_package(Grantlee Qt4)
+# Do not use QtGui. Applications using QtGui module can override this
+set(QT_DONT_USE_QTGUI 1)
+include(${QT_USE_FILE})
+
+# Include dir
+find_path(Grantlee_INCLUDE_DIR
+  NAMES grantlee/grantlee.h
+  PATHS ${CMAKE_INCLUDE_PATH}
+    ${GRANTLEE_INCLUDE_PATH}
+)
+
+# Finally the library itself
+find_library(Grantlee_LIBRARY
+  NAMES grantlee_core_library
+  PATHS ${CMAKE_LIBRARY_PATH}
+    ${GRANTLEE_LIBRARY_PATH}
+)
+
+# Set the include dir variables and the libraries and let libfind_process do the rest.
+# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
+set(Grantlee_PROCESS_INCLUDES Grantlee_INCLUDE_DIR QT_INCLUDES)
+set(Grantlee_PROCESS_LIBS Grantlee_LIBRARY QT_LIBRARIES)
+libfind_process(Grantlee)
+
+if (Grantlee_FOUND)
+  string(REGEX REPLACE "/[^/]*$" "/grantlee/" GRANTLEE_PLUGIN_PATH ${Grantlee_LIBRARY} )
+endif(Grantlee_FOUND)
+
+


[cmake] Support architecture name on OpenBSD.

x86_64 is spelled "amd64" on this platform. Return "amd64", for
consistency with Swift and other projects.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -23,6 +23,8 @@
     set("${result_var_name}" "armv7" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7-a")
     set("${result_var_name}" "armv7" PARENT_SCOPE)
+  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "amd64")
+    set("${result_var_name}" "amd64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
     set("${result_var_name}" "x86_64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "IA64")


Changed the svg driver to be on by default.

svn path=/trunk/; revision=7320

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -94,7 +94,7 @@
 "psttf:psttf:ON"
 "xterm:tek:OFF" "tek4010:tek:OFF" "tek4107:tek:OFF" "mskermit:tek:OFF"
 "versaterm:tek:OFF" "vlt:tek:OFF" "conex:tek:OFF" "tek4010f:tek:OFF"
-"svg:svg:OFF"
+"svg:svg:ON"
 "tek4107f:tek:OFF"
 "tk:tk:ON"
 "tkwin:tkwin:ON"


Force the patches to be applied in order again!

   While the list was sorted, this change serialize the application
   of the patches.

   Moved the disply to the actual application of the patch not
   the configuration step.

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -268,21 +268,23 @@
 	add_custom_target(nuttx_copy_${CONFIG} DEPENDS ${PX4_BINARY_DIR}/nuttx_copy_${CONFIG}.stamp)

 	# patch
+    unset (last_patch )
 	add_custom_target(nuttx_patch_${CONFIG})
 	foreach(patch ${nuttx_patches})
 		get_filename_component(patch_file_name ${patch} NAME)
-		message(STATUS "${CONFIG} NuttX patch: nuttx-patches/${patch_file_name}")
 		string(REPLACE "/" "_" patch_name "nuttx_patch_${patch_file_name}-${CONFIG}")
 		set(patch_stamp ${nuttx_src}/${patch_name}.stamp)

 		add_custom_command(OUTPUT ${patch_stamp}
 			COMMAND ${PATCH} -d ${nuttx_src} -s -p1 -N < ${patch}
 			COMMAND ${TOUCH} ${patch_stamp}
-			DEPENDS ${DEPENDS} nuttx_copy_${CONFIG} ${patch}
-			COMMENT "Applying ${patch}")
+			DEPENDS ${last_patch} ${DEPENDS} nuttx_copy_${CONFIG} ${patch}
+			USES_TERMINAL
+			COMMENT "${CONFIG} Applying NuttX patch: nuttx-patches/${patch_file_name}")

 		add_custom_target(${patch_name} DEPENDS ${patch_stamp})
 		add_dependencies(nuttx_patch_${CONFIG} ${patch_name})
+        set (last_patch ${patch_name})
 	endforeach()

 	# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes


Added support for ios-ntp

Added support for ios-ntp

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -202,6 +202,7 @@
 add_target(ICU icu)
 add_target(IMAGEMAGICK imagemagick)
 add_target(IMAP_2007F imap-2007f)
+add_target(IOS_NTP ios_ntp)
 add_target(ISO_3166 iso_3166)
 add_target(ISO_639 iso_639)
 add_target(ISO_COUNTRY_FLAGS iso-country-flags)
@@ -349,6 +350,7 @@
 set_libraries(icu_test ${ICU_PREFIX}/lib icutest)
 set_libraries(icu_tu ${ICU_PREFIX}/lib icutu)
 set_libraries(icu_uc ${ICU_PREFIX}/lib icuuc)
+set_libraries(ios_ntp ${IOS_NTP_PREFIX}/lib ios_ntp)
 set_libraries(imagemagick ${IMAGEMAGICK_PREFIX}/lib
               Magick++ MagickCore MagickWand)
 set_libraries(jsoncpp ${JSONCPP_PREFIX}/lib jsoncpp)
@@ -544,6 +546,7 @@
 add_library_dependencies(boost_iostreams ${BZ2_LIB})
 add_framework_dependencies(formatter_kit AddressBook AddressBookUI CoreLocation)
 add_library_dependencies(gtest pthread)
+add_framework_dependencies(ios_ntp CFNetwork CoreGraphics UIKit)
 add_library_dependencies(openssl third_party.gmp)
 add_library_dependencies(libcurl third_party.zlib)
 if (NOT APPLE)
@@ -665,6 +668,8 @@
 set_include_directories(httpxx ${HTTPXX_PREFIX}/include)
 set_include_directories(icu ${ICU_PREFIX}/include)
 set_include_directories(imagemagick ${IMAGEMAGICK_PREFIX}/include/ImageMagick-6)
+set_include_directories(
+    ios_ntp ${IOS_NTP_PREFIX}/include ${IOS_NTP_PREFIX}/include/ios-ntp)
 set_include_directories(jsoncpp ${JSONCPP_PREFIX}/include)
 set_include_directories(libcurl ${LIBCURL_PREFIX}/include)
 set_include_directories(libcxx ${LIBCXX_PREFIX}/include/c++/v1)
@@ -2017,6 +2022,42 @@
 add_dependencies(${IMAGEMAGICK_TARGET} ${LIBRSVG_TARGET})
 add_dependencies(${IMAGEMAGICK_TARGET} ${PANGO_TARGET})
 endif ()
+
+################################################################################
+# ios-ntp.
+set(DOWNLOAD_TARGET ${IOS_NTP_TARGET}_download)
+add_external_project(
+  ${DOWNLOAD_TARGET}
+  PREFIX ${IOS_NTP_PREFIX}
+  DOWNLOAD_COMMAND
+      ${GIT} clone --depth 1 git://github.com/jbenet/ios-ntp.git
+          ${DOWNLOAD_TARGET}
+  CONFIGURE_COMMAND ${NOP}
+  BUILD_COMMAND ${NOP}
+  INSTALL_COMMAND
+      cd <SOURCE_DIR>/src &&
+      find . -name "*.h" | cpio -dp <INSTALL_DIR>/include/ios-ntp &&
+      cd <SOURCE_DIR>/lib &&
+      find . -name "*.h" | cpio -dp <INSTALL_DIR>/include/ios-ntp)
+ExternalProject_Get_Property(${DOWNLOAD_TARGET} SOURCE_DIR)
+set(SRCS
+    ${SOURCE_DIR}/lib/GCDAsyncUdpSocket.m
+    ${SOURCE_DIR}/src/NSDate+NetworkClock.m
+    ${SOURCE_DIR}/src/NetAssociation.m
+    ${SOURCE_DIR}/src/NetworkClock.m)
+set_source_files_properties(${SRCS} PROPERTIES GENERATED TRUE)
+objc_library(${IOS_NTP_TARGET} ${SRCS})
+link_framework(${IOS_NTP_TARGET} CFNetwork CoreGraphics UIKit)
+target_include_directories(${IOS_NTP_TARGET} PUBLIC ${SOURCE_DIR}/lib)
+set_target_properties(
+    ${IOS_NTP_TARGET} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY ${IOS_NTP_PREFIX}/lib
+    LIBRARY_OUTPUT_DIRECTORY ${IOS_NTP_PREFIX}/lib
+    COMPILE_FLAGS
+        "-fno-objc-arc -include ${SOURCE_DIR}/resources/ios-ntp-Prefix.pch"
+    OUTPUT_NAME ios_ntp)
+add_dependencies(${IOS_NTP_TARGET} ${DOWNLOAD_TARGET})
+set(IOS_NTP_HOSTS ${SOURCE_DIR}/resources/ntp.hosts)

 ################################################################################
 # IMAP-2007f. TODO(qfiard): Make portable.


Ported libcxxabi to iOS

Ported libcxxabi to iOS

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1785,7 +1785,22 @@
 ################################################################################
 # libcxxabi.
 ExternalProject_Get_Property(${LIBCXX_TARGET} SOURCE_DIR)
-set(LIBCXXABI_OPTIONS "-I${SOURCE_DIR}/include")
+set(LIBCXXABI_OPTIONS "-I${SOURCE_DIR}/include ${ARCHS_AS_FLAGS}")
+if (APPLE AND NOT "${CMAKE_OSX_SYSROOT}" STREQUAL "")
+  set(LIBCXXABI_OPTIONS "${LIBCXXABI_OPTIONS} --sysroot ${CMAKE_OSX_SYSROOT}")
+endif ()
+set(LIBCXXABI_BUILD_COMMAND
+    "cd <INSTALL_DIR>/lib &&\
+     CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}\
+     OPTIONS=\"${LIBCXXABI_OPTIONS}\"")
+set(LIBCXXABI_BUILD_COMMAND_END "./buildit")
+if (BUILD_SHARED_LIBS)
+  set(LIBCXXABI_BUILD_COMMAND_END
+      "${LIBCXXABI_BUILD_COMMAND_END} && ln -sf libcxxabi.1.0.dylib libcxxabi.dylib")
+else ()
+  set(LIBCXXABI_BUILD_COMMAND "${LIBCXXABI_BUILD_COMMAND} BUILD_STATIC=1")
+endif ()
+set(LIBCXXABI_BUILD_COMMAND "${LIBCXXABI_BUILD_COMMAND} ${LIBCXXABI_BUILD_COMMAND_END}")
 add_external_project(
   ${LIBCXXABI_TARGET}
   PREFIX ${LIBCXXABI_PREFIX}
@@ -1794,11 +1809,7 @@
   PATCH_COMMAND
     cd <INSTALL_DIR>/lib && patch -p0 < ${THIRD_PARTY_SOURCE_DIR}/libcxxabi.patch
   CONFIGURE_COMMAND ${NOP}
-  BUILD_COMMAND
-    cd <INSTALL_DIR>/lib &&
-    CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER}
-    OPTIONS=${LIBCXXABI_OPTIONS} ./buildit &&
-    ln -s libc++abi.1.0.dylib libc++abi.dylib
+  BUILD_COMMAND echo ${LIBCXXABI_BUILD_COMMAND} | sh
   INSTALL_COMMAND ${NOP})
 add_external_project_step(${LIBCXXABI_TARGET} set_install_names
   COMMAND


Added support for FormatterKit

Added support for FormatterKit

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -180,6 +180,7 @@
 add_target(FAST_IMAGE_CACHE fast_image_cache)
 add_target(FB_GALLERY fb_gallery)
 add_target(FLEX flex)
+add_target(FORMATTER_KIT formatter_kit)
 add_target(FREETYPE freetype)
 add_target(G2LOG g2log)
 add_target(GCC gcc)
@@ -330,6 +331,7 @@
 set_libraries(fast_image_cache ${FAST_IMAGE_CACHE_PREFIX}/lib fast_image_cache)
 set_libraries(fb_gallery ${FB_GALLERY_PREFIX}/lib fb_gallery)
 set_libraries(flex ${FLEX_PREFIX}/lib fl)
+set_libraries(formatter_kit ${FORMATTER_KIT_PREFIX}/lib formatter_kit)
 set_libraries(freetype ${FREETYPE_PREFIX}/lib freetype)
 set_libraries(g2log ${G2LOG_PREFIX}/lib lib_activeobject lib_g2logger)
 set_libraries(gflags ${GFLAGS_PREFIX}/lib gflags)
@@ -540,6 +542,7 @@
 add_library_dependencies(boost_log third_party.boost_filesystem)
 add_library_dependencies(boost_thread third_party.boost_atomic)
 add_library_dependencies(boost_iostreams ${BZ2_LIB})
+add_framework_dependencies(formatter_kit AddressBook AddressBookUI CoreLocation)
 add_library_dependencies(gtest pthread)
 add_library_dependencies(openssl third_party.gmp)
 add_library_dependencies(libcurl third_party.zlib)
@@ -651,6 +654,7 @@
 set_include_directories(fast_image_cache ${FAST_IMAGE_CACHE_PREFIX}/include)
 set_include_directories(fb_gallery ${FB_GALLERY_PREFIX}/include)
 set_include_directories(flex ${FLEX_PREFIX}/include)
+set_include_directories(formatter_kit ${FORMATTER_KIT_PREFIX}/include)
 set_include_directories(freetype ${FREETYPE_PREFIX}/include)
 set_include_directories(g2log ${G2LOG_PREFIX}/include)
 set_include_directories(gflags ${GFLAGS_PREFIX}/include)
@@ -1444,6 +1448,42 @@
   CONFIGURE_COMMAND ./configure --prefix=${FLEX_PREFIX} ${HOST} ${SYSROOT}
   BUILD_IN_SOURCE 1)
 set(FLEX_EXECUTABLE ${FLEX_PREFIX}/bin/flex++)
+
+################################################################################
+# FormatterKit.
+set(DOWNLOAD_TARGET ${FORMATTER_KIT_TARGET}_download)
+add_external_project(
+  ${DOWNLOAD_TARGET}
+  PREFIX ${FORMATTER_KIT_PREFIX}
+  DOWNLOAD_COMMAND
+      ${GIT} clone --depth 1 git://github.com/QuentinFiard/FormatterKit.git
+          ${DOWNLOAD_TARGET}
+  CONFIGURE_COMMAND ${NOP}
+  BUILD_COMMAND ${NOP}
+  INSTALL_COMMAND
+      cd <SOURCE_DIR> &&
+      find FormatterKit -name "*.h" | cpio -dp <INSTALL_DIR>/include)
+ExternalProject_Get_Property(${DOWNLOAD_TARGET} SOURCE_DIR)
+set(SOURCE_DIR2 ${SOURCE_DIR}/FormatterKit)
+set(SRCS
+    ${SOURCE_DIR2}/TTTAddressFormatter.m
+    ${SOURCE_DIR2}/TTTArrayFormatter.m
+    ${SOURCE_DIR2}/TTTColorFormatter.m
+    ${SOURCE_DIR2}/TTTLocationFormatter.m
+    ${SOURCE_DIR2}/TTTOrdinalNumberFormatter.m
+    ${SOURCE_DIR2}/TTTTimeIntervalFormatter.m
+    ${SOURCE_DIR2}/TTTUnitOfInformationFormatter.m
+    ${SOURCE_DIR2}/TTTURLRequestFormatter.m)
+set_source_files_properties(${SRCS} PROPERTIES GENERATED TRUE)
+objc_library(${FORMATTER_KIT_TARGET} ${SRCS})
+link_framework(${FORMATTER_KIT_TARGET} AddressBook AddressBookUI CoreLocation)
+set_target_properties(
+    ${FORMATTER_KIT_TARGET} PROPERTIES
+    ARCHIVE_OUTPUT_DIRECTORY ${FORMATTER_KIT_PREFIX}/lib
+    LIBRARY_OUTPUT_DIRECTORY ${FORMATTER_KIT_PREFIX}/lib
+    OUTPUT_NAME formatter_kit)
+add_dependencies(${FORMATTER_KIT_TARGET} ${DOWNLOAD_TARGET})
+set(FORMATTER_KIT_LOCALIZATIONS ${SOURCE_DIR}/Localizations)

 ################################################################################
 # Freetype.


Fixed indirect target referencing for Python and Java

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -97,13 +97,15 @@

 function(add_target OUT NAME)
   set(${OUT}_PREFIX ${THIRD_PARTY_BINARY_DIR}/${NAME} PARENT_SCOPE)
-  set(${OUT}_TARGET third_party.${NAME}_target PARENT_SCOPE)
+  set(TARGET third_party.${NAME}_target)
+  set(${OUT}_TARGET ${TARGET} PARENT_SCOPE)
+  set(${TARGET} ${TARGET} PARENT_SCOPE)
 endfunction()

 macro(set_libraries NAME DIR)
-  set(FULL_NAME third_party.${NAME})
   # Defines the target of the library, by default it is equal to the name of
   # library suffixed with _target.
+  set(FULL_NAME third_party.${NAME})
   set(${FULL_NAME}_target ${FULL_NAME}_target)
   set(third_party.${NAME})
   if (BUILD_SHARED_LIBS AND NOT "${DIR}" STREQUAL "")


CELIX-418: disable building docker dir in osx

--- cmake/cmake_celix/DockerPackaging.cmake
+++ cmake/cmake_celix/DockerPackaging.cmake
@@ -130,7 +130,7 @@
                 INPUT "${LAUNCHER_STAGE1}"
         )

-        add_executable(${DOCKER_TARGET} ${LAUNCHER_SRC})
+        add_executable(${DOCKER_TARGET} EXCLUDE_FROM_ALL ${LAUNCHER_SRC})
         #   set_target_properties(${DOCKER_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${DOCKER_LOC})
         target_include_directories(${DOCKER_TARGET} PRIVATE ${CELIX_INCLUDE_DIRS})
         target_link_libraries(${DOCKER_TARGET} PRIVATE ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})


ORC-1036: Support dynamic download of the latest tzdata based on sha512.sum file (#948)

### What changes were proposed in this pull request?

Due to tzdata upgrade, the fixed download links in CI are often not working.
This pr is aimed at supporting dynamic downloads of the latest tzdata based on the sha512.sum file.

### Why are the changes needed?

Avoid CI not working when tzdata releases a new version.

### How was this patch tested?

Pass the CIs.

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -274,14 +274,35 @@
 # IANA - Time Zone Database

 if (WIN32)
-  ExternalProject_Add(tzdata_ep
-    URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2021b-1.tar.xz"
-    URL_HASH MD5=d0de6f00f5a37ee211cfabeae9eb0937
-    CONFIGURE_COMMAND ""
-    BUILD_COMMAND ""
-    INSTALL_COMMAND "")
-  ExternalProject_Get_Property(tzdata_ep SOURCE_DIR)
-  set(TZDATA_DIR ${SOURCE_DIR}/share/zoneinfo)
+  SET(CURRENT_TZDATA_FILE "")
+  SET(CURRENT_TZDATA_SHA512 "")
+  File(DOWNLOAD "http://ftp.osuosl.org/pub/cygwin/noarch/release/tzdata/sha512.sum" ${CMAKE_CURRENT_BINARY_DIR}/sha512.sum)
+  File(READ ${CMAKE_CURRENT_BINARY_DIR}/sha512.sum TZDATA_SHA512_CONTENT)
+  string(REPLACE "\n" ";" TZDATA_SHA512_LINE ${TZDATA_SHA512_CONTENT})
+  foreach (LINE IN LISTS TZDATA_SHA512_LINE)
+      if (LINE MATCHES ".tar.xz$" AND (NOT LINE MATCHES "src.tar.xz$"))
+          string(REPLACE " " ";" FILE_ARGS ${LINE})
+          list (GET FILE_ARGS 0 FILE_SHA512)
+          list (GET FILE_ARGS 2 FILE_NAME)
+          if (FILE_NAME STRGREATER CURRENT_TZDATA_FILE)
+              SET(CURRENT_TZDATA_FILE ${FILE_NAME})
+              SET(CURRENT_TZDATA_SHA512 ${FILE_SHA512})
+          endif()
+      endif()
+  endforeach()
+
+  if (NOT "${CURRENT_TZDATA_FILE}" STREQUAL "")
+    ExternalProject_Add(tzdata_ep
+      URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/${CURRENT_TZDATA_FILE}"
+      URL_HASH SHA512=${CURRENT_TZDATA_SHA512}
+      CONFIGURE_COMMAND ""
+      BUILD_COMMAND ""
+      INSTALL_COMMAND "")
+    ExternalProject_Get_Property(tzdata_ep SOURCE_DIR)
+    set(TZDATA_DIR ${SOURCE_DIR}/share/zoneinfo)
+  else()
+    message(STATUS "WARNING: tzdata were not found")
+  endif()
 endif ()

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


Update googlebenchmark to 1.6.1 (#86)

Update googlebenchmark to 1.6.1 (#86)

--- cmake/DownloadGoogleBenchmark.cmake
+++ cmake/DownloadGoogleBenchmark.cmake
@@ -4,8 +4,8 @@

 INCLUDE(ExternalProject)
 ExternalProject_Add(googlebenchmark
-	URL https://github.com/google/benchmark/archive/v1.2.0.zip
-	URL_HASH SHA256=cc463b28cb3701a35c0855fbcefb75b29068443f1952b64dd5f4f669272e95ea
+	URL https://github.com/google/benchmark/archive/v1.6.1.zip
+	URL_HASH SHA256=367e963b8620080aff8c831e24751852cffd1f74ea40f25d9cc1b667a9dd5e45
 	SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark"
 	BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark"
 	CONFIGURE_COMMAND ""


modern cmake - create library import target

--- cmake/Modules/LimeSuiteConfig.cmake
+++ cmake/Modules/LimeSuiteConfig.cmake
@@ -9,6 +9,8 @@
 # The following will be set after find_package(LimeSuite):
 # LimeSuite_LIBRARIES    - development libraries
 # LimeSuite_INCLUDE_DIRS - development includes
+#
+# Or link with the import library target LimeSuite
 ########################################################################

 ########################################################################
@@ -43,3 +45,9 @@
 endif()
 set(LimeSuite_INCLUDE_DIRS ${LIMESUITE_INCLUDE_DIR})

+########################################################################
+## create import library target
+########################################################################
+add_library(LimeSuite SHARED IMPORTED)
+set_property(TARGET LimeSuite PROPERTY IMPORTED_LOCATION ${LIMESUITE_LIBRARY})
+set_property(TARGET LimeSuite PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIMESUITE_INCLUDE_DIR})


[cmake] shuffles -O0 around

[cmake] shuffles -O0 around

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -71,11 +71,11 @@
 SET( CMAKE_CXX_FLAGS "-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS=1 ${CMAKE_CXX_FLAGS}" )

 SET( CMAKE_CXX_FLAGS_DEBUG
-  "-DDNDEBUG -g3 -ggdb -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Wundef -Wnon-virtual-dtor -ftemplate-backtrace-limit=0 ${CMAKE_CXX_FLAGS_DEBUG}")
+  "-O0 -DDNDEBUG -g3 -ggdb -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Wundef -Wnon-virtual-dtor -ftemplate-backtrace-limit=0 ${CMAKE_CXX_FLAGS_DEBUG}")

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
         set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING
-        "-Wnon-literal-null-conversion -Wused-but-marked-unused -Wno-tautological-compare -Wfloat-equal -Wdisabled-macro-expansion -Wcovered-switch-default -Wswitch-enum -Wunreachable-code -Wshorten-64-to-32 -O0 ${CMAKE_CXX_FLAGS_DEBUG}"
+        "-Wnon-literal-null-conversion -Wused-but-marked-unused -Wno-tautological-compare -Wfloat-equal -Wdisabled-macro-expansion -Wcovered-switch-default -Wswitch-enum -Wunreachable-code -Wshorten-64-to-32  ${CMAKE_CXX_FLAGS_DEBUG}"
         )
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
         set( CMAKE_CXX_FLAGS_DEBUG CACHE STRING


Fixed issue which caused architecture name for x86 to always be uppercase

Change-Id: I1324d8d0998d0e5d2441e82b8f98f94c8faa44c0
Reviewed-on: https://wn-project.dnsalias.net/gerrit/150
Try: Devon Powell <bef84a74f4a3947934cc58306a6aae518eaf1936@gmail.com>
Tested-by: WNBot <efa0942020584fb66fb8bea377b59e48fa0f85ef@gmail.com>
Reviewed-by: Andrew Woloszyn <2926f0436f8103ab8257713335cf26447d8bf68a@google.com>

--- Utilities/CMake/determine_architecture.cmake
+++ Utilities/CMake/determine_architecture.cmake
@@ -85,10 +85,10 @@
   # check for architectures using preprocessor symbols. Symbol list names must
   # match the format [architecture, all caps, alphanumeric and _ only]_SYMBOLS.
   foreach(ARCHITECTURE ${ARCHITECTURE_LIST})
-    wn_make_preprocessor_symbol(${ARCHITECTURE} ARCHITECTURE)
+    wn_make_preprocessor_symbol(${ARCHITECTURE} SANITIZE_ARCHITECTURE)

-    set(ARCHITECTURE_SYMBOL_LIST_NAME ${ARCHITECTURE}_SYMBOLS)
-    set(ARCHITECTURE_HAS_VARIABLE_NAME HAS_${ARCHITECTURE}_SYMBOL)
+    set(ARCHITECTURE_SYMBOL_LIST_NAME ${SANITIZE_ARCHITECTURE}_SYMBOLS)
+    set(ARCHITECTURE_HAS_VARIABLE_NAME HAS_${SANITIZE_ARCHITECTURE}_SYMBOL)

     wn_check_any_symbol_exists(
       ${ARCHITECTURE_SYMBOL_LIST_NAME}
@@ -97,6 +97,7 @@

     if (${ARCHITECTURE_HAS_VARIABLE_NAME})
       set(WN_ARCHITECTURE ${ARCHITECTURE})
+
       break()
     endif()
   endforeach()


modules: libGLESv3 actually really exists.

The world is actually sane.

--- modules/FindOpenGLES3.cmake
+++ modules/FindOpenGLES3.cmake
@@ -34,7 +34,11 @@

 # Library
 find_library(OPENGLES3_LIBRARY NAMES
-    GLESv2) # wtf?
+    GLESv3
+
+    # On some platforms (e.g. desktop emulation with Mesa or NVidia) ES3
+    # support is provided in ES2 lib
+    GLESv2)

 # Include dir
 find_path(OPENGLES3_INCLUDE_DIR


cmake(python): handle PYTHON3_LIMITED_API

- python-3.x => python-3
- config-3.x.py => config-3.py

--- modules/python/common.cmake
+++ modules/python/common.cmake
@@ -164,7 +164,12 @@
   endif()
 else()
   ocv_assert(DEFINED OPENCV_PYTHON_INSTALL_PATH)
-  set(__python_binary_install_path "${OPENCV_PYTHON_INSTALL_PATH}/${__python_loader_subdir}python-${${PYTHON}_VERSION_MAJOR}.${${PYTHON}_VERSION_MINOR}")
+  if(${PYTHON}_LIMITED_API)
+    set(__python_binary_subdir "python-${${PYTHON}_VERSION_MAJOR}")
+  else()
+    set(__python_binary_subdir "python-${${PYTHON}_VERSION_MAJOR}.${${PYTHON}_VERSION_MINOR}")
+  endif()
+  set(__python_binary_install_path "${OPENCV_PYTHON_INSTALL_PATH}/${__python_loader_subdir}${__python_binary_subdir}")
 endif()

 install(TARGETS ${the_module}
@@ -192,7 +197,7 @@
     set(CMAKE_PYTHON_EXTENSION_INSTALL_PATH_BASE "LOADER_DIR")
   endif()

-  if(DEFINED ${PYTHON}_VERSION_MINOR)
+  if(DEFINED ${PYTHON}_VERSION_MINOR AND NOT ${PYTHON}_LIMITED_API)
     set(__target_config "config-${${PYTHON}_VERSION_MAJOR}.${${PYTHON}_VERSION_MINOR}.py")
   else()
     set(__target_config "config-${${PYTHON}_VERSION_MAJOR}.py")


enh: Use PROJECT_PACKAGE_NAME_L instead of hard-coded "mirtk" string [CMake]

--- CMake/Modules/mirtkAddExecutable.cmake
+++ CMake/Modules/mirtkAddExecutable.cmake
@@ -40,11 +40,11 @@
   endif ()
   # Add executable target
   set(LANGUAGE CXX)
-  set(BINARY_LIBEXEC_DIR "${TOPLEVEL_BINARY_LIBEXEC_DIR}/mirtk")
-  if (TOPLEVEL_INSTALL_LIBEXEC_DIR MATCHES "/mirtk/*$")
+  set(BINARY_LIBEXEC_DIR "${TOPLEVEL_BINARY_LIBEXEC_DIR}/${PROJECT_PACKAGE_NAME_L}")
+  if (TOPLEVEL_INSTALL_LIBEXEC_DIR MATCHES "/${PROJECT_PACKAGE_NAME_L}/*$")
     set(INSTALL_LIBEXEC_DIR "${TOPLEVEL_INSTALL_LIBEXEC_DIR}")
   else ()
-    set(INSTALL_LIBEXEC_DIR "${TOPLEVEL_INSTALL_LIBEXEC_DIR}/mirtk")
+    set(INSTALL_LIBEXEC_DIR "${TOPLEVEL_INSTALL_LIBEXEC_DIR}/${PROJECT_PACKAGE_NAME_L}")
   endif ()
   if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${target_name}.cc")
     basis_add_executable(${target_name}.cc ${TARGET_SOURCES} LIBEXEC)


fix configure error when BUILD_TESTING is turned off

--- CMakeExternals/RExternalPackages.cmake
+++ CMakeExternals/RExternalPackages.cmake
@@ -14,13 +14,17 @@
   @ONLY
 )

+if(BUILD_TESTING)
+  set(depends "VisomicsData")
+endif()
+
 add_custom_target(${target} ALL
   COMMAND ${CMAKE_COMMAND}
    -DR_cmd=${R_cmd}
    "-DR_cmd_args=${R_cmd_args}"
    -DR_output_name=${R_output_name}
    -P ${CMAKE_SOURCE_DIR}/Utilities/GetRExternalPackages.cmake
-  DEPENDS VisomicsData
+  DEPENDS ${depends}
   COMMENT "Installing external R packages"
   VERBATIM
   )


cmake: Configure the ThinLTO cache directory when using ELF lld or gold.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -715,11 +715,20 @@
   if(NOT LINKER_IS_LLD_LINK)
     append("-flto=thin" CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
   endif()
-  # On darwin, enable the lto cache. This improves initial build time a little
-  # since we re-link a lot of the same objects, and significantly improves
-  # incremental build time.
-  append_if(APPLE "-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
-            CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  # If the linker supports it, enable the lto cache. This improves initial build
+  # time a little since we re-link a lot of the same objects, and significantly
+  # improves incremental build time.
+  # FIXME: We should move all this logic into the clang driver.
+  if(APPLE)
+    append("-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  elseif(UNIX AND LLVM_USE_LINKER STREQUAL "lld")
+    append("-Wl,--thinlto-cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  elseif(LLVM_USE_LINKER STREQUAL "gold")
+    append("-Wl,--plugin-opt,cache-dir=${PROJECT_BINARY_DIR}/lto.cache"
+           CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+  endif()
 elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
   append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   if(NOT LINKER_IS_LLD_LINK)


[CMake] Put -Werror to CMAKE_CXX_FLAGS instead of using add_llvm_definitions()

add_definitions shouldn't really be used for compiler flags, and the variable
LLVM_DEFINITIONS is not appropriately used at the moment, e.g. it's not exported
to LLVMConfig.cmake

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -307,9 +307,7 @@
     check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor" CXX_SUPPORTS_NON_VIRTUAL_DTOR_FLAG)
     append_if(CXX_SUPPORTS_NON_VIRTUAL_DTOR_FLAG "-Wnon-virtual-dtor" CMAKE_CXX_FLAGS)
   endif (LLVM_ENABLE_WARNINGS)
-  if (LLVM_ENABLE_WERROR)
-    add_llvm_definitions( -Werror )
-  endif (LLVM_ENABLE_WERROR)
+  append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   if (LLVM_ENABLE_CXX1Y)
     check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
     append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)


pw_build/cmake: Extend pw_add_module_library

Extends pw_add_module_library to include link and compile options.

Change-Id: I3cc85a3e02a8589ef2cf5310bf2a279c320ac69d
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/79380
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -166,17 +166,27 @@
 #
 #   SOURCES - source files for this library
 #   HEADERS - header files for this library
-#   PUBLIC_INCLUDES - public target_include_directories argument.
-#   PRIVATE_INCLUDES - public target_include_directories argument.
 #   PUBLIC_DEPS - public target_link_libraries arguments
 #   PRIVATE_DEPS - private target_link_libraries arguments
+#   PUBLIC_INCLUDES - public target_include_directories argument
+#   PRIVATE_INCLUDES - public target_include_directories argument
 #   IMPLEMENTS_FACADES - which facades this library implements
 #   PUBLIC_DEFINES - public target_compile_definitions arguments
 #   PRIVATE_DEFINES - private target_compile_definitions arguments
+#   PUBLIC_COMPILE_OPTIONS - public target_compile_options arguments
+#   PRIVATE_COMPILE_OPTIONS - private target_compile_options arguments
+#   PUBLIC_LINK_OPTIONS - public target_link_options arguments
+#   PRIVATE_LINK_OPTIONS - private target_link_options arguments
 #
 function(pw_add_module_library NAME)
-  _pw_library_args(list_args PUBLIC_INCLUDES PRIVATE_INCLUDES IMPLEMENTS_FACADES
-                   PUBLIC_DEFINES PRIVATE_DEFINES)
+  _pw_library_args(
+      list_args
+          PUBLIC_INCLUDES PRIVATE_INCLUDES
+          IMPLEMENTS_FACADES
+          PUBLIC_DEFINES PRIVATE_DEFINES
+          PUBLIC_COMPILE_OPTIONS PRIVATE_COMPILE_OPTIONS
+          PUBLIC_LINK_OPTIONS PRIVATE_LINK_OPTIONS
+  )
   _pw_parse_argv_strict(pw_add_module_library 1 "" "" "${list_args}")

   # Check that the library's name is prefixed by the module name.
@@ -231,6 +241,22 @@

   if(NOT "${arg_PRIVATE_DEFINES}" STREQUAL "")
     target_compile_definitions("${NAME}" PRIVATE ${arg_PRIVATE_DEFINES})
+  endif()
+
+  if(NOT "${arg_PUBLIC_COMPILE_OPTIONS}" STREQUAL "")
+    target_compile_options("${NAME}" PUBLIC ${arg_PUBLIC_COMPILE_OPTIONS})
+  endif()
+
+  if(NOT "${arg_PRIVATE_COMPILE_OPTIONS}" STREQUAL "")
+    target_compile_options("${NAME}" PRIVATE ${arg_PRIVATE_COMPILE_OPTIONS})
+  endif()
+
+  if(NOT "${arg_PUBLIC_LINK_OPTIONS}" STREQUAL "")
+    target_link_options("${NAME}" PUBLIC ${arg_PUBLIC_LINK_OPTIONS})
+  endif()
+
+  if(NOT "${arg_PRIVATE_LINK_OPTIONS}" STREQUAL "")
+    target_link_options("${NAME}" PRIVATE ${arg_PRIVATE_LINK_OPTIONS})
   endif()
 endfunction(pw_add_module_library)


Second part of the fix for ROOT-6194

Second part of the fix for ROOT-6194

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -484,7 +484,7 @@
 else()
   set(makecompiledata ${CMAKE_SOURCE_DIR}/build/unix/compiledata.sh)
 endif()
-
+get_filename_component(cxx ${CMAKE_CXX_COMPILER} NAME)
 string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
 execute_process(COMMAND ${makecompiledata} include/compiledata.h "${cxx}" "" "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}"
 	   "${CMAKE_CXX_FLAGS}" "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}" "${CMAKE_EXE_FLAGS}" "${LibSuffix}" "${SYSLIBS}"


[Build System: CMake] Set the binary dir for the generated runtime headers to the source dir when building the standalone overlays (rdar://47558666).

--- cmake/modules/StandaloneOverlay.cmake
+++ cmake/modules/StandaloneOverlay.cmake
@@ -61,7 +61,7 @@

 # Some overlays include the runtime's headers,
 # and some of those headers are generated at build time.
-add_subdirectory("${SWIFT_SOURCE_DIR}/include" "swift/include")
+add_subdirectory("${SWIFT_SOURCE_DIR}/include" "${SWIFT_SOURCE_DIR}/include")
 add_subdirectory("${SWIFT_SOURCE_DIR}/apinotes" "swift/apinotes")

 # Without this line, installing components is broken. This needs refactoring.


Fix too old deployment target on macOS, we switched to 10.9 and C++11.

--- src/cmake/configure_build.cmake
+++ src/cmake/configure_build.cmake
@@ -18,8 +18,8 @@

 if(APPLE)
 	if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
-		# 10.6 is our min. target, if you use higher sdk, weak linking happens.
-		set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "" FORCE)
+		# 10.9 is our min. target, if you use higher sdk, weak linking happens.
+		set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)
 	endif()

 	if(NOT ${CMAKE_GENERATOR} MATCHES "Xcode")


- Add correctness for when "armeabi-v7a with VFPV3" and similar are used when creating library directories  - For Android, only strip the .so that is deployed, keep local copies intact

--- cmake/Packaging/AndroidApkBuild.cmake
+++ cmake/Packaging/AndroidApkBuild.cmake
@@ -90,7 +90,9 @@

     set( BUILD_OUTDIR ${ANDROID_BUILD_OUTPUT}/${Target_Name} )

-    set ( ANDROID_LIB_OUTPUT_DIRECTORY ${BUILD_OUTDIR}/libs/${Api_Arch} )
+    string ( REGEX REPLACE "([a-zA-Z0-9\_\-]+)\ .*" "\\1" LIB_SUFFIX "${Api_Arch}"  )
+
+    set ( ANDROID_LIB_OUTPUT_DIRECTORY ${BUILD_OUTDIR}/libs/${LIB_SUFFIX} )
     set ( ANDROID_ASSET_OUTPUT_DIRECTORY ${BUILD_OUTDIR}/assets )

     set ( ANDROID_ANT_COMMON_PROPERTIES -Dout.final.file="${ANDROID_APK_FILE_OUTPUT}" )
@@ -168,6 +170,15 @@
     add_custom_command ( TARGET ${Target_Name}
         POST_BUILD
         COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${Target_Name}>" ${ANDROID_LIB_OUTPUT_DIRECTORY}
+        )
+
+    #
+    # We strip the final .so file that will be put on the device, not the real one
+    #
+
+    add_custom_command ( TARGET ${Target_Name}
+        POST_BUILD
+        COMMAND ${ANDROID_STRIP} "${ANDROID_LIB_OUTPUT_DIRECTORY}/lib${Target_Name}.so"
         )

     #
@@ -280,11 +291,6 @@

     if(CMAKE_BUILD_TYPE STREQUAL "Release")
-        add_custom_command ( TARGET ${Target_Name}
-            POST_BUILD
-            COMMAND ${ANDROID_STRIP} "$<TARGET_FILE:${Target_Name}>"
-            )
-
         # In release-mode, we sign and align the APK manually
         add_custom_command ( TARGET ${Target_Name}
             POST_BUILD


CMake: Define BOOST_NO_CXX11_HDR_UNORDERED_MAP for bundled boost if <gcc-4.8

Closes #3624.

--- cmake/configure/configure_boost.cmake
+++ cmake/configure/configure_boost.cmake
@@ -47,6 +47,19 @@
     LIST(APPEND BOOST_DEFINITIONS "BOOST_ALL_NO_LIB")
     LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_ALL_NO_LIB")
   ENDIF()
+
+  #
+  # Our bundled boost version 1.62 checks for the availability of
+  # "emplace_hint" incorrectly. Thus, simply define
+  # BOOST_NO_CXX11_HDR_UNORDERED_MAP if the gcc compiler version is less
+  # than 4.8.
+  #
+  IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+      CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" )
+    LIST(APPEND BOOST_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+    LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+  ENDIF()
+
 ENDMACRO()

 MACRO(FEATURE_BOOST_FIND_EXTERNAL var)
@@ -62,6 +75,17 @@
     IF("${BOOST_VERSION_MAJOR}" STREQUAL "1" AND "${BOOST_VERSION_MINOR}" STREQUAL "58")
       MESSAGE(STATUS "Boost version 1.58 is not compatible with deal.II!")
       SET(${var} FALSE)
+    ENDIF()
+
+    #
+    # Newer boost versions check for the availability of "emplace_hint"
+    # incorrectly. Thus, simply define BOOST_NO_CXX11_HDR_UNORDERED_MAP if
+    # the gcc compiler version is less than 4.8.
+    #
+    IF( CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND
+        CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8" )
+      LIST(APPEND BOOST_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
+      LIST(APPEND BOOST_USER_DEFINITIONS "BOOST_NO_CXX11_HDR_UNORDERED_MAP")
     ENDIF()
   ENDIF()
 ENDMACRO()


Update jkqtplotter_cmake_options.cmake

Update jkqtplotter_cmake_options.cmake

--- cmake/jkqtplotter_cmake_options.cmake
+++ cmake/jkqtplotter_cmake_options.cmake
@@ -17,7 +17,7 @@
     option(JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT "Build the library with printer support switched off, even if it is available" OFF)
 endif()
 if(NOT DEFINED JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS)
-    option(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS "Build the library using precompiled headers to improve compile speed" OFF)
+    option(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS "Build the library using precompiled headers to improve compile speed" ON)
 endif()
 if(NOT DEFINED CMAKE_INSTALL_PREFIX)
     option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/install)


[CMake] Promote extension warnings to errors.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -171,7 +171,10 @@

     # Promoted warnings.
     -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.
-    -w14239 # Promote 'nonstandard extension used : 'token' : conversion from 'type' to 'type'' to level 1 warning.
+
+    # Promoted warnings to errors.
+    -we4238 # Promote 'nonstandard extension used : class rvalue used as lvalue' to error.
+    -we4239 # Promote 'nonstandard extension used : 'token' : conversion from 'type' to 'type'' to error.
     )

   # Enable warnings


Clarifiing that ROOT_BINDIR is the same as ROOT_BINARY_DIR

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -675,7 +675,7 @@
 # Deprecated value ROOT_BINARY_DIR
 set(ROOT_BINARY_DIR_SETUP "
 # Deprecated value, please don't use it and use ROOT_BINDIR instead.
-get_filename_component(ROOT_BINARY_DIR \"\${_thisdir}/${ROOT_CMAKE_TO_BIN_DIR}\" ABSOLUTE)
+get_filename_component(ROOT_BINARY_DIR \"\${ROOT_BINDIR}\" ABSOLUTE)
 ")
 set(ROOT_MODULE_PATH "\${_thisdir}/modules")


CMake: remove duplicate find_package(pybind11 ...) (#1521)

This duplicate seems to come from the PR #1371.
This PR spanned April 15 - August 24 (2021).

Meanwhile, PR #1410 (June 13 - June 21),
changed the CMake logic around `find_package(pybind11 ...)`.

It looks like former PR mishandled the merge of the latter.

Signed-off-by: Guillaume Papin <73126930ee9af7169d0be9cc369d7014ae514ea1@epitech.eu>


define xcode bitcode generation mode

define xcode bitcode generation mode

--- toolchains/apple.cmake
+++ toolchains/apple.cmake
@@ -36,6 +36,7 @@
 function( TNUN_enable_bitcode )
   add_compile_options( -fno-function-sections )
   set( CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES" )
+  set( CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "bitcode" ) # Without this, Xcode adds -fembed-bitcode-marker compile options instead of -fembed-bitcode
 endfunction()

 link_libraries( $<$<CONFIG:RELEASE>:-dead_strip> )