[Build] Fixed a small typo in the FindGit.cmake helper.

--- config/FindGit.cmake
+++ config/FindGit.cmake
@@ -8,17 +8,17 @@
   set (Git_FOUND TRUE)

   macro (Git_WC_INFO dir prefix)
-    execute_process (COMMAND ${Git_EXECUTABLE} rev-list --quiet -n 1 HEAD
+    execute_process (COMMAND ${Git_EXECUTABLE} rev-list -n 1 HEAD
       WORKING_DIRECTORY ${dir}
       ERROR_VARIABLE Git_error
       OUTPUT_VARIABLE ${prefix}_WC_REVISION_HASH
       OUTPUT_STRIP_TRAILING_WHITESPACE)
     if (NOT ${Git_error} EQUAL 0)
       message (STATUS
-		"Command \"${Git_EXECUTABLE} rev-list --quiet -n 1 HEAD\" in directory ${dir} failed with output:\n${Git_error}")
+	"Command \"${Git_EXECUTABLE} rev-list -n 1 HEAD\" in directory ${dir} failed with output:\n${Git_error}")
     else (NOT ${Git_error} EQUAL 0)
       execute_process (COMMAND ${Git_EXECUTABLE}
-		name-rev ${${prefix}_WC_REVISION_HASH}
+	name-rev ${${prefix}_WC_REVISION_HASH}
         WORKING_DIRECTORY ${dir}
         OUTPUT_VARIABLE ${prefix}_WC_REVISION_NAME
         OUTPUT_STRIP_TRAILING_WHITESPACE)


ENH: extended CREATE_CORE_LIB macro with optional debug and globbing modes

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -6,6 +6,26 @@
 #
 MACRO(CREATE_CORE_LIB)
   INCLUDE(files.cmake)
+  IF(MITK_CMAKE_DEBUG)
+    FILE(GLOB_RECURSE CPP_FILES_GLOB RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
+    FOREACH(CPP_FILE ${CPP_FILES})
+      IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CPP_FILE})
+        LIST(REMOVE_ITEM CPP_FILES_GLOB ${CPP_FILE})
+      ELSE(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CPP_FILE})
+        # this does not work since there are some generated files added by template macro
+        # MESSAGE(STATUS "WARNING: referenced file from files.cmake does not exist: ${CPP_FILE}")
+        # LIST(REMOVE_ITEM CPP_FILES ${CPP_FILE})
+      ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CPP_FILE})
+    ENDFOREACH(CPP_FILE)
+    IF(CPP_FILES_GLOB)
+      MESSAGE(STATUS "WARNING: possibly obsolete files: ${CPP_FILES_GLOB}")
+    ENDIF(CPP_FILES_GLOB)
+  ENDIF(MITK_CMAKE_DEBUG)
+  IF(MITK_USE_GLOBBING)
+    FILE(GLOB_RECURSE CPP_FILES_GLOB RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
+    SET(CPP_FILES ${CPP_FILES_GLOB})
+  ENDIF(MITK_USE_GLOBBING)
+
   GET_FILENAME_COMPONENT(LIBNAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
   SET(LIBNAME mitk${LIBNAME}${LIBPOSTFIX})
   ADD_LIBRARY(${LIBNAME} ${CPP_FILES})


FindJsonCpp: add version detection

FindJsonCpp: add version detection

--- CMake/FindJsonCpp.cmake
+++ CMake/FindJsonCpp.cmake
@@ -19,8 +19,21 @@
 set(JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR})
 set(JsonCpp_LIBRARIES "${JsonCpp_LIBRARY}")

+set(_JsonCpp_version_args)
+if (EXISTS "${JsonCpp_INCLUDE_DIR}/json/version.h")
+  file(STRINGS "${JsonCpp_INCLUDE_DIR}/json/version.h" _JsonCpp_version_contents REGEX "#\\s+define\\s+JSONCPP_VERSION_[A-Z]+")
+  foreach (_JsonCpp_version_part MAJOR MINOR PATCH)
+    string(REGEX REPLACE ".*#\\s*define ARMA_VERSION_${_JsonCpp_version_part}\\s+([0-9]+).*" "\\1" JsonCpp_VERSION_${_JsonCpp_version_part} "${_JsonCpp_version_contents}")
+  endforeach ()
+
+  set(JsonCpp_VERSION_STRING "${JsonCpp_VERSION_MAJOR}.${JsonCpp_VERSION_MINOR}.${JsonCpp_VERSION_PATCH}")
+
+  set(_JsonCpp_version_args VERSION_VAR JsonCpp_VERSION_STRING)
+endif ()
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(JsonCpp DEFAULT_MSG
-  JsonCpp_LIBRARIES JsonCpp_INCLUDE_DIRS)
+  JsonCpp_LIBRARIES JsonCpp_INCLUDE_DIRS
+  ${_JsonCpp_version_args})

 mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)


Bring back per-system defines, got lost with #478

--- CommonFindPackage.cmake
+++ CommonFindPackage.cmake
@@ -32,6 +32,8 @@
 #  - ${PROJECT_NAME}_FIND_PACKAGES_FOUND - string of found packages
 #  - ${PROJECT_NAME}_FIND_PACKAGES_NOTFOUND - string of not-found packages

+include(CommonGraph)
+
 if(NOT PKGCONFIG_FOUND AND NOT MSVC)
   find_package(PkgConfig QUIET)
 endif()
@@ -40,19 +42,29 @@

 option(COMMON_FIND_PACKAGE_QUIET "Use QUIET for common_find_package command" ON)

-include(CommonGraph)
+if(WIN32)
+  set(__system Win32)
+endif()
+if(APPLE)
+  set(__system Darwin)
+endif()
+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+  set(__system Linux)
+endif()
+
+list(APPEND COMMON_FIND_PACKAGE_DEFINES ${__system})
 if(COMMON_USE_CXX03)
-  set(COMMON_FIND_PACKAGE_DEFINES ${SYSTEM} ${UPPER_PROJECT_NAME}_USE_CXX03)
+  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_USE_CXX03)
 else()
-  set(COMMON_FIND_PACKAGE_DEFINES ${SYSTEM} ${UPPER_PROJECT_NAME}_USE_CXX11)
+  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_USE_CXX11)
 endif()

 include(TestBigEndian)
 test_big_endian(BIGENDIAN)
 if(BIGENDIAN)
-  set(COMMON_FIND_PACKAGE_DEFINES ${SYSTEM} ${UPPER_PROJECT_NAME}_BIGENDIAN)
+  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_BIGENDIAN)
 else()
-  set(COMMON_FIND_PACKAGE_DEFINES ${SYSTEM} ${UPPER_PROJECT_NAME}_LITTLEENDIAN)
+  list(APPEND COMMON_FIND_PACKAGE_DEFINES ${UPPER_PROJECT_NAME}_LITTLEENDIAN)
 endif()

 macro(common_find_package Package_Name)
@@ -197,7 +209,7 @@
   configure_file(${CMAKE_SOURCE_DIR}/CMake/common/cpp/defines.h
     ${PROJECT_BINARY_DIR}/include/${PROJECT_INCLUDE_NAME}/defines.h @ONLY)
   set(__defines_file
-    "${CMAKE_CURRENT_BINARY_DIR}/include/${PROJECT_INCLUDE_NAME}/defines${SYSTEM}.h")
+    "${CMAKE_CURRENT_BINARY_DIR}/include/${PROJECT_INCLUDE_NAME}/defines${__system}.h")
   set(COMMON_DEFINES_FILE
     ${PROJECT_BINARY_DIR}/include/${PROJECT_INCLUDE_NAME}/defines.h ${__defines_file})

@@ -205,8 +217,8 @@
   set(__options_cmake_file_in ${__options_cmake_file}.in)
   file(WRITE ${__defines_file_in}
     "// generated by CommonFindPackage.cmake, do not edit.\n\n"
-    "#ifndef ${PROJECT_NAME}_DEFINES_${SYSTEM}_H\n"
-    "#define ${PROJECT_NAME}_DEFINES_${SYSTEM}_H\n\n")
+    "#ifndef ${PROJECT_NAME}_DEFINES_${__system}_H\n"
+    "#define ${PROJECT_NAME}_DEFINES_${__system}_H\n\n")
   file(WRITE ${__options_cmake_file_in} "# Optional modules enabled during build\n")
   foreach(DEF ${COMMON_FIND_PACKAGE_DEFINES})
     add_definitions(-D${DEF}=1)


Simplify and speed up tarball creation

Simplify and speed up tarball creation

--- GitTargets.cmake
+++ GitTargets.cmake
@@ -5,6 +5,8 @@
 if(NOT GIT_EXECUTABLE)
   return()
 endif()
+
+find_program(GZIP_EXECUTABLE gzip)

 math(EXPR _gittargets_ODD_MINOR "${VERSION_MINOR} % 2")
 if(_gittargets_ODD_MINOR)
@@ -60,7 +62,28 @@
   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
   )

-set(_gittargets_TARGETS branch cut tag erase)
+add_custom_target(tarball-create
+  COMMAND ${GIT_EXECUTABLE} archive --worktree-attributes
+    --prefix ${CMAKE_PROJECT_NAME}-${VERSION}/
+    -o ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar
+    release-${VERSION}
+  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+  COMMENT "Creating ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar"
+  )
+
+if(GZIP_EXECUTABLE)
+  add_custom_target(tarball
+    COMMAND ${GZIP_EXECUTABLE}
+      "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar"
+    DEPENDS tarball-create
+    COMMENT
+      "Compressing ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz"
+  )
+else()
+  add_custom_target(tarball DEPENDS tarball-create)
+endif()
+
+set(_gittargets_TARGETS branch cut tag erase tarball tarball-create)
 foreach(_gittargets_TARGET ${_gittargets_TARGETS})
   set_target_properties(${_gittargets_TARGET} PROPERTIES EXCLUDE_FROM_ALL ON)
   set_target_properties(${_gittargets_TARGET} PROPERTIES FOLDER "git")


CR #86

CR #86

--- GitTargets.cmake
+++ GitTargets.cmake
@@ -8,14 +8,13 @@
 #
 # Targets:
 # * branch: Create a new branch for developing the current version and
-#   push it to origin. The branch is name MAJOR.MINOR, where the minor
-#   version * is rounded up to the next even version. Odd minor
-#   numbers are * considered development versions, and might still be
-#   used when * releasing a pre-release version (e.g., 1.3.9 used for
-#   1.4-beta).
+#   push it to origin. The branch name is MAJOR.MINOR, where the minor
+#   version is rounded up to the next even version. Odd minor numbers
+#   are considered development versions, and might still be used when
+#   releasing a pre-release version (e.g., 1.3.9 used for 1.4-beta).
 # * cut: Delete the current version branch locally and remote.
 # * tag: Create the version branch if needed, and create a tag
-#   release-VERSION on the version branch HEAD. Pushes tag to the
+#   release-VERSION on the version branch HEAD. Pushes the tag to the
 #   origin repository.
 # * erase: Delete the current tag locally and remote
 # * retag: Move an existing tag to HEAD


more fixes for ceres EIGEN3/EIGEN var name hacks....

Change-Id: Ia61969850dba4c58c698457c17d58c60843c9b75

--- VAD_Eigen3.cmake
+++ VAD_Eigen3.cmake
@@ -6,13 +6,15 @@
   message("run VAD_SYSTEM for EIGEN3")
   find_package_plus_no_import(${ARGN} NO_CMAKE_BUILDS_PATH)

-  # TODO also handle this through some script?
   # ceres uses it's own findEigen routine... and expexts EIGEN_... as var names...
-  if (EIGEN3_FOUND)
-    vad_add_var(EIGEN_FOUND TRUE)
+  if (NOT EIGEN_FOUND AND EIGEN3_FOUND)
+    vad_add_var(EIGEN_FOUND ${EIGEN3_FOUND})
   endif()
-  if (Eigen3_VERSION)
+  if (NOT EIGEN_VERSION AND Eigen3_VERSION)
     vad_add_var(EIGEN_VERSION ${Eigen3_VERSION})
+  endif()
+  if (NOT EIGEN_INCLUDE_DIRS AND EIGEN3_INCLUDE_DIRS)
+    vad_add_var(EIGEN_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIRS})
   endif()
   make_imported_targets_global()
 endfunction()


Update FindClangTools.cmake

Update FindClangTools.cmake

Clang tools typo

--- tools/cmake/FindClangTools.cmake
+++ tools/cmake/FindClangTools.cmake
@@ -20,7 +20,7 @@
 endif()

 find_program(CLANG_FORMAT_PROGRAM
-  NAMES clang-format 3.9 clang-format-3.8 clang-format-3.7 clang-format-3.6 clang-format
+  NAMES clang-format-3.9 clang-format-3.8 clang-format-3.7 clang-format-3.6 clang-format
   PATHS $ENV{CLANG_TOOLS_PATH} /usr/local/bin /usr/bin
   NO_DEFAULT_PATH)


make sure that Qt links the desired libraries

--- qt4.cmake
+++ qt4.cmake
@@ -10,6 +10,12 @@
 include (ExternalSource)
 include (BuildSupport)
 #include (PatchSupport)
