remove duplicate common.cmake

remove duplicate common.cmake

--- common.cmake
+++ common.cmake
@@ -1,96 +0,0 @@
-# Copyright (c) 2017 Egor Tensin <Egor.Tensin@gmail.com>
-# It's a CMake code snippet I use in all of my CMake projects.
-# It makes targets link the runtime statically by default + strips debug
-# symbols in release builds.
-# The latest version can be found at
-# https://gist.github.com/egor-tensin/cmake-common.
-# Distributed under the MIT License.
-
-# Version: 2017-05-19T13:51:22+00:00
-
-get_directory_property(parent_directory PARENT_DIRECTORY)
-set(is_root_project $<NOT:parent_directory>)
-
-set(USE_STATIC_RUNTIME "${is_root_project}" CACHE BOOL "Link the runtime statically")
-set(STRIP_SYMBOL_TABLE "${is_root_project}" CACHE BOOL "Strip symbol tables")
-
-if(is_root_project)
-    if(MSVC)
-        add_compile_options(/MP /W4)
-    elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        add_compile_options(-Wall -Wextra)
-    endif()
-endif()
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-function(use_static_runtime_msvc target)
-    get_target_property(target_type "${target}" TYPE)
-    if(target_type STREQUAL INTERFACE_LIBRARY)
-    else()
-        target_compile_options("${target}" PRIVATE
-            $<$<CONFIG:Debug>:/MTd>
-            $<$<NOT:$<CONFIG:Debug>>:/MT>)
-    endif()
-endfunction()
-
-function(use_static_runtime_gcc target)
-    get_target_property(target_type "${target}" TYPE)
-    if(target_type STREQUAL EXECUTABLE)
-        target_link_libraries("${target}" PRIVATE -static)
-    endif()
-endfunction()
-
-function(use_static_runtime target)
-    if(MSVC)
-        use_static_runtime_msvc("${target}")
-    elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        use_static_runtime_gcc("${target}")
-    else()
-        message(WARNING "Unrecognized toolset")
-    endif()
-endfunction()
-
-function(strip_symbol_table_gcc target)
-    get_target_property(target_type "${target}" TYPE)
-    set(release_build $<OR:$<CONFIG:Release>,$<CONFIG:MinSizeRel>>)
-    if(target_type STREQUAL INTERFACE_LIBRARY)
-    else()
-        target_link_libraries("${target}" PRIVATE $<${release_build}:-s>)
-    endif()
-endfunction()
-
-function(strip_symbol_table target)
-    if(MSVC)
-    elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
-        strip_symbol_table_gcc("${target}")
-    else()
-        message(WARNING "Unrecognized toolset")
-    endif()
-endfunction()
-
-function(apply_common_settings target)
-    if(TARGET "${target}")
-        get_target_property(target_imported "${target}" IMPORTED)
-        if(target_imported STREQUAL NOTFOUND OR NOT target_imported)
-            if(STRIP_SYMBOL_TABLE)
-                strip_symbol_table("${target}")
-            endif()
-            if(USE_STATIC_RUNTIME)
-                use_static_runtime("${target}")
-            endif()
-        endif()
-    endif()
-endfunction()
-
-macro(add_executable target)
-    _add_executable(${ARGV})
-    apply_common_settings("${target}")
-endmacro()
-
-macro(add_library target)
-    _add_library(${ARGV})
-    apply_common_settings("${target}")
-endmacro()


build: add ccache option to envoy build (#380)

At least on my machine, ccache set via CC and CXX env variables is no
longer working and breaks the boringssl build. This allows ccache to
be turned on via cmake for the envoy code only.

--- common.cmake
+++ common.cmake
@@ -34,5 +34,14 @@

 option(ENVOY_STRIP "strip symbols from binaries" OFF)

+option(ENVOY_USE_CCACHE "build with ccache" OFF)
+if (ENVOY_USE_CCACHE)
+  find_program(CCACHE_FOUND ccache)
+  if (CCACHE_FOUND)
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
+    set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
+  endif()
+endif()
+
 set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${ENVOY_COTIRE_MODULE_DIR}")
 include(cotire)


Added Debian changelog to -tests package.


Must have modules are avformat and avcodec

All other modules are considered optinal

--- CMake/FindFFMPEG.cmake
+++ CMake/FindFFMPEG.cmake
@@ -110,9 +110,10 @@
 FFMPEG_FIND(LIBSWSCALE  swscale  swscale.h)  # not sure about the header to look for here.

 SET(FFMPEG_FOUND "NO")
-# Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.
-IF   (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVDEVICE_FOUND AND
-      FFMPEG_LIBAVCODEC_FOUND AND FFMPEG_LIBAVUTIL_FOUND AND STDINT_OK)
+
+# Note we don't check FFMPEG_LIBSWSCALE_FOUND, FFMPEG_LIBAVDEVICE_FOUND,
+# and FFMPEG_LIBAVUTIL_FOUND as they are optional.
+IF (FFMPEG_LIBAVFORMAT_FOUND AND FFMPEG_LIBAVCODEC_FOUND AND STDINT_OK)

     SET(FFMPEG_FOUND "YES")

@@ -128,8 +129,4 @@
         ${FFMPEG_LIBAVCODEC_LIBRARIES}
         ${FFMPEG_LIBAVUTIL_LIBRARIES}
         ${FFMPEG_LIBSWSCALE_LIBRARIES})
-ELSE ()
-
-#    MESSAGE(STATUS "Could not find FFMPEG")
-
-ENDIF()
+ENDIF()


ENH: Add the superbuild itkpython binary folder to FindSphinx

Change-Id: Idb8bb61469d5be63b2182524df071274699579cb

--- CMake/FindSphinx.cmake
+++ CMake/FindSphinx.cmake
@@ -5,8 +5,22 @@
 #  SPHINX_EXECUTABLE
 #  SPHINX_FOUND

+set(_python_paths )
+find_package(PythonInterp)
+if(PYTHON_EXECUTABLE)
+  get_filename_component(_python_dir "${PYTHON_EXECUTABLE}" DIRECTORY)
+  list(APPEND _python_paths
+    "${_python_dir}"
+    "${_python_dir}/Scripts"
+    )
+endif()
+
+
 find_program(SPHINX_EXECUTABLE
-  NAMES sphinx-build
+  NAMES
+    sphinx-build sphinx-build.exe
+  HINTS
+    ${_python_paths}
   PATHS
     /usr/bin
     /usr/local/bin


STYLE

STYLE

--- CMake/ImportPqxx.cmake
+++ CMake/ImportPqxx.cmake
@@ -5,14 +5,14 @@

 IF(OTB_USE_PQXX)
   FIND_PACKAGE(Pqxx)
-    IF(PQXX_FOUND)
-      MESSAGE(STATUS "Activating Pqxx support")
-      ADD_DEFINITIONS(-DOTB_USE_PQXX)
-    ELSE(PQXX_FOUND)
-      # Generate an error if no external Pqxx is available
-      MESSAGE(FATAL_ERROR "Pqxx required but not found. "
-                          "Turn OTB_USE_PQXX to OFF")
-    ENDIF(PQXX_FOUND)
+  IF(PQXX_FOUND)
+    MESSAGE(STATUS "Activating Pqxx support")
+    ADD_DEFINITIONS(-DOTB_USE_PQXX)
+  ELSE(PQXX_FOUND)
+    # Generate an error if no external Pqxx is available
+    MESSAGE(FATAL_ERROR "Pqxx required but not found. "
+                        "Turn OTB_USE_PQXX to OFF")
+  ENDIF(PQXX_FOUND)
 ELSE(OTB_USE_PQXX)
   MESSAGE(STATUS "Disabling Pqxx support")
 ENDIF(OTB_USE_PQXX)


Update GTest to 1.12.1

Update GTest to 1.12.1

--- SuperBuild/External_GTest.cmake
+++ SuperBuild/External_GTest.cmake
@@ -10,7 +10,7 @@
 set(GTEST_GIT_REPOSITORY "${git_protocol}://github.com/google/googletest.git" CACHE  STRING "Google Test repository")
 mark_as_advanced(GTEST_GIT_REPOSITORY)

-set(GTEST_GIT_TAG "release-1.11.0" CACHE STRING "Tag or hash for GTtest git repo")
+set(GTEST_GIT_TAG "release-1.12.1" CACHE STRING "Tag or hash for GTtest git repo")
 mark_as_advanced(GTEST_GIT_TAG)
 set(GTEST_TAG_COMMAND GIT_TAG "${GTEST_GIT_TAG}")


Updated zstd library name due to changes in vcpkg

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/FindBlosc.cmake
+++ cmake/FindBlosc.cmake
@@ -251,7 +251,7 @@
     if(BLOSC_USE_EXTERNAL_SOURCES)
       set_target_properties(Blosc::blosc PROPERTIES
         INTERFACE_LINK_DIRECTORIES "${Blosc_LIBRARY_DIRS}"
-        INTERFACE_LINK_LIBRARIES "lz4;snappy;zlib;zstd"
+        INTERFACE_LINK_LIBRARIES "lz4;snappy;zlib;zstd_static"
       )
     endif()
   endif()


Missed one library to mark as advanced

Missed one library to mark as advanced

--- cmake/FindPhysX.cmake
+++ cmake/FindPhysX.cmake
@@ -202,4 +202,4 @@
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PhysX  DEFAULT_MSG  PhysX_INCLUDE_DIR PhysX_LIBRARY_DEBUG PhysX_LIBRARY_RELEASE ${NECESSARY_COMPONENTS})

-MARK_AS_ADVANCED(PhysX_INCLUDE_DIR PhysX_LIBRARY_DIR PhysX_LIBRARY_DEBUG PhysX_LIBRARY_RELEASE)+MARK_AS_ADVANCED(PhysX_INCLUDE_DIR PhysX_LIBRARY_DIR PhysX_LIBRARY_DEBUG PhysX_LIBRARY_RELEASE PhysX_LIBRARY_PROFILE)


--- cmake/XercesDLL.cmake
+++ cmake/XercesDLL.cmake
@@ -21,6 +21,7 @@
 # cache variable

 set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
+set(BUILD_SHARED_RUNTIME ON CACHE BOOL "Build with shared linked runtine library (MSVC)")

 # Add a d postfix to Debug libraries on Windows

@@ -47,3 +48,15 @@
     set(XERCES_DLL_EXPORT 1)
   endif()
 endif()
+
+if(MSVC)
+  if(BUILD_SHARED_RUNTIME)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELESE} /MD")
+  else()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
+    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
+    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELESE} /MT")
+  endif()
+endif()


Removed unnecessary CATKIN_DEPENDS.

Removed unnecessary CATKIN_DEPENDS.

The `message_generation` and `cmake_modules` catkin packages were
mistakenly added to the `catkin_package(CATKIN_DEPENDS ...` directive,
leading to unnecessary runtime dependencies.

--- catkin.cmake
+++ catkin.cmake
@@ -34,8 +34,6 @@
                  sensor_msgs
                  image_transport
                  roscpp
-                 cmake_modules
-                 message_generation
                  geometry_msgs
 )


Bugfix

Bugfix

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@26428 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/contrib/cmake/configure/configure_umfpack.cmake
+++ deal.II/contrib/cmake/configure/configure_umfpack.cmake
@@ -15,7 +15,7 @@
   FIND_PACKAGE(AMD)

   IF(UMFPACK_FOUND AND AMD_FOUND)
-    #SET(${var} TRUE)
+    SET(${var} TRUE)
   ENDIF()

 ENDMACRO()


STYLE: New logo

STYLE: New logo

--- Common.cmake
+++ Common.cmake
@@ -45,7 +45,7 @@
 set(EXTENSION_CATEGORY "Diffusion")
 set(EXTENSION_CONTRIBUTORS "Francois Budin (UNC)")
 set(EXTENSION_DESCRIPTION "FiberViewerLight is an open-source software to visualize and edit fibers")
-set(EXTENSION_ICONURL "http://www.nitrc.org/project/screenshot.php?group_id=534&screenshot_id=598")
+set(EXTENSION_ICONURL "https://www.nitrc.org/project/screenshot.php?group_id=534&screenshot_id=766")
 set(EXTENSION_SCREENSHOTURLS "http://www.nitrc.org/project/list_screenshots.php?group_id=534&screenshot_id=599 http://www.nitrc.org/project/list_screenshots.php?group_id=534&screenshot_id=597")
 set(EXTENSION_STATUS "Beta")
 set(EXTENSION_DEPENDS "NA") # Specified as a space separated list or 'NA' if any


Issue #53: Make obvious which Boost you are picking up.

--- CMake/mpIncludeBoost.cmake
+++ CMake/mpIncludeBoost.cmake
@@ -37,6 +37,8 @@
   find_package(Boost 1.67 EXACT COMPONENTS ${MYPROJECT_BOOST_LIBS} REQUIRED)
   include_directories(${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})
