Whitespace tidy

Whitespace tidy

--- Modules/FindTBB.cmake
+++ Modules/FindTBB.cmake
@@ -1,17 +1,17 @@
 # The MIT License (MIT)
 #
 # Copyright (c) 2015 Justus Calvin
-#
+#
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
 # in the Software without restriction, including without limitation the rights
 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 # copies of the Software, and to permit persons to whom the Software is
 # furnished to do so, subject to the following conditions:
-#
+#
 # The above copyright notice and this permission notice shall be included in all
 # copies or substantial portions of the Software.
-#
+#
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -31,16 +31,16 @@
 #  find_package(TBB [major[.minor]] [EXACT]
 #               [QUIET] [REQUIRED]
 #               [[COMPONENTS] [components...]]
-#               [OPTIONAL_COMPONENTS components...])
-#
-# where the allowed components are tbbmalloc and tbb_preview. Users may modify
+#               [OPTIONAL_COMPONENTS components...])
+#
+# where the allowed components are tbbmalloc and tbb_preview. Users may modify
 # the behavior of this module with the following variables:
 #
 # * TBB_ROOT_DIR          - The base directory the of TBB installation.
 # * TBB_INCLUDE_DIR       - The directory that contains the TBB headers files.
 # * TBB_LIBRARY           - The directory that contains the TBB library files.
-# * TBB_<library>_LIBRARY - The path of the TBB the corresponding TBB library.
-#                           These libraries, if specified, override the
+# * TBB_<library>_LIBRARY - The path of the TBB the corresponding TBB library.
+#                           These libraries, if specified, override the
 #                           corresponding library search results, where <library>
 #                           may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug,
 #                           tbb_preview, or tbb_preview_debug.
@@ -50,7 +50,7 @@
 # Users may modify the behavior of this module with the following environment
 # variables:
 #
-# * TBB_INSTALL_DIR
+# * TBB_INSTALL_DIR
 # * TBBROOT
 # * LIBRARY_PATH
 #
@@ -63,15 +63,15 @@
 # * TBB_VERSION           - The full version string
 # * TBB_VERSION_MAJOR     - The major version
 # * TBB_VERSION_MINOR     - The minor version
-# * TBB_INTERFACE_VERSION - The interface version number defined in
+# * TBB_INTERFACE_VERSION - The interface version number defined in
 #                           tbb/tbb_stddef.h.
-# * TBB_<library>_LIBRARY_RELEASE - The path of the TBB release version of
+# * TBB_<library>_LIBRARY_RELEASE - The path of the TBB release version of
 #                           <library>, where <library> may be tbb, tbb_debug,
-#                           tbbmalloc, tbbmalloc_debug, tbb_preview, or
+#                           tbbmalloc, tbbmalloc_debug, tbb_preview, or
 #                           tbb_preview_debug.
-# * TBB_<library>_LIBRARY_DEGUG - The path of the TBB release version of
+# * TBB_<library>_LIBRARY_DEGUG - The path of the TBB release version of
 #                           <library>, where <library> may be tbb, tbb_debug,
-#                           tbbmalloc, tbbmalloc_debug, tbb_preview, or
+#                           tbbmalloc, tbbmalloc_debug, tbb_preview, or
 #                           tbb_preview_debug.
 #
 # The following varibles should be used to build and link with TBB:
@@ -93,11 +93,9 @@
 include(FindPackageHandleStandardArgs)

 if(NOT TBB_FOUND)
-
   ##################################
   # Check the build type
   ##################################
-
   if(NOT DEFINED TBB_USE_DEBUG_BUILD)
     if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug|RelWithDebInfo|RELWITHDEBINFO|relwithdebinfo)")
       set(TBB_BUILD_TYPE DEBUG)
@@ -109,14 +107,13 @@
   else()
     set(TBB_BUILD_TYPE RELEASE)
   endif()
-
+
   ##################################
   # Set the TBB search directories
   ##################################
-
   # Define search paths based on user input and environment variables
   set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT})
-
+
   # Define the search directories based on the current platform
   if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
     set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB"
@@ -148,7 +145,7 @@
   elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
     # OS X
     set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb")
-
+
     # TODO: Check to see which C++ library is being used by the compiler.
     if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0)
       # The default C++ library on OS X 10.9 and later is libc++
@@ -159,7 +156,7 @@
   elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     # Linux
     set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb")
-
+
     # TODO: Check compiler version to see the suffix should be <arch>/gcc4.1 or
     #       <arch>/gcc4.1. For now, assume that the compiler is more recent than
     #       gcc 4.4.x or later.
@@ -169,11 +166,10 @@
       set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4")
     endif()
   endif()
-
+
   ##################################
   # Find the TBB include dir
   ##################################
-
   find_path(TBB_INCLUDE_DIRS tbb/tbb.h
       HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR}
       PATHS ${TBB_DEFAULT_SEARCH_DIR}
@@ -182,7 +178,6 @@
   ##################################
   # Set version strings
   ##################################
-
   if(TBB_INCLUDE_DIRS)
     file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
     string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
@@ -197,7 +192,6 @@
   ##################################
   # Find TBB components
   ##################################
-
   if(TBB_VERSION VERSION_LESS 4.3)
     set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb)
   else()
@@ -207,7 +201,6 @@
   # Find each component
   foreach(_comp ${TBB_SEARCH_COMPOMPONENTS})
     if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")
-
       # Search for the libraries
       find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}
           HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
@@ -222,9 +215,11 @@
       if(TBB_${_comp}_LIBRARY_DEBUG)
         list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}")
       endif()
+
       if(TBB_${_comp}_LIBRARY_RELEASE)
         list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}")
       endif()
+
       if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY)
         set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}")
       endif()
@@ -239,17 +234,15 @@
       mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE)
       mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG)
       mark_as_advanced(TBB_${_comp}_LIBRARY)
-
     endif()
   endforeach()

   ##################################
   # Set compile flags and libraries
   ##################################
-
   set(TBB_DEFINITIONS_RELEASE "")
   set(TBB_DEFINITIONS_DEBUG "-DTBB_USE_DEBUG=1")
-
+
   if(TBB_LIBRARIES_${TBB_BUILD_TYPE})
     set(TBB_DEFINITIONS "${TBB_DEFINITIONS_${TBB_BUILD_TYPE}}")
     set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}")
@@ -261,15 +254,14 @@
     set(TBB_LIBRARIES "${TBB_LIBRARIES_DEBUG}")
   endif()

-  find_package_handle_standard_args(TBB
+  find_package_handle_standard_args(TBB
       REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES
       HANDLE_COMPONENTS
       VERSION_VAR TBB_VERSION)

   ##################################
-  # Create targets
-  ##################################
-
+  # Create Imported targets
+  ##################################
   if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
     add_library(tbb SHARED IMPORTED)
     set_target_properties(tbb PROPERTIES
@@ -299,5 +291,4 @@
   unset(TBB_BUILD_TYPE)
   unset(TBB_LIB_PATH_SUFFIX)
   unset(TBB_DEFAULT_SEARCH_DIR)
-
 endif()


BUG: Setting of the variable EXTENSION_SUPERBUILD_BINARY_DIR to the outer build of the SPHARM-PDM extension

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -273,6 +273,7 @@
     ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
     ${COMMON_EXTERNAL_PROJECT_ARGS}
     -D${LOCAL_PROJECT_NAME}_SUPERBUILD:BOOL=OFF
+    -DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${EXTENSION_NAME}_BINARY_DIR}
     -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/${proj}-install
   )


transitively carry thrift dependencies forward

Summary: eden.thrift includes fb303_core.thrift, so any cmake target that depends on eden.thrift should pull in fb303_core.thrift's include directories and libraries. Implement that machinery in CppThriftLibrary.cmake.

Reviewed By: wez

Differential Revision: D16062657

fbshipit-source-id: d5d962960e767a138a9b634a12aebccf72d6ef43

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -37,7 +37,13 @@
     DIRECTORY
   )

-  list(APPEND GEN_ARGS "include_prefix=${output_dir}")
+  # Generate relative paths in #includes
+  file(RELATIVE_PATH include_prefix ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE})
+  get_filename_component(include_prefix ${include_prefix} DIRECTORY)
+
+  if (NOT "${include_prefix}" STREQUAL "")
+    list(APPEND GEN_ARGS "include_prefix=${include_prefix}")
+  endif()
   # CMake 3.12 is finally getting a list(JOIN) function, but until then
   # treating the list as a string and replacing the semicolons is good enough.
   string(REPLACE ";" "," GEN_ARG_STR "${GEN_ARGS}")
@@ -70,6 +76,24 @@
     )
   endforeach()