+
+include(zlib)
+include(libpng)
+include(libjpeg)
+include(libtiff)
+include(freetype2)

 external_source (qt4
     4.8.3
@@ -34,7 +40,7 @@
 # (This builds everything that ilastik needs.)

 ExternalProject_Add(${qt4_NAME}
-    #DEPENDS
+    DEPENDS             ${freetype2_NAME}
     PREFIX              ${BUILDEM_DIR}
     URL                 ${qt4_URL}
     URL_MD5             ${qt4_MD5}
@@ -80,6 +86,13 @@
         -release
         -shared
         -no-accessibility
+        -fontconfig
+        -system-zlib
+        -system-libpng
+        -system-libjpeg
+        -system-libtiff
+        -I${BUILDEM_DIR}/include
+        -L${BUILDEM_DIR}/lib
         ${EXTRA_QT4_CONFIG_FLAGS}
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make
     TEST_COMMAND        ${BUILDEM_ENV_STRING} make check


Ported libcxx to iOS

Ported libcxx to iOS

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1772,12 +1772,17 @@
   ${LIBCXX_TARGET}
   PREFIX ${LIBCXX_PREFIX}
   DOWNLOAD_COMMAND ${NOP}
+  PATCH_COMMAND
+    patch -p0 < ${THIRD_PARTY_SOURCE_DIR}/libcxx.patch
   CMAKE_ARGS
+      -DLIBCXX_ENABLE_SHARED=${BUILD_SHARED_LIBS}
+
       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+      -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
       -DCMAKE_BUILD_TYPE=RELEASE
-      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS_WITH_ARCHS}
+      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS_WITH_ARCHS}
       -DCMAKE_SHARED_LINKER_FLAGS=${LIBCXX_LINKER_FLAGS}
       -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
       -DCMAKE_OSX_ARCHITECTURES=${ARCHS}


ffmpeg windows wrapper 2.7.1=>3.1.1, openh264 1.4.0=>1.5.0, vpx 1.5.0

--- 3rdparty/ffmpeg/ffmpeg.cmake
+++ 3rdparty/ffmpeg/ffmpeg.cmake
@@ -1,9 +1,9 @@
-# Binary branch name: ffmpeg/master_20150703
-# Binaries were created for OpenCV: e379ea6ed60b0caad4d4e3eea096e9d850cb8c86
-set(FFMPEG_BINARIES_COMMIT "8aeefc4efe3215de89d8c7e114ae6f7a6091b8eb")
-set(FFMPEG_FILE_HASH_BIN32 "89c783eee1c47bfc733f08334ec2e31c")
-set(FFMPEG_FILE_HASH_BIN64 "35fe6ccdda6d7a04e9056b0d73b98e76")
-set(FFMPEG_FILE_HASH_CMAKE "8606f947a780071f8fcce8cbf39ceef5")
+# Binary branch name: ffmpeg/master_20160715
+# Binaries were created for OpenCV: 0e6aa189cb9a9642b0ae7983d301693516faad5d
+set(FFMPEG_BINARIES_COMMIT "7eef9080d3271c7547d303fa839a62e1124ff1e6")
+set(FFMPEG_FILE_HASH_BIN32 "3bb2a8388af90adf6c762210e696400d")
+set(FFMPEG_FILE_HASH_BIN64 "ebcfc963f0a94f7e83d58d60eaf23849")
+set(FFMPEG_FILE_HASH_CMAKE "f99941d10c1e87bf16b9055e8fc91ab2")

 set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/Itseez/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)


make use of jom if we can find it

make use of jom if we can find it

--- test.cmake
+++ test.cmake
@@ -10,8 +10,14 @@
 set(CTEST_USE_LAUNCHERS 1) # much improved error/warning message logging

 if(WIN32)
-   set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
-   set(CMAKE_MAKE_PROGRAM "nmake -I")
+   find_program(JOM jom)
+   if(JOM)
+      set(CTEST_CMAKE_GENERATOR "NMake Makefiles JOM")
+      set(CMAKE_MAKE_PROGRAM "jom -j$ENV{number_of_processors} -i")
+   else()
+      set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
+      set(CMAKE_MAKE_PROGRAM "nmake -I")
+   endif()
 else()
    set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
    if(NOT CMAKE_MAKE_PROGRAM)


ctkMacroBuildLib - Use MY_LIBRARY_TYPE instead of CTK_BUILD_SHARED_LIBS

--- CMake/ctkMacroBuildLib.cmake
+++ CMake/ctkMacroBuildLib.cmake
@@ -149,7 +149,7 @@
   SET_TARGET_PROPERTIES(${lib_name} PROPERTIES CTK_LIB_TARGET_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})

   # Install rules
-  IF(CTK_BUILD_SHARED_LIBS)
+  IF(MY_LIBRARY_TYPE STREQUAL "SHARED")
     INSTALL(TARGETS ${lib_name}
       RUNTIME DESTINATION ${CTK_INSTALL_BIN_DIR} COMPONENT Runtime
       LIBRARY DESTINATION ${CTK_INSTALL_LIB_DIR} COMPONENT Runtime


BUG: Removed quotes from fftwf and fftwd hashes

This fixes a bug in which fftwf and fftwd fails to download becuase the hashs are surrounded by quotes.
CMake version is 3.11.4

Change-Id: Ic87478d191833f6bdd32137e41bda6a6217afe3b

--- CMake/itkExternal_FFTW.cmake
+++ CMake/itkExternal_FFTW.cmake
@@ -94,7 +94,7 @@
       ExternalProject_add(fftwf
         PREFIX fftwf
         URL "${_fftw_url}"
-        URL_HASH SHA512="${_fftw_url_hash}"
+        URL_HASH SHA512=${_fftw_url_hash}
         DOWNLOAD_NAME "fftw-${_fftw_target_version}.tar.gz"
         CONFIGURE_COMMAND
           env
@@ -122,7 +122,7 @@
       ExternalProject_add(fftwd
         PREFIX fftwd
         URL "${_fftw_url}"
-        URL_HASH SHA512="${_fftw_url_hash}"
+        URL_HASH SHA512=${_fftw_url_hash}
         DOWNLOAD_NAME "fftw-${_fftw_target_version}.tar.gz"
         CONFIGURE_COMMAND
           env


Restore MatchPoint and SimpleITK install rules

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -74,4 +74,19 @@
   endif()
 endif()

-set(_install_DESTINATION "") # IMPORTANT: Restore default install destination!
+set(_install_DESTINATION "")
+
+# Install MatchPoint binaries that are not auto-detected
+if(MITK_USE_MatchPoint)
+  MITK_INSTALL(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin" FILES_MATCHING PATTERN "MapUtilities*")
+  MITK_INSTALL(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin" FILES_MATCHING PATTERN "MapAlgorithms*")
+endif()
+
+# Install SimpleITK binaries that are not auto-detected
+if(MITK_USE_SimpleITK)
+  MITK_INSTALL(DIRECTORY "${MITK_EXTERNAL_PROJECT_PREFIX}/bin" FILES_MATCHING PATTERN "SimpleITK*")
+endif()
+
+# IMPORTANT: Restore default install destination!
+# IMPORTANT: Do not edit this file beyond this line!
+set(_install_DESTINATION "")


ImportedProjectUtils: Insert at insert index, not found index

--- ImportedProjectUtils.cmake
+++ ImportedProjectUtils.cmake
@@ -345,9 +345,9 @@
     else ()

         math (EXPR CREATE_METAPROJECT_CMAKE_ARGS_INSERT_INDEX
-              "${CREATE_METAPROJECT_CMAKE_ARGS_INDEX} + 2")
+              "${CREATE_METAPROJECT_CMAKE_ARGS_INDEX} + 1")
         list (INSERT CREATE_METAPROJECT_OPTIONS
-              "${CREATE_METAPROJECT_CMAKE_ARGS_INDEX}"
+              "${CREATE_METAPROJECT_CMAKE_ARGS_INSERT_INDEX}"
               "\"-C${INITIAL_CACHE}\"")

     endif ()


From Jean-Sebastien Guay, updated CTestConfig to point to new cdash.openscenegraph.org site

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,6 +8,6 @@
 set(CTEST_NIGHTLY_START_TIME "00:00:00 CET")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "www.cdash.org")
-set(CTEST_DROP_LOCATION "/CDashPublic/submit.php?project=OpenSceneGraph")
+set(CTEST_DROP_SITE "cdash.openscenegraph.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=OpenSceneGraph")
 set(CTEST_DROP_SITE_CDASH TRUE)


Fix CMake error using multi-configuration generator

--- cmake/ChooseMSVCCRT.cmake
+++ cmake/ChooseMSVCCRT.cmake
@@ -97,7 +97,7 @@
   endforeach(build_type)
 endmacro(choose_msvc_crt MSVC_CRT)

-string(TOUPPER ${CMAKE_BUILD_TYPE} build)
+string(TOUPPER "${CMAKE_BUILD_TYPE}" build)
 set(LIEF_CRT "/${LIEF_USE_CRT_${build}}")
 message(STATUS "LIEF_CRT: ${LIEF_CRT}")
 # List of valid CRTs for MSVC


Disable WITH_GFX_H264 if no backend compiled in.

--- cmake/ConfigOptions.cmake
+++ cmake/ConfigOptions.cmake
@@ -41,17 +41,18 @@
 	set(CMAKE_COMPILER_IS_CLANG 1)
 endif()

-option(WITH_GFX_H264 "Build GFX H264 support. A backend (OpenH264|FFMPEG|X264|MediaFoundation) must also be compiled in." OFF)
 if(NOT WIN32)
-    CMAKE_DEPENDENT_OPTION(WITH_VALGRIND_MEMCHECK "Compile with valgrind helpers." OFF "NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_LEAK" OFF)
-    CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_ADDRESS "Compile with gcc/clang address sanitizer." OFF "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_LEAK" OFF)
-    CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_LEAK "Compile with gcc/clang leak sanitizer." OFF "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS" OFF)
+	CMAKE_DEPENDENT_OPTION(WITH_VALGRIND_MEMCHECK "Compile with valgrind helpers." OFF "NOT WITH_SANITIZE_ADDRESS; NOT WITH_SANITIZE_LEAK" OFF)
+	CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_ADDRESS "Compile with gcc/clang address sanitizer." OFF "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_LEAK" OFF)
+	CMAKE_DEPENDENT_OPTION(WITH_SANITIZE_LEAK "Compile with gcc/clang leak sanitizer." OFF "NOT WITH_VALGRIND_MEMCHECK; NOT WITH_SANITIZE_ADDRESS" OFF)
 else()
 	if(NOT UWP)
-    	CMAKE_DEPENDENT_OPTION(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON
+		option(WITH_MEDIA_FOUNDATION "Enable H264 media foundation decoder." ON
 			"WITH_GFX_H264" OFF)
-    endif()
+	endif()
 endif()
+CMAKE_DEPENDENT_OPTION(WITH_GFX_H264 "Build GFX H264 support. A backend (OpenH264|FFMPEG|X264|MediaFoundation) must also be compiled in." ON
+	"WITH_X264 OR WITH_OPENH264 OR WITH_MEDIA_FOUNDATION OR WITH_FFMPEG" OFF)

 if(WIN32 AND NOT UWP)
 	option(WITH_NATIVE_SSPI "Use native SSPI modules" ON)


Fix of FindGStreamer.cmake module. Properly set path to gstconfig.h

--- cmake/FindGStreamer.cmake
+++ cmake/FindGStreamer.cmake
@@ -155,6 +155,14 @@
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(GStreamer REQUIRED_VARS ${_GSTREAMER_REQUIRED_VARS}
                                             VERSION_VAR   GSTREAMER_VERSION)
+if (WIN32)
+	find_path(_gst_config_include_DIR
+			NAMES gst/gstconfig.h
+			PATHS C:/gstreamer/1.0/x86/lib C:/gstreamer/1.0/x86_64/lib
+			PATH_SUFFIXES gstreamer-1.0/include
+	)
+	list(APPEND GSTREAMER_INCLUDE_DIRS ${_gst_config_include_DIR})
+endif(WIN32)

 mark_as_advanced(
     GSTREAMER_APP_INCLUDE_DIRS


cmake stuff

cmake stuff

--- cmake/FindPkgConfig.cmake
+++ cmake/FindPkgConfig.cmake
@@ -1,16 +0,0 @@
-#
-# This module finds if pkg-config is installed and determines where binary is.
-# This # code sets the following variables:
-#
-#  PKGCONFIG_FOUND              = 1 if found, else 0
-#  PKGCONFIG_EXECUTABLE         = full path to the ruby binary
-#
-
-FIND_PROGRAM(PKGCONFIG_EXECUTABLE
-	NAMES pkg-config
-	PATHS /usr/bin /usr/local/bin
-)
-SET(PKGCONFIG_FOUND 0)
-IF(EXISTS ${PKGCONFIG_EXECUTABLE})
-	SET(PKGCONFIG_FOUND 1)
-ENDIF(EXISTS ${PKGCONFIG_EXECUTABLE})


Address Sherm's comments about cmake macro.

--- cmake/OpenSimMacros.cmake
+++ cmake/OpenSimMacros.cmake
@@ -37,7 +37,7 @@

     STRING(TOUPPER "${OSIMADDLIB_KIT}" OSIMADDLIB_UKIT)

-
+
     # Version stuff.
     # --------------
     SET(OSIMADDLIB_LIBRARY_NAME osim${OSIMADDLIB_KIT})
@@ -52,24 +52,29 @@
         -DOPENSIM_${OSIMADDLIB_UKIT}_AUTHORS="${AUTHORS}"
         -DOPENSIM_${OSIMADDLIB_UKIT}_TYPE="Shared"
         )
-
+

     # Add the library.
     # ----------------
+    # These next few lines are the most important:
+    # Specify the directories in OpenSim that contain header files.
     INCLUDE_DIRECTORIES(${OpenSim_SOURCE_DIR}/Vendors ${OpenSim_SOURCE_DIR})
-
+
+    # Create the library using the provided source and include files.
     ADD_LIBRARY(osim${OSIMADDLIB_KIT} SHARED
-        ${OSIMADDLIB_SOURCES} ${OSIMADDLIB_INCLUDES})
+        ${OSIMADDLIB_SOURCES} ${OSIMADDLIB_INCLUDES})