+  message("Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
+  message("Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}")
   if(WIN32)
     if(WITHIN_SUBBUILD)
       add_definitions(-DBoost_LIB_DIAGNOSTIC_DEFINITIONS)  # To get debug messages


Reset conditionally used variables at beginning

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -16,6 +16,12 @@
 set(Boost_DEPENDS ${proj})

 if(NOT DEFINED BOOST_ROOT AND NOT MITK_USE_SYSTEM_Boost)
+
+  #[[ Reset variables. ]]
+  set(patch_cmd "")
+  set(configure_cmd "")
+  set(build_cmd "")
+  set(install_cmd "")

   set(BOOST_ROOT ${ep_prefix})


Make the option not available for Release build config. Due to how CMake works, this prevention only works for single-config generator.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -185,7 +185,7 @@
         # It is not possible to turn SSE off on 64-bit MSVC and it appears it is also not able to do so safely on 64-bit GCC
         cmake_dependent_option (URHO3D_SSE "Enable SIMD instruction set (32-bit Web and Intel platforms only, including Android on Intel Atom); default to true on Intel and false on Web platform; the effective SSE level could be higher, see also URHO3D_DEPLOYMENT_TARGET and CMAKE_OSX_DEPLOYMENT_TARGET build options" "${URHO3D_DEFAULT_SIMD}" "NOT URHO3D_64BIT" TRUE)
     endif ()
-    option (URHO3D_HASH_DEBUG "Enable StringHash reversing and hash collision detection at the expense of memory and performance penalty" FALSE)
+    cmake_dependent_option (URHO3D_HASH_DEBUG "Enable StringHash reversing and hash collision detection at the expense of memory and performance penalty" FALSE "NOT CMAKE_BUILD_TYPE STREQUAL Release" FALSE)
     cmake_dependent_option (URHO3D_3DNOW "Enable 3DNow! instruction set (Linux platform only); should only be used for older CPU with (legacy) 3DNow! support" "${HAVE_3DNOW}" "X86 AND CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT URHO3D_SSE" FALSE)
     cmake_dependent_option (URHO3D_MMX "Enable MMX instruction set (32-bit Linux platform only); the MMX is effectively enabled when 3DNow! or SSE is enabled; should only be used for older CPU with MMX support" "${HAVE_MMX}" "X86 AND CMAKE_SYSTEM_NAME STREQUAL Linux AND NOT URHO3D_64BIT AND NOT URHO3D_SSE AND NOT URHO3D_3DNOW" FALSE)
     # For completeness sake - this option is intentionally not documented as we do not officially support PowerPC (yet)


Updted lua macros

Updted lua macros

--- cmake/lua.cmake
+++ cmake/lua.cmake
@@ -31,34 +31,43 @@
 # install_lua_executable ( target source )
 # Automatically generate a binary if srlua package is available
 # The application or its source will be placed into /bin
-# If the application source did not have .lua suffix then it will be added
+# If the application source did have .lua suffix then it will be removed
 # USE: lua_executable ( sputnik src/sputnik.lua )
 macro ( install_lua_executable _name _source )
-  get_filename_component ( _source_name ${_source} NAME_WE )
   # Find srlua and glue
   find_program( SRLUA_EXECUTABLE NAMES srlua )
   find_program( GLUE_EXECUTABLE NAMES glue )
-
+  # Executable output
+  set ( _exe ${CMAKE_CURRENT_BINARY_DIR}/${_name}${CMAKE_EXECUTABLE_SUFFIX} )
   if ( NOT SKIP_LUA_WRAPPER AND SRLUA_EXECUTABLE AND GLUE_EXECUTABLE )
-    # Generate binary gluing the lua code to srlua
+    # Generate binary gluing the lua code to srlua, this is a robuust approach for most systems
+    # Recommended, expecially for Windows systems
     add_custom_command(
-      OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}
+      OUTPUT ${_exe}
       COMMAND ${GLUE_EXECUTABLE}
-      ARGS ${SRLUA_EXECUTABLE} ${_source} ${CMAKE_CURRENT_BINARY_DIR}/${_name}
+      ARGS ${SRLUA_EXECUTABLE} ${_source} ${_exe}
       DEPENDS ${_source}
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
       VERBATIM
     )
     # Make sure we have a target associated with the binary
     add_custom_target(${_name} ALL
-        DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_name}
+        DEPENDS ${_exe}
     )
     # Install with run permissions
-    install ( PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${_name} DESTINATION ${INSTALL_BIN} )
+    install ( PROGRAMS ${_exe} DESTINATION ${INSTALL_BIN} COMPONENT Runtime)
+    # Also install the source as optional component
+    install ( PROGRAMS ${_source} DESTINATION ${INSTALL_FOO}
+            RENAME ${_name}
+    	      COMPONENT Other
+    )
   else()
-    # Add .lua suffix and install as is
+    # Install into bin as is, we assume the executable uses UNIX shebang
+    # NOTE: This approach is unsuitable for non UNIX systems
     install ( PROGRAMS ${_source} DESTINATION ${INSTALL_BIN}
-            RENAME ${_source_name}.lua )
+            RENAME ${_name}
+            COMPONENT Runtime
+    )
   endif()
 endmacro ()

@@ -102,7 +111,9 @@

     if ( ${is_install} )
       install ( FILES ${_first_source} DESTINATION ${INSTALL_LMOD}/${_module_dir}
-                RENAME ${_module_filename} )
+                RENAME ${_module_filename}
+                COMPONENT Runtime
+      )
     endif ()
   else ()  # Lua C binary module
     enable_language ( C )
@@ -123,7 +134,7 @@
     set_target_properties ( ${_target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
                 "${_module_dir}" PREFIX "" OUTPUT_NAME "${_module_filenamebase}" )
     if ( ${is_install} )
-      install ( TARGETS ${_target} DESTINATION ${INSTALL_CMOD}/${_module_dir})
+      install ( TARGETS ${_target} DESTINATION ${INSTALL_CMOD}/${_module_dir} COMPONENT Runtime)
     endif ()
   endif ()
 endmacro ()


fixed handling case with zero packages in setup.py

--- cmake/catkin_export_python.cmake
+++ cmake/catkin_export_python.cmake
@@ -58,21 +58,23 @@
     endif()
     include(${${pkg_name}_BINARY_DIR}/${PATH_TO_SETUP_PY}setup_py_interrogation.cmake)

-    list(LENGTH ${pkg_name}_PACKAGES pkgs_count)
-    math(EXPR pkgs_range "${pkgs_count} - 1")
-    foreach(index RANGE ${pkgs_range})
-      list(GET ${pkg_name}_PACKAGES ${index} pkg)
-      list(GET ${pkg_name}_PACKAGE_DIRS ${index} pkg_dir)
-      get_filename_component(name ${pkg_dir} NAME)
-      if(NOT ("${pkg}" STREQUAL "${name}"))
-        message(FATAL_ERROR "The package name ${pkg} differs from the basename of the path ${pkg_dir} in project ${PROJECT_NAME}")
-      endif()
-      get_filename_component(path ${pkg_dir} PATH)
-      set(PACKAGE_PYTHONPATH ${CMAKE_CURRENT_SOURCE_DIR}/${path})
-      configure_file(${catkin_EXTRAS_DIR}/templates/__init__.py.in
-        ${CMAKE_BINARY_DIR}/gen/py/${pkg}/__init__.py
-        @ONLY)
-    endforeach()
+    if(${pkg_name}_PACKAGES)
+      list(LENGTH ${pkg_name}_PACKAGES pkgs_count)
+      math(EXPR pkgs_range "${pkgs_count} - 1")
+      foreach(index RANGE ${pkgs_range})
+        list(GET ${pkg_name}_PACKAGES ${index} pkg)
+        list(GET ${pkg_name}_PACKAGE_DIRS ${index} pkg_dir)
+        get_filename_component(name ${pkg_dir} NAME)
+        if(NOT ("${pkg}" STREQUAL "${name}"))
+          message(FATAL_ERROR "The package name ${pkg} differs from the basename of the path ${pkg_dir} in project ${PROJECT_NAME}")
+        endif()
+        get_filename_component(path ${pkg_dir} PATH)
+        set(PACKAGE_PYTHONPATH ${CMAKE_CURRENT_SOURCE_DIR}/${path})
+        configure_file(${catkin_EXTRAS_DIR}/templates/__init__.py.in
+          ${CMAKE_BINARY_DIR}/gen/py/${pkg}/__init__.py
+          @ONLY)
+      endforeach()
+    endif()

     file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
     foreach(script ${${pkg_name}_SCRIPTS})


Added /bigobj definitions to all msvc compiler flags. Resolves error while compiling: *MSVC 2013 Win32 Debug compilation requires /bigobj *MSVC 2013 x64 Debug compilation requires /bigobj *MSVC 2015 Win32 Debug compilation requires /bigobj *MSVC 2015 x64 Debug compilation requires /bigobj

--- cmake/Compilers/msvc.cmake
+++ cmake/Compilers/msvc.cmake
@@ -9,13 +9,8 @@
 add_definitions(-D_CRT_SECURE_NO_WARNINGS -DHAS_CXX0X)

 #set defines for msvc
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /EHa /MP")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa /MP")
-
-if(IS_64BIT)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
-endif()
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /EHa /MP /bigobj")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHa /MP /bigobj")

 # apply flags for debug build
 set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W3")


with cmake 2.6, also search in the dirs in CMAKE_PREFIX_PATH

Alex

svn path=/trunk/kdesupport/akonadi/; revision=806282

--- cmake/modules/FindAutomoc4.cmake
+++ cmake/modules/FindAutomoc4.cmake
@@ -24,8 +24,8 @@
 else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
    # when building this project outside kdesupport
    find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake
-             PATH_SUFFIXES automoc4
-             PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib
+             PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4
+             PATHS ${CMAKE_SYSTEM_PREFIX_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib
              NO_DEFAULT_PATH )
 endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")


Always add -D_REENTRANT and -D_THREAD_SAFE

--- cmake/MyPackageStart.cmake
+++ cmake/MyPackageStart.cmake
@@ -106,15 +106,27 @@
 	    ADD_DEFINITIONS("-D${_definition}")
       ENDIF ()
     ENDFOREACH ()
-    GET_DIRECTORY_PROPERTY (_DirDefs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS)
-    IF (MYPACKAGE_DEBUG)
-      MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] New COMPILE_DEFINITIONS is: ${_DirDefs}")
-    ENDIF ()
   ELSE ()
     IF (MYPACKAGE_DEBUG)
       MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] CMAKE_C_COMPILER_ID does not match MSVC: ${CMAKE_C_COMPILER_ID}")
     ENDIF ()
   ENDIF ()
+  #
+  # Regardless of compiler, we always set the following historical macros
+  #
+  FOREACH (_definition _REENTRANT _THREAD_SAFE)
+    LIST (FIND _DirDefs ${_definition} _index)
+    IF (${_index} GREATER -1)
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] Compile definition ${_definition} already set")
+      ENDIF ()
+    ELSE ()
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-START-STATUS] Adding compile definition ${_definition}")
+      ENDIF ()
+      ADD_DEFINITIONS("-D${_definition}")
+    ENDIF ()
+  ENDFOREACH ()
   #
   # Prepare output directories
   #


move vSMCExample.cmake to vSMCExample repo

