Unix/Build: use -fsigned-char

Unix/Build: use -fsigned-char

Some architectures including ARM assumes that plain char is
unsigned unlike x64.

Because CoreCLR has been assuming char is signed, we need to
explictly tell the toolchain the signedness of char type.

Fix #4746

Signed-off-by: MyungJoo Ham <84146178f7c201fa3079bfc93fccba71d81dffe3@samsung.com>

--- compileoptions.cmake
+++ compileoptions.cmake
@@ -41,6 +41,10 @@
   # to a struct or a class that has virtual members or a base class. In that case, clang
   # may not generate the same object layout as MSVC.
   add_compile_options(-Wno-incompatible-ms-struct)
+
+  # Some architectures (e.g., ARM) assume char type is unsigned while CoreCLR assumes char is signed
+  # as x64 does. It has been causing issues in ARM (https://github.com/dotnet/coreclr/issues/4746)
+  add_compile_options(-fsigned-char)

 endif(CLR_CMAKE_PLATFORM_UNIX)


[CMake] Stop building eprintf library on Darwin

In r278988 clang stopped using the eprintf library, so we should stop generating it too.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@279090 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -256,30 +256,6 @@
   set(${output_var} ${intermediate} PARENT_SCOPE)
 endfunction()

-function(darwin_add_eprintf_library)
-  cmake_parse_arguments(LIB
-    ""
-    ""
-    "CFLAGS"
-    ${ARGN})
-
-  add_library(clang_rt.eprintf STATIC eprintf.c)
-  set_target_compile_flags(clang_rt.eprintf
-    -isysroot ${DARWIN_osx_SYSROOT}
-    ${DARWIN_osx_BUILTIN_MIN_VER_FLAG}
-    -arch i386
-    ${LIB_CFLAGS})
-  set_target_properties(clang_rt.eprintf PROPERTIES
-      OUTPUT_NAME clang_rt.eprintf${COMPILER_RT_OS_SUFFIX})
-  set_target_properties(clang_rt.eprintf PROPERTIES
-    OSX_ARCHITECTURES i386)
-  add_dependencies(builtins clang_rt.eprintf)
-  set_target_properties(clang_rt.eprintf PROPERTIES
-        ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
-  install(TARGETS clang_rt.eprintf
-      ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
-endfunction()
-
 # Generates builtin libraries for all operating systems specified in ARGN. Each
 # OS library is constructed by lipo-ing together single-architecture libraries.
 macro(darwin_add_builtin_libraries)
@@ -349,8 +325,6 @@
                       INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR})
     endif()
   endforeach()
-
-  darwin_add_eprintf_library(CFLAGS ${CFLAGS})

   # We put the x86 sim slices into the archives for their base OS
   foreach (os ${ARGN})


Move cmake pop check state to correct place

--- cmake/Modules/SafeCheckSymbolExists.cmake
+++ cmake/Modules/SafeCheckSymbolExists.cmake
@@ -26,9 +26,8 @@
 	list (APPEND CMAKE_REQUIRED_DEFINITIONS
 		     ${DEFS})

+	check_symbol_exists ("${SYMBOL}" "${FILES}" "${VARIABLE}")
 	cmake_pop_check_state ()
-	check_symbol_exists ("${SYMBOL}" "${FILES}" "${VARIABLE}")
-
 	set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS_OLD})
 endmacro ()


[fixed] BOTG_INCLUDE

[fixed] BOTG_INCLUDE

--- cmake/BOTG_INCLUDE.cmake
+++ cmake/BOTG_INCLUDE.cmake
@@ -18,9 +18,9 @@
         ENDIF()
         GET_FILENAME_COMPONENT( dir "${ep}" DIRECTORY )
         GET_FILENAME_COMPONENT( project "${ep}" NAME_WE )
-        SET( BOTG_EXTERNAL_SOURCE_DIR_${project} "${dir}/${project}" CACHE PATH INTERNAL)
+        SET( BOTG_EXTERNAL_SOURCE_DIR_${project} "${CMAKE_CURRENT_SOURCE_DIR}/${dir}/${project}" CACHE PATH INTERNAL)

-        SET( dest "${CMAKE_BINARY_DIR}/_DOWNLOAD/${botg_external_source_dir}" )
+        SET( dest "${CMAKE_BINARY_DIR}/_DOWNLOAD/${dir}/${project}" )
         MESSAGE( STATUS "[BootsOnTheGround] bootstrapping project ${ep} ... ")

         CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ep}" "${dest}/CMakeLists.txt" )


Adding correct hdf5 path

Adding correct hdf5 path

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -25,7 +25,7 @@

 # ---[ HDF5
 find_package(HDF5 COMPONENTS HL REQUIRED)
-include_directories(SYSTEM ${HDF5_INCLUDE_DIRS})
+include_directories(SYSTEM ${HDF5_INCLUDE_DIRS} ${HDF5_HL_INCLUDE_DIR})
 list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES})

 # ---[ LMDB


this is a bit more readable

this is a bit more readable

--- cmake/FindFreeRTOS.cmake
+++ cmake/FindFreeRTOS.cmake
@@ -77,7 +77,11 @@
     find_path(FreeRTOS_${PORT}_PATH
         NAMES portmacro.h
         PATHS "${FREERTOS_PATH}" "${FREERTOS_PATH}/FreeRTOS"
-        PATH_SUFFIXES "portable/GCC/${PORT}/r0p1" "Source/portable/GCC/${PORT}"  "Source/portable/GCC/${PORT}/r0p1"
+        PATH_SUFFIXES
+            "portable/GCC/${PORT}/r0p1"
+            "portable/GCC/${PORT}"
+            "Source/portable/GCC/${PORT}"
+            "Source/portable/GCC/${PORT}/r0p1"
         NO_DEFAULT_PATH
     )


set var

set var

--- cmake/FindOpenBLAS.cmake
+++ cmake/FindOpenBLAS.cmake
@@ -6,8 +6,6 @@
         /usr/local/include/openblas
         /usr/local/include/openblas-base
         /opt/OpenBLAS/include
-        $ENV{OpenBLAS_HOME}
-        $ENV{OpenBLAS_HOME}/include
         )

 SET(Open_BLAS_LIB_SEARCH_PATHS
@@ -20,10 +18,6 @@
         /usr/local/lib
         /usr/local/lib64
         /opt/OpenBLAS/lib
-        $ENV{OpenBLAS}cd
-        $ENV{OpenBLAS}/lib
-        $ENV{OpenBLAS_HOME}
-        $ENV{OpenBLAS_HOME}/lib
         )

 FIND_PATH(OpenBLAS_INCLUDE_DIR NAMES cblas.h PATHS ${Open_BLAS_INCLUDE_SEARCH_PATHS})


switched back to old embree 2.2

switched back to old embree 2.2

--- cmake/build_embree.cmake
+++ cmake/build_embree.cmake
@@ -122,14 +122,12 @@
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/builders/heuristic_strand_partition.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/builders/heuristic_fallback.cpp

-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/bezier1.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/bezier1i.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/triangle1.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/triangle4.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/triangle1v.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/triangle4v.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/triangle4i.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/ispc_wrapper_sse.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/instance_intersector1.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/instance_intersector4.cpp

@@ -139,22 +137,25 @@
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_fast.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_morton.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_binner.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_toplevel.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector1.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector4_chunk.cpp
     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_statistics.cpp

-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_builder.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector1.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector4.cpp
-
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_statistics.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_builder.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector1.cpp
-    ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector4.cpp
+# remove for embree 2.3.3:
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/bezier1.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/ispc_wrapper_sse.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_binner.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_builder.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector1.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector4.cpp
+
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_statistics.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_builder.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector1.cpp
+     ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector4.cpp
     )

   # ------------------------------------------------------------------
@@ -178,10 +179,11 @@
       (${OSPRAY_XEON_TARGET} STREQUAL "SSE41") OR
       (${OSPRAY_XEON_TARGET} STREQUAL "SSE"))
     OSPRAY_ADD_LIBRARY(ospray_embree_sse41 STATIC
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_binner.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_toplevel.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector1.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector4_chunk.cpp
+# remove for embree 2.3.3:
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_builder_binner.cpp
       )
     SET_TARGET_PROPERTIES(ospray_embree_sse41 PROPERTIES COMPILE_FLAGS "${OSPRAY_ARCH_SSE41}")
     TARGET_LINK_LIBRARIES(ospray_embree ospray_embree_sse41)
@@ -217,7 +219,6 @@
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/builders/heuristic_fallback.cpp

       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/triangle8.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/ispc_wrapper_avx.cpp

       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/instance_intersector1.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/instance_intersector4.cpp
@@ -233,16 +234,6 @@
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector4_hybrid.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector8_chunk.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4/bvh4_intersector8_hybrid.cpp
-
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_builder.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector1.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector4.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector8.cpp
-
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_builder.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector1.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector4.cpp
-      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector8.cpp

       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh8/bvh8.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh8/bvh8_builder.cpp
@@ -251,6 +242,18 @@
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh8/bvh8_intersector4_hybrid.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh8/bvh8_intersector8_chunk.cpp
       ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh8/bvh8_intersector8_hybrid.cpp
+
+# remove for embree 2.3.3:
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/geometry/ispc_wrapper_avx.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_builder.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector1.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector4.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4mb/bvh4mb_intersector8.cpp
+
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_builder.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector1.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector4.cpp
+      ${OSPRAY_EMBREE_SOURCE_DIR}/kernels/xeon/bvh4hair/bvh4hair_intersector8.cpp
       )
     SET_TARGET_PROPERTIES(ospray_embree_avx PROPERTIES COMPILE_FLAGS "${OSPRAY_ARCH_AVX}")
     TARGET_LINK_LIBRARIES(ospray_embree ospray_embree_avx)


Patch for NDK r10

Patch for NDK r10

--- platforms/android/android.toolchain.cmake
+++ platforms/android/android.toolchain.cmake
@@ -301,6 +301,8 @@
 #     [+] updated for NDK r9c
 #   - January 2014
 #     [~] fix copying of shared STL
+#   - October 2014
+#     [~] fix NATIVE_API_LEVEL detection for NDK r10
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -423,12 +425,18 @@
 endmacro()

 macro( __DETECT_NATIVE_API_LEVEL _var _path )
- SET( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*$" )
- FILE( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
- if( NOT __apiFileContent )
-  message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
- endif()
- string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
+ list(APPEND __ndkApiLevelRegexList
+  "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9])[\t ]*$"
+  "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+[0-9]+[\t ]+.*([A-Z]).*$"
+ )
+ foreach( __ndkApiLevelRegex IN LISTS __ndkApiLevelRegexList)
+  FILE( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
+  if( __apiFileContent )
+   string( REGEX REPLACE "${__ndkApiLevelRegex}" "\\1" ${_var} "${__apiFileContent}" )
+   break()
+  endif()
+ endforeach()
+ unset( __ndkApiLevelRegexList )
  unset( __apiFileContent )
  unset( __ndkApiLevelRegex )
 endmacro()
@@ -874,7 +882,7 @@
 else()
  if( BUILD_WITH_ANDROID_NDK )
   __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
-  if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
+  if( NOT __realApiLevel STREQUAL ANDROID_NATIVE_API_LEVEL )
    message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
   endif()
   unset( __realApiLevel )


Adopt the FindGLIB2.cmake from kdelibs.

Adopt the FindGLIB2.cmake from kdelibs.

BUG: 247546

--- cmake/FindGLIB2.cmake
+++ cmake/FindGLIB2.cmake
@@ -5,36 +5,45 @@
 #  GLIB2_INCLUDE_DIR - the glib2 include directory
 #  GLIB2_LIBRARIES - glib2 library

+# Copyright (c) 2008 Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+

 if(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)
     # Already in cache, be silent
     set(GLIB2_FIND_QUIETLY TRUE)
 endif(GLIB2_INCLUDE_DIR AND GLIB2_LIBRARIES)

-if (NOT WIN32)
-   find_package(PkgConfig REQUIRED)
-   pkg_check_modules(PKG_GLIB REQUIRED glib-2.0)
-endif(NOT WIN32)
+find_package(PkgConfig)
+pkg_check_modules(PC_LibGLIB2 QUIET glib-2.0)

-find_path(GLIB2_MAIN_INCLUDE_DIR glib.h
-          PATH_SUFFIXES glib-2.0
-          PATHS ${PKG_GLIB_INCLUDE_DIRS} )
+find_path(GLIB2_MAIN_INCLUDE_DIR
+          NAMES glib.h
+          HINTS ${PC_LibGLIB2_INCLUDEDIR}
+          PATH_SUFFIXES glib-2.0)
+
+find_library(GLIB2_LIBRARY
+             NAMES glib-2.0
+             HINTS ${PC_LibGLIB2_LIBDIR}
+)
+
+set(GLIB2_LIBRARIES ${GLIB2_LIBRARY})

 # search the glibconfig.h include dir under the same root where the library is found
-find_library(GLIB2_LIBRARIES
-             NAMES glib-2.0
-             PATHS ${PKG_GLIB_LIBRARY_DIRS} )
+get_filename_component(glib2LibDir "${GLIB2_LIBRARIES}" PATH)

 find_path(GLIB2_INTERNAL_INCLUDE_DIR glibconfig.h
-          PATH_SUFFIXES glib-2.0/include ../lib/glib-2.0/include
-          PATHS ${PKG_GLIB_INCLUDE_DIRS} ${PKG_GLIB_LIBRARIES} ${CMAKE_SYSTEM_LIBRARY_PATH})
+          PATH_SUFFIXES glib-2.0/include
+          HINTS ${PC_LibGLIB2_INCLUDEDIR} "${glib2LibDir}" ${CMAKE_SYSTEM_LIBRARY_PATH})

-set(GLIB2_INCLUDE_DIR ${GLIB2_MAIN_INCLUDE_DIR})
+set(GLIB2_INCLUDE_DIR "${GLIB2_MAIN_INCLUDE_DIR}")

 # not sure if this include dir is optional or required
 # for now it is optional
 if(GLIB2_INTERNAL_INCLUDE_DIR)
-  set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} ${GLIB2_INTERNAL_INCLUDE_DIR})
+  set(GLIB2_INCLUDE_DIR ${GLIB2_INCLUDE_DIR} "${GLIB2_INTERNAL_INCLUDE_DIR}")
 endif(GLIB2_INTERNAL_INCLUDE_DIR)

 include(FindPackageHandleStandardArgs)