+  list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
+  foreach(depends IN LISTS DEPENDS)
+    get_property(thrift_include_directory
+      TARGET ${depends}
+      PROPERTY THRIFT_INCLUDE_DIRECTORY)
+
+    if (thrift_include_directory STREQUAL "")
+      message(STATUS "No thrift dependency found for ${depends}")
+    else()
+      list(APPEND thrift_include_options -I
+        ${thrift_include_directory})
+    endif()
+  endforeach()
+
+  file(
+    GLOB_RECURSE THRIFT_TEMPLATE_FILES
+    FOLLOW_SYMLINKS ${FBTHRIFT_TEMPLATES_DIR}/*.mustache)
+
   # Emit the rule to run the thrift compiler
   add_custom_command(
     OUTPUT
@@ -82,7 +106,7 @@
       --strict
       --templates ${FBTHRIFT_TEMPLATES_DIR}
       --gen "mstch_cpp2:${GEN_ARG_STR}"
-      -I ${CMAKE_SOURCE_DIR}
+      ${thrift_include_options}
       -o ${output_dir}
       ${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}
     WORKING_DIRECTORY
@@ -97,16 +121,18 @@
   add_library(${LIB_NAME} STATIC
     ${generated_sources}
   )
-  set_property(
-    TARGET ${LIB_NAME}
-    PROPERTY PUBLIC_HEADER
-      ${generated_headers}
+
+  install(
+    FILES ${generated_headers}
+    DESTINATION $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/gen-cpp2
   )
+
   target_include_directories(
     ${LIB_NAME}
+    PRIVATE
+      ${CMAKE_SOURCE_DIR}
+      ${CMAKE_BINARY_DIR}
     PUBLIC
-      $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
-      $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
       ${FOLLY_INCLUDE_DIR}
       ${FBTHRIFT_INCLUDE_DIR}
   )
@@ -117,4 +143,15 @@
       FBThrift::thriftcpp2
       Folly::folly
   )
+
+  set_target_properties(
+    ${LIB_NAME}
+    PROPERTIES
+      EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
+      THRIFT_INCLUDE_DIRECTORY ${CMAKE_SOURCE_DIR}
+  )
+
+  get_property(thrift_include_directory
+    TARGET ${LIB_NAME}
+    PROPERTY THRIFT_INCLUDE_DIRECTORY)
 endfunction()


set PKG_CONFIG_LIBDIR in toolchain-mingw32.cmake

--- script/toolchain-mingw32.cmake
+++ script/toolchain-mingw32.cmake
@@ -9,3 +9,5 @@
 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET(ENV{PKG_CONFIG_LIBDIR} ${CMAKE_FIND_ROOT_PATH}/lib/pkgconfig)


Disable inconsistent-missing-destructor-override Warning.

--- cmake/Modules/CppUTestWarningFlags.cmake
+++ cmake/Modules/CppUTestWarningFlags.cmake
@@ -69,6 +69,7 @@
            Wno-c++98-compat
            Wno-c++98-compat-pedantic
            Wno-c++14-compat
+           Wno-inconsistent-missing-destructor-override
            )
     endif (C++11)


Work around bug in clang-3.6 with AVX.

Work around bug in clang-3.6 with AVX.

--- cmake/checks/check_01_cpu_features.cmake
+++ cmake/checks/check_01_cpu_features.cmake
@@ -109,9 +109,32 @@
     "
     DEAL_II_HAVE_SSE2)

+  #
+  # clang-3.6.0 has a bug in operator+ on two VectorizedArray components as
+  # defined in deal.II. Therefore, the test for AVX needs to also test for
+  # operator+ to be correctly implemented.
+  #
   CHECK_CXX_SOURCE_RUNS(
     "
     #include <immintrin.h>
+    class VectorizedArray
+    {
+    public:
+      VectorizedArray &
+      operator += (const VectorizedArray &vec)
+      {
+        data = _mm256_add_pd (data, vec.data);
+        return *this;
+      }
+      __m256d data;
+    };
+    inline
+    VectorizedArray
+    operator + (const VectorizedArray &u, const VectorizedArray &v)
+    {
+      VectorizedArray tmp = u;
+      return tmp+=v;
+    }
     int main()
     {
       __m256d a, b;
@@ -132,6 +155,14 @@
         return_value = 1;
       for (int i=1; i<n_vectors; ++i)
         if (ptr[i] != 5.0625)
+          return_value = 1;
+      VectorizedArray c, d, e;
+      c.data = b;
+      d.data = b;
+      e = c + d;
+      ptr = reinterpret_cast<double*>(&e.data);
+      for (int i=0; i<n_vectors; ++i)
+        if (ptr[i] != 4.5)
           return_value = 1;
       _mm_free (data);
       return return_value;


removed httpget test because it is too undeterministic

--- tests/web/http_get_test.cmake
+++ tests/web/http_get_test.cmake
@@ -1,6 +1,7 @@
 function(test)

-
+  message("Test inconclusive - too undeterministic")
+  return()
   ## fail test
   # http_get("http://notahost.tld")
   # ans(res)


Add lowercase letters to routine REGEX

Add lowercase letters to routine REGEX

Add the set of lowercase letters "a-z" to the regular expression that
captures the routine name in the ReportXINDEXResult function.  This allows
for routines with lower case letters, such as M-Unit, to be reported on
correctly.

OSEHRA-Id: http://issues.osehra.org/browse/OAT-200
Change-Id: I1b5ee93736e9b17bc130e8851f1ac38df0d0e7d9

--- CMake/CommonFunctions.cmake
+++ CMake/CommonFunctions.cmake
@@ -28,8 +28,8 @@
    string(REPLACE "_" " " PACKAGE_NAME ${PACKAGE_NAME})
    foreach (line ${OUTPUT})
       # the XINDEX will always check the integrity of the routine using checksum
-      if(line MATCHES "^[A-Z0-9%][^ ]+ +\\* \\* .*[cC]hecksum:.*")
-        string(REGEX MATCH "^[A-Z0-9%]+[^ ]" routine_name "${line}")
+      if(line MATCHES "^[A-Za-z0-9%][^ ]+ +\\* \\* .*[cC]hecksum:.*")
+        string(REGEX MATCH "^[A-Za-z0-9%]+[^ ]" routine_name "${line}")
       elseif(line MATCHES ${FAILURE_CONDITION})
         # also assume the file name is ${PACKAGE_NAME}.${routinename}
         set(ExceptionFound FALSE)


COMP: Updated ExternalProject.cmake - Find_program(git ..) now looks on known location

That should to find Git on windows

--- CMake/ExternalProject.cmake
+++ CMake/ExternalProject.cmake
@@ -684,7 +684,11 @@
     list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
   elseif(git_repository)
     #find_package(Git)
-    find_program(Git_EXECUTABLE git DOC "git command line client")
+    find_program(Git_EXECUTABLE git
+      PATHS
+        "C:/Program Files/Git/bin"
+        "C:/Program Files (x86)/Git/bin"
+      DOC "git command line client")
     mark_as_advanced(Git_EXECUTABLE)
     if(NOT Git_EXECUTABLE)
       message(FATAL_ERROR "error: could not find git to clone ${name} - Make sure Git_EXECUTABLE is set properly")


BUG: Adjust itk.org ExternalData URL.

BUG: Adjust itk.org ExternalData URL.

The request to https://www.itk.org gives a 301 redirect to https://itk.org.
Use the direct address, which helps some clients.

Change-Id: Ic12f1249634bbd23ded1f17a9ca84582556022ee

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -35,7 +35,7 @@
     "https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"

     # Data published by developers using git-gerrit-push.
-    "https://www.itk.org/files/ExternalData/%(algo)/%(hash)"
+    "https://itk.org/files/ExternalData/%(algo)/%(hash)"

     # Mirror supported by the Slicer community.
     "https://slicer.kitware.com/midas3/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"


add ubuntu library path for library checking path

--- cmake/Modules/FindCppUTest.cmake
+++ cmake/Modules/FindCppUTest.cmake
@@ -33,6 +33,7 @@
           HINTS ${CPPUTEST_DIR}/lib64 ${CPPUTEST_DIR}/lib
                 ${PC_CPPUTEST_LIBRARY_DIRS}
                 /usr/lib64 /usr/lib
+                /usr/lib/x86_64-linux-gnu
                 /usr/lib/powerpc64le-linux-gnu )
 if(CPPUTEST_LIBRARY_DIRS MATCHES "^.*-NOTFOUND")
   set(CPPUTEST_FOUND 0)


Update FindSampGdk3 usage example code

Update FindSampGdk3 usage example code

Should have been done in the previous commit...

--- cmake/Modules/FindSampGdk3.cmake
+++ cmake/Modules/FindSampGdk3.cmake
@@ -18,9 +18,7 @@
 #
 # Using this module:
 #
-#   set(SampGdk3_USE_STATIC_LIB FALSE)
 #   find_package(SampGdk3 VERSION 3.2.1)
-#
 #   if(SampGdk3_FOUND)
 #     include_directories(${SampGdk3_INCLUDE_DIRS})
 #     target_link_libraries(foo ${Sampgdk_LIBRARIES})


Fix automatic detection of available dependencies (#602)

* Fix automatic detection of available dependencies

--- cmake/iDynTreeDependencies.cmake
+++ cmake/iDynTreeDependencies.cmake
@@ -11,9 +11,9 @@
   set(options DO_NOT_SILENTLY_SEARCH)
   set(singleValueArgs MINIMUM_VERSION)
   set(multiValueArgs COMPONENTS)
-  cmake_parse_arguments(IHD "" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})
+  cmake_parse_arguments(IHD "${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})
   string(TOUPPER ${package} PKG)
-  if (IHD_DO_NOT_SILENTLY_SEARCH)
+  if (NOT IHD_DO_NOT_SILENTLY_SEARCH)
     if (IHD_COMPONENTS)
       find_package(${package} ${IHD_MINIMUM_VERSION} QUIET COMPONENTS ${IHD_COMPONENTS})
     else ()


Put precompiled header file in per-configuration directory for MSVC

--- cmake/kl/PrecompileHeaders.cmake
+++ cmake/kl/PrecompileHeaders.cmake
@@ -55,11 +55,20 @@

     if(MSVC)
         set(host_file ${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch.cpp)
-        set(pch_file ${CMAKE_CURRENT_BINARY_DIR}/${_target}_pch.pch)
+        if(CMAKE_CFG_INTDIR STREQUAL ".")
+            set(pch_file ${CMAKE_CURRENT_BINARY_DIR}/${_target}.pch)
+        else()
+            set(pch_file ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.pch)
+        endif()

         file(TO_NATIVE_PATH ${host_file} host_file_native)
         file(TO_NATIVE_PATH ${pch_file} pch_file_native)
         file(TO_NATIVE_PATH ${prefix_file} prefix_file_native)
+
+        # This is required because of some really weird handling
+        # of $(Configuration) in COMPILE_OPTIONS property (but not COMPILE_FLAGS!)
+        # when a option with a path has native slashes.
+        string(REPLACE "$(" "\\$(" pch_file_native ${pch_file_native})

         set(host_file_flags
             "/Yc${prefix_file_native}"


Update FindWiringpi.cmake

Update FindWiringpi.cmake

--- cmake/modules/FindWiringpi.cmake
+++ cmake/modules/FindWiringpi.cmake
@@ -22,7 +22,7 @@
    )

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(wiringPi DEFAULT_MSG WIRINGPI_LIBRARIES WIRINGPI_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Wiringpi DEFAULT_MSG WIRINGPI_LIBRARIES WIRINGPI_INCLUDE_DIR)

 MARK_AS_ADVANCED(WIRINGPI_INCLUDE_DIR WIRINGPI_LIBRARIES)


Oops! Forgot to enable extqt by default now that it builds without issues.

svn path=/trunk/; revision=9857

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -91,8 +91,7 @@
 "pngqt:qt:ON"
 "ppmqt:qt:ON"
 "tiffqt:qt:ON"
-# Default OFF until build error is fixed.
-"extqt:qt:OFF"
+"extqt:qt:ON"
 # Currently does not validate at http://validator.w3.org/, but that appears
 # to be a result of the validator being unfamiliar with SVG-1.2 (a draft
 # SVG standard that has not been finalized yet) which is produced


Removed -lstdc++ for nuttx build

Removed -lstdc++ for nuttx build

Signed-off-by: Mark Charlebois <f1891e7fc976ae1bd489627e2954fb730751d728@gmail.com>

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -441,7 +441,7 @@
 		-nostdlib
 		)

-	set(added_exe_linker_flags -lstdc++) # none currently
+	set(added_exe_linker_flags) # none currently

 	set(cpu_flags)
 	if (${BOARD} STREQUAL "px4fmu-v1")


glib: Add unrelocatable files

glib: Add unrelocatable files

--- cmake/projects/glib/hunter.cmake
+++ cmake/projects/glib/hunter.cmake
@@ -37,7 +37,9 @@
     PACKAGE_NAME glib
     PACKAGE_INTERNAL_DEPS_ID "1"
     PACKAGE_UNRELOCATABLE_TEXT_FILES
+    "bin/glib-gettextize"
     "lib/libgio-2.0.la"
+    "lib/libglib-2.0.la"
     "lib/libgmodule-2.0.la"
     "lib/libgobject-2.0.la"
     "lib/libgthread-2.0.la"


disable -fassociative-math (within -funsafe-math-optimizations)

--- cmake/px4_add_common_flags.cmake
+++ cmake/px4_add_common_flags.cmake
@@ -51,10 +51,16 @@
 		-fdata-sections
 		-ffunction-sections
 		-fomit-frame-pointer
-		-funsafe-math-optimizations
+
+		#-funsafe-math-optimizations # Enables -fno-signed-zeros, -fno-trapping-math, -fassociative-math and -freciprocal-math
+		-fno-signed-zeros	# Allow optimizations for floating-point arithmetic that ignore the signedness of zero
+		-fno-trapping-math	# Compile code assuming that floating-point operations cannot generate user-visible traps
+		#-fassociative-math	# Allow re-association of operands in series of floating-point operations
+		-freciprocal-math	# Allow the reciprocal of a value to be used instead of dividing by the value if this enables optimizations
+
+		-fno-math-errno		# Do not set errno after calling math functions that are executed with a single instruction, e.g., sqrt

 		-fno-strict-aliasing
-		-fno-math-errno

 		# visibility
 		-fvisibility=hidden


Temporarily disable the DCE on main module to make it runnable.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -317,7 +317,7 @@
     cmake_dependent_option (EMSCRIPTEN_ALLOW_MEMORY_GROWTH "Enable memory growing based on application demand when targeting asm.js, it is not set by default due to performance penalty (Emscripten with STATIC or SHARED library type only)" FALSE "NOT EMSCRIPTEN_WASM AND NOT URHO3D_LIB_TYPE STREQUAL MODULE" ${DEFAULT_MEMORY_GROWTH})   # Allow memory growth by default when targeting WebAssembly since there is no performance penalty as in asm.js mode
     math (EXPR EMSCRIPTEN_TOTAL_MEMORY "128 * 1024 * 1024")
     set (EMSCRIPTEN_TOTAL_MEMORY ${EMSCRIPTEN_TOTAL_MEMORY} CACHE STRING "Specify the total size of memory to be used (Emscripten only); default to 128 MB, must be in multiple of 64 KB when targeting WebAssembly and in multiple of 16 MB when targeting asm.js")
-    option (EMSCRIPTEN_SHARE_DATA "Enable sharing data file support (Emscripten only)")
+    cmake_dependent_option (EMSCRIPTEN_SHARE_DATA "Enable sharing data file support (Emscripten only)" FALSE "NOT URHO3D_LIB_TYPE STREQUAL MODULE" TRUE)
 endif ()
 # Constrain the build option values in cmake-gui, if applicable
 set_property (CACHE URHO3D_LIB_TYPE PROPERTY STRINGS STATIC SHARED ${MODULE})
@@ -1003,9 +1003,7 @@
                 # Set the custom EMCC_OPTION property to peload the generated shared data file
                 if (EMSCRIPTEN_SHARE_DATA)
                     set (SHARED_RESOURCE_JS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_PROJECT_NAME}.js)
-                    set (PREFIX_JS ${CMAKE_BINARY_DIR}/Source/pak-loader.js)
-                    list (APPEND SOURCE_FILES ${PREFIX_JS} ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data)
-                    set_source_files_properties (${PREFIX_JS} PROPERTIES GENERATED TRUE EMCC_OPTION pre-js)
+                    list (APPEND SOURCE_FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data)
                     # DEST_BUNDLE_DIR may be empty when macro caller does not wish to install anything
                     if (DEST_BUNDLE_DIR)
                         install (FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
@@ -1614,11 +1612,6 @@
                         set (SELF_EXECUTABLE_SHELL 1)
                         set (HAS_SHELL_FILE 1)
                     endif ()
-                else ()
-                    # If not using EMRUN then we need to include the emrun_prejs.js manually in order to process the request parameters as app's arguments correctly
-                    set (EMRUN_PREJS ${EMSCRIPTEN_ROOT_PATH}/src/emrun_prejs.js)
-                    list (APPEND SOURCE_FILES ${EMRUN_PREJS})
-                    set_source_files_properties (${EMRUN_PREJS} PROPERTIES EMCC_OPTION pre-js)
                 endif ()
             endif ()
         endif ()
@@ -1722,23 +1715,35 @@
     endif ()
     # Extra linker flags for Emscripten
     if (EMSCRIPTEN)
-        if (NOT LIB_TYPE)   # LIB_TYPE is empty for executable target
-            list (APPEND LINK_FLAGS "-s NO_EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY}")
+        # These flags are set only once either in the main module or main executable
+        if ((URHO3D_LIB_TYPE STREQUAL MODULE AND ${TARGET_NAME} STREQUAL Urho3D) OR (NOT URHO3D_LIB_TYPE STREQUAL MODULE AND NOT LIB_TYPE))
+            list (APPEND LINK_FLAGS "-s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY}")
             if (EMSCRIPTEN_ALLOW_MEMORY_GROWTH)
                 list (APPEND LINK_FLAGS "-s ALLOW_MEMORY_GROWTH=1")
             endif ()
+            if (EMSCRIPTEN_SHARE_DATA)      # MODULE lib type always have this variable enabled
+                list (APPEND LINK_FLAGS "--pre-js ${CMAKE_BINARY_DIR}/Source/pak-loader.js")
+            endif ()
+            if (URHO3D_TESTING)
+                list (APPEND LINK_FLAGS --emrun)
+            else ()
+                # If not using EMRUN then we need to include the emrun_prejs.js manually in order to process the request parameters as app's arguments correctly
+                list (APPEND LINK_FLAGS "--pre-js ${EMSCRIPTEN_ROOT_PATH}/src/emrun_prejs.js")
+            endif ()
+        endif ()
+        # These flags are here instead of in the CMAKE_(EXE|MODULE)_LINKER_FLAGS so that they do not interfere with the auto-detection logic during initial configuration
+        if (NOT LIB_TYPE OR LIB_TYPE STREQUAL MODULE)
+            list (APPEND LINK_FLAGS "-s NO_EXIT_RUNTIME=1 -s ERROR_ON_UNDEFINED_SYMBOLS=1")
             if (EMSCRIPTEN_WASM)
                 list (APPEND LINK_FLAGS "-s WASM=1")
-            endif ()
-            if (URHO3D_TESTING)
-                list (APPEND LINK_FLAGS "--emrun")
             endif ()
         endif ()
         # Pass EMCC-specifc setting to differentiate between main and side modules
         if (URHO3D_LIB_TYPE STREQUAL MODULE)
             if (${TARGET_NAME} STREQUAL Urho3D)
-                # Main module has standard libs statically linked with dead code elimination
-                list (APPEND LINK_FLAGS "-s MAIN_MODULE=2")
+                # Main module has standard libs statically linked
+                # TODO: with dead code elimination
+                list (APPEND LINK_FLAGS "-s MAIN_MODULE=1")
             elseif ((NOT ARG_NODEPS AND NOT LIB_TYPE) OR LIB_TYPE STREQUAL MODULE)
                 if (LIB_TYPE)
                     set (SIDE_MODULES ${SIDE_MODULES} ${TARGET_NAME} PARENT_SCOPE)


PolysquareToolingUtil: Quote arguments and use the cl driver

This is required for Windows compatibility (spaces in pathnames
and CMAKE_CXX_FLAGS etc were cl-compatible, not clang-compatible)

--- PolysquareToolingUtil.cmake
+++ PolysquareToolingUtil.cmake
@@ -113,14 +113,18 @@
 function (psq_append_each_to_options_with_prefix MAIN_LIST PREFIX)

     cmake_parse_arguments (APPEND
-                           ""
+                           "WRAP_IN_QUOTES"
                            ""
                            "LIST"
                            ${ARGN})

     foreach (ITEM ${APPEND_LIST})

-        list (APPEND ${MAIN_LIST} ${PREFIX}${ITEM})
+        if (APPEND_WRAP_IN_QUOTES)
+            list (APPEND ${MAIN_LIST} "\\\"${PREFIX}${ITEM}\\\"")
+        else ()
+            list (APPEND ${MAIN_LIST} ${PREFIX}${ITEM})
+        endif ()

     endforeach ()

@@ -646,14 +650,26 @@
         if (LANGUAGE STREQUAL "CXX")

             list (APPEND COMPILER_COMMAND_LINE
-                  ${CMAKE_CXX_COMPILER}
+                  "\\\"${CMAKE_CXX_COMPILER}\\\""
                   -x
                   c++)

+            if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+
+                list (APPEND COMPILER_COMMAND_LINE "--driver-mode=cl")
+
+            endif ()
+
         elseif (LANGUAGE STREQUAL "C")

             list (APPEND COMPILER_COMMAND_LINE
-                  ${CMAKE_C_COMPILER})
+                  "\\\"${CMAKE_C_COMPILER}\\\"")
+
+            if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+
+                list (APPEND COMPILER_COMMAND_LINE "--driver-mode=cl")
+
+            endif ()

         endif ()

@@ -662,23 +678,24 @@
               -o
               "CMakeFiles/${TARGET}.dir/${BASENAME}.o"
               -c
-              "${FULL_PATH}")
+              "\\\"${FULL_PATH}\\\"")

         # All includes
         psq_append_each_to_options_with_prefix (COMPILER_COMMAND_LINE
                                                 -isystem
                                                 LIST
-                                                ${COMPDB_EXTERNAL_INCLUDE_DIRS})
+                                                ${COMPDB_EXTERNAL_INCLUDE_DIRS}
+                                                WRAP_IN_QUOTES)
         psq_append_each_to_options_with_prefix (COMPILER_COMMAND_LINE
                                                 -I
                                                 LIST
-                                                ${COMPDB_INTERNAL_INCLUDE_DIRS})
+                                                ${COMPDB_INTERNAL_INCLUDE_DIRS}
+                                                WRAP_IN_QUOTES)

         # All defines
         psq_append_each_to_options_with_prefix (COMPILER_COMMAND_LINE
                                                 -D
                                                 LIST ${COMPDB_DEFINES})
-

         # CXXFLAGS / CFLAGS
         if (LANGUAGE STREQUAL "CXX")


Fix Collage plugin loading, add pointer CAS

[x] May break build
[ ] May break existing applications (see CHANGES.txt)
[x] Bugfix
[ ] New Feature
[x] Cleanup
[ ] Optimization
[ ] Documentation

--- PurpleAddAmalgamation.cmake
+++ PurpleAddAmalgamation.cmake
@@ -12,10 +12,20 @@

 function(PURPLE_ADD_AMALGAMATION NAME SHORT_NAME VERSION VERSION_ABI)
   purple_expand_libraries(LIBRARIES ${ARGN})
+  string(TOUPPER ${NAME} UPPER_NAME)

   set(THIS_SOURCES)
   set(THIS_LIBRARIES)
-  set(THIS_DEFINITIONS)
+
+  if(MSVC OR XCODE_VERSION)
+    set(THIS_DEFINITIONS ${UPPER_NAME}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+  else()
+    if(APPLE)
+      set(THIS_DEFINITIONS ${UPPER_NAME}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${NAME}.${VERSION_ABI}${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+    else()
+      set(THIS_DEFINITIONS ${UPPER_NAME}_DSO_NAME=\"${CMAKE_SHARED_LIBRARY_PREFIX}${NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}.${VERSION_ABI}\")
+    endif()
+  endif()

   foreach(LIBRARY ${LIBRARIES})
     get_property(SOURCES TARGET ${LIBRARY} PROPERTY SOURCES)


Support additional CMake generator variables in Superbuild

Ensure propagation of generator variables such as the architecture to
the superbuild subprojects.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -237,6 +237,9 @@
   CMAKE_JOB_POOL_COMPILE

   CMAKE_GENERATOR
+  CMAKE_GENERATOR_INSTANCE
+  CMAKE_GENERATOR_PLATFORM
+  CMAKE_GENERATOR_TOOLSET
   CMAKE_EXTRA_GENERATOR
   MEMORYCHECK_COMMAND_OPTIONS
   MEMORYCHECK_SUPPRESSIONS_FILE


Add compiler flag

Add compiler flag

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -97,6 +97,7 @@
   SET(DOWNLOAD_TOOLKITS OFF)
   SET(BUILD_HEADLESS ON)
   SET(BUILD_WITH_PYTHON OFF)
+  ADD_DEFINITIONS(-DTRAVIS_BUILD)
 ENDIF()

 ###########################################


Fixed unnecessary search for boost library, when no benchmarks are build

The boost library is unfortunately necessary for nonius under windows.
When invoking cmake with option: -DBUILD_BENCHMARKS=FALSE the boost library will not be searched anymore.

fixed #93

--- CMake/3rd_party_libs.cmake
+++ CMake/3rd_party_libs.cmake
@@ -34,20 +34,22 @@
 MESSAGE(STATUS "Finding 3rd party libs...")
 MESSAGE(STATUS "===========================")

-if (MSVC)
-    # there is a the moment a problem with finding multiple versions of boost,
-    # i.e. the static AND the static runtime version; that is not possible atm.
-    # Because of that, the benchmarks cannot be build with the static runtime lib option enabled
-    set(Boost_USE_STATIC_LIBS       ON)
-    set(Boost_USE_STATIC_RUNTIME    OFF)
-    set(BOOST_ALL_DYN_LINK          OFF)
+if (BUILD_BENCHMARKS)
+    if (MSVC)
+        # there is a the moment a problem with finding multiple versions of boost,
+        # i.e. the static AND the static runtime version; that is not possible atm.
+        # Because of that, the benchmarks cannot be build with the static runtime lib option enabled
+        set(Boost_USE_STATIC_LIBS       ON)
+        set(Boost_USE_STATIC_RUNTIME    OFF)
+        set(BOOST_ALL_DYN_LINK          OFF)

-    find_package(Boost COMPONENTS chrono system)
-else()
-    find_package(Boost)
+        find_package(Boost COMPONENTS chrono system)
+    else()
+        find_package(Boost)
+    endif()
+
+    find_package(Threads REQUIRED)
 endif()
-
-find_package(Threads REQUIRED)

 set(RAPID_JSON_DIR ${RTTR_3RD_PARTY_DIR}/rapidjson-1.1.0)
 set(CATCH_DIR ${RTTR_3RD_PARTY_DIR}/catch-1.8.2)


cmake: find gslcblas

cmake: find gslcblas

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -24,14 +24,15 @@
 find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h HINTS ${PC_GSL_INCLUDE_DIRS})

 find_library(GSL_LIBRARY NAMES gsl HINTS ${PC_GSL_LIBRARY_DIRS} )
-
-set(GSL_LIBRARIES ${GSL_LIBRARY} )
-set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )
+find_library(GSL_CBLAS_LIBRARY NAMES gslcblas HINTS ${PC_GSL_LIBRARY_DIRS} )

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE
 # if all listed variables are TRUE
+find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR )
+find_package_handle_standard_args(GSL DEFAULT_MSG GSL_CBLAS_LIBRARY GSL_INCLUDE_DIR )

-find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR )
+set(GSL_LIBRARIES "${GSL_LIBRARY};${GSL_CBLAS_LIBRARY}" )
+set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )

-mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY )
+mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY GSL_CBLAS_LIBRARY)


FindMKL.cmake: don't use C explicitly

FindMKL.cmake: don't use C explicitly

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -67,7 +67,7 @@
 find_package(OpenMP QUIET)

 check_type_size("int" INT_SIZE
-  BUILTIN_TYPES_ONLY LANGUAGE C)
+  BUILTIN_TYPES_ONLY LANGUAGE CXX)

 set(MKL_THREAD_LAYER "TBB" CACHE STRING "The thread layer to choose for MKL")
 set_property(CACHE MKL_THREAD_LAYER PROPERTY STRINGS "TBB" "GNU OpenMP" "Intel OpenMP" "Sequential")


update findovr script

update findovr script

--- CMakeModules/FindOVR.cmake
+++ CMakeModules/FindOVR.cmake
@@ -1,14 +1,25 @@
 include(FindPackageHandleStandardArgs)

 # Rekhi Linux lab
-set(CMAKE_LIBRARY_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.4.4/LibOVR/Lib/Linux/Release/x86_64" ${CMAKE_LIBRARY_PATH})
-set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.4.4/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
-set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.4.4/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
-# Installed in this directory's parent directory (paths lower will be search first)
+#set(CMAKE_LIBRARY_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.4.4/LibOVR/Lib/Linux/Release/x86_64" ${CMAKE_LIBRARY_PATH})
+#set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.4.4/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
+#set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.4.4/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
+set(CMAKE_LIBRARY_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Debug" ${CMAKE_LIBRARY_PATH})
+set(CMAKE_LIBRARY_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Release" ${CMAKE_LIBRARY_PATH})
+set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
+set(CMAKE_INCLUDE_PATH "/home/campus11/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
+
+# Kuhl's machines
+set(CMAKE_LIBRARY_PATH "/home/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Debug" ${CMAKE_LIBRARY_PATH})
+set(CMAKE_LIBRARY_PATH "/home/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Release" ${CMAKE_LIBRARY_PATH})
+set(CMAKE_INCLUDE_PATH "/home/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
+set(CMAKE_INCLUDE_PATH "/home/kuhl/public-ogl/ovr_sdk_linux_0.5.0.1/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
+
+
+# Allow folder to be stored alongside the opengl-examples folder.
 #set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Lib/Linux/Release/x86_64" ${CMAKE_LIBRARY_PATH})
 #set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
 #set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.4.4/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
-
 set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Debug" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Lib/Linux/x86_64/Release" ${CMAKE_LIBRARY_PATH})
 set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../ovr_sdk_linux_0.5.0.1/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
@@ -16,13 +27,8 @@

-# An alternative directory name that OVR could be installed in (same style as: https://github.com/jherico/OculusSDK )
-set(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../OculusSDK/LibOVR/Lib/Linux/Release/x86_64" ${CMAKE_LIBRARY_PATH})
-set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../OculusSDK/LibOVR/Include" ${CMAKE_INCLUDE_PATH})
-set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../OculusSDK/LibOVR/Src" ${CMAKE_INCLUDE_PATH})
-
-
 # library was named libovr.a in 0.4.4 and libOVR.a in 0.5.0.1
+set(CMAKE_LIBRARY_PATH "/usr/lib64" ${CMAKE_LIBRARY_PATH})
 find_library(OVR_LIBRARIES libOVR.a libovr.a)
 find_library(OVR_LIBRARY_SO libOVRRT64_0.so.5)
 find_path(OVR_INCLUDE_DIR_LIB OVR.h)


update gpu compute archs for cuda11 (#27039)

--- cmake/cuda.cmake
+++ cmake/cuda.cmake
@@ -16,6 +16,7 @@
   set(paddle_known_gpu_archs8 "30 35 50 52 60 61")
   set(paddle_known_gpu_archs9 "30 35 50 52 60 61 70")
   set(paddle_known_gpu_archs10 "30 35 50 52 60 61 70 75")
+  set(paddle_known_gpu_archs11 "35 50 52 60 61 70 75 80")
 endif()

 ######################################################################################
@@ -188,6 +189,10 @@
   set(paddle_known_gpu_archs ${paddle_known_gpu_archs10})
   set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -D_MWAITXINTRIN_H_INCLUDED")
   set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -D__STRICT_ANSI__")
+elseif (${CMAKE_CUDA_COMPILER_VERSION} LESS 12.0) # CUDA 11.x
+  set(paddle_known_gpu_archs ${paddle_known_gpu_archs11})
+  set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -D_MWAITXINTRIN_H_INCLUDED")
+  set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -D__STRICT_ANSI__")
 endif()

 add_definitions("-DPADDLE_CUDA_BINVER=\"${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}\"")


Add link to docs

Add link to docs

[skip ci]

--- os/android.cmake
+++ os/android.cmake
@@ -32,7 +32,10 @@
 set(CMAKE_SYSTEM_NAME "Android")

 if(CMAKE_VERSION VERSION_LESS 3.7.1)
-  polly_fatal_error("Minimum CMake version for Android is 3.7.1")
+  polly_fatal_error(
+      "Minimum CMake version for Android is 3.7.1:"
+      "* http://polly.readthedocs.io/en/latest/toolchains/android.html#android-ndk-x-api-y"
+  )
 endif()

 macro(find_host_program)


Revert "Remove git based support for testing examples" (#170)

This reverts commit 7312c58361fc8e707eeea4de6c18c7d1b404d866.

--- examples/common.cmake
+++ examples/common.cmake
@@ -1,7 +1,7 @@
-# Copyright (c) 2013, 2015, 2019 Ruslan Baratov
+# Copyright (c) 2013, 2015 Ruslan Baratov
 # All rights reserved.

-cmake_minimum_required(VERSION 3.2)
+cmake_minimum_required(VERSION 3.0)

 ### Include HunterGate module from git submodule
 set(gate_dir "${CMAKE_CURRENT_LIST_DIR}/../gate")
@@ -18,27 +18,17 @@
 message("Including HunterGate: ${gate_module}")
 include("${gate_module}")

-set(
-    error_message
-    "Are you using jenkins.py script for testing?
-    Please check:
-    - https://hunter.readthedocs.io/en/latest/creating-new/create/cmake.html#testing-locally"
-)
+### Check testing variables are set
+string(COMPARE EQUAL "${TESTING_URL}" "" url_is_empty)
+string(COMPARE EQUAL "${TESTING_SHA1}" "" sha1_is_empty)
+string(COMPARE EQUAL "${HUNTER_ROOT}" "" hunter_root_is_empty)

-### Check testing variables are set
-if("${TESTING_URL}" STREQUAL "")
-  message(FATAL_ERROR "TESTING_URL is empty. ${error_message}")
+if(NOT url_is_empty AND NOT sha1_is_empty AND NOT hunter_root_is_empty)
+  get_filename_component(TESTING_URL "${TESTING_URL}" ABSOLUTE)
+
+  ### HunterGate module
+  HunterGate(URL "${TESTING_URL}" SHA1 "${TESTING_SHA1}" ${TESTING_CONFIG_OPT})
+else()
+  get_filename_component(HUNTER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
+  HunterGate(URL "x" SHA1 "xxxxxxxx" ${TESTING_CONFIG_OPT})
 endif()
-
-if("${TESTING_SHA1}" STREQUAL "")
-  message(FATAL_ERROR "TESTING_SHA1 is empty. ${error_message}")
-endif()
-
-if("${HUNTER_ROOT}" STREQUAL "")
-  message(FATAL_ERROR "HUNTER_ROOT is empty. ${error_message}")
-endif()
-
-get_filename_component(TESTING_URL "${TESTING_URL}" ABSOLUTE)
-
-### HunterGate module
-HunterGate(URL "${TESTING_URL}" SHA1 "${TESTING_SHA1}" ${TESTING_CONFIG_OPT})


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -15,6 +15,7 @@
 Name[it]=Messaggistica istantanea
 Name[kk]=Лезде хабарласу
 Name[ko]=인스턴트 메시지
+Name[lt]=Tikralaikiai pokalbiai
 Name[nb]=Lynmelding
 Name[nl]=Instant Messaging
 Name[pl]=Komunikator internetowy
@@ -51,6 +52,7 @@
 Comment[it]=Avvia una chat con un tuo contatto di MI oppure cambia il tuo stato di MI
 Comment[kk]=Кез-келген лезде хабарласу контактыңызбен чат-әңгімені бастау не күй-жайын өзгерту
 Comment[ko]=IM 대화 상대와 대화를 시작하거나 상태 바꾸기
+Comment[lt]=Pradėti pokalbį su bet kuriuo TP kontaktu arba pakeiskite savo TP būseną
 Comment[nb]=Start en prat med en av dine LM-kontakter eller endre din LM-status
 Comment[nl]=Begin een chat met een van uw IM-contactpersonen of wijzig uw IM-status
 Comment[pl]=Rozpocznij rozmowę z którymkolwiek z twoich kontaktów lub zmień swoja dostępność


DOC: Sphinx examples update to 2016-05-22.

Change-Id: I83100438074841a51551d35b7edaea3259b5f58c

--- Modules/Remote/SphinxExamples.remote.cmake
+++ Modules/Remote/SphinxExamples.remote.cmake
@@ -2,6 +2,6 @@
 itk_fetch_module(SphinxExamples
   "This module builds the examples found at https://itk.org/ITKExamples/"
   GIT_REPOSITORY https://itk.org/ITKExamples.git
-  # 2016-01-27
-  GIT_TAG 3dfb50ce56c79cbc3f889d402ce1a920c1663a0f
+  # 2016-05-22
+  GIT_TAG a05239867960130d89b61ad302c6df27ae400e70
   )


CTest: Make sure $CXX invocation doesn't quote spaces

This enables flags in $CXX but breaks spaces in paths to the compiler

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

--- test.cmake
+++ test.cmake
@@ -192,7 +192,8 @@
    endif()
 endmacro()
 macro(extract_gnuc_compiler_info CXX)
-   execute_process(COMMAND "${CXX}" --version OUTPUT_VARIABLE COMPILER_VERSION_COMPLETE ERROR_VARIABLE COMPILER_VERSION_COMPLETE OUTPUT_STRIP_TRAILING_WHITESPACE)
+   string(REPLACE " " ";" CXX_AS_LIST "${CXX}")
+   execute_process(COMMAND ${CXX_AS_LIST} --version OUTPUT_VARIABLE COMPILER_VERSION_COMPLETE ERROR_VARIABLE COMPILER_VERSION_COMPLETE OUTPUT_STRIP_TRAILING_WHITESPACE)
    string(REPLACE "\n" ";" COMPILER_VERSION "${COMPILER_VERSION_COMPLETE}")
    list(GET COMPILER_VERSION 0 COMPILER_VERSION)
    string(REPLACE "Open64 Compiler Suite: Version" "Open64" COMPILER_VERSION "${COMPILER_VERSION}")


updating ctest drop site

updating ctest drop site

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

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "swr-ivb-lnx-01")
+#set(CTEST_DROP_SITE "swr-ivb-lnx-01")
+set(CTEST_DROP_SITE "10.123.110.91")
 set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Embree")
 set(CTEST_DROP_SITE_CDASH TRUE)
+


enabled zero derivative hair test

enabled zero derivative hair test

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -16,7 +16,7 @@

 set(CTEST_PROJECT_NAME "Embree")
 set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
-set(TEST_MODELS_HASH b3f2d0ad821c54cfc5e55fa44a91a1d3dbef6d51)
+set(TEST_MODELS_HASH e7b75aa232b17d1009355804ff82c3c950da1a00)

 IF (NOT CTEST_DROP_SITE)
   set(CTEST_DROP_METHOD "http")


Allow override of pre- & post install step

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -64,7 +64,7 @@
   execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -si
     OUTPUT_VARIABLE LSB_DISTRIBUTOR_ID OUTPUT_STRIP_TRAILING_WHITESPACE)

-  message(STATUS "LSB-Release system information:: Distributor-ID: "
+  message(STATUS "LSB-Release system information: Distributor-ID: "
     "${LSB_DISTRIBUTOR_ID}  Release: ${LSB_RELEASE}  Codename: ${LSB_CODENAME}")
 endif()
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
@@ -96,7 +96,9 @@
   set(CPACK_RPM_PACKAGE_LICENSE "LGPL")
   set(CPACK_RPM_PACKAGE_RELEASE ${${UPPER_PROJECT_NAME}_PACKAGE_VERSION})
   set(CPACK_RPM_PACKAGE_VERSION ${VERSION})
-  set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/CMake/rpmPostInstall.sh")
+  if(NOT CPACK_RPM_POST_INSTALL_SCRIPT_FILE)
+    set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_SOURCE_DIR}/CMake/rpmPostInstall.sh")
+  endif()
 else()
   if(${UPPER_PROJECT_NAME}_PACKAGE_VERSION)
     set(CPACK_PACKAGE_VERSION_PATCH
@@ -106,7 +108,9 @@
   if(CPACK_GENERATOR STREQUAL "DEB")
     # dpkg requires lowercase package names
     string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-    set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "/sbin/ldconfig")
+    if(NOT CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA)
+      set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "/sbin/ldconfig")
+    endif()

     if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
       set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")


Little change in cmake scripts

Little change in cmake scripts

--- cmake/dev/eprosima_libraries.cmake
+++ cmake/dev/eprosima_libraries.cmake
@@ -96,7 +96,7 @@

         find_package(${package} QUIET)

-        if(fastcdr_FOUND)
+        if(${package}_FOUND)
             message(STATUS "${package} library found...")
         else()
             message(STATUS "${package} library not found...")


Fix cmake config scripts to support several helper libs

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -448,10 +448,10 @@
                     )
                 endforeach ()
             endif ()
-            get_target_property(OriginalLib "${ARGS_HELPER_LIBS}" ALIASED_TARGET)
+            get_target_property(OriginalLib "${helperLib}" ALIASED_TARGET)
             if (${OriginalLib} STREQUAL "OriginalLib-NOTFOUND")
                 #                message(STATUS "The name ${ARGS_HELPER_LIBS} is a REAL target.")
-                set(OriginalLib ${ARGS_HELPER_LIBS})
+                set(OriginalLib ${helperLib})
             endif ()
             message(STATUS "Installing ${OriginalLib}")
             get_target_property(IsImported "${OriginalLib}" IMPORTED)


bump CIL tag (#595)

bump CIL tag (#595)

bump CIL tag

[ci skip]

--- version_config.cmake
+++ version_config.cmake
@@ -149,7 +149,7 @@

 # CCPi CIL
 set(DEFAULT_CIL_URL https://github.com/TomographicImaging/CIL.git)
-set(DEFAULT_CIL_TAG "ca12ef252e68eaa7a3cccd19250e5481f02bcfd2")
+set(DEFAULT_CIL_TAG "b81326291c6061d57fa332a248cb9d15d9f957eb")
 set(DEFAULT_CIL-ASTRA_URL https://github.com/TomographicImaging/CIL-ASTRA.git)
 set(DEFAULT_CIL-ASTRA_TAG "v21.2.0")
 set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git)


added: support for explicitely building static libs

--- share/hugh/cmake/functions/cma_setup_library.cmake
+++ share/hugh/cmake/functions/cma_setup_library.cmake
@@ -7,13 +7,14 @@
 ####################################################################################################

 # .rst:
-# cma_setup_library(NAME SOURCES .. [DEPENDENCIES ..] [INCDIR <string>] [PREFIX <string>] [WINRT]
-#                   [NOINSTALL] [DEBUG])
+# cma_setup_library(NAME SOURCES .. [DEPENDENCIES ..] [INCDIR <string>] [PREFIX <string>] [STATIC]
+#                   [WINRT] [NOINSTALL] [DEBUG])
 #   NAME         -
 #   SOURCES      -
 #   DEPENDENCIES -
 #   INCDIR       -
 #   PREFIX       -
+#   STATIC       -
 #   WINRT        -
 #   NOINSTALL    -
 #   DEBUG        -
@@ -22,7 +23,7 @@
   include(CMakeParseArguments)
   include(functions/cma_utilities)

-  set(OARGS WINRT NOINSTALL DEBUG)
+  set(OARGS STATIC WINRT NOINSTALL DEBUG)
   set(SARGS INCDIR PREFIX)
   set(MARGS SOURCES DEPENDENCIES)
   cmake_parse_arguments(LIB "${OARGS}" "${SARGS}" "${MARGS}" ${ARGN})
@@ -74,7 +75,13 @@
       "   LIB_INCDIR_INSTALL = ${LIB_INCDIR_INSTALL}")
   endif()

-  add_library(${LIB_NAME} ${CMAKE_LIBRARY_TYPE} ${LIB_SOURCES})
+  set(LIB_TYPE ${CMAKE_LIBRARY_TYPE})
+
+  if(LIB_STATIC)
+    set(LIB_TYPE STATIC)
+  endif()
+
+  add_library(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES})

   if(LIB_WINRT)
     cma_add_winrt_props(${LIB_NAME})
@@ -91,7 +98,7 @@
   if(NOT LIB_NOINSTALL)
     # 1. ARCHIVE|LIBRARY not pre-processed -> cannot be held in variable
     # 2. shared libs ARCHIVE section is for import lib files from .dlls
-    if("SHARED" STREQUAL "${CMAKE_LIBRARY_TYPE}")
+    if("xSHARED" STREQUAL "x${LIB_TYPE}")
       install(TARGETS             ${LIB_NAME}
               ARCHIVE DESTINATION ${${PROJECT_NAME}_LIBRARY_DIRECTORY}
               LIBRARY DESTINATION ${${PROJECT_NAME}_LIBRARY_DIRECTORY}


include external directory

include external directory

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

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -443,6 +443,9 @@
 #  * CUDA

 macro (seqan_find_dependencies)
+  # Register external include directory.
+  include_directories(${SEQAN_ROOT_SOURCE_DIR}/external/include)
+
   find_package (ZLIB QUIET)
   if (ZLIB_FOUND)
     add_definitions(-DSEQAN_HAS_ZLIB=1)
@@ -460,7 +463,7 @@
   find_package (TR1)
   find_package (Boost)
   if (Boost_FOUND)
-    include_directories(${Boost_INCLUDE_DIRS})
+    #    include_directories(${Boost_INCLUDE_DIRS})
   endif (Boost_FOUND)

   if (CUDA_FOUND)


[build] add Broadwell identification for enabling additional compilation flags (#908)

--- src/cmakeFindModules/OptimizeForArchitecture.cmake
+++ src/cmakeFindModules/OptimizeForArchitecture.cmake
@@ -41,7 +41,9 @@
    if(_vendor_id STREQUAL "GenuineIntel")
       if(_cpu_family EQUAL 6)
          # Any recent Intel CPU except NetBurst
-         if(_cpu_model EQUAL 70) #intel haswell
+         if(_cpu_model EQUAL 79)
+            set(TARGET_ARCHITECTURE "broadwell")
+         elseif(_cpu_model EQUAL 70) #intel haswell
             set(TARGET_ARCHITECTURE "haswell")
          elseif(_cpu_model EQUAL 69) # Core i5/i7-4xxxU CPUs
             set(TARGET_ARCHITECTURE "haswell")
@@ -120,7 +122,7 @@
 endmacro()

 macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
+   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"broadwell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -186,6 +188,13 @@
       list(APPEND _march_flag_list "corei7-avx")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma")
+   elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
+      list(APPEND _march_flag_list "broadwell")
+      list(APPEND _march_flag_list "core-avx2")
+      list(APPEND _march_flag_list "core-avx-i")
+      list(APPEND _march_flag_list "corei7-avx")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma" "bmi" "bmi2")
    elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
       list(APPEND _march_flag_list "core-avx-i")
       list(APPEND _march_flag_list "corei7-avx")


arc: mdb-nsim runner: launch cores according CONFIG_MP_NUM_CPUS

nsim_hs_smp has 2 cores, and CONFIG_MP_NUM_CPUS defalut value is 2.
But some tests will have extra config: CONFIG_MP_NUM_CPUS=1, so we
need to launch cores according CONFIG_MP_NUM_CPUS, not using a fix
number 2.

Signed-off-by: Watson Zeng <bb6a45ebfbb8932a11537002b062f5218879c562@synopsys.com>

--- boards/arc/nsim/board.cmake
+++ boards/arc/nsim/board.cmake
@@ -19,7 +19,7 @@
 board_runner_args(arc-nsim "--props=nsim_hs.props")
 board_runner_args(mdb-nsim "--nsim_args=mdb_hs.args")
 elseif(${CONFIG_SOC_NSIM_HS_SMP})
-board_runner_args(mdb-nsim "--cores=2" "--nsim_args=mdb_hs_smp.args")
+board_runner_args(mdb-nsim "--cores=${CONFIG_MP_NUM_CPUS}" "--nsim_args=mdb_hs_smp.args")
 endif()

 board_finalize_runner_args(arc-nsim)


[builder]: fix [make_library] linker options

 -  [make_library] produces incorrect linker flags for STATIC library.
    Linker error is '/usr/bin/ld: group ended before it began'.
    RC is [make_library] adds "-Xlinker --start-group" only for SHARED
    target but puts "-Xlinker --end-group" for any variant.

Issue: https://github.com/Intel-Media-SDK/MediaSDK/issues/531
Test: compilation

--- builder/FindFunctions.cmake
+++ builder/FindFunctions.cmake
@@ -207,6 +207,10 @@
       target_link_libraries( ${target} ${lib} )
     endforeach()

+    if( Linux )
+      target_link_libraries( ${target} "-Xlinker --end-group" )
+    endif()
+
 #    set_target_properties( ${target} PROPERTIES LINK_INTERFACE_LIBRARIES "" )
   endif()

@@ -224,7 +228,7 @@
   set_target_properties( ${target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_LIB_DIR}/${CMAKE_BUILD_TYPE} FOLDER ${folder} )

   if( Linux )
-    target_link_libraries( ${target} "-Xlinker --end-group -lgcc" )
+    target_link_libraries( ${target} "-lgcc" )
   endif()

   set( target ${target} PARENT_SCOPE )


Temporarily revert LLVM 14 support for release 1.8 branch

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -39,7 +39,6 @@
     NAMES
       "llvmtce-config"
       "llvm-config"
-      "llvm-config-mp-14.0" "llvm-config-14" "llvm-config140"
       "llvm-config-mp-13.0" "llvm-config-13" "llvm-config130"
       "llvm-config-mp-12.0" "llvm-config-12" "llvm-config120"
       "llvm-config-mp-11.0" "llvm-config-11" "llvm-config110"
@@ -206,11 +205,8 @@
 elseif(LLVM_VERSION MATCHES "^13[.]")
   set(LLVM_MAJOR 13)
   set(LLVM_13_0 1)
-elseif(LLVM_VERSION MATCHES "^14[.]")
-  set(LLVM_MAJOR 14)
-  set(LLVM_14_0 1)
 else()
-  message(FATAL_ERROR "LLVM version between 6.0 and 14.0 required, found: ${LLVM_VERSION}")
+  message(FATAL_ERROR "LLVM version between 6.0 and 13.0 required, found: ${LLVM_VERSION}")
 endif()

 #############################################################


adding libSimField.a to FindSimModSuite.cmake

--- cmake/FindSimModSuite.cmake
+++ cmake/FindSimModSuite.cmake
@@ -35,6 +35,7 @@

 set(SIMMODSUITE_LIBS "")
 set(SIM_LIB_NAMES
+  SimField
   SimPartitionedMesh-mpi
   SimMeshing
   SimMeshTools


CUDA can run under Xcode clang (but only one specific version)

--- cmake/PVConfigProject.cmake
+++ cmake/PVConfigProject.cmake
@@ -102,9 +102,8 @@
       # to Xcode version numbers
       set(COMPILER_DETECTED ON)
       set(XCODE_COMPILER_DETECTED ON)
-      message(STATUS "Xcode clang compiler detected. No OpenMP or CUDA support.")
+      message(STATUS "Xcode clang compiler detected. No OpenMP support.")
       set(PV_USE_OPENMP OFF CACHE BOOL "${PV_USE_OPENMP_HELP}")
-      set(PV_USE_CUDA OFF CACHE BOOL "${PV_USE_CUDA_HELP}")
     else()
       # Open source clang detected
       set(COMPILER_DETECTED ON)
@@ -217,9 +216,6 @@
   if (PV_USE_CUDA)
     if(INTEL_COMPILER_DETECTED)
       message(WARNING "-- CUDA cannot be used with the Intel compiler. Disabling CUDA build")
-      set(PV_USE_CUDA OFF)
-    elseif(XCODE_COMPILER_DETECTED)
-      message(WARNING "-- CUDA cannot be used with the default Xcode compiler. Disabling CUDA build")
       set(PV_USE_CUDA OFF)
     else()
       set(CUDNN_PATH ${CUDNN_PATH_HINT} CACHE PATH "${PV_CUDNN_PATH_HELP}")


Add some fixes for Linux ThirdParty compilation

--- cmake/ThirdPartyPETSc.cmake
+++ cmake/ThirdPartyPETSc.cmake
@@ -33,6 +33,9 @@
             CONFIGURE_COMMAND ./configure
                 --with-cc=${PETSC_C_COMPILER}
                 --with-cxx=${PETSC_CXX_COMPILER}
+                --with-shared-libraries=0
+                --with-pic=1
+                --with-x=0
                 --prefix=${TPSRC}/dist
                 --with-petsc-arch=c-opt
                 --with-fc=0
@@ -41,7 +44,7 @@

         INCLUDE_DIRECTORIES(${TPSRC}/dist/include)
         SET(PETSC_LIBRARIES "${TPSRC}/dist/lib/libpetsc.a")
-        MESSAGE(STATUS "Will build PETSc")
+        MESSAGE(STATUS "Build PETSc: ${PETSC_LIBRARIES}")
     ELSE (THIRDPARTY_BUILD_PETSC)
         INCLUDE(FindPETSc)
         IF (NOT PETSC_FOUND)


cmake: XercesFunctions: Remove duplicated timegm check

git-svn-id: 3ec853389310512053d525963cab269c063bb453@1840340 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/XercesFunctions.cmake
+++ cmake/XercesFunctions.cmake
@@ -32,7 +32,6 @@
 check_function_exists(ftime HAVE_FTIME)
 check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
 check_function_exists(gmtime_r HAVE_GMTIME_R)
-check_function_exists(timegm HAVE_TIMEGM)
 check_function_exists(memmove HAVE_MEMMOVE)
 check_function_exists(memset HAVE_MEMSET)
 check_function_exists(nl_langinfo HAVE_NL_LANGINFO)


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -24,7 +24,7 @@

 # NOTE: no names with spaces!

-hunter_config(vmime VERSION 0.9.2.1)
+hunter_config(vmime VERSION 0.9.2.2)
 hunter_config(gloox VERSION 1.0.20-p5)
 hunter_config(wdc VERSION 1.0.1-hunter-p1)
 hunter_config(pugixml VERSION 1.8.1)


- using 3 digits number for qt version dependency.

--- cmake/dtkDependencies.cmake
+++ cmake/dtkDependencies.cmake
@@ -32,7 +32,7 @@
   set(QT_USE_QTMAIN TRUE)
 endif(WIN32)

-find_package(Qt4 4.6 REQUIRED)
+find_package(Qt4 4.6.0 REQUIRED)
 include(${QT_USE_FILE})

 mark_as_advanced(QT_QMAKE_EXECUTABLE)


Fix ngraph build on Redhat Linux

Fix ngraph build on Redhat Linux

--- cmake/external/ngraph.cmake
+++ cmake/external/ngraph.cmake
@@ -6,7 +6,7 @@
 set(ngraph_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/external/ngraph)
 set(ngraph_INSTALL_DIR ${ngraph_ROOT_DIR})
 set(ngraph_INCLUDE_DIRS ${ngraph_INSTALL_DIR}/include)
-set(ngraph_LIBRARIES ${ngraph_INSTALL_DIR}/lib)
+set(ngraph_LIBRARIES ${ngraph_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR})
 set(ngraph_SRC ${CMAKE_CURRENT_BINARY_DIR}/ngraph/src/project_ngraph)
 set(prebuilt_ONNX_SOURCE_DIR "${PROJECT_SOURCE_DIR}/external/onnx")
 set(prebuilt_ONNX_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/onnx")


fix lib64 test=develop

fix lib64 test=develop

--- cmake/external/ngraph.cmake
+++ cmake/external/ngraph.cmake
@@ -69,7 +69,7 @@
     CMAKE_ARGS          -DNGRAPH_DEX_ONLY=TRUE
     CMAKE_ARGS          -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
     CMAKE_ARGS          -DMKLDNN_INCLUDE_DIR=${MKLDNN_INC_DIR}
-    CMAKE_ARGS          -DMKLDNN_LIB_DIR=${MKLDNN_INSTALL_DIR}/lib
+    CMAKE_ARGS          -DMKLDNN_LIB_DIR=${MKLDNN_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}
     CMAKE_ARGS          -DMKLML_LIB_DIR=${MKLML_INSTALL_DIR}/lib
 )


[CMake][NFC] Remove dead code lldb_append_link_flags() from AddLLDB.cmake

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@365651 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -160,22 +160,6 @@
   add_lldb_executable(${name} GENERATE_INSTALL ${ARG_UNPARSED_ARGUMENTS})
 endfunction()

-# Support appending linker flags to an existing target.
-# This will preserve the existing linker flags on the
-# target, if there are any.
-function(lldb_append_link_flags target_name new_link_flags)
-  # Retrieve existing linker flags.
-  get_target_property(current_link_flags ${target_name} LINK_FLAGS)
-
-  # If we had any linker flags, include them first in the new linker flags.
-  if(current_link_flags)
-    set(new_link_flags "${current_link_flags} ${new_link_flags}")
-  endif()
-
-  # Now set them onto the target.
-  set_target_properties(${target_name} PROPERTIES LINK_FLAGS ${new_link_flags})
-endfunction()
-
 # The test suite relies on finding LLDB.framework binary resources in the
 # build-tree. Remove them before installing to avoid collisions with their
 # own install targets.


[CMake] Correct CMake message mode

[CMake] Correct CMake message mode

Summary:
This wasn't actually printing out a CMake warning, it was prepending
"WARN" to the message.

Reviewers: zturner

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1311,7 +1311,7 @@
         set(${base_dir} ${LIT_BASE_DIR} PARENT_SCOPE)
         return()
       else()
-        message(WARN "LLVM_EXTERNAL_LIT set to ${LLVM_EXTERNAL_LIT}, but the path does not exist.")
+        message(WARNING "LLVM_EXTERNAL_LIT set to ${LLVM_EXTERNAL_LIT}, but the path does not exist.")
       endif()
     endif()
   endif()


Remove FindThreads.cmake since CMake can now find pthread properly when building on Windows.

--- cmake/FindThreads.cmake
+++ cmake/FindThreads.cmake
@@ -1,236 +0,0 @@
-# Updated FindThreads.cmake that supports pthread-win32
-# Downloaded from http://www.vtk.org/Bug/bug_view_advanced_page.php?bug_id=6399
-
-# - This module determines the thread library of the system.
-#
-# The following variables are set
-#  CMAKE_THREAD_LIBS_INIT     - the thread library
-#  CMAKE_USE_SPROC_INIT       - are we using sproc?
-#  CMAKE_USE_WIN32_THREADS_INIT - using WIN32 threads?
-#  CMAKE_USE_PTHREADS_INIT    - are we using pthreads
-#  CMAKE_HP_PTHREADS_INIT     - are we using hp pthreads
-#
-# If use of pthreads-win32 is desired, the following variables
-# can be set.
-#
-#  THREADS_USE_PTHREADS_WIN32 -
-#    Setting this to true searches for the pthreads-win32
-#    port (since CMake 2.8.0)
-#
-#  THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME
-#      C  = no exceptions (default)
-#         (NOTE: This is the default scheme on most POSIX thread
-#          implementations and what you should probably be using)
-#      CE = C++ Exception Handling
-#      SE = Structure Exception Handling (MSVC only)
-#      (NOTE: Changing this option from the default may affect
-#       the portability of your application.  See pthreads-win32
-#       documentation for more details.)
-#
-#======================================================
-# Example usage where threading library
-# is provided by the system:
-#
-#   find_package(Threads REQUIRED)
-#   add_executable(foo foo.cc)
-#   target_link_libraries(foo ${CMAKE_THREAD_LIBS_INIT})
-#
-# Example usage if pthreads-win32 is desired on Windows
-# or a system provided thread library:
-#
-#   set(THREADS_USE_PTHREADS_WIN32 true)
-#   find_package(Threads REQUIRED)
-#   include_directories(${THREADS_PTHREADS_INCLUDE_DIR})
-#
-#   add_executable(foo foo.cc)
-#   target_link_libraries(foo ${CMAKE_THREAD_LIBS_INIT})
-#
-
-INCLUDE (CheckIncludeFiles)
-INCLUDE (CheckLibraryExists)
-SET(Threads_FOUND FALSE)
-
-IF(WIN32 AND NOT CYGWIN AND THREADS_USE_PTHREADS_WIN32)
-  SET(_Threads_ptwin32 true)
-ENDIF()
-
-# Do we have sproc?
-IF(CMAKE_SYSTEM MATCHES IRIX)
-  CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h"  CMAKE_HAVE_SPROC_H)
-ENDIF()
-
-IF(CMAKE_HAVE_SPROC_H)
-  # We have sproc
-  SET(CMAKE_USE_SPROC_INIT 1)
-
-ELSEIF(_Threads_ptwin32)
-
-  IF(NOT DEFINED THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME)
-    # Assign the default scheme
-    SET(THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME "C")
-  ELSE()
-    # Validate the scheme specified by the user
-    IF(NOT THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "C" AND
-       NOT THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "CE" AND
-       NOT THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "SE")
-         MESSAGE(FATAL_ERROR "See documentation for FindPthreads.cmake, only C, CE, and SE modes are allowed")
-    ENDIF()
-    IF(NOT MSVC AND THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "SE")
-      MESSAGE(FATAL_ERROR "Structured Exception Handling is only allowed for MSVC")
-    ENDIF(NOT MSVC AND THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME STREQUAL "SE")
-  ENDIF()
-
-  FIND_PATH(THREADS_PTHREADS_INCLUDE_DIR NAMES pthread.h)
-
-
-  # Determine the library filename
-  IF(MSVC)
-    SET(_Threads_pthreads_libname
-        pthreadsV${THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME}2)
-  ELSEIF(MINGW)
-    SET(_Threads_pthreads_libname
-        pthreadsG${THREADS_PTHREADS_WIN32_EXCEPTION_SCHEME}2)
-  ELSE()
-    MESSAGE(FATAL_ERROR "This should never happen")
-  ENDIF()
-
-  FIND_LIBRARY(THREADS_PTHREADS_WIN32_LIBRARY
-               NAMES ${_Threads_pthreads_libname}
-			   )
-
-  IF(THREADS_PTHREADS_INCLUDE_DIR AND THREADS_PTHREADS_WIN32_LIBRARY)
-    MARK_AS_ADVANCED(THREADS_PTHREADS_INCLUDE_DIR)
-    SET(CMAKE_THREAD_LIBS_INIT ${THREADS_PTHREADS_WIN32_LIBRARY})
-    SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-    SET(Threads_FOUND TRUE)
-  ENDIF()
-
-  MARK_AS_ADVANCED(THREADS_PTHREADS_WIN32_LIBRARY)
-
-ELSE()
-  # Do we have pthreads?
-  CHECK_INCLUDE_FILES("pthread.h" CMAKE_HAVE_PTHREAD_H)
-  IF(CMAKE_HAVE_PTHREAD_H)
-    #
-    # We have pthread.h
-    # Let's check for the library now.
-    #
-    SET(CMAKE_HAVE_THREADS_LIBRARY)
-    IF(NOT THREADS_HAVE_PTHREAD_ARG)
-
-      # Do we have -lpthreads
-      CHECK_LIBRARY_EXISTS(pthreads pthread_create "" CMAKE_HAVE_PTHREADS_CREATE)
-      IF(CMAKE_HAVE_PTHREADS_CREATE)
-        SET(CMAKE_THREAD_LIBS_INIT "-lpthreads")
-        SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-        SET(Threads_FOUND TRUE)
-      ENDIF()
-
-      # Ok, how about -lpthread
-      CHECK_LIBRARY_EXISTS(pthread pthread_create "" CMAKE_HAVE_PTHREAD_CREATE)
-      IF(CMAKE_HAVE_PTHREAD_CREATE)
-        SET(CMAKE_THREAD_LIBS_INIT "-lpthread")
-        SET(Threads_FOUND TRUE)
-        SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-      ENDIF()
-
-      IF(CMAKE_SYSTEM MATCHES "SunOS.*")
-        # On sun also check for -lthread
-        CHECK_LIBRARY_EXISTS(thread thr_create "" CMAKE_HAVE_THR_CREATE)
-        IF(CMAKE_HAVE_THR_CREATE)
-          SET(CMAKE_THREAD_LIBS_INIT "-lthread")
-          SET(CMAKE_HAVE_THREADS_LIBRARY 1)
-          SET(Threads_FOUND TRUE)
-        ENDIF()
-      ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*")
-
-    ENDIF(NOT THREADS_HAVE_PTHREAD_ARG)
-
-    IF(NOT CMAKE_HAVE_THREADS_LIBRARY)
-      # If we did not found -lpthread, -lpthread, or -lthread, look for -pthread
-      IF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
-        MESSAGE(STATUS "Check if compiler accepts -pthread")
-        TRY_RUN(THREADS_PTHREAD_ARG THREADS_HAVE_PTHREAD_ARG
-          ${CMAKE_BINARY_DIR}
-          ${CMAKE_ROOT}/Modules/CheckForPthreads.c
-          CMAKE_FLAGS -DLINK_LIBRARIES:STRING=-pthread
-          COMPILE_OUTPUT_VARIABLE OUTPUT)
-
-        IF(THREADS_HAVE_PTHREAD_ARG)
-          IF(THREADS_PTHREAD_ARG MATCHES "^2$")
-            SET(Threads_FOUND TRUE)
-            MESSAGE(STATUS "Check if compiler accepts -pthread - yes")
-          ELSE()
-            MESSAGE(STATUS "Check if compiler accepts -pthread - no")
-            FILE(APPEND
-              ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-              "Determining if compiler accepts -pthread returned ${THREADS_PTHREAD_ARG} instead of 2. The compiler had the following output:\n${OUTPUT}\n\n")
-          ENDIF()
-        ELSE()
-          MESSAGE(STATUS "Check if compiler accepts -pthread - no")
-          FILE(APPEND
-            ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
-            "Determining if compiler accepts -pthread failed with the following output:\n${OUTPUT}\n\n")
-        ENDIF()
-
-      ENDIF("THREADS_HAVE_PTHREAD_ARG" MATCHES "^THREADS_HAVE_PTHREAD_ARG")
-
-      IF(THREADS_HAVE_PTHREAD_ARG)
-        SET(Threads_FOUND TRUE)
-        SET(CMAKE_THREAD_LIBS_INIT "-pthread")
-      ENDIF()
-
-    ENDIF(NOT CMAKE_HAVE_THREADS_LIBRARY)
-  ENDIF(CMAKE_HAVE_PTHREAD_H)
-ENDIF()
-
-IF(CMAKE_THREAD_LIBS_INIT)
-  SET(CMAKE_USE_PTHREADS_INIT 1)
-  SET(Threads_FOUND TRUE)
-ENDIF()
-
-IF(CMAKE_SYSTEM MATCHES "Windows"
-   AND NOT THREADS_USE_PTHREADS_WIN32)
-  SET(CMAKE_USE_WIN32_THREADS_INIT 1)
-  SET(Threads_FOUND TRUE)
-ENDIF()
-
-IF(CMAKE_USE_PTHREADS_INIT)
-  IF(CMAKE_SYSTEM MATCHES "HP-UX-*")
-    # Use libcma if it exists and can be used.  It provides more
-    # symbols than the plain pthread library.  CMA threads
-    # have actually been deprecated:
-    #   http://docs.hp.com/en/B3920-90091/ch12s03.html#d0e11395
-    #   http://docs.hp.com/en/947/d8.html
-    # but we need to maintain compatibility here.
-    # The CMAKE_HP_PTHREADS setting actually indicates whether CMA threads
-    # are available.
-    CHECK_LIBRARY_EXISTS(cma pthread_attr_create "" CMAKE_HAVE_HP_CMA)
-    IF(CMAKE_HAVE_HP_CMA)
-      SET(CMAKE_THREAD_LIBS_INIT "-lcma")
-      SET(CMAKE_HP_PTHREADS_INIT 1)
-      SET(Threads_FOUND TRUE)
-    ENDIF(CMAKE_HAVE_HP_CMA)
-    SET(CMAKE_USE_PTHREADS_INIT 1)
-  ENDIF()
-
-  IF(CMAKE_SYSTEM MATCHES "OSF1-V*")
-    SET(CMAKE_USE_PTHREADS_INIT 0)
-    SET(CMAKE_THREAD_LIBS_INIT )
-  ENDIF()
-
-  IF(CMAKE_SYSTEM MATCHES "CYGWIN_NT*")
-    SET(CMAKE_USE_PTHREADS_INIT 1)
-    SET(Threads_FOUND TRUE)
-    SET(CMAKE_THREAD_LIBS_INIT )
-    SET(CMAKE_USE_WIN32_THREADS_INIT 0)
-  ENDIF()
-ENDIF(CMAKE_USE_PTHREADS_INIT)
-
-INCLUDE(FindPackageHandleStandardArgs)
-IF(_Threads_ptwin32)
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG
-    THREADS_PTHREADS_WIN32_LIBRARY THREADS_PTHREADS_INCLUDE_DIR)
-ELSE()
-  FIND_PACKAGE_HANDLE_STANDARD_ARGS(Threads DEFAULT_MSG Threads_FOUND)
-ENDIF()


install openslide license if WSI module is enabled on windows

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -269,6 +269,14 @@
     )
 endif()

+if(FAST_MODULE_WholeSlideImaging AND WIN32)
+    # Install openslide and related licences
+    install(DIRECTORY
+        ${FAST_EXTERNAL_BUILD_DIR}/openslide/src/openslide/licenses/
+        DESTINATION fast/licenses/
+    )
+endif()
+
 if(FAST_BUILD_DOCS)
 	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
         DESTINATION fast/doc


ProjectLLVM: Update LLVM library list

ProjectLLVM: Update LLVM library list

--- cmake/ProjectLLVM.cmake
+++ cmake/ProjectLLVM.cmake
@@ -35,14 +35,12 @@
         # Only used here locally to setup the "llvm" imported target
         set(LIBS
             LLVMMCJIT
-            LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMMCDisassembler
-            LLVMX86AsmPrinter LLVMX86Utils LLVMSelectionDAG LLVMAsmPrinter
-            LLVMDebugInfoCodeView LLVMCodeGen LLVMBitWriter LLVMipo
-            LLVMInstrumentation LLVMVectorize LLVMScalarOpts LLVMLinker
-            LLVMIRReader LLVMAsmParser LLVMInstCombine LLVMTransformUtils
-            LLVMExecutionEngine LLVMTarget LLVMAnalysis LLVMProfileData
-            LLVMRuntimeDyld LLVMObject LLVMMCParser LLVMBitReader LLVMMC
-            LLVMCore LLVMSupport
+            LLVMX86CodeGen LLVMGlobalISel LLVMX86Desc LLVMX86Info LLVMMCDisassembler
+            LLVMX86AsmPrinter LLVMX86Utils LLVMSelectionDAG LLVMAsmPrinter LLVMDebugInfoCodeView
+            LLVMDebugInfoMSF LLVMCodeGen LLVMipo LLVMInstrumentation LLVMVectorize LLVMScalarOpts
+            LLVMLinker LLVMIRReader LLVMAsmParser LLVMInstCombine LLVMTransformUtils LLVMBitWriter
+            LLVMExecutionEngine LLVMTarget LLVMAnalysis LLVMProfileData LLVMRuntimeDyld LLVMObject
+            LLVMMCParser LLVMBitReader LLVMMC LLVMCore LLVMBinaryFormat LLVMSupport LLVMDemangle
         )

         # System libs that LLVM depend on.
@@ -71,7 +69,7 @@
                        -DLLVM_ENABLE_TERMINFO=OFF  # Disable terminal color support
                        -DLLVM_ENABLE_ZLIB=OFF      # Disable compression support -- not needed at all
                        -DLLVM_TARGETS_TO_BUILD=X86
-                       -DLLVM_INCLUDE_TOOLS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF
+                       -DLLVM_INCLUDE_TOOLS=ON -DLLVM_INCLUDE_EXAMPLES=OFF
                        -DLLVM_INCLUDE_TESTS=OFF
             LOG_CONFIGURE TRUE
             BUILD_COMMAND   ${BUILD_COMMAND}


Remove /WHOLDARCHIVE flag.

Remove /WHOLDARCHIVE flag.

--- cmake/TbagProject.cmake
+++ cmake/TbagProject.cmake
@@ -288,7 +288,8 @@
 macro (tbag_project__set_whole_archive __lib_name)
     if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION)
         if (NOT MSVC_VERSION LESS 1900)
-            list (APPEND TBAG_PROJECT_LDFLAGS /WHOLEARCHIVE:${__lib_name})
+            #list (APPEND TBAG_PROJECT_LDFLAGS "/WHOLEARCHIVE:${__lib_name}") ## ERROR: Auto converting '/' -> '\'
+            list (APPEND TBAG_PROJECT_LDFLAGS ${__lib_name})
         else ()
             list (APPEND TBAG_PROJECT_LDFLAGS ${__lib_name})
         endif ()


Fixed(?) a problem in Linux - wrong macro defined for shared libharu in Linux.

svn path=/trunk/; revision=7295

--- cmake/modules/pdf.cmake
+++ cmake/modules/pdf.cmake
@@ -31,7 +31,11 @@
   find_package(hpdf)
   if(hpdf_FOUND)
     message(STATUS "Looking for haru pdf header and library - found")
-    set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_DLL")
+    if(WIN32)
+      set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_DLL")
+    else(WIN32)
+      set(pdf_COMPILE_FLAGS "-I${hpdf_INCLUDE_DIRS} -DHPDF_SHARED")
+    endif(WIN32)
     set(pdf_LINK_FLAGS "${hpdf_LIBRARIES}")
     set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${pdf_LINK_FLAGS})
   else(hpdf_FOUND)


ISPC_EXECUTABLE no longer marked as advanced in cmake

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -24,7 +24,7 @@
 SET(ISPC_VERSION_REQUIRED "1.7.1")

 IF (NOT ISPC_EXECUTABLE)
-  FIND_PROGRAM(ISPC_EXECUTABLE ispc)
+  FIND_PROGRAM(ISPC_EXECUTABLE ispc DOC "Path to the ISPC executable.")
   IF (NOT ISPC_EXECUTABLE)
     MESSAGE(FATAL_ERROR "Intel SPMD Compiler (ISPC) not found. Disable ENABLE_ISPC_SUPPORT or install ISPC.")
   ELSE()
@@ -43,7 +43,7 @@

   SET(ISPC_VERSION ${ISPC_VERSION} CACHE STRING "ISPC Version")
   MARK_AS_ADVANCED(ISPC_VERSION)
-  MARK_AS_ADVANCED(ISPC_EXECUTABLE)
+#  MARK_AS_ADVANCED(ISPC_EXECUTABLE)
 ENDIF()

 GET_FILENAME_COMPONENT(ISPC_DIR ${ISPC_EXECUTABLE} PATH)


Fix for the naming of DA's

Fix for the naming of DA's

--- cmake/CMakeDA.cmake
+++ cmake/CMakeDA.cmake
@@ -181,6 +181,9 @@
 	  execute_process(COMMAND svn info $ENV{ALICE_ROOT}/${DASRC} OUTPUT_VARIABLE _daversion OUTPUT_STRIP_TRAILING_WHITESPACE)
 	  string(REGEX REPLACE ".*Last Changed Rev: ([^\n]+)\n.*" "\\1" DAVERSION ${_daversion})

+	#DAREVISION
+	  execute_process(COMMAND svn info ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE _darevision OUTPUT_STRIP_TRAILING_WHITESPACE)
+          string(REGEX REPLACE ".*Revision: ([^\n]+)\n.*" "\\1" DAREVISION ${_darevision})
 	# DAROOTRELEASE
 	  execute_process(COMMAND root-config --version OUTPUT_VARIABLE _darootrelease OUTPUT_STRIP_TRAILING_WHITESPACE)
 	  string(REGEX REPLACE "/" "." DAROOTRELEASE ${_darootrelease})
@@ -190,7 +193,7 @@
           string (REPLACE "-" "." DAALIROOTRELEASE "${DAALIROOTRELEASE}")

 	  set(DAARCNAME "${DATARGETNAME}")
-	  string(REPLACE "-" "" DAARCNAME "${DAARCNAME}")
+	  #string(REPLACE "-" "" DAARCNAME "${DAARCNAME}")
 	  set(DAARC "${DAARCNAME}-${DAVERSION}")
 	  set(DATAR "${DATARGETDIR}/${DAARC}.src.tar.gz")
 	  set(DASPECFILE "${DATARGETDIR}/${DAMODULE}${SUBDAMODULE}${DANAME}da.spec")
@@ -337,7 +340,7 @@
 COMMAND @echo "Summary: ${ONLINEDETECTORNAME} Detector Algorithm" >> ${DASPECFILE}
 COMMAND @echo "Name: ${DAARCNAME}" >> ${DASPECFILE}
 COMMAND @echo "Version: ${DAVERSION}" >> ${DASPECFILE}
-COMMAND @echo "Release: ${DAALIROOTRELEASE}" >> ${DASPECFILE}
+COMMAND @echo "Release: ${DAALIROOTRELEASE}.${DAREVISION}" >> ${DASPECFILE}
 COMMAND @echo "License: CERN Alice DAQ/Offine" >> ${DASPECFILE}
 COMMAND @echo "Source: %{name}-%{version}.src.tar.gz" >> ${DASPECFILE}
 COMMAND @echo "Group: Applications/Alice" >> ${DASPECFILE}
@@ -434,7 +437,7 @@
 COMMAND mkdir -p ${CMAKE_BINARY_DIR}/junk/SOURCES ${CMAKE_BINARY_DIR}/junk/SPECS ${CMAKE_BINARY_DIR}/junk/BUILD ${CMAKE_BINARY_DIR}/junk/RPMS ${CMAKE_BINARY_DIR}/junk/SRPMS
 COMMAND cp ${DATAR} ${CMAKE_BINARY_DIR}/junk/SOURCES
 COMMAND rpmbuild --verbose --define "_topdir ${CMAKE_BINARY_DIR}/junk" --nodeps -bb ${DASPECFILE}
-COMMAND cp -p `find ${CMAKE_BINARY_DIR}/junk/ -name "${DAARC}-*.rpm"` . ;
+COMMAND cp `find './junk/' -name '${DAARC}*.rpm'` ./
 COMMAND rm -rf junk
 COMMAND echo "***** RPMS created and put ${CMAKE_BINARY_DIR} folder *****"
 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
@@ -452,12 +455,16 @@

 add_dependencies(${DAEXE} ${DASRC} DAOBJ_${DAEXE}_ ${BINPATH} ${LIBPATH} ${DALIB}.a ${DAQDALIB} ${ROOTLIB})

+
 add_custom_target(DAOBJ_${DAEXE}_
 )
 add_custom_command(
 TARGET DAOBJ_${DAEXE}_
 COMMAND echo "***** Compiling ${DASRC} *****"
-COMMAND g++ -c -DLinux -DDATE_SYS=Linux -Dlong32="int" -Dlong64="long long" -DdatePointer="long" -I/date/rorc -I/date/runControl -I/date/readList -I/date/eventBuilder -I/date/banksManager -I/date/bufferManager -I/date/db -I/date/commonDefs -I/date/monitoring -I/date/infoLogger -I/date/logbook -I${DAQDADIR} -I${ALICE_ROOT}/RAW -I${CMAKE_BINARY_DIR}/include -I$ENV{ROOTSYS}/include ${mod} ${date_head} ${ALICE_ROOT}/${DASRC} -o ${DAOBJ}
+COMMAND echo "${DFLAGS}"
+COMMAND g++ -c -D${CMAKE_SYSTEM_NAME} -DDATE_SYS=${CMAKE_SYSTEM_NAME} -Dlong32="int" -Dlong64="long long" -DdatePointer="long" -I/date/rorc -I/date/runControl -I/date/readList -I/date/eventBuilder -I/date/banksManager -I/date/bufferManager -I/date/db -I/date/commonDefs -I/date/monitoring -I/date/infoLogger -I/date/logbook -I${DAQDADIR} -I${ALICE_ROOT}/RAW -I${CMAKE_BINARY_DIR}/include -I$ENV{ROOTSYS}/include ${mod} ${date_head} ${ALICE_ROOT}/${DASRC} -o ${DAOBJ}
+#COMMAND g++ -c ${DATEFLAGS} -I${DAQDADIR} -I${ALICE_ROOT}/RAW -I${CMAKE_BINARY_DIR}/include -I$ENV{ROOTSYS}/include ${mod} ${date_head} ${ALICE_ROOT}/${DASRC} -o ${DAOBJ}
+
 WORKING_DIRECTORY ${ALICE_ROOT}
 )
 add_dependencies(DAOBJ_${DAEXE}_ DADEP_${DAEXE}_ )


ENH: supoort commnad `make target_name`

ENH: supoort commnad `make target_name`

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -97,15 +97,12 @@
   endforeach()

   if(APPLE) # Use OSX's libtool to merge archives
-    add_custom_target(${TARGET_NAME}_archive
-      COMMAND libtool -static -o "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a" ${libfiles}
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      DEPENDS ${libs}
-      )
-    add_library(${TARGET_NAME} STATIC IMPORTED GLOBAL)
-    set_property(TARGET ${TARGET_NAME} PROPERTY
-      IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a")
-    add_dependencies(${TARGET_NAME} ${TARGET_NAME}_archive)
+    set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}_dummy.c)
+    file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
+    add_library(${TARGET_NAME} STATIC ${dummyfile})
+		add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
+      COMMAND rm "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a"
+      COMMAND /usr/bin/libtool -static -o "${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.a" ${libfiles})
 	else() # general UNIX: use "ar" to extract objects and re-add to a common lib
     foreach(lib ${libs})
       set(objlistfile ${lib}.objlist) # list of objects in the input library


Improve diff handling under windows

Improve diff handling under windows

--- cmake/runTest.cmake
+++ cmake/runTest.cmake
@@ -9,24 +9,24 @@
 )

 # arguments checking
-if( NOT TEST_COMMAND )
-  message( FATAL_ERROR "Require TEST_COMMAND to be defined" )
-endif( NOT TEST_COMMAND )
-if( NOT TEST_ARGSLIST )
-  message( FATAL_ERROR "Require TEST_ARGSLIST to be defined (form=arg1;arg2;arg3)" )
-endif( NOT TEST_ARGSLIST )
-if( NOT TEST_OUTPUT )
-  message( FATAL_ERROR "Require TEST_OUTPUT to be defined" )
-endif( NOT TEST_OUTPUT )
-if( NOT TEST_BASELINE )
-  message( FATAL_ERROR "Require TEST_BASELINE to be defined" )
-endif( NOT TEST_BASELINE )
+if (NOT TEST_COMMAND)
+  message( FATAL_ERROR "Require TEST_COMMAND to be defined")
+endif (NOT TEST_COMMAND)
+if (NOT TEST_ARGSLIST)
+  message( FATAL_ERROR "Require TEST_ARGSLIST to be defined (argform=arg1;arg2;arg3)")
+endif (NOT TEST_ARGSLIST)
+if (NOT TEST_OUTPUT)
+  message( FATAL_ERROR "Require TEST_OUTPUT to be defined")
+endif (NOT TEST_OUTPUT)
+if (NOT TEST_BASELINE)
+  message( FATAL_ERROR "Require TEST_BASELINE to be defined")
+endif (NOT TEST_BASELINE)

-message( "TEST_COMMAND ${TEST_COMMAND}")
-message( "TEST_ARGSLIST ${TEST_ARGSLIST}")
-message( "TEST_OUTPUT ${TEST_OUTPUT}")
-message( "TEST_BASELINE ${TEST_BASELINE}")
-message( "DIFF_EXECUTABLE is ${TEST_DIFF_EXECUTABLE}")
+#message( "TEST_COMMAND ${TEST_COMMAND}")
+#message( "TEST_ARGSLIST ${TEST_ARGSLIST}")
+#message( "TEST_OUTPUT ${TEST_OUTPUT}")
+#message( "TEST_BASELINE ${TEST_BASELINE}")
+#message( "DIFF_EXECUTABLE is ${TEST_DIFF_EXECUTABLE}")

 # run the test program, capture the stdout/stderr and the result var
 execute_process(
@@ -34,38 +34,52 @@
   OUTPUT_FILE ${TEST_OUTPUT}
   ERROR_VARIABLE TEST_ERROR
   RESULT_VARIABLE TEST_RESULT
-  )
+ )

 # if the return value is !=0 bail out
-if( TEST_RESULT )
-  message( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}" )
-endif( TEST_RESULT )
+if (TEST_RESULT)
+  message( FATAL_ERROR "Failed: Test program ${TEST_COMMAND} ${TEST_ARGSLIST} exited != 0. \n${TEST_ERROR}")
+endif (TEST_RESULT)

-# now compare the output with the reference
-execute_process(
-  COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_OUTPUT} ${TEST_BASELINE}
-  RESULT_VARIABLE TEST_RESULT
+# now compare the output with the reference, use diff command if possible, since we can
+# use -w to ignore whitespace/line ending differences across platforms
+if (TEST_DIFF_EXECUTABLE)
+  # we need to un-escape spaces in the file names of executables like diff
+  STRING(REPLACE "\\ " " " TEST_DIFF_EXECUTABLE "${TEST_DIFF_EXECUTABLE}")
+  message("executing ${TEST_DIFF_EXECUTABLE} -w -q ${CMAKE_CURRENT_BINARY_DIR}/${TEST_OUTPUT} ${TEST_BASELINE}")
+  execute_process(
+    COMMAND "${TEST_DIFF_EXECUTABLE}" -w -q "${CMAKE_CURRENT_BINARY_DIR}/${TEST_OUTPUT}" "${TEST_BASELINE}"
+    RESULT_VARIABLE TEST_RESULT
+	  OUTPUT_VARIABLE DIFF_RESULT
   )
+else (TEST_DIFF_EXECUTABLE)
+  execute_process(
+    COMMAND "${CMAKE_COMMAND}" -E compare_files ${TEST_OUTPUT} ${TEST_BASELINE}
+    RESULT_VARIABLE TEST_RESULT
+  )
+endif (TEST_DIFF_EXECUTABLE)

 # if return value is !=0 display something to show problems
-if( TEST_RESULT )
+if (TEST_RESULT)
   file(READ ${TEST_OUTPUT} ERR_TXT)
-  message("#########################")
-  message("OUTPUT IS ${ERR_TXT}")
-  message("#########################")
+  message("###########${TEST_RESULT}##############")
+  message("Test output is ${ERR_TXT}")

   # compare the output with the reference if possible
   if (TEST_DIFF_EXECUTABLE)
-	  execute_process(
-	    COMMAND ${TEST_DIFF_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/${TEST_OUTPUT}" "${TEST_BASELINE}"
-      OUTPUT_VARIABLE DIFF_RESULT
-	    )
+    execute_process(
+      COMMAND ${TEST_DIFF_EXECUTABLE} "-w" "${CMAKE_CURRENT_BINARY_DIR}/${TEST_OUTPUT}" "${TEST_BASELINE}"
+	    OUTPUT_VARIABLE DIFF_RESULT
+    )
     message("#########################")
-    message(FATAL_ERROR "Failed: DIFF IS \n${DIFF_RESULT}")
+    message("diff -w ${CMAKE_CURRENT_BINARY_DIR}/${TEST_OUTPUT} ${TEST_BASELINE} \n${DIFF_RESULT}")
+    message("#########################")
+    message(FATAL_ERROR "Failed: The output of ${TEST_COMMAND} ${TEST_ARGSLIST} did not match ${TEST_BASELINE}")
   else (TEST_DIFF_EXECUTABLE)
-    message( FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not match ${TEST_BASELINE}")
+    message("#########################")
+    message( FATAL_ERROR "Failed: The output of ${TEST_COMMAND} ${TEST_ARGSLIST} did not match ${TEST_BASELINE}")
   endif (TEST_DIFF_EXECUTABLE)
-endif( TEST_RESULT )
+endif (TEST_RESULT)

 # everything went fine...
-message( "Passed: The output of ${TEST_PROGRAM} matches ${TEST_BASELINE}" )
+message( "Passed: The output of ${TEST_COMMAND} matches ${TEST_BASELINE}")


PKG: new system libs draged by Qt plugins

--- Packaging/PackageGlobals.cmake
+++ Packaging/PackageGlobals.cmake
@@ -103,6 +103,12 @@
   libICE.so*
   libXrandr.so*
   libpython*
+  libxcb.so*
+  libxcb-glx.so*
+  libX11-xcb.so*
+  libmysqlclient.so*
+  libodbc.so*
+  libpq.so*
   )
   # libexpat.so.*
   # libfontconfig.so*
@@ -128,6 +134,7 @@
   AGL.framework
   OpenGL.framework
   libgcc_s.*dylib
+  libcups.*dylib
   )

 if(WIN32)


Fix my email address

Fix my email address

--- cmake/FindSpeechd.cmake
+++ cmake/FindSpeechd.cmake
@@ -1,5 +1,5 @@
 # find speech-dispatcher library and header if available
-# Copyright (c) 2009, Jeremy Whiting <jeremy@scitools.com>
+# Copyright (c) 2009, Jeremy Whiting <jpwhiting@kde.org>
 # Copyright (c) 2011, Raphael Kubo da Costa <kubito@gmail.com>
 # This module defines
 #  SPEECHD_INCLUDE_DIR, where to find libspeechd.h


Support multiple targets in add_coverage.

--- cmake/Findcodecov.cmake
+++ cmake/Findcodecov.cmake
@@ -48,7 +48,9 @@
 function (add_coverage TNAME)
 	# only add coverage for target, if coverage is support and enabled.
 	if (ENABLE_COVERAGE)
-		add_coverage_target(${TNAME})
+		foreach (TNAME ${ARGV})
+			add_coverage_target(${TNAME})
+		endforeach ()
 	endif ()
 endfunction (add_coverage)


Add finding debug library of Panda3D

Add finding debug library of Panda3D

--- cmake/Findpanda3d.cmake
+++ cmake/Findpanda3d.cmake
@@ -14,6 +14,12 @@
 #
 #   panda3d_FOUND            - True if panda3d has been found and can be used
 #
+# This module reads hints about search locations from variables::
+#
+#   panda3d_ROOT             - Preferred installation prefix
+#   panda3d_ROOT_DEBUG       - Preferred Debug installation prefix (Panda3D optimization level 1-2)
+#   panda3d_ROOT_RELEASE     - Preferred Release installation prefix (Panda3D optimization level 3-4)
+#
 # The following `IMPORTED` targets are also defined::
 #
 #   panda3d::panda3d    - Target for the Panda3D necessary libraries.
@@ -23,8 +29,7 @@

 find_path(panda3d_INCLUDE_DIR
     NAMES "pandaFramework.h"
-    PATHS "${panda3d_ROOT}"
-    PATH_SUFFIXES include
+    HINTS "${panda3d_ROOT}/include"
 )

 set(panda3d_DEFAULT_COMPONENTS p3framework panda pandaexpress p3dtool p3dtoolconfig p3direct p3interrogatedb)
@@ -36,50 +41,76 @@
 list(REMOVE_ITEM panda3d_NON_DEFAULT_COMPONENTS ${panda3d_DEFAULT_COMPONENTS})

 if(WIN32)
-    set(panda3d_LIB_PREFIX "lib")
+    set(panda3d_lib_prefix "lib")
 else()
-    set(panda3d_LIB_PREFIX "")
+    set(panda3d_lib_prefix "")
 endif()
+set(panda3d_lib_suffix_RELEASE "")
+set(panda3d_lib_suffix_DEBUG "_d")
+set(panda3d_configurations "DEBUG" "RELEASE")

-foreach(COMPONENT_NAME ${panda3d_FIND_COMPONENTS})
-    find_library(panda3d_${COMPONENT_NAME}_LIBRARY
-        NAMES ${panda3d_LIB_PREFIX}${COMPONENT_NAME}
-        PATHS "${panda3d_ROOT}"
-        PATH_SUFFIXES lib
-    )
-    list(APPEND panda3d_LIBRARY ${panda3d_${COMPONENT_NAME}_LIBRARY})
+foreach(configuration ${panda3d_configurations})
+    foreach(component_name ${panda3d_FIND_COMPONENTS})
+        find_library(panda3d_${component_name}_LIBRARY_${configuration}
+            NAMES ${panda3d_lib_prefix}${component_name}${panda3d_lib_suffix_${configuration}}
+            HINTS "${panda3d_ROOT_${configuration}}" "${panda3d_ROOT}"
+            PATH_SUFFIXES "lib"
+        )
+        list(APPEND panda3d_LIBRARY_${configuration} ${panda3d_${component_name}_LIBRARY_${configuration}})
+    endforeach()
 endforeach()
-#find_library(panda3d_LIBRARY_DEBUG
-#    NAMES ${panda3d_FIND_COMPONENTS}
-#    HINTS ${panda3d_LIBRARYDIR}
-#    PATH_SUFFIXES lib64 lib
-#)

 # Set panda3d_FOUND
 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(panda3d
     FOUND_VAR panda3d_FOUND
-    REQUIRED_VARS panda3d_LIBRARY panda3d_INCLUDE_DIR
+    REQUIRED_VARS panda3d_INCLUDE_DIR
 )

 if(panda3d_FOUND)
     message(STATUS "Found the following Panda3D libraries:")
-    foreach(COMPONENT ${panda3d_FIND_COMPONENTS})
-        message (STATUS "  ${COMPONENT}")
-    endforeach()

     # create targets of found components
-    foreach(COMPONENT_NAME ${panda3d_FIND_COMPONENTS})
-        if(NOT TARGET panda3d::${COMPONENT_NAME})
-            add_library(panda3d::${COMPONENT_NAME} UNKNOWN IMPORTED)
-            set_target_properties(panda3d::${COMPONENT_NAME} PROPERTIES
-                INTERFACE_INCLUDE_DIRECTORIES "${panda3d_INCLUDE_DIR}"
-                IMPORTED_LOCATION "${panda3d_${COMPONENT_NAME}_LIBRARY}"
-                IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
-            )
+    foreach(component_name ${panda3d_FIND_COMPONENTS})
+        if(NOT TARGET panda3d::${component_name})
+            add_library(panda3d::${component_name} UNKNOWN IMPORTED)

-            # Make variables changeable to the advanced user
-            mark_as_advanced(panda3d_${COMPONENT_NAME}_LIBRARY)
+            if(EXISTS "${panda3d_${component_name}_LIBRARY_RELEASE}")
+                set_property(TARGET panda3d::${component_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+                set_property(TARGET panda3d::${component_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELWITHDEBINFO)
+                set_target_properties(panda3d::${component_name} PROPERTIES
+                    IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+                    IMPORTED_LOCATION "${panda3d_${component_name}_LIBRARY_RELEASE}"
+
+                    IMPORTED_LINK_INTERFACE_LANGUAGES_${configuration} "CXX"
+                    IMPORTED_LOCATION_RELEASE "${panda3d_${component_name}_LIBRARY_RELEASE}"
+                    IMPORTED_LOCATION_RELWITHDEBINFO "${panda3d_${component_name}_LIBRARY_RELEASE}"
+                    IMPORTED_LOCATION_MINSIZEREL "${panda3d_${component_name}_LIBRARY_RELEASE}"
+                )
+
+                # Make variables changeable to the advanced user
+                mark_as_advanced(panda3d_${component_name}_LIBRARY_RELEASE)
+                message(STATUS "  ${component_name}")
+            endif()
+
+            if(EXISTS "${panda3d_${component_name}_LIBRARY_DEBUG}")
+                set_property(TARGET panda3d::${component_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+                set_target_properties(panda3d::${component_name} PROPERTIES
+                    IMPORTED_LINK_INTERFACE_LANGUAGES_${configuration} "CXX"
+                    IMPORTED_LOCATION_DEBUG "${panda3d_${component_name}_LIBRARY_DEBUG}"
+                )
+
+                # Make variables changeable to the advanced user
+                mark_as_advanced(panda3d_${component_name}_LIBRARY_DEBUG)
+
+                if(NOT EXISTS "${panda3d_${component_name}_LIBRARY_RELEASE}")
+                    set_target_properties(panda3d::${component_name} PROPERTIES
+                        IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+                        IMPORTED_LOCATION "${panda3d_${component_name}_LIBRARY_DEBUG}"
+                    )
+                    message(STATUS "  ${component_name}")
+                endif()
+            endif()
         endif()
     endforeach()

@@ -87,8 +118,8 @@
     if(NOT TARGET panda3d::panda3d)
         add_library(panda3d::panda3d INTERFACE IMPORTED)

-        foreach(COMPONENT_NAME ${panda3d_DEFAULT_COMPONENTS})
-            list(APPEND _panda3d_DEFAULT_TARGET_DEPENDENCIES panda3d::${COMPONENT_NAME})
+        foreach(component_name ${panda3d_DEFAULT_COMPONENTS})
+            list(APPEND _panda3d_DEFAULT_TARGET_DEPENDENCIES panda3d::${component_name})
         endforeach()

         set_target_properties(panda3d::panda3d PROPERTIES


cmake: ocv_cmake_dump_vars() remove duplicated information

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -2,21 +2,22 @@

 # Debugging function
 function(ocv_cmake_dump_vars)
-  set(VARS "")
-  get_cmake_property(_variableNames VARIABLES)
+  get_cmake_property(__variableNames VARIABLES)
   cmake_parse_arguments(DUMP "" "TOFILE" "" ${ARGN})
   set(regex "${DUMP_UNPARSED_ARGUMENTS}")
   string(TOLOWER "${regex}" regex_lower)
-  foreach(_variableName ${_variableNames})
-    string(TOLOWER "${_variableName}" _variableName_lower)
-    if(_variableName MATCHES "${regex}" OR _variableName_lower MATCHES "${regex_lower}")
-      set(VARS "${VARS}${_variableName}=${${_variableName}}\n")
+  set(__VARS "")
+  foreach(__variableName ${__variableNames})
+    string(TOLOWER "${__variableName}" __variableName_lower)
+    if((__variableName MATCHES "${regex}" OR __variableName_lower MATCHES "${regex_lower}")
+        AND NOT __variableName_lower MATCHES "^__")
+      set(__VARS "${__VARS}${__variableName}=${${__variableName}}\n")
     endif()
   endforeach()
   if(DUMP_TOFILE)
-    file(WRITE ${CMAKE_BINARY_DIR}/${DUMP_TOFILE} "${VARS}")
-  else()
-    message(AUTHOR_WARNING "${VARS}")
+    file(WRITE ${CMAKE_BINARY_DIR}/${DUMP_TOFILE} "${__VARS}")
+  else()
+    message(AUTHOR_WARNING "${__VARS}")
   endif()
 endfunction()


fix(cmake): fixes #413 (#457)

fix(cmake): fixes #413 (#457)

--- cmake/g3logConfig.cmake
+++ cmake/g3logConfig.cmake
@@ -47,7 +47,7 @@
    endif ()
 endif ()

-find_package_handle_standard_args(G3LOG REQUIRED_VARS G3LOG_INCLUDE_DIR G3LOG_LIBRARY)
+find_package_handle_standard_args(g3log REQUIRED_VARS G3LOG_INCLUDE_DIR G3LOG_LIBRARY)
 mark_as_advanced(G3LOG_INCLUDE_DIR G3LOG_LIBRARY)
 set(G3LOG_INCLUDE_DIRS ${G3LOG_INCLUDE_DIR})
 set(G3LOG_LIBRARIES ${G3LOG_LIBRARY})


Drop ENABLE_cxx logic or replace it by CMAKE_CXX_COMPILER_WORKS logic
where appropriate.

The result should be that cmake always tries to find a working C++ compiler
for a fresh build and continues to do that for subsequent "dirty" builds if
a working C++ compiler was not found previously. This logic sets ENABLE_cxx
OFF when there is no working C++ compiler, but the logic does not depend on
ENABLE_cxx.  Thus, that variable is strictly reserved for toggling whether
or not C++ bindings are to be built/installed and whether C++ examples are
built (for BUILD_TEST=ON) and installed.

svn path=/trunk/; revision=10201

--- cmake/modules/c++.cmake
+++ cmake/modules/c++.cmake
@@ -28,15 +28,15 @@
   OPTION(ENABLE_cxx "Enable C++ bindings" ON)
 endif(DEFAULT_NO_BINDINGS)

-if(ENABLE_cxx AND NOT PLPLOT_CXX_COMPILER_WORKS)
+if(NOT PLPLOT_CXX_COMPILER_WORKS)
   workaround_9220(CXX PLPLOT_CXX_COMPILER_WORKS)
   if(NOT PLPLOT_CXX_COMPILER_WORKS)
     message(STATUS "WARNING: no working C++ compiler so disabling C++ bindings and examples.")
     set(ENABLE_cxx OFF CACHE BOOL "Enable C++ bindings" FORCE)
   endif(NOT PLPLOT_CXX_COMPILER_WORKS)
-endif(ENABLE_cxx AND NOT PLPLOT_CXX_COMPILER_WORKS)
+endif(NOT PLPLOT_CXX_COMPILER_WORKS)

-if(ENABLE_cxx)
+if(PLPLOT_CXX_COMPILER_WORKS)
   # Find and check C++ compiler.
   enable_language(CXX OPTIONAL)

@@ -44,9 +44,9 @@
     message(STATUS "No working C++ compiler found so disabling C++ bindings and examples.")
     set(ENABLE_cxx OFF CACHE BOOL "Enable C++ bindings" FORCE)
   endif(NOT CMAKE_CXX_COMPILER_WORKS)
-endif(ENABLE_cxx)
+endif(PLPLOT_CXX_COMPILER_WORKS)

-if(ENABLE_cxx)
+if(CMAKE_CXX_COMPILER_WORKS)
   # Check if "using namespace std;" works
   INCLUDE(TestForNamespace)

@@ -62,4 +62,4 @@

   # Need to add check if stdint.h can be used from c++ (PL_HAVE_CXX_STDINT_H)
   INCLUDE(TestForStdintCXX)
-endif(ENABLE_cxx)
+endif(CMAKE_CXX_COMPILER_WORKS)


Explicitly add in freetype include paths / libraries if required.
They may not be included via libgnomeprintui-2.2.

svn path=/trunk/; revision=7782

--- cmake/modules/gcw.cmake
+++ cmake/modules/gcw.cmake
@@ -55,6 +55,13 @@
       # Requires blank-delimited list.
       string(REGEX REPLACE ";" " " gcw_COMPILE_FLAGS "${cflags1}")
       set(gcw_LINK_FLAGS "${linkflags1}")
+      # Add freetype includes / libraries if required
+      if (WITH_FREETYPE)
+        foreach(DIR ${FREETYPE_INCLUDE_DIR})
+          set(gcw_COMPILE_FLAGS "${gcw_COMPILE_FLAGS} -I${DIR}")
+        endforeach(DIR ${FREETYPE_INCLUDE_DIR})
+        set(gcw_LINK_FLAGS ${gcw_LINK_FLAGS} ${FREETYPE_LIBRARIES})
+      endif (WITH_FREETYPE)
     else(linkflags1)
       message(STATUS
       "WARNING: libgnomeprintui-2.2 not found.  Setting PLD_gcw "


update version to 2.1.0

update version to 2.1.0

git-svn-id: 647c2dfdf120d9af8205d960f30c8711574448cd@1397 6778bc44-b910-0410-a7a0-be141de4315d

--- src/cmake/CPack-projectM.cmake
+++ src/cmake/CPack-projectM.cmake
@@ -17,8 +17,8 @@
 #SET(CPACK_BINARY_TGZ ON)
 #SET(CPACK_SOURCE_Z OFF)
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "1")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")

 IF(CPACK_PROJECTM_INCLUDED)
 	INCLUDE(CPack)