--- cmake/vSMCExampleFunctions.cmake
+++ cmake/vSMCExampleFunctions.cmake
@@ -1,159 +0,0 @@
-FUNCTION (ADD_SMP_EXECUTABLE base header source smp_name)
-    STRING (TOUPPER "${smp_name}" SMP)
-    STRING (TOLOWER "${smp_name}" smp)
-
-    IF (${smp} STREQUAL "cilk")
-        SET (HALF_NUM_THREADS
-            "int tnum = __cilkrts_get_nworkers();")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "tnum = tnum > 1 ? tnum / 2 : tnum;")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "std::stringstream tnum_ss; tnum_ss << tnum;")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "__cilkrts_set_param(\"nworkers\", tnum_ss.str().c_str());")
-    ELSEIF (${smp} STREQUAL "omp")
-        SET (HALF_NUM_THREADS
-            "int tnum = omp_get_max_threads();")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "omp_set_num_threads(tnum > 1 ? tnum / 2 : tnum);")
-    ELSEIF (${smp} STREQUAL "std")
-        SET (HALF_NUM_THREADS
-            "vsmc::ThreadInfo &tinfo = vsmc::ThreadInfo::instance();")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "std::size_t tnum = tinfo.thread_num();")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "tinfo.thread_num(tnum > 1 ? tnum / 2 : tnum);")
-    ELSEIF (${smp} STREQUAL "tbb")
-        SET (HALF_NUM_THREADS
-            "int tnum = tbb::task_scheduler_init::default_num_threads();")
-        SET (HALF_NUM_THREADS ${HALF_NUM_THREADS}
-            "tbb::task_scheduler_init init(tnum > 1 ? tnum / 2 : tnum);")
-    ENDIF (${smp} STREQUAL "cilk")
-
-    CONFIGURE_FILE (
-        ${PROJECT_SOURCE_DIR}/include/${header}.hpp
-        ${PROJECT_BINARY_DIR}/include/${header}_${smp}.hpp)
-    CONFIGURE_FILE (
-        ${PROJECT_SOURCE_DIR}/src/${source}.cpp
-        ${PROJECT_BINARY_DIR}/src/${source}_${smp}.cpp)
-
-    ADD_EXECUTABLE (${source}_${smp}
-        ${PROJECT_BINARY_DIR}/src/${source}_${smp}.cpp)
-
-    IF (${smp} STREQUAL "omp")
-        SET_TARGET_PROPERTIES (${source}_${smp} PROPERTIES COMPILE_FLAGS
-            "${OpenMP_CXX_FLAGS}")
-        TARGET_LINK_LIBRARIES (${source}_${smp} ${OpenMP_LINK_LIBRARIES})
-    ELSEIF (${smp} STREQUAL "std")
-        TARGET_LINK_LIBRARIES (${source}_${smp} ${VSMC_THREAD_LINK_LIBRARIES})
-    ELSEIF (${smp} STREQUAL "tbb")
-        TARGET_LINK_LIBRARIES (${source}_${smp} ${TBB_LINK_LIBRARIES})
-    ENDIF (${smp} STREQUAL "omp")
-
-    IF (${source} MATCHES "_mpi")
-        TARGET_LINK_LIBRARIES (${source}_${smp} ${VSMC_MPI_LINK_LIBRARIES})
-        ADD_DEPENDENCIES (example_mpi ${souce}_${smp})
-    ENDIF (${source} MATCHES "_mpi")
-
-    TARGET_LINK_LIBRARIES (${source}_${smp} ${EXAMPLE_LINK_LIBRARIES})
-
-    ADD_DEPENDENCIES (${base} ${source}_${smp})
-    ADD_DEPENDENCIES (example_${smp} ${source}_${smp})
-ENDFUNCTION (ADD_SMP_EXECUTABLE)
-
-FUNCTION (ADD_EXAMPLE base)
-    FOREACH (smp ${SMP_EXECUTABLES})
-        FOREACH (alg ${ARGN})
-            ADD_SMP_EXECUTABLE (${base} ${base} ${base}_${alg} ${smp})
-        ENDFOREACH (alg)
-    ENDFOREACH (smp)
-ENDFUNCTION (ADD_EXAMPLE)
-
-FUNCTION (COPY_FILE basename filename)
-    ADD_CUSTOM_COMMAND (
-        OUTPUT  ${PROJECT_BINARY_DIR}/${filename}
-        DEPENDS ${PROJECT_SOURCE_DIR}/${filename}
-        COMMAND ${CMAKE_COMMAND} ARGS -E copy
-        ${PROJECT_SOURCE_DIR}/${filename} ${PROJECT_BINARY_DIR}/${filename})
-    ADD_CUSTOM_TARGET (${basename}-${filename}
-        DEPENDS ${PROJECT_BINARY_DIR}/${filename})
-    ADD_DEPENDENCIES (${basename}-files ${basename}-${filename})
-ENDFUNCTION (COPY_FILE)
-
-FUNCTION (COPY_DIRECTORY basename dirname fullpath)
-    FILE (GLOB_RECURSE dirfiles
-        ${fullpath}/*.h ${fullpath}/*.hpp
-        ${fullpath}/*.c ${fullpath}/*.cpp ${fullpath}/*.cl)
-    ADD_CUSTOM_COMMAND (
-        OUTPUT ${PROJECT_BINARY_DIR}/${dirname} DEPENDS ${dirfiles}
-        COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory
-        ${fullpath} ${PROJECT_BINARY_DIR}/${dirname})
-    ADD_CUSTOM_TARGET (${basename}-${dirname}
-        DEPENDS ${PROJECT_BINARY_DIR}/${dirname})
-    ADD_DEPENDENCIES (${basename}-files ${basename}-${dirname})
-ENDFUNCTION (COPY_DIRECTORY)
-
-FUNCTION (COPY_FILE_OPTIONAL basename filename)
-    IF (EXISTS ${PROJECT_SOURCE_DIR}/${filename})
-        COPY_FILE (${basename} ${filename})
-    ELSE (EXISTS ${PROJECT_SOURCE_DIR}/${filename})
-            MESSAGE (STATUS "File: ${basename}: ${filename} not available")
-    ENDIF (EXISTS ${PROJECT_SOURCE_DIR}/${filename})
-ENDFUNCTION (COPY_FILE_OPTIONAL)
-
-FUNCTION (CHECK_HEADER headername cond)
-    IF (${cond})
-        STRING (REPLACE "/" "_" HEADER_NAME "${headername}")
-        STRING (REPLACE ".hpp" "" checkname "${HEADER_NAME}")
-        IF (EXISTS ${PROJECT_SOURCE_DIR}/src/header_${checkname}.cpp)
-            ADD_EXECUTABLE (header_${checkname}_check
-                ${PROJECT_SOURCE_DIR}/src/header_${checkname}.cpp)
-        ELSE (EXISTS ${PROJECT_SOURCE_DIR}/src/header_${checkname}.cpp)
-            CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/src/header_check.cpp
-                ${PROJECT_BINARY_DIR}/src/header_${checkname}.cpp)
-            ADD_EXECUTABLE (header_${checkname}_check
-                ${PROJECT_BINARY_DIR}/src/header_${checkname}.cpp)
-        ENDIF (EXISTS ${PROJECT_SOURCE_DIR}/src/header_${checkname}.cpp)
-
-        FOREACH (arg ${ARGN})
-            IF (${arg} STREQUAL "MPI")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${VSMC_MPI_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "MPI")
-            IF (${arg} STREQUAL "OPENCL")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${OpenCL_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "OPENCL")
-            IF (${arg} STREQUAL "GSL")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${GSL_LINK_LIBRARIES})
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${GSL_CBLAS_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "GSL")
-            IF (${arg} STREQUAL "MKL")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${MKL_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "MKL")
-            IF (${arg} STREQUAL "GCD")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${GCD_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "GCD")
-            IF (${arg} STREQUAL "OPENMP")
-                SET_TARGET_PROPERTIES (header_${checkname}_check
-                    PROPERTIES COMPILE_FLAGS "${OpenMP_CXX_FLAGS}")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${OpenMP_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "OPENMP")
-            IF (${arg} STREQUAL "TBB")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${TBB_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "TBB")
-            IF (${arg} STREQUAL "THREAD")
-                TARGET_LINK_LIBRARIES (header_${checkname}_check
-                    ${VSMC_THREAD_LINK_LIBRARIES})
-            ENDIF (${arg} STREQUAL "THREAD")
-        ENDFOREACH (arg ${ARGN})
-
-        ADD_DEPENDENCIES (header header_${checkname}_check)
-    ENDIF (${cond})
-ENDFUNCTION (CHECK_HEADER)


[skip CI][cmake] change version

[skip CI][cmake] change version

--- cmake/SiconosVersion.cmake
+++ cmake/SiconosVersion.cmake
@@ -1,6 +1,6 @@
 # --- set siconos current version ---
 set(MAJOR_VERSION 4)
-set(MINOR_VERSION 2)
+set(MINOR_VERSION 3)
 set(PATCH_VERSION 0)
 set(SICONOS_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}")


[compiler-rt] Fix running tests on macOS when XCode is not installed

Summary:
If XCode is not installed, `xcodebuild -version -sdk macosx Path` will give
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
In this case the variable OSX_SYSROOT will be empty and
OSX_SYSROOT_FLAG is set to "-isysroot" (without a path).
This then causes the CompilerRTUnitTestCheckCxx target failed to for me
because "${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E" expanded to
"clang -isysroot -E". This results in a warning "sysroot -E does not exist"
and the target fails to run because the C++ headers cannot be found.

Reviewers: beanz, kubamracek

Reviewed By: beanz

Subscribers: dberris, mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

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

--- cmake/base-config-ix.cmake
+++ cmake/base-config-ix.cmake
@@ -91,15 +91,22 @@
 endif()

 if(APPLE)
-  # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not
-  # the command line tools. If this is the case, we need to find the OS X
-  # sysroot to pass to clang.
-  if(NOT EXISTS /usr/include)
-    execute_process(COMMAND xcodebuild -version -sdk macosx Path
+  # On Darwin if /usr/include/c++ doesn't exist, the user probably has Xcode but
+  # not the command line tools (or is using macOS 10.14 or newer). If this is
+  # the case, we need to find the OS X sysroot to pass to clang.
+  if(NOT EXISTS /usr/include/c++)
+    execute_process(COMMAND xcrun -sdk macosx --show-sdk-path
        OUTPUT_VARIABLE OSX_SYSROOT
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE)
-    set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
+    if (NOT OSX_SYSROOT OR NOT EXISTS ${OSX_SYSROOT})
+      message(WARNING "Detected OSX_SYSROOT ${OSX_SYSROOT} does not exist")
+    else()
+      message(STATUS "Found OSX_SYSROOT: ${OSX_SYSROOT}")
+      set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
+    endif()
+  else()
+    set(OSX_SYSROOT_FLAG "")
   endif()

   option(COMPILER_RT_ENABLE_IOS "Enable building for iOS" On)


In standalone package, default data subdirectory is "data", not "var"

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -106,7 +106,7 @@
  SET(INSTALL_SQLBENCHROOTDIR_UNIX "")
  SET(INSTALL_DOCREADMEDIR_UNIX "share/mysql/doc/MySQL-server-${MYSQL_NO_DASH_VERSION}")
  SET(INSTALL_SUPPORTFILESDIR_UNIX "")
- SET(INSTALL_MYSQLDATADIR_STANDALONE "var")
+ SET(INSTALL_MYSQLDATADIR_UNIX "var")

 # Clear cached variables if install layout was changed


Right handle for REQUIRED in cmake/modules/FindV8.cmake

--- cmake/modules/FindV8.cmake
+++ cmake/modules/FindV8.cmake
@@ -130,18 +130,23 @@
 )

 if (V8_INCLUDE_DIR AND V8_LIBRARY)
-	set (V8_FOUND "YES")
+	set (V8_FOUND TRUE)
 	set (V8_INCLUDE_DIRS ${V8_INCLUDE_DIR})
 	set (V8_LIBRARIES ${V8_LIBRARY})
 	set (V8_LIBRARIES ${V8_LIBRARIES} ${V8_LIBBASE_LIBRARY})
 	set (V8_LIBRARIES ${V8_LIBRARIES} ${V8_LIBPLATFORM_LIBRARY})
+	message (STATUS "Found v8: ${V8_INCLUDE_DIRS}")
 elseif (V8_INCLUDE_DIR AND V8_BASE_LIBRARY)
-	set (V8_FOUND "YES")
+	set (V8_FOUND TRUE)
 	set (V8_INCLUDE_DIRS ${V8_INCLUDE_DIR})
 	set (V8_LIBRARIES ${V8_LIBRARIES} ${V8_BASE_LIBRARY})
 	set (V8_LIBRARIES ${V8_LIBRARIES} ${V8_NOSNAPSHOT_LIBRARY})
 	set (V8_LIBRARIES ${V8_LIBRARIES} ${V8_LIBBASE_LIBRARY})
 	set (V8_LIBRARIES ${V8_LIBRARIES} ${V8_LIBPLATFORM_LIBRARY})
+	message (STATUS "Found v8: ${V8_INCLUDE_DIRS}")
 else ()
-	set (V8_FOUND "NO")
+	set (V8_FOUND FALSE)
+	if (V8_FIND_REQUIRED)
+		message (FATAL_ERROR "V8 library not found.")
+	endif ()
 endif ()


Adding a new flag to tell Visual Studio to include debugging information (#1026)

in the release builds. This makes it easier to profile inside Intel
VTune when needed.

--- cmake/simdjson-flags.cmake
+++ cmake/simdjson-flags.cmake
@@ -75,7 +75,7 @@
 #  set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
 #endif()

-
+option(SIMDJSON_VISUAL_STUDIO_BUILD_WITH_DEBUG_INFO_FOR_PROFILING "Under Visual Studio, add Zi to the compile flag and DEBUG to the link file to add debugging information to the release build for easier profiling inside tools like VTune" OFF)
 if(MSVC)
 if("${MSVC_TOOLSET_VERSION}" STREQUAL "140")
   # Visual Studio 2015 issues warnings and we tolerate it,  cmake -G"Visual Studio 14" ..
@@ -83,6 +83,10 @@
 else()
   # Recent version of Visual Studio expected (2017, 2019...). Prior versions are unsupported.
   target_compile_options(simdjson-internal-flags INTERFACE /WX /W3 /sdl /w34714) # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4714?view=vs-2019
+endif()
+if(SIMDJSON_VISUAL_STUDIO_BUILD_WITH_DEBUG_INFO_FOR_PROFILING)
+  target_link_options(simdjson-flags  INTERFACE    /DEBUG )
+  target_compile_options(simdjson-flags INTERFACE  /Zi    )
 endif()
 else()
   target_compile_options(simdjson-internal-flags INTERFACE -fPIC)


CMake ARMClang6: use armclang for asm

CMake ARMClang6: use armclang for asm

Fixes the issue of armasm, passing -DMACRO={0,0} - fails to parse.

We use armclang frontend but passing -masm=armasm.

--- cmake/toolchains/ARM.cmake
+++ cmake/toolchains/ARM.cmake
@@ -1,7 +1,7 @@
 # Copyright (c) 2020 ARM Limited. All rights reserved.
 # SPDX-License-Identifier: Apache-2.0

-set(CMAKE_ASM_COMPILER "armasm")
+set(CMAKE_ASM_COMPILER "armclang")
 set(CMAKE_C_COMPILER "armclang")
 set(CMAKE_CXX_COMPILER "armclang")
 set(CMAKE_AR "armar")
@@ -42,14 +42,10 @@
             $<$<COMPILE_LANGUAGE:CXX>:${common_options}>
     )

-    set(asm_preproc_options
-        "--target=arm-arm-none-eabi,-D,MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED"
-    )
     target_compile_options(${target}
         PUBLIC
+            $<$<COMPILE_LANGUAGE:ASM>:--target=arm-arm-none-eabi -masm=armasm>
             $<$<COMPILE_LANGUAGE:ASM>:${MBED_STUDIO_ARM_COMPILER}>
-            $<$<COMPILE_LANGUAGE:ASM>:--cpreproc>
-            $<$<COMPILE_LANGUAGE:ASM>:--cpreproc_opts=${asm_preproc_options}>
     )

     target_compile_definitions(${target}


wsman_config.h.cmake: drop HAVE_CUNIT_BASIC_H

Signed-off-by: Klaus Kämpf <a2d9296eff59242585f43255819fff5d1f11d6ee@suse.de>

--- wsman_config.h.cmake
+++ wsman_config.h.cmake
@@ -54,11 +54,6 @@
 #define HAVE_CTYPE_H 1
 #endif

-/* Define to 1 if you have the <CUnit/Basic.h> header file. */
-#if @HAVE_CUNIT_BASIC_H@
-#define HAVE_CUNIT_BASIC_H 1
-#endif
-
 /* Define to 1 if you have the `daemon' function. */
 #if @HAVE_DAEMON@
 #define HAVE_DAEMON 1


s/rm/rm -f/ in case file was missing

s/rm/rm -f/ in case file was missing

--- test/HalideGenerator.cmake
+++ test/HalideGenerator.cmake
@@ -47,7 +47,7 @@
     add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
       DEPENDS "${gen_target}"
       COMMAND "${CMAKE_BINARY_DIR}/bin/${gen_target}${CMAKE_EXECUTABLE_SUFFIX}" "-g" "${gen_name}" "-f" "${func_name}" "-o" "${SCRATCH_DIR}" ${ARGN}
-      COMMAND rm "${FILTER_LIB}"
+      COMMAND rm -f "${FILTER_LIB}"
       COMMAND "${CMAKE_AR}" q "${FILTER_LIB}" "${SCRATCH_DIR}/${func_name}.o"
       WORKING_DIRECTORY "${SCRATCH_DIR}"
       )


Refs #1903. fix SimpleCommunitacion test bug and resolves #70

--- cmake/dev/boost_libraries.cmake
+++ cmake/dev/boost_libraries.cmake
@@ -24,10 +24,14 @@
     set(Boost_USE_STATIC_LIBS OFF)
     set(Boost_USE_MULTITHREADED ON)
     set(Boost_USE_STATIC_RUNTIME OFF)
-    if(WIN32 AND EPROSIMA_BOOST)
+    if(WIN32)
         set(BOOST_LIBRARYDIR_ $ENV{BOOST_LIBRARYDIR})
         if(BOOST_LIBRARYDIR_)
-            file(TO_CMAKE_PATH "${BOOST_LIBRARYDIR_}/${MSVC_ARCH}" BOOST_LIBRARYDIR)
+            if(EPROSIMA_BOOST)
+                file(TO_CMAKE_PATH "${BOOST_LIBRARYDIR_}/${MSVC_ARCH}" BOOST_LIBRARYDIR)
+            else()
+                file(TO_CMAKE_PATH "${BOOST_LIBRARYDIR_}" BOOST_LIBRARYDIR)
+            endif()
         endif()
     endif()
     find_package(Boost REQUIRED COMPONENTS ${ARGN})


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

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

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


STYLE: fix indentation

STYLE: fix indentation

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -108,10 +108,10 @@

   # Check if ${GDAL_LIBRARY} has tiff library
   TRY_COMPILE(GDAL_HAS_TIFF
-  ${CMAKE_CURRENT_BINARY_DIR}/CMake
-  ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasTiff.cxx
-  CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
-  OUTPUT_VARIABLE OUTPUT)
+              ${CMAKE_CURRENT_BINARY_DIR}/CMake
+              ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasTiff.cxx
+              CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${TIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+              OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_TIFF)
     MESSAGE(STATUS "  Testing if GDAL exposes tiff library symbols      -- yes")
     SET(TIFF_LIBRARY ${GDAL_LIBRARY})