fix gtest cmake module

fix gtest cmake module

Find GTest library when ESN uses system installed GTest library.

--- cmake/FindGTest.cmake
+++ cmake/FindGTest.cmake
@@ -16,6 +16,19 @@
     set(GTEST_LIBRARIES gtest)
     set(GTEST_INCLUDE_DIRS
         "${CMAKE_BINARY_DIR}/gtest/src/gtest-project/include")
+else()
+    find_library(
+        GTEST_LIBRARIES gtest
+        HINTS
+            ENV GTEST_ROOT
+            ${GTEST_ROOT}
+    )
+    find_path(
+        GTEST_INCLUDE_DIRS gtest/gtest.h
+        HINTS
+            $ENV{GTEST_ROOT}/include
+            ${GTEST_ROOT}/include
+    )
 endif()

 find_package_handle_standard_args(


Fix FindHoard.cmake script

Fix FindHoard.cmake script

--- cmake/FindHoard.cmake
+++ cmake/FindHoard.cmake
@@ -44,4 +44,5 @@
 endif ()

 mark_as_advanced(
-  Hoard_LIB+  Hoard_LIBRARIES
+)


Update FindMySQL.cmake

Update FindMySQL.cmake

--- cmake/FindMySQL.cmake
+++ cmake/FindMySQL.cmake
@@ -72,7 +72,7 @@
 			  "/usr/mysql/include/mysql" )

 	find_path( MYSQL_LIBRARY_PATH
-		NAMES "libmysql.a" "libmysqlclient_r.a" "libmysql.so" "libmysqlclient_r.so"
+		NAMES libmysqlclient_r.a libmysqlclient_r.so
 		PATHS "${EXTERNAL_BINARY_DIR}"
 			  "$ENV{HOME}/mysql/lib"
 			  "/lib/mysql"
@@ -86,7 +86,7 @@
               "/usr/lib/x86_64-linux-gnu" )

 	find_library( MYSQL_LIBRARY
-		NAMES "libmysql" "mysqlclient_r"
+		NAMES mysqlclient mysqlclient_r
 		PATHS "${EXTERNAL_BINARY_DIR}"
 			  "$ENV{HOME}/mysql/lib"
 			  "/lib/mysql"


Refactor FindXmlTo.cmake script

Refactor FindXmlTo.cmake script

Refactor FindXmlTo to use FindPackageHandleStandardArgs to have less
to maintain.  Also mark the XMLTO_EXECUTABLE variable as advanced so
it doesn't appear in the GUI by default

--- cmake/FindXmlTo.cmake
+++ cmake/FindXmlTo.cmake
@@ -2,23 +2,18 @@
 # This will convert XML docBook files to various formats like:
 # man html txt dvi ps pdf
 #  macro XMLTO(outfiles infiles... MODES modes...)
-
-set ( XmlTo_FOUND false )

 find_program ( XMLTO_EXECUTABLE
   NAMES xmlto
   DOC   "path to the xmlto docbook xslt frontend"
 )

-if ( XMLTO_EXECUTABLE )
-  set ( XmlTo_FOUND true )
-endif ( XMLTO_EXECUTABLE )

-if ( NOT XmlTo_FIND_QUIETLY )
-  if ( XmlTo_FIND_REQUIRED )
-    FATAL_ERROR ( "xmlto not found" )
-  endif ( XmlTo_FIND_REQUIRED )
-endif ( NOT XmlTo_FIND_QUIETLY )
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(XmlTo
+  REQUIRED_VARS XMLTO_EXECUTABLE)
+
+mark_as_advanced( XMLTO_EXECUTABLE )

 macro ( _XMLTO_FILE outfiles mode)
   #special settings


config-ix.cmake: Tweak stray endif(...) to suppress a warning in CMake.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -313,7 +313,7 @@
       message(STATUS "Adding LZMA as a dep to XML2 for cross-compilation, make sure liblzma.a is available.")
       set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} "-llzma")
     endif ()
-  endif ( CMAKE_CROSSCOMPILING )
+  endif ()
 endif ()

 include(CheckCXXCompilerFlag)


Replace cmake check for printf with a check for fopen.

Printf is a builtin, and the check fails with -Werror because of a clang
warning about an incompatible redeclaration.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@255189 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -68,7 +68,7 @@
 check_symbol_exists(__func__ "" COMPILER_RT_HAS_FUNC_SYMBOL)

 # Libraries.
-check_library_exists(c printf "" COMPILER_RT_HAS_LIBC)
+check_library_exists(c fopen "" COMPILER_RT_HAS_LIBC)
 check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL)
 check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT)
 check_library_exists(m pow "" COMPILER_RT_HAS_LIBM)


Silenced Latex output

Silenced Latex output

--- cmake/createDoc.cmake
+++ cmake/createDoc.cmake
@@ -37,10 +37,10 @@
 			DEPENDS ${PROJECT_BINARY_DIR}/doc/latex/refman.tex
 			WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/doc/latex/
 			COMMAND ${LATEX}
-			ARGS ${PROJECT_BINARY_DIR}/doc/latex/refman.tex
+			ARGS -quiet ${PROJECT_BINARY_DIR}/doc/latex/refman.tex
 		    # run latex twice to get references right (normal use case of latex, don't ask why)
 			COMMAND ${LATEX}
-			ARGS ${PROJECT_BINARY_DIR}/doc/latex/refman.tex
+			ARGS -quiet ${PROJECT_BINARY_DIR}/doc/latex/refman.tex
 			COMMAND ${CMAKE_COMMAND}
 			ARGS -E copy ${PROJECT_BINARY_DIR}/doc/latex/refman.pdf ${PROJECT_BINARY_DIR}/doc/tiglRef.pdf
 		)
@@ -61,10 +61,10 @@
             # create directory for latex build
             # build pdf
 			COMMAND ${LATEX}
-			ARGS tiglGuide.tex
+			ARGS -quiet tiglGuide.tex
 			# run latex twice to get references right (normal use case of latex, don't ask why)
 		    COMMAND ${LATEX}
-			ARGS tiglGuide.tex
+			ARGS -quiet tiglGuide.tex
 		)

         # TIGL Changelog
@@ -83,10 +83,10 @@
             # create directory for latex build
             # build pdf
 			COMMAND ${LATEX}
-			ARGS changeLog.tex
+			ARGS -quiet changeLog.tex
 			# run latex twice to get references right (normal use case of latex, don't ask why)
 		    COMMAND ${LATEX}