+    # This target links to the libraries provided as arguments to this func.
     TARGET_LINK_LIBRARIES(osim${OSIMADDLIB_KIT} ${OSIMADDLIB_LINKLIBS})
-
+
+    # This is for exporting classes on Windows.
     SET(EXPORT_MACRO OSIM${OSIMADDLIB_UKIT}_EXPORTS)
     SET_TARGET_PROPERTIES(osim${OSIMADDLIB_KIT} PROPERTIES
        DEFINE_SYMBOL ${EXPORT_MACRO}
        PROJECT_LABEL "Libraries - osim${OSIMADDLIB_KIT}"
     )
-
-
+
+
     # Install.
     # --------
     # Shared libraries are needed at runtime for applications, so we put them
@@ -100,21 +105,21 @@
             DESTINATION sdk/include/OpenSim/${OSIMADDLIB_KIT})
     ENDIF()

-
+
     # Testing.
     # --------
     ENABLE_TESTING()
-
-    IF (EXECUTABLE_OUTPUT_PATH)
-      SET (TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
-    ELSE (EXECUTABLE_OUTPUT_PATH)
-      SET (TEST_PATH .)
-    ENDIF (EXECUTABLE_OUTPUT_PATH)
+
+    IF(EXECUTABLE_OUTPUT_PATH)
+        SET(TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
+    ELSE()
+        SET(TEST_PATH .)
+    ENDIF()

     IF(BUILD_TESTING)
         FOREACH(OSIMADDLIB_TESTDIR ${OSIMADDLIB_TESTDIRS})
             SUBDIRS("${OSIMADDLIB_TESTDIR}")
         ENDFOREACH()
-    ENDIF(BUILD_TESTING)
+    ENDIF()

 ENDFUNCTION()


Fix CPack package name for the library to use the full brand name.  https://tracker.physiomeproject.org/show_bug.cgi?id=3079

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

--- cmake/ZincPackaging.cmake
+++ cmake/ZincPackaging.cmake
@@ -61,8 +61,6 @@

 	SET( CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/distrib/osx/welcome.txt" )
 	LIST( LENGTH LENGTH_ARCHS CMAKE_OSX_ARCHITECTURES )
-	message(STATUS "la=${LENGTH_ARCHS}-${CMAKE_OSX_ARCHITECTURES}")
-	message(STATUS "la=${CMAKE_SYSTEM_NAME}-${CMAKE_OSX_ARCHITECTURES}")

 	SET( ZINC_ARCHITECTURE "universal" )
 	SET( CPACK_GENERATOR  "TGZ" "PackageMaker" )
@@ -83,7 +81,7 @@
 SET( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/distrib/description.txt" )
 SET( CPACK_PACKAGE_VENDOR "physiomeproject" )

-SET( CPACK_PACKAGE_FILE_NAME "zinc-${ZINC_PACKAGE_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}" )
+SET( CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${ZINC_PACKAGE_VERSION}-${ZINC_ARCHITECTURE}-${ZINC_SYSTEM}" )
 SET( CPACK_OUTPUT_FILE_PREFIX "package" )

 INCLUDE(CPack)


bug: Add CMAKE_PREFIX_PATH to external/curl.cmake (#250)

--- cmake/external/curl.cmake
+++ cmake/external/curl.cmake
@@ -49,6 +49,7 @@
                    -DHTTP_ONLY=ON
                    -DCMAKE_ENABLE_OPENSSL=ON
                    -DENABLE_ARES=ON
+                   -DCMAKE_PREFIX_PATH=${GOOGLE_CLOUD_CPP_PREFIX_PATH}
                    -DCMAKE_INSTALL_PATH=${GOOGLE_CLOUD_CPP_INSTALL_PATH}
                    -DCMAKE_INSTALL_RPATH=${GOOGLE_CLOUD_CPP_INSTALL_RPATH}
                    -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>


adjust test paramters for each example

adjust test paramters for each example

--- cmake/vSMCFunctions.cmake
+++ cmake/vSMCFunctions.cmake
@@ -31,14 +31,37 @@
                 TARGET_LINK_LIBRARIES (${exe_name} ${EXAMPLE_LINK_LIBRARIES})
             ENDIF (${exe} STREQUAL "std")

+            IF (${basename} STREQUAL "gmm")
+                ADD_TEST (NAME ${exe_name} COMMAND ${exe_name}
+                    "--particle_num" "1000"
+                    "--prior2" "100"
+                    "--burnin_num" "100"
+                    "--iter_num" "100"
+                    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+                    CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel)
+            ENDIF (${basename} STREQUAL "gmm")
+
+            IF (${basename} STREQUAL "node")
+                ADD_TEST (NAME ${exe_name} COMMAND ${exe_name}
+                    "--particle_num" "100"
+                    "--prior2" "30"
+                    "--burnin_num" "100"
+                    "--iter_num" "100"
+                    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+                    CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel)
+            ENDIF (${basename} STREQUAL "node")
+
+            IF (${basename} STREQUAL "pet")
+                ADD_TEST (NAME ${exe_name} COMMAND ${exe_name}
+                    "--particle_num" "1000"
+                    "--prior2" "500"
+                    "--burnin_num" "100"
+                    "--iter_num" "100"
+                    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+                    CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel)
+            ENDIF (${basename} STREQUAL "pet")
+
             ADD_DEPENDENCIES (${basename} ${exe_name})
-            ADD_TEST (NAME ${exe_name} COMMAND ${exe_name}
-                "--particle_num" "100"
-                "--prior2" "30"
-                "--burnin_num" "100"
-                "--iter_num" "100"
-                WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
-                CONFIGURATIONS Debug Release RelWithDebInfo MinSizeRel)
         ENDFOREACH(alg)
     ENDFOREACH (exe)
 ENDFUNCTION (ADD_EXAMPLE)


Find the static version of libgmp to avoid any external dependency

--- cmake_local/FindGMP.cmake
+++ cmake_local/FindGMP.cmake
@@ -9,7 +9,7 @@
 set(GMP_PREFIX "" CACHE PATH "Path to GMP prefix")

 find_path(GMP_INCLUDE_DIR gmp.h PATHS ${GMP_PREFIX}/include /usr/include /usr/local/include)
-find_library(GMP_LIBRARY NAMES gmp PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib)
+find_library(GMP_LIBRARY libgmp.a PATHS ${GMP_PREFIX}/lib /usr/lib /usr/local/lib)

 if(GMP_INCLUDE_DIR AND GMP_LIBRARY)
   set(GMP_FOUND TRUE)


SVN_SILENT made messages (.desktop file) - always resolve ours

In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"

--- plugins/sunshine/ktpaccountskcm_plugin_sunshine.desktop.cmake
+++ plugins/sunshine/ktpaccountskcm_plugin_sunshine.desktop.cmake
@@ -3,7 +3,7 @@
 Comment=Custom account configuration user interface for Gadu-Gadu accounts using the Sunshine connection manager.
 Comment[ast]=Interfaz d'usuariu de configuración de cuenta personalizada pa cuentes Gadu-Gadu qu'usen el xestor de conexones Sunshine.
 Comment[bs]=Korisnički interfejs za konfiguraciju Gadu-Gadu korisničkih naloga koristeći Sunshine menadžer konekcja.
-Comment[ca]=Interfície d'usuari de configuració de compte personalitzat per comptes del Gadu-Gadu que utilitzen el gestor de connexions Sunshine.
+Comment[ca]=Interfície d'usuari de configuració de compte personalitzat en comptes del Gadu-Gadu que utilitzen el gestor de connexions Sunshine.
 Comment[ca@valencia]=Interfície d'usuari de configuració de compte personalitzat per comptes del Gadu-Gadu que utilitzen el gestor de connexions Sunshine.
 Comment[cs]=Vlastní uživatelské rozhraní nastavení účtů pro účty Gadu-Gadu používající správce spojení Sunshine.
 Comment[da]=Brugerflade til brugertilpasset kontokonfiguration til Gadu-Gadu-konti der bruger forbindelseshåndteringen Sunshine.


Make the PCH script emit the PCH it the correct directory so that it is acutally used during the build.

--- PrecompiledHeader.cmake
+++ PrecompiledHeader.cmake
@@ -1,6 +1,6 @@
 # Macro for setting up precompiled headers. Usage:
 #
-#   add_precompiled_header(target header.h [FORCEINCLUDE])
+#	add_precompiled_header(target header.h [FORCEINCLUDE])
 #
 # MSVC: A source file with the same name as the header must exist and
 # be included in the target (E.g. header.cpp).
@@ -12,10 +12,11 @@
 # every header file.
 #
 # Copyright (C) 2009-2013 Lars Christensen <larsch@belunktum.dk>
+# Copyright (C) 2014 Sam Roth <sam.roth1@gmail.com>
 #
 # Permission is hereby granted, free of charge, to any person
 # obtaining a copy of this software and associated documentation files
-# (the ���Software���), to deal in the Software without restriction,
+# (the "Software"), to deal in the Software without restriction,
 # including without limitation the rights to use, copy, modify, merge,
 # publish, distribute, sublicense, and/or sell copies of the Software,
 # and to permit persons to whom the Software is furnished to do so,
@@ -24,7 +25,7 @@
 # The above copyright notice and this permission notice shall be
 # included in all copies or substantial portions of the Software.
 #
-# THE SOFTWARE IS PROVIDED ���AS IS���, WITHOUT WARRANTY OF ANY KIND,
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
@@ -33,81 +34,83 @@
 # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.

-MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
-  GET_FILENAME_COMPONENT(_inputWe ${_input} NAME_WE)
-  SET(pch_source ${_inputWe}.cpp)
-  FOREACH(arg ${ARGN})
-    IF(arg STREQUAL FORCEINCLUDE)
-      SET(FORCEINCLUDE ON)
-    ELSE(arg STREQUAL FORCEINCLUDE)
-      SET(FORCEINCLUDE OFF)
-    ENDIF(arg STREQUAL FORCEINCLUDE)
-  ENDFOREACH(arg)
+function(add_precompiled_header target_name input_file)
+	get_filename_component(_inputWe ${input_file} NAME_WE)
+	set(pch_source ${_inputWe}.cpp)
+	foreach(arg ${ARGN})
+		if(arg STREQUAL FORCEINCLUDE)
+			set(FORCEINCLUDE ON)
+		else(arg STREQUAL FORCEINCLUDE)
+			set(FORCEINCLUDE OFF)
+		endif(arg STREQUAL FORCEINCLUDE)
+	endforeach(arg)

-  IF(MSVC)
-    GET_TARGET_PROPERTY(sources ${_targetName} SOURCES)
-    SET(_sourceFound FALSE)
-    FOREACH(_source ${sources})
-      SET(PCH_COMPILE_FLAGS "")
-      IF(_source MATCHES \\.\(cc|cxx|cpp\)$)
-	GET_FILENAME_COMPONENT(_sourceWe ${_source} NAME_WE)
-	IF(_sourceWe STREQUAL ${_inputWe})
-	  SET(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /Yc${_input}")
-	  SET(_sourceFound TRUE)
-	ELSE(_sourceWe STREQUAL ${_inputWe})
-	  SET(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /Yu${_input}")
-	  IF(FORCEINCLUDE)
-	    SET(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /FI${_input}")
-	  ENDIF(FORCEINCLUDE)
-	ENDIF(_sourceWe STREQUAL ${_inputWe})
-	SET_SOURCE_FILES_PROPERTIES(${_source} PROPERTIES COMPILE_FLAGS "${PCH_COMPILE_FLAGS}")
-      ENDIF(_source MATCHES \\.\(cc|cxx|cpp\)$)
-    ENDFOREACH()
-    IF(NOT _sourceFound)
-      MESSAGE(FATAL_ERROR "A source file for ${_input} was not found. Required for MSVC builds.")
-    ENDIF(NOT _sourceFound)
-  ENDIF(MSVC)
-
+	if(MSVC)
+		get_target_property(sources ${target_name} SOURCES)
+		set(_sourceFound FALSE)
+		foreach(_source ${sources})
+			set(PCH_COMPILE_FLAGS "")
+			if(_source MATCHES \\.\(cc|cxx|cpp\)$)
+		get_filename_component(_sourceWe ${_source} NAME_WE)
+		if(_sourceWe STREQUAL ${_inputWe})
+			set(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /Yc${input_file}")
+			set(_sourceFound TRUE)
+		else(_sourceWe STREQUAL ${_inputWe})
+			set(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /Yu${input_file}")
+			if(FORCEINCLUDE)
+				set(PCH_COMPILE_FLAGS "${PCH_COMPILE_FLAGS} /FI${input_file}")
+			endif(FORCEINCLUDE)
+		endif(_sourceWe STREQUAL ${_inputWe})
+		set_source_files_properties(${_source} PROPERTIES COMPILE_FLAGS "${PCH_COMPILE_FLAGS}")
+			endif(_source MATCHES \\.\(cc|cxx|cpp\)$)
+		endforeach()
+		if(NOT _sourceFound)
+			message(FATAL_ERROR "A source file for ${input_file} was not found. Required for MSVC builds.")
+		endif(NOT _sourceFound)
+	endif(MSVC)
+

-  IF(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
-    GET_FILENAME_COMPONENT(_name ${_input} NAME)
-    SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
-    SET(_output "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.gch")
-    #MAKE_DIRECTORY(${_outdir})
-    #SET(_output "${_outdir}/.c++")
-
-    STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
-    SET(_compiler_FLAGS ${${_flags_var_name}})
-
-    GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
-    FOREACH(item ${_directory_flags})
-      LIST(APPEND _compiler_FLAGS "-I${item}")
-    ENDFOREACH(item)
+	if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
+		get_filename_component(_name ${input_file} NAME)
+		get_filename_component(srcfiledir ${input_file} DIRECTORY)
+		set(_source "${CMAKE_CURRENT_SOURCE_DIR}/${input_file}")
+		set(_output "${CMAKE_CURRENT_SOURCE_DIR}/${srcfiledir}/${_name}.gch")

-    GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
-    LIST(APPEND _compiler_FLAGS ${_directory_flags})
-
-    foreach(item ${CMAKE_CXX_FLAGS})
-        LIST(APPEND _compiler_FLAGS ${item})
-    endforeach()
-
-
-
-
+		string(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name)
+		set(_compiler_FLAGS ${${_flags_var_name}})

-    MESSAGE("${CMAKE_CXX_COMPILER} -DPCHCOMPILE ${_compiler_FLAGS} -x c++-header -o {_output} ${_source} ${PCH_ADDL_FLAGS}")
-    SEPARATE_ARGUMENTS(_compiler_FLAGS)
-    ADD_CUSTOM_COMMAND(
-      OUTPUT ${_output}
-      COMMAND ${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source} ${PCH_ADDL_FLAGS}
-      DEPENDS ${_source} )
-    ADD_CUSTOM_TARGET(${_targetName}_gch DEPENDS ${_output})
-    ADD_DEPENDENCIES(${_targetName} ${_targetName}_gch)
-
-    SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_CURRENT_SOURCE_DIR}/${_input} -Winvalid-pch")
-   get_target_property(_targetFlags ${_targetName} COMPILE_FLAGS)
-    message("target properties: ${_targetFlags}")
-  ENDIF()
+		get_directory_property(_directory_flags INCLUDE_DIRECTORIES)
+		foreach(item ${_directory_flags})
+			list(APPEND _compiler_FLAGS "-I${item}")
+		endforeach(item)

+		get_directory_property(_directory_flags DEFINITIONS)
+		list(APPEND _compiler_FLAGS ${_directory_flags})

-ENDMACRO()
+		foreach(item ${CMAKE_CXX_FLAGS})
+			LIST(APPEND _compiler_FLAGS ${item})
+		endforeach()
+
+		set(compiler_command
+			"${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source} ${PCH_ADDL_FLAGS}"
+		)
+
+		separate_arguments(compiler_command)
+
+		message("${compiler_command}")
+
+		#message("${CMAKE_CXX_COMPILER} -DPCHCOMPILE ${_compiler_FLAGS} -x c++-header -o {_output} ${_source} ${PCH_ADDL_FLAGS}")
+		separate_arguments(_compiler_FLAGS)
+		add_custom_command(
+			OUTPUT ${_output}
+			COMMAND ${compiler_command}
+			DEPENDS ${_source}
+		)
+		add_custom_target(${target_name}_gch DEPENDS ${_output})
+		add_dependencies(${target_name} ${target_name}_gch)
+
+		set_target_properties(${target_name} PROPERTIES COMPILE_FLAGS "-include ${CMAKE_CURRENT_SOURCE_DIR}/${input_file} -Winvalid-pch")
+	 	get_target_property(_targetFlags ${target_name} COMPILE_FLAGS)
+		message("target properties: ${_targetFlags}")
+	endif()
+endfunction()


use ThriftCppLibrary.cmake from fbcode_builder

Summary:
Update fboss to use `ThriftCppLibrary.cmake` directly from fbcode_builder
rather than maintaining its own copy of this file.

Reviewed By: chadaustin

Differential Revision: D17005421

fbshipit-source-id: a64df426118df6088b47f09410dad7b8b7e79a43

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,6 +1,4 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
-# NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
-# needs to be changed.  TODO: this should be handled via shipit.

 include(FBCMakeParseArgs)


Fix potential arg processing error

Fix potential arg processing error

When no additional arguments were given on the left side of '-P build.cmake'

--- build.cmake
+++ build.cmake
@@ -59,12 +59,12 @@
         list(APPEND ARGLIST ${CMAKE_ARGV${ARG_INDEX}})
     endforeach()

-    string(FIND "${ARGLIST}" "-P;${BASENAME};" SEP_POS)
+    string(FIND "${ARGLIST}" "-P;${BASENAME}" SEP_POS)

     string(SUBSTRING "${ARGLIST}" 0 ${SEP_POS} ${ConfigArgsOut})

     if(NOT ${SEP_POS} EQUAL -1)
-        math(EXPR SEP_END_POS "${SEP_POS} + 15")
+        math(EXPR SEP_END_POS "${SEP_POS} + 14")
         string(SUBSTRING "${ARGLIST}" ${SEP_END_POS} "-1" BUILD_SCRIPT_ARGS)

         foreach(SARG ${BUILD_SCRIPT_ARGS})


Add CMake function to install components symlink to fat jar

--- functions.cmake
+++ functions.cmake
@@ -689,6 +689,21 @@
     install(FILES "target/${NAME}-${PARAM_CLASSIFIER}.jar" DESTINATION lib/jars/)
     install(DIRECTORY DESTINATION conf/configserver-app/components)
     install_symlink(lib/jars/${NAME}-${PARAM_CLASSIFIER}.jar conf/configserver-app/components/${NAME}.jar)
+endfunction()
+
+function(install_components_symlink APPNAME NAME)
+    cmake_parse_arguments(
+        PARAM
+        ""
+        "CLASSIFIER"
+        ""
+        ${ARGN}
+    )
+    if(NOT PARAM_CLASSIFIER)
+       SET(PARAM_CLASSIFIER "jar-with-dependencies")
+    endif()
+    install(DIRECTORY DESTINATION conf/${APPNAME}/components)
+    install_symlink(lib/jars/${NAME}-${PARAM_CLASSIFIER}.jar conf/${APPNAME}/components/${NAME}.jar)
 endfunction()

 function(add_extra_projects)


[mechanics] compilation failure with OCE if -Werror=non-virtual-dtor

--- cmake/CXXCompilerSetup.cmake
+++ cmake/CXXCompilerSetup.cmake
@@ -86,7 +86,9 @@
   add_cxx_options("-Wformat=2")
   add_cxx_options("-Werror=format-security")

-  add_cxx_options("-Werror=non-virtual-dtor")
+  if(NOT WITH_OCC AND NOT WITH_MECHANISMS)
+    add_cxx_options("-Werror=non-virtual-dtor")
+  endif()
 endif()

 # add_cxx_options("-static -static-libgcc -static-libstdc++" "GNU;Clang")


make sure regex read all the way to the end of line (#3531)

--- cmake/Modules/git_tags.cmake
+++ cmake/Modules/git_tags.cmake
@@ -43,10 +43,10 @@

     if (NOT ${TAG_LIST} STREQUAL "")
         # first look for vX.Y.Z release tag
-        string(REGEX MATCH "${NGRAPH_CURRENT_HASH}[\t ]+refs/tags/v([0-9?]+)\\.([0-9?]+)\\.([0-9?]+)" TAG ${TAG_LIST})
+        string(REGEX MATCH "${NGRAPH_CURRENT_HASH}[\t ]+refs/tags/v([0-9?]+)\\.([0-9?]+)\\.([0-9?]+)$" TAG ${TAG_LIST})
         if ("${TAG}" STREQUAL "")
             # release tag not found so now look for vX.Y.Z-rc.N tag
-            string(REGEX MATCH "${NGRAPH_CURRENT_HASH}[\t ]+refs/tags/v([0-9?]+)\\.([0-9?]+)\\.([0-9?]+)-(rc\\.[0-9?]+)" TAG ${TAG_LIST})
+            string(REGEX MATCH "${NGRAPH_CURRENT_HASH}[\t ]+refs/tags/v([0-9?]+)\\.([0-9?]+)\\.([0-9?]+)-(rc\\.[0-9?]+)$" TAG ${TAG_LIST})
         endif()
         set(STATUS ${TAG})
         if (NOT "${TAG}" STREQUAL "")
@@ -79,6 +79,7 @@
     if ("${NGRAPH_CURRENT_RELEASE_TAG}" STREQUAL "")
         NGRAPH_GET_CURRENT_HASH()
         NGRAPH_GET_MOST_RECENT_TAG()
+        message(STATUS "Current hash ${NGRAPH_CURRENT_HASH}")
         string(SUBSTRING "${NGRAPH_CURRENT_HASH}" 0 7 HASH)
         if (NOT ${NGRAPH_MOST_RECENT_RELEASE_TAG} STREQUAL "")
             set(NGRAPH_VERSION_LABEL "${NGRAPH_MOST_RECENT_RELEASE_TAG}+${HASH}" PARENT_SCOPE)


[cmake] add setting for disabling warnings Wc++11-extensions (disabled by default)

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -427,6 +427,13 @@
 		DESCRIPTION "Warn about narrowing conversions"
 		DEFAULT "-Wno-narrowing"
 		"-Wnarrowing" "-Wno-narrowing"
+		)
+
+	axl_create_compiler_flag_setting(
+		GCC_FLAG_CPP_WARNING_C11EXTENSION
+		DESCRIPTION "Warn about C++11 extensions"
+		DEFAULT "-Wno-c++11-extensions"
+		"-Wc++11-extensions" "-Wno-c++11-extensions"
 		)

 	# these warnings only pop up with -Wmost (hardcoded by the Xcode generator)


[build] Fixed build break for OCaml bindings.

After r273302 LLVM_SYSTEM_LIBS may have entries that already have
-l prefix and we need to deal with that.

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

--- cmake/modules/AddOCaml.cmake
+++ cmake/modules/AddOCaml.cmake
@@ -73,7 +73,13 @@

   get_property(system_libs TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS)
   foreach(system_lib ${system_libs})
-    list(APPEND ocaml_flags "-l${system_lib}" )
+    if (system_lib MATCHES "^-")
+      # If it's an option, pass it without changes.
+      list(APPEND ocaml_flags "${system_lib}" )
+    else()
+      # Otherwise assume it's a library name we need to link with.
+      list(APPEND ocaml_flags "-l${system_lib}" )
+    endif()
   endforeach()

   string(REPLACE ";" " " ARG_CFLAGS "${ARG_CFLAGS}")


[CMake] Fix broken builds from r309029

[CMake] Fix broken builds from r309029

Fixing the mismatched beginning if and endif contents.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -121,7 +121,7 @@
       COMMENT "Building libLLVMTableGen for native TableGen..."
       USES_TERMINAL)
   add_custom_target(NATIVE_LIB_LLVMTABLEGEN DEPENDS LIB_LLVMTABLEGEN)
-endif(LLVM_USE_HOST_TOOLS)
+endif()

 macro(add_tablegen target project)
   set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})


Add path hint for Windows

Add path hint for Windows

--- cmake_include/FindMXML.cmake
+++ cmake_include/FindMXML.cmake
@@ -29,9 +29,9 @@
 #------------------------------------------------------------------------------
 # find the runtime binaries of the MXML library
 #------------------------------------------------------------------------------
-find_library(MXML_LIBRARY NAMES mxml mxml1)
+find_library(MXML_LIBRARY NAMES mxml mxml1
+             HINTS ENV MXML_ROOT)

-
 if(MXML_LIBRARY MATCHES MXML_LIBRARY-NOTFOUND)
     message(FATAL_ERROR "Could not find MXML library!")
 else()


For VC++, define the ?INT*_C macros only it they are not yet defined.

Some compatibility updates like the Boost TR1 compatibility headers
define them.

Patch contributed by OvermindDL1!

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

--- include/llvm/System/DataTypes.h.cmake
+++ include/llvm/System/DataTypes.h.cmake
@@ -118,14 +118,33 @@
 #define INT32_MAX 2147483647
 #define INT32_MIN -2147483648
 #define UINT32_MAX 4294967295U
-#define INT8_C(C)   C
-#define UINT8_C(C)  C
-#define INT16_C(C)  C
-#define UINT16_C(C) C
-#define INT32_C(C)  C
-#define UINT32_C(C) C ## U
-#define INT64_C(C)  ((int64_t) C ## LL)
-#define UINT64_C(C) ((uint64_t) C ## ULL)
+/* Certain compatibility updates to VC++ introduce the `cstdint'
+ * header, which defines the INT*_C macros. On default installs they
+ * are absent. */
+#ifndef INT8_C
+# define INT8_C(C)   C
+#endif
+#ifndef UINT8_C
+# define UINT8_C(C)  C
+#endif
+#ifndef INT16_C
+# define INT16_C(C)  C
+#endif
+#ifndef UINT16_C
+# define UINT16_C(C) C
+#endif
+#ifndef INT32_C
+# define INT32_C(C)  C
+#endif
+#ifndef UINT32_C
+# define UINT32_C(C) C ## U
+#endif
+#ifndef INT64_C
+# define INT64_C(C)  ((int64_t) C ## LL)
+#endif
+#ifndef UINT64_C
+# define UINT64_C(C) ((uint64_t) C ## ULL)
+#endif
 #endif /* _MSC_VER */

 /* Set defaults for constants which we cannot find. */


MAINT: fix CMake script.

MAINT: fix CMake script.

--- cpp/src/DO/Sara/UseDOSaraFeatureDescriptors.cmake
+++ cpp/src/DO/Sara/UseDOSaraFeatureDescriptors.cmake
@@ -1,14 +1,15 @@
-if (SARA_USE_FROM_SOURCE)
-  get_property(DO_Sara_FeatureDescriptors_ADDED GLOBAL PROPERTY
-               _DO_Sara_FeatureDescriptors_INCLUDED)
-  if (NOT DO_Sara_FeatureDescriptors_ADDED)
+if(SARA_USE_FROM_SOURCE)
+  get_property(DO_Sara_FeatureDescriptors_ADDED GLOBAL
+               PROPERTY _DO_Sara_FeatureDescriptors_INCLUDED)
+  if(NOT DO_Sara_FeatureDescriptors_ADDED)
     sara_glob_directory(${DO_Sara_SOURCE_DIR}/FeatureDescriptors)
     sara_create_common_variables("FeatureDescriptors")
     sara_generate_library("FeatureDescriptors")

-    target_link_libraries(DO_Sara_FeatureDescriptors
-      PUBLIC
-      DO::Sara::Features
-      $<$<BOOL:OpenMP_CXX_FOUND>:OpenMP::OpenMP_CXX>)
-  endif ()
-endif ()
+    target_link_libraries(
+      DO_Sara_FeatureDescriptors
+      PUBLIC DO::Sara::Features #
+             DO::Sara::ImageProcessing
+             $<$<BOOL:OpenMP_CXX_FOUND>:OpenMP::OpenMP_CXX>)
+  endif()
+endif()


Fix for CGAL relocation fix. Wrong libdir was used.

--- deps/CGAL/CGAL.cmake
+++ deps/CGAL/CGAL.cmake
@@ -8,8 +8,13 @@
     DEPENDS dep_boost dep_GMP dep_MPFR
 )

+include(GNUInstallDirs)
+
+# CGAL, for whatever reason, makes itself non-relocatable by writing the build directory into
+# CGALConfig-installation-dirs.cmake and including it in configure time.
+# If this file is not present, it will not consider the stored absolute path
 ExternalProject_Add_Step(dep_CGAL dep_CGAL_relocation_fix
     DEPENDEES install
     COMMAND ${CMAKE_COMMAND} -E remove CGALConfig-installation-dirs.cmake
-    WORKING_DIRECTORY "${DESTDIR}/usr/local/lib/cmake/CGAL"
+    WORKING_DIRECTORY "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/CGAL"
 )


Add WindowsStore to supported OS targets

--- conan.cmake
+++ conan.cmake
@@ -93,7 +93,7 @@
         if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
             set(CONAN_SYSTEM_NAME Macos)
         endif()
-        set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD)
+        set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD WindowsStore)
         list (FIND CONAN_SUPPORTED_PLATFORMS "${CONAN_SYSTEM_NAME}" _index)
         if (${_index} GREATER -1)
             #check if the cmake system is a conan supported one


feat: allow users to specify conan executable for conan_config_install (#376)

--- conan.cmake
+++ conan.cmake
@@ -882,9 +882,10 @@
     set(multiValueArgs ARGS)
     cmake_parse_arguments(CONAN "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    find_program(CONAN_CMD conan)
-    if(NOT CONAN_CMD AND CONAN_REQUIRED)
-        message(FATAL_ERROR "Conan executable not found!")
+    if(DEFINED CONAN_COMMAND)
+        set(CONAN_CMD ${CONAN_COMMAND})
+    else()
+        conan_check(REQUIRED)
     endif()

     if(DEFINED CONAN_VERIFY_SSL)


Fix cmake install.

Fix cmake install.

--- build/cmake/install.cmake
+++ build/cmake/install.cmake
@@ -1,9 +1,28 @@
 install(
-  DIRECTORY ${CMAKE_SOURCE_DIR}/build/cmake/dest/${CMAKE_INSTALL_PREFIX}/
+  DIRECTORY ${STAGE_PREFIX_DIR}/
   DESTINATION ${CMAKE_INSTALL_PREFIX}
   USE_SOURCE_PERMISSIONS
 )
 install(PROGRAMS ${CMAKE_SOURCE_DIR}/build/package/files/etc/init.d/api-umbrella DESTINATION /etc/init.d)
 install(FILES ${CMAKE_SOURCE_DIR}/build/package/files/etc/logrotate.d/api-umbrella DESTINATION /etc/logrotate.d)
 install(FILES ${CMAKE_SOURCE_DIR}/build/package/files/etc/sudoers.d/api-umbrella DESTINATION /etc/sudoers.d)
-install(FILES ${CMAKE_SOURCE_DIR}/build/package/files/etc/api-umbrella/api-umbrella.yml DESTINATION /etc/api-umbrella RENAME api-umbrella.yml.default)
+
+# If /etc/api-umbrella/api-umbrella.yml doesn't exist, install it.
+#
+# If /etc/api-umbrella/api-umbrella.yml does exist, install the default version
+# to api-umbrella.yml.default (so it's available for reference, but we don't
+# overwrite any local changes).
+#
+# The CODE block is so that this conditional is deferred until install time
+# (rather than when cmake builds the makefile). See:
+# https://cmake.org/Bug/view.php?id=12646
+install(
+  CODE "
+  if(NOT EXISTS /etc/api-umbrella/api-umbrella.yml)
+    file(INSTALL ${CMAKE_SOURCE_DIR}/build/package/files/etc/api-umbrella/api-umbrella.yml DESTINATION /etc/api-umbrella)
+  else()
+    message(STATUS \"Skipping: /etc/api-umbrella/api-umbrella.yml\")
+    file(INSTALL ${CMAKE_SOURCE_DIR}/build/package/files/etc/api-umbrella/api-umbrella.yml DESTINATION /etc/api-umbrella RENAME api-umbrella.yml.default)
+  endif()
+  "
+)


Change freetype build directories to ft

Change freetype build directories to ft

--- CMakeModules/build_freetype.cmake
+++ CMakeModules/build_freetype.cmake
@@ -1,6 +1,6 @@
 INCLUDE(ExternalProject)

-SET(prefix ${CMAKE_BINARY_DIR}/third_party/freetype)
+SET(prefix ${CMAKE_BINARY_DIR}/third_party/ft)
 SET(freetype_location ${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX})
 IF(CMAKE_VERSION VERSION_LESS 3.2)
     IF(CMAKE_GENERATOR MATCHES "Ninja")
@@ -18,12 +18,12 @@
 ENDIF(UNIX)

 ExternalProject_Add(
-    freetype-ext
+    ft-ext
     GIT_REPOSITORY http://git.sv.nongnu.org/r/freetype/freetype2.git
     GIT_TAG 14df6b1a63f5c5773bb498063205cb79aac21173
     PREFIX "${prefix}"
     UPDATE_COMMAND ""
-    CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" ${prefix}/src/freetype-ext
+    CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
     -DCMAKE_CXX_FLAGS:STRING=${CXXFLAGS}
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
@@ -36,7 +36,7 @@
 ADD_LIBRARY(freetype IMPORTED STATIC)
 SET(freetype_location ${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX})
 SET_TARGET_PROPERTIES(freetype PROPERTIES IMPORTED_LOCATION ${freetype_location})
-ADD_DEPENDENCIES(freetype freetype-ext)
+ADD_DEPENDENCIES(freetype ft-ext)

 SET(FREETYPE_INCLUDE_DIRS ${prefix}/include/freetype2)
 SET(FREETYPE_LIBRARIES freetype)


Remove FATAL condition in case ALIEN is not set

FATAL condition makes it impossible to compile AliPhysics
with the o2 defaults which deactivate alien. Configuration
of ALIEN should be handled by the build recipe.

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -206,7 +206,8 @@

     set(ROOT_HASALIEN TRUE)
     else(ALIEN)
-    message(FATAL_ERROR "ROOT was built with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
+        set(ROOT_HASALIEN FALSE)
+        message(WARNING "ROOT was built with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
     endif(ALIEN)

     # Checking for xml support


Change CHANGE_SUMMARY parsing method

Change CHANGE_SUMMARY parsing method

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -152,7 +152,7 @@
 	SET(_cmdOpts "")
 	IF (NOT "${CHANGE_SUMMARY}" STREQUAL "")
 	    SET(CHANGE_SUMMARY "Release ${PROJECT_NAME}-${PRJ_VER}")
-	ENDIF(NOT ${CHANGE_SUMMARY}" STREQUAL "")
+	ENDIF(NOT "${CHANGE_SUMMARY}" STREQUAL "")

 	IF (NOT REDHAT_BUGZILLA STREQUAL "")
 	    LIST(APPEND _cmdOpts "-b" "${REDHAT_BUGZILLA}")


Fixing installation rules

Fixing installation rules

--- Resources/CMake/CMakeMacros.cmake
+++ Resources/CMake/CMakeMacros.cmake
@@ -52,17 +52,17 @@
     )

     if ( DEFINED MXA_INSTALL_FILES)
-    if ( ${MXA_INSTALL_FILES} EQUAL 1 )
-        INSTALL(TARGETS ${EXE_NAME}
-            RUNTIME
-            DESTINATION ./
-            COMPONENT Applications
-            LIBRARY DESTINATION ./
-            ARCHIVE DESTINATION ./
-            RUNTIME DESTINATION ./
-            BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/.
-        )
-    endif()
+        if ( ${MXA_INSTALL_FILES} EQUAL 1 )
+            INSTALL(TARGETS ${EXE_NAME}
+                RUNTIME
+                DESTINATION ./
+                COMPONENT Applications
+                LIBRARY DESTINATION ./
+                ARCHIVE DESTINATION ./
+                RUNTIME DESTINATION ./
+                BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX}/.
+            )
+        endif()
     endif()

     # --- If we are on OS X copy all the embedded libraries to the app bundle
@@ -242,7 +242,7 @@
                         PATHS  ${lib_path}/../bin ${lib_path}/.. ${lib_path}/
                         NO_DEFAULT_PATH )
          # message(STATUS "${upperlib}_LIBRARY_DLL_${TYPE}: ${${upperlib}_LIBRARY_DLL_${TYPE}}")
-
+          mark_as_advanced(${upperlib}_LIBRARY_DLL_${TYPE})
           if ( ${${upperlib}_LIBRARY_DLL_${TYPE}} STREQUAL  "${upperlib}_LIBRARY_DLL_${TYPE}-NOTFOUND")
             message(FATAL_ERROR "According to how ${upperlib}_LIBRARY_${TYPE} was found the library should"
                                 " have been built as a DLL but no .dll file can be found. I looked in the "
@@ -251,7 +251,7 @@

          # SET(${upperlib}_LIBRARY_DLL_${TYPE} "${${upperlib}_LIBRARY_DLL_${TYPE}}/${lib_name}.dll" CACHE FILEPATH "The path to the DLL Portion of the library" FORCE)
          # message(STATUS "${upperlib}_LIBRARY_DLL_${TYPE}: ${${upperlib}_LIBRARY_DLL_${TYPE}}")
-         # message(STATUS "  Copy: ${${upperlib}_LIBRARY_DLL_${TYPE}}/${lib_name}.dll\n    To: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BTYPE}/")
+          message(STATUS "Generating Copy Rule for DLL File for ${upperlib}_LIBRARY_${TYPE}")
           ADD_CUSTOM_TARGET(ZZ_${upperlib}_DLL_${TYPE}-Copy ALL
                       COMMAND ${CMAKE_COMMAND} -E copy_if_different ${${upperlib}_LIBRARY_DLL_${TYPE}}
                       ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BTYPE}/
@@ -287,7 +287,7 @@
                         PATHS  ${lib_path}/../bin ${lib_path}/.. ${lib_path}/
                         NO_DEFAULT_PATH )
          # message(STATUS "${upperlib}_LIBRARY_DLL_${TYPE}: ${${upperlib}_LIBRARY_DLL_${TYPE}}")
-
+          mark_as_advanced(${upperlib}_LIBRARY_DLL_${TYPE})
           if ( ${${upperlib}_LIBRARY_DLL_${TYPE}} STREQUAL  "${upperlib}_LIBRARY_DLL_${TYPE}-NOTFOUND")
             # message(STATUS "A Companion DLL for ${upperlib}_LIBRARY_${TYPE} was NOT found which usually means"
             #                    " that the library was NOT built as a DLL. I looked in the "


Fix spell

Fix spell

--- cmake/modules/hunter_experimental_add_host_project.cmake
+++ cmake/modules/hunter_experimental_add_host_project.cmake
@@ -4,7 +4,7 @@
 # ************************* !!! WARNING !!! *************************
 #
 # You're using experimental feature. This may not work well
-# and can be removed anytime. It's a workaround for existsing
+# and can be removed anytime. It's a workaround for existing
 # feature request:
 #
 # https://github.com/ruslo/hunter/issues/495
@@ -29,7 +29,7 @@
 ************************* !!! WARNING !!! *************************

 You're using experimental feature. This may not work well
-and can be removed anytime. It's a workaround for existsing
+and can be removed anytime. It's a workaround for existing
 feature request:

 https://github.com/ruslo/hunter/issues/495


Move back compute capability 2.0 and remove deprecated warning

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -76,6 +76,8 @@
      )
 else()
  set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
+     -Wno-deprecated-gpu-targets
+     -gencode arch=compute_20,code=sm_20
      -gencode arch=compute_30,code=sm_30
      -gencode arch=compute_35,code=sm_35
      -gencode arch=compute_35,code=compute_35


Let cpack install all components he wants

--- cmake/MyPackagePack.cmake
+++ cmake/MyPackagePack.cmake
@@ -30,39 +30,9 @@
     #
     SET (CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE)
     #
-    # Do not get fooled by components out of our control
+    # Always enable archive
     #
-	SET (CPACK_COMPONENTS_ALL)
-    IF (_HAVE_MANPAGECOMPONENT)
-      IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-PACK-DEBUG] ... Registering ManpageComponent")
-      ENDIF ()
-	  LIST(APPEND CPACK_COMPONENTS_ALL "ManpageComponent")
-    ENDIF ()
-    IF (_HAVE_DYNAMICLIBRARYCOMPONENT)
-      IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-PACK-DEBUG] ... Registering DynamicLibraryComponent")
-      ENDIF ()
-	  LIST(APPEND CPACK_COMPONENTS_ALL "DynamicLibraryComponent")
-    ENDIF ()
-    IF (_HAVE_STATICLIBRARYCOMPONENT)
-      IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-PACK-DEBUG] ... Registering StaticLibraryComponent")
-      ENDIF ()
-	  LIST(APPEND CPACK_COMPONENTS_ALL "StaticLibraryComponent")
-    ENDIF ()
-    IF (_HAVE_HEADERCOMPONENT)
-      IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-PACK-DEBUG] ... Registering HeaderComponent")
-      ENDIF ()
-	  LIST(APPEND CPACK_COMPONENTS_ALL "HeaderComponent")
-    ENDIF ()
-    IF (_HAVE_APPLICATIONCOMPONENT)
-      IF (MYPACKAGE_DEBUG)
-        MESSAGE (STATUS "[${PROJECT_NAME}-PACK-DEBUG] ... Registering ApplicationComponent")
-      ENDIF ()
-	  LIST(APPEND CPACK_COMPONENTS_ALL "ApplicationComponent")
-    ENDIF ()
+    SET (CPACK_ARCHIVE_COMPONENT_INSTALL ON)
     #
     # Include CPack - from now on we will have access to CPACK own macros
     #
@@ -214,7 +184,7 @@
     # Quite subtil, but the "package" target is not visible at this time. There is a old standing bug
     # in CMake about this.
     # We use a custom target for package generation.
-    # In addition documentation is generated using the INSTALL(CODE xxx) hack.
+    # In addition man pages is generated using the INSTALL(CODE xxx) hack.
     #
     ADD_CUSTOM_TARGET(pack
       COMMAND ${CMAKE_MAKE_PROGRAM} package


No separator if no vendor name.

No separator if no vendor name.

	* build-aux/cmake/modules/GostaiCPack.cmake: Here.

--- build-aux/cmake/modules/GostaiCPack.cmake
+++ build-aux/cmake/modules/GostaiCPack.cmake
@@ -75,12 +75,20 @@
   "${PROJECT_TARNAME}-${pkg_sys_name}${build_type}")

 # Installation directory.
+set(cpack_package_vendor_separator "")
+if(CPACK_PACKAGE_VENDOR)
+  if(WIN32)
+    set(cpack_package_vendor_separator " ")
+  else(WIN32)
+    set(cpack_package_vendor_separator "-")
+  endif(WIN32)
+endif(CPACK_PACKAGE_VENDOR)
 if(WIN32)
   set(CPACK_PACKAGE_INSTALL_DIRECTORY
-    "${CPACK_PACKAGE_VENDOR} ${PROJECT_NAME} ${PROJECT_VERSION}")
+    "${CPACK_PACKAGE_VENDOR}${cpack_package_vendor_separator}${PROJECT_NAME} ${PROJECT_VERSION}")
 else(WIN32)
   set(CPACK_PACKAGE_INSTALL_DIRECTORY
-    "${CPACK_PACKAGE_VENDOR}-${PROJECT_NAME}-${PROJECT_VERSION}")
+    "${CPACK_PACKAGE_VENDOR}${cpack_package_vendor_separator}${PROJECT_NAME}-${PROJECT_VERSION}")
 endif(WIN32)

 # Set generators


fix node use script

fix node use script

https://github.com/smanders/externpro/issues/356

--- projects/use/usexp-node-config.cmake
+++ projects/use/usexp-node-config.cmake
@@ -28,5 +28,5 @@
 list(APPEND reqVars ${PRJ}_EXE)
 include(FindPackageHandleStandardArgs)
 set(FPHSA_NAME_MISMATCHED TRUE) # find_package_handle_standard_args NAME_MISMATCHED (prefix usexp-)
-find_package_handle_standard_args(${prj} REQUIRED_VARS ${reqVars})
+find_package_handle_standard_args(node REQUIRED_VARS ${reqVars})
 mark_as_advanced(${reqVars})


fix finding boost of linux ...

fix finding boost of linux ...

--- cmake/qibuild/modules/boostutils.cmake
+++ cmake/qibuild/modules/boostutils.cmake
@@ -73,7 +73,7 @@
     if(APPLE)
       flib(BOOST_${_suffix} NAMES ${_osx_names})
     else()
-      flib(BOOST_${_suffix} NAMES ${_osx_names})
+      flib(BOOST_${_suffix} NAMES ${_linux_names})
     endif()
   endif()
 endfunction()


[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>" )


[Conf] More robust way to derive Boost.Python component

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -70,6 +70,8 @@
 #  * INSTALL_INCLUDE_DIR  - Installation directory for the header files
 #  * INSTALL_DATA_DIR     - Installation directory for the data files
 #  * INSTALL_SAMPLE_DIR   - Installation directory for the (CSV) sample files
+#  * NEED_PYTHON          - Whether Python libraries are needed
+#                           That paremeter is derived from the required libraries
 #  * RUN_GCOV             - Whether or not to perform code coverage
 #
 macro (set_project_options _build_doc _enable_tests _run_gcov)
@@ -106,6 +108,7 @@
   set (CSS_ALL_TARGETS)
   set (IMG_ALL_TARGETS)
   set (MAN_ALL_TARGETS)
+  set (NEED_PYTHON OFF)

   # Set the library installation directory (either 32 or 64 bits)
   set (LIBDIR "lib${LIB_SUFFIX}" CACHE PATH
@@ -335,6 +338,7 @@
     endif (${_arg_lower} STREQUAL "lcov")

     if (${_arg_lower} STREQUAL "python")
+      set (NEED_PYTHON ON)
       get_python (${_arg_version})
     endif (${_arg_lower} STREQUAL "python")

@@ -616,19 +620,37 @@
   #         On some platform/Boost version combinations, the Python version
   #         may be just the major version (2 or 3 as of 2020) or the major
   #         and minor versions (e.g., 27, 28, 34, 36, 37, 38, 39 as of 2020)
-  set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
-  set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
+  # Note 3: Boot.Python has is reuired only for Python extensions. It should
+  #         not be linked with other regular (non-Python) libraries/binaries,
+  #         as it pulls with it symbols from the Python interpreter, which are
+  #         available only when launched from a Python interpreter.
   set (Boost_USE_STATIC_LIBS OFF)
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
+  # Boost.Python - Depending on the platforms, the component name
+  # differs. We try all of them, and the find_package() will retrieve
+  # just one
+  if (NEED_PYTHON)
+    set (python_cpt_name0 "python")
+    #
+    if (Python3_VERSION_MAJOR)
+      set (python_cpt_name1 "python${Python3_VERSION_MAJOR}")
+    endif (Python3_VERSION_MAJOR)
+    #
+    if (Python3_VERSION_MINOR)
+      set (python_cpt_name2 "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
+    endif (Python3_VERSION_MINOR)
+  endif (NEED_PYTHON)

   # Boost components for (non-Python) libraries
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system locale regex)

   # Boost components for Python extensions
-  set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT
-	${python_cpt_name1} ${python_cpt_name2})
+  if (NEED_PYTHON)
+    set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT
+      ${python_cpt_name0} ${python_cpt_name1} ${python_cpt_name2})
+  endif (NEED_PYTHON)

   # Boost components for main (non-test) binaries
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
@@ -655,54 +677,61 @@
   find_package (BoostWrapper ${_required_version} REQUIRED)

   if (Boost_FOUND)
-    # Boost.Python library
-	if (${Boost_PYTHON3_FOUND})
-      message (STATUS "  + Boost_PYTHON3_FOUND: ${Boost_PYTHON3_FOUND}")
-	endif (${Boost_PYTHON3_FOUND})
-	#
-	if (${Boost_PYTHON38_FOUND})
-      message (STATUS "  + Boost_PYTHON38_FOUND: ${Boost_PYTHON38_FOUND}")
-	endif (${Boost_PYTHON38_FOUND})
-	#
-	if (${Boost_PYTHON_VERSION})
+
+    if (NEED_PYTHON)
+      # Boost has a single Python library, but its name depends on the
+      # distribution, it can be libboost_python3 or libboost_python3x
+      if (Boost_PYTHON_LIBRARY)
+	set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name0})
+	if (Python3_VERSION_MAJOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name1})
+	endif (Python3_VERSION_MAJOR)
+	if (Python3_VERSION_MINOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name2})
+	endif (Python3_VERSION_MINOR)
+      endif (Boost_PYTHON_LIBRARY)
+
+      #
+      if (Boost_PYTHON${Python3_VERSION_MAJOR}_LIBRARY)
+	set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name1})
+	list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name0})
+	if (Python3_VERSION_MINOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name2})
+	endif (Python3_VERSION_MINOR)
+      endif (Boost_PYTHON${Python3_VERSION_MAJOR}_LIBRARY)
+
+      #
+      if (Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_LIBRARY)
+	set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name2})
+	list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name0})
+	if (Python3_VERSION_MAJOR)
+	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name1})
+	endif (Python3_VERSION_MAJOR)
+      endif (Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_LIBRARY)
+
+      # Reporting
+      message (STATUS "  + Retained Boost Python component: ${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT}")
+
+      # Derive the Boost.Python component name (amoung Boost_PYTHON,
+      # Boost_PYTHON3, Boost_PYTHON3X)
+      string (TOUPPER ${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT} _python_cpt)
+
+      # Reporting
+      message (STATUS "  + Boost Python component: Boost_${_python_cpt}")
+
+      # Derive the Python version used by Boost.Python
+      if (${Boost_${_python_cpt}_LIBRARY} MATCHES "python([1-9])\\.?([0-9])?")
+	set (Boost_PYTHON_VERSION "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
+      endif (${Boost_${_python_cpt}_LIBRARY} MATCHES "python([1-9])\\.?([0-9])?")
+
+      # Reporting
       message (STATUS "  + Boost_PYTHON_VERSION: ${Boost_PYTHON_VERSION}")
-	endif (${Boost_PYTHON_VERSION})
-	#
-	if (${Boost_PYTHON_LIBRARY})
-      message (STATUS "  + Boost_PYTHON_LIBRARY: ${Boost_PYTHON_LIBRARY}")
-	endif (${Boost_PYTHON_LIBRARY})
-	#
-	if (${Boost_PYTHON3_LIBRARY})
-      message (STATUS "  + Boost_PYTHON3_LIBRARY: ${Boost_PYTHON3_LIBRARY}")
-	endif (${Boost_PYTHON3_LIBRARY})
-	#
-	if (${Boost_PYTHON36_LIBRARY})
-      message (STATUS "  + Boost_PYTHON36_LIBRARY: ${Boost_PYTHON36_LIBRARY}")
-	endif (${Boost_PYTHON36_LIBRARY})
-	#
-	if (${Boost_PYTHON37_LIBRARY})
-      message (STATUS "  + Boost_PYTHON37_LIBRARY: ${Boost_PYTHON37_LIBRARY}")
-	endif (${Boost_PYTHON37_LIBRARY})
-	#
-	if (${Boost_PYTHON38_LIBRARY})
-      message (STATUS "  + Boost_PYTHON38_LIBRARY: ${Boost_PYTHON38_LIBRARY}")
-	endif (${Boost_PYTHON38_LIBRARY})
-	#
-	if (${Boost_PYTHON39_LIBRARY})
-      message (STATUS "  + Boost_PYTHON39_LIBRARY: ${Boost_PYTHON39_LIBRARY}")
-	endif (${Boost_PYTHON39_LIBRARY})
-
-	# Boost has a single Python library, but its name depends on the
-	# distribution, it can be libboost_python3 or libboost_python3x
-	if (${Boost_PYTHON3_FOUND})
-	  set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name1})
-	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name2})
-	endif (${Boost_PYTHON3_FOUND})
-
-	if (${Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND})
-	  set (BOOST_REQUIRED_COMPONENTS_FOR_PYEXT ${python_cpt_name2})
-	  list (REMOVE_ITEM BOOST_REQUIRED_COMPONENTS ${python_cpt_name1})
-	endif (${Boost_PYTHON${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}_FOUND})
+
+      # Boost.Python library
+      if (Boost_${_python_cpt}_LIBRARY)
+	message (STATUS "  + Boost_${_python_cpt}_LIBRARY: ${Boost_${_python_cpt}_LIBRARY}")
+      endif (Boost_${_python_cpt}_LIBRARY)
+    endif (NEED_PYTHON)

     # Update the list of include directories for the project
     include_directories (${Boost_INCLUDE_DIRS})