@@ -127,10 +127,10 @@

   # Check if ${GDAL_LIBRARY} has geotiff library
   TRY_COMPILE(GDAL_HAS_GEOTIFF
-  ${CMAKE_CURRENT_BINARY_DIR}/CMake
-  ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasGeoTiff.cxx
-  CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
-  OUTPUT_VARIABLE OUTPUT)
+              ${CMAKE_CURRENT_BINARY_DIR}/CMake
+              ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasGeoTiff.cxx
+              CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GEOTIFF_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+              OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_GEOTIFF)
     MESSAGE(STATUS "  Testing if GDAL exposes geotiff library symbols   -- yes")
     SET(GEOTIFF_LIBRARY ${GDAL_LIBRARY})
@@ -146,10 +146,10 @@

   # Check if ${GDAL_LIBRARY} has jpeg library
   TRY_COMPILE(GDAL_HAS_JPEG
-  ${CMAKE_CURRENT_BINARY_DIR}/CMake
-  ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasJpeg.cxx
-  CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${JPEG_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
-  OUTPUT_VARIABLE OUTPUT)
+              ${CMAKE_CURRENT_BINARY_DIR}/CMake
+              ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasJpeg.cxx
+              CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${JPEG_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+              OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_JPEG)
     MESSAGE(STATUS "  Testing if GDAL exposes jpeg library symbols      -- yes")
     SET(JPEG_LIBRARY ${GDAL_LIBRARY})
@@ -165,10 +165,10 @@

   # Check if ${GDAL_LIBRARY} has ogr library
   TRY_COMPILE(GDAL_HAS_OGR
-  ${CMAKE_CURRENT_BINARY_DIR}/CMake
-  ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasOGR.cxx
-  CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${OGR_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
-  OUTPUT_VARIABLE OUTPUT)
+              ${CMAKE_CURRENT_BINARY_DIR}/CMake
+              ${CMAKE_CURRENT_SOURCE_DIR}/CMake/TestGDALHasOGR.cxx
+              CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${OGR_INCLUDE_DIRS};${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+              OUTPUT_VARIABLE OUTPUT)
   IF(GDAL_HAS_OGR)
     MESSAGE(STATUS "  Testing if GDAL has OGR                           -- yes")
     SET(OGR_LIBRARY ${GDAL_LIBRARY})
@@ -224,9 +224,9 @@
   ENDIF(NOT WIN32)

   # This test is known to fail with gdal build with some versions of hdf library
-  #${OTB_DATA_ROOT}/Input/MOD09Q1G_EVI.A2006233.h07v03.005.2008338190308.hdf  -> Test KO
-  #${OTB_DATA_ROOT}/Input/GSSTF_NCEP.2b.2008.12.31.he5  -> Test OK
-  #${CMAKE_CURRENT_SOURCE_DIR}/CMake/example.hdf -> Test should be KO in some special cases
+  #  ${OTB_DATA_ROOT}/Input/MOD09Q1G_EVI.A2006233.h07v03.005.2008338190308.hdf  -> Test KO
+  #  ${OTB_DATA_ROOT}/Input/GSSTF_NCEP.2b.2008.12.31.he5  -> Test OK
+  #  ${CMAKE_CURRENT_SOURCE_DIR}/CMake/example.hdf -> Test should be KO in some special cases
   IF(CHECK_GDAL_BUILT_WITH_HDF)
     SET(CMAKE_REQUIRED_INCLUDES ${GDAL_INCLUDE_DIR})
     SET(CMAKE_REQUIRED_LIBRARIES "${GDAL_LIBRARY}")


tiny fix

tiny fix

--- source/ConfigureChecks.cmake
+++ source/ConfigureChecks.cmake
@@ -37,7 +37,6 @@
   ticpp
   am
   compressor
-  beansdb
   aggregator
   distribute
   msgpack


Add new helful settings

Add new helful settings

- Always use project include dirs first
- Prevent absolute install directories
- Quieten install target
- Never export to or use package registry for find_package

--- Modules/CetCMakeSettings.cmake
+++ Modules/CetCMakeSettings.cmake
@@ -25,6 +25,51 @@
 # General Build Settings
 # ^^^^^^^^^^^^^^^^^^^^^^
 #
+# The following CMake variables and options are configured by default
+# when including this module:
+#
+# - ``CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE`` : ON
+#
+#   - Force project directories to appear first in any list of include paths.
+#     This applies to both full paths and those created by generator expressions.
+#
+set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
+
+#.rst:
+# - ``CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION`` : ON
+#
+#   - CET policy is to install fully relocatable packages, so install
+#     directories should never be absolute. NB: This does not guarantee
+#     that a package *is* relocatable.
+#
+set(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION ON)
+
+#.rst:
+# - ``CMAKE_INSTALL_MESSAGE`` : ``LAZY``
+#
+#   - Only report new or updated files installed by the ``install`` target.
+#
+set(CMAKE_INSTALL_MESSAGE LAZY)
+
+#.rst:
+# - ``CMAKE_EXPORT_NO_PACKAGE_REGISTRY`` : ON
+# - ``CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY`` : ON
+# - ``CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY`` : ON
+#
+#   - These variables are set to ensure that a project never creates or searches
+#     for config files in any package registry. This prevents the
+#     :cmake:command:`find_package <cmake:command:find_package>`
+#     command from locating potentially spurious config files.
+#
+set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY ON)
+set(CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY ON)
+
+#.rst:
+#
+# In addition to the base setting above, configurable options are provided for
+# enabling/disabling extra targets and functionality:
+#
 # .. cmake:variable:: CET_BUILD_NO_UNINSTALL_TARGET
 #
 #   Option to disable creation of an ``uninstall`` target for the project.
@@ -33,13 +78,14 @@
 #   See the documentation of the ``CetUninstallTarget``
 #   module for more details on what this target does.
 #
-
 option(CET_BUILD_NO_UNINSTALL_TARGET "Disable creation of an `uninstall` target" OFF)
 mark_as_advanced(CET_BUILD_NO_UNINSTALL_TARGET)

 if(NOT CET_BUILD_NO_UNINSTALL_TARGET)
   include("${CMAKE_CURRENT_LIST_DIR}/CetUninstallTarget.cmake")
 endif()
+
+

 #.rst:
 # CTest/Testing Settings


SYSTEM TARGET without .dd.gz

SYSTEM TARGET without .dd.gz

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@2003 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/Pipol.cmake
+++ Numerics/cmake/Pipol.cmake
@@ -66,8 +66,10 @@
         SET(PIPOL_SUB_RSYNC_OPTIONS "-aC")
       ENDIF(NOT PIPOL_SUB_RSYNC_OPTIONS)

+      STRING(REPLACE ".dd.gz" "" SYSTEM_TARGET ${SYSTEM_PATTERN})
+
       ADD_CUSTOM_TARGET(
-        ${SYSTEM_PATTERN}
+        ${SYSTEM_TARGET}
         COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
         COMMAND rsync ${PIPOL_USER}@pipol.inria.fr:/usr/local/bin/pipol-sub .
         COMMAND ./pipol-sub --pipol-user=${PIPOL_USER} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_SOURCE_DIR} ${PIPOL_RC_DIR_OPTION} --rsynco=${PIPOL_SUB_RSYNC_OPTIONS}
@@ -82,7 +84,7 @@
         )

       ADD_CUSTOM_TARGET(
-        package-${SYSTEM_PATTERN}
+        package-${SYSTEM_TARGET}
         COMMENT "PIPOL Build : ${SYSTEM_PATTERN}"
         COMMAND rsync ${PIPOL_USER}@pipol.inria.fr:/usr/local/bin/pipol-sub . \;\\
         COMMAND ./pipol-sub --pipol-user=${PIPOL_USER} ${SYSTEM_PATTERN} 02:00 --reconnect --group --keep --verbose=1 --export=${CMAKE_SOURCE_DIR} ${PIPOL_RC_DIR_OPTION}


make dl_algo_file sha1 optional - if '' then just check status code

--- unit-tests/algo/dl_algo_file.cmake
+++ unit-tests/algo/dl_algo_file.cmake
@@ -10,10 +10,20 @@
     #message(STATUS "from= ${ALGO_SRC_URL}/${filename}")
     #message(STATUS "empty= ${empty}")
     if( NOT EXISTS "${path}" OR ${empty} )
-	    message(STATUS "Downloading '${filename}' into '${CMAKE_CURRENT_BINARY_DIR}/algo'")
-        file(DOWNLOAD "${ALGO_SRC_URL}/${filename}" "${path}"
-            EXPECTED_HASH SHA1=${sha1}
-            STATUS status)
+        message(STATUS "Downloading '${filename}' into '${CMAKE_CURRENT_BINARY_DIR}/algo'")
+        if( NOT sha1 )
+            file(DOWNLOAD "${ALGO_SRC_URL}/${filename}" "${path}"
+                STATUS status)
+            list(GET status 0 code)
+            list(GET status 1 message)
+            if( code )
+                message( SEND_ERROR " ${message}")
+            endif()
+        else()
+            file(DOWNLOAD "${ALGO_SRC_URL}/${filename}" "${path}"
+                EXPECTED_HASH SHA1=${sha1}
+                STATUS status)
+        endif()
     endif()
 endfunction()


pcre2 build

pcre2 build

--- cmake/MyPackageCheckCommonSizes.cmake
+++ cmake/MyPackageCheckCommonSizes.cmake
@@ -14,8 +14,9 @@
   #
   FOREACH (_sign "" "u")
     FOREACH (_size 8 16 32 64)
-      SET (_MYTYPE    MYPACKAGE_${_sign}INT${_size})
-      SET (_MYTYPEDEF MYPACKAGE_${_sign}INT${_size}_TYPEDEF)
+      SET (_mytype    MYPACKAGE_${_sign}int${_size})
+      STRING (TOUPPER ${_mytype} _MYTYPE)
+      SET (_MYTYPEDEF ${_MYTYPE}_TYPEDEF)

       SET (HAVE_${_MYTYPE} FALSE)
       SET (${_MYTYPE} "")


Add diagnostics-color flag to compiler if supported

--- cmake/ilcsoft_default_cxx_flags.cmake
+++ cmake/ilcsoft_default_cxx_flags.cmake
@@ -39,3 +39,9 @@
 ELSE()
   MESSAGE( STATUS "NOT building with CXX11 standard" )
 ENDIF()
+
+
+CHECK_CXX_COMPILER_FLAG("-fdiagnostics-color=always" CXX_FLAG_WORKS_-fdiagnostics-color)
+IF(CXX_FLAG_WORKS_-fdiagnostics-color)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
+ENDIF()


PS-7622: Improve prepend_cflags_if_supported cmake macro

https://jira.percona.com/browse/PS-7622

At the moment there is a lot of "command-line option is valid for C/ObjC
but not for C++" warnings in build log. They all issued by check_c_compiler_flag
check in prepend_cflags_if_supported cmake macro.
Use check_cxx_source_compiles instead to check if flag is supported.
This allows to suppress all those warnings.

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -45,19 +45,59 @@

 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
+include(CMakePushCheckState)
+
+MACRO (CHECK_C_COMPILER_FLAG FLAG RESULT)
+  CMAKE_PUSH_CHECK_STATE()
+  set(OLD_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+  set(CMAKE_C_FLAGS "")
+  SET(CMAKE_REQUIRED_FLAGS "-Werror ${FLAG}")
+  CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT}
+          FAIL_REGEX "unknown argument ignored"
+          FAIL_REGEX "argument unused during compilation"
+          FAIL_REGEX "unsupported .*option"
+          FAIL_REGEX "unknown .*option"
+          FAIL_REGEX "unrecognized .*option"
+          FAIL_REGEX "ignoring unknown option"
+          FAIL_REGEX "[Ww]arning: [Oo]ption"
+          FAIL_REGEX "error: visibility"
+          FAIL_REGEX "warning: visibility"
+          )
+  set(${CMAKE_C_FLAGS} OLD_CMAKE_C_FLAGS)
+  CMAKE_POP_CHECK_STATE()
+ENDMACRO()
+
+MACRO (CHECK_CXX_COMPILER_FLAG FLAG RESULT)
+  CMAKE_PUSH_CHECK_STATE()
+  set(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+  set(CMAKE_CXX_FLAGS "")
+  SET(CMAKE_REQUIRED_FLAGS "-Werror ${FLAG}")
+  CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT}
+          FAIL_REGEX "unknown argument ignored"
+          FAIL_REGEX "argument unused during compilation"
+          FAIL_REGEX "unsupported .*option"
+          FAIL_REGEX "unknown .*option"
+          FAIL_REGEX "unrecognized .*option"
+          FAIL_REGEX "ignoring unknown option"
+          FAIL_REGEX "[Ww]arning: [Oo]ption"
+          FAIL_REGEX "error: visibility"
+          FAIL_REGEX "warning: visibility"
+          )
+  set(${CMAKE_CXX_FLAGS} OLD_CMAKE_CXX_FLAGS)
+  CMAKE_POP_CHECK_STATE()
+ENDMACRO()

 ## prepends a compiler flag if the compiler supports it
 MACRO (prepend_cflags_if_supported)
   FOREACH (flag ${ARGN})
