Require libraries when a wrapping for a language is enabled

At the Superbuild level when wrapping for a language was enabled, the
requirements for the language were not marked as required. Not when a
language is enabled the cmake package is required.

Conflicts:
	CMake/sitkLanguageOptions.cmake

Change-Id: I07f40e1e934d72b8d9b5fe128a1a5a8c30f1df47

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -25,12 +25,15 @@
 #
 option ( WRAP_LUA "Wrap Lua" ON )

-find_package ( PythonInterp QUIET)

 # If you're not using python or it's the first time, be quiet
-if (NOT WRAP_PYTHON)
+if (DEFINED  WRAP_PYTHON AND WRAP_PYTHON)
+  set(_QUIET "REQUIRED")
+else()
   set(_QUIET "QUIET")
 endif()
+
+find_package ( PythonInterp ${_QUIET})

 find_package ( PythonLibs ${PYTHON_VERSION_STRING} EXACT ${_QUIET} )

@@ -61,8 +64,14 @@
 option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )
 check_PIC_flag ( Python )

-find_package ( Java COMPONENTS Development Runtime QUIET )
-find_package ( JNI QUIET )
+if (DEFINED  WRAP_JAVA AND WRAP_JAVA)
+  set(_QUIET "REQUIRED")
+else()
+  set(_QUIET "QUIET")
+endif()
+
+find_package ( Java COMPONENTS Development Runtime ${_QUIET} )
+find_package ( JNI ${_QUIET} )
 if ( ${JAVA_FOUND} AND ${JNI_FOUND} )
   set( WRAP_JAVA_DEFAULT ON )
 else ( ${JAVA_FOUND} AND ${JNI_FOUND} )
@@ -92,7 +101,14 @@
 option ( WRAP_JAVA "Wrap Java" ${WRAP_JAVA_DEFAULT} )
 check_PIC_flag ( Java )

-find_package ( TCL QUIET )
+
+if (DEFINED  WRAP_TCL AND WRAP_TCL)
+  set(_QUIET "REQUIRED")
+else()
+  set(_QUIET "QUIET")
+endif()
+
+find_package ( TCL ${_QUIET} )
 if ( ${TCL_FOUND} )
   set ( WRAP_TCL_DEFAULT ON )
 else ( ${TCL_FOUND} )
@@ -124,7 +140,14 @@
 option ( WRAP_RUBY "Wrap Ruby" ${WRAP_RUBY_DEFAULT} )
 check_PIC_flag ( Ruby )

-find_package( CSharp QUIET )
+
+if (DEFINED  WRAP_CSHARP AND WRAP_CSHARP)
+  set(_QUIET "REQUIRED")
+else()
+  set(_QUIET "QUIET")
+endif()
+
+find_package( CSharp ${_QUIET} )
 if ( ${CSHARP_FOUND} AND NOT MINGW )
   set ( WRAP_CSHARP_DEFAULT ON )
 else ()
@@ -137,7 +160,13 @@
 )
 option ( WRAP_CSHARP "Wrap C#" ${WRAP_CSHARP_DEFAULT} )

-find_package(R QUIET)
+if (DEFINED  WRAP_R AND WRAP_R)
+  set(_QUIET "REQUIRED")
+else()
+  set(_QUIET "QUIET")
+endif()
+
+find_package(R ${_QUIET})
 if ( ${R_FOUND} AND NOT WIN32 )
   set ( WRAP_R_DEFAULT ON )
 else( )


Correct FEDORA_BUILD_TAG to FEDORA_BUILD_TAGS

--- Modules/ManageReleaseOnFedora.cmake
+++ Modules/ManageReleaseOnFedora.cmake
@@ -184,11 +184,11 @@

 	    FOREACH(_tag ${_FEDORA_BUILD_LIST})
 		IF("${_tag}" STREQUAL "fedora")
-		    LIST(APPEND _FEDORA_BUILD_TAG ${FEDORA_CURRENT_RELEASE_TAGS})
+		    LIST(APPEND _FEDORA_BUILD_TAGS ${FEDORA_CURRENT_RELEASE_TAGS})
 		ELSEIF("${_tag}" STREQUAL "epel")
-		    LIST(APPEND _FEDORA_BUILD_TAG ${EPEL_SUPPORTED_RELEASE_TAGS})
+		    LIST(APPEND _FEDORA_BUILD_TAGS ${EPEL_SUPPORTED_RELEASE_TAGS})
 		ELSE("${_tag}" STREQUAL "fedora")
-		    LIST(APPEND _FEDORA_BUILD_TAG "${_tag}")
+		    LIST(APPEND _FEDORA_BUILD_TAGS "${_tag}")
 		ENDIF("${_tag}" STREQUAL "fedora")
 	    ENDFOREACH(_tag ${_FEDORA_BUILD_LIST})

@@ -238,7 +238,6 @@
 	ENDMACRO(USE_KOJI srpm)

 	MACRO(_use_fedpkg_make_targets srpm)
-	    #MESSAGE("_FEDORA_BUILD_TAGS=${_FEDORA_BUILD_TAGS}")
 	    #Commit summary
 	    IF (DEFINED CHANGE_SUMMARY)
 		SET (COMMIT_MSG  "-m \"${CHANGE_SUMMARY}\"")


include CTest after setting buildname...

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

--- Numerics/cmake/SiconosProject.cmake
+++ Numerics/cmake/SiconosProject.cmake
@@ -118,8 +118,6 @@

   # Tests+Dashboard configuration
   IF(WITH_TESTING)
-    INCLUDE(CTest)
-    ENABLE_TESTING()

     IF(IS_DIRECTORY ${CMAKE_BINARY_DIR}/Testing)
       # a note file for the dashboard
@@ -181,6 +179,9 @@
       ENDIF(C_HAVE_FTEST_COVERAGE)

     ENDIF(WITH_TESTS_COVERAGE)
+
+    INCLUDE(CTest)
+    ENABLE_TESTING()

   ENDIF(WITH_TESTING)
   # The library build stuff


ARROW-15448: [C++] Use apache mirror system to download ORC's source

By the recent switch to bundled ORC builds in the wheels has surfaced flaky download issues from apache dist which should be discouraged to use.

Closes #12256 from kszucs/orc-urls

Authored-by: Krisztián Szűcs <6bab32dc957a05a87930e779f272342e159326fa@gmail.com>
Signed-off-by: Krisztián Szűcs <6bab32dc957a05a87930e779f272342e159326fa@gmail.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -540,7 +540,8 @@
   set(ORC_SOURCE_URL "$ENV{ARROW_ORC_URL}")
 else()
   set_urls(ORC_SOURCE_URL
-           "https://archive.apache.org/dist/orc/orc-${ARROW_ORC_BUILD_VERSION}/orc-${ARROW_ORC_BUILD_VERSION}.tar.gz"
+           "https://www.apache.org/dyn/closer.cgi?action=download&filename=/orc/orc-${ARROW_ORC_BUILD_VERSION}/orc-${ARROW_ORC_BUILD_VERSION}.tar.gz"
+           "https://downloads.apache.org/orc/orc-${ARROW_ORC_BUILD_VERSION}/orc-${ARROW_ORC_BUILD_VERSION}.tar.gz"
            "https://github.com/apache/orc/archive/rel/release-${ARROW_ORC_BUILD_VERSION}.tar.gz"
   )
 endif()