@@ -715,8 +744,10 @@
       "${BOOST_REQUIRED_COMPONENTS_FOR_LIB}")

     # Update the list of Python library dependencies for the project
-    register_boost_lib ("PROJ_DEP_LIBS_FOR_PYEXT"
-      "${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT}")
+    if (NEED_PYTHON)
+      register_boost_lib ("PROJ_DEP_LIBS_FOR_PYEXT"
+	"${BOOST_REQUIRED_COMPONENTS_FOR_PYEXT}")
+    endif (NEED_PYTHON)

     # Update the list of binary dependencies for the project
     register_boost_lib ("PROJ_DEP_LIBS_FOR_BIN"
@@ -772,22 +803,22 @@

   set (${_proto_srcs})
   foreach (FIL ${ARGN})
-	# Extract the file-path and the extension of the Protobuf specification file
+    # Extract the file-path and the extension of the Protobuf specification file
     get_filename_component (ABS_FIL ${FIL} ABSOLUTE)
     get_filename_component (FIL_WE ${FIL} NAME_WE)

-	# With Python, Protobuf adds "_pb2"
-	set (_proto_gen_src ${FIL_WE}_pb2.py)
-
-	message (STATUS
-	  "Adding ${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src} to Python sources")
+    # With Python, Protobuf adds "_pb2"
+    set (_proto_gen_src ${FIL_WE}_pb2.py)
+
+    message (STATUS
+      "Adding ${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src} to Python sources")

     list (APPEND ${_proto_srcs} "${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src}")

-	# Add a specific command for the Protobuf stub/skeleton generation
+    # Add a specific command for the Protobuf stub/skeleton generation
     add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src}"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