-    STRING (REGEX REPLACE "-" "_" temp_flag ${flag})
-    check_c_compiler_flag ("-Werror ${flag}" HAVE_C_${temp_flag})
-    IF (HAVE_C_${temp_flag})
+    CHECK_C_COMPILER_FLAG("${flag}" C_RESULT)
+    CHECK_CXX_COMPILER_FLAG("${flag}" CXX_RESULT)
+    IF(C_RESULT)
       SET (CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
-    ENDIF ()
-    check_cxx_compiler_flag ("-Werror ${flag}" HAVE_CXX_${temp_flag})
-    IF (HAVE_CXX_${temp_flag})
+    ENDIF()
+    IF(CXX_RESULT)
       SET (CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
-    ENDIF ()
+    ENDIF()
   ENDFOREACH (flag)
 ENDMACRO (prepend_cflags_if_supported)


Add an interface target for C++11 flags

Add an interface target for C++11 flags

--- cmake-local/CompilerFeatures.cmake
+++ cmake-local/CompilerFeatures.cmake
@@ -33,6 +33,8 @@

 if(OSVR_HAVE_STD_SHARED_PTR AND OSVR_HAVE_STD_UNIQUE_PTR)
     set(OSVR_CXX11_FLAGS ${CMAKE_REQUIRED_FLAGS})
+    add_library(osvr_cxx11_flags INTERFACE)
+    target_compile_options(osvr_cxx11_flags INTERFACE ${CMAKE_REQUIRED_FLAGS})
 else()
     message(FATAL_ERROR "Sorry, your compiler does not support the C++11 features required to compile the library core.")
 endif()


Fixed error in cmake script

Fixed error in cmake script

--- cmake/dev/eprosima_libraries.cmake
+++ cmake/dev/eprosima_libraries.cmake
@@ -67,7 +67,7 @@
                  message(FATAL_ERROR "Cannot build Git submodule ${package} in release mode")
              endif()

-             set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${${package}ExternalDir}/install/${LIB_INSTALL_DIR})
+             set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${${package}ExternalDir}/install)
          else()
              execute_process(COMMAND ${CMAKE_COMMAND} --build .
                  WORKING_DIRECTORY ${${package}ExternalDir}


Fix for ROOT-8829 - Any unexpected error output on 'assert' tests will make the test fail

--- cmake/modules/RootTestDriver.cmake
+++ cmake/modules/RootTestDriver.cmake
@@ -126,14 +126,18 @@
     endif()

     # log stderr
-    if(CHECKERR AND NOT ERRREF)
-      set(_chkerr ERROR_VARIABLE _outvar)
-    elseif(ERRREF)
-      set(_chkerr ERROR_VARIABLE _errvar)
+    if(ERRREF)
+      set(_chkerr ERROR_VARIABLE _errvar)     # Check err reference
     else()
-      set(_chkerr ERROR_VARIABLE _errvar2)
-    endif()
-
+      if(CHECKERR AND CHECKOUT)
+        set(_chkerr ERROR_VARIABLE _outvar)   # Both err and out together
+      elseif(CHECKERR)
+        set(_chkerr ERROR_VARIABLE _errvar0)  # Only check (no reference) the err and and ignore out
+      else()
+        set(_chkerr ERROR_VARIABLE _errvar2)  # Only check out eventually
+      endif()
+    endif()
+
     execute_process(COMMAND ${_cmd} ${_input} ${_chkout} ${_chkerr} WORKING_DIRECTORY ${CWD} RESULT_VARIABLE _rc)

     string(REGEX REPLACE "([.]*)[;][-][e][;]([^;]+)([.]*)" "\\1;-e '\\2\\3'" res "${_cmd}")
@@ -144,15 +148,26 @@
     message("-- BEGIN TEST OUTPUT --")
     message("${_outvar}${_outvar2}")
     message("-- END TEST OUTPUT --")
-    if(_errvar OR _errvar2)
+    if(_errvar0 OR _errvar OR _errvar2)
       message("-- BEGIN TEST ERROR --")
-      message("${_errvar}${_errvar2}")
+      message("${_errvar0}${_errvar}${_errvar2}")
       message("-- END TEST ERROR --")
     endif()

     file(WRITE ${OUT} "${_outvar}")
     if(ERR)
       file(WRITE ${ERR} "${_errvar}")
+    endif()
+
+    if(_errvar0)
+      # Filter messages in stderr that are expected
+      string(STRIP ${_errvar0} _errvar0)
+      string(REPLACE "\n" ";" _lines "${_errvar0}")
+      list(FILTER _lines EXCLUDE REGEX "^Info in <.+::ACLiC>: creating shared library.+")
+      string(REPLACE ";" "\n" _errvar0 "${_lines}")
+      if(_errvar0)
+        message(FATAL_ERROR "Unexpected error output")
+      endif()
     endif()

     if(DEFINED RC AND (NOT "${_rc}" STREQUAL "${RC}"))


Set ${DRIVER}_SOURCE

Set ${DRIVER}_SOURCE

svn path=/trunk/; revision=6807

--- cmake/modules/drivers-finish.cmake
+++ cmake/modules/drivers-finish.cmake
@@ -39,6 +39,24 @@
     endforeach(DRIVER_IN_LIST ${DRIVERS_LIST})
     if(APPEND_DRIVER)
       set(DRIVERS_LIST ${DRIVERS_LIST} ${DRIVER})
+      if(DRIVER STREQUAL "wxwidgets")
+        set(${DRIVER}_SOURCE
+	${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.cpp
+	${${DRIVER}_SOURCE}
+	)
+      else(DRIVER STREQUAL "wxwidgets")
+        if(DRIVER STREQUAL "psttf")
+          set(${DRIVER}_SOURCE
+	  ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.cc
+	  ${${DRIVER}_SOURCE}
+	  )
+        else(DRIVER STREQUAL "psttf")
+          set(${DRIVER}_SOURCE
+	  ${CMAKE_SOURCE_DIR}/drivers/${DRIVER}.c
+	  ${${DRIVER}_SOURCE}
+	  )
+        endif(DRIVER STREQUAL "psttf")
+      endif(DRIVER STREQUAL "wxwidgets")
     endif(APPEND_DRIVER)
   endif(PLD_${DEVICE})
 endforeach(DRIVERS_DEVICE)


cmake: remove debug message

cmake: remove debug message

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -314,7 +314,7 @@
 \")
 "  )

-    message(STATUS "Staging ${_staged_name} instead of ${target}!")
+    qi_verbose("Staging ${_staged_name} instead of ${target}!")
     string(TOUPPER ${target} _U_target)
     string(TOLOWER ${_staged_name} _other_name)
     string(TOUPPER ${_staged_name} _U_staged_name)


stage: always add ROOT_DIR/include to INCLUDE_DIRS

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -88,7 +88,7 @@
   endforeach()

   set(_res "
-set(${_U_target}_INCLUDE_DIRS \"${_suffixes}\" CACHE STRING \"\" FORCE)
+set(${_U_target}_INCLUDE_DIRS \"\${ROOT_DIR}/include;${_suffixes}\" CACHE STRING \"\" FORCE)
 mark_as_advanced(${_U_target}_INCLUDE_DIRS)
   "
   )


internal/tests.cmake retro-compat fixes

internal/tests.cmake retro-compat fixes

Change-Id: I4d1beb9fea78040559a342fe0bbbe566715d32f4

--- cmake/qibuild/internal/tests.cmake
+++ cmake/qibuild/internal/tests.cmake
@@ -5,8 +5,6 @@
     "SRC;DEPENDS;ARGUMENTS;ENVIRONMENT" ${ARGN})

   set(_srcs ${ARG_SRC} ${ARG_UNPARSED_ARGUMENTS})
-
-  set(_should_return FALSE)

   if(NOT QI_WITH_TESTS)
     set(_should_return TRUE)
@@ -18,6 +16,17 @@

   if(ARG_PERF_TEST AND NOT QI_WITH_PERF_TESTS)
     set(_should_return TRUE)
+  endif()
+
+  if(ARG_NO_ADD_TEST)
+    qi_deprecated(WARNING "NO_ADD_TEST is deprecated, use qi_create_test_helper instead")
+    qi_create_test_helper(${target_name} ${_srcs})
+    set(_deps ${ARG_DEPENDS})
+    if(ARG_GTEST_TEST)
+      list(APPEND _deps GTEST GTEST_MAIN)
+    endif()
+    qi_use_lib(${target_name} ${_deps})
+    return()
   endif()

   if(NOT ARG_TIMEOUT)


update qibuild.cmake

update qibuild.cmake

--- doc/foobar-qibuild/qibuild.cmake
+++ doc/foobar-qibuild/qibuild.cmake
@@ -6,88 +6,16 @@
 # This file is part of the qibuild project    #
 ###############################################

-set(QIBUILD_BOOTSTRAP_VERSION 6)
+set(QIBUILD_BOOTSTRAP_VERSION 9)

-
-##
-# Create a use_qibuild.cmake file in CMAKE_BINARY_DIR,
-# and include it.
-# This allow us to find all qibuild/qibuild.cmake
-function(bootstrap)
-  find_program(PYTHON_EXECUTABLE NAMES python2 python python.exe
-    PATHS
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
-  )
-
-
-  if(NOT PYTHON_EXECUTABLE)
-    message(STATUS
-      "
-      Could not find python executable.
-
-      Please check your setup.
-
-      "
-    )
-    message(FATAL_ERROR "")
-  endif()
-
-  get_filename_component(_python_root ${PYTHON_EXECUTABLE} PATH)
-  find_program(QI_BUILD_EXECUTABLE qibuild.py
-    PATHS
-      "${_python_root}/Scripts"
-  )
-
-
-  if(NOT QI_BUILD_EXECUTABLE)
-    message(STATUS
-      "
-      Could not find qibuild executable.
-
-      Please check your setup.
-
-      "
-    )
-    message(FATAL_ERROR "")
-  endif()
-  set(_cmd ${PYTHON_EXECUTABLE} ${QI_BUILD_EXECUTABLE})
-  set(_cmd ${_cmd} configure --single --bootstrap "--build-directory=${CMAKE_BINARY_DIR}")
-  execute_process(
-      COMMAND ${_cmd}
-      RESULT_VARIABLE  _retcode
-      OUTPUT_VARIABLE  _stdout
-      ERROR_VARIABLE   _stderr
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-      )
-  if(NOT ${_retcode} EQUAL 0)
-    message(STATUS
-        "
-        qibuild bootstrap fail!
-        Log:
-        ====
-        ${_cmd}
-        ${_stdout}
-        ${_stderr}
-
-        ===
-
-        Please file a bug report with a comple CMake log
-        "
-    )
-      message(FATAL_ERROR "")
-  endif()
-endfunction()
-
-if(NOT EXISTS ${CMAKE_BINARY_DIR}/dependencies.cmake)
-  bootstrap()
+# Someone used qibuild and generated a dependencies.cmake
+# file (for the dependencies and where to find qibuild/cmake file),
+# so just use it.
+if(EXISTS ${CMAKE_BINARY_DIR}/dependencies.cmake)
+  include(${CMAKE_BINARY_DIR}/dependencies.cmake)
 endif()

-if(EXISTS ${CMAKE_BINARY_DIR}/dependencies.cmake)
-  include(${CMAKE_BINARY_DIR}/dependencies.cmake)
-else()
-  message(STATUS "can't find dependencies.cmake")
-endif()
-
+# Someone called cmake with a toolchain file that is
+# able to find qibuild/cmake code, so just include it.
+# Else, fail loudly.
 include(qibuild/general)
-


enable rpath on clblas/develop

enable rpath on clblas/develop

--- src/cmake/build_clBLAS.cmake
+++ src/cmake/build_clBLAS.cmake
@@ -25,7 +25,8 @@
     -DBUILD_CLIENT:BOOL=OFF
     -DBUILD_TEST:BOOL=OFF
     -DBUILD_KTEST:BOOL=OFF
-    -DADD_RPATH:BOOL=ON
+    # -DADD_RPATH:BOOL=ON
+    -DCMAKE_MACOSX_RPATH:BOOL=ON
     -DSUFFIX_LIB:STRING=
     -DCORR_TEST_WITH_ACML:BOOL=OFF
     -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo


Update superbuild SWIG version to 2.0.9

Update superbuild SWIG version to 2.0.9

Change-Id: Ie320fe737057802ee32500d09b401ff32d143023

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -1,10 +1,10 @@
-set( TARGET_SWIG_VERSION 2.0.8 )
+set( TARGET_SWIG_VERSION 2.0.9 )
 if(NOT SWIG_DIR)
   if(WIN32)
     # swig.exe available as pre-built binary on Windows:
     ExternalProject_Add(Swig
       URL http://prdownloads.sourceforge.net/swig/swigwin-${TARGET_SWIG_VERSION}.zip
-      URL_MD5 b33724aaa42a736816d7f095e7d93e4f
+      URL_MD5 a1dc34766cf599f49e2092f7973c85f4
       SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/swigwin-${TARGET_SWIG_VERSION}
       CONFIGURE_COMMAND ""
       BUILD_COMMAND ""
@@ -58,7 +58,7 @@

     ExternalProject_add(Swig
       URL http://prdownloads.sourceforge.net/swig/swig-${TARGET_SWIG_VERSION}.tar.gz
-      URL_MD5 69f917e870efc0712c06ab53217b28d1
+      URL_MD5 54d534b14a70badc226129159412ea85
       CONFIGURE_COMMAND ${swig_CONFIGURE_COMMAND}
       DEPENDS PCRE
       )


Update lpeg.cmake

Update lpeg.cmake

fix error on windows

--- deps/lpeg.cmake
+++ deps/lpeg.cmake
@@ -11,7 +11,7 @@
   ${LPEGLIB_DIR}/lptree.c
   ${LPEGLIB_DIR}/lpvm.c
 )
-add_definitions(-DWITH_LPEG)
+add_definitions(-DLUA_LIB -DWITH_LPEG)
 remove_definitions(-DNDEBUG)
 remove_definitions(-DVERSION)


[Feature] #1274: Whitelist INTEL COMPILER 16.0.2

--- util/cmake/FindSeqAn.cmake
+++ util/cmake/FindSeqAn.cmake
@@ -150,6 +150,13 @@
     # require at least clang 3.5
     if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
         message(AUTHOR_WARNING "Clang version (${CMAKE_CXX_COMPILER_VERSION}) should be at least 3.5! Anything below is untested.")
+    endif ()
+
+elseif (COMPILER_IS_INTEL)
+
+    # require at least icpc 16.0.2
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0.2)
+        message(AUTHOR_WARNING "Intel Compiler version (${CMAKE_CXX_COMPILER_VERSION}) should be at least 16.0.2! Anything below is untested.")
     endif ()

 elseif (COMPILER_IS_MSVC)


CMake: do not overwrite default threading config (std)

--- CMake/PrepareThreadingOptions.cmake
+++ CMake/PrepareThreadingOptions.cmake
@@ -17,29 +17,6 @@

 if (Boost_THREAD_FOUND AND Boost_DATE_TIME_FOUND)
 	set(Boost_THREADING TRUE)
-endif ()
-
-if (Boost_THREADING AND NOT OGRE_THREAD_SUPPORT_AVAILABLE)
-	set(OGRE_THREAD_SUPPORT_AVAILABLE TRUE)
-	set(OGRE_THREAD_DEFAULT_PROVIDER "boost")
-	set(OGRE_THREAD_TYPE "2")
-endif ()
-
-if (POCO_FOUND AND NOT OGRE_THREAD_SUPPORT_AVAILABLE)
-	set(OGRE_THREAD_SUPPORT_AVAILABLE TRUE)
-	set(OGRE_THREAD_DEFAULT_PROVIDER "poco")
-	set(OGRE_THREAD_TYPE "2")
-endif ()
-
-if (TBB_FOUND AND NOT OGRE_THREAD_SUPPORT_AVAILABLE)
-	set(OGRE_THREAD_SUPPORT_AVAILABLE TRUE)
-	set(OGRE_THREAD_DEFAULT_PROVIDER "tbb")
-	set(OGRE_THREAD_TYPE "2")
-endif ()
-
-if (OGRE_CONFIG_THREAD_PROVIDER STREQUAL "std")
-	set(OGRE_THREAD_DEFAULT_PROVIDER "std")
-	set(OGRE_THREAD_TYPE "2")
 endif ()

 set(OGRE_CONFIG_THREADS ${OGRE_THREAD_TYPE} CACHE STRING


Update CTK tag for CTKTesting and charts support

--- CMake/SuperBuild/External_CTK.cmake
+++ CMake/SuperBuild/External_CTK.cmake
@@ -58,7 +58,7 @@

   ExternalProject_Add(${proj}
     GIT_REPOSITORY "${git_protocol}://github.com/commontk/CTK.git"
-    GIT_TAG "35561f21f570dba22ea30f36798e15a29f485a1d"
+    GIT_TAG "bafec5879695c6385727035f897c9fe386408ca2"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${CMAKE_BINARY_DIR}/${proj}-build
     CMAKE_GENERATOR ${gen}
@@ -79,7 +79,7 @@
       -DVTK_DIR:PATH=${VTK_DIR}
       -DCTK_LIB_Widgets:BOOL=ON
       -DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON
-      -DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=OFF
+      -DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=ON
       -DCTK_LIB_PluginFramework:BOOL=OFF
       -DCTK_PLUGIN_org.commontk.eventbus:BOOL=OFF
     INSTALL_COMMAND ""


Move to C17 and C++17 standards for ARM EABI toolchain

***NO_CI***

--- CMake/toolchain.arm-none-eabi.cmake
+++ CMake/toolchain.arm-none-eabi.cmake
@@ -50,10 +50,10 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

 # set required C and C++ standard for ALL targets
-set(CMAKE_C_STANDARD 11 CACHE INTERNAL "C standard for all targets")
-set(CMAKE_CXX_STANDARD 11 CACHE INTERNAL "C++ standard for all targets")
+set(CMAKE_C_STANDARD 17 CACHE INTERNAL "C standard for all targets")
+set(CMAKE_CXX_STANDARD 17 CACHE INTERNAL "C++ standard for all targets")

 # set all C and C++ extensions to be OFF on ALL targets
-# this forces the use of -std=c11 and -std=c++11 instead of -std=gnu11 and -std=gnu++11
+# this forces the use of -std=c17 and -std=c++17 instead of -std=gnu17 and -std=gnu++17
 set(CMAKE_C_EXTENSIONS OFF CACHE INTERNAL "C compiler extensions OFF")
 set(CMAKE_CXX_EXTENSIONS OFF CACHE INTERNAL "C++ compiler extensions OFF")


Fix post build script to only do copy when it is absolutely required. [ci only: master, AppVeyor, OSX]

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -53,6 +53,12 @@
     set (CMAKE_FIND_ROOT_PATH ${IOS_SYSROOT})
     if (IPHONEOS_DEPLOYMENT_TARGET)
         set (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET ${IPHONEOS_DEPLOYMENT_TARGET})
+    endif ()
+    if (DEFINED ENV{TRAVIS})
+        # TODO: recheck this again later
+        # Ensure the CMAKE_OSX_DEPLOYMENT_TARGET is set to empty, something is wrong with Travis-CI OSX worker
+        set (CMAKE_OSX_DEPLOYMENT_TARGET)
+        unset (CMAKE_OSX_DEPLOYMENT_TARGET CACHE)
     endif ()
 elseif (XCODE)
     set (CMAKE_OSX_SYSROOT macosx)    # Set Base SDK to "Latest OS X"
@@ -1116,11 +1122,11 @@
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND scp $<TARGET_FILE:${TARGET_NAME}> ${URHO3D_SCP_TO_TARGET} || exit 0
             COMMENT "Scp-ing ${TARGET_NAME} executable to target system")
     endif ()
-    if (DIRECT3D_DLL AND NOT URHO3D_OPENGL)
+    if (DIRECT3D_DLL AND NOT URHO3D_OPENGL AND NOT ARG_NODEPS AND CMAKE_RUNTIME_OUTPUT_DIRECTORY)
         # Make a copy of the D3D DLL to the runtime directory in the build tree
         add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DIRECT3D_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
     endif ()
-    if (WIN32 AND NOT ARG_NODEPS AND URHO3D_LIB_TYPE STREQUAL SHARED)
+    if (WIN32 AND NOT ARG_NODEPS AND URHO3D_LIB_TYPE STREQUAL SHARED AND CMAKE_RUNTIME_OUTPUT_DIRECTORY)
         # Make a copy of the Urho3D DLL to the runtime directory in the build tree
         if (TARGET Urho3D)
             add_custom_command (TARGET ${TARGET_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:Urho3D> ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})


EMSCRIPTEN: NOT USING "--closure 1" ANYMORE...

(SOME SKETCHES STOPPED WORKING BECAUSE OF IT...)

--- core/cmake/test.cmake
+++ core/cmake/test.cmake
@@ -154,7 +154,7 @@

     configure_file("${CROSS_ROOT}/cmake/emscripten/template.html.in" template.html)
     set(CMAKE_EXECUTABLE_SUFFIX .html)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os --closure 1 --emrun --shell-file template.html")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 --emrun --shell-file template.html")

     if (RESOURCE_COUNT)
       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --preload-file ../../res")


Removed warning when GCC/Intel compiler is too old

This is not helpful as a warning, it could be output in summary to state
that visibility support will not be used but I don't think that is needed.

Change-Id: I4f70abd0ceddae6befd53e02341b5fdb15ba3aed

--- CMake/GenerateExportHeader.cmake
+++ CMake/GenerateExportHeader.cmake
@@ -176,7 +176,6 @@

     if(${_gcc_version} VERSION_LESS "4.2")
       set(GCC_TOO_OLD TRUE)
-      message(WARNING "GCC version older than 4.2")
     endif()
   endif()

@@ -188,7 +187,6 @@

     if(${_intel_version} VERSION_LESS "12.0")
       set(_INTEL_TOO_OLD TRUE)
-      message(WARNING "Intel compiler older than 12.0")
     endif()
   endif()


Add FFExp6.h to cmake file

Add FFExp6.h to cmake file

--- CMake/FileLists.cmake
+++ CMake/FileLists.cmake
@@ -81,6 +81,7 @@
    src/FFBonds.h
    src/FFConst.h
    src/FFDihedrals.h
+   src/FFExp6.h
    src/FFParticle.h
    src/FFSetup.h
    src/FFShift.h


Use MacroBoolTo01

Use MacroBoolTo01

svn path=/trunk/KDE/kdepim/; revision=538503

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -5,29 +5,16 @@
 include(CheckLibraryExists)
 include(CheckPrototypeExists)
 include(CheckTypeSize)
-
+include(MacroBoolTo01)
 # The FindKDE4.cmake module sets _KDE4_PLATFORM_DEFINITIONS with
 # definitions like _GNU_SOURCE that are needed on each platform.
 set(CMAKE_REQUIRED_DEFINITIONS ${_KDE4_PLATFORM_DEFINITIONS})

-if(KDE4_KDEPIM_NEW_DISTRLISTS)
-	set(KDEPIM_NEW_DISTRLISTS 1)
-else(KDE4_KDEPIM_NEW_DISTRLISTS)
-	set(KDEPIM_NEW_DISTRLISTS 0)
-endif(KDE4_KDEPIM_NEW_DISTRLISTS)
-
-if(SASL2_FOUND)
-	set(HAVE_LIBSASL2 1)
-else(SASL2_FOUND)
-	set(HAVE_LIBSASL2 0)
-endif(SASL2_FOUND)
+macro_bool_to_01(KDE4_KDEPIM_NEW_DISTRLISTS KDEPIM_NEW_DISTRLISTS)
+macro_bool_to_01(SASL2_FOUND HAVE_LIBSASL2)

 OPTION(WITH_INDEXLIB "Enable full-text indexing in KMail." OFF)
-if(WITH_INDEXLIB)
-	set(HAVE_INDEXLIB 1)
-else(WITH_INDEXLIB)
-	set(HAVE_INDEXLIB 0)
-endif(WITH_INDEXLIB)
+macro_bool_to_01(WITH_INDEXLIB HAVE_INDEXLIB)

 #now check for dlfcn.h using the cmake supplied CHECK_include_FILE() macro
 # If definitions like -D_GNU_SOURCE are needed for these checks they


Fix typo.

Fix typo.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -58,7 +58,7 @@
     set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} nsl)
   endif (HAVE_LIBNSL)
   # libresolv