-			ARGS changeLog.tex
+			ARGS -quiet changeLog.tex
 		)

 		add_custom_target(pdf


Enable building in Debug mode if the user really wants this (#230)

Also inform the user about slow performance if they do this.

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -99,7 +99,16 @@
   elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
     google_add_flag(GOOG_CXX_FLAGS "-O3 -g -DNDEBUG")
   elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
-    message(FATAL_ERROR "Compiling in debug mode is not supported.")
+    if(FORCE_DEBUG_BUILD)
+      message(WARNING "Building in Debug mode, expect very slow performance.")
+      google_add_flag(GOOG_CXX_FLAGS "-g")
+    else()
+      message(FATAL_ERROR
+        "Compiling in Debug mode is not supported and can cause severely degraded performance. "
+        "You should change the build type to Release. If you want to build in Debug mode anyway, "
+        "call CMake with -DFORCE_DEBUG_BUILD=True"
+      )
+    endif()
   else()
     message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
   endif()


Don't strip haka patch version even if it is 0

--- build/Package.cmake
+++ build/Package.cmake
@@ -12,11 +12,7 @@
 set(CPACK_PACKAGE_VERSION_MINOR ${HAKA_VERSION_MINOR})
 set(CPACK_PACKAGE_VERSION_PATCH ${HAKA_VERSION_PATCH})

-if(${HAKA_VERSION_PATCH} GREATER 0)
-	set(CPACK_PACKAGE_VERSION "${HAKA_VERSION_MAJOR}.${HAKA_VERSION_MINOR}.${HAKA_VERSION_PATCH}${HAKA_VERSION_BUILD}")
-else()
-	set(CPACK_PACKAGE_VERSION "${HAKA_VERSION_MAJOR}.${HAKA_VERSION_MINOR}${HAKA_VERSION_BUILD}")
-endif()
+set(CPACK_PACKAGE_VERSION "${HAKA_VERSION_MAJOR}.${HAKA_VERSION_MINOR}.${HAKA_VERSION_PATCH}${HAKA_VERSION_BUILD}")

 string(TOLOWER ${CMAKE_BUILD_TYPE} build)
 set(CPACK_PACKAGE_FULLNAME "${CPACK_PACKAGE_NAME}-${build}-${CMAKE_LUA}")


Update ConsoleApplication.cmake

Update ConsoleApplication.cmake

--- build/cmake/ConsoleApplication.cmake
+++ build/cmake/ConsoleApplication.cmake
@@ -1,18 +1,18 @@
-function(add_console_application BINARY_NAME ${SRC_LIST} ${HDR_LIST} ${INL_LIST} ${RES_LIST} ${LIB_LIST})
-
-if(APP_VERSION_MAJOR)
-  set(PREPROCESSOR_DEFINITIONS "${PREPROCESSOR_DEFINITIONS} -DSE_APP_VERSION_MAJOR=${APP_VERSION_MAJOR}")
-endif()
-if(APP_VERSION_MINOR)
-  set(PREPROCESSOR_DEFINITIONS "${PREPROCESSOR_DEFINITIONS} -DSE_APP_VERSION_MINOR=${APP_VERSION_MINOR}")
-endif()
-if(APP_VERSION_MAINTENANCE)
-  set(PREPROCESSOR_DEFINITIONS "${PREPROCESSOR_DEFINITIONS} -DSE_APP_VERSION_MAINTENANCE=${APP_VERSION_MAINTENANCE}")
-endif()
-
-add_definitions(${PREPROCESSOR_DEFINITIONS})
-source_group("Source Files" FILES ${SRC_LIST} ${INL_LIST})
-add_executable(${BINARY_NAME} ${SRC_LIST} ${HDR_LIST} ${INL_LIST} ${RES_LIST})
-target_link_libraries(${BINARY_NAME} ${LIB_LIST})
-
+function(add_console_application BINARY_NAME ${SRC_LIST} ${HDR_LIST} ${INL_LIST} ${RES_LIST} ${LIB_LIST})
+
+if(APP_VERSION_MAJOR)
+  set(PREPROCESSOR_DEFINITIONS "${PREPROCESSOR_DEFINITIONS} -DTG_APP_VERSION_MAJOR=${APP_VERSION_MAJOR}")
+endif()
+if(APP_VERSION_MINOR)
+  set(PREPROCESSOR_DEFINITIONS "${PREPROCESSOR_DEFINITIONS} -DTG_APP_VERSION_MINOR=${APP_VERSION_MINOR}")
+endif()
+if(APP_VERSION_MAINTENANCE)
+  set(PREPROCESSOR_DEFINITIONS "${PREPROCESSOR_DEFINITIONS} -DTG_APP_VERSION_MAINTENANCE=${APP_VERSION_MAINTENANCE}")
+endif()
+
+add_definitions(${PREPROCESSOR_DEFINITIONS})
+source_group("Source Files" FILES ${SRC_LIST} ${INL_LIST})
+add_executable(${BINARY_NAME} ${SRC_LIST} ${HDR_LIST} ${INL_LIST} ${RES_LIST})
+target_link_libraries(${BINARY_NAME} ${LIB_LIST})
+
 endfunction(add_console_application)


Fix bug compiling DCCL from package

Fix bug compiling DCCL from package

--- software/network/cmake/FindGoby.cmake
+++ software/network/cmake/FindGoby.cmake
@@ -52,8 +52,10 @@

   if(NOT (GOBY_VERSION_MAJOR EQUAL "2" AND GOBY_VERSION_MINOR EQUAL "0"))
     find_package(DCCL)
-    include_directories("${DCCL_INCLUDE_DIR}")
-    protobuf_include_dirs("${DCCL_INCLUDE_DIR}")
+    if(DEFINED DCCL_INCLUDE_DIR)
+      include_directories("${DCCL_INCLUDE_DIR}")
+      protobuf_include_dirs("${DCCL_INCLUDE_DIR}")
+      endif()
     set(DCCL_LIBRARIES dccl)
   endif()


Make FindGMP also find mpir

Make FindGMP also find mpir

--- cmake/FindGMP.cmake
+++ cmake/FindGMP.cmake
@@ -34,7 +34,7 @@
 endif()

 find_path(GMP_INCLUDE_DIR NAMES gmp.h)
-find_library(GMP_LIBRARY NAMES gmp)
+find_library(GMP_LIBRARY NAMES gmp mpir)

 include(FindPackageHandleStandardArgs)


FindHIP: added new macro HIP_RESET_FLAGS

Change-Id: I0af491f6689abf1c1b5691261fe1f3e61a5d916d


Changes to PCH on Linux

Changes to PCH on Linux

* pch binary goes to CMAKE_CURRENT_BINARY_DIR
* Correct -std=c++XX flag is used
* This works

--- cmake/add_pch.cmake
+++ cmake/add_pch.cmake
@@ -49,7 +49,9 @@
   IF(CMAKE_COMPILER_IS_GNUCXX)
     GET_FILENAME_COMPONENT(_name ${_input} NAME)
     SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
-    SET(_output "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.gch")
+    SET(_outdir "${CMAKE_CURRENT_BINARY_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}})
@@ -99,12 +101,14 @@
       list(APPEND _compiler_FLAGS "${item}")
     ENDFOREACH(item)

+    get_target_property(_cxx_std ${_targetName} CXX_STANDARD)
+
     SEPARATE_ARGUMENTS(_compiler_FLAGS)
     #STRING(REPLACE ";" "\t" _compiler_FLAGS "${_compiler_FLAGS}")
-    MESSAGE("${CMAKE_CXX_COMPILER} -DPCHCOMPILE ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source}")
+    MESSAGE("${CMAKE_CXX_COMPILER} -DPCHCOMPILE ${_compiler_FLAGS} -x c++-header -std=c++${_cxx_std} -o ${_output} ${_source}")
     ADD_CUSTOM_COMMAND(
       OUTPUT ${_output}
-      COMMAND ${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source}
+      COMMAND ${CMAKE_CXX_COMPILER} ${_compiler_FLAGS} -x c++-header -std=c++${_cxx_std} -o ${_output} ${_source}
       DEPENDS ${_source} ${IRRLICHT_HEADERS} )
     ADD_CUSTOM_TARGET(${_targetName}_gch DEPENDS ${_output})
     ADD_DEPENDENCIES(${_targetName} ${_targetName}_gch)


There's no systemd socket activation support yet

--- cmake/systemd.cmake
+++ cmake/systemd.cmake
@@ -18,7 +18,7 @@

 MACRO(CHECK_SYSTEMD)
   IF(UNIX)
-    SET(WITH_SYSTEMD "auto" CACHE STRING "Compile with systemd socket activation and notification")
+    SET(WITH_SYSTEMD "auto" CACHE STRING "Enable systemd scripts and notification support")
     IF(WITH_SYSTEMD STREQUAL "yes" OR WITH_SYSTEMD STREQUAL "auto")
       IF(PKG_CONFIG_FOUND)
         IF(WITH_SYSTEMD STREQUAL "yes")


Mac: v0.2.9

Mac: v0.2.9


CTest: Promote simserv04 to the list of official regression testers

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32943 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/scripts/run_testsuite.cmake
+++ deal.II/cmake/scripts/run_testsuite.cmake
@@ -245,7 +245,7 @@
 MESSAGE("-- CTEST_SITE:             ${CTEST_SITE}")

 IF( "${TRACK}" STREQUAL "Regression Tests"
-    AND NOT CTEST_SITE MATCHES "tester" )
+    AND NOT CTEST_SITE MATCHES "^(simserv04|tester)$" )
   MESSAGE(FATAL_ERROR "
 I'm sorry ${CTEST_SITE}, I'm afraid I can't do that.
 The TRACK \"Regression Tests\" is not for you.


Add initial support for ARMV9 Cortex 510/710/X1/X2

--- cmake/cc.cmake
+++ cmake/cc.cmake
@@ -156,6 +156,30 @@
 endif ()

 if (${CORE} STREQUAL ARMV8SVE)
+  if (NOT DYNAMIC_ARCH)
+    set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
+  endif ()
+endif ()
+
+if (${CORE} STREQUAL CORTEXA510)
+  if (NOT DYNAMIC_ARCH)
+    set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
+  endif ()
+endif ()
+
+if (${CORE} STREQUAL CORTEXA710)
+  if (NOT DYNAMIC_ARCH)
+    set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
+  endif ()
+endif ()
+
+if (${CORE} STREQUAL CORTEXX1)
+  if (NOT DYNAMIC_ARCH)
+    set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
+  endif ()
+endif ()
+
+if (${CORE} STREQUAL CORTEXX2)
   if (NOT DYNAMIC_ARCH)
     set (CCOMMON_OPT "${CCOMMON_OPT} -march=armv8-a+sve")
   endif ()


fix: Qt5::Widgets is invalid for pkgconfig (#62)

--- cmake/qt.cmake
+++ cmake/qt.cmake
@@ -3,4 +3,4 @@
 include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
 target_link_libraries(${bin} Qt5::Widgets)

-set(${bin}_pkg_config_requires ${${bin}_pkg_config_requires} Qt5::Widgets)
+set(${bin}_pkg_config_requires ${${bin}_pkg_config_requires} Qt5Widgets)


[CMAKE] Fix the build with Xcode as a generator

Summary:
Xcode (like Visual Studio) manages build configurations from the IDE and
append this configuration name as a subdirectory for the built targets.
It allows the tools to maintain several configuration builds under the
same tree.

This is causing an issue with native executables, as it becomes
impossible to retrieve the path to the generated native executable.

This diff solves the issue by disabling the subfolder creation for
native executables.
One consequence is that the binary might be overriden on configuration
change. This is unlikely to occur because the configuration is not
passed down when building the native executables, so it should always
fallback to use the same default configuration.

This does not solve all the issues, e.g. the `check` target still fails
to find the `test_bitcoin` executable (the target path expansion does
not work since it's wrapped into a shell script). This is left for
another diff.

Depends on D5333.

Test Plan:
Test there is no regression with `ninja` ...:
  cmake -GNinja ..
  ninja

... nor `make`:
  cmake -G"Unix Makefiles" ..
  make

The build now succeeds with `Xcode` (run on OSX):
  cmake -GXcode ..
  cmake --build ${PWD} # No idea how to invoke xcode, but cmake knows !

Run the Gitian builds.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5338

--- cmake/modules/NativeExecutable.cmake
+++ cmake/modules/NativeExecutable.cmake
@@ -16,6 +16,16 @@
 function(add_native_executable NAME)
 	if(__IS_NATIVE_BUILD)
 		add_executable(${NAME} EXCLUDE_FROM_ALL ${ARGN})
+		# Multi-configuration generators (VS, Xcode) append a per-configuration
+		# subdirectory to the specified directory unless the
+		# `RUNTIME_OUTPUT_DIRECTORY` property is defined using a generator
+		# expression.
+		# Since we don't care about the build configuration for native
+		# executables, we can simply drop this subdirectory.
+		# Doing so ensure that the path to the binary can always be retrieved.
+		set_target_properties(${NAME} PROPERTIES
+			RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<0:>"
+		)
 	else()
 		set(NATIVE_TARGET "${NAME}")
 		file(RELATIVE_PATH RELATIVE_PATH "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")


Split off 7.8.26

Split off 7.8.26

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
-set ( HPCC_POINT 25 )
+set ( HPCC_POINT 27 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 8.0.4

Split off 8.0.4

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 3 )
+set ( HPCC_POINT 5 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 7.12.106

Split off 7.12.106

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 12 )
-set ( HPCC_POINT 105 )
+set ( HPCC_POINT 107 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Adding large file flags to FindSeqAn.cmake.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@9426 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -22,6 +22,7 @@
         # For the GCC, enable warnings.
         set (CMAKE_CXX_WARNING_LEVEL 4)
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -W -Wall -Wno-long-long -fstrict-aliasing -Wstrict-aliasing")
+        add_definitions (-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)

         # Determine GCC version.
         # message("Determining GCC version.")


Enabling unwind semantics for MSVC (<locale> warns otherwise).

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@11091 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -184,6 +184,8 @@
         # Warning level 3 for MSVC is disabled for now to see how much really bad warnings there are.
         #set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3)
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2")
+        # Enable unwind semantics.  <locale> (which itself includes <xlocale>) needs this or triggers a warning.
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
     endif (MSVC)

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


Don't set subsystem for all executables

Don't set subsystem for all executables

--- cmake/Utils.cmake
+++ cmake/Utils.cmake
@@ -26,7 +26,7 @@
 endfunction(nucleus_add_library)

 function(nucleus_add_executable name)
-    add_executable(${name} WIN32 MACOSX_BUNDLE ${ARGN})
+    add_executable(${name} ${ARGN})

     if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
         # Enable warnings and multi-process compilation.


The boost config should go into build/ecto/include ...  The config file exposes this to the rest of the kitchen.

--- cmake/boost.cmake
+++ cmake/boost.cmake
@@ -50,8 +50,3 @@
 endif()

 configure_file(${ecto_SOURCE_DIR}/cmake/boost-config.hpp.in ${ecto_BINARY_DIR}/include/ecto/boost-config.hpp)
-if(ecto_kitchen_BINARY_DIR)
-  configure_file(${ecto_SOURCE_DIR}/cmake/boost-config.hpp.in
-    ${ecto_kitchen_BINARY_DIR}/include/ecto/boost-config.hpp)
-endif()
-


Update cmake helper to support VS 2019

Update cmake helper to support VS 2019

--- cmake/conan.cmake
+++ cmake/conan.cmake
@@ -52,6 +52,8 @@
         set(${result} 14 PARENT_SCOPE)
     elseif(NOT MSVC_VERSION VERSION_LESS 1910 AND MSVC_VERSION VERSION_LESS 1920)
         set(${result} 15 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1920 AND MSVC_VERSION VERSION_LESS 1930)
+        set(${result} 16 PARENT_SCOPE)
     else()
         message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]")
     endif()
@@ -122,7 +124,7 @@
         set(_CONAN_SETTING_COMPILER gcc)
         set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION})
         if (USING_CXX)
-            conan_cmake_detect_gnu_libcxx(_LIBCXX)
+            conan_cmake_detect_unix_libcxx(_LIBCXX)
             set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
         endif ()
     elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL AppleClang)
@@ -133,37 +135,29 @@
         set(_CONAN_SETTING_COMPILER apple-clang)
         set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR})
         if (USING_CXX)
-            set(_CONAN_SETTING_COMPILER_LIBCXX libc++)
+            conan_cmake_detect_unix_libcxx(_LIBCXX)
+            set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
         endif ()
     elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang)
         string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION})
         list(GET VERSION_LIST 0 MAJOR)
         list(GET VERSION_LIST 1 MINOR)
+        set(_CONAN_SETTING_COMPILER clang)
+        set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR})
         if(APPLE)
             cmake_policy(GET CMP0025 APPLE_CLANG_POLICY_ENABLED)
             if(NOT APPLE_CLANG_POLICY_ENABLED)
                 message(STATUS "Conan: APPLE and Clang detected. Assuming apple-clang compiler. Set CMP0025 to avoid it")
                 set(_CONAN_SETTING_COMPILER apple-clang)
-                set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR})
-            else()
-                set(_CONAN_SETTING_COMPILER clang)
-                set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR})
             endif()
-            if (USING_CXX)
-                set(_CONAN_SETTING_COMPILER_LIBCXX libc++)
-            endif ()
-        else()
-            set(_CONAN_SETTING_COMPILER clang)
-            if(${MAJOR} GREATER 7)
-                set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR})
-            else()
-                set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR})
-            endif()
-            if (USING_CXX)
-                conan_cmake_detect_gnu_libcxx(_LIBCXX)
-                set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
-            endif ()
-        endif()
+        endif()
+        if(${_CONAN_SETTING_COMPILER} STREQUAL clang AND ${MAJOR} GREATER 7)
+            set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR})
+        endif()
+        if (USING_CXX)
+            conan_cmake_detect_unix_libcxx(_LIBCXX)
+            set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX})
+        endif ()
     elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC)
         set(_VISUAL "Visual Studio")
         _get_msvc_ide_version(_VISUAL_VERSION)
@@ -202,16 +196,20 @@

     # If profile is defined it is used
     if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARGUMENTS_DEBUG_PROFILE)
-        set(_SETTINGS -pr ${ARGUMENTS_DEBUG_PROFILE})
+        set(_APPLIED_PROFILES ${ARGUMENTS_DEBUG_PROFILE})
     elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND ARGUMENTS_RELEASE_PROFILE)
-        set(_SETTINGS -pr ${ARGUMENTS_RELEASE_PROFILE})
+        set(_APPLIED_PROFILES ${ARGUMENTS_RELEASE_PROFILE})
     elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" AND ARGUMENTS_RELWITHDEBINFO_PROFILE)
-        set(_SETTINGS -pr ${ARGUMENTS_RELWITHDEBINFO_PROFILE})
+        set(_APPLIED_PROFILES ${ARGUMENTS_RELWITHDEBINFO_PROFILE})
     elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" AND ARGUMENTS_MINSIZEREL_PROFILE)
-        set(_SETTINGS -pr ${ARGUMENTS_MINSIZEREL_PROFILE})
+        set(_APPLIED_PROFILES ${ARGUMENTS_MINSIZEREL_PROFILE})
     elseif(ARGUMENTS_PROFILE)