-	  --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
+      --python_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
       DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
       COMMENT "Running Python protocol buffer compiler on ${FIL}, generating ${CMAKE_CURRENT_BINARY_DIR}/${_proto_gen_src}"
       VERBATIM)
@@ -1852,10 +1883,10 @@
   endif (${_lib_short_name} STREQUAL ${MODULE_NAME})

   ##
-  # Python extension libraries hase some peculiarities
+  # Python extension libraries has some peculiarities
   if ("${_lib_prefix}" STREQUAL "py")
-	message (STATUS "${_lib_short_name} is assumed to be a Python library:")
-	message (STATUS "  -> Following libraries will be weakly linked: ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT}")
+    message (STATUS "${_lib_short_name} is assumed to be a Python library:")
+    message (STATUS "  -> Following libraries will be weakly linked: ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT}")

     # no 'lib' prefix
     set_target_properties (${_lib_target} PROPERTIES PREFIX "")
@@ -1863,34 +1894,34 @@
     # The suffix must be .so (even on MacOS, not .dylib)
     set_target_properties (${_lib_target} PROPERTIES SUFFIX ".so")

-	# Add the dependencies for Python extensions.
-	#
-	# Python extensions (which are also libraries per se) must not be linked
-	# against libpython3.x.so (which includes the interpreter). On Linux, it is
-	# fine not to link against libpython3.x.so, but on OS X, the compiler
-	# fails, unless the -undefined dynamic_lookup option is passed, which is
-	# what target_link_libraries_with_dynamic_lookup() is doing. That function
-	# is specified in the targetLinkLibrariesWithDynamicLookup.cmake file.
-	#
-	# See also:
-	#  https://blog.tim-smith.us/2015/09/python-extension-modules-os-x/
-	#  https://github.com/scikit-build/scikit-build/blob/master/skbuild/resources/cmake/targetLinkLibrariesWithDynamicLookup.cmake
-	target_link_libraries_with_dynamic_lookup (${_lib_target}
-	  ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT})
-	#python_extension_module (${_lib_target})
+    # Add the dependencies for Python extensions.
+    #
+    # Python extensions (which are also libraries per se) must not be linked
+    # against libpython3.x.so (which includes the interpreter). On Linux, it is
+    # fine not to link against libpython3.x.so, but on OS X, the compiler
+    # fails, unless the -undefined dynamic_lookup option is passed, which is
+    # what target_link_libraries_with_dynamic_lookup() is doing. That function
+    # is specified in the targetLinkLibrariesWithDynamicLookup.cmake file.
+    #
+    # See also:
+    #  https://blog.tim-smith.us/2015/09/python-extension-modules-os-x/
+    #  https://github.com/scikit-build/scikit-build/blob/master/skbuild/resources/cmake/targetLinkLibrariesWithDynamicLookup.cmake
+    target_link_libraries_with_dynamic_lookup (${_lib_target}
+      ${Python3_LIBRARIES} ${PROJ_DEP_LIBS_FOR_PYEXT})
+    #python_extension_module (${_lib_target})

   endif ("${_lib_prefix}" STREQUAL "py")

   ##
   # Library name (and soname)
   if (WIN32)