-  check_library_exists(resolve hstrerror "" HAVE_LIBRESOLV)
+  check_library_exists(resolv hstrerror "" HAVE_LIBRESOLV)
   if (HAVE_LIBRESOLV)
     set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} resolv)
   endif (HAVE_LIBRESOLV)


ENH: Update the nightly xml URL.

ENH: Update the nightly xml URL.

--- CMake/DownloadDoxygenXML.cmake
+++ CMake/DownloadDoxygenXML.cmake
@@ -1,3 +1,3 @@
-file( DOWNLOAD http://dl.dropbox.com/u/15135983/itk-doxygen-xml.tar.bz2
+file( DOWNLOAD http://itk.org/files/NightlyDoxygen/InsightDoxygenDocXml.tar.gz
   ${ITKDoxygenXML_TEMP_DIR}/itk-doxygen-xml.tar.bz2 SHOW_PROGRESS
   )


Updated FindPython.cmake to fail if numpy/arrayobject.h cannot be included.

--- CMake/Modules/FindPython.cmake
+++ CMake/Modules/FindPython.cmake
@@ -16,6 +16,7 @@
 	CHECK_CXX_SOURCE_COMPILES(
 		"
 		#include <Python.h>
+		#include <numpy/arrayobject.h>

 		int main(int argc, char **argv){
 			PyTuple_New(0);


Fixed lapack detection on Ubuntu 14.04.

Fixed lapack detection on Ubuntu 14.04.

--- CMakeModules/FindCLAPACK.cmake
+++ CMakeModules/FindCLAPACK.cmake
@@ -41,9 +41,16 @@
 set(BLA_STATIC TRUE)
 set(LAPACK_STATIC TRUE)

+set(TMP ${CMAKE_FIND_LIBRARY_SUFFIXES})
+set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3)
 find_library( GFORTRAN_LIBRARY
               NAMES gfortran
               PATHS ENV LD_LIBRARY_PATH )
+set(CMAKE_FIND_LIBRARY_SUFFIXES ${TMP})
+
+if (GFORTRAN_LIBRARY)
+  set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf)
+endif ()

 set(BLA_VENDOR "Apple")
 find_package(LAPACK)


cmake: Fixed a problem with ccache.

cmake: Fixed a problem with ccache.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -17,9 +17,13 @@
 set(SOURCEDIR ${CMAKE_SOURCE_DIR})

 function(COMPILER_DUMPVERSION _OUTPUT_VERSION)
+    # Remove whitespaces from the argument.
+    # This is needed for CC="ccache gcc" cmake ..
+    string(REPLACE " " "" _C_COMPILER_ARG "${CMAKE_C_COMPILER_ARG1}")
+
     execute_process(
         COMMAND
-            ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1} -dumpversion
+            ${CMAKE_C_COMPILER} ${_C_COMPILER_ARG} -dumpversion
         OUTPUT_VARIABLE _COMPILER_VERSION
     )


test_data_download_worker: use aom-test-data bucket

this will help segregate av1 test vectors and regression files from
those in libvpx

Change-Id: I2bd034016f21374e6924800b730a67f9c3017e3a


cmake: Add -Wstrict-prototypes during build

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -13,7 +13,7 @@
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -pedantic -pedantic-errors")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wmissing-prototypes -Wdeclaration-after-statement")
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunused -Wfloat-equal -Wpointer-arith -Wwrite-strings -Wformat-security")
-        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -Wundef")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-format-attribute -Wundef -Wstrict-prototypes")

         # with -fPIC
         check_c_compiler_flag("-fPIC" WITH_FPIC)


Bugfix in FindLcov.cmake.

Bugfix in FindLcov.cmake.

Used wrong sources list, which caused errors, if files from CMAKE_BINARY_DIR
were used.

--- cmake/FindLcov.cmake
+++ cmake/FindLcov.cmake
@@ -254,7 +254,7 @@

 	set(TDIR ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TNAME}.dir)
 	set(GENINFO_FILES "")
-	foreach(FILE ${TSOURCES})
+	foreach(FILE ${SOURCES})
 		# Generate coverage files. If no .gcda file was generated during
 		# execution, the empty coverage file will be used instead.
 		set(OUTFILE "${TDIR}/${FILE}.info")


Use the correct SDL2 headers under Linux (if installed via pkg or from source)

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -5,10 +5,11 @@
 #  SDL2_INCLUDE_DIR

 FIND_PATH(SDL2_INCLUDE_DIR SDL.h
-  PATH_SUFFIXES include
+  PATH_SUFFIXES include SDL2
   PATHS
   ~/Library/Frameworks
   /Library/Frameworks
+  /usr/local/include
   /usr/local
   /usr
   /sw # Fink
@@ -55,8 +56,8 @@
 )

 SET(SDL2_LIBRARIES
-    ${SDL2_LIBRARY}
-    ${SDL2_LIBRARY_SDL2MAIN}
+  ${SDL2_LIBRARY}
+  ${SDL2_LIBRARY_SDL2MAIN}
 )

 INCLUDE(FindPackageHandleStandardArgs)


cmake: fix assembler with GCC on OS X

cmake: fix assembler with GCC on OS X

The clang assembler is available via -Wa,-q and supports AVX

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -147,38 +147,25 @@
 endmacro()

 macro(vc_check_assembler)
-   if(APPLE)
-      if(NOT Vc_COMPILER_IS_CLANG)
-         message(WARNING "Apple does not provide an assembler with AVX support. AVX will not be available. Please use Clang if you want to use AVX.")
+   exec_program(${CMAKE_CXX_COMPILER} ARGS -print-prog-name=as OUTPUT_VARIABLE _as)
+   mark_as_advanced(_as)
+   if(NOT _as)
+      message(WARNING "Could not find 'as', the assembler used by GCC. Hoping everything will work out...")
+   else()
+      exec_program(${_as} ARGS --version OUTPUT_VARIABLE _as_version)
+      string(REGEX REPLACE "\\([^\\)]*\\)" "" _as_version "${_as_version}")
+      string(REGEX MATCH "[1-9]\\.[0-9]+(\\.[0-9]+)?" _as_version "${_as_version}")
+      if(_as_version VERSION_LESS "2.18.93")
+         UserWarning("Your binutils is too old (${_as_version}). Some optimizations of Vc will be disabled.")
          set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -DVc_NO_XGETBV") # old assembler doesn't know the xgetbv instruction
          set(Vc_AVX_INTRINSICS_BROKEN true)