ARROW-16993: [C++] Don't find Boost components if they aren't needed (#13846)

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1019,12 +1019,16 @@
     # Find static boost headers and libs
     set(Boost_USE_STATIC_LIBS ON)
   endif()
+  if(ARROW_BOOST_REQUIRE_LIBRARY)
+    set(ARROW_BOOST_COMPONENTS system filesystem)
+  else()
+    set(ARROW_BOOST_COMPONENTS)
+  endif()
   resolve_dependency(Boost
                      REQUIRED_VERSION
                      ${ARROW_BOOST_REQUIRED_VERSION}
                      COMPONENTS
-                     system
-                     filesystem
+                     ${ARROW_BOOST_COMPONENTS}
                      IS_RUNTIME_DEPENDENCY
                      # libarrow.so doesn't depend on libboost*.
                      FALSE)


CMake: Add librt.so to the link interface of UMFPACK to avoid an underlinkage problem.

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

--- deal.II/cmake/modules/FindUMFPACK.cmake
+++ deal.II/cmake/modules/FindUMFPACK.cmake
@@ -105,7 +105,6 @@
 FIND_UMFPACK_LIBRARY(COLAMD colamd)
 FIND_UMFPACK_LIBRARY(SuiteSparse_config suitesparseconfig)

-
 SET(_output ${UMFPACK_LIBRARY} ${CHOLMOD_LIBRARY} ${COLAMD_LIBRARY} ${AMD_LIBRARY} ${SuiteSparse_config_LIBRARY})
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(UMFPACK DEFAULT_MSG
   _output # Cosmetic: Gives nice output
@@ -127,6 +126,16 @@
     ${SuiteSparse_config_LIBRARY}
     ${LAPACK_LIBRARIES}
     )
+
+  #
+  # Add rt to the link interface as well:
+  #
+  FIND_LIBRARY(rt_lib NAMES rt)
+  MARK_AS_ADVANCED(rt_lib)
+  IF(NOT rt_lib MATCHES "-NOTFOUND")
+    LIST(APPEND UMFPACK_LIBRARIES ${rt_lib})
+  ENDIF()
+
   SET(UMFPACK_INCLUDE_DIRS
     ${UMFPACK_INCLUDE_DIR}
     ${AMD_INCLUDE_DIR}


[cmake] allow for source listing outside dune/module/

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -82,7 +82,7 @@
 		set( ${MODULE}_LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/lib/.libs)
 		LINK_DIRECTORIES( ${${MODULE}_LIBDIR} )
 		SET( LIBNAME libdune${MODULE}.a )
-		FILE( GLOB_RECURSE ${MODULE}_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/dune/${MODULE}/*.hh" )
+		FILE( GLOB_RECURSE ${MODULE}_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/dune/*.hh" )
 		LIST( APPEND DUNE_HEADERS ${${MODULE}_HEADER} )
 		LIST( APPEND DUNE_LIBS ${${MODULE}_FOUND} )
 		find_library( ${MODULE}_FOUND ${LIBNAME} PATHS ${${MODULE}_LIBDIR})


Updated FindEigen

Updated FindEigen

Change-Id: I9dd7cfc6e1c0492208e2e849ba29db8b634cc336

--- cmake/FindEigen.cmake
+++ cmake/FindEigen.cmake
@@ -1,9 +1,6 @@
-# This CMake module was taken from Ceres. Ceres Solver license is included.
-#
-#
 # Ceres Solver - A fast non-linear least squares minimizer
-# Copyright 2013 Google Inc. All rights reserved.
-# http://code.google.com/p/ceres-solver/
+# Copyright 2015 Google Inc. All rights reserved.
+# http://ceres-solver.org/
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
@@ -101,6 +98,18 @@
   NAMES Eigen/Core
   PATHS ${EIGEN_INCLUDE_DIR_HINTS}
   ${EIGEN_CHECK_INCLUDE_DIRS})
+IF (NOT EIGEN_INCLUDE_DIR)
+  # Handle case where user / CMAKE_PREFIX_PATH does not specify the
+  # required eigen3 subdirectory, prepend it to search target and retry.
+  FIND_PATH(EIGEN_INCLUDE_DIR
+    NAMES eigen3/Eigen/Core
+    PATHS ${EIGEN_INCLUDE_DIR_HINTS}
+    ${EIGEN_CHECK_INCLUDE_DIRS})
+  IF (EIGEN_INCLUDE_DIR AND EXISTS ${EIGEN_INCLUDE_DIR})
+    UPDATE_CACHE_VARIABLE(EIGEN_INCLUDE_DIR "${EIGEN_INCLUDE_DIR}/eigen3")
+  ENDIF (EIGEN_INCLUDE_DIR AND EXISTS ${EIGEN_INCLUDE_DIR})
+ENDIF(NOT EIGEN_INCLUDE_DIR)
+
 IF (NOT EIGEN_INCLUDE_DIR OR
     NOT EXISTS ${EIGEN_INCLUDE_DIR})
   EIGEN_REPORT_NOT_FOUND(


Remove CMake find module for GMock

Remove CMake find module for GMock

GMock is handled by Conan

--- cmake/FindGMock.cmake
+++ cmake/FindGMock.cmake
@@ -1,515 +0,0 @@
-# Get the Google C++ Mocking Framework.
-# (This file is almost an copy of the original FindGTest.cmake file,
-#  altered to download and compile GMock and GTest if not found
-#  in GMOCK_ROOT or GTEST_ROOT respectively,
-#  feel free to use it as it is or modify it for your own needs.)
-#
-# Defines the following variables:
-#
-#   GMOCK_FOUND - Found or got the Google Mocking framework
-#   GTEST_FOUND - Found or got the Google Testing framework
-#   GMOCK_INCLUDE_DIRS - GMock include directory
-#   GTEST_INCLUDE_DIRS - GTest include direcotry
-#
-# Also defines the library variables below as normal variables
-#
-#   GMOCK_BOTH_LIBRARIES - Both libgmock & libgmock_main
-#   GMOCK_LIBRARIES - libgmock
-#   GMOCK_MAIN_LIBRARIES - libgmock-main
-#
-#   GTEST_BOTH_LIBRARIES - Both libgtest & libgtest_main
-#   GTEST_LIBRARIES - libgtest
-#   GTEST_MAIN_LIBRARIES - libgtest_main
-#
-# Accepts the following variables as input:
-#
-#   GMOCK_ROOT - The root directory of the gmock install prefix
-#   GTEST_ROOT - The root directory of the gtest install prefix
-#   GMOCK_SRC_DIR -The directory of the gmock sources
-#   GMOCK_VER - The version of the gmock sources to be downloaded
-#
-#-----------------------
-# Example Usage:
-#
-#    set(GMOCK_ROOT "~/gmock")
-#    find_package(GMock REQUIRED)
-#    include_directories(${GMOCK_INCLUDE_DIRS})
-#
-#    add_executable(foo foo.cc)
-#    target_link_libraries(foo ${GMOCK_BOTH_LIBRARIES})
-#
-#=============================================================================
-# Copyright (c) 2016 Michel Estermann
-# Copyright (c) 2016 Kamil Strzempowicz
-# Copyright (c) 2011 Matej Svec
-#
-# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2016 Kitware, Inc.
-# Copyright 2000-2011 Insight Software Consortium
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-#   nor the names of their contributors may be used to endorse or promote
-#   products derived from this software without specific prior written
-#   permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# ------------------------------------------------------------------------------
-#
-# The above copyright and license notice applies to distributions of
-# CMake in source and binary form.  Some source files contain additional
-# notices of original copyright by their contributors; see each source
-# for details.  Third-party software packages supplied with CMake under
-# compatible licenses provide their own copyright notices documented in
-# corresponding subdirectories.
-#
-# ------------------------------------------------------------------------------
-#
-# CMake was initially developed by Kitware with the following sponsorship:
-#
-#  * National Library of Medicine at the National Institutes of Health
-#    as part of the Insight Segmentation and Registration Toolkit (ITK).
-#
-#  * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
-#    Visualization Initiative.
-#
-#  * National Alliance for Medical Image Computing (NAMIC) is funded by the
-#    National Institutes of Health through the NIH Roadmap for Medical Research,
-#    Grant U54 EB005149.
-#
-#  * Kitware, Inc.
-#=============================================================================
-# Thanks to Daniel Blezek <blezek@gmail.com> for the GTEST_ADD_TESTS code
-
-function(gtest_add_tests executable extra_args)
-    if(NOT ARGN)
-        message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
-    endif()
-    if(ARGN STREQUAL "AUTO")
-        # obtain sources used for building that executable
-        get_property(ARGN TARGET ${executable} PROPERTY SOURCES)
-    endif()
-    set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+) *, *([A-Za-z_0-9]+) *\\).*")
-    set(gtest_test_type_regex "(TYPED_TEST|TEST_?[FP]?)")
-    foreach(source ${ARGN})
-        file(READ "${source}" contents)
-        string(REGEX MATCHALL "${gtest_test_type_regex} *\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
-        foreach(hit ${found_tests})
-            string(REGEX MATCH "${gtest_test_type_regex}" test_type ${hit})
-
-            # Parameterized tests have a different signature for the filter
-            if("x${test_type}" STREQUAL "xTEST_P")
-                string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit})
-            elseif("x${test_type}" STREQUAL "xTEST_F" OR "x${test_type}" STREQUAL "xTEST")
-                string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit})
-            elseif("x${test_type}" STREQUAL "xTYPED_TEST")
-                string(REGEX REPLACE ${gtest_case_name_regex} "\\1/*.\\2" test_name ${hit})
-            else()
-                message(WARNING "Could not parse GTest ${hit} for adding to CTest.")
-                continue()
-            endif()
-            add_test(NAME ${test_name} COMMAND ${executable} --gtest_filter=${test_name} ${extra_args})
-        endforeach()
-    endforeach()
-endfunction()
-
-function(_append_debugs _endvar _library)
-    if(${_library} AND ${_library}_DEBUG)
-        set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
-    else()
-        set(_output ${${_library}})
-    endif()
-    set(${_endvar} ${_output} PARENT_SCOPE)
-endfunction()
-
-function(_gmock_find_library _name)
-    find_library(${_name}
-        NAMES ${ARGN}
-        HINTS
-        ENV GMOCK_ROOT
-        ${GMOCK_ROOT}
-        PATH_SUFFIXES ${_gmock_libpath_suffixes}
-        )
-    mark_as_advanced(${_name})
-endfunction()
-
-function(_gtest_find_library _name)
-    find_library(${_name}
-        NAMES ${ARGN}
-        HINTS
-        ENV GTEST_ROOT
-        ${GTEST_ROOT}
-        PATH_SUFFIXES ${_gtest_libpath_suffixes}
-        )
-    mark_as_advanced(${_name})
-endfunction()
-
-if(NOT DEFINED GMOCK_MSVC_SEARCH)
-    set(GMOCK_MSVC_SEARCH MD)
-endif()
-
-set(_gmock_libpath_suffixes lib)
-set(_gtest_libpath_suffixes lib)
-if(MSVC)
-    if(GMOCK_MSVC_SEARCH STREQUAL "MD")
-        list(APPEND _gmock_libpath_suffixes
-            msvc/gmock-md/Debug
-            msvc/gmock-md/Release)
-        list(APPEND _gtest_libpath_suffixes
-            msvc/gtest-md/Debug
-            msvc/gtest-md/Release)
-    elseif(GMOCK_MSVC_SEARCH STREQUAL "MT")
-        list(APPEND _gmock_libpath_suffixes
-            msvc/gmock/Debug
-            msvc/gmock/Release)
-        list(APPEND _gtest_libpath_suffixes
-            msvc/gtest/Debug
-            msvc/gtest/Release)
-    endif()
-endif()
-
-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
-    HINTS
-    $ENV{GMOCK_ROOT}/include
-    ${GMOCK_ROOT}/include
-    )
-mark_as_advanced(GMOCK_INCLUDE_DIR)
-
-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
-    HINTS
-    $ENV{GTEST_ROOT}/include
-    ${GTEST_ROOT}/include
-    )
-mark_as_advanced(GTEST_INCLUDE_DIR)
-
-if(MSVC AND GMOCK_MSVC_SEARCH STREQUAL "MD")
-    # The provided /MD project files for Google Mock add -md suffixes to the
-    # library names.
-    _gmock_find_library(GMOCK_LIBRARY gmock-md gmock)
-    _gmock_find_library(GMOCK_LIBRARY_DEBUG gmock-mdd gmockd)
-    _gmock_find_library(GMOCK_MAIN_LIBRARY gmock_main-md gmock_main)
-    _gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_main-mdd gmock_maind)
-
-    _gtest_find_library(GTEST_LIBRARY gtest-md gtest)
-    _gtest_find_library(GTEST_LIBRARY_DEBUG gtest-mdd gtestd)
-    _gtest_find_library(GTEST_MAIN_LIBRARY gtest_main-md gtest_main)
-    _gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind)
-else()
-    _gmock_find_library(GMOCK_LIBRARY gmock)
-    _gmock_find_library(GMOCK_LIBRARY_DEBUG gmockd)
-    _gmock_find_library(GMOCK_MAIN_LIBRARY gmock_main)
-    _gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind)
-
-    _gtest_find_library(GTEST_LIBRARY gtest)
-    _gtest_find_library(GTEST_LIBRARY_DEBUG gtestd)
-    _gtest_find_library(GTEST_MAIN_LIBRARY gtest_main)
-    _gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
-endif()
-
-if(NOT TARGET GTest::GTest)
-    add_library(GTest::GTest UNKNOWN IMPORTED)
-endif()
-if(NOT TARGET GTest::Main)
-    add_library(GTest::Main UNKNOWN IMPORTED)
-endif()
-
-if(NOT TARGET GMock::GMock)
-    add_library(GMock::GMock UNKNOWN IMPORTED)
-endif()
-
-if(NOT TARGET GMock::Main)
-    add_library(GMock::Main UNKNOWN IMPORTED)
-endif()
-
-set(GMOCK_LIBRARY_EXISTS OFF)
-set(GTEST_LIBRARY_EXISTS OFF)
-
-if(EXISTS "${GMOCK_LIBRARY}" OR EXISTS "${GMOCK_LIBRARY_DEBUG}" AND GMOCK_INCLUDE_DIR)
-    set(GMOCK_LIBRARY_EXISTS ON)
-endif()
-
-if(EXISTS "${GTEST_LIBRARY}" OR EXISTS "${GTEST_LIBRARY_DEBUG}" AND GTEST_INCLUDE_DIR)
-    set(GTEST_LIBRARY_EXISTS ON)
-endif()
-
-if(NOT (${GMOCK_LIBRARY_EXISTS} AND ${GTEST_LIBRARY_EXISTS}))
-
-    include(ExternalProject)
-
-    if(GTEST_USE_STATIC_LIBS)
-        set(GTEST_CMAKE_ARGS -Dgtest_force_shared_crt:BOOL=ON -DBUILD_SHARED_LIBS=OFF)
-        if(BUILD_SHARED_LIBS)
-            list(APPEND GTEST_CMAKE_ARGS
-                -DCMAKE_POSITION_INDEPENDENT_CODE=ON
-                -Dgtest_hide_internal_symbols=ON
-                -DCMAKE_CXX_VISIBILITY_PRESET=hidden
-                -DCMAKE_VISIBILITY_INLINES_HIDDEN=ON
-                -DCMAKE_POLICY_DEFAULT_CMP0063=NEW
-            )
-        endif()
-        set(GTEST_LIBRARY_PREFIX ${CMAKE_STATIC_LIBRARY_PREFIX})
-    else()
-        set(GTEST_CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
-        set(GTEST_LIBRARY_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
-    endif()
-    if(WIN32)
-        list(APPEND GTEST_CMAKE_ARGS -Dgtest_disable_pthreads=ON)
-    endif()
-
-    if("${GMOCK_SRC_DIR}" STREQUAL "")
-        message(STATUS "Downloading GMock / GTest version ${GMOCK_VER} from git")
-        if("${GMOCK_VER}" STREQUAL "1.6.0" OR "${GMOCK_VER}" STREQUAL "1.7.0")
-            set(GTEST_BIN_DIR "${GMOCK_ROOT}/src/gtest-build")
-            set(GTEST_LIBRARY "${GTEST_BIN_DIR}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            set(GTEST_MAIN_LIBRARY "${GTEST_BIN_DIR}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            mark_as_advanced(GTEST_LIBRARY)
-            mark_as_advanced(GTEST_MAIN_LIBRARY)
-
-            externalproject_add(
-                gtest
-                GIT_REPOSITORY "https://github.com/google/googletest.git"
-                GIT_TAG "release-${GMOCK_VER}"
-                PREFIX ${GMOCK_ROOT}
-                INSTALL_COMMAND ""
-                LOG_DOWNLOAD ON
-                LOG_CONFIGURE ON
-                LOG_BUILD ON
-                CMAKE_ARGS
-                    ${GTEST_CMAKE_ARGS}
-                BINARY_DIR ${GTEST_BIN_DIR}
-                BUILD_BYPRODUCTS
-                    "${GTEST_LIBRARY}"
-                    "${GTEST_MAIN_LIBRARY}"
-            )
-
-            set(GMOCK_BIN_DIR "${GMOCK_ROOT}/src/gmock-build")
-            set(GMOCK_LIBRARY "${GMOCK_BIN_DIR}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            set(GMOCK_MAIN_LIBRARY "${GMOCK_BIN_DIR}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            mark_as_advanced(GMOCK_LIBRARY)
-            mark_as_advanced(GMOCK_MAIN_LIBRARY)
-
-            externalproject_add(
-                gmock
-                GIT_REPOSITORY "https://github.com/google/googlemock.git"
-                GIT_TAG "release-${GMOCK_VER}"
-                PREFIX ${GMOCK_ROOT}
-                INSTALL_COMMAND ""
-                LOG_DOWNLOAD ON
-                LOG_CONFIGURE ON
-                LOG_BUILD ON
-                CMAKE_ARGS
-                    ${GTEST_CMAKE_ARGS}
-                BINARY_DIR ${GMOCK_BIN_DIR}
-                BUILD_BYPRODUCTS
-                    "${GMOCK_LIBRARY}"
-                    "${GMOCK_MAIN_LIBRARY}"
-            )
-
-            add_dependencies(gmock gtest)
-
-            add_dependencies(GTest::GTest gtest)
-            add_dependencies(GTest::Main gtest)
-            add_dependencies(GMock::GMock gmock)
-            add_dependencies(GMock::Main gmock)
-
-            externalproject_get_property(gtest source_dir)
-            set(GTEST_INCLUDE_DIR "${source_dir}/include")
-            mark_as_advanced(GTEST_INCLUDE_DIR)
-            externalproject_get_property(gmock source_dir)
-            set(GMOCK_INCLUDE_DIR "${source_dir}/include")
-            mark_as_advanced(GMOCK_INCLUDE_DIR)
-        else() #1.8.0
-            set(GMOCK_BIN_DIR "${GMOCK_ROOT}/src/gmock-build")
-            set(GTEST_LIBRARY "${GMOCK_BIN_DIR}/googlemock/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            set(GTEST_MAIN_LIBRARY "${GMOCK_BIN_DIR}/googlemock/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            set(GMOCK_LIBRARY "${GMOCK_BIN_DIR}/googlemock/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            set(GMOCK_MAIN_LIBRARY "${GMOCK_BIN_DIR}/googlemock/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-            mark_as_advanced(GTEST_LIBRARY)
-            mark_as_advanced(GTEST_MAIN_LIBRARY)
-            mark_as_advanced(GMOCK_LIBRARY)
-            mark_as_advanced(GMOCK_MAIN_LIBRARY)
-
-            externalproject_add(
-                gmock
-                GIT_REPOSITORY "https://github.com/google/googletest.git"
-                GIT_TAG "release-${GMOCK_VER}"
-                PREFIX ${GMOCK_ROOT}
-                INSTALL_COMMAND ""
-                LOG_DOWNLOAD ON
-                LOG_CONFIGURE ON
-                LOG_BUILD ON
-                CMAKE_ARGS
-                    ${GTEST_CMAKE_ARGS}
-                BINARY_DIR "${GMOCK_BIN_DIR}"
-                BUILD_BYPRODUCTS
-                    "${GTEST_LIBRARY}"
-                    "${GTEST_MAIN_LIBRARY}"
-                    "${GMOCK_LIBRARY}"
-                    "${GMOCK_MAIN_LIBRARY}"
-            )
-
-            add_dependencies(GTest::GTest gmock)
-            add_dependencies(GTest::Main gmock)
-            add_dependencies(GMock::GMock gmock)
-            add_dependencies(GMock::Main gmock)
-
-            externalproject_get_property(gmock source_dir)
-            set(GTEST_INCLUDE_DIR "${source_dir}/googletest/include")
-            set(GMOCK_INCLUDE_DIR "${source_dir}/googlemock/include")
-            mark_as_advanced(GMOCK_INCLUDE_DIR)
-            mark_as_advanced(GTEST_INCLUDE_DIR)
-        endif()
-
-        # Prevent CMake from complaining about these directories missing when the libgtest/libgmock targets get used as dependencies
-        file(MAKE_DIRECTORY ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR})
-    else()
-        message(STATUS "Building Gmock / Gtest from dir ${GMOCK_SRC_DIR}")
-
-        set(GMOCK_BIN_DIR "${GMOCK_ROOT}/src/gmock-build")
-        set(GTEST_LIBRARY "${GMOCK_BIN_DIR}/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}")
-        set(GTEST_MAIN_LIBRARY "${GMOCK_BIN_DIR}/gtest/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-        set(GMOCK_LIBRARY "${GMOCK_BIN_DIR}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX}")
-        set(GMOCK_MAIN_LIBRARY "${GMOCK_BIN_DIR}/${CMAKE_CFG_INTDIR}/${GTEST_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX}")
-        mark_as_advanced(GTEST_LIBRARY)
-        mark_as_advanced(GTEST_MAIN_LIBRARY)
-        mark_as_advanced(GMOCK_LIBRARY)
-        mark_as_advanced(GMOCK_MAIN_LIBRARY)
-
-        if(EXISTS "${GMOCK_SRC_DIR}/gtest/include/gtest/gtest.h")
-            set(GTEST_INCLUDE_DIR "${GMOCK_SRC_DIR}/gtest/include")
-            mark_as_advanced(GTEST_INCLUDE_DIR)
-        endif()
-        if(EXISTS "${GMOCK_SRC_DIR}/include/gmock/gmock.h")
-            set(GMOCK_INCLUDE_DIR "${GMOCK_SRC_DIR}/include")
-            mark_as_advanced(GMOCK_INCLUDE_DIR)
-        elseif(EXISTS "${GMOCK_SRC_DIR}/../../include/gmock/gmock.h")
-            set(GMOCK_INCLUDE_DIR "${GMOCK_SRC_DIR}/../../include")
-            if(IS_ABSOLUTE "${GMOCK_INCLUDE_DIR}")
-                get_filename_component(GMOCK_INCLUDE_DIR "${GMOCK_INCLUDE_DIR}" ABSOLUTE)
-            endif()
-            mark_as_advanced(GMOCK_INCLUDE_DIR)
-        endif()
-
-        externalproject_add(
-            gmock
-            SOURCE_DIR ${GMOCK_SRC_DIR}
-            PREFIX ${GMOCK_ROOT}
-            INSTALL_COMMAND ""
-            LOG_DOWNLOAD ON
-            LOG_CONFIGURE ON
-            LOG_BUILD ON
-            CMAKE_ARGS
-                ${GTEST_CMAKE_ARGS}
-            BINARY_DIR "${GMOCK_BIN_DIR}"
-            BUILD_BYPRODUCTS
-                "${GTEST_LIBRARY}"
-                "${GTEST_MAIN_LIBRARY}"
-                "${GMOCK_LIBRARY}"
-                "${GMOCK_MAIN_LIBRARY}"
-        )
-
-        add_dependencies(GTest::GTest gmock)
-        add_dependencies(GTest::Main gmock)
-        add_dependencies(GMock::GMock gmock)
-        add_dependencies(GMock::Main gmock)
-    endif()
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GTest DEFAULT_MSG GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-find_package_handle_standard_args(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY)
-
-include(CMakeFindDependencyMacro)
-find_dependency(Threads)
-
-set_target_properties(GTest::GTest PROPERTIES
-    INTERFACE_LINK_LIBRARIES "Threads::Threads"
-    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
-    IMPORTED_LOCATION "${GTEST_LIBRARY}"
-    )
-
-if(GTEST_INCLUDE_DIR)
-    set_target_properties(GTest::GTest PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}"
-        INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}"
-    )
-endif()
-
-set_target_properties(GTest::Main PROPERTIES
-    INTERFACE_LINK_LIBRARIES "GTest::GTest"
-    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
-    IMPORTED_LOCATION "${GTEST_MAIN_LIBRARY}")
-
-set_target_properties(GMock::GMock PROPERTIES
-    INTERFACE_LINK_LIBRARIES "Threads::Threads"
-    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
-    IMPORTED_LOCATION "${GMOCK_LIBRARY}")
-
-if(GMOCK_INCLUDE_DIR)
-    set_target_properties(GMock::GMock PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${GMOCK_INCLUDE_DIR}"
-        INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${GMOCK_INCLUDE_DIR}"
-    )
-    if(GMOCK_VER VERSION_LESS "1.7")
-        # GMock 1.6 still has GTest as an external link-time dependency,
-        # so just specify it on the link interface.
-        set_property(TARGET GMock::GMock APPEND PROPERTY
-            INTERFACE_LINK_LIBRARIES GTest::GTest)
-    elseif(GTEST_INCLUDE_DIR)
-        # GMock 1.7 and beyond doesn't have it as a link-time dependency anymore,
-        # so merge it's compile-time interface (include dirs) with ours.
-        set_property(TARGET GMock::GMock APPEND PROPERTY
-            INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}")
-        set_property(TARGET GMock::GMock APPEND PROPERTY
-            INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}")
-    endif()
-endif()
-
-set_target_properties(GMock::Main PROPERTIES
-    INTERFACE_LINK_LIBRARIES "GMock::GMock"
-    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
-    IMPORTED_LOCATION "${GMOCK_MAIN_LIBRARY}")
-
-if(GTEST_FOUND)
-    set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
-    set(GTEST_LIBRARIES GTest::GTest)
-    set(GTEST_MAIN_LIBRARIES GTest::Main)
-    set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
-    if(VERBOSE)
-        message(STATUS "GTest includes: ${GTEST_INCLUDE_DIRS}")
-        message(STATUS "GTest libs: ${GTEST_BOTH_LIBRARIES}")
-    endif()
-endif()
-
-if(GMOCK_FOUND)
-    set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})
-    set(GMOCK_LIBRARIES GMock::GMock)
-    set(GMOCK_MAIN_LIBRARIES GMock::Main)
-    set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARIES} ${GMOCK_MAIN_LIBRARIES})
-    if(VERBOSE)
-        message(STATUS "GMock includes: ${GMOCK_INCLUDE_DIRS}")
-        message(STATUS "GMock libs: ${GMOCK_BOTH_LIBRARIES}")
-    endif()
-endif()


Another fix for git dirty revs

Another fix for git dirty revs

--- cmake/buildinfo.cmake
+++ cmake/buildinfo.cmake
@@ -44,7 +44,7 @@
         COMMAND git rev-parse --abbrev-ref HEAD
         OUTPUT_VARIABLE GIT_BRANCH)

-    if(GIT_DIFF EQUAL 1)
+    if(${GIT_DIFF} STREQUAL "1")
         set(GIT_DIRTY "+")
     else()
         set(GIT_DIRTY "")


Separating ARM/AArch64 Compiler-RT tests

Makes sure ARM bots don't run AArch64 and vice-versa, since not all
AArch64 systems can run AArch32 and no ARM hardware can run AArch64.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -140,11 +140,12 @@
       test_target_arch(mips ${TARGET_32_BIT_CFLAGS})
       test_target_arch(mips64 ${TARGET_64_BIT_CFLAGS})
     endif()
-  endif()
-  # Build ARM libraries if we are configured to test on ARM
-  if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm|aarch64")
+  elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm")
     test_target_arch(arm "-march=armv7-a")
-    test_target_arch(aarch64 "-march=armv8-a")
+  elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32")
+    test_target_arch(aarch32 "-march=armv8-a")
+  elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64")
+    test_target_arch(aarch64 "-march=aarch64")
   endif()
   set(COMPILER_RT_OS_SUFFIX "")
 endif()


[libFuzzer] Disable i386 on non-Linux platforms

Summary: Disable i386 on non-Linux platforms since it is unwanted and broken on Windows.

Reviewers: morehouse, rnk

Reviewed By: morehouse

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -231,7 +231,11 @@
     ${MIPS32} ${MIPS64} ${PPC64} ${S390X})
 set(ALL_CRT_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64})
 set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
-set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64})
+if(LINUX)
+  set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64})
+else()
+  set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64})
+endif()

 if(APPLE)
   set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64})


ELF and Libraries Add ELF targets Add flags to compile and link with libraries

--- cmake/gcc_stm32.cmake
+++ cmake/gcc_stm32.cmake
@@ -43,16 +43,17 @@

 SET(CMAKE_OBJCOPY ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objcopy CACHE INTERNAL "objcopy tool")
 SET(CMAKE_OBJDUMP ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-objdump CACHE INTERNAL "objdump tool")
+SET(CMAKE_DEBUGER ${TOOLCHAIN_BIN_DIR}/${TARGET_TRIPLET}-gdb CACHE INTERNAL "debuger")

-SET(CMAKE_C_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "c compiler flags debug")
-SET(CMAKE_CXX_FLAGS_DEBUG "-Og -g" CACHE INTERNAL "cxx compiler flags debug")
-SET(CMAKE_ASM_FLAGS_DEBUG "-g" CACHE INTERNAL "asm compiler flags debug")
+SET(CMAKE_C_FLAGS_DEBUG "--specs=rdimon.specs -lgcc -lc -lm -lrdimon -lnosys -Og -g" CACHE INTERNAL "c compiler flags debug")
+SET(CMAKE_CXX_FLAGS_DEBUG "--specs=rdimon.specs -lgcc -lc -lm -lrdimon -Og -g" CACHE INTERNAL "cxx compiler flags debug")
+SET(CMAKE_ASM_FLAGS_DEBUG "-g -gstabs+" CACHE INTERNAL "asm compiler flags debug")
 SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE INTERNAL "linker flags debug")

 SET(CMAKE_C_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "c compiler flags release")
 SET(CMAKE_CXX_FLAGS_RELEASE "-Os -flto" CACHE INTERNAL "cxx compiler flags release")
 SET(CMAKE_ASM_FLAGS_RELEASE "" CACHE INTERNAL "asm compiler flags release")
-SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "-flto" CACHE INTERNAL "linker flags release")
+SET(CMAKE_EXE_LINKER_FLAGS_RELESE "-flto" CACHE INTERNAL "linker flags release")

 SET(CMAKE_FIND_ROOT_PATH ${TOOLCHAIN_PREFIX}/${TARGET_TRIPLET} ${EXTRA_FIND_PATH})
 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
@@ -67,6 +68,7 @@
     ENDIF()
     ADD_CUSTOM_TARGET(${TARGET}.hex DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oihex ${FILENAME} ${FILENAME}.hex)
     ADD_CUSTOM_TARGET(${TARGET}.bin DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Obinary ${FILENAME} ${FILENAME}.bin)
+    ADD_CUSTOM_TARGET(${TARGET}.elf DEPENDS ${TARGET} COMMAND ${CMAKE_OBJCOPY} -Oelf32-little ${FILENAME} ${FILENAME}.elf)
 ENDFUNCTION()

 STRING(TOLOWER ${STM32_FAMILY} STM32_FAMILY_LOWER)


libzmq: other projects can depend on it now

issue https://github.com/smanders/externpro/issues/282

--- projects/libzmq.cmake
+++ projects/libzmq.cmake
@@ -19,6 +19,7 @@
   DLNAME libzmq-${VER}.tar.gz
   PATCH ${PATCH_DIR}/libzmq.patch
   DIFF https://${FORK}/compare/zeromq:
+  DEPS_FUNC build_libzmq
   )
 ########################################
 function(build_libzmq)
@@ -38,5 +39,8 @@
     -DLIBZMQ_VER=${VER}
     -DXP_NAMESPACE:STRING=xpro
     )
-  xpCmakeBuild(libzmq "" "${XP_CONFIGURE}")
+  xpCmakeBuild(libzmq "" "${XP_CONFIGURE}" zmqTargets)
+  if(ARGN)
+    set(${ARGN} "${zmqTargets}" PARENT_SCOPE)
+  endif()
 endfunction()


Suppressed root warnings from HLT.

Suppressed root warnings from HLT.

--- cmake/modules/CreateHLTSubCMakeFiles.cmake
+++ cmake/modules/CreateHLTSubCMakeFiles.cmake
@@ -517,7 +517,7 @@
       file(APPEND ${FileName} "\${CMAKE_SOURCE_DIR}/${file}\n")
     EndIf(file MATCHES "^.*[$].*$")
   endforeach(file ${EINCLUDE_SUBDIR})
-  file(APPEND ${FileName} "\${ROOT_INCLUDE_DIR}\n")
+

   if(${_dir} STREQUAL STEER OR ${_dir} STREQUAL TPC OR ${_dir} STREQUAL ALIROOT)
     file(APPEND ${FileName} "\${CMAKE_BINARY_DIR}/STEER\n")
@@ -529,6 +529,7 @@

   file(APPEND ${FileName} ")\n\n")
   file(APPEND ${FileName} "include_directories(\${INCLUDE_DIRECTORIES})\n\n")
+  file(APPEND ${FileName} "include_directories(SYSTEM \${ROOT_INCLUDE_DIR})\n\n")
   file(APPEND ${FileName} "set(LINK_DIRECTORIES\n")
   file(APPEND ${FileName} "\${ROOT_LIBRARY_DIR}\n")
   file(APPEND ${FileName} ")\n\n")
@@ -1242,8 +1243,6 @@
       file(APPEND ${FileName} "\${CMAKE_SOURCE_DIR}/${file}\n")
     EndIf(file MATCHES "^.*[$].*$")
   endforeach(file ${EINCLUDE_SUBDIR})
-  file(APPEND ${FileName} "\${ROOT_INCLUDE_DIR}\n")
-
   if(${_dir} STREQUAL STEER OR ${_dir} STREQUAL TPC OR ${_dir} STREQUAL ALIROOT)
     file(APPEND ${FileName} "\${CMAKE_BINARY_DIR}/STEER\n")
   endif(${_dir} STREQUAL STEER OR ${_dir} STREQUAL TPC OR ${_dir} STREQUAL ALIROOT)
@@ -1254,6 +1253,7 @@

   file(APPEND ${FileName} ")\n\n")
   file(APPEND ${FileName} "include_directories(\${INCLUDE_DIRECTORIES})\n\n")
+  file(APPEND ${FileName} "include_directories(SYSTEM \${ROOT_INCLUDE_DIR})\n\n")
   file(APPEND ${FileName} "set(LINK_DIRECTORIES\n")
   file(APPEND ${FileName} "\${ROOT_LIBRARY_DIR}\n")
   file(APPEND ${FileName} ")\n\n")


Use generic cpu when LLVM can't detect the host processor

LLVM's CPU detection is very basic, it parses /proc/cpuinfo and uses
information from their to look up CPUs in its own internal tables.
These tables are incomplete, so it's not uncommon for LLVM to not
be able to detect the CPU.

Ideally pocl would use something better than llc --version for CPU
detection, but for now we can at least fallback to the generic
cpu when LLVM can't detect the host.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -567,6 +567,10 @@

 set_cache_var(LLC_TRIPLE "LLC_TRIPLE")

+# FIXME: The cpu name printed by llc --version is the same cpu that will be
+# targeted if ypu pass -mcpu=native to llc, so we could replace this auto-detection
+# with just: set(LLC_HOST_CPU "native"), however, we can't do this at the moment
+# because of the work-around for arm1176jz-s.
 if(NOT DEFINED LLC_HOST_CPU AND NOT CMAKE_CROSSCOMPILING)
   message(STATUS "Find out LLC host CPU with ${LLVM_LLC}")
   execute_process(COMMAND ${LLVM_LLC} "--version" RESULT_VARIABLE RES_VAR OUTPUT_VARIABLE OUTPUT_VAR)
@@ -589,7 +593,8 @@
 endif()

 if(LLC_HOST_CPU MATCHES "unknown")
-  message(FATAL_ERROR "LLVM could not recognize your CPU model automatically. Please rerun cmake with -DLLC_HOST_CPU=<model> (to see a list of models, try: llc -mcpu help)")
+  message(WARNING "LLVM could not recognize your CPU model automatically.  Using a generic CPU target.")
+  set(LLC_HOST_CPU "generic")
 endif()

 set(LLC_HOST_CPU "${LLC_HOST_CPU}" CACHE STRING "The Host CPU to use with llc")


CMake: the CHECK_ALIGNOF(x) macros were printing !0 exit status

We use exit status here to pass the actual alignment (b/c libc +
printf + windows). This makes the checks silent

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -337,7 +337,7 @@
 endmacro()

 # clang try-compile-run macro, run via lli, the llvm interpreter
-macro(custom_try_run_lli SOURCE1 SOURCE2 OUTPUT_VAR RES_VAR)
+macro(custom_try_run_lli SILENT SOURCE1 SOURCE2 OUTPUT_VAR RES_VAR)
 # this uses "lli" - the interpreter, so we can run any -target
 # TODO variable for target !!
   set(OUTF "${CMAKE_BINARY_DIR}/try_run.bc")
@@ -353,7 +353,7 @@
     execute_process(COMMAND "${LLVM_LLI}" "-force-interpreter" "${OUTF}" RESULT_VARIABLE RESV OUTPUT_VARIABLE ${OUTPUT_VAR} ERROR_VARIABLE EV)
     set(${RES_VAR} ${RESV})
     file(REMOVE "${OUTF}")
-    if(${RESV})
+    if(${RESV} AND (NOT ${SILENT}))
       message(STATUS " ########## The command ${LLVM_LLI} -force-interpreter ${OUTF}")
       message(STATUS " ########## Exited with nonzero status: ${RESV}")
       if(${${OUTPUT_VAR}})
@@ -419,7 +419,7 @@

   if(NOT DEFINED ${CACHE_VAR_NAME})

-    custom_try_run_lli("
+    custom_try_run_lli(TRUE "
 #ifndef offsetof
 #define offsetof(type, member) ((char *) &((type *) 0)->member - (char *) 0)
 #endif


Allow attributes on suil projects

Allow attributes on suil projects

--- cmake/Suil.cmake
+++ cmake/Suil.cmake
@@ -7,6 +7,10 @@
 if (CMAKE_BUILD_TYPE STREQUAL "Debug")
     add_definitions(-DSUIL_DEBUG -DSUIL_TRACE_ENABLED)
 endif()
+
+# Allow attributes on sources
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wattributes")
+set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   -Wattributes")

 if (NOT SUIL_BASE_PATH)
     set(SUIL_BASE_PATH /usr)


More work on compile commands database.

More work on compile commands database.

--- cmake/AeonEngineFunctions.cmake
+++ cmake/AeonEngineFunctions.cmake
@@ -10,8 +10,10 @@
         file(WRITE ${CMAKE_BINARY_DIR}/compile_commands.json "[\n")
         foreach(SOURCE_FILE ${sources})
             get_source_file_property(LANGUAGE ${SOURCE_FILE} LANGUAGE)
+            get_source_file_property(LOCATION ${SOURCE_FILE} LOCATION)
+            get_source_file_property(OBJECT_OUTPUTS ${SOURCE_FILE} OBJECT_OUTPUTS)
             if(LANGUAGE STREQUAL "CXX" OR LANGUAGE STREQUAL "C")
-                file(APPEND ${CMAKE_BINARY_DIR}/compile_commands.json "{\n\t\"directory\": \"${CMAKE_CURRENT_SOURCE_DIR}\",\n\t\"command\": \"cl.exe -c ${INCLUDE_FLAGS} -fms-extensions -fms-compatibility -fms-compatibility-version=19 -std=c++14 -D_MSC_VER=1900\",\n\t\"file\": \"${SOURCE_FILE}\"\n},\n")
+                file(APPEND ${CMAKE_BINARY_DIR}/compile_commands.json "{\n  \"directory\": \"${CMAKE_CURRENT_SOURCE_DIR}\",\n  \"command\": \"cl.exe ${INCLUDE_FLAGS} -fms-extensions -fms-compatibility -fms-compatibility-version=19 -std=c++14 -D_MSC_VER=1900 -c ${LOCATION}\",\n  \"file\": \"${LOCATION}\"\n},\n")
             endif()
         endforeach()
         file(APPEND ${CMAKE_BINARY_DIR}/compile_commands.json "]\n")


update

update

--- cmake/SetupProjectOptions.cmake
+++ cmake/SetupProjectOptions.cmake
@@ -8,7 +8,7 @@

 # testing
 OPTION(DCSC08961_BLD_UTEST "Enable unit-test building by default"                          ON)
-OPTION(DCSC08961_RUN_CTEST "Enable unit-test execution using CTest by default"             ON)
+OPTION(DCSC08961_RUN_CTEST "Enable unit-test execution using CTest by default"            OFF)
 OPTION(DCSC08961_RUN_UTEST "Enable unit-test execution using the build system by default" OFF)

 # coverage testing


Clean up Findminisat.cmake a little.

Clean up Findminisat.cmake a little.

--- cmake/modules/Findminisat.cmake
+++ cmake/modules/Findminisat.cmake
@@ -5,9 +5,7 @@
 #  MINISAT_LIBRARIES - The libraries needed to use minisat
 #  MINISAT_DEFINITIONS - Compiler switches required for using minisat

-find_package(PkgConfig)
-# pkg_check_modules(PC_MINISAT QUIET minisat) # MiniSat deoes not have pkg-config
-# set(MINISAT_DEFINITIONS if_needed_fill_here)
+set(MINISAT_DEFINITIONS "")

 find_path(MINISAT_INCLUDE_DIR minisat/core/Solver.h
           HINTS ${MINISAT_INCLUDE_DIRS}
@@ -34,7 +32,7 @@

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set MINISAT_FOUND to TRUE
-# if all listed variables are TRUE
+# if all listed variables are set
 find_package_handle_standard_args(minisat  DEFAULT_MSG
                                   MINISAT_LIBRARY MINISAT_INCLUDE_DIR)


#24 remove assimpm

#24 remove assimpm

--- cmake_modules/FindAssimpm.cmake
+++ cmake_modules/FindAssimpm.cmake
@@ -1,84 +0,0 @@
-#  Copyright (C) 2015 3D Repo Ltd
-#
-#  This program is free software: you can redistribute it and/or modify
-#  it under the terms of the GNU Affero General Public License as
-#  published by the Free Software Foundation, either version 3 of the
-#  License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU Affero General Public License for more details.
-#
-#  You should have received a copy of the GNU Affero General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-#attempt to find ASSIMP library
-#if ASSIMP is found, ASSIMP_FOUND is set to true
-#ASSIMP_INCLUDE_DIR will point to the include folder of the installation
-#ASSIMP_LIBRARIES will point to the libraries
-
-
-if(DEFINED ENV{ASSIMP_ROOT})
-	set(ASSIMP_ROOT $ENV{ASSIMP_ROOT})
-	message(STATUS "$ASSIMP_ROOT defined: ${ASSIMP_ROOT}")
-	find_path(ASSIMP_INCLUDE_DIR assimp
-		${ASSIMP_ROOT}/include
-		)
-	find_library(ASSIMP_LIBRARIES_RELEASE NAMES assimp
-		PATHS
-		${ASSIMP_ROOT}/lib
-	)
-	find_library(ASSIMP_LIBRARIES_DEBUG NAMES assimpd
-		PATHS
-		${ASSIMP_ROOT}/lib
-	)
-	set(ASSIMP_LIBRARIES
-		debug ${ASSIMP_LIBRARIES_DEBUG}
-		optimized ${ASSIMP_LIBRARIES_RELEASE}
-		)
-endif()
-
-if(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)
-	set(ASSIMP_FOUND TRUE)
-
-else(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)
-	find_path(ASSIMP_INCLUDE_DIR assimp
-		/usr/include
-		/usr/local/include
-		/opt/local/include
-    )
-
-	find_library(ASSIMP_LIBRARIES_RELEASE NAMES assimp
-    	PATHS
-    	/usr/lib/
-    	/usr/local/lib/
-    	/opt/local/lib/
-    )
-
-	find_library(ASSIMP_LIBRARIES_DEBUG NAMES assimpd
-    	PATHS
-    	/usr/lib/
-    	/usr/local/lib/
-    	/opt/local/lib/
-    )
-
-	set(ASSIMP_LIBRARIES
-		debug ${ASSIMP_LIBRARIES_DEBUG}
-		optimized ${ASSIMP_LIBRARIES_RELEASE}
-		)
-endif(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)
-
-
-
-if(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)
-	set(ASSIMPM_FOUND TRUE)
-	message(STATUS "ASSIMP installation found.")
-	message(STATUS "ASSIMP_INCLUDE_DIR: ${ASSIMP_INCLUDE_DIR}")
-	message(STATUS "ASSIMP_LIBRARIES: ${ASSIMP_LIBRARIES}")
-
-else(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)
-#cannot find mongo anywhere!
-	set(ASSIMPM_FOUND FALSE)
-	message(STATUS "ASSIMP not found. Please set ASSIMP_ROOT to your installation directory")
-endif(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)


CMake: Ensure that CMakeFiles/Dictionaries/ exist

This is workaround for older CMake not creating target directory
for custom commands.

Former-commit-id: 9e286fc871f8fa68809f7a71160c029bf2c9ecb8

--- cmake/JPetFramework-Utilities.cmake
+++ cmake/JPetFramework-Utilities.cmake
@@ -41,6 +41,7 @@
     endif()
     if(NOT skip)
       # output dictionary file will be kept in CMake build folder
+      file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Dictionaries)
       set(dictionary
         ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/Dictionaries/${name}Dictionary)
       if(EXISTS ${linkdef})


[cmake] Include project name in Sphinx doctree dir to fix race conditions

Modify add_sphinx_target() to include the project name alongside builder
in Sphinx doctree directory. This aims to avoid crashes due to race
conditions between multiple Sphinx instances running in parallel that
attempt to create or read that directory simultaneously.

This problem has originally been addressed in r283188. However, that
commit presumed that there will be only one target per builder being
run. However, r314863 introduced a second manpage target, reintroducing
the race condition.

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

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

--- cmake/modules/AddSphinxTarget.cmake
+++ cmake/modules/AddSphinxTarget.cmake
@@ -19,7 +19,7 @@
 # ``project`` should be the project name
 function (add_sphinx_target builder project)
   set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/${builder}")
-  set(SPHINX_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-${builder}")
+  set(SPHINX_DOC_TREE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees-${project}-${builder}")
   set(SPHINX_TARGET_NAME docs-${project}-${builder})

   if (SPHINX_WARNINGS_AS_ERRORS)


Create the RenderManagerCpp imported target from the CMake config file

--- cmake/osvrRenderManagerConfig.cmake
+++ cmake/osvrRenderManagerConfig.cmake
@@ -41,6 +41,12 @@

 # Undo our changes for later consumers
 osvr_unstash_common_map_config()
+
+if(NOT TARGET osvrRenderManager::osvrRenderManagerCpp)
+    add_library(osvrRenderManager::osvrRenderManagerCpp INTERFACE IMPORTED)
+    set_target_properties(osvrRenderManager::osvrRenderManagerCpp PROPERTIES
+        INTERFACE_LINK_LIBRARIES "osvrRenderManager::osvrRenderManager;osvr::osvrClientKitCpp")
+endif()

 # Fix up imported targets to add deps: these files will only exist in install trees.
 include("${CMAKE_CURRENT_LIST_DIR}/osvrRenderManagerConfigInstalledBoost.cmake" OPTIONAL)


Revert "Strip rpath from libgeoip too."

Revert "Strip rpath from libgeoip too."

This reverts commit 75a9728a75211a48b53227a7d212b7230cb1f3c1.

I don't think this should actually be needed on clean installs.

--- build/cmake/libgeoip.cmake
+++ build/cmake/libgeoip.cmake
@@ -9,7 +9,6 @@
   URL_HASH MD5=${LIBGEOIP_HASH}
   CONFIGURE_COMMAND ${LIBGEOIP_CONFIGURE_CMD}
   INSTALL_COMMAND make install DESTDIR=${STAGE_DIR}
-    COMMAND chrpath -d ${STAGE_EMBEDDED_DIR}/lib/libGeoIP.so
     COMMAND find ${STAGE_EMBEDDED_DIR}/bin/ -name geoiplookup* -exec chrpath -d {} $<SEMICOLON>
 )


build: fix xxhash -DENABLE_INLINE_API w/ our patch.

Fixes: #304
Ref: https://github.com/Cyan4973/xxHash/issues/163

--- recipe/wellknown.cmake
+++ recipe/wellknown.cmake
@@ -181,8 +181,7 @@
       -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
       -DBUILD_XXHSUM=OFF
       -DBUILD_SHARED_LIBS=OFF
+      -DBUILD_ENABLE_INLINE_API=ON
       <SOURCE_DIR>/cmake_unofficial
-    INSTALL_COMMAND
-      ${make_command} install && ${CMAKE_COMMAND} -E copy <SOURCE_DIR>/xxhash.c <INSTALL_DIR>/include/xxhash.c
-    URL https://github.com/Cyan4973/xxHash/archive/v0.6.5.tar.gz
-    URL_MD5 6af3a964f3c2accebce66e54b44b6446)
+    URL https://github.com/Cyan4973/xxHash/archive/c9970b8.tar.gz
+    URL_MD5 c1c87865e98f79144814a1d57db47751)


cmake: fix integration with cotire

cmake: fix integration with cotire

--- cmake/ClangTidy.cmake
+++ cmake/ClangTidy.cmake
@@ -71,6 +71,14 @@
 else()
     message(STATUS "clang-apply-replacements not found")
 endif()
+
+if(TARGET all_pch)
+    add_dependencies(lint all_pch)
+    add_dependencies(lint-by-file all_pch)
+    add_dependencies(lint-by-diagnostic all_pch)
+    add_dependencies(lint-fix all_pch)
+endif()
+
 # function(lint TARGET)
 #     add_custom_target(${TARGET}-lint VERBATIM)


make error message more explicit. It took me 15 minutes to figure out
what was wrong, I though it was looking for the bzip2 executable.

svn path=/trunk/kdesupport/strigi/; revision=643052

--- cmake/FindBZip2.cmake
+++ cmake/FindBZip2.cmake
@@ -35,7 +35,7 @@
   ENDIF (NOT BZip2_FIND_QUIETLY)
 ELSE (BZIP2_FOUND)
   IF (BZip2_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "Could NOT find BZip2")
+    MESSAGE(FATAL_ERROR "Could NOT find BZip2 libraries")
   ENDIF (BZip2_FIND_REQUIRED)
 ENDIF (BZIP2_FOUND)


build: remove unnecessary modification of CMAKE_REQUIRED_DEFINITIONS

This is unnecessary now that the flag handling has been fixed.  The flags will
be added properly in the main CMakeLists.txt after the config-ix inclusion which
performs the required check.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@203639 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -30,11 +30,3 @@
 check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)
 check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)

-# Check C++0x features
-if (LIBCXX_ENABLE_CXX0X)
-  if (LIBCXX_HAS_STDCXX0X_FLAG)
-    set(CMAKE_REQUIRED_DEFINITIONS -std=c++0x)
-  endif()
-else()
-  set(LIBCXX_HAS_STDCXX0X_FLAG FALSE)
-endif()


Fixed GWP-ASan build breakage. When adding the optional flag parser, there was a missing dependency on compiler-rt (and thus SanitizerCommon) for this feature.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -687,7 +687,8 @@
 # Note: Fuchsia and Windows are not currently supported by GWP-ASan. Support
 # is planned for these platforms. Darwin is also not supported due to TLS
 # calling malloc on first use.
-if (GWP_ASAN_SUPPORTED_ARCH AND OS_NAME MATCHES "Android|Linux")
+if (COMPILER_RT_HAS_SANITIZER_COMMON AND GWP_ASAN_SUPPORTED_ARCH AND
+    OS_NAME MATCHES "Android|Linux")
   set(COMPILER_RT_HAS_GWP_ASAN TRUE)
 else()
   set(COMPILER_RT_HAS_GWP_ASAN FALSE)


[libcxxabi] iconv is not needed for mingw-w64

git-svn-id: 6a9f6578bdee8d959f0ed58970538b4ab6004734@304026 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -36,7 +36,7 @@
       set(MINGW_RUNTIME gcc_s gcc)
     endif()
     set(MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32
-                        shell32 user32 kernel32 iconv mingw32 ${MINGW_RUNTIME}
+                        shell32 user32 kernel32 mingw32 ${MINGW_RUNTIME}
                         moldname mingwex msvcrt)
     list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
   endif()


[GWP-ASan] D63736 broke ARMv7/v8 sanitizer bots.

Remove ARM32/ARM64 support for GWP-ASan due to a strange SEGV when
running scudo's preinit.c test. Disabling to make the bots go green
while investigating.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -247,7 +247,7 @@
   set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64} ${ARM64})
 endif()

-set(ALL_GWP_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64} ${ARM32})
+set(ALL_GWP_ASAN_SUPPORTED_ARCH ${X86} ${X86_64})
 if(APPLE)
   set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64})
 else()


r9567/sofa : FIX: cmake compiler definitions propagation

Former-commit-id: 702933c1c4c97092292b7c21497df98f450c98c1

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -68,7 +68,7 @@

 	set(defines)
 	foreach(it ${GLOBAL_COMPILER_DEFINES})
-		list(APPEND defines "-D${it}")
+		list(APPEND defines "-D${it}")
 	endforeach()

 	foreach(it ${moc_files})
@@ -367,19 +367,20 @@
 			set(dependencies ${GLOBAL_PROJECT_DEPENDENCIES_${projectName}})

 			# and compute its compiler definitions
-			set(compilerDefines ${${projectName}_COMPILER_DEFINES})
+			set(dependenciesCompilerDefines)

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

-				set(compilerDefines ${compilerDefines} ${GLOBAL_PROJECT_OPTION_COMPILER_DEFINITIONS_${dependency}})
+				set(dependenciesCompilerDefines ${dependenciesCompilerDefines} ${GLOBAL_PROJECT_REGISTERED_COMPILER_DEFINITIONS_${dependency}})
 			endforeach()
 			#message(STATUS "${offset} - ${projectName}")

 			# set the updated compiler definitions of the current project
+			set(GLOBAL_PROJECT_REGISTERED_COMPILER_DEFINITIONS_${projectName} ${dependenciesCompilerDefines} ${GLOBAL_PROJECT_OPTION_COMPILER_DEFINITIONS_${projectName}} CACHE INTERNAL "${projectName} compiler definitions from option and dependencies options" FORCE)
 			if(TARGET ${projectName})
-				set(compilerDefines ${compilerDefines} ${GLOBAL_PROJECT_OPTION_COMPILER_DEFINITIONS_${projectName}})
+				set(compilerDefines ${${projectName}_COMPILER_DEFINES} ${GLOBAL_PROJECT_REGISTERED_COMPILER_DEFINITIONS_${projectName}})
 				list(REMOVE_DUPLICATES compilerDefines)
 				set_target_properties(${projectName} PROPERTIES COMPILE_DEFINITIONS "${compilerDefines}")
 			endif()


cmake: fix incorrect warning message display

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -126,11 +126,11 @@
     set(multiValueArgs COMPILE_OPTIONS)
     cmake_parse_arguments(ACO "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    if (NOT "${ACO_WARNING_MESSAGE}" STREQUAL "")
-        message(WARNING "Warning: ${ACO_WARNING_MESSAGE}")
-    endif()
+    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "${ACO_COMPILER_ID}")
+        if (NOT "${ACO_WARNING_MESSAGE}" STREQUAL "")
+            message(WARNING "Warning: ${ACO_WARNING_MESSAGE}")
+        endif()

-    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "${ACO_COMPILER_ID}")
         target_compile_options(${ACO_TARGET} INTERFACE ${ACO_COMPILE_OPTIONS})
     endif()
 endfunction()


add source groups to cmake

add source groups to cmake

--- cmake/voxelGame.cmake
+++ cmake/voxelGame.cmake
@@ -75,3 +75,11 @@
 add_executable(Voxel ${VOXEL_SRC})
 target_link_libraries(Voxel ${VOXEL_LIBRARIES})
 include_directories(include ${VOXEL_INCLUDE})
+
+# Project solution folders organization
+source_group("game" REGULAR_EXPRESSION game/.*)
+source_group("graphics" REGULAR_EXPRESSION graphics/.*)
+source_group("graphics\\D3D11" REGULAR_EXPRESSION graphics/D3D11/.*)
+source_group("graphics\\OpenGL" REGULAR_EXPRESSION graphics/OpenGL/.*)
+source_group("main" REGULAR_EXPRESSION main/.*)
+source_group("platform" REGULAR_EXPRESSION platform/.*)


Fixed 2 missing parentheses

Fixed 2 missing parentheses

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -251,9 +251,9 @@
 message(STATUS "Version flags set to: ${XCODE_IOS_PLATFORM_VERSION_FLAGS}")

 if (ENABLE_BITCODE)
-  set(BITCODE "-fembed-bitcode"
+  set(BITCODE "-fembed-bitcode")
 else()
-  set(BITCODE ""
+  set(BITCODE "")
 endif()

 set(CMAKE_C_FLAGS


version updated to 1.3.1

version updated to 1.3.1

--- conf/RTFVersion.cmake
+++ conf/RTFVersion.cmake
@@ -9,7 +9,7 @@
 # bumping VERSION_PATCH
 set(RTF_VERSION_MAJOR "1")
 set(RTF_VERSION_MINOR "3")
-set(RTF_VERSION_PATCH "0")
+set(RTF_VERSION_PATCH "1")
 set(RTF_VERSION_TWEAK "")
 set(RTF_VERSION_STRING "")


Add pedantic for Clang

Add pedantic for Clang

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -114,11 +114,14 @@

             $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.8>:
                 -Wpedantic
+
                 -Wreturn-local-addr
             >
         >

         $<$<CXX_COMPILER_ID:Clang>:
+            -Wpedantic
+
             -Wreturn-stack-address
         >


Changed the debug postfix to "_d" from "d"

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -18,7 +18,7 @@
 #

 set(DEFAULT_PROJECT_OPTIONS
-    DEBUG_POSTFIX             "d"
+    DEBUG_POSTFIX             "_d"
     CXX_STANDARD              14
     LINKER_LANGUAGE           "CXX"
     POSITION_INDEPENDENT_CODE ON


Update FindMyPackage.cmake

Update FindMyPackage.cmake

--- cmake/FindLB/cloning.cmake
+++ cmake/FindLB/cloning.cmake
@@ -34,6 +34,7 @@
 	elseif(NOT ${_package}_FIND_QUIETLY)
 		message(STATUS "Find ${_package_name}: ${_msg}")
 	endif()
+	set(${_package}_NOT_FOUND_MESSAGE "${_msg}")
 endmacro()

 # Info reporting macro
@@ -63,16 +64,20 @@
 endforeach()
 _fmp_report_debug("########")

+# For CMake GUI
+option(${_package}_PREFER_HIGHEST
+	"Prefer the highest available version even if a lower version has more requested optional components"
+)
+
 # Find where all versions are installed
-if(NOT ${_package}_ROOT)
-	find_path(${_package}_ROOT
-		NAMES
-			${_package}
-	)
-endif()
+find_path(${_package}_ROOT
+	NAMES
+		${_package}
+	DOC "This should be the directory that contains ${_package}"
+)

 # Error out if we could not find the package directory
-if(${${_package}_ROOT} STREQUAL "${_package}_ROOT-NOTFOUND")
+if("${${_package}_ROOT}" STREQUAL "${_package}_ROOT-NOTFOUND")
 	_fmp_report_error("Could not find where versions are stored - please set ${_package}_ROOT")
 	return()
 endif()
@@ -172,35 +177,39 @@
 	return()
 endif()

-# Prefer versions with the most requested optional components
-set(_preferred_versions "")
-set(_preferred_versions_compnum 0)
-foreach(_version ${_candidate_versions})
-	set(_compnum 0)
-	# Count present requested optional components
-	foreach(_component ${${_package}_FIND_COMPONENTS})
-		if(NOT ${_package}_FIND_REQUIRED_${_component})
-			if(EXISTS "${${_package}_VERSIONS_DIRECTORY}/${_version}/cmake/${_package}/${_component}.cmake")
-				math(EXPR _compnum "${_compnum} + 1")
+if(${_package}_PREFER_HIGHEST)
+	set(_preferred_versions "${_candidate_versions}")
+else()
+	# Prefer versions with the most requested optional components
+	set(_preferred_versions "")
+	set(_preferred_versions_compnum 0)
+	foreach(_version ${_candidate_versions})
+		set(_compnum 0)
+		# Count present requested optional components
+		foreach(_component ${${_package}_FIND_COMPONENTS})
+			if(NOT ${_package}_FIND_REQUIRED_${_component})
+				if(EXISTS "${${_package}_VERSIONS_DIRECTORY}/${_version}/cmake/${_package}/${_component}.cmake")
+					math(EXPR _compnum "${_compnum} + 1")
+				endif()
 			endif()
+		endforeach()
+		# Update preferred versions
+		if(_compnum GREATER _preferred_versions_compnum)
+			set(_preferred_versions ${_version})
+			set(_preferred_versions_compnum ${_compnum})
+		elseif(_compnum EQUAL _preferred_versions_compnum)
+			list(APPEND _preferred_versions ${_version})
 		endif()
 	endforeach()
-	# Update preferred versions
-	if(_compnum GREATER _preferred_versions_compnum)
-		set(_preferred_versions ${_version})
-		set(_preferred_versions_compnum ${_compnum})
-	elseif(_compnum EQUAL _preferred_versions_compnum)
-		list(APPEND _preferred_versions ${_version})
-	endif()
-endforeach()
-_fmp_report_debug("_preferred_versions=${_preferred_versions}")
-
-# Error out if we made a mistake in our logic above
-# (worst case should be that _preferred_versions is the same as _candidate_versions)
-list(LENGTH _preferred_versions _num_preferred)
-if(_num_preferred EQUAL 0)
-	message(FATAL_ERROR "Something has gone wrong the code in Find${_package}.cmake")
-	return()
+	_fmp_report_debug("_preferred_versions=${_preferred_versions}")
+
+	# Error out if we made a mistake in our logic above
+	# (worst case should be that _preferred_versions is the same as _candidate_versions)
+	list(LENGTH _preferred_versions _num_preferred)
+	if(_num_preferred EQUAL 0)
+		message(FATAL_ERROR "Something has gone wrong the code in Find${_package}.cmake")
+		return()
+	endif()
 endif()

 # Finally, select the highest version
@@ -211,18 +220,41 @@
 	endif()
 endforeach()
 _fmp_report_debug("_preferred_version=${_preferred_version}")
+set(_ver_path "${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}/cmake")
+
+# Make sure all requirements are met
+include("${_ver_path}/${_package}-requirements.cmake" OPTIONAL)
+foreach(_component ${${_package}_FIND_COMPONENTS})
+	include("${_ver_path}/${_package}/${_component}-requirements.cmake" OPTIONAL)
+endforeach()

 # Load the version and report findings
-include("${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}/cmake/${_package}.cmake")
+include("${_ver_path}/${_package}.cmake")
 set(_components "")
 foreach(_component ${${_package}_FIND_COMPONENTS})
-	set(_comp_path "${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}/cmake/${_package}/${_component}.cmake")
+	set(_comp_path "${_ver_path}/${_package}/${_component}.cmake")
 	if(EXISTS "${_comp_path}")
 		include("${_comp_path}")
 		list(APPEND _components ${_component})
+		set(${_package}_${_component}_FOUND 1)
 	endif()
 endforeach()
 set(${_package}_FOUND 1)
+set(${_package}_VERSION "${_preferred_version}")
+set(${_package}_VERSION_STRING "${_preferred_version}")
+string(REPLACE "." ";" _preferred_version_list "${_preferred_version}")
+list(LENGTH _preferred_version_list _preferred_version_depth)
+list(GET _preferred_version_list 0 ${_package}_VERSION_MAJOR)
+if(_preferred_version_depth GREATER 1)
+	list(GET _preferred_version_list 1 ${_package}_VERSION_MINOR)
+	if(_preferred_version_depth GREATER 2)
+		list(GET _preferred_version_list 2 ${_package}_VERSION_PATCH)
+		if(_preferred_version_depth GREATER 3)
+			list(GET _preferred_version_list 3 ${_package}_VERSION_TWEAK)
+		endif()
+	endif()
+endif()
+set(${_package}_ROOT_DIR "${${_package}_VERSIONS_DIRECTORY}/${_preferred_version}")
 string(REPLACE ";" ", " _components "${_components}")
 if(_components STREQUAL "")
 	_fmp_report_info("Found version ${_preferred_version} with no components")


Fix broken debugging in MSVC

Fix broken debugging in MSVC

--- cmake/Modules/CCache.cmake
+++ cmake/Modules/CCache.cmake
@@ -50,6 +50,6 @@
     endif ()
 endif ()

-if (MSVC AND NOT ENV{CLCACHE_DIR} STREQUAL "")
+if (MSVC AND (DEFINED ENV{CLCACHE_DIR} AND NOT ENV{CLCACHE_DIR} STREQUAL ""))
     ucm_replace_flag("/Z[iI]" "" REGEX CONFIG Debug RelWithDebInfo)
 endif ()


More windows fun

More windows fun

Link to sources in visual studio (more user-friendly).
Only look for msbuild/xbuild when *not* building VS solutions.

--- cmake/Modules/CSProj.cmake
+++ cmake/Modules/CSProj.cmake
@@ -1,14 +1,16 @@
 include(CMakeParseArguments)

-find_program(CSBUILD msbuild)
-if (NOT CSBUILD)
-  find_program(CSBUILD xbuild)
-endif()
+if(NOT CMAKE_GENERATOR MATCHES "^Visual Studio")
+	find_program(CSBUILD msbuild)
+	if (NOT CSBUILD)
+	  find_program(CSBUILD xbuild)
+	endif()

-if (NOT CSBUILD)
-  message(WARNING "msbuild (or xbuild) NOT found but required for C#. Projects will NOT be generated.")
-else()
-  message(STATUS "CSBUILD: ${CSBUILD}")
+	if (NOT CSBUILD)
+	  message(SEND_ERROR "msbuild (or xbuild) NOT found but required for C#. Projects will NOT be generated.")
+	else()
+	  message(STATUS "CSBUILD: ${CSBUILD}")
+	endif()
 endif()

 set(CSPROJ_LOCATION "${CMAKE_CURRENT_LIST_DIR}" CACHE INTERNAL "csproj directory")
@@ -16,7 +18,16 @@
 function(sources_to_xml INPUTS OUT)
   set(${OUT})
   foreach(SRC IN LISTS ${INPUTS})
-    list(APPEND ${OUT} "<Compile Include=\"${SRC}\" />")
+  	set(COMPILE_XML "<Compile Include=\"${SRC}\">")
+  	if(EXISTS "${SRC}")
+  		get_filename_component(SRC_NAME "${SRC}" NAME)
+  		# Get the file base directory's name.
+	  	get_filename_component(SRC_DIR "${SRC}" DIRECTORY)
+	  	get_filename_component(SRC_DIR "${SRC_DIR}" NAME)
+	  	set(COMPILE_XML "${COMPILE_XML}<Link>${SRC_DIR}/${SRC_NAME}</Link>")
+	endif()
+	set(COMPILE_XML "${COMPILE_XML}</Compile>")
+    list(APPEND ${OUT} "${COMPILE_XML}")
   endforeach()
   string(REPLACE ";" "\n" ${OUT} "${${OUT}}")
   set(${OUT} ${${OUT}} PARENT_SCOPE)


DO not pass -DDebug in fuzz build mode.

DO not pass -DDebug in fuzz build mode.

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -17,8 +17,8 @@
 if(CMAKE_BUILD_TYPE STREQUAL "RELEASE")
   # want assertions in all but Release build type.
   add_definitions(-DNDEBUG)
-elseif(NOT CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
-  # if not Release and not RelWithDebInfo build, enable extra debug mode
+elseif(NOT (CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO" OR CMAKE_BUILD_TYPE STREQUAL "FUZZ"))
+  # if not Release/RelWithDebInfo/Fuzz build, enable extra debug mode
   add_definitions(-DDEBUG)
 endif()

@@ -100,7 +100,8 @@
     CMAKE_C_FLAGS_SANITIZE )

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


simplify and make quiet in the download of mklml.cmake

--- cmake/external/mklml.cmake
+++ cmake/external/mklml.cmake
@@ -54,8 +54,8 @@
     ${EXTERNAL_PROJECT_LOG_ARGS}
     PREFIX                ${MKLML_SOURCE_DIR}
     DOWNLOAD_DIR          ${MKLML_DOWNLOAD_DIR}
-    DOWNLOAD_COMMAND      wget --no-check-certificate ${MKLML_URL} -c -O ${MKLML_VER}.tgz
-                          && tar zxf ${MKLML_DOWNLOAD_DIR}/${MKLML_VER}.tgz
+    DOWNLOAD_COMMAND      wget --no-check-certificate ${MKLML_URL} -c -q -O ${MKLML_VER}.tgz
+                          && tar zxf ${MKLML_VER}.tgz
     DOWNLOAD_NO_PROGRESS  1
     UPDATE_COMMAND        ""
     CMAKE_ARGS            -DCMAKE_INSTALL_PREFIX=${MKLML_INSTALL_ROOT}


[lld][cmake] Fix BUILD_SHARED_LIBS installation

Summary:
This fixes a regression caused by D28397, which switched lld from using
add_llvm_library to llvm_add_library. The latter does not automatically set up
install rules for libraries, as it's expected the project will set them up
manually based on its own needs.

This adds the install rules to add_lld_library for lld. They were inspired by
the similar add_clang_library macro in clang.

Reviewers: ruiu, beanz, davidlt, EricWF, dtzWill

Subscribers: mgorny, llvm-commits

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

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@292909 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLD.cmake
+++ cmake/modules/AddLLD.cmake
@@ -1,6 +1,38 @@
 macro(add_lld_library name)
-  llvm_add_library(${name} ${ARGN})
+  cmake_parse_arguments(ARG
+    "SHARED"
+    ""
+    ""
+    ${ARGN})
+  if(ARG_SHARED)
+    set(ARG_ENABLE_SHARED SHARED)
+  endif()
+  llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS})
   set_target_properties(${name} PROPERTIES FOLDER "lld libraries")
+
+  if (LLD_BUILD_TOOLS)
+    if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
+        NOT LLVM_DISTRIBUTION_COMPONENTS)
+      set(export_to_lldtargets EXPORT lldTargets)
+      set_property(GLOBAL PROPERTY LLD_HAS_EXPORTS True)
+    endif()
+
+    install(TARGETS ${name}
+      COMPONENT ${name}
+      ${export_to_lldtargets}
+      LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+      ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+      RUNTIME DESTINATION bin)
+
+    if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
+      add_custom_target(install-${name}
+        DEPENDS ${name}
+        COMMAND "${CMAKE_COMMAND}"
+          -DCMAKE_INSTALL_COMPONENT=${name}
+          -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+    endif()
+    set_property(GLOBAL APPEND PROPERTY LLD_EXPORTS ${name})
+  endif()
 endmacro(add_lld_library)

 macro(add_lld_executable name)


Test for whether bash is available.  Also, test for whether any shell is
available.

svn path=/trunk/; revision=7227

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -52,7 +52,25 @@
 include(double)
 include(instdirs)
 include(rpath)
+
 option(BUILD_TEST "Compile examples in the build tree and enable ctest" OFF)
+# Use bash when available for ctest and install tree test support
+find_program(SH_EXECUTABLE bashxx)
+if(SH_EXECUTABLE)
+  set(HAVE_BASH ON)
+else(SH_EXECUTABLE)
+  find_program(SH_EXECUTABLE sh)
+endif(SH_EXECUTABLE)
+
+if(NOT SH_EXECUTABLE)
+   message(STATUS
+   "WARNING: shell not found, disabling ctest and install tree examples tests"
+   )
+   set(BUILD_TEST OFF
+   CACHE BOOL "Compile examples in the build tree and enable ctest" FORCE
+   )
+endif(NOT SH_EXECUTABLE)
+
 option(PREBUILD_DIST "Pre-build all components required for distribution" OFF)
 if(NOT CMAKE_SYSTEM_NAME STREQUAL "Linux")
   set(


Deal properly with case where CMAKE_INSTALL_PREFIX is an empty string.
(This case is typically used to generate binary distribution tarballs.)

svn path=/trunk/; revision=12387

--- cmake/modules/python.cmake
+++ cmake/modules/python.cmake
@@ -111,11 +111,20 @@
 endif(ENABLE_python AND HAVE_NUMPY)

 if(ENABLE_python)
+  # if CMAKE_INSTALL_EXEC_PREFIX is an empty string, must replace
+  # it with "/" to make PYTHON_INSTALL_TEMPLATE an absolute path to be
+  # consistent with all other installation paths.
+  if(CMAKE_INSTALL_EXEC_PREFIX)
+    set(PYTHON_INSTALL_TEMPLATE "${CMAKE_INSTALL_EXEC_PREFIX}")
+  else(CMAKE_INSTALL_EXEC_PREFIX)
+    set(PYTHON_INSTALL_TEMPLATE "/")
+  endif(CMAKE_INSTALL_EXEC_PREFIX)
+
   # N.B. This is a nice way to obtain all sorts of Python information
   # using distutils.
   execute_process(
     COMMAND
-    ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${CMAKE_INSTALL_EXEC_PREFIX}')"
+    ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${PYTHON_INSTALL_TEMPLATE}')"
     OUTPUT_VARIABLE PYTHON_INSTDIR
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )


Add valgrind supression file support.

Add valgrind supression file support.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -335,6 +335,9 @@
 if(CTEST_MEMORYCHECK_COMMAND)
     set(CTEST_MEMORYCHECK_TYPE "Valgrind")
     set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--trace-children=yes --track-origins=yes --leak-check=full --show-reachable=yes")
+    if(EXISTS "${CTEST_SOURCE_DIRECTORY}/valgrind.supp")
+        set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "${CTEST_MEMORYCHECK_COMMAND_OPTIONS} --suppressions=${CTEST_SOURCE_DIRECTORY}/valgrind.supp")
+    endif()
     set(CTEST_BUILD_NAME "${CI_BUILD_NAME}-valgrind")
     ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
     ctest_start(Continuous)


Fixed Ubuntu build.

Fixed Ubuntu build.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -318,7 +318,13 @@
     if(CC_VERSION VERSION_GREATER 5 OR CC_VERSION VERSION_EQUAL 5)
         if(CC_TSAN GREATER 0)
             set(CTEST_MEMORYCHECK_TYPE "ThreadSanitizer")
-            #set(CC_TSAN_FLAGS "-static-libtsan")
+            if(UNIX)
+                set(CI_UBUNTU 0)
+                execute_process(COMMAND cat /etc/*-release COMMAND grep -c Ubuntu OUTPUT_VARIABLE CI_UBUNTU )
+                if(CI_UBUNTU GREATER 0)
+                    set(CC_TSAN_FLAGS "-static-libtsan")
+                endif()
+            endif()
         endif()
     endif()
 elseif(CC_NAME STREQUAL "clang")


Cleanup.

Cleanup.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -8,12 +8,6 @@

 if(NOT DEFINED ENV{CI})
     message(FATAL_ERROR "Not a CI server.")
-endif()
-
-if(DEFINED ENV{CTEST_CMAKE_GENERATOR})
-    set(CTEST_CMAKE_GENERATOR "$ENV{CTEST_CMAKE_GENERATOR}")
-elseif(UNIX)
-    set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
 endif()

 # Compiler
@@ -83,10 +77,7 @@
     endif()
 else()
     set(CC_NAME "msvc")
-    string(SUBSTRING ${CTEST_CMAKE_GENERATOR} 14 2 CC_VERSION)
-    if(${CTEST_CMAKE_GENERATOR} MATCHES ".*ARM")
-        set(CC_ARCH "arm")
-    elseif(${CTEST_CMAKE_GENERATOR} MATCHES ".*Win64")
+    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
         set(CC_ARCH "x86_64")
     else()
         set(CC_ARCH "x86")
@@ -207,7 +198,7 @@
 elseif(CC_NAME STREQUAL "icc")
     set(CTEST_COVERAGE_COMMAND codecov)
     set(CTEST_COVERAGE_EXTRA_FLAGS "${CTEST_COVERAGE_EXTRA_FLAGS} -txtlcov")
-elseif(CC_NAME STREQUAL "msvc" AND NOT CC_ARCH STREQUAL "arm")
+elseif(CC_NAME STREQUAL "msvc")
     find_program(CTEST_COVERAGE_COMMAND NAMES OpenCppCoverage)
 endif()
 if(CTEST_COVERAGE_COMMAND)


Fix mismatch condition.

Fix mismatch condition.

	* build-aux/cmake/modules/CheckCMakeVarsExists.cmake: Do that.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/CheckCMakeVarsExists.cmake
+++ build-aux/cmake/modules/CheckCMakeVarsExists.cmake
@@ -10,7 +10,7 @@
 ## For comments, bug reports and feedback: http://www.urbiforge.com
 ##

-if(NOT COMMAND CHECK_CMAKE_VARS_EXISTS)
+if(NOT COMMAND CHECK_CMAKE_VARS_EXISTS_CMAKE)

   # Check whether the given variables exists. Send an error message if it
   # doesn't.


build: yaml-cpp depends on Boost

build: yaml-cpp depends on Boost

The version of yaml-cpp that we minimally depend on has a dependency on
Boost. Later versions do not, but this shouldn't impact anything (just
the execution order).

--- recipe/dev.cmake
+++ recipe/dev.cmake
@@ -223,6 +223,7 @@
     INSTALL_COMMAND ${make_command} install)

 cooking_ingredient (yaml-cpp
+  REQUIRES Boost
   CMAKE_ARGS
     -DYAML_CPP_BUILD_TESTS=OFF
     -DBUILD_SHARED_LIBS=ON


Use the OpenGL2 rendering backend

Use the OpenGL2 rendering backend

Numerous improvements in rendering speed across our platforms.

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -4,6 +4,7 @@
   CMAKE_ARGS
     -DBUILD_SHARED_LIBS:BOOL=ON
     -DBUILD_TESTING:BOOL=OFF
+    -DVTK_RENDERING_BACKEND:STRING=OpenGL2
     -DPARAVIEW_BUILD_QT_GUI:BOOL=ON
     -DPARAVIEW_ENABLE_PYTHON:BOOL=ON
     -DPARAVIEW_BUILD_PLUGIN_AdiosReader:BOOL=FALSE


Use the right variable to enable kits

Use the right variable to enable kits

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -44,7 +44,7 @@
     -DPARAVIEW_ENABLE_CATALYST:BOOL=OFF
     -DPARAVIEW_ENABLE_WEB:BOOL=ON
     -DPARAVIEW_USE_QTHELP:BOOL=OFF
-    -DPARAVIEW_ENABLE_KITS:BOOL=ON
+    -DVTK_ENABLE_KITS:BOOL=ON
     -DPARAVIEW_BUILD_PLUGIN_AdiosReader:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_AnalyzeNIfTIIO:BOOL=FALSE
     -DPARAVIEW_BUILD_PLUGIN_ArrowGlyph:BOOL=FALSE


DEL: Obsolete files

DEL: Obsolete files

--- spharm-pdm.cmake
+++ spharm-pdm.cmake
@@ -1,55 +0,0 @@
-project(spharmpdm)
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/Common.cmake)
-#-----------------------------------------------------------------------------
-find_package(ITK REQUIRED)
-include(${USE_ITK_FILE})
-
-#-----------------------------------------------------------------------------
-find_package(VTK REQUIRED)
-include(${USE_VTK_FILE})
-
-#-----------------------------------------------------------------------------
-find_package(SlicerExecutionModel REQUIRED GenerateCLP)
-include(${GenerateCLP_USE_FILE})
-include(${SlicerExecutionModel_USE_FILE})
-include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake)
-
-#-----------------------------------------------------------------------------
-find_package(BatchMake REQUIRED)
-include(${BatchMake_USE_FILE})
-
-#-----------------------------------------------------------------------------
-
-set(CLAPACK_LIBRARY_DIRECTORIES
-  #${CLAPACK_DIR}/SRC
-  #${CLAPACK_DIR}/BLAS/SRC
-  ${CLAPACK_DIR}/F2CLIBS/libf2c)
-if(WIN32)
-  set(CLAPACK_LIBRARIES lapack blas libf2c)
-else()
-  set(CLAPACK_LIBRARIES lapack blas f2c)
-endif()
-
-link_directories( ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} )
-link_directories(${CLAPACK_LIBRARY_DIRECTORIES})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Shape/IO)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Shape/SpatialObject)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Shape/Algorithms)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Shape/Numerics)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/Shape/Statistics)
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libraries/SparseLibMVIml)
-include_directories(${Boost_DIR}/include)
-include_directories(${Boost_DIR}/include)
-
-link_directories(${Boost_DIR}/lib)
-add_subdirectory(Libraries)
-add_subdirectory(Applications)
-
-FILE( GLOB list_files ${CMAKE_CURRENT_SOURCE_DIR}/bmm/*.* )
-FILE( COPY ${list_files} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
-
-#======================================================================================
-  # Create Tests
- include(CTest)
- add_subdirectory(Testing) # contains a CMakeLists.txt


Updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -109,9 +109,9 @@

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Corrade DEFAULT_MSG
-    CORRADE_INCLUDE_DIR
     CORRADE_UTILITY_LIBRARY
     CORRADE_PLUGINMANAGER_LIBRARY
+    CORRADE_INCLUDE_DIR
     CORRADE_RC_EXECUTABLE)

 if(NOT CORRADE_FOUND)


[OpenMP] Fix KMP_DYNAMIC_LIB to be dependent on LIBOMP_ENABLE_SHARED

The KMP_DYNAMIC_LIB guard was hard set to 1. This patch has the guard depend
on CMake variable LIBOMP_ENABLE_SHARED.

git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@343866 91177308-0d34-0410-b5e6-96231b3b80d8

--- runtime/src/kmp_config.h.cmake
+++ runtime/src/kmp_config.h.cmake
@@ -59,6 +59,8 @@
 #cmakedefine01 STUBS_LIBRARY
 #cmakedefine01 LIBOMP_USE_HWLOC
 #define KMP_USE_HWLOC LIBOMP_USE_HWLOC
+#cmakedefine01 LIBOMP_ENABLE_SHARED
+#define KMP_DYNAMIC_LIB LIBOMP_ENABLE_SHARED
 #define KMP_ARCH_STR "@LIBOMP_LEGAL_ARCH@"
 #define KMP_LIBRARY_FILE "@LIBOMP_LIB_FILE@"
 #define KMP_VERSION_MAJOR @LIBOMP_VERSION_MAJOR@
@@ -84,7 +86,6 @@
 # define BUILD_I8 1
 #endif

-#define KMP_DYNAMIC_LIB 1
 #define KMP_NESTED_HOT_TEAMS 1
 #define KMP_ADJUST_BLOCKTIME 1
 #define BUILD_PARALLEL_ORDERED 1


raspberrypi2-cxx11 use os/raspberry2 & compiler/gcc-cross-compile-raspberry-pi

--- raspberrypi2-cxx11.cmake
+++ raspberrypi2-cxx11.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2015, Alexandre Pretyman
+# Copyright (c) 2015, 2017 Alexandre Pretyman
 # All rights reserved.

 if(DEFINED POLLY_RASPBERRYPI2_CXX11_CMAKE)
@@ -15,85 +15,11 @@
 )

 include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_common.cmake")
+
 include(polly_clear_environment_variables)
-include(polly_fatal_error)
-include(polly_add_cache_flag)
-
-set(_rpi_error_msg) #if empty, then no errors!
-string(COMPARE EQUAL
-    "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH}"
-    ""
-    _is_empty
-)
-if(_is_empty)
-  set(_rpi_error_msg
-      "${_rpi_error_msg}\nRASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH environment variable not set. Set it to the absolute path of the \"bin\" directory for the toolchain"
-  )
-endif()
-
-string(COMPARE EQUAL
-    "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX}"
-    ""
-    _is_empty
-)
-if(_is_empty)
-  set(_rpi_error_msg
-      "${_rpi_error_msg}\nRASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX environment variable not set. Set it to the triplet of the toolchain (ex: arm-linux-gnueabihf)"
-  )
-endif()
-
-string(COMPARE EQUAL
-    "$ENV{RASPBERRYPI_CROSS_COMPILE_SYSROOT}"
-    ""
-    _is_empty
-)
-if(_is_empty)
-  set(_rpi_error_msg
-    "${_rpi_error_msg}\nRASPBERRYPI_CROSS_COMPILE_SYSROOT environment variable not set. Set it to the sysroot to be used"
-  )
-endif()
-
-string(COMPARE NOTEQUAL
-    "${_rpi_error_msg}"
-    ""
-    _has_errors
-)
-if(_has_errors)
-  polly_fatal_error(
-      "RaspberyPi Toolchain configuration failed:"
-      ${_rpi_error_msg}
-  )
-endif()
-
-set(RAPSBERRYPI2_COMPILE_FLAGS
-    "-mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard"
-    CACHE STRING "RaspberryPi 2 Compile Flags"
-)
-
-# We shouldn't try to hardcore the path, since the cross compiler for the Mac
-# needs to be in a "case-sensitive" file system
-set(CROSS_COMPILE_TOOLCHAIN_PATH
-    "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PATH}"
-    CACHE PATH "RaspberryPi Toolchain Path"
-)
-
-# The prefix is what is known as the cross compiler triplet or quadruplet.
-# ex: arm-unknown-linux-gnueabihf (note: no dash at the end)
-set(CROSS_COMPILE_TOOLCHAIN_PREFIX
-    "$ENV{RASPBERRYPI_CROSS_COMPILE_TOOLCHAIN_PREFIX}"
-    CACHE STRING "RaspberryPi Toolchain Prefix"
-)
-
-# The sysroot for the cross compile
-set(CROSS_COMPILE_SYSROOT
-    "$ENV{RASPBERRYPI_CROSS_COMPILE_SYSROOT}"
-    CACHE PATH "RaspberryPi sysroot"
-)

 include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")
-include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc-cross-compile-raspberry-pi.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi2.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/os/raspberry-pi-hardfloat.cmake")

-polly_add_cache_flag(CMAKE_C_FLAGS ${RAPSBERRYPI2_COMPILE_FLAGS})
-polly_add_cache_flag(CMAKE_CXX_FLAGS ${RAPSBERRYPI2_COMPILE_FLAGS})
-polly_add_cache_flag(CMAKE_SYSTEM_NAME "Linux")
-polly_add_cache_flag(CMAKE_SYSTEM_PROCESSOR "armv7-a")


Fix ordering issue with multiple outputs.

--- build/cmake/core-web-app.cmake
+++ build/cmake/core-web-app.cmake
@@ -1,11 +1,11 @@
 add_custom_command(
-  OUTPUT ${WORK_DIR}/vendor/bundle ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/.bundle/config
+  OUTPUT ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/.bundle/config ${WORK_DIR}/vendor/bundle
   DEPENDS bundler ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/Gemfile ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/Gemfile.lock
   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app
   COMMAND env PATH=${STAGE_EMBEDDED_DIR}/bin:$ENV{PATH} bundle install --clean --path=${WORK_DIR}/vendor/bundle
-  COMMAND touch -c ${WORK_DIR}/vendor/bundle ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/.bundle/config
+  COMMAND touch -c  ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/.bundle/config ${WORK_DIR}/vendor/bundle
 )
-add_custom_target(web_app_bundle_install ALL DEPENDS ${WORK_DIR}/vendor/bundle ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/.bundle/config)
+add_custom_target(web_app_bundle_install ALL DEPENDS ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app/.bundle/config ${WORK_DIR}/vendor/bundle)

 add_custom_command(
   OUTPUT ${WORK_DIR}/tmp/web-app-precompiled-assets


CMAKE: Improve python detection

CMAKE: Improve python detection

--- cmake/OpenCVDetectPython.cmake
+++ cmake/OpenCVDetectPython.cmake
@@ -254,10 +254,12 @@

 if(PYTHON_DEFAULT_EXECUTABLE)
     set(PYTHON_DEFAULT_AVAILABLE "TRUE")
-elseif(PYTHON2INTERP_FOUND) # Use Python 2 as default Python interpreter
+elseif(PYTHON2_EXECUTABLE AND PYTHON2INTERP_FOUND)
+    # Use Python 2 as default Python interpreter
     set(PYTHON_DEFAULT_AVAILABLE "TRUE")
     set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
-elseif(PYTHON3INTERP_FOUND) # Use Python 3 as fallback Python interpreter (if there is no Python 2)
+elseif(PYTHON3_EXECUTABLE AND PYTHON3INTERP_FOUND)
+    # Use Python 3 as fallback Python interpreter (if there is no Python 2)
     set(PYTHON_DEFAULT_AVAILABLE "TRUE")
     set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON3_EXECUTABLE}")
 endif()


[CMake] Adding support for generating libclang_rt.eprintf.a

This library provides eprintf for i386 on OS X versions later than 10.4.

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

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

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

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


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/puffin-buffer/hunter.cmake
+++ cmake/projects/puffin-buffer/hunter.cmake
@@ -14,7 +14,7 @@
     URL
     "https://github.com/designerror/puffin-buffer/archive/v0.3.0.0.tar.gz"
     SHA1
-    db1ffeacffea475c05e4bf7b829ebeba37a6288e
+    cc25f51c7af5f3e27c6c4ca7d58c22239a6ffd68
 )

 hunter_add_version(


update compiler flags

update compiler flags

--- cmake/downloaded/autocmake_GNU.CXX.cmake
+++ cmake/downloaded/autocmake_GNU.CXX.cmake
@@ -1,7 +1,7 @@
 if(NOT DEFINED ENV{CXXFLAGS})
     if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-        set(CMAKE_CXX_FLAGS_RELEASE "-Ofast")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+        set(CMAKE_CXX_FLAGS_RELEASE "-O3")
         set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
     endif()
 endif()


Added automatic building of plugins as static when dynamic build is switch off.

git-svn-id: 23b6355f2bb369032457de4eb5f713ee134f73a8@6741 16af8721-9629-0410-8352-f15c8da7e697

--- CMakeModules/OsgMacroUtils.cmake
+++ CMakeModules/OsgMacroUtils.cmake
@@ -114,8 +114,12 @@
     ENDIF(NOT TARGET_LABEL)

 # here we use the command to generate the library
-
-    ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
+
+    IF   (DYNAMIC_OPENSCENEGRAPH)
+        ADD_LIBRARY(${TARGET_TARGETNAME} MODULE ${TARGET_SRC} ${TARGET_H})
+    ELSE (DYNAMIC_OPENSCENEGRAPH)
+        ADD_LIBRARY(${TARGET_TARGETNAME} STATIC ${TARGET_SRC} ${TARGET_H})
+    ENDIF(DYNAMIC_OPENSCENEGRAPH)

     #not sure if needed, but for plugins only msvc need the d suffix
     IF(NOT MSVC)


fix __PRETTY_FUNCTION__ for compilers that do not understand it

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

--- deal.II/cmake/checks/check_01_compiler_features.cmake
+++ deal.II/cmake/checks/check_01_compiler_features.cmake
@@ -250,9 +250,9 @@
     DEAL_II_COMPILER_HAS_ATTRIBUTE_FUNC)

   IF(DEAL_II_COMPILER_HAS_ATTRIBUTE_FUNC)
-    SET(__PRETTY_FUNCTION__ "__func")
+    SET(__PRETTY_FUNCTION__ "__func__")
   ELSE()
-    SET(__PRETTY_FUNCTION__ "(not available)")
+    SET(__PRETTY_FUNCTION__ "\"(not available)\"")
   ENDIF()

 ENDIF()


X11: use c++11

X11: use c++11

--- src/X11/projectDef.cmake
+++ src/X11/projectDef.cmake
@@ -16,8 +16,7 @@
 SOURCE_GROUP(X11 FILES ${PLATFORM})

 # use this to add preprocessor definitions
-add_definitions(
-)
+add_definitions( -std=c++11 )

 set (SOURCES
     ${SOURCES}


SuperBuild: switch to autoconf on ox. issue with cmake

--- SuperBuild/CMake/External_geotiff.cmake
+++ SuperBuild/CMake/External_geotiff.cmake
@@ -21,25 +21,56 @@
   ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF JPEG_INCLUDE_DIR)
   ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF JPEG_LIBRARY)

-  ExternalProject_Add(GEOTIFF
-    PREFIX GEOTIFF
-    URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
-    URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
-    SOURCE_DIR ${GEOTIFF_SB_SRC}
-    BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
-    INSTALL_DIR ${SB_INSTALL_PREFIX}
-    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-    DEPENDS ${GEOTIFF_DEPENDENCIES}
-    CMAKE_CACHE_ARGS
-    -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-    -DCMAKE_BUILD_TYPE:STRING=Release
-    -DBUILD_SHARED_LIBS:BOOL=ON
-    -DBUILD_TESTING:BOOL=OFF
-    ${GEOTIFF_SB_CONFIG}
-    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
-    )
+  #RK: we are forced to use autoconf on osx due to cmake's find_* functions
+  #Do we need to use the same of Linux ?
+  if(APPLE)
+    set(GEOTIFF_SB_CONFIG)
+    ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF PROJ_ROOT     --with-proj)
+    ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF TIFF_ROOT     --with-libtiff)
+    ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF JPEG_ROOT     --with-jpeg)
+    ADD_SUPERBUILD_CONFIGURE_VAR(GEOTIFF ZLIB_ROOT     --with-libz)

-  SUPERBUILD_PATCH_SOURCE(GEOTIFF "remove-install-name-dir")
+    ExternalProject_Add(GEOTIFF
+      PREFIX GEOTIFF
+      URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
+      URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
+      SOURCE_DIR ${GEOTIFF_SB_SRC}
+      BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
+      INSTALL_DIR ${SB_INSTALL_PREFIX}
+      DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+      DEPENDS ${GEOTIFF_DEPENDENCIES}
+      CONFIGURE_COMMAND
+      ${SB_ENV_CONFIGURE_CMD}
+      ${GEOTIFF_SB_SRC}/configure
+      --prefix=${SB_INSTALL_PREFIX}
+      --enable-static=no
+      ${GEOTIFF_SB_CONFIG}
+      BUILD_COMMAND $(MAKE)
+      INSTALL_COMMAND $(MAKE) install)
+
+    SUPERBUILD_PATCH_SOURCE(GEOTIFF "patch-configure-script")
+
+  else()
+
+    ExternalProject_Add(GEOTIFF
+      PREFIX GEOTIFF
+      URL "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-1.4.1.tar.gz"
+      URL_MD5 48bdf817e6e7a37671cc1f41b01e10fc
+      SOURCE_DIR ${GEOTIFF_SB_SRC}
+      BINARY_DIR ${GEOTIFF_SB_BUILD_DIR}
+      INSTALL_DIR ${SB_INSTALL_PREFIX}
+      DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+      DEPENDS ${GEOTIFF_DEPENDENCIES}
+      CMAKE_CACHE_ARGS
+      -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
+      -DCMAKE_BUILD_TYPE:STRING=Release
+      -DBUILD_SHARED_LIBS:BOOL=ON
+      -DBUILD_TESTING:BOOL=OFF
+      -DPROJ4_OSGEO4W_HOME:PATH=${SB_INSTALL_PREFIX}
+      ${GEOTIFF_SB_CONFIG}
+      CMAKE_COMMAND ${SB_CMAKE_COMMAND}
+      )
+  endif()

   set(_SB_GEOTIFF_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
   if(WIN32)


Extraneous debug output

Extraneous debug output

--- scripts/PythonModule.cmake
+++ scripts/PythonModule.cmake
@@ -151,7 +151,6 @@
     endif()
     add_dependencies(${container_target} ${module_target})
     if(NOT "${${ext}_DEPENDENCIES}" STREQUAL "")
-        message("ADDING TARGET *** ${${ext}_DEPENDENCIES}")
         add_dependencies(${module_target} ${${ext}_DEPENDENCIES})
     endif()

@@ -286,7 +285,6 @@
         set(cmdline
             "${cond}--gdb> ${cond}--gdb-outdir> ${cond}${PROJECT_BINARY_DIR}/cython_debug_files>")
     endif()
-    message(STATUS "c source ${c_source} -- ${arguments} -- ${DEPENDENCIES}")
     add_custom_command(
         OUTPUT "${c_source}"
         COMMAND ${arguments}


Make use of luac optional

Make use of luac optional

--- build/UseLua.cmake
+++ build/UseLua.cmake
@@ -9,6 +9,10 @@
 else()
 	message(FATAL_ERROR "Invalid Lua version")
 endif()
+
+
+set(LUAC "yes" CACHE BOOL "precompile lua files during build")
+

 include_directories(${LUA_INCLUDE_DIR})

@@ -29,25 +33,29 @@

 	set(LUA_COMPILE_COMPILED_FILES)

-	foreach(it ${LUA_COMPILE_FILES})
-		get_filename_component(lua_source_file_path "${it}" ABSOLUTE)
-		get_filename_component(lua_source_file_name "${it}" NAME_WE)
-		set(lua_source_outfile_path "${lua_source_file_name}.bc")
+	if(LUAC)
+		foreach(it ${LUA_COMPILE_FILES})
+			get_filename_component(lua_source_file_path "${it}" ABSOLUTE)
+			get_filename_component(lua_source_file_name "${it}" NAME_WE)
+			set(lua_source_outfile_path "${lua_source_file_name}.bc")

-		add_custom_command(
-			OUTPUT "${lua_source_outfile_path}"
-			COMMAND ${LUA_COMPILER} ${LUA_FLAGS} -o ${lua_source_outfile_path} ${lua_source_file_path}
-			MAIN_DEPENDENCY "${lua_source_file_path}"
-			COMMENT "Building Lua file ${it}"
-			DEPENDS ${LUA_DEPENDENCY}
-			VERBATIM)
+			add_custom_command(
+				OUTPUT "${lua_source_outfile_path}"
+				COMMAND ${LUA_COMPILER} ${LUA_FLAGS} -o ${lua_source_outfile_path} ${lua_source_file_path}
+				MAIN_DEPENDENCY "${lua_source_file_path}"
+				COMMENT "Building Lua file ${it}"
+				DEPENDS ${LUA_DEPENDENCY}
+				VERBATIM)

-		SET_SOURCE_FILES_PROPERTIES("${lua_source_outfile_path}" PROPERTIES GENERATED 1)
-		LIST(APPEND LUA_COMPILE_COMPILED_FILES "${CMAKE_CURRENT_BINARY_DIR}/${lua_source_outfile_path}")
-	endforeach(it)
+			SET_SOURCE_FILES_PROPERTIES("${lua_source_outfile_path}" PROPERTIES GENERATED 1)
+			LIST(APPEND LUA_COMPILE_COMPILED_FILES "${CMAKE_CURRENT_BINARY_DIR}/${lua_source_outfile_path}")
+		endforeach(it)

-	get_directory_property(lua_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
-	set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${lua_extra_clean_files};${LUA_COMPILE_COMPILED_FILES}")
+		get_directory_property(lua_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
+		set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${lua_extra_clean_files};${LUA_COMPILE_COMPILED_FILES}")
+	else()
+		set(LUA_COMPILE_COMPILED_FILES ${LUA_COMPILE_FILES})
+	endif()

 	if(TARGET ${LUA_COMPILE_NAME})
 		get_target_property(ID ${LUA_COMPILE_NAME} LUA_ID)


expat_config.h.cmake: Replace misleading header

--- expat/expat_config.h.cmake
+++ expat/expat_config.h.cmake
@@ -1,4 +1,4 @@
-/* expat_config.h.in.  Generated from configure.in by autoheader.  */
+/* expat_config.h.cmake.  Based upon generated expat_config.h.in.  */

 /* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
 #cmakedefine BYTEORDER @BYTEORDER@


SVN_SILENT made messages (.desktop file)

--- plugins/pintxo/ktpaccountskcm_plugin_pintxo.desktop.cmake
+++ plugins/pintxo/ktpaccountskcm_plugin_pintxo.desktop.cmake
@@ -9,6 +9,7 @@
 Comment[es]=Interfaz de configuración de cuentas personalizadas para las cuentas que usen el gestor de conexiones Pintxo.
 Comment[fi]=Pintxo-yhteyshallintaa käyttävien tilien mukautettu hallintakäyttöliittymä.
 Comment[fr]=Interface utilisateur de configuration de comptes pour les comptes employant le gestionnaire de connexion « Pintxo ».
+Comment[gl]=Interface de usuario de configuración personalizada da conta para contas que empreguen o xestor de conexións Pintxo.
 Comment[hu]=Egyedi beállítófelület a Pintxo kapcsolatkezelőt használó azonosítókhoz.
 Comment[ia]=Interfacie de usator pro configuration de conto personalisate pro contos usante le gerente de connexion Pintxo
 Comment[it]=Interfaccia utente personalizzata di configurazione account per account che usano il gestore di connessioni Pintxo.
@@ -41,6 +42,7 @@
 Name[es]=Interfaz de configuración de cuentas Pintxo
 Name[fi]=Pintxo-tilinmäärityksen käyttöliittymä
 Name[fr]=Interface utilisateur pour la configuration de comptes « Pintxo ».
+Name[gl]=Interface de usuario para a configuración de contas de Pintxo
 Name[hu]=Pintxo azonosítóbeállító felület
 Name[ia]=Interfacie de usator de configuration de conto de Pintxo
 Name[it]=Interfaccia utente di configurazione account Pintxo


Changed Config.cmake to cache BUILD_PLATFORM *after* it has been determined the first time, so it shows up as something other than "unknown" in the cache.

--- cmake/Config.cmake
+++ cmake/Config.cmake
@@ -11,8 +11,7 @@

 include(CheckCXXSourceCompiles)

-# create cache entry
-set(BUILD_PLATFORM "unknown" CACHE STRING "Platform name")
+set(BUILD_PLATFORM "unknown")

 # Multi-threading support
 if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
@@ -59,6 +58,9 @@
 else()
   set(BUILD_PLATFORM "unknown")
 endif()
+
+# create cache entry
+set(BUILD_PLATFORM ${BUILD_PLATFORM} CACHE STRING "Platform name")

 message(STATUS "Build platform: ${BUILD_PLATFORM}")


Slight improvement to the Mac OS X deployment of our plugins (as a result of trying to mimic what is done in Qt Creator).

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -296,13 +296,13 @@

     IF(APPLE)
         ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
-                           COMMAND install_name_tool -id @executable_path/../PlugIns/${MAIN_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
+                           COMMAND install_name_tool -id @rpath/PlugIns/${MAIN_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
                                                          ${MAC_OS_X_PROJECT_BINARY_DIR}/Contents/PlugIns/${MAIN_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})

         FOREACH(OPENCOR_DEPENDENCY ${OPENCOR_DEPENDENCIES})
             ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
                                COMMAND install_name_tool -change ${MAC_OS_X_PROJECT_LIBRARY_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${OPENCOR_DEPENDENCY}${CMAKE_SHARED_LIBRARY_SUFFIX}
-                                                                 @executable_path/../PlugIns/${MAIN_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${OPENCOR_DEPENDENCY}${CMAKE_SHARED_LIBRARY_SUFFIX}
+                                                                 @rpath/PlugIns/${MAIN_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${OPENCOR_DEPENDENCY}${CMAKE_SHARED_LIBRARY_SUFFIX}
                                                                  ${MAC_OS_X_PROJECT_BINARY_DIR}/Contents/PlugIns/${MAIN_PROJECT_NAME}/${CMAKE_SHARED_LIBRARY_PREFIX}${PLUGIN_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
         ENDFOREACH()
     ENDIF()


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -1226,6 +1226,7 @@
         IF(${STATUS_CODE} EQUAL 0)
             EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar -xzf ${REAL_COMPRESSED_FILENAME}
                             WORKING_DIRECTORY ${REAL_DIRNAME} OUTPUT_QUIET)
+
             FILE(REMOVE ${REAL_COMPRESSED_FILENAME})
         ELSE()
             FILE(REMOVE ${REAL_COMPRESSED_FILENAME})