-	# MS Windows
+    # MS Windows
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
       VERSION ${GENERIC_LIB_VERSION})

   else (WIN32)
-	# Linux and MacOS
+    # Linux and MacOS
     set_target_properties (${_lib_target} PROPERTIES
       OUTPUT_NAME ${_lib_short_name}
       VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
@@ -1907,15 +1938,15 @@
   ##
   # Installation of the library
   if ("${_lib_prefix}" STREQUAL "py")
-	# If the library is Python, install it into a dedicated directory
-	message (STATUS "${_lib_short_name} is assumed to be a Python library")
-	install (TARGETS ${_lib_target}
+    # If the library is Python, install it into a dedicated directory
+    message (STATUS "${_lib_short_name} is assumed to be a Python library")
+    install (TARGETS ${_lib_target}
       EXPORT ${LIB_DEPENDENCY_EXPORT}
       LIBRARY DESTINATION "${INSTALL_PY_LIB_DIR}" COMPONENT runtime)
-
+
   else ("${_lib_prefix}" STREQUAL "py")
-	# Install the library in the standard location
-	install (TARGETS ${_lib_target}
+    # Install the library in the standard location
+    install (TARGETS ${_lib_target}
       EXPORT ${LIB_DEPENDENCY_EXPORT}
       LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT runtime)
   endif ("${_lib_prefix}" STREQUAL "py")
@@ -2673,7 +2704,7 @@

 # Python
 macro (display_python)
-  if (Python3_FOUND)
+  if (NEED_PYTHON)
     message (STATUS)
     message (STATUS "* Python:")
     message (STATUS "  - Python3_VERSION ............... : ${Python3_VERSION}")
@@ -2682,7 +2713,10 @@
     message (STATUS "  - Python3_LIBRARIES ............. : ${Python3_LIBRARIES}")
     message (STATUS "  - Python3_LIBRARY_DIRS .......... : ${Python3_LIBRARY_DIRS}")
     message (STATUS "  - Python3_RUNTIME_LIBRARY_DIRS .. : ${Python3_RUNTIME_LIBRARY_DIRS}")
-  endif (Python3_FOUND)
+  else (NEED_PYTHON)
+    message (STATUS)
+    message (STATUS "* Python not required")
+  endif (NEED_PYTHON)
 endmacro (display_python)

 # ICU
@@ -2717,7 +2751,9 @@
     message (STATUS "  - Boost_LIB_VERSION ............. : ${Boost_LIB_VERSION}")
     message (STATUS "  - Boost_HUMAN_VERSION ........... : ${Boost_HUMAN_VERSION}")
     message (STATUS "  - Boost_INCLUDE_DIRS ............ : ${Boost_INCLUDE_DIRS}")
-    message (STATUS "  - Boost_PYTHON_VERSION .......... : ${Boost_PYTHON_VERSION}")
+    if (NEED_PYTHON)
+      message (STATUS "  - Boost_PYTHON_VERSION .......... : ${Boost_PYTHON_VERSION}")
+    endif (NEED_PYTHON)
     message (STATUS "  - Boost required components ..... : ${BOOST_REQUIRED_COMPONENTS}")
     message (STATUS "  - Boost required libraries ...... : ${BOOST_REQUIRED_LIBS}")
     message (STATUS "  - Boost required libs for Py ext. : ${PROJ_DEP_LIBS_FOR_PYEXT}")


FindOgre.cmake: use 32-bit or 64-bit versions of the TBB libs depending on the used build configuration.

--- cmake/FindOgre.cmake
+++ cmake/FindOgre.cmake
@@ -117,14 +117,19 @@
             link_directories(${OGRE_DIR}/lib/$(ConfigurationName)/opt)
             if (TUNDRA_NO_BOOST) # TBB used for Ogre threading, so include it
                 include_directories(${TBB_HOME}/include)
+                if (CMAKE_CL_64)
+                    SET(TBB_ARCH "intel64")
+                else()
+                    SET(TBB_ARCH "ia32")
+                endif()
                 if (MSVC90)
-                    set(VC_VER "vc9")
+                    set(TBB_VC_VER "vc9")
                 elseif(MSVC10)
-                    set(VC_VER "vc10")
-                #elseif(MSVC11)
-                #    set(VC_VER "vc11")
+                    set(TBB_VC_VER "vc10")
+                elseif(MSVC11)
+                    set(TBB_LIB_VER "vc11")
                 endif()
-                link_directories(${TBB_HOME}/lib/ia32/${VC_VER}) # TODO ia32 is correct folder only on 32-bit
+                link_directories(${TBB_HOME}/lib/${TBB_ARCH}/${TBB_VC_VER})
             endif()
         endif()
         message(STATUS "Using Ogre from SDK directory " ${OGRE_DIR})


Return -q flag on link line on AIX. (#24)

--- cmake/bde_ufid.cmake
+++ cmake/bde_ufid.cmake
@@ -539,6 +539,7 @@
             >
             $<$<CXX_COMPILER_ID:XL>:
                 Threads::Threads
+                $<IF:${bde_ufid_is_64}, -q64, -q32>
             >
     )
 endfunction()


Avoid Cmake that create C++14 build with C++17 installed

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -9,6 +9,14 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHc")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
+
+  if (MSVC_VERSION GREATER_EQUAL "1900")
+    include(CheckCXXCompilerFlag)
+    CHECK_CXX_COMPILER_FLAG("/std:c++latest" _cpp_latest_flag_supported)
+    if (_cpp_latest_flag_supported)
+        add_compile_options("/std:c++latest")
+    endif()
+  endif()

   if(CMAKE_BUILD_TYPE STREQUAL "Debug")
     # disabling SAFESEH


Make submission more robust.

Make submission more robust.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -228,7 +228,7 @@
 endif()
 ctest_build()
 ctest_test()
-ctest_submit(PARTS Start Update Configure Build Test Upload Submit)
+ctest_submit(PARTS Start Update Configure Build Test Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)

 # Coverage
 if(CC_NAME STREQUAL "gcc")
@@ -312,7 +312,7 @@
         exec_program(chmod $ENV{HOME} ARGS +x codecov.io)
         exec_program($ENV{HOME}/codecov.io ${CTEST_SOURCE_DIRECTORY} ARGS -X gcov -s ${CTEST_BINARY_DIRECTORY})
     endif()
-    ctest_submit(PARTS Start Update Configure Build Test Coverage Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Test Coverage Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
 endif()

 # Static analysis
@@ -333,7 +333,7 @@
         ctest_configure(OPTIONS "-DKD_BUILD_TESTS=0;-DCI_FLAGS=${CC_ANALYSE_FLAGS}")
     endif()
     ctest_build()
-    ctest_submit(PARTS Start Update Configure Build Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
 endif()

 # Dynamic analysis (Valgrind)
@@ -357,7 +357,7 @@
     ctest_build()
     ctest_test()
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
     set(CTEST_MEMORYCHECK_COMMAND "")
     set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "")
 endif()
@@ -418,7 +418,7 @@
     ctest_build()
     ctest_test()
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
 endif()

 # Dynamic analysis (MSan)
@@ -446,7 +446,7 @@
     ctest_build()
     ctest_test()
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
 endif()

 # Dynamic analysis(TSan)
@@ -485,7 +485,7 @@
     ctest_build()
     ctest_test()
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
 endif()

 # Dynamic analysis (UBSan)
@@ -519,5 +519,5 @@
     ctest_build()
     ctest_test()
     ctest_memcheck()
-    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit)
+    ctest_submit(PARTS Start Update Configure Build Test MemCheck Upload Submit RETRY_COUNT 100 RETRY_DELAY 10)
 endif()


Update WSREP_PATCH_REVNO

Update WSREP_PATCH_REVNO

--- cmake/wsrep.cmake
+++ cmake/wsrep.cmake
@@ -22,8 +22,8 @@

 # MariaDB addition: Revision number of the last revision merged from
 # codership branch visible in @@visible_comment.
-# Branch : https://github.com/codership/mysql-wsrep/tree/5.5
-SET(WSREP_PATCH_REVNO "4f81026") # Should be updated on every merge.
+# Branch : https://github.com/codership/mysql-wsrep/tree/5.6
+SET(WSREP_PATCH_REVNO "21a2415") # Should be updated on every merge.

 # MariaDB: Obtain patch revision number:
 # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.


Build: Set environment variables for plugin test

I accidentally removed the argument in commit 88312c2.

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -167,7 +167,8 @@
 			  WORKING_DIRECTORY "${WORKING_DIRECTORY}")
 		set_property (TEST ${testexename}
 			      PROPERTY ENVIRONMENT
-				       "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib")
+				       "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib"
+				       "${ARG_ENVIRONMENT}")

 		if (ARG_MEMLEAK)
 			set_property (TEST ${testexename}


cmake/llvm: Improve tool detection

cmake/llvm: Improve tool detection

On Debian, llvm-obj{copy,dump} tools are installed with a version
suffix.  Look first for a version that matches our compiler when
probing for tool paths before trying the bare version, or falling back
to GNU binutils.

Signed-off-by: Andy Ross <61c3cfd4c0060414f91281a789685c974e47d1ec@google.com>

--- cmake/bintools/llvm/target.cmake
+++ cmake/bintools/llvm/target.cmake
@@ -7,12 +7,25 @@
   set(find_program_binutils_args PATHS ${TOOLCHAIN_HOME})
 endif()

-find_program(CMAKE_AR      llvm-ar      ${find_program_clang_args}   )
-find_program(CMAKE_NM      llvm-nm      ${find_program_clang_args}   )
-find_program(CMAKE_OBJDUMP llvm-objdump ${find_program_clang_args}   )
-find_program(CMAKE_RANLIB  llvm-ranlib  ${find_program_clang_args}   )
-find_program(CMAKE_STRIP   llvm-strip   ${find_program_clang_args}   )
-find_program(CMAKE_OBJCOPY objcopy      ${find_program_binutils_args})
+# Extract the clang version.  Debian (maybe other distros?) will
+# append a version to llvm-objdump/objcopy
+execute_process(COMMAND ${CMAKE_C_COMPILER} --version
+                OUTPUT_VARIABLE CLANGVER)
+string(REGEX REPLACE "[^0-9]*([0-9]+).*" "\\1" CLANGVER ${CLANGVER})
+
+find_program(CMAKE_AR      llvm-ar      ${find_program_clang_args})
+find_program(CMAKE_NM      llvm-nm      ${find_program_clang_args})
+find_program(CMAKE_OBJDUMP NAMES
+                           llvm-objdump
+                           llvm-objdump-${CLANGVER}
+                           ${find_program_clang_args})
+find_program(CMAKE_RANLIB  llvm-ranlib  ${find_program_clang_args})
+find_program(CMAKE_STRIP   llvm-strip   ${find_program_clang_args})
+find_program(CMAKE_OBJCOPY NAMES
+                           llvm-objcopy
+                           llvm-objcopy-${CLANGVER}
+                           objcopy
+                           ${find_program_binutils_args})
 find_program(CMAKE_READELF readelf      ${find_program_binutils_args})

 # Use the gnu binutil abstraction


cmake: Fix VCS_VERSION command, generate only one commit ID

--- cmake/generate-VCS_VERSION.cmake
+++ cmake/generate-VCS_VERSION.cmake
@@ -9,7 +9,7 @@
 )
 if("${VCS_VERSION}" STREQUAL "")
      execute_process(
-          COMMAND ${GIT_EXECUTABLE} log --pretty=format:%cd-g%h --date=short --abbrev-commit
+          COMMAND ${GIT_EXECUTABLE} log --pretty=format:%cd-g%h --date=short --abbrev-commit -1
           OUTPUT_VARIABLE VCS_VERSION
           ERROR_VARIABLE _git_error_msg
           OUTPUT_STRIP_TRAILING_WHITESPACE


Added freetype2 suffix.

Added freetype2 suffix.

--- cmake_modules/FindFreetype.cmake
+++ cmake_modules/FindFreetype.cmake
@@ -55,9 +55,10 @@
     /sw/include
     /opt/local/include
     /usr/freeware/include
+    PATH_SUFFIXES freetype freetype2
     )

-  FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
+  FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
     HINTS
     $ENV{FREETYPE_DIR}/include/freetype2
     PATHS
@@ -68,7 +69,7 @@
     /sw/include
     /opt/local/include
     /usr/freeware/include
-    PATH_SUFFIXES freetype2
+    PATH_SUFFIXES freetype freetype2
     )

   FIND_LIBRARY(FREETYPE_LIBRARY


Added a missing clang lib

Added a missing clang lib

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -213,7 +213,7 @@
 set(CLANG_LIBNAMES clangCodeGen clangFrontendTool clangFrontend clangDriver clangSerialization
     clangParse clangSema clangRewrite clangRewriteFrontend
     clangStaticAnalyzerFrontend clangStaticAnalyzerCheckers
-    clangStaticAnalyzerCore clangAnalysis clangEdit clangAST clangLex clangBasic)
+    clangStaticAnalyzerCore clangAnalysis clangEdit clangAST clangASTMatchers clangLex clangBasic)

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