-         set(Vc_AVX2_INTRINSICS_BROKEN true)
-      endif()
-   else(APPLE)
-      if(${ARGC} EQUAL 1)
-         set(_as "${ARGV1}")
-      else()
-         exec_program(${CMAKE_CXX_COMPILER} ARGS -print-prog-name=as OUTPUT_VARIABLE _as)
-         mark_as_advanced(_as)
-      endif()
-      if(NOT _as)
-         message(WARNING "Could not find 'as', the assembler used by GCC. Hoping everything will work out...")
-      else()
-         exec_program(${_as} ARGS --version OUTPUT_VARIABLE _as_version)
-         string(REGEX REPLACE "\\([^\\)]*\\)" "" _as_version "${_as_version}")
-         string(REGEX MATCH "[1-9]\\.[0-9]+(\\.[0-9]+)?" _as_version "${_as_version}")
-         if(_as_version VERSION_LESS "2.18.93")
-            UserWarning("Your binutils is too old (${_as_version}). Some optimizations of Vc will be disabled.")
-            set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -DVc_NO_XGETBV") # old assembler doesn't know the xgetbv instruction
-            set(Vc_AVX_INTRINSICS_BROKEN true)
-            set(Vc_XOP_INTRINSICS_BROKEN true)
-            set(Vc_FMA4_INTRINSICS_BROKEN true)
-         elseif(_as_version VERSION_LESS "2.21.0")
-            UserWarning("Your binutils is too old (${_as_version}) for XOP instructions. They will therefore not be provided in libVc.")
-            set(Vc_XOP_INTRINSICS_BROKEN true)
-         endif()
-      endif()
-   endif(APPLE)
+         set(Vc_XOP_INTRINSICS_BROKEN true)
+         set(Vc_FMA4_INTRINSICS_BROKEN true)
+      elseif(_as_version VERSION_LESS "2.21.0")
+         UserWarning("Your binutils is too old (${_as_version}) for XOP instructions. They will therefore not be provided in libVc.")
+         set(Vc_XOP_INTRINSICS_BROKEN true)
+      endif()
+   endif()
 endmacro()

 macro(vc_set_preferred_compiler_flags)
@@ -255,7 +242,16 @@
          vc_set_gnu_buildtype_flags()
       endif()

-      vc_check_assembler()
+      if(APPLE)
+         # The GNU assembler (as) on Mac OS X is hopelessly outdated. The -q flag
+         # to as tells it to use the clang assembler, though, which is fine.
+         # -Wa,-q tells GCC to pass -q to as.
+         vc_add_compiler_flag(Vc_COMPILE_FLAGS "-Wa,-q")
+         # Apparently the MacOS clang assember doesn't understand XOP instructions.
+         set(Vc_XOP_INTRINSICS_BROKEN true)
+      else()
+         vc_check_assembler()
+      endif()
    elseif(Vc_COMPILER_IS_INTEL)
       ##################################################################################################
       #                                          Intel Compiler                                        #


Pack the darwin build based on the architecture

The current prebuilts put the darwin builds under "darwin/x86_64", so reproduce that behavior for the CMake packaging logic.

PiperOrigin-RevId: 291844613

--- cmake/cpp_pack.cmake
+++ cmake/cpp_pack.cmake
@@ -44,10 +44,14 @@
   elseif(MSVC)
     set(FIREBASE_LIB_CONFIG_PATH "windows")
   elseif(APPLE)
-    set(FIREBASE_LIB_CONFIG_PATH "darwin")
+    # Use the provided architecture, or fallback to a reasonable default.
+    if(${CMAKE_OSX_ARCHITECTURES} STREQUAL "")
+      set(FIREBASE_LIB_CONFIG_PATH "darwin/x86_64")
+    else()
+      set(FIREBASE_LIB_CONFIG_PATH "darwin/${CMAKE_OSX_ARCHITECTURES}")
+    endif()
   else()
     # Check if building for 32 bit
-    message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
     if("${CMAKE_CXX_FLAGS}" MATCHES "-m32")
       set(FIREBASE_LIB_CONFIG_PATH "linux/i386")
     else()


Added optional argument to add_gismo_executable to overwrite the default file name

--- cmake/gismoUse.cmake
+++ cmake/gismoUse.cmake
@@ -12,24 +12,31 @@

 # add an executable
 macro(add_gismo_executable FILE)
+    set(ExtraMacroArgs ${ARGN})
     if( GISMO_BUILD_LIB )
-        add_gismo_shared_executable(${FILE})
+        add_gismo_shared_executable(${FILE} ${ExtraMacroArgs})
     #elseif ( GISMO_BUILD_STATIC_LIB )
-    #    add_gismo_static_executable(${FILE})
+    #    add_gismo_static_executable(${FILE} ${ExtraMacroArgs})
     else ( GISMO_BUILD_LIB )
-    	add_gismo_pure_executable(${FILE})
+        add_gismo_pure_executable(${FILE} ${ExtraMacroArgs})
     endif( GISMO_BUILD_LIB )
 endmacro(add_gismo_executable)

 # add an executable compiled with pure template headers
 macro(add_gismo_pure_executable FILE)
-    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
-    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
+    set(ExtraMacroArgs ${ARGN})
+    list(LENGTH ExtraMacroArgs NumExtraMacroArgs)
+    if(NumExtraMacroArgs GREATER 0)
+        set(FNAME ${ARGV1})
+    else()
+        get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
+    endif()
+    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME})
     #message(STATUS "exec (pure template): ${FNAME}")
     add_executable(${FNAME} ${FILE} ${gismo_SOURCES} ${gismo_EXTENSIONS} ${gismo_dev_EXTENSIONS})
     target_link_libraries(${FNAME} gismo_static)
     if(UNIX AND NOT APPLE)
-    	target_link_libraries(${FNAME} dl)
+        target_link_libraries(${FNAME} dl)
     endif(UNIX AND NOT APPLE)
     # Allow CMake to follow dependencies on hpp files
     set_property(TARGET ${FNAME} PROPERTY
@@ -39,8 +46,14 @@

 # add an executable compiled with the shared library
 macro(add_gismo_shared_executable FILE)
-    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
-    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
+    set(ExtraMacroArgs ${ARGN})
+    list(LENGTH ExtraMacroArgs NumExtraMacroArgs)
+    if(NumExtraMacroArgs GREATER 0)
+        set(FNAME "${ARGV1}")
+    else()
+        get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
+    endif()
+    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME})
     #message(STATUS "exec (dynamically linked): ${FNAME}")
     add_executable(${FNAME} ${FILE})
     target_link_libraries(${FNAME} gismo)
@@ -48,20 +61,26 @@
       target_link_libraries(${FNAME} gcov)
     endif(GISMO_BUILD_COVERAGE)
     if(UNIX AND NOT APPLE)
-    	target_link_libraries(${FNAME} dl)
+        target_link_libraries(${FNAME} dl)
     endif(UNIX AND NOT APPLE)
-	#set_property(TARGET ${FNAME} PROPERTY FOLDER "tests-gismo")
+        #set_property(TARGET ${FNAME} PROPERTY FOLDER "tests-gismo")
 endmacro(add_gismo_shared_executable)

 # add an executable compiled statically with the library
 macro(add_gismo_static_executable FILE)
-    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
-    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
+    set(ExtraMacroArgs ${ARGN})
+    list(LENGTH ExtraMacroArgs NumExtraMacroArgs)
+    if(NumExtraMacroArgs GREATER 0)
+        set(FNAME ${ARGV1})
+    else()
+        get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
+    endif()
+    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME})
     #message(STATUS "exec (statically linked): ${FNAME}")
     add_executable(${FNAME} ${FILE})
     target_link_libraries(${FNAME} gismo_static)
     if(UNIX AND NOT APPLE)
-    	target_link_libraries(${FNAME} dl)
+        target_link_libraries(${FNAME} dl)
     endif(UNIX AND NOT APPLE)
 endmacro(add_gismo_static_executable)

@@ -89,32 +108,32 @@

 # collect .cpp files
 macro(aux_cpp_directory DIR VAR)
-	FILE(GLOB ${ARGV1} ${DIR}/[^.]*.cpp)
+        FILE(GLOB ${ARGV1} ${DIR}/[^.]*.cpp)
 endmacro(aux_cpp_directory)

 # collect gs*.cpp files
 macro(aux_gs_cpp_directory DIR VAR)
-	FILE(GLOB ${ARGV1} ${DIR}/gs*.cpp)
+        FILE(GLOB ${ARGV1} ${DIR}/gs*.cpp)
 endmacro(aux_gs_cpp_directory)

 # collect .h files
 macro(aux_header_directory DIR VAR)
-	FILE(GLOB ${ARGV1} ${DIR}/[^.]*.h)
+        FILE(GLOB ${ARGV1} ${DIR}/[^.]*.h)
 endmacro(aux_header_directory)

 # collect .hpp files
 macro(aux_tmpl_header_directory DIR VAR)
-	FILE(GLOB ${ARGV1} ${DIR}/[^.]*.hpp)
+        FILE(GLOB ${ARGV1} ${DIR}/[^.]*.hpp)
 endmacro(aux_tmpl_header_directory)

 # collect .cxx files
 macro(aux_cxx_source_directory DIR VAR)
-	FILE(GLOB ${ARGV1} ${DIR}/[^.]*.cxx)
+        FILE(GLOB ${ARGV1} ${DIR}/[^.]*.cxx)
 endmacro(aux_cxx_source_directory)

 # collect _.cpp (instance) files
 macro(aux_instance_directory DIR VAR)
-	FILE(GLOB ${ARGV1} ${DIR}/[^.]*_.cpp)
+        FILE(GLOB ${ARGV1} ${DIR}/[^.]*_.cpp)
 endmacro(aux_instance_directory)

 function(get_repo_info repository revision) #REPO_REVISION
@@ -129,8 +148,8 @@
       set(${repository} "git" PARENT_SCOPE)
       find_program(git_executable NAMES git git.exe git.cmd)
       execute_process(COMMAND ${git_executable} log -1 --pretty=format:%H
-	WORKING_DIRECTORY ${gismo_SOURCE_DIR} TIMEOUT 5
-	RESULT_VARIABLE git_res OUTPUT_VARIABLE git_rev)
+        WORKING_DIRECTORY ${gismo_SOURCE_DIR} TIMEOUT 5
+        RESULT_VARIABLE git_res OUTPUT_VARIABLE git_rev)
       set(${revision} ${git_rev} PARENT_SCOPE)
     #else()
     #  message("GISMO_REPO undefined.")


Moved treatment of C++98/11/14 into separate file.

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

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -91,46 +91,7 @@
 set(CMAKE_CXX_STANDARD_REQUIRED OFF)
 set(CMAKE_CXX_EXTENSIONS OFF)

-# CMake 3.1 complains it does not know how to set the compile flags
-if(NOT DEFINED CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION)
-if((CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang"))
-  # set(CMAKE_CXX_FLAGS "-stdlib=libc++")
-    set(CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION "-std=c++${CMAKE_CXX_STANDARD}")
-    set(CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION "-std=gnu++${CMAKE_CXX_STANDARD}")
-elseif((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND MSVC)
-  set(CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION "")
-  set(CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION "")
-endif()
-endif()
-
-if (CMAKE_VERSION VERSION_LESS "3.1" AND CMAKE_COMPILER_IS_GNUCC)
-  if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.1)
-    CHECK_CXX_COMPILER_FLAG("-std=c++${CMAKE_CXX_STANDARD}"
-                            COMPILER_SUPPORTS_CXX${CMAKE_CXX_STANDARD})
-    if(COMPILER_SUPPORTS_CXX${CMAKE_CXX_STANDARD})
-      if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD} -stdlib=libc++")
-      else()
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
-      endif()
-    else()
-      CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
-      if(COMPILER_SUPPORTS_CXX0X)
-        if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++")
-        else()
-          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-        endif()
-      else()
-         message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++${CMAKE_CXX_STANDARD}.")
-     endif()
-   endif()
-  else() #gcc 6.1
-    if(CMAKE_CXX_STANDARD EQUAL "98")
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
-    endif()
-  endif()
-endif()#cmake<3.1
+include(AddCXXCompileOptions)

 if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xIntel")
   # message(STATUS "Using Boost for smart pointers")


Set compute capability to 3.0 if it is 6.1.

Otherwise the new GTX 1070 with CUDA 7.5 causes errors on GL-interop.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -81,8 +81,15 @@
   message(STATUS "initial cuda arch flags: |${CUDA_ARCH_FLAGS}|")
   set(CUDA_ARCH_FLAGS )
   foreach(code ${CUDA_COMPUTE_CAPABILITY})
-    set(CUDA_ARCH_FLAGS ${CUDA_ARCH_FLAGS} "-gencode;arch=compute_${code},code=sm_${code}")
-    set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-gencode;arch=compute_${code},code=sm_${code}")
+    if (${CUDA_VERSION} VERSION_EQUAL "7.5")
+      message(STATUS "CUDA VERSION ${CUDA_VERSION}")
+      if (${code} VERSION_GREATER "5.2")
+        message(STATUS "Compute capability version ${code} too high, reset to 30")
+        set(code 30)
+      endif()
+    endif()
+    set(CUDA_ARCH_FLAGS ${CUDA_ARCH_FLAGS} "-gencode;arch=compute_${code},code=compute_${code}")
+    set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-gencode;arch=compute_${code},code=compute_${code}")
   endforeach()

   MESSAGE(STATUS "CUDA: automatically determined cuda nvcc flags: ${CUDA_NVCC_FLAGS}")


samples/wayland: remove partually unsupported compiler optimization flag

Issue: #1601

clang complains that -fno-devirtualize-speculatively is not supported.
I hardly see why we need this compiler flag at the first place since this is
optimization disabling flag which hints that this is some workaround for
some issues at the first place. So - delete it.

Signed-off-by: Dmitry Rogozhkin <01f0df9cc32cbf6a7f0faa5c8376e6cf28354d70@intel.com>

--- builder/FindPackages.cmake
+++ builder/FindPackages.cmake
@@ -254,9 +254,6 @@
   if (PKG_WAYLAND_CLIENT_FOUND)
     configure_target(${ARGV0} "${PKG_WAYLAND_CLIENT_CFLAGS}" "${PKG_WAYLAND_CLIENT_LIBRARY_DIRS}")
     set(LOCAL_CFLAGS "${LOCAL_CFLAGS} -DLIBVA_WAYLAND_SUPPORT")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0)
-       set(LOCAL_CFLAGS "${LOCAL_CFLAGS} -fno-devirtualize-speculatively")
-    endif()
   endif()

   set(SCOPE_CFLAGS "${SCOPE_CFLAGS} ${LOCAL_CFLAGS}" PARENT_SCOPE)