-        set(_SETTINGS -pr ${ARGUMENTS_PROFILE})
-    endif()
+        set(_APPLIED_PROFILES ${ARGUMENTS_PROFILE})
+    endif()
+
+    foreach(ARG ${_APPLIED_PROFILES})
+        set(_SETTINGS ${_SETTINGS} -pr ${ARG})
+    endforeach()

     if(NOT _SETTINGS OR ARGUMENTS_PROFILE_AUTO STREQUAL "ALL")
         set(ARGUMENTS_PROFILE_AUTO arch build_type compiler compiler.version
@@ -237,35 +235,52 @@
 endfunction()

-function(conan_cmake_detect_gnu_libcxx result)
-    # Allow -D_GLIBCXX_USE_CXX11_ABI=ON/OFF as argument to cmake
-    if(DEFINED _GLIBCXX_USE_CXX11_ABI)
-        if(_GLIBCXX_USE_CXX11_ABI)
-            set(${result} libstdc++11 PARENT_SCOPE)
-            return()
-        else()
-            set(${result} libstdc++ PARENT_SCOPE)
-            return()
-        endif()
-    endif()
-
-    # Check if there's any add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
+function(conan_cmake_detect_unix_libcxx result)
+    # Take into account any -stdlib in compile options
+    get_directory_property(compile_options DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_OPTIONS)
+
+    # Take into account any _GLIBCXX_USE_CXX11_ABI in compile definitions
     get_directory_property(defines DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS)
     foreach(define ${defines})
-        if(define STREQUAL "_GLIBCXX_USE_CXX11_ABI=0")
+        if(define MATCHES "_GLIBCXX_USE_CXX11_ABI")
+            if(define MATCHES "^-D")
+                set(compile_options ${compile_options} "${define}")
+            else()
+                set(compile_options ${compile_options} "-D${define}")
+            endif()
+        endif()
+    endforeach()
+
+    execute_process(
+        COMMAND ${CMAKE_COMMAND} -E echo "#include <string>"
+        COMMAND ${CMAKE_CXX_COMPILER} -x c++ ${compile_options} -E -dM -
+        OUTPUT_VARIABLE string_defines
+    )
+
+    if(string_defines MATCHES "#define __GLIBCXX__")
+        # Allow -D_GLIBCXX_USE_CXX11_ABI=ON/OFF as argument to cmake
+        if(DEFINED _GLIBCXX_USE_CXX11_ABI)
+            if(_GLIBCXX_USE_CXX11_ABI)
+                set(${result} libstdc++11 PARENT_SCOPE)
+                return()
+            else()
+                set(${result} libstdc++ PARENT_SCOPE)
+                return()
+            endif()
+        endif()
+
+        if(string_defines MATCHES "#define _GLIBCXX_USE_CXX11_ABI 1\n")
+            set(${result} libstdc++11 PARENT_SCOPE)
+        else()
+            # Either the compiler is missing the define because it is old, and so
+            # it can't use the new abi, or the compiler was configured to use the
+            # old abi by the user or distro (e.g. devtoolset on RHEL/CentOS)
             set(${result} libstdc++ PARENT_SCOPE)
-            return()
-        endif()
-    endforeach()
-
-    # Use C++11 stdlib as default if gcc is 5.1+
-    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1")
-      set(${result} libstdc++ PARENT_SCOPE)
-    else()
-      set(${result} libstdc++11 PARENT_SCOPE)
-    endif()
-endfunction()
-
+        endif()
+    else()
+        set(${result} libc++ PARENT_SCOPE)
+    endif()
+endfunction()

 function(conan_cmake_detect_vs_runtime result)
     string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
@@ -290,9 +305,10 @@

 macro(parse_arguments)
   set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_OUTPUT_DIRS OUTPUT_QUIET NO_IMPORTS)
-  set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE
-                   PROFILE ARCH BUILD_TYPE INSTALL_FOLDER CONAN_COMMAND)
-  set(multiValueArgs REQUIRES OPTIONS IMPORTS SETTINGS BUILD ENV GENERATORS PROFILE_AUTO INSTALL_ARGS)
+  set(oneValueArgs CONANFILE  ARCH BUILD_TYPE INSTALL_FOLDER CONAN_COMMAND)
+  set(multiValueArgs DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE
+                     PROFILE REQUIRES OPTIONS IMPORTS SETTINGS BUILD ENV GENERATORS PROFILE_AUTO
+                     INSTALL_ARGS)
   cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
 endmacro()

@@ -362,11 +378,11 @@
     execute_process(COMMAND ${conan_command} ${conan_args}
                      RESULT_VARIABLE return_code
                      OUTPUT_VARIABLE conan_output
-                     ERROR_VARIABLE conan_output
+                     ERROR_VARIABLE conan_output
                      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})

     message(STATUS "${conan_output}")
-
+
     if(NOT "${return_code}" STREQUAL "0")
       message(FATAL_ERROR "Conan install failed='${return_code}'")
     endif()
@@ -516,4 +532,3 @@
     execute_process(COMMAND ${CONAN_CMD} remote add ${CONAN_NAME} ${CONAN_URL}
       ${CONAN_INDEX_ARG} -f)
 endmacro()
-


add details. test=develop

add details. test=develop

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -27,7 +27,6 @@

 CheckCompilerCXX11Flag()
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
 # safe_set_flag
 #
 # Set a compile flag only if compiler is support
@@ -148,6 +147,7 @@
     -Wno-error=unused-function  # Warnings in Numpy Header.
     -Wno-error=array-bounds # Warnings in Eigen::array
 )
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
 endif(NOT WIN32)

 if (APPLE)


do not activate -fwhole-program-vtables on AppleClang, as it does not support it

--- toolchains/clang.cmake
+++ toolchains/clang.cmake
@@ -12,7 +12,9 @@

 list( APPEND TNUN_compiler_optimize_for_speed -fvectorize -fslp-vectorize -fslp-vectorize-aggressive )
 list( APPEND TNUN_compiler_report_optimization -Rpass=loop-.* )
-list( APPEND TNUN_compiler_LTO -fwhole-program-vtables )
+if( NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" ) # Tested with XCode 8
+    list( APPEND TNUN_compiler_LTO -fwhole-program-vtables )
+endif()

 # http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
 # http://clang.llvm.org/docs/AddressSanitizer.html


update windows zlib submodule

update windows zlib submodule

--- cmake/Dependencies_core.cmake
+++ cmake/Dependencies_core.cmake
@@ -55,17 +55,21 @@

   set(ZLIB_TARGET zlibstatic)
   add_subdirectory(submodules/zlib)
-  set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/../submodules/zlib" CACHE PATH "zlib dir" FORCE)
+
+  # libPNG uses include_directory(ZLIB_INCLUDE_DIR) therefore we have to set these variables
+  set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/../submodules/zlib ${CMAKE_CURRENT_BINARY_DIR}/submodules/zlib CACHE PATH "zlib dir" FORCE)
+  set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} CACHE PATH "zlib dir" FORCE)
+
+  # include dir that use the zlib target
   target_include_directories(${ZLIB_TARGET} PUBLIC
-  $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../submodules/zlib>
-  $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/submodules/zlib>  )
-
-   #set_target_properties(zlibstatic PROPERTIES EXCLUDE_FROM_ALL 1)
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../submodules/zlib>
+    $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/submodules/zlib>  )
+
   PackageHelperTarget(${ZLIB_TARGET} ZLIB_FOUND)
-  set_target_properties(${ZLIB_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SAIGA_RUNTIME_OUTPUT_DIRECTORY}")
-  #message(FATAL_ERROR ${ZLIB_INCLUDE_DIR})
+  #set_target_properties(${ZLIB_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SAIGA_RUNTIME_OUTPUT_DIRECTORY}")
   SET(SAIGA_USE_ZLIB 1)

+  # Create a fake zlib target which also points to the zlib static library
   add_library(zlib INTERFACE)
   target_link_libraries(zlib INTERFACE zlibstatic)


compile sm75 only for cuda 10

compile sm75 only for cuda 10

--- cmake/Dependencies_cuda.cmake
+++ cmake/Dependencies_cuda.cmake
@@ -54,14 +54,23 @@
     endif()

+
+
     if(SAIGA_CUDA_COMP)
         SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_30,code=sm_30")
         SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_30,code=compute_30")
     endif()
     SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode arch=compute_52,code=sm_52")
-    SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_61,code=sm_61") # Pascal
+
+    if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL "9")
+        SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_61,code=sm_61") # Pascal
+    endif()
+
     #SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_70,code=sm_70") # Volta
-    SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_75,code=sm_75") # Turing
+
+    if(${CMAKE_CUDA_COMPILER_VERSION} VERSION_GREATER_EQUAL "10")
+        SET(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_75,code=sm_75") # Turing
+    endif()

     if(SAIGA_CUDA_RDC)


changing find liblo for Linux

changing find liblo for Linux

--- cmake/Modules/FindLIBLO.cmake
+++ cmake/Modules/FindLIBLO.cmake
@@ -1,11 +1,16 @@
-# Try to find the STK library.
+# Try to find the Liblo library.
 # Once done this will define:
 #  LIBLO_FOUND - System has the OSC library.
 #  LIBLO_INCLUDE_DIRS - The OSC include directories.
 #  LIBLO_LIBRARIES - The libraries needed to use the OSC library.

 find_path(LIBLO_INCLUDE_DIR lo.h PATH_SUFFIXES lo)
+
+if(LINUX)
+find_library(LIBLO_LIBRARY NAMES lo)
+else()
 find_library(LIBLO_LIBRARY NAMES liblo.a lo)
+endif()

 set(LIBLO_INCLUDE_DIRS ${LIBLO_INCLUDE_DIR})
 set(LIBLO_LIBRARIES ${LIBLO_LIBRARY} )


add cmake find drake geometry util library

--- cmake/modules/FindDrake.cmake
+++ cmake/modules/FindDrake.cmake
@@ -18,6 +18,7 @@
 find_drake_library(DRAKE_JOINTS_LIBRARY drakeJoints "Drake Joints library")
 find_drake_library(DRAKE_SHAPES_LIBRARY drakeShapes "Drake Shapes library")
 find_drake_library(DRAKE_CHULL_LIBRARY drakeConvexHull "Drake Convex Hull library")
+find_drake_library(DRAKE_GEOMETRYUTIL_LIBRARY drakeGeometryUtil "Drake Geometry Util library")

 set(DRAKE_INCLUDE_DIRS


Less restrictive cmake search for clFFT.

--- cmake/modules/FindclFFT.cmake
+++ cmake/modules/FindclFFT.cmake
@@ -15,38 +15,33 @@
 # to the directory containing 'include/clFFT.h" prior to calling this script.

 if(CLFFT_ROOT)
+
   find_path(CLFFT_ROOT_DIR
     NAMES include/clFFT.h
-    PATHS ${CLFFT_ROOT}
+    PATHS "${CLFFT_ROOT}"
     PATHS ENV CLFFT_ROOT
     DOC "clFFT root directory."
     NO_DEFAULT_PATH)
-  find_path(_CLFFT_INCLUDE_DIRS
-    NAMES clFFT.h
-    PATHS ${CLFFT_ROOT_DIR} /usr
-    PATH_SUFFIXES include
-    DOC "clFFT include directory"
-    NO_DEFAULT_PATH)
-  find_library(_CLFFT_LIBRARY
-    NAMES clFFT
-    PATHS ${CLFFT_ROOT_DIR} /usr
-    PATH_SUFFIXES lib lib64 lib/import lib64/import
-    DOC "clFFT library directory"
-    NO_DEFAULT_PATH)

 else()
+
   find_path(CLFFT_ROOT_DIR
     NAMES include/clFFT.h
     DOC "clFFT root directory.")

-  find_path(_CLFFT_INCLUDE_DIRS
-    NAMES clFFT.h
-    DOC "clFFT include directory")
+endif()

-  find_library(_CLFFT_LIBRARY
-    NAMES clFFT
-    DOC "clFFT library directory")
-endif()
+find_path(_CLFFT_INCLUDE_DIRS
+  NAMES clFFT.h
+  PATHS "${CLFFT_ROOT_DIR}" "/usr"
+  PATH_SUFFIXES "include"
+  DOC "clFFT include directory")
+
+find_library(_CLFFT_LIBRARY
+  NAMES clFFT
+  PATHS "${CLFFT_ROOT_DIR}" "/usr"
+  PATH_SUFFIXES "lib" "lib64" "lib/import" "lib64/import"
+  DOC "clFFT library directory")

 set(clFFT_INCLUDE_DIRS ${_CLFFT_INCLUDE_DIRS})
 set(clFFT_LIBRARIES ${_CLFFT_LIBRARY})


[cpack] Fix stray RELEASE in binary names:

BUILD_TYPE has a different meaning, use a local variable instead.

--- cmake/modules/RootCPack.cmake
+++ cmake/modules/RootCPack.cmake
@@ -119,12 +119,12 @@
 endif()
 #---Build type---------------------------------------------------------------------------------------
 if(NOT CMAKE_BUILD_TYPE STREQUAL Release)
-  string(TOLOWER .${CMAKE_BUILD_TYPE} BUILD_TYPE)
+  string(TOLOWER .${CMAKE_BUILD_TYPE} BUILD_TYPE_FOR_NAME)
 endif()

 set(CPACK_PACKAGE_RELOCATABLE True)
 set(CPACK_PACKAGE_INSTALL_DIRECTORY "root_v${ROOT_VERSION}")
-set(CPACK_PACKAGE_FILE_NAME "root_v${ROOT_VERSION}.${OS_NAME_VERSION}${COMPILER_NAME_VERSION}${BUILD_TYPE}")
+set(CPACK_PACKAGE_FILE_NAME "root_v${ROOT_VERSION}.${OS_NAME_VERSION}${COMPILER_NAME_VERSION}${BUILD_TYPE_FOR_NAME}")
 set(CPACK_PACKAGE_EXECUTABLES "root" "ROOT")

 if(WIN32)


cmake/UseCSharp: use a more generated name, so we can use a target name matching the output file

--- cmake/Modules/UseCSharp.cmake
+++ cmake/Modules/UseCSharp.cmake
@@ -106,7 +106,7 @@
     DEPENDS ${sources_dep}
   )
   add_custom_target(
-    ${name} ALL
+    ${name}CSharpCompile ALL
     DEPENDS ${CSHARP_BINARY_DIRECTORY}/${name}.${output}
     SOURCES ${sources_dep}
   )


cmake: indicate single precision floating-point for Cortex-M33

ARM Cortex-M33 may implement an optional Floating Point Unit
(FPU) supporting single-precision arithmetic. This commit
modifies the respective GCC_M_CPU flag to comply with Cortex-M33.

Signed-off-by: Ioannis Glaropoulos <5921cc8bab7e1d4329f52fd8f6268f9692e3de80@nordicsemi.no>

--- cmake/fpu-for-gcc-m-cpu.cmake
+++ cmake/fpu-for-gcc-m-cpu.cmake
@@ -2,4 +2,4 @@

 set(FPU_FOR_cortex-m4      fpv4-sp-d16)
 set(FPU_FOR_cortex-m7      fpv5-d16)
-set(FPU_FOR_cortex-m33     fpv5-d16)
+set(FPU_FOR_cortex-m33     fpv5-sp-d16)


Print defs for JPEGTurbo

Print defs for JPEGTurbo

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -184,7 +184,8 @@

 # JPEG -- prefer Turbo-JPEG to regular libjpeg
 checked_find_package (JPEGTurbo
-                   DEFINITIONS -DUSE_JPEG_TURBO=1)
+                      DEFINITIONS -DUSE_JPEG_TURBO=1
+                      PRINT       JPEG_INCLUDES JPEG_LIBRARIES)
 if (NOT JPEG_FOUND) # Try to find the non-turbo version
     checked_find_package (JPEG REQUIRED)
 endif ()