add VERSION file

add VERSION file

--- cmake/Sign.cmake
+++ cmake/Sign.cmake
@@ -8,6 +8,7 @@
 set(_SIGNATURE_EXE_RAW ${CMAKE_BINARY_DIR}/${APP_NAME})
 set(SIGNATURE_EXE ${CMAKE_BINARY_DIR}/${_SIGNATURE_NAME})
 set(SIGNATURE_SIG ${CMAKE_BINARY_DIR}/${_SIGNATURE_NAME}.sig)
+file(WRITE ${CMAKE_BINARY_DIR}/VERSION "${VERSION_SHORT}\n")
 get_filename_component(_SIGNATURE_KEY_PATH ${SIGNATURE_KEY} ABSOLUTE)
 if(EXISTS ${_SIGNATURE_KEY_PATH})
   add_custom_target(siggen
@@ -15,9 +16,10 @@
     COMMAND cp -f ${_SIGNATURE_EXE_RAW} ${SIGNATURE_EXE}
   )
   add_custom_target(siggenupload
-    COMMAND rclone --transfers=1 --checkers=2 mkdir ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
-    COMMAND rclone --transfers=1 --checkers=2 copy ${SIGNATURE_EXE} ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
-    COMMAND rclone --transfers=1 --checkers=2 copy ${SIGNATURE_SIG} ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
+    COMMAND rclone mkdir ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
+    COMMAND rclone copy ${SIGNATURE_EXE} ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
+    COMMAND rclone copy ${SIGNATURE_SIG} ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
+    COMMAND rclone copy ${CMAKE_BINARY_DIR}/VERSION ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
   )
 else()
   add_custom_target(siggen echo no ~/server.key found)