a fix for the cmake file

a fix for the cmake file

--- engine/cmake/FindGluonEngine.cmake
+++ engine/cmake/FindGluonEngine.cmake
@@ -21,7 +21,7 @@
     set(_gluonEngineReq "REQUIRED")
 endif (GluonEngine_FIND_REQUIRED)

-find_package(GluonCore _gluonEngineReq)
+find_package(GluonCore ${_gluonEngineReq})

 #set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_INSTALL_PREFIX}/share/gluon/cmake)


VWR-20810 (SNOW-503) Quote EXE_STAGING_DIR to prevent it failing with some paths

--- indra/cmake/LLAddBuildTest.cmake
+++ indra/cmake/LLAddBuildTest.cmake
@@ -107,7 +107,7 @@

     # Setup target
     ADD_EXECUTABLE(PROJECT_${project}_TEST_${name} ${${name}_test_SOURCE_FILES})
-    SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${EXE_STAGING_DIR})
+    SET_TARGET_PROPERTIES(PROJECT_${project}_TEST_${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")

     #
     # Per-codefile additional / external project dep and lib dep property extraction
@@ -196,7 +196,7 @@
     message(STATUS "ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})")
   endif(TEST_DEBUG)
   ADD_EXECUTABLE(INTEGRATION_TEST_${testname} ${source_files})
-  SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${EXE_STAGING_DIR})
+  SET_TARGET_PROPERTIES(INTEGRATION_TEST_${testname} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${EXE_STAGING_DIR}")

   # Add link deps to the executable
   if(TEST_DEBUG)


Fix regression in nmake support (#3650)

Fix regression in nmake support (#3650)

The NMake generator fails to use ml64/ml for assembly, causing build failures.  To fix that we directly point at the assembler.  Tested on VisualStudio 2013 update 5 build tools.

--- make/cpp2asm_support.cmake
+++ make/cpp2asm_support.cmake
@@ -227,9 +227,17 @@
   endif (DEBUG)
 else ()
   if (X64)
+    # In case of NMake Makefiles CMAKE_ASM_COMPILER will find cl.exe, thus we need
+    # to do it manually for both ml.exe and ml64.exe
     find_program(CMAKE_ASM_COMPILER ml64.exe HINTS "${cl_path}" DOC "path to assembler")
+    if ("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles")
+      set(CMAKE_ASM_COMPILER "ml64.exe")
+    endif()
   else (X64)
     find_program(CMAKE_ASM_COMPILER ml.exe HINTS "${cl_path}" DOC "path to assembler")
+    if ("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles")
+      set(CMAKE_ASM_COMPILER "ml.exe")
+    endif()
   endif (X64)
   if (NOT CMAKE_ASM_COMPILER)
     message(FATAL_ERROR "assembler not found: required to build")


Add `LIBATFRAME_UTILS_TEST_SOURCE_LOCATION` detection

Signed-off-by: WenTao Ou <d033e22ae348aeb5660fc2140aec35850c4da997@owent.net>

--- project/cmake/ProjectBuildOption.cmake
+++ project/cmake/ProjectBuildOption.cmake
@@ -444,6 +444,35 @@
         }"
   LIBATFRAME_UTILS_UNORDERED_MAP_SET_HAS_RESERVE)

+check_cxx_source_compiles(
+  "
+  #include <iostream>
+  #include <string_view>
+  #include <source_location>
+
+  void log(const std::string_view message,
+           const std::source_location location =
+                 std::source_location::current()) {
+    std::cout << \"file: \"
+              << location.file_name() << \"(\"
+              << location.line() << \":\"
+              << location.column() << \") `\"
+              << location.function_name() << \"`: \"
+              << message << std::endl;
+  }
+
+  template <typename T> void fun(T x) {
+    log(x);
+  }
+
+  int main(int, char*[]) {
+    log(\"Hello world!\");
+    fun(\"Hello C++20!\");
+    return 0;
+  }"
+  LIBATFRAME_UTILS_TEST_SOURCE_LOCATION)
+set(LIBATFRAME_UTILS_ENABLE_SOURCE_LOCATION ${LIBATFRAME_UTILS_TEST_SOURCE_LOCATION})
+
 set(CMAKE_REQUIRED_LIBRARIES ${LIBATFRAME_UTILS_TEST_UNORDERED_MAP_SET_BACKUP_CMAKE_REQUIRED_LIBRARIES})
 unset(LIBATFRAME_UTILS_TEST_UNORDERED_MAP_SET_BACKUP_CMAKE_REQUIRED_LIBRARIES)


fixing gpu arch detection fallback

fixing gpu arch detection fallback

--- cmake/FindCudaArch.cmake
+++ cmake/FindCudaArch.cmake
@@ -3,7 +3,11 @@

 # Known NVIDIA GPU achitectures Torch can be compiled for.
 # This list will be used for CUDA_ARCH_NAME = All option
-SET(KNOWN_GPU_ARCHITECTURES "2.0 2.1(2.0) 3.0 3.5 5.0 5.2")
+SET(KNOWN_GPU_ARCHITECTURES "2.0 2.1(2.0) 3.0 3.5 5.0")
+
+IF (CUDA_VERSION VERSION_GREATER "6.5")
+   SET(KNOWN_GPU_ARCHITECTURES "${KNOWN_GPU_ARCHITECTURES} 5.2")
+ENDIF (CUDA_VERSION VERSION_GREATER "6.5")

 ################################################################################################
 # Removes duplicates from LIST(s)


FindOpenSLES: removed debug message

FindOpenSLES: removed debug message

--- cmake/FindOpenSLES.cmake
+++ cmake/FindOpenSLES.cmake
@@ -28,7 +28,6 @@
 if(OPENSLES_FOUND)
 	set(OPENSLES_LIBRARIES ${OPENSLES_LIBRARY})
 else(OPENSLES_FOUND)
-	message("${OPENSLES_FIND_REQUIRED}")
 	if (OpenSLES_FIND_REQUIRED)
 		message(FATAL_ERROR "Could NOT find OPENSLES")
 	endif()


Adding a new unused warning to the make file.

--- cmake/OriginConfig.cmake
+++ cmake/OriginConfig.cmake
@@ -19,7 +19,8 @@
 # Explicitly disable unused variables, which causes concept code to become
 # quite noisy.
 # FIXME: Disable unused parameters also?
-set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-variable -std=c++0x")
+set(ORIGIN_IGNORED_WARNINGS "-Wno-unused-variable -Wno-unused-value")
+set(CMAKE_CXX_FLAGS "-Wall ${ORIGIN_IGNORED_WARNINGS} -std=c++0x")

 # NOTE: This was deprecated in favor of simply snatching the BoostUtils modul
 # into the Origin source tree


script updates

script updates

--- cmake/ctest_script.cmake
+++ cmake/ctest_script.cmake
@@ -58,7 +58,10 @@
 #  "Visual Studio 14 2015 Win64", and so on)
 set(CTEST_CMAKE_GENERATOR "Unix Makefiles")

-# The above parameters can be reset by passing upto 4 arguments
+set(CNAME cc)
+set(CXXNAME g++)
+
+# The above parameters can be reset by passing upto 6 arguments
 # e.g. as: ctest -S ctest_script.cmake,"Experimental;Release;8;Ninja"
 macro(read_args)
   set(narg ${ARGC})
@@ -74,13 +77,17 @@
   if (narg GREATER 3)
     set(CTEST_CMAKE_GENERATOR "${ARGV3}")
   endif()
+  if (narg GREATER 5)
+    set(CNAME "${ARGV4}")
+    set(CXXNAME "${ARGV5}")
+  endif()
 endmacro(read_args)
 read_args(${CTEST_SCRIPT_ARG})

 # C/C++ compilers,  e.g. "cc/g++", "icc/icpc", "clang/clang++"
-find_program (CC NAMES cc)
+find_program (CC NAMES ${CNAME})
 set(ENV{CC}  ${CC})
-find_program (CXX NAMES g++)
+find_program (CXX NAMES ${CXXNAME})
 set(ENV{CXX}  ${CXX})

 # Other Environment variables and scripts
@@ -109,40 +116,65 @@
     -DGISMO_EXTRA_DEBUG=OFF
     -DGISMO_BUILD_PCH=OFF
     #-DGISMO_PLAINDOX=ON
-    -DGISMO_BUILD_COVERAGE=OFF
 )
-
-# Computer ID shown on the dashboard (will be set automatically)
-# set(CTEST_SITE "Server0407")

 # Source folder (defaults inside the script directory)
 set(CTEST_SOURCE_DIRECTORY ${CTEST_SCRIPT_DIRECTORY}/gismo_src)

 # Build folder (defaults inside the script directory)
-set(CTEST_BINARY_DIRECTORY ${CTEST_SCRIPT_DIRECTORY}/gismo_build)
-
-# Empty existing directory before building (otherwise builds are incremental)
+set(CTEST_BINARY_DIRECTORY ${CTEST_SCRIPT_DIRECTORY}/build_${CTEST_TEST_MODEL}_${CTEST_CONFIGURATION_TYPE}_${CXXNAME})
+
+# Empty previous directory before building (otherwise builds are incremental)
 #ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+file(REMOVE_RECURSE ${CTEST_BINARY_DIRECTORY}/bin)

 # Test timeout in seconds
-set(CTEST_TEST_TIMEOUT 800)
+set(CTEST_TEST_TIMEOUT 200)

 # Coverage analysis
 set(test_coverage FALSE)
-set(CTEST_COVERAGE_COMMAND "/usr/bin/gcov")
-set(CTEST_CUSTOM_COVERAGE_EXCLUDE "${CTEST_SOURCE_DIRECTORY}/external/")
-
-# Memory check with valgrind
-set(test_memcheck FALSE)
-set(CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind")
-set(MEMORYCHECK_SUPPRESSIONS_FILE "${CTEST_SOURCE_DIRECTORY}/cmake/valgrind_supp.txt")
-set(MEMORYCHECK_COMMAND_OPTIONS "--error-exitcode=1 --leak-check=yes -q")
-#--tool=memcheck --show-reachable=yes --num-callers=50 --track-origins=yes --trace-children=yes
+if (test_coverage)
+  find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
+  set(CTEST_CUSTOM_COVERAGE_EXCLUDE "${CTEST_SOURCE_DIRECTORY}/external/")
+  set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} "-g -O0 --coverage -fprofile-arcs -ftest-coverage")
+  set(ENV{CFLAGS} "$ENV{CFLAGS} -g -O0 --coverage -fprofile-arcs -ftest-coverage")
+endif()
+
+# Dynamic analysis
+#Valgrind, Purify, BoundsChecker. ThreadSanitizer, AddressSanitizer,
+#LeakSanitizer, MemorySanitizer, and UndefinedBehaviorSanitizer.
+set(CTEST_MEMORYCHECK_TYPE "")
+
+if ("${CTEST_MEMORYCHECK_TYPE}" STREQUAL "Valgrind")
+  find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+  set(MEMORYCHECK_SUPPRESSIONS_FILE "${CTEST_SOURCE_DIRECTORY}/cmake/valgrind_supp.txt")
+  set(MEMORYCHECK_COMMAND_OPTIONS "--error-exitcode=1 --leak-check=yes -q")
+  #--tool=memcheck --show-reachable=yes --num-callers=50 --track-origins=yes --trace-children=yes
+elif(CTEST_MEMORYCHECK_TYPE STREQUAL "AddressSanitizer")
+  set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -fsanitize=address -fno-omit-frame-pointer")
+  set(ENV{LDFLAGS}  "$ENV{LDFLAGS} -fsanitize=address")
+endif()

 # Update type (eg. svn or git)
 set(UPDATE_TYPE git)
-find_program (CTEST_GIT_COMMAND NAMES ${UPDATE_TYPE})
-set (CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
+find_program(CTEST_GIT_COMMAND NAMES ${UPDATE_TYPE})
+set(CTEST_UPDATE_COMMAND "${CTEST_GIT_COMMAND}")
+
+# For continuous builds, number of seconds to stay alive
+set(test_runtime 43200) #12h by default
+
+# Computer ID shown on the dashboard (will be set automatically)
+# set(CTEST_SITE "Server0407")
+
+# Ignore certain tests during test or memcheck
+#set(CTEST_CUSTOM_TESTS_IGNORE "")
+#set(CTEST_CUSTOM_MEMCHECK_IGNORE "")
+
+## #################################################################
+## Test routines
+## #################################################################
+
+#message(STATUS "Preserve full output (CTEST_FULL_OUTPUT)")

 # Initial checkout
 if(NOT EXISTS "${CTEST_SOURCE_DIRECTORY}")
@@ -151,18 +183,6 @@
   set(CTEST_CHECKOUT_COMMAND "${CTEST_GIT_COMMAND} clone --depth 1 --branch stable ${GISMO_REPOSITORY} gismo_src")
 endif()

-# For continuous builds, number of seconds to stay alive
-set(test_runtime 43200) #12h by default
-
-# Ignore certain tests during test or memcheck
-#set(CTEST_CUSTOM_TESTS_IGNORE "")
-#set(CTEST_CUSTOM_MEMCHECK_IGNORE "")
-
-## #################################################################
-## Test routines
-## #################################################################
-
-#message(STATUS "Preserve full output (CTEST_FULL_OUTPUT)")
 if("${CTEST_CMAKE_GENERATOR}" MATCHES "Make" OR "${CTEST_CMAKE_GENERATOR}" MATCHES "Ninja")
  set(CTEST_USE_LAUNCHERS 1)
 else()
@@ -190,7 +210,7 @@
 find_program(UNAME NAMES uname)
 execute_process(COMMAND "${UNAME}" "-s" OUTPUT_VARIABLE osname OUTPUT_STRIP_TRAILING_WHITESPACE)
 execute_process(COMMAND "${UNAME}" "-m" OUTPUT_VARIABLE "cpu" OUTPUT_STRIP_TRAILING_WHITESPACE)
-set(CTEST_BUILD_NAME "${osname}-${cpu} ${CTEST_CMAKE_GENERATOR}-${CTEST_CONFIGURATION_TYPE}-$ENV{CXX}")
+set(CTEST_BUILD_NAME "${osname}-${cpu} ${CTEST_CMAKE_GENERATOR}-${CTEST_CONFIGURATION_TYPE}-${CXXNAME}")
 endif()

 if(NOT CTEST_BUILD_JOBS)
@@ -236,7 +256,7 @@
      ctest_submit(PARTS Coverage)
   endif()

-  if(test_memcheck)
+  if(NOT "x${CTEST_MEMORYCHECK_TYPE}" STREQUAL "x")
     #message("Running memcheck..")
     ctest_memcheck()
     ctest_submit(PARTS MemCheck)