Build: llvm-config --system-libs needs --static for LLVM_STATIC (#1375)

This fixes CI in the Mac test. Something about the Homebrew upgrade to llvm 12.0.0_1 made this fix necessary to build.

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/modules/FindLLVM.cmake
+++ src/cmake/modules/FindLLVM.cmake
@@ -58,9 +58,35 @@
 execute_process (COMMAND ${LLVM_CONFIG} --targets-built
        OUTPUT_VARIABLE LLVM_TARGETS
        OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process (COMMAND ${LLVM_CONFIG} --system-libs
-                 OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
-                 OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+############ HACK ##############
+# On OSX, the Homebrew (and maybe any build) of LLVM 10.0 seems to have a
+# link conflict with its dependency on the llvm libc++ and the system
+# libc++, both can end up dynamically linked and lead to very subtle and
+# frustrating behavior failures (in particular, osl's use of libclang will
+# botch include file parsing any time LD_LIBRARY_PATH doesn't have the llvm
+# libc++ first).
+#
+# It seems that this is not a problem when linking against the llvm and
+# libclang libraries statically. So on apple and when LLVM 10+ are involved,
+# just force that choice. Other than larger executables, it seems harmless,
+# and in any case a better choice than this beastly bug.
+#
+# We can periodically revisit this with new version of LLVM, maybe they will
+# fix things and we won't require this preemptive static linking.
+if (APPLE AND LLVM_VERSION VERSION_GREATER_EQUAL 10.0)
+    set (LLVM_STATIC ON)
+endif ()
+
+if (LLVM_STATIC)
+    execute_process (COMMAND ${LLVM_CONFIG} --system-libs --link-static
+                     OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
+                     OUTPUT_STRIP_TRAILING_WHITESPACE)
+else ()
+    execute_process (COMMAND ${LLVM_CONFIG} --system-libs
+                     OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
+                     OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif ()
 string (REPLACE " " ";" LLVM_SYSTEM_LIBRARIES "${LLVM_SYSTEM_LIBRARIES}")

 find_library ( LLVM_LIBRARY
@@ -105,25 +131,6 @@
 endforeach ()

-############ HACK ##############
-# On OSX, the Homebrew (and maybe any build) of LLVM 10.0 seems to have a
-# link conflict with its dependency on the llvm libc++ and the system
-# libc++, both can end up dynamically linked and lead to very subtle and
-# frustrating behavior failures (in particular, osl's use of libclang will
-# botch include file parsing any time LD_LIBRARY_PATH doesn't have the llvm
-# libc++ first).
-#
-# It seems that this is not a problem when linking against the llvm and
-# libclang libraries statically. So on apple and when LLVM 10+ are involved,
-# just force that choice. Other than larger executables, it seems harmless,
-# and in any case a better choice than this beastly bug.
-#
-# We can periodically revisit this with new version of LLVM, maybe they will
-# fix things and we won't require this preemptive static linking.
-if (APPLE AND LLVM_VERSION VERSION_GREATER_EQUAL 10.0)
-    set (LLVM_STATIC ON)
-endif ()
-
 # shared llvm library may not be available, this is not an error if we use LLVM_STATIC.
 if ((LLVM_LIBRARY OR LLVM_LIBRARIES OR LLVM_STATIC) AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
   if (LLVM_STATIC)


Fix compilation error in Debug mode with MSVC

--- src/cmake/precompiled_libs.cmake
+++ src/cmake/precompiled_libs.cmake
@@ -56,8 +56,15 @@

 	# TODO(sergey): On Windows llvm-config doesn't give proper results for the
 	# library names, use hardcoded libraries for now.
-	file(GLOB LLVM_LIBRARIES ${LLVM_ROOT_DIR}/lib/*.lib)
+	file(GLOB LLVM_LIBRARIES_RELEASE ${LLVM_ROOT_DIR}/lib/*.lib)
 	file(GLOB LLVM_LIBRARIES_DEBUG ${LLVM_ROOT_DIR}/debug/lib/*.lib)
+	set(LLVM_LIBRARIES)
+	foreach(_llvm_library ${LLVM_LIBRARIES_RELEASE})
+		set(LLVM_LIBRARIES ${LLVM_LIBRARIES} optimized ${_llvm_library})
+	endforeach()
+	foreach(_llvm_library ${LLVM_LIBRARIES_DEBUG})
+		set(LLVM_LIBRARIES ${LLVM_LIBRARIES} debug ${_llvm_library})
+	endforeach()

 	# On Windows we use precompiled GLEW and GLUT.
 	_set_default(GLEW_ROOT_DIR "${_lib_DIR}/opengl")
@@ -81,6 +88,48 @@
 		-DFREEGLUT_STATIC
 		-DFREEGLUT_LIB_PRAGMAS=0
 	)
+
+	# Special exceptions for libraries which needs explicit debug version
+	set(OPENIMAGEIO_LIBRARY
+		optimized ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO.lib
+		optimized ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO_Util.lib
+		debug ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO_d.lib
+		debug ${OPENIMAGEIO_ROOT_DIR}/lib/OpenImageIO_Util_d.lib
+	)
+
+	set(OSL_OSLCOMP_LIBRARY
+		optimized ${OSL_ROOT_DIR}/lib/oslcomp.lib
+		debug ${OSL_ROOT_DIR}/lib/oslcomp_d.lib
+	)
+	set(OSL_OSLEXEC_LIBRARY
+		optimized ${OSL_ROOT_DIR}/lib/oslexec.lib
+		debug ${OSL_ROOT_DIR}/lib/oslexec_d.lib
+	)
+	set(OSL_OSLQUERY_LIBRARY
+		optimized ${OSL_ROOT_DIR}/lib/oslquery.lib
+		debug ${OSL_ROOT_DIR}/lib/oslquery_d.lib
+	)
+
+	set(OPENEXR_IEX_LIBRARY
+		optimized ${OPENEXR_ROOT_DIR}/lib/Iex-2_2.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/Iex-2_2_d.lib
+	)
+	set(OPENEXR_HALF_LIBRARY
+		optimized ${OPENEXR_ROOT_DIR}/lib/Half.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/Half_d.lib
+	)
+	set(OPENEXR_ILMIMF_LIBRARY
+		optimized ${OPENEXR_ROOT_DIR}/lib/IlmImf-2_2.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/IlmImf-2_2_d.lib
+	)
+	set(OPENEXR_IMATH_LIBRARY
+		optimized ${OPENEXR_ROOT_DIR}/lib/Imath-2_2.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/Imath-2_2_d.lib
+	)
+	set(OPENEXR_ILMTHREAD_LIBRARY
+		optimized ${OPENEXR_ROOT_DIR}/lib/IlmThread-2_2.lib
+		debug ${OPENEXR_ROOT_DIR}/lib/IlmThread-2_2_d.lib
+	)
 endif()

 unset(_lib_DIR)


one more debug message for ODE find

one more debug message for ODE find

--HG--
extra : convert_revision : 3171233ab5918f2a5f813f8f9d8aa75333a828c3

--- trunk/CMakeModules/FindODE.cmake
+++ trunk/CMakeModules/FindODE.cmake
@@ -114,6 +114,7 @@
   message(STATUS "ODE_INCLUDE = '${ODE_INCLUDE}'")
   message(STATUS "_ODE_LIB_HINTS = '${_ODE_LIB_HINTS}'")
   message(STATUS "ODE_LIBRARY = '${ODE_LIBRARY}'")
+  message(STATUS "ODE_VERSION = '${ODE_VERSION}'")
   message(STATUS "-----------------------------------")
 endif()


Typo fixed.

Typo fixed.

--- cmake/FindBSP.cmake
+++ cmake/FindBSP.cmake
@@ -239,7 +239,7 @@

     string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z])?_?(M[47])?.*$" COMP_U ${COMP_U})
     if(NOT CMAKE_MATCH_1)
-        message(FATAL_ERROR "Unknown HAL component: ${COMP}")
+        message(FATAL_ERROR "Unknown BSP component: ${COMP}")
     endif()

     if(CMAKE_MATCH_3)


CELIX-237: Update in FindFFI.cmake for lib name

--- cmake/FindFFI.cmake
+++ cmake/FindFFI.cmake
@@ -32,9 +32,8 @@

 mark_as_advanced(GNUTLS_INCLUDE_DIR GNUTLS_LIBRARY)

-find_library(FFI_LIBRARY NAMES ffi
+find_library(FFI_LIBRARY NAMES ffi libffi
         PATHS $ENV{FFI_DIR} ${FFI_DIR} /usr/local /opt/local
-        PATH_SUFFIXES lib
         HINTS ${PC_LIBFFI_LIBDIR} ${PC_LIBFFI_LIBRARY_DIRS}
 )


Create an "LLD_LIBDIRS" var to override lld loc

--- cmake/Findlld.cmake
+++ cmake/Findlld.cmake
@@ -24,6 +24,7 @@
         string(TOUPPER ${_libname_} _prettylibname_)
         find_library(LLD_${_prettylibname_}_LIB NAMES ${_libname_}
             PATHS
+                ${LLD_LIBDIRS}
                 /usr/lib/llvm-10/lib
                 /usr/local/llvm100/lib
                 /mingw64/lib


remove buildspace from CATKIN_WORKSPACES

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -8,6 +8,9 @@
   message(FATAL_ERROR "catkin_EXTRAS_DIR is not set")
 endif()

+# define buildspace
+set(CATKIN_BUILD_PREFIX "${CMAKE_BINARY_DIR}/buildspace")
+
 # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
 # or CMAKE_PREFIX_PATH from the environment
 if(NOT DEFINED CMAKE_PREFIX_PATH)
@@ -16,6 +19,8 @@
   endif()
 endif()
 if(CMAKE_PREFIX_PATH)
+  # skip buildspace if it is in CMAKE_PREFIX_PATH so that it is not part of CATKIN_WORKSPACES
+  list(REMOVE_ITEM CMAKE_PREFIX_PATH ${CATKIN_BUILD_PREFIX})
   message(STATUS "Using CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
 endif()

@@ -36,8 +41,6 @@
 # save original CMAKE_PREFIX_PATH for environment generation
 set(CMAKE_PREFIX_PATH_WITHOUT_BUILDSPACE ${CMAKE_PREFIX_PATH})

-# define buildspace
-set(CATKIN_BUILD_PREFIX "${CMAKE_BINARY_DIR}/buildspace")
 # prepend buildspace to CMAKE_PREFIX_PATH
 list(INSERT CMAKE_PREFIX_PATH 0 ${CATKIN_BUILD_PREFIX})


[Phi] fix phi compile option for jetson (#45757)

* [Phi] fix phi compile option for jetson

* Update phi.cmake

--- cmake/phi.cmake
+++ cmake/phi.cmake
@@ -83,7 +83,7 @@
         "${kernel_impl}")
     if(NOT first_registry STREQUAL "")
       # some gpu kernel only can run on cuda, not support rocm, so we add this branch
-      if(WITH_ROCM)
+      if(WITH_ROCM OR WITH_NV_JETSON)
         string(FIND "${first_registry}" "cuda_only" pos)
         if(pos GREATER 1)
           continue()


Add git revision to buildconfig by default

if someone is using the source without GIT, let them have the work
to provide a proper version information

--- cmake/ConfigOptions.cmake
+++ cmake/ConfigOptions.cmake
@@ -154,7 +154,7 @@
     option(WITH_VAAPI "Use FFMPEG VAAPI" OFF)
 endif(WITH_FFMPEG)

-option(USE_VERSION_FROM_GIT_TAG "Extract FreeRDP version from git tag." OFF)
+option(USE_VERSION_FROM_GIT_TAG "Extract FreeRDP version from git tag." ON)

 option(WITH_CAIRO    "Use CAIRO image library for screen resizing" OFF)
 option(WITH_SWSCALE  "Use SWScale image library for screen resizing" OFF)


Use IMPORTED_LINK_INTERFACE_LIBRARIES to link geos

--- cmake/find/Findgeos.cmake
+++ cmake/find/Findgeos.cmake
@@ -69,10 +69,6 @@
       "geos::c"
       PROPERTIES
         IMPORTED_LOCATION "${GEOS_C_LIBRARY}"
-  )
-  add_dependencies(
-      "geos::c"
-      "geos"
+        IMPORTED_LINK_INTERFACE_LIBRARIES "geos"
   )
 endif()
-


two ways to name snap packages?

two ways to name snap packages?

--- cmake/packages/snap.cmake
+++ cmake/packages/snap.cmake
@@ -7,7 +7,6 @@
 if(SNAPCRAFT_FOUND)
   set(SNAPCRAFT_TEMPLATE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Installation/Ubuntu")
   set(SNAPCRAFT_SOURCE_DIR "${CMAKE_BINARY_DIR}/_CPack_Packages/SNAP")
-  set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_*${ARANGODB_PACKAGE_ARCHITECTURE}.snap")

   message(STATUS "Creating snap package")

@@ -31,7 +30,12 @@
   file(
     COPY        "${SNAPCRAFT_TEMPLATE_DIR}/arangodb.png"
     DESTINATION "${SNAPCRAFT_SOURCE_DIR}/"
-  )
+    )
+
+  set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap")
+  if(NOT EXISTS ${CPACK_SNAP_PACKAGE_FILE_NAME})
+    set(CPACK_SNAP_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${ARANGODB_PACKAGE_REVISION}_${ARANGODB_PACKAGE_ARCHITECTURE}.snap")
+  endif()
   add_custom_target(snap
     COMMENT "create snap-package"
     COMMAND ${SNAP_EXE} snap


add some flann includes

add some flann includes

--- cmake/rosbuild_lite.cmake
+++ cmake/rosbuild_lite.cmake
@@ -251,6 +251,7 @@
       /opt/ros/electric/stacks/ros_comm/tools/rosconsole/include
       /opt/ros/electric/stacks/common_msgs/sensor_msgs/msg_gen/cpp/include
       /opt/ros/electric/stacks/perception_pcl/pcl/msg_gen/cpp/include
+      /opt/ros/electric/stacks/perception_pcl/flann/include/
       /usr/include/vtk-5.6/
       /usr/include/eigen3
   )


add another useful resolver variant

add another useful resolver variant

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -108,6 +108,7 @@
 #
 set (PLUGINS_LIST_RESOLVER
 	resolver_fm_b_b
+	resolver_fm_pb_b
 	resolver_fm_hb_b
 	resolver_fm_hp_b
 	resolver_fm_ub_x


fix CUDA/HIP cmake flags

fix CUDA/HIP cmake flags

- CUDA
  - do not set `-G` for nvcc when CMake build type is debug
    - `-G` will not only add debug symbols it also set `-O0`
  - ALPAKA_HIP_KEEP_FILES
    - remove the default folder `nvcc_tmp` -> this is not working with
multiple targets e.g. alpaka examples
  - remove that `ALPAKA_HIP_KEEP_FILES` is activated when
`ALPAKA_CUDA_SHOW_CODELINES` is used
- HIP
  - fix the keep files flag
  - fix how debug symbold will be added
  - do not set `-G` for HIP-nvcc when CMake build type debug is used

--- cmake/alpakaCommon.cmake
+++ cmake/alpakaCommon.cmake
@@ -286,7 +286,7 @@
             option(ALPAKA_CUDA_FAST_MATH "Enable fast-math" ON)
             option(ALPAKA_CUDA_FTZ "Set flush to zero for GPU" OFF)
             option(ALPAKA_CUDA_SHOW_REGISTER "Show kernel registers and create PTX" OFF)
-            option(ALPAKA_CUDA_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps (folder: nvcc_tmp)" OFF)
+            option(ALPAKA_CUDA_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps 'CMakeFiles/<targetname>.dir'" OFF)
             option(ALPAKA_CUDA_NVCC_EXPT_EXTENDED_LAMBDA "Enable experimental, extended host-device lambdas in NVCC" ON)
             option(ALPAKA_CUDA_NVCC_SEPARABLE_COMPILATION "Enable separable compilation in NVCC" OFF)

@@ -471,12 +471,7 @@

                 if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
                     list(APPEND CUDA_NVCC_FLAGS -g)
-                    if(MSVC)
-                        message(WARNING "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} does not support -G with CUDA! "
-                                        "Device debug symbols NOT added.")
-                    else()
-                        list(APPEND CUDA_NVCC_FLAGS -G)
-                    endif()
+                    list(APPEND CUDA_NVCC_FLAGS -lineinfo)
                 endif()

                 if(ALPAKA_CUDA_FAST_MATH)
@@ -509,18 +504,17 @@
                 endif()

                 if(ALPAKA_CUDA_KEEP_FILES)
-                    file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/nvcc_tmp")
+                    #file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/nvcc_tmp")
                     list(APPEND CUDA_NVCC_FLAGS --keep)
-                    list(APPEND CUDA_NVCC_FLAGS --keep-dir="${PROJECT_BINARY_DIR}/nvcc_tmp")
-                endif()
-
-                option(ALPAKA_CUDA_SHOW_CODELINES "Show kernel lines in cuda-gdb and cuda-memcheck" OFF)
+                    #list(APPEND CUDA_NVCC_FLAGS --keep-dir="${PROJECT_BINARY_DIR}/nvcc_tmp")
+                endif()
+
+                option(ALPAKA_CUDA_SHOW_CODELINES "Show kernel lines in cuda-gdb and cuda-memcheck. If ALPAKA_CUDA_KEEP_FILES is enabled source code will be inlined in ptx." OFF)
                 if(ALPAKA_CUDA_SHOW_CODELINES)
                     list(APPEND CUDA_NVCC_FLAGS --source-in-ptx -lineinfo)
                     if(NOT MSVC)
                         list(APPEND CUDA_NVCC_FLAGS -Xcompiler=-rdynamic)
                     endif()
-                    set(ALPAKA_CUDA_KEEP_FILES ON CACHE BOOL "activate keep files" FORCE)
                 endif()
             endif()

@@ -562,7 +556,7 @@
             option(ALPAKA_HIP_FAST_MATH "Enable fast-math" ON)
             option(ALPAKA_HIP_FTZ "Set flush to zero for GPU" OFF)
             option(ALPAKA_HIP_SHOW_REGISTER "Show kernel registers and create PTX" OFF)
-            option(ALPAKA_HIP_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps (folder: nvcc_tmp)" OFF)
+            option(ALPAKA_HIP_KEEP_FILES "Keep all intermediate files that are generated during internal compilation steps in 'CMakeFiles/<targetname>.dir'." OFF)

             set(HIP_HIPCC_FLAGS)

@@ -601,10 +595,10 @@
                 # but for HIP we have to do this here
                 list(APPEND HIP_NVCC_FLAGS -D__CUDACC__)
                 list(APPEND HIP_NVCC_FLAGS -ccbin ${CMAKE_CXX_COMPILER})
-                list(APPEND HIP_NVCC_FLAGS -Xcompiler=-g)

                 if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
-                    list(APPEND HIP_NVCC_FLAGS -G)
+                    list(APPEND CUDA_NVCC_FLAGS -lineinfo)
+                    list(APPEND HIP_NVCC_FLAGS -Xcompiler=-g)
                 endif()
                 # propage host flags
                 # SET(CUDA_PROPAGATE_HOST_FLAGS ON) # does not exist in HIP, so do it manually
@@ -695,17 +689,9 @@
             endif()

             if(ALPAKA_HIP_KEEP_FILES)
-                file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/hip_tmp")
-                list(APPEND HIP_HIPCC_FLAGS --keep)
-                list(APPEND HIP_HIPCC_FLAGS --keep-dir "${PROJECT_BINARY_DIR}/hip_tmp")
+                list(APPEND HIP_HIPCC_FLAGS -save-temps)
             endif()

-            option(ALPAKA_HIP_SHOW_CODELINES "Show kernel lines in cuda-gdb and cuda-memcheck" OFF)
-            if(ALPAKA_HIP_SHOW_CODELINES)
-                list(APPEND HIP_HIPCC_FLAGS --source-in-ptx -lineinfo)
-                list(APPEND HIP_HIPCC_FLAGS -Xcompiler=rdynamic)
-                set(ALPAKA_HIP_KEEP_FILES ON CACHE BOOL "activate keep files" FORCE)
-            endif()
             if(_ALPAKA_HIP_LIBRARIES)
                 target_link_libraries(alpaka INTERFACE ${_ALPAKA_HIP_LIBRARIES})
             endif()


fix clang-format cmake-target name clash

--- cmake/clang-format.cmake
+++ cmake/clang-format.cmake
@@ -6,7 +6,7 @@
 find_program(CLANG_FORMAT "clang-format")
 if(CLANG_FORMAT)
   add_custom_target(
-    clang-format
+    "clang-format-${PROJECT_NAME}"
     COMMAND ${CLANG_FORMAT}
     -i
     -style=file


ctest update

ctest update

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

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -10,11 +10,11 @@
 ##   ctest -S /path/to/ctest_script.cmake
 ##
 ## It is recommended to make a copy of the file (especially using git).
-## For extra information
+## For more verbosity add the flag
 ##
 ##   ctest -S /path/to/ctest_script.cmake -V
 ##
-## or even  -VV
+## or even -VV.
 ##
 ## Set execution options in the Configuration part.
 ## For multiple tests (eg. different compilers) make multiple copies
@@ -33,10 +33,25 @@

 # The Generator for CMake.
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+#set(CTEST_CMAKE_GENERATOR "Ninja")
+#set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
+#set(CTEST_CMAKE_GENERATOR "NMake Makefiles JOM")
+#set(CTEST_CMAKE_GENERATOR "MinGW Makefiles")
+#set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
+#set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
+#set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
+#set(CTEST_CMAKE_GENERATOR "Xcode")
+#set(CTEST_CMAKE_GENERATOR "CodeBlocks")
+#set(CTEST_CMAKE_GENERATOR "Sublime Text 2")
+#set(CTEST_CMAKE_GENERATOR "Eclipse CDT4")

-# Set compiler
-#set(CXX g++)
-#set(CC  gcc)
+# Set environment/compiler
+set(ENV{CC}  "gcc")
+set(ENV{CXX} "g++")
+#set(ENV{CC}  "icc")
+#set(ENV{CXX} "icpc")
+#set(ENV{CC}  "clang")
+#set(ENV{CXX} "clang++")

 # Build type
 set(CTEST_BUILD_CONFIGURATION RelWithDebInfo)
@@ -45,16 +60,16 @@
 find_program(UNAME NAMES uname)
 exec_program("${UNAME}" ARGS "-s" OUTPUT_VARIABLE osname)
 exec_program("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "cpu")
-set(CTEST_BUILD_NAME "${osname}-${cpu} ${CTEST_CMAKE_GENERATOR} / ${CTEST_BUILD_CONFIGURATION} ${CXX}")
+set(CTEST_BUILD_NAME "${osname}-${cpu} ${CTEST_CMAKE_GENERATOR}/${CTEST_BUILD_CONFIGURATION} $ENV{CXX}")

 # Test type (Nightly, Continuous, Experimental)
-set(dashboard_model "Experimental")
+set(test_model "Experimental")

 # For continuous builds, number of seconds to stay alive
-set(dashboard_runtime 40000)
+set(test_runtime 40000)

 # Build flags
-set( CTEST_BUILD_FLAGS "-j2")
+set(CTEST_BUILD_FLAGS "-j2")

 # Source folder
 set(CTEST_SOURCE_DIRECTORY ${CTEST_SCRIPT_DIRECTORY}/..)
@@ -63,8 +78,8 @@
 set(CTEST_BINARY_DIRECTORY ${CTEST_SOURCE_DIRECTORY}/build_ctest)

 # Update type (eg. svn or git)
-set( UPDATE_TYPE git)
-set( CTEST_UPDATE_COMMAND "git") #"${CTEST_SOURCE_DIRECTORY}/cmake/svn_github.sh"
+set(UPDATE_TYPE git)
+set(CTEST_UPDATE_COMMAND "git")

 # Timeouts
 set(CTEST_TEST_TIMEOUT 200 CACHE STRING
@@ -86,14 +101,15 @@
 )

 # Coverage analysis
-#set(dashboard_do_coverage TRUE)
+#set(test_coverage TRUE)
 #set(CTEST_COVERAGE_COMMAND "/usr/bin/gcov")
 #set(CTEST_CUSTOM_COVERAGE_EXCLUDE "${CTEST_SOURCE_DIRECTORY}/external/")

 # Memory check with valgrind
-#set(dashboard_do_memcheck true)
+#set(test_memcheck true)
 #set(CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
-
+#set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "/path_to/suppression_file.supp")
+#set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --leak-check=full --show-reachable=yes --track-origins=yes")

 ## #################################################################
@@ -109,44 +125,39 @@
   ctest_test()
   ctest_submit(PARTS Test)

-  if(dashboard_do_coverage)
+  if(test_coverage)
      message("Running coverage..")
      ctest_coverage(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
      ctest_submit(PARTS Coverage)
   endif()

-  if(dashboard_do_memcheck)
+  if(test_memcheck)
     message("Running memcheck..")
     ctest_memcheck()
     ctest_submit(PARTS MemCheck)
   endif()
 endmacro(run_ctests)

-#if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt")
-#  message("Starting fresh configuration...")
-#  write_cache()
-#endif()
-
 file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
 #ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})

-ctest_start(${dashboard_model})
+ctest_start(${test_model})

-if(NOT "${dashboard_model}" STREQUAL "Continuous")
+if(NOT "${test_model}" STREQUAL "Continuous")

 ctest_update()
 run_ctests()

 else() #continuous model

-while(${CTEST_ELAPSED_TIME} LESS ${dashboard_runtime})
+while(${CTEST_ELAPSED_TIME} LESS ${test_runtime})
   set(START_TIME ${CTEST_ELAPSED_TIME})
   ctest_update(RETURN_VALUE count)
   #message(STATUS "Found ${count} changed files.")
   if( ${count} GREATER 0 )
     run_ctests()
   endif()
-  ctest_sleep(${START_TIME} 300    ${CTEST_ELAPSED_TIME})
+  ctest_sleep(${START_TIME} 300 ${CTEST_ELAPSED_TIME})
 endwhile()

-endif(NOT "${dashboard_model}" STREQUAL "Continuous")
+endif(NOT "${test_model}" STREQUAL "Continuous")


fix script for cmake<3.7

fix script for cmake<3.7

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -521,7 +521,7 @@
   if(DEFINED DROP_METHOD)
     set(CTEST_DROP_METHOD ${DROP_METHOD})
   endif()
-  if ("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.10")
+  if ("${CMAKE_VERSION}" VERSION_GREATER "3.9.99")
     set(CTEST_LABELS_FOR_SUBPROJECTS ${LABELS_FOR_SUBPROJECTS}) #labels/subprojects
   endif()

@@ -534,8 +534,8 @@
     foreach(subproject ${LABELS_FOR_SUBPROJECTS})
       #message("Subproject ${subproject}")
       if ("${CMAKE_VERSION}" VERSION_LESS "3.10")
-	set_property(GLOBAL PROPERTY SubProject ${subproject})
-	set_property(GLOBAL PROPERTY Label ${subproject})
+        set_property(GLOBAL PROPERTY SubProject ${subproject})
+        set_property(GLOBAL PROPERTY Label ${subproject})
       endif()
       ctest_build(TARGET ${subproject} APPEND)
       ctest_submit(PARTS Build  RETRY_COUNT 3)


Add dgc source code to bos platform. (#19892)

* add dgc.tgz to bos

--- cmake/external/dgc.cmake
+++ cmake/external/dgc.cmake
@@ -23,14 +23,14 @@
 ExternalProject_Add(
     extern_dgc
     ${EXTERNAL_PROJECT_LOG_ARGS}
-    GIT_REPOSITORY "https://github.com/PaddlePaddle/Fleet"
-    GIT_TAG "2d04dc3800cdd0601f1b65d547dabcc60b0cf9dc"
+    URL "http://fleet.bj.bcebos.com/collective.tgz"
+    URL_MD5  "015d565156c3de4e30fe25473f47e7a9"
     SOURCE_DIR "${DGC_SOURCES_DIR}"
     CONFIGURE_COMMAND ""
-    BUILD_COMMAND cd collective && make -j
+    BUILD_COMMAND make -j
     INSTALL_COMMAND mkdir -p ${DGC_INSTALL_DIR}/lib/  ${DGC_INCLUDE_DIR}/dgc
-        && cp ${DGC_SOURCES_DIR}/collective/build/lib/libdgc.a ${DGC_LIBRARIES}
-        && cp ${DGC_SOURCES_DIR}/collective/build/include/dgc.h ${DGC_INCLUDE_DIR}/dgc/
+        && cp ${DGC_SOURCES_DIR}/build/lib/libdgc.a ${DGC_LIBRARIES}
+        && cp ${DGC_SOURCES_DIR}/build/include/dgc.h ${DGC_INCLUDE_DIR}/dgc/
     BUILD_IN_SOURCE 1
 )


CMake: Turned on debug:fastlink on VS

CMake: Turned on debug:fastlink on VS

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -255,7 +255,14 @@
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /ZI")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /ZI")

+    # enable debug:fastlink for debug builds
+    # https://blogs.msdn.microsoft.com/vcblog/2014/11/12/speeding-up-the-incremental-developer-build-scenario/
+    set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG:FASTLINK")
+    set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /DEBUG:FASTLINK")
+
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
+
+

     # set iterator debug level (default=2)
     # https://msdn.microsoft.com/en-us/library/hh697468.aspx


dont use -march=native on Android

dont use -march=native on Android

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

--- cmake/pcl_find_sse.cmake
+++ cmake/pcl_find_sse.cmake
@@ -6,7 +6,7 @@
     if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
         execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-dumpversion"
                         OUTPUT_VARIABLE GCC_VERSION_STRING)
-        if(GCC_VERSION_STRING VERSION_GREATER 4.2 AND NOT APPLE)
+        if(GCC_VERSION_STRING VERSION_GREATER 4.2 AND NOT APPLE AND NOT ANDROID_NDK)
           SET(SSE_FLAGS "${SSE_FLAGS} -march=native")
           message(STATUS "Using CPU native flags for SSE optimization: ${SSE_FLAGS}")
         endif()


Now enabling languages earlier

Now enabling languages earlier


Add another option the MACRO_COLLECT_PLUGINS for specifying the default build state (ON/OFF) for bundles

--- openCherry/CMake/MacroCollectPlugins.cmake
+++ openCherry/CMake/MacroCollectPlugins.cmake
@@ -9,6 +9,7 @@
 #                       [BUNDLE_LIST_PATH bundle_list_path]
 #                       [CMAKE_CACHE_PREFIX cache_prefix]
 #                       [ENABLE_PLUGIN_MACROS _enable_macros]
+#                       [BUNDLE_DEFAULT_ON bundle_default_on]
 #                       [DEFAULT_BUILD_ON]
 #                       [FORCE_BUILD_ALL]
 #                       )
@@ -40,6 +41,10 @@
 # the macro is (<bundle-symbolicname>) and the macro must set the variable
 # ENABLE_PLUGIN to true or false. For Qt4, a default macro is provided.
 #
+# BUNDLE_DEFAULT_ON
+# <bundle_default_on> is a list of bundle symbolic names for which the
+# CMake build option should default to ON
+#
 # DEFAULT_BUILD_ON if set, the generated CMake option for building plug-ins
 # defaults to ON. Otherwise, it is set to OFF.
 #
@@ -50,7 +55,7 @@
 #
 MACRO(MACRO_COLLECT_PLUGINS)

-MACRO_PARSE_ARGUMENTS(_COLLECT "OUTPUT_DIR;CACHE_PLUGIN_SOURCE_DIRS;CACHE_PLUGIN_BINARY_DIRS;CACHE_PLUGIN_TARGETS;BUNDLE_LIST_PATH;CMAKE_CACHE_PREFIX;ENABLE_PLUGIN_MACROS" "DEFAULT_BUILD_ON;FORCE_BUILD_ALL" ${ARGN})
+MACRO_PARSE_ARGUMENTS(_COLLECT "OUTPUT_DIR;CACHE_PLUGIN_SOURCE_DIRS;CACHE_PLUGIN_BINARY_DIRS;CACHE_PLUGIN_TARGETS;BUNDLE_LIST_PATH;BUNDLE_DEFAULT_ON;CMAKE_CACHE_PREFIX;ENABLE_PLUGIN_MACROS" "DEFAULT_BUILD_ON;FORCE_BUILD_ALL" ${ARGN})

 IF(NOT _COLLECT_ADD_DIR)
   SET(_COLLECT_ADD_DIR 1)
@@ -118,7 +123,13 @@
 SET(${BUNDLE-SYMBOLICNAME}_SRC_DIR \"${dir_entry}\")
 SET(${BUNDLE-SYMBOLICNAME}_BIN_DIR \"${_COLLECT_OUTPUT_DIR}/${BUNDLE-SYMBOLICNAME}\")")

-      OPTION("${_COLLECT_CMAKE_CACHE_PREFIX}BUILD_${BUNDLE-SYMBOLICNAME}" "Build ${BUNDLE-SYMBOLICNAME} Plugin" ${_COLLECT_DEFAULT_BUILD_ON})
+      SET(_default_bundle_option ${_COLLECT_DEFAULT_BUILD_ON})
+      LIST(FIND _COLLECT_BUNDLE_DEFAULT_ON ${BUNDLE-SYMBOLICNAME} _bundle_default_on_found)
+      IF(_bundle_default_on_found GREATER -1)
+        SET(_default_bundle_option 1)
+      ENDIF()
+
+      OPTION("${_COLLECT_CMAKE_CACHE_PREFIX}BUILD_${BUNDLE-SYMBOLICNAME}" "Build ${BUNDLE-SYMBOLICNAME} Plugin" ${_default_bundle_option})
       IF(${_COLLECT_CMAKE_CACHE_PREFIX}BUILD_${BUNDLE-SYMBOLICNAME} OR _COLLECT_FORCE_BUILD_ALL)
         LIST(APPEND _plugins_to_build "${dir_entry}")
         STRING(REPLACE . _ _plugin_target ${BUNDLE-SYMBOLICNAME})


Minor change in a cmake rule to not use deep relative paths.

--- oss_src/unity/ReplicateSDKSourceTree.cmake
+++ oss_src/unity/ReplicateSDKSourceTree.cmake
@@ -39,11 +39,11 @@
 ## Copy boost
 set (boostfiles "")
 # find all direct included boost headers
-execute_process(COMMAND ${CMAKE_ARGV3}/../../../oss_local_scripts/find_boost_include.sh ${sdkfiles} OUTPUT_VARIABLE boostfiles)
+execute_process(COMMAND ${CMAKE_ARGV4}/oss_local_scripts/find_boost_include.sh ${sdkfiles} OUTPUT_VARIABLE boostfiles)
 string(REPLACE "\n" ";" boostfiles ${boostfiles})
 # use bcp to recursively copy all dependent headers
-set (bcp ${CMAKE_ARGV3}/../../../deps/local/bin/bcp)
-execute_process(COMMAND ${bcp} --boost=${CMAKE_ARGV3}/../../../deps/local/include ${boostfiles} ${CMAKE_ARGV3}/sdk)
+set (bcp ${CMAKE_ARGV4}/deps/local/bin/bcp)
+execute_process(COMMAND ${bcp} --boost=${CMAKE_ARGV4}/deps/local/include ${boostfiles} ${CMAKE_ARGV3}/sdk)

 ## Copy doxygen files
 file(COPY sdk/doxygen DESTINATION "${CMAKE_ARGV3}/sdk")


FIX: Sample plugin dlls install paths

FIX: Sample plugin dlls install paths

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -379,10 +379,7 @@

     # Installation
     install(TARGETS ${CEGUI_TARGET_NAME}
-        RUNTIME DESTINATION bin
-        LIBRARY DESTINATION ${CEGUI_LIB_INSTALL_DIR}
-        ARCHIVE DESTINATION ${CEGUI_LIB_INSTALL_DIR}
-        BUNDLE DESTINATION ${CEGUI_LIB_INSTALL_DIR}
+    LIBRARY DESTINATION bin
     )

     # Add the MetaData chunk of the sample to the final xml


cmake: Fix D2D include path w/ Visual Studio 2012.

--- cmake/FindDirectX.cmake
+++ cmake/FindDirectX.cmake
@@ -214,13 +214,11 @@

 	find_path (DirectX_D2D1_INCLUDE_DIR d2d1.h
-		PATHS
-			"${DirectX_ROOT_DIR}/Include"
+		PATHS ${DirectX_INC_SEARCH_PATH}
 		DOC "The directory where d2d1.h resides")

 	find_library (DirectX_D2D1_LIBRARY d2d1
-		PATHS
-			"${DirectX_ROOT_DIR}/Lib/x86"
+		PATHS ${DirectX_LIB_SEARCH_PATH}
 		DOC "The directory where d2d1 resides")

 	if (DirectX_D2D1_INCLUDE_DIR AND DirectX_D2D1_LIBRARY)


CMake: all libpaths in FastJet config

CMake: all libpaths in FastJet config

Fixes a problem with external CGAL accidentally introduced in
c819e34ba3979f3b400b27579b412b63e01fbde1 (sorry)

--- cmake/FindFASTJET.cmake
+++ cmake/FindFASTJET.cmake
@@ -71,25 +71,24 @@
     # Extracting compilation flags
     execute_process(COMMAND ${FASTJET_CONFIG} --cxxflags OUTPUT_VARIABLE FASTJET_CXXFLAGS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE)
     if(error)
-        message(FATAL_ERROR "Error retrieving FastJet compilation flags : ${error}")
+        message(FATAL_ERROR "Error retrieving FastJet compilation flags: ${error}")
     endif(error)

-    # Extracting the include path from the CXX flags
+    # Extracting the include path(s?) from the CXX flags (LIST)
     set(FASTJET_INCLUDE_DIR)
     if(FASTJET_CXXFLAGS)
         string(REGEX MATCHALL "(^| )-I[^ ]+" incfolders ${FASTJET_CXXFLAGS})
         foreach(incfolder ${incfolders})
             string(STRIP ${incfolder} incfolder)
             string(SUBSTRING ${incfolder} 2 -1 incfolder)
-            set(FASTJET_INCLUDE_DIR ${incfolder})
-            break()
+            list(APPEND FASTJET_INCLUDE_DIR ${incfolder})
         endforeach()
     endif(FASTJET_CXXFLAGS)

     # Extracting libraries and linking options
     execute_process(COMMAND ${FASTJET_CONFIG} --libs OUTPUT_VARIABLE FASTJET_CONFIGLIBS ERROR_VARIABLE error OUTPUT_STRIP_TRAILING_WHITESPACE)
     if(error)
-        message(FATAL_ERROR "Error retrieving FastJet libs : ${error}")
+        message(FATAL_ERROR "Error retrieving FastJet libs: ${error}")
     endif(error)

     # Extracting the list of needed libraries during linking and the linking directory
@@ -97,7 +96,7 @@
     set(FASTJET_LIBS_DIR)
     if(FASTJET_CONFIGLIBS)

-        # Extract libraries needed at link time (-l): the output is a LIST
+        # Extract libraries needed at link time (-l) (LIST)
         string(REGEX MATCHALL "(^| )-l[^ ]+" fjlibs ${FASTJET_CONFIGLIBS})
         foreach(fjlib ${fjlibs})
             string(STRIP ${fjlib} fjlib)
@@ -105,13 +104,12 @@
             list(APPEND FASTJET_LIBS ${fjlib})
         endforeach()

-        # Extract library path: only one STRING as output
+        # Extract library paths used by FastJet to find needed libs: (LIST)
         string(REGEX MATCHALL "(^| )-L[^ ]+" fjlibdirs ${FASTJET_CONFIGLIBS})
         foreach(fjlibdir ${fjlibdirs})
             string(STRIP ${fjlibdir} fjlibdir)
             string(SUBSTRING ${fjlibdir} 2 -1 fjlibdir)
-            set(FASTJET_LIBS_DIR ${fjlibdir})
-            break()
+            list(APPEND FASTJET_LIBS_DIR ${fjlibdir})
         endforeach()

     endif(FASTJET_CONFIGLIBS)


Allowed FindLog4CXX.cmake to respect LOG4CXX_ROOT_DIR

--- cmake/FindLog4CXX.cmake
+++ cmake/FindLog4CXX.cmake
@@ -55,6 +55,7 @@
         ${PC_LOG4CXX_INCLUDE_DIRS}
     PATH_SUFFIXES
 		log4cxx
+	NO_DEFAULT_PATH
 )

 find_library(LOG4CXX_LIBRARY
@@ -63,9 +64,10 @@
     PATHS
 		${LOG4CXX_ROOT_DIR}/lib
         ${PC_LOG4CXX_LIBDIR}
-        ${PC_LOG4CXX_LIBRARY_DIRS}
+        ${PC_LOG4CXX_LIBRARY_DIRS}
+    NO_DEFAULT_PATH
 )
-
+
 include(FindPackageHandleStandardArgs)

 # handle the QUIETLY and REQUIRED arguments and set LOG4CXX_FOUND to TRUE


Disable coverage if target has no supported sources.

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -210,6 +210,13 @@
 	endforeach ()
 	list(REMOVE_DUPLICATES TARGET_LANGUAGES)

+	if ("${TARGET_LANGUAGES}" STREQUAL "")
+		message(AUTHOR_WARNING "Coverage disabled for target ${TNAME} "
+			"because there is no coverage available for target sources."
+		)
+		return()
+	endif()
+
 	set(TARGET_LANG "")
 	set(TEMP_COMPILER "")
 	foreach (LANG ${TARGET_LANGUAGES})
@@ -219,8 +226,7 @@
 			set(TARGET_LANG ${LANG})
 		else ()
 			message(AUTHOR_WARNING "Coverage disabled for target ${TNAME} "
-				"because it will be compiled by different compilers. "
-				"Please set compiler- and linker-flags manual for this target."
+				"because it will be compiled by different compilers."
 			)
 			return()
 		endif ()


splitted add_coverage into two functions

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -38,43 +38,20 @@

-# Add coverage support for target ${TARGET} and register target for gcov. If
-# coverage is disabled or not supported, this function will simply do nothing.
+# Add coverage support for target ${TNAME} and register target for coverage
+# evaluation. If coverage is disabled or not supported, this function will
+# simply do nothing.
 #
-# Note: This function is defined at the top of this module to explictly define
-# add_coverage, even if there is no support for coverage, to not break build-
-# scripts.
+# Note: This function is only a wrapper to define this function always, even if
+#   coverage is not supported by the compiler or disabled. This function must
+#   stay here, because the module will be exited, if there is no coverage
+#   support by the compiler or it is disabled by the user.
 #
 function(add_coverage TNAME)
-	# If coverage is disabled, or coverage is already enabled for this target,
-	# we can skip the execution of this function.
-	if (NOT ENABLE_COVERAGE OR TARGET ${TNAME}-coverage)
-		return()
+	# only add coverage for target, if coverage is support and enabled.
+	if (ENABLE_COVERAGE)
+		add_coverage_target(${TNAME})
 	endif ()
-
-	# create coverage target for this target
-	add_custom_target(${TNAME}-coverage DEPENDS ${TNAME})
-
-	# enable coverage for target
-	set_property(TARGET ${TNAME}
-		APPEND_STRING
-		PROPERTY COMPILE_FLAGS " ${COVERAGE_CFLAGS}"
-	)
-	set_property(TARGET ${TNAME}
-		APPEND_STRING
-		PROPERTY LINK_FLAGS " ${COVERAGE_LINKER_FLAGS}"
-	)
-
-
-	# add gcov evaluation
-	if (GCOV_FOUND)
-		add_gcov_target(${TNAME})
-	endif (GCOV_FOUND)
-
-	# add lcov evaluation
-	if (LCOV_FOUND)
-		add_lcov_target(${TNAME})
-	endif (LCOV_FOUND)
 endfunction(add_coverage)

@@ -116,7 +93,7 @@
 	endif ()
 endforeach()

-# abort, if no coverage support by compiler. Disable coverage for further
+# Abort, if no coverage support by compiler. Disable coverage for further
 # processing, so add_coverage will ignore it.
 if (NOT COVERAGE_FOUND)
 	message(WARNING "No compiler supports coverage.")
@@ -124,6 +101,42 @@
 	return()
 endif()

+
+
+# Add coverage support for target ${TNAME} and register target for coverage
+# evaluation.
+#
+function(add_coverage_target TNAME)
+	# If coverage is already enabled for this target, we can skip the execution
+	# of this function.
+	if (TARGET ${TNAME}-coverage)
+		return()
+	endif ()
+
+	# create coverage target for this target
+	add_custom_target(${TNAME}-coverage DEPENDS ${TNAME})
+
+	# enable coverage for target
+	set_property(TARGET ${TNAME}
+		APPEND_STRING
+		PROPERTY COMPILE_FLAGS " ${COVERAGE_CFLAGS}"
+	)
+	set_property(TARGET ${TNAME}
+		APPEND_STRING
+		PROPERTY LINK_FLAGS " ${COVERAGE_LINKER_FLAGS}"
+	)
+
+
+	# add gcov evaluation
+	if (GCOV_FOUND)
+		add_gcov_target(${TNAME})
+	endif (GCOV_FOUND)
+
+	# add lcov evaluation
+	if (LCOV_FOUND)
+		add_lcov_target(${TNAME})
+	endif (LCOV_FOUND)
+endfunction(add_coverage_target)

 # If ENABLE_COVERAGE_ALL is enabled, overload add_executable and add_library


Remove last occurrences of uncrustify

Remove last occurrences of uncrustify

--- cmake/HealthCheck.cmake
+++ cmake/HealthCheck.cmake
@@ -4,7 +4,6 @@

 set(OPTION_CPPCHECK_ENABLED Off)
 set(OPTION_CLANG_TIDY_ENABLED Off)
-set(OPTION_UNCRUSTIFY_ENABLED Off)

 # Function to register a target for enabled health checks
 function(perform_health_checks target)
@@ -22,11 +21,6 @@
     if (OPTION_CLANG_TIDY_ENABLED)
         perform_clang_tidy(clang-tidy-${target} ${target} ${ARGN})
         add_dependencies(check-${target} clang-tidy-${target})
-    endif()
-
-    if (OPTION_UNCRUSTIFY_ENABLED)
-        perform_uncrustify(uncrustify-${target} ${target} ${ARGN})
-        add_dependencies(check-${target} uncrustify-${target})
     endif()

     add_dependencies(check-all check-${target})


cmake: set: document function

cmake: set: document function

--- cmake/qibuild/set.cmake
+++ cmake/qibuild/set.cmake
@@ -1,13 +1,16 @@
 ## Copyright (C) 2011 Aldebaran Robotics

+# write the variable into cache, variable wont be visible
 macro(qi_set_global name)
   set("${name}" ${ARGN} CACHE INTERNAL "" FORCE)
 endmacro()

+# write the variable into cache
 macro(qi_set_cache name)
   set("${name}" ${ARGN} CACHE STRING "" FORCE)
 endmacro()

+# write the variable into cache, mark as an advanced variable
 macro(qi_set_advanced_cache name)
   set("${name}" ${ARGN} CACHE STRING "" FORCE)
   mark_as_advanced("${name}")


Android build needs to find 'echo' first.

Otherwise, the android build will fail to
build libshaderc_combined.a

--- cmake/setup_build.cmake
+++ cmake/setup_build.cmake
@@ -24,14 +24,17 @@
 if (ANDROID)
 # For android let's preemptively find the correct packages so that
 # child projects (glslang, googletest) do not fail to find them.
+find_host_program(ECHO_EXE echo REQUIRED)
 find_host_program(PYTHON_EXE python REQUIRED)
 find_host_package(PythonInterp)
 find_host_package(BISON)
 else()
+# Every extra program found here should have a corresponding
+# entry for the ANDROID case.
+find_program(ECHO_EXE echo REQUIRED)
 find_program(PYTHON_EXE python REQUIRED)
 endif()

-find_program(ECHO_EXE echo REQUIRED)

 option(ENABLE_CODE_COVERAGE "Enable collecting code coverage." OFF)
 if (ENABLE_CODE_COVERAGE)


install: install required python scripts

Signed-off-by: Karol Gugala <38af71640571ee4b5093d4f69ffca1ac454f2948@antmicro.com>

--- xc7/make/install.cmake
+++ xc7/make/install.cmake
@@ -38,6 +38,7 @@
   install(FILES ${TOOLCHAIN_WRAPPERS} ${VPR_COMMON}
           DESTINATION bin
           PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
+
   # install binaries
   install(FILES ${YOSYS_BINS} ${VPR} ${GENFASM}
           DESTINATION bin
@@ -52,6 +53,18 @@
   install(FILES ${FASM_TO_BIT}
           DESTINATION bin/python
           PERMISSIONS WORLD_EXECUTE WORLD_READ OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE)
+
+  install(DIRECTORY ${symbiflow-arch-defs_SOURCE_DIR}/third_party/fasm
+          DESTINATION bin/python)
+
+  install(DIRECTORY ${symbiflow-arch-defs_SOURCE_DIR}/third_party/prjxray/prjxray
+          DESTINATION bin/python/prjxray)
+
+  install(DIRECTORY ${symbiflow-arch-defs_SOURCE_DIR}/third_party/prjxray/utils
+          DESTINATION bin/python/prjxray)
+
+  install(FILES ${symbiflow-arch-defs_SOURCE_DIR}/utils/lib/parse_pcf.py
+          DESTINATION bin/python/lib)

   # install yosys data
   install(DIRECTORY ${YOSYS_DATADIR}


add the right flag to build with clang++ on Linux

fix https://github.com/jamoma/JamomaCore/issues/380
thansk to @jcelerier

--- Shared/CMake/JamomaPlatformSpecific.cmake
+++ Shared/CMake/JamomaPlatformSpecific.cmake
@@ -56,6 +56,11 @@
 				include_directories("/usr/include/i386-linux-gnu/c++/4.8/")
 			endif()
 		endif()
+
+                if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+                    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+                endif()
+
 	elseif(MINGW)
 		add_definitions(-DTT_PLATFORM_WIN)
 		SET(CPACK_GENERATOR "NSIS")


cmake: Fixed ASM checks incorrectly checking for ATT dialect support on GAS files

--- .cmake/Modules/CheckCompile.cmake
+++ .cmake/Modules/CheckCompile.cmake
@@ -13,7 +13,7 @@
 endfunction ()

 function (check_asm_source_compiles _S _VAR)
-  if (NOT CMAKE_ASM-ATT_COMPILER_WORKS)
+  if (NOT CMAKE_ASM_COMPILER_WORKS)
     set (${_VAR} FALSE)
     return ()
   endif ()


cmake: fixed compilation woth clang on Linux

Clang does not seem to like the option -stdlib on Ubuntu, but seems
required on MacOS (Investigation ongoing)

--- src/cmake/common-settings.cmake
+++ src/cmake/common-settings.cmake
@@ -100,7 +100,8 @@
 			endif()
 		endif()
 	endif()
-	if (YUNI_HAS_LIB_CPP11_SUPPORT)
+	if (YUNI_HAS_LIB_CPP11_SUPPORT AND (NOT CLANG OR APPLE))
+		# clang seems to not like the option -stdlib, but required on MacOS...
 		set(YUNI_COMMON_CXX_OPTIONS  "${YUNI_COMMON_CXX_OPTIONS} -stdlib=libc++")
 	endif()


Add support for using OGRE_SOURCE_DIR on Linux

--- CMake/Packages/FindOGRE_Old.cmake
+++ CMake/Packages/FindOGRE_Old.cmake
@@ -25,12 +25,6 @@
 		CMAKE_POLICY(POP)
 	else()

-		if(WIN32 OR APPLE)
-			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OGRE_SOURCE_DIR}/CMake ${OGRE_SOURCE_DIR}/CMake/Packages)
-		else()
-			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/lib/OGRE/cmake/ /usr/local/lib/OGRE/cmake /usr/share/OGRE/cmake/modules /usr/local/share/OGRE/cmake/modules)
-		endif()
-
 		IF (NOT OGRE_SOURCE_DIR)
 			set(OGRE_SOURCE_DIR "" CACHE PATH "Path to Ogre sources (set it if you don't have OGRE_HOME or OGRE_SRC environment variables)")
 		ENDIF ()
@@ -38,6 +32,14 @@
 		if (NOT OGRE_BUILD)
 			set(OGRE_BUILD ${OGRE_SOURCE_DIR} CACHE PATH "Path to Ogre build directory (same as OGRE_SOURCE_DIR by default)")
 		endif ()
+
+		if (NOT ${OGRE_SOURCE_DIR} STREQUAL "")
+			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OGRE_SOURCE_DIR}/CMake ${OGRE_SOURCE_DIR}/CMake/Packages)
+		endif()
+
+		if (NOT (WIN32 OR APPLE))
+			set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/lib/OGRE/cmake/ /usr/local/lib/OGRE/cmake /usr/share/OGRE/cmake/modules /usr/local/share/OGRE/cmake/modules)
+		endif()

 		if (EXISTS ${OGRE_SOURCE_DIR}/CMake)
 			MESSAGE(STATUS "Original FindOGRE.cmake found in OGRE_SOURCE_DIR, trying to use it")


Disable dependencies from freetype external project build

For a not yet known reason, having these dependencies is causing
linking errors although package based freetype installations don't
have such issue. Since the PNG, ZLIB, BZip2 and harfbuzz are not
required for forge's use case of freetype, they are disabled.

--- CMakeModules/build_freetype.cmake
+++ CMakeModules/build_freetype.cmake
@@ -19,7 +19,6 @@
     SET(byproducts BYPRODUCTS ${freetype_location})
 ENDIF()

-
 IF(UNIX)
     SET(CXXFLAGS "${CMAKE_CXX_FLAGS} -w -fPIC")
     SET(CFLAGS "${CMAKE_C_FLAGS} -w -fPIC")
@@ -33,7 +32,10 @@
     INSTALL_DIR "${prefix}"
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${CMAKE_COMMAND} -Wno-dev "-G${CMAKE_GENERATOR}" <SOURCE_DIR>
-    -DWITH_HarfBuzz:BOOL=OFF
+    -DWITH_HarfBuzz=OFF
+    -DWITH_ZLIB=OFF
+    -DWITH_BZip2=OFF
+    -DWITH_PNG=OFF
     -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
     -DCMAKE_CXX_FLAGS:STRING=${CXXFLAGS}
     -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}


remove unnecessary  set with PARENT_SCOPE from macro

--- ctest_ext.cmake
+++ ctest_ext.cmake
@@ -424,8 +424,6 @@
             endif()
         endif()
     endif()
-
-    set(HAVE_UPDATES ${HAVE_UPDATES} PARENT_SCOPE)
 endmacro()

 #


Fix ExternalData Path to in source location

--- CMake/sitkExternalData.cmake
+++ CMake/sitkExternalData.cmake
@@ -19,7 +19,7 @@
 endif()
 list(APPEND ExternalData_OBJECT_STORES
   # Local data store populated by the ITK pre-commit hook
-  "${SimpleITK_SOURCE_DIR}/../.ExternalData"
+  "${SimpleITK_SOURCE_DIR}/.ExternalData"
   )

 set(ExternalData_BINARY_ROOT ${CMAKE_BINARY_DIR}/ExternalData)