Removed inclusion of test.cmake and testcases.cmake

--- cmake/acme.cmake
+++ cmake/acme.cmake
@@ -49,8 +49,8 @@

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

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


Fixed a minor cmake problem, occuring when DYNAMIC_CORE=ON and CMAKE_C_FLAGS was empty

--- cmake/arch.cmake
+++ cmake/arch.cmake
@@ -73,7 +73,7 @@
     endif ()
     if (NOT NO_AVX512)
       set(DYNAMIC_CORE ${DYNAMIC_CORE} SKYLAKEX)
-      string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+      string(REGEX REPLACE "-march=native" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
    endif ()
     if (DYNAMIC_LIST)
 	set(DYNAMIC_CORE PRESCOTT ${DYNAMIC_LIST})


more makefile fixes for ispc debug symbols. fixes #14

--- cmake/ispc.cmake
+++ cmake/ispc.cmake
@@ -84,9 +84,9 @@
   ENDIF()

 	IF (${CMAKE_BUILD_TYPE} STREQUAL "Release")
-    SET(CMAKE_ISPC_OPT_FLAGS "-O3")
+    SET(CMAKE_ISPC_OPT_FLAGS -O3)
 	ELSE()
-    SET(CMAKE_ISPC_OPT_FLAGS "-O2 -g")
+    SET(CMAKE_ISPC_OPT_FLAGS -O2 -g)
 	ENDIF()

   SET(ISPC_OBJECTS "")


cmake: west: do not print error if west topdir fails

`west` is an optional tool.
Although `west` is optional, a developer might be working with both west
and non-west based projects, like
- vanilla Zephyr (using west)
- downstream project (not using west)

and thus have west installed, but not always in use.

In the downstream project scenario not using west, then running CMake
will print the following error:
```
FATAL ERROR: no west workspace found from "<path>/zephyr";
"west topdir" requires one.
Things to try:
  - Change directory to somewhere inside a west workspace and retry.
  - Set ZEPHYR_BASE to a zephyr repository path in a west workspace.
  - Run "west init" to set up a workspace here.
  - Run "west init -h" for additional information.
```

This commit sets `WEST` CMake variable to `WEST-NOTFOUND` when west is
found but Zephyr is not in a west workspace (`west topdir` fails)

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

--- cmake/west.cmake
+++ cmake/west.cmake
@@ -90,7 +90,15 @@
   execute_process(
     COMMAND ${WEST} topdir
     OUTPUT_VARIABLE WEST_TOPDIR
+    ERROR_QUIET
+    RESULT_VARIABLE west_topdir_result
     OUTPUT_STRIP_TRAILING_WHITESPACE
     WORKING_DIRECTORY ${ZEPHYR_BASE}
     )
+
+  if(west_topdir_result)
+    # west topdir is undefined.
+    # That's fine; west is optional, so could be custom Zephyr project.
+    set(WEST WEST-NOTFOUND CACHE INTERNAL "West")
+  endif()
 endif()


CNF: Adding missing otb_module_add_test_mpi() macro

--- CMake/OTBStandaloneModuleMacros.cmake
+++ CMake/OTBStandaloneModuleMacros.cmake
@@ -95,6 +95,26 @@
             -testenv ${TESTAPPLICATION_TESTENVOPTIONS})
   endif()
 endmacro()
+
+#-----------------------------------------------------------------------------
+# Function otb_add_test_mpi to run mpi tests
+function(otb_add_test_mpi)
+   set( _OPTIONS_ARGS )
+   set( _ONE_VALUE_ARGS NAME NBPROCS COMMAND)
+   set( _MULTI_VALUE_ARGS )
+   cmake_parse_arguments( TEST_MPI "${_OPTIONS_ARGS}" "${_ONE_VALUE_ARGS}" "${_MULTI_VALUE_ARGS}" ${ARGN} )
+
+   # Test nb procs
+   if( NOT TEST_MPI_NBPROCS )
+     set(TEST_MPI_NBPROCS 2)
+   endif()
+   # Test command line
+   foreach(arg IN LISTS TEST_MPI_UNPARSED_ARGUMENTS)
+     list(APPEND ARGS ${arg})
+   endforeach()
+   set (test_parameters -np ${TEST_MPI_NBPROCS} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_MPI_COMMAND} ${ARGS})
+   otb_add_test(NAME ${TEST_MPI_NAME} COMMAND ${MPIEXEC} ${test_parameters})
+endfunction()

 macro(otb_module_target_label _target_name)


Update common.cmake for apple and linux/clang features On apple, link with CoreFoundation to allow for Instrumentation testing via Xcode. On Linux with Clang, use libstdc++. On other platforms use libc++. Link with the project library after all additional libraries to catch cross-dependencies.

--- common.cmake
+++ common.cmake
@@ -49,7 +49,11 @@
         set(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE} -O4 -DNDEBUG")
         set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g")

-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+        if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
+        else()
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+        endif()
     elseif(${CMAKE_MAKE_PROGRAM} MATCHES "(msdev|devenv|nmake|MSBuild)")
         add_definitions("/W3")
     else ()


Fix problem with detection python libraries.

--- salome_adm/cmake_files/FindSalomePythonLibs.cmake
+++ salome_adm/cmake_files/FindSalomePythonLibs.cmake
@@ -34,6 +34,7 @@
 IF (SALOMEPYTHONINTERP_FOUND AND NOT "${PYTHON_VERSION_STRING}" STREQUAL "")
    # Trying to search libraries with same version as an interpreter version
    SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
+   SET(PythonLibs_FIND_VERSION_MAJOR ${PYTHON_VERSION_MAJOR})
 ENDIF()
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PythonLibs PYTHON_INCLUDE_DIR 2)


Modifications to propagate the compile and linking options.

--- dynamicsJRLJapan.pc.cmake
+++ dynamicsJRLJapan.pc.cmake
@@ -9,5 +9,5 @@
 Description: ${PROJECT_DESCRIPTION}
 Version: ${PROJECT_VERSION}
 Requires: ${PROJECT_REQUIREMENTS}
-Libs: -L${install_pkg_libdir} -l${PROJECT_NAME}
-Cflags: -I${install_pkg_include_dir}
+Libs:  ${${PROJECT_NAME}_LDFLAGS}
+Cflags: -I${install_pkg_include_dir} ${${PROJECT_NAME}_CXXFLAGS}


cmake: add documentation for px4_posix_generate_alias and px4_posix_generate_symlinks

--- platforms/posix/cmake/px4_impl_os.cmake
+++ platforms/posix/cmake/px4_impl_os.cmake
@@ -104,7 +104,30 @@
 endfunction()

-# TODO: document API
+#=============================================================================
+#
+#	px4_posix_generate_alias
+#
+#	This function generates the px4-alias.sh script containing the command
+#	aliases for all modules and commands.
+#
+#	Usage:
+#		px4_posix_generate_alias(
+#			MODULE_LIST <in-list>
+#			OUT <file>
+#			PREFIX <prefix>)
+#
+#	Input:
+#		MODULE_LIST	: list of modules
+#		PREFIX	: command prefix (e.g. "px4-")
+#
+#	Output:
+#		OUT	: px4-alias.sh file path
+#
+#	Example:
+#		px4_posix_generate_alias(
+#			OUT <generated-src> MODULE_LIST px4_simple_app PREFIX px4-)
+#
 function(px4_posix_generate_alias)
 	px4_parse_function_args(
 		NAME px4_posix_generate_alias
@@ -133,7 +156,27 @@
 endfunction()

-# TODO: document API
+#=============================================================================
+#
+#	px4_posix_generate_symlinks
+#
+#	This function generates symlinks for all modules/commands.
+#
+#	Usage:
+#		px4_posix_generate_symlinks(
+#			TARGET <target>
+#			MODULE_LIST <in-list>
+#			PREFIX <prefix>)
+#
+#	Input:
+#		MODULE_LIST	: list of modules
+#		PREFIX	: command prefix (e.g. "px4-")
+#		TARGET	: cmake target for which the symlinks should be created
+#
+#	Example:
+#		px4_posix_generate_symlinks(
+#			TARGET px4 MODULE_LIST px4_simple_app PREFIX px4-)
+#
 function(px4_posix_generate_symlinks)
 	px4_parse_function_args(
 		NAME px4_posix_generate_symlinks