Add the ability to add a line at top of cython generated file

--- scripts/PythonModule.cmake
+++ scripts/PythonModule.cmake
@@ -242,7 +242,7 @@
 function(_pm_add_cython module source)

     string(REGEX REPLACE "/" "_" cy "cy.${module}")
-    cmake_parse_arguments(${cy} "CPP" "TARGET" "" ${ARGN})
+    cmake_parse_arguments(${cy} "CPP" "TARGET;STARTLINE" "" ${ARGN})
     # Creates command-line arguments for cython for include directories
     get_property(included_dirs
         DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@@ -268,17 +268,17 @@
     else()
         set(arguments ${PYTHON_EXECUTABLE} -m cython)
     endif()
-    if(${${cy}_CPP})
-        set(c_source "cython_${cy_module}.cc")
+    if(${cy}_CPP)
+        set(generated_source "cython_${cy_module}.cc")
         list(APPEND arguments --cplus)
     else()
-        set(c_source "cython_${cy_module}.c")
+        set(generated_source "cython_${cy_module}.c")
     endif()

     # Create C source from cython
     list(APPEND arguments
         "${source}"
-        -o "${CMAKE_CURRENT_BINARY_DIR}/${c_source}" ${inclusion}
+        -o "${CMAKE_CURRENT_BINARY_DIR}/${generated_source}" ${inclusion}
     )
     if(NOT CMAKE_VERSION VERSION_LESS "2.8.10")
         set(cond "$<$<OR:$<CONFIG:RelWithDebInfo>,$<CONFIG:Debug>>:")
@@ -286,12 +286,39 @@
             "${cond}--gdb> ${cond}--gdb-outdir> ${cond}${PROJECT_BINARY_DIR}/cython_debug_files>")
     endif()
     add_custom_command(
-        OUTPUT "${c_source}"
+        OUTPUT "${generated_source}"
         COMMAND ${arguments}
         WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
         DEPENDS ${DEPENDENCIES}
         COMMENT "Generating c/c++ source ${source} with cython (${directory})"
     )
+    # Adds line at the top of the generated file
+    # Its necessary to deal with some ctype.h vs cctype unpleasantness
+    if(${cy}_STARTLINE)
+      get_filename_component(directory "${generated_source}" DIRECTORY)
+      get_filename_component(filename "${generated_source}" NAME)
+      if("${directory}" STREQUAL "")
+          set(c_source "startlines.${filename}")
+      else()
+          set(c_source "${ddir}/startlines.${filename}")
+      endif()
+      if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/prepend_line.sh")
+          file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/prepend_line.sh"
+            "cd ${CMAKE_CURRENT_BINARY_DIR};"
+            "echo \"${${cy}_STARTLINE}\" > $2;"
+            "cat $1 >> $2;"
+          )
+      endif()
+      add_custom_command(
+          OUTPUT "${c_source}"
+          COMMAND bash ${CMAKE_CURRENT_BINARY_DIR}/prepend_line.sh ${generated_source} ${c_source}
+          WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+          DEPENDS "${generated_source}"
+          COMMENT "Adding starting line to generated cython source ${source} (${directory})"
+      )
+    else()
+      set(c_source "${generated_source}")
+    endif()

     # Extension name
     string(REGEX MATCH "[^\\.]*$" extension ${cy_module})


fixing gcc 4.8 & 4.9 builds after merging #471

--- scripts/cmake/common.cmake
+++ scripts/cmake/common.cmake
@@ -138,6 +138,10 @@
         add_compiler_flags(-Wnoexcept)
     endif()

+    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
+        add_compiler_flags(-Wno-missing-field-initializers)
+    endif()
+
     # no way to silence it in the expression decomposition macros: _Pragma() in macros doesn't work for the c++ front-end of g++
     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55578
     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69543


build/cmake/BoostMacros.cmake: Removed 'Boost_NO_BOOST_CMAKE' and minor cleanup

--- build/cmake/BoostMacros.cmake
+++ build/cmake/BoostMacros.cmake
@@ -19,17 +19,10 @@

 set(BOOST_MINREV 1.56)

-# we are not ready for the new style link targets introduced in
-# boost 1.70.0 and cmake 3.14.2 which showed up on appveyor in
-# mingw builds
-set(Boost_NO_BOOST_CMAKE ON)
-
 macro(REQUIRE_BOOST_HEADERS)
   find_package(Boost ${BOOST_MINREV} QUIET REQUIRED)
   if (NOT Boost_FOUND)
-    string(CONCAT fatal_message
-        "Boost ${BOOST_MINREV} or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}")
-    message(FATAL_ERROR, ${fatal_message})
+    message(FATAL_ERROR "Boost ${BOOST_MINREV} or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}")
   endif()
   if (DEFINED Boost_INCLUDE_DIRS)
     # pre-boost 1.70.0 aware cmake, otherwise it is using targets
@@ -41,9 +34,6 @@
   message(STATUS "Locating boost libraries required by sources in ${CMAKE_CURRENT_SOURCE_DIR}")
   find_package(Boost ${BOOST_MINREV} REQUIRED COMPONENTS ${${libs}})
   if (NOT Boost_FOUND)
-    string(CONCAT fatal_message
-        "Boost ${BOOST_MINREV} or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}, "
-	    "or use -DBUILD_TESTING=OFF")
-    message(FATAL_ERROR, ${fatal_message})
+    message(FATAL_ERROR "Boost ${BOOST_MINREV} or later is required to build sources in ${CMAKE_CURRENT_SOURCE_DIR}, or use -DBUILD_TESTING=OFF")
   endif()
 endmacro()


Make bc-flexisip package depends of Soci backends for SQlite and MySQL

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -101,7 +101,7 @@
 %endif

 %if @ENABLE_SOCI@
-Requires: %{pkg_prefix}soci
+Requires: %{pkg_prefix}soci %{pkg_prefix}soci-mysql %{pkg_prefix}soci-sqlite3
 BuildRequires: %{pkg_prefix}soci-mysql-devel
 %endif


ENH gdal-config

ENH gdal-config

--- Modules/ThirdParty/GDAL/otb-module-init.cmake
+++ Modules/ThirdParty/GDAL/otb-module-init.cmake
@@ -16,6 +16,7 @@
 	set(MIN_MINOR_VERSION 10)

 	set(GDAL_QUALIFIES TRUE)
+	set(COMPILE_ERRORS FALSE)

 	# Ensure that the temporary dir always exists before starting tests
 	if(NOT EXISTS ${TEMP})
@@ -82,6 +83,7 @@
 	# Warning messages
 	if (NOT COMPILE_RESULT_VERSION)
 		message(WARNING "Modules/ThirdParty/GDAL/gdalVersionTest.cxx did not compile.")
+		set(COMPILE_ERRORS TRUE)
 	elseif (${RUN_RESULT_VERSION} EQUAL 1)
 		file(READ "${TEMP}/gdalVersion.txt" DETECTED_VERSION)
 		message(WARNING "Version of GDAL must be >= " ${MIN_MAJOR_VERSION} "." ${MIN_MINOR_VERSION} " : " ${DETECTED_VERSION} " detected.")
@@ -95,6 +97,7 @@

 	if (NOT COMPILE_RESULT_FORMATS)
 		message(WARNING "Modules/ThirdParty/GDAL/gdalFormatsTest.cxx did not compile.")
+		set(COMPILE_ERRORS TRUE)
 	else()

 		if (NOT GDAL_HAS_J2K_JG2000 AND NOT GDAL_HAS_J2K_OPJG AND NOT GDAL_HAS_J2K_KAK AND NOT GDAL_HAS_J2K_ECW)
@@ -117,7 +120,7 @@

 	if (NOT COMPILE_RESULT_CREATE)
 		message(WARNING "Modules/ThirdParty/GDAL/gdalCreateTest.cxx did not compile.")
-
+		set(COMPILE_ERRORS TRUE)
 	elseif (NOT GDAL_CAN_CREATE_GEOTIFF)
 			message(WARNING "GDAL can't create geotiff files.")
 			set(GDAL_QUALIFIES FALSE)
@@ -126,8 +129,7 @@

 	if (NOT COMPILE_RESULT_CREATECOPY)
 		message(WARNING "Modules/ThirdParty/GDAL/gdalCreateCopyTest.cxx did not compile.")
-
-	else()
+		set(COMPILE_ERRORS TRUE)

 		if (NOT GDAL_CAN_CREATE_BIGTIFF)
 			message(WARNING "No BIGTIFF capatilities.")
@@ -169,6 +171,7 @@
 			# Warning messages
 			if (NOT COMPILE_RESULT_SYMBOLS)
 				message(WARNING "Modules/ThirdParty/GDAL/gdalSymbolsTest.cxx did not compile.")
+				set(COMPILE_ERRORS TRUE)
 			elseif (${RUN_RESULT_SYMBOLS} EQUAL 1)
 				message(WARNING "Internal versions of libtiff/libgeotiff detected without symbol renaming (when configuring GDAL, if options --with-libtiff or --with-geotiff are set to 'internal', then options --with-rename-internal-libtiff-symbols and --with-rename-internal-libgeotiff-symbols should be set to 'yes').")
 				set(GDAL_QUALIFIES FALSE)
@@ -181,7 +184,7 @@
 	endif() #UNIX

-	if (GDAL_QUALIFIES)
+	if(GDAL_QUALIFIES AND NOT COMPILE_ERRORS)
 		message(STATUS " >> Yes")
 	else()
 		message(STATUS " >> No")


Fixed typo in EnableUpstreamTargets.cmake

--- src/cmake/EnableUpstreamTargets.cmake
+++ src/cmake/EnableUpstreamTargets.cmake
@@ -16,7 +16,8 @@
 # If package is an upstream target, <packagename>_FOUND is set to TRUE
 macro(find_package)
     get_property(UPSTREAM_TARGETS GLOBAL PROPERTY UPSTREAM_TARGETS)
-    if(NOT "${ARGV0}" IN_LIST UPSTREAM_TARGETS)
+    set(target_name "${ARGV0}")
+    if(NOT ${target_name} IN_LIST UPSTREAM_TARGETS)
         _find_package(${ARGV})
     else()
         set("${target_name}_FOUND" TRUE PARENT_SCOPE)


ENH: Update SCIFIO remote module to 2019-12-11 Git master

 Matt McCormick (6):
   ENH: Update bundled JRE to Java 11
   ENH: Bump bio-formats version to 6.3.0
   ENH: Add Azure Pipelines configuration
   DOC: Add Azure Pipeline CI badge to README
   COMP: Avoid getenv with Visual Studio
   BUG: Remove Python packages from the testing configuration

--- Modules/Remote/SCIFIO.remote.cmake
+++ Modules/Remote/SCIFIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(SCIFIO
   "SCIFIO (Bioformats) ImageIO plugin for ITK"
   GIT_REPOSITORY ${git_protocol}://github.com/scifio/scifio-imageio.git
-  GIT_TAG 5081a00976cd67c782715a6df2bd4db1071eac3c
+  GIT_TAG 5ea114902b8da5de6ccde139237b6e39409b7730
   )


update git tag for GRM

update git tag for GRM

--- Modules/Remote/otbGRM.remote.cmake
+++ Modules/Remote/otbGRM.remote.cmake
@@ -12,5 +12,5 @@
 http://tully.ups-tlse.fr/lassallep/grm
 "
   GIT_REPOSITORY https://github.com/orfeotoolbox/GRM
-  GIT_TAG c53a61d12b895a85c3909130021988730c309cb7
+  GIT_TAG 209161cc0b3fadad7999e80b83838868f430289e
 )


This is actually not required, if you're holding CMake the right way.

--- x86_energyConfig.cmake
+++ x86_energyConfig.cmake
@@ -1,6 +1,4 @@
 include("${CMAKE_CURRENT_LIST_DIR}/x86_energyTargets.cmake")
-
-set(x86_energy_FOUND TRUE)

 get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
 get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)


set SIRF_TAG to v2.1.0-rc.3

set SIRF_TAG to v2.1.0-rc.3

--- version_config.cmake
+++ version_config.cmake
@@ -187,7 +187,7 @@
   set(DEFAULT_CCPi-Astra_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG v2.1.0-rc.2)
+  set(DEFAULT_SIRF_TAG v2.1.0-rc.3)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


updated to SIRF 2.1.0-rc.1

updated to SIRF 2.1.0-rc.1

--- version_config.cmake
+++ version_config.cmake
@@ -183,7 +183,7 @@
   set(DEFAULT_CCPi-Astra_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG b9b8bcd0589ea64737a186ab2fdc79cc37d42d34)
+  set(DEFAULT_SIRF_TAG v2.1.0-rc.1)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


Modified unity build support to take ".cxx" (which are generated by qt) into account.

--- CMakeModules/OgreAddTargets.cmake
+++ CMakeModules/OgreAddTargets.cmake
@@ -70,7 +70,7 @@
       # test if file is more than just a header
       get_filename_component(_EXT ${_FILE} EXT)
       list(FIND _EXCLUDES ${_FILE} _EXCLUDED)
-      if ((_EXT STREQUAL ".cpp") AND (_EXCLUDED EQUAL "-1"))
+      if (((_EXT STREQUAL ".cpp") OR (_EXT STREQUAL ".cxx")) AND (_EXCLUDED EQUAL "-1"))
         set(_FILE_CONTENTS "${_FILE_CONTENTS}\#include \"${_FILE}\"\n")
         math(EXPR _FILE_CNT "${_FILE_CNT}+1")
         if(_FILE_CNT EQUAL OGITOR_UNITY_FILES_PER_UNIT)


- исправлен cmake генерации грамматик

 - исправлен cmake генерации грамматик

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12665 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/split-bison.cmake
+++ rdo/packages/cmake/trunk/split-bison.cmake
@@ -33,7 +33,7 @@
 	SET(BISON_${INPUT_FILE}_OUTPUT_HEADER)
 	IF(${ARGC} GREATER 4 OR ${ARGC} EQUAL 4)
 		SET(BISON_${INPUT_FILE}_OUTPUT_HEADER ${GRAMMA_H})
-		SET(BISON_DEFINE -defines ${BISON_${INPUT_FILE}_OUTPUT_HEADER})
+		SET(BISON_DEFINE -defines\ ${BISON_${INPUT_FILE}_OUTPUT_HEADER})
 		LIST(APPEND OUTPUT_FILE ${BISON_${INPUT_FILE}_OUTPUT_HEADER})
 	ENDIF()


Fix #148: catch always gets downloaded, even if COMPILE_TESTS=NO

--- cmake/CMakeDependencies.cmake
+++ cmake/CMakeDependencies.cmake
@@ -43,14 +43,15 @@
 # find doxygen
 find_package(Doxygen)

+if (${COMPILE_TESTS})

 find_package(Catch)
-
-if(NOT CATCH_FOUND)
-    message("Could not find catch, downloading it now")
-    # Includes Catch in the project:
-    add_subdirectory(${CMAKE_SOURCE_DIR}/src/catch)
-    include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
-else()
-    INCLUDE_DIRECTORIES(${CATCH_INCLUDE_DIRS})
+	if(NOT CATCH_FOUND)
+	    message("Could not find catch, downloading it now")
+	    # Includes Catch in the project:
+	    add_subdirectory(${CMAKE_SOURCE_DIR}/src/catch)
+	    include_directories(${CATCH_INCLUDE_DIR} ${COMMON_INCLUDES})
+	else()
+    	INCLUDE_DIRECTORIES(${CATCH_INCLUDE_DIRS})
+	endif()
 endif()


Remove obsolete FindGMock.cmake file

Remove obsolete FindGMock.cmake file

--- cmake/Modules/FindGMock.cmake
+++ cmake/Modules/FindGMock.cmake
@@ -1,129 +0,0 @@
-# Locate the Google C++ Mocking Framework.
-# (This file is almost an identical copy of the original FindGTest.cmake file,
-#  feel free to use it as it is or modify it for your own needs.)
-#
-#
-# Defines the following variables:
-#
-#   GMOCK_FOUND - Found the Google Testing framework
-#   GMOCK_INCLUDE_DIRS - Include directories
-#
-# Also defines the library variables below as normal
-# variables. These contain debug/optimized keywords when
-# a debugging library is found.
-#
-#   GMOCK_BOTH_LIBRARIES - Both libgmock & libgmock-main
-#   GMOCK_LIBRARIES - libgmock
-#   GMOCK_MAIN_LIBRARIES - libgmock-main
-#
-# Accepts the following variables as input:
-#
-#   GMOCK_ROOT - (as a CMake or environment variable)
-#                The root directory of the gmock install prefix
-#
-#   GMOCK_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
-#                       "MD" or "MT" to enable searching a gmock build tree
-#                       (defaults: "MD")
-#
-#-----------------------
-# Example Usage:
-#
-#    find_package(GMock REQUIRED)
-#    include_directories(${GMOCK_INCLUDE_DIRS})
-#
-#    add_executable(foo foo.cc)
-#    target_link_libraries(foo ${GMOCK_BOTH_LIBRARIES})
-#
-#=============================================================================
-# This file is released under the MIT licence:
-#
-# Copyright (c) 2011 Matej Svec
-#
-# 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
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#=============================================================================
-
-
-function(_gmock_append_debugs _endvar _library)
-  if(${_library} AND ${_library}_DEBUG)
-    set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
-  else()
-    set(_output ${${_library}})
-  endif()
-  set(${_endvar} ${_output} PARENT_SCOPE)
-endfunction()
-
-function(_gmock_find_library _name)
-  find_library(${_name}
-    NAMES ${ARGN}
-    HINTS
-      $ENV{GMOCK_ROOT}
-      ${GMOCK_ROOT}
-    PATH_SUFFIXES ${_gmock_libpath_suffixes}
-  )
-  mark_as_advanced(${_name})
-endfunction()
-
-
-if(NOT DEFINED GMOCK_MSVC_SEARCH)
-  set(GMOCK_MSVC_SEARCH MD)
-endif()
-
-set(_gmock_libpath_suffixes lib)
-if(MSVC)
-  if(GMOCK_MSVC_SEARCH STREQUAL "MD")
-    list(APPEND _gmock_libpath_suffixes
-      msvc/gmock-md/Debug
-      msvc/gmock-md/Release)
-  elseif(GMOCK_MSVC_SEARCH STREQUAL "MT")
-    list(APPEND _gmock_libpath_suffixes
-      msvc/gmock/Debug
-      msvc/gmock/Release)
-  endif()
-endif()
-
-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
-  HINTS
-    $ENV{GMOCK_ROOT}/include
-    ${GMOCK_ROOT}/include
-)
-mark_as_advanced(GMOCK_INCLUDE_DIR)
-
-if(MSVC AND GMOCK_MSVC_SEARCH STREQUAL "MD")
-  # The provided /MD project files for Google Mock add -md suffixes to the
-  # library names.
-  _gmock_find_library(GMOCK_LIBRARY            gmock-md  gmock)
-  _gmock_find_library(GMOCK_LIBRARY_DEBUG      gmock-mdd gmockd)
-  _gmock_find_library(GMOCK_MAIN_LIBRARY       gmock_main-md  gmock_main)
-  _gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_main-mdd gmock_maind)
-else()
-  _gmock_find_library(GMOCK_LIBRARY            gmock)
-  _gmock_find_library(GMOCK_LIBRARY_DEBUG      gmockd)
-  _gmock_find_library(GMOCK_MAIN_LIBRARY       gmock_main)
-  _gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind)
-endif()
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY)
-
-if(GMOCK_FOUND)
-  set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})
-  _gmock_append_debugs(GMOCK_LIBRARIES      GMOCK_LIBRARY)
-  _gmock_append_debugs(GMOCK_MAIN_LIBRARIES GMOCK_MAIN_LIBRARY)
-  set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARIES} ${GMOCK_MAIN_LIBRARIES})
-endif()


update: using SYSTEM tag for INCLUDE_DIRECTORIES

--- cmake/SetupCompilerPost.cmake
+++ cmake/SetupCompilerPost.cmake
@@ -23,21 +23,21 @@
 # with gcc/clang handle boost/glm/gli include dirs like system-header dirs, i.e. do not warn
 # questionable things from there; note: only works for real non-system-header dirs!
 IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-  IF(NOT ${Boost_INCLUDE_DIR} STREQUAL "/usr/include")
-    ADD_DEFINITIONS("-isystem ${Boost_INCLUDE_DIR}")
-  ENDIF()
-
-  IF(NOT ${GLM_INCLUDE_DIR} STREQUAL "/usr/include")
-    ADD_DEFINITIONS("-isystem ${GLM_INCLUDE_DIR}")
-  ENDIF()
-
-  IF(NOT ${GLI_INCLUDE_DIR} STREQUAL "/usr/include")
-    ADD_DEFINITIONS("-isystem ${GLI_INCLUDE_DIR}")
-  ENDIF()
-ELSE()
-  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
-  INCLUDE_DIRECTORIES(${GLM_INCLUDE_DIR})
-  INCLUDE_DIRECTORIES(${GLI_INCLUDE_DIR})
+#   IF(NOT ${Boost_INCLUDE_DIR} STREQUAL "/usr/include")
+#     ADD_DEFINITIONS("-isystem ${Boost_INCLUDE_DIR}")
+#   ENDIF()
+#
+#   IF(NOT ${GLM_INCLUDE_DIR} STREQUAL "/usr/include")
+#     ADD_DEFINITIONS("-isystem ${GLM_INCLUDE_DIR}")
+#   ENDIF()
+#
+#   IF(NOT ${GLI_INCLUDE_DIR} STREQUAL "/usr/include")
+#     ADD_DEFINITIONS("-isystem ${GLI_INCLUDE_DIR}")
+#   ENDIF()
+# ELSE()
+  INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIR})
+  INCLUDE_DIRECTORIES(SYSTEM ${GLM_INCLUDE_DIR})
+  INCLUDE_DIRECTORIES(SYSTEM ${GLI_INCLUDE_DIR})
 ENDIF()

 IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC")


Link ARMPL with libgfortran when using GCC

Arm Performance Libraries versions at least >= 20.03 need a Fortran
runtime library.

--- cmake/modules/FindARMPL.cmake
+++ cmake/modules/FindARMPL.cmake
@@ -40,7 +40,7 @@
 set_target_properties(ARMPL::ARMPL
   PROPERTIES INTERFACE_COMPILE_DEFINITIONS INTEGER32
              INTERFACE_INCLUDE_DIRECTORIES "${ARMPL_INCLUDE_DIRS}"
-             INTERFACE_LINK_LIBRARIES "${ARMPL_LIBRARIES};OpenMP::OpenMP_CXX"
+             INTERFACE_LINK_LIBRARIES "${ARMPL_LIBRARIES};$<$<CXX_COMPILER_ID:GNU>:gfortran>;OpenMP::OpenMP_CXX"
 )

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


Makes rosidl interfaces generation action folder aware.

--- rosidl_generator_dds_idl/cmake/rosidl_generate_dds_interfaces.cmake
+++ rosidl_generator_dds_idl/cmake/rosidl_generate_dds_interfaces.cmake
@@ -40,6 +40,7 @@
   set(_output_basepath "${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_dds_idl/${PROJECT_NAME}")
   set(_generated_msg_files "")
   set(_generated_srv_files "")
+  set(_generated_action_files "")
   foreach(_idl_file ${_ARG_IDL_FILES})
     get_filename_component(_extension "${_idl_file}" EXT)
     get_filename_component(_parent_folder "${_idl_file}" DIRECTORY)
@@ -54,6 +55,8 @@
         list(APPEND _generated_msg_files "${_output_path}/${_name}_.idl")
       elseif(_parent_folder STREQUAL "srv")
         list(APPEND _generated_srv_files "${_output_path}/${_name}_.idl")
+      elseif(_parent_folder STREQUAL "action")
+        list(APPEND _generated_action_files "${_output_path}/${_name}_.idl")
       else()
         message(FATAL_ERROR "Interface file with unknown parent folder: ${_idl_file}")
       endif()
@@ -108,7 +111,7 @@
   )

   add_custom_command(
-    OUTPUT ${_generated_msg_files} ${_generated_srv_files}
+    OUTPUT ${_generated_msg_files} ${_generated_srv_files} ${_generated_action_files}
     COMMAND ${PYTHON_EXECUTABLE} ${rosidl_generator_dds_idl_BIN}
     --generator-arguments-file "${generator_arguments_file}"
     --subfolders ${_ARG_OUTPUT_SUBFOLDERS}
@@ -121,14 +124,16 @@
   add_custom_target(
     ${target}
     DEPENDS
-    ${_generated_msg_files} ${_generated_srv_files}
+    ${_generated_msg_files} ${_generated_srv_files} ${_generated_action_files}
   )

   set(_msg_destination "share/${PROJECT_NAME}/msg")
   set(_srv_destination "share/${PROJECT_NAME}/srv")
+  set(_action_destination "share/${PROJECT_NAME}/action")
   foreach(_subfolder ${_ARG_OUTPUT_SUBFOLDERS})
     set(_msg_destination "${_msg_destination}/${_subfolder}")
     set(_srv_destination "${_srv_destination}/${_subfolder}")
+    set(_action_destination "${_action_destination}/${_subfolder}")
   endforeach()
   if(NOT rosidl_generate_interfaces_SKIP_INSTALL)
     if(NOT _generated_msg_files STREQUAL "")
@@ -143,5 +148,11 @@
         DESTINATION "${_srv_destination}"
       )
     endif()
+    if(NOT _generated_action_files STREQUAL "")
+      install(
+        FILES ${_generated_action_files}
+        DESTINATION "${_action_destination}"
+      )
+    endif()
   endif()
 endmacro()


SVN_SILENT made messages (.desktop file)

--- vlc/vlc.desktop.cmake
+++ vlc/vlc.desktop.cmake
@@ -18,6 +18,7 @@
 Name[es]=VLC
 Name[et]=VLC
 Name[hu]=VLC
+Name[nb]=VLC
 Name[nds]=VLC
 Name[nl]=VLC
 Name[pa]=VLC
@@ -35,6 +36,7 @@
 Name[zh_TW]=VLC

 Comment=Phonon VLC backend
+Comment[bs]=VLC kao pozadina za Phonon
 Comment[ca]=Dorsal del VLC pel Phonon
 Comment[ca@valencia]=Dorsal del VLC pel Phonon
 Comment[cs]=Podpůrná vrstva VLC
@@ -43,6 +45,7 @@
 Comment[es]=Motor VLC para Phonon
 Comment[et]=Phononi VLC taustaprogramm
 Comment[hu]=Phonon VLC-backend
+Comment[nb]=Phonon VLC-motor
 Comment[nds]=VLC-Hülpprogramm för Phonon
 Comment[nl]=VLC-backend van Phonon
 Comment[pa]=ਫੋਨੋਨ VLC ਬੈਕਐਂਡ


make sure that regex does not match cmake

--- cmake/EigenConfigureTesting.cmake
+++ cmake/EigenConfigureTesting.cmake
@@ -26,7 +26,7 @@
 # try to grab the default flags
 string(REGEX MATCH "MakeCommand:.*-- (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
 if(NOT CMAKE_MATCH_1)
-string(REGEX MATCH "MakeCommand:.*make (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
+string(REGEX MATCH "MakeCommand:.*[^c]make (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
 endif()
 string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config \"\${CTEST_CONFIGURATION_TYPE}\" -- ${CMAKE_MATCH_1} ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
        EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE})


Improve coding style.

Improve coding style.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1260,7 +1260,7 @@

 #----------------------------------------------------------------------------
 # function ROOT_ADD_GTEST(<testsuite> source1 source2... LIBRARIES)
-#
+#----------------------------------------------------------------------------
 function(ROOT_ADD_GTEST test_suite)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LIBRARIES" ${ARGN})
   include_directories(${CMAKE_CURRENT_BINARY_DIR} ${GTEST_INCLUDE_DIR} ${GMOCK_INCLUDE_DIR})
@@ -1278,7 +1278,6 @@
   ROOT_PATH_TO_STRING(mangled_name ${test_suite} PATH_SEPARATOR_REPLACEMENT "-")
   ROOT_ADD_TEST(gtest${mangled_name} COMMAND ${test_suite} WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR})
 endfunction()
-

 #----------------------------------------------------------------------------
 # ROOT_ADD_TEST_SUBDIRECTORY( <name> )


Correctly escape regex dot in RootNewMacros.cmake

CMake requires two backslashes here (one for escaping the backslash
in our string, and then the \. for regex to recognize it's a literal dot).

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -474,7 +474,7 @@
     # FIXME: Krb5Auth.h triggers "declaration of '__mb_cur_max' has a different language linkage"
     # problem.
     # FIXME: error: declaration of 'NSObject' must be imported from module 'ROOT.libBonjour.so.TBonjourBrowser.h' before it is required
-    if (${library} MATCHES "libKrb5Auth.so" OR ${library} MATCHES "(libGCocoa|libGQuartz)\..*")
+    if (${library} MATCHES "libKrb5Auth.so" OR ${library} MATCHES "(libGCocoa|libGQuartz)\\..*")
       return()
     endif()
   endif(APPLE)
@@ -495,7 +495,7 @@

   set(modulemap_entry "module \"${library}\" {")
   # For modules GCocoa and GQuartz we need objc context.
-  if (${library} MATCHES "(libGCocoa|libGQuartz)\..*")
+  if (${library} MATCHES "(libGCocoa|libGQuartz)\\..*")
     set (modulemap_entry "${modulemap_entry}\n  requires objc\n")
   else()
     set (modulemap_entry "${modulemap_entry}\n  requires cplusplus\n")


Add nsync lib to onnxruntime_mlas_test's deps (#1199)

* Add nsync lib to onnxruntime_mlas_test's deps

--- cmake/onnxruntime_unittests.cmake
+++ cmake/onnxruntime_unittests.cmake
@@ -519,9 +519,13 @@
 onnxruntime_add_include_to_target(onnxruntime_perf_test gsl)

 if (onnxruntime_BUILD_SHARED_LIB)
-  target_link_libraries(onnxruntime_perf_test PRIVATE onnxruntime_test_utils onnx_test_runner_common onnxruntime_common
+  set(onnxruntime_perf_test_libs onnxruntime_test_utils onnx_test_runner_common onnxruntime_common
           onnx_test_data_proto onnx_proto libprotobuf ${GETOPT_LIB_WIDE} onnxruntime
-          ${SYS_PATH_LIB} ${CMAKE_DL_LIBS} Threads::Threads)
+          ${SYS_PATH_LIB} ${CMAKE_DL_LIBS})
+  if(onnxruntime_USE_NSYNC)
+    list(APPEND onnxruntime_perf_test_libs nsync_cpp)
+  endif()
+  target_link_libraries(onnxruntime_perf_test PRIVATE ${onnxruntime_perf_test_libs} Threads::Threads)
   if(tensorflow_C_PACKAGE_PATH)
     target_include_directories(onnxruntime_perf_test PRIVATE ${tensorflow_C_PACKAGE_PATH}/include)
     target_link_directories(onnxruntime_perf_test PRIVATE ${tensorflow_C_PACKAGE_PATH}/lib)
@@ -647,5 +651,10 @@

 add_executable(onnxruntime_mlas_test ${TEST_SRC_DIR}/mlas/unittest.cpp)
 target_include_directories(onnxruntime_mlas_test PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc)
-target_link_libraries(onnxruntime_mlas_test PRIVATE onnxruntime_mlas onnxruntime_common Threads::Threads)
+set(onnxruntime_mlas_test_libs onnxruntime_mlas onnxruntime_common)
+if(onnxruntime_USE_NSYNC)
+  list(APPEND onnxruntime_mlas_test_libs nsync_cpp)
+endif()
+list(APPEND onnxruntime_mlas_test_libs Threads::Threads)
+target_link_libraries(onnxruntime_mlas_test PRIVATE ${onnxruntime_mlas_test_libs})
 set_target_properties(onnxruntime_mlas_test PROPERTIES FOLDER "ONNXRuntimeTest")


Enforce -fPIC in shared libs

Enforce -fPIC in shared libs

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -204,6 +204,11 @@
 			target_compile_definitions(${name} PUBLIC _USE_MATH_DEFINES)
 		endif()

+		# for gcc and clang, we must build libraries as fPIC:
+		if(NOT MSVC)
+			target_compile_options(${name} PRIVATE "-fPIC")
+		endif()
+
 		set_target_properties(${name} PROPERTIES FOLDER "modules")
 		set(iftype PUBLIC)
 		add_coverage(${name})


removed FindOpenSubdiv.cmake

removed FindOpenSubdiv.cmake

--- common/cmake/FindOpenSubdiv.cmake
+++ common/cmake/FindOpenSubdiv.cmake
@@ -1,26 +0,0 @@
-## ======================================================================== ##
-## Copyright 2009-2016 Intel Corporation                                    ##
-##                                                                          ##
-## Licensed under the Apache License, Version 2.0 (the "License");          ##
-## you may not use this file except in compliance with the License.         ##
-## You may obtain a copy of the License at                                  ##
-##                                                                          ##
-##     http://www.apache.org/licenses/LICENSE-2.0                           ##
-##                                                                          ##
-## Unless required by applicable law or agreed to in writing, software      ##
-## distributed under the License is distributed on an "AS IS" BASIS,        ##
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
-## See the License for the specific language governing permissions and      ##
-## limitations under the License.                                           ##
-## ======================================================================== ##
-
-FIND_PATH( OPENSUBDIV_INCLUDE_DIR NAMES opensubdiv/version.h )
-FIND_LIBRARY( OPENSUBDIV_LIBRARY NAMES osdCPU)
-
-SET(OPENSUBDIV_LIBRARIES ${OPENSUBDIV_LIBRARY} )
-SET(OPENSUBDIV_INCLUDE_DIRS ${OPENSUBDIV_INCLUDE_DIR} )
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENSUBDIV DEFAULT_MSG OPENSUBDIV_INCLUDE_DIR OPENSUBDIV_LIBRARY)
-
-MARK_AS_ADVANCED(OPENSUBDIV_INCLUDE_DIR OPENSUBDIV_LIBRARY)


RPI - Fix 64-bit SHARED lib type build config.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -124,8 +124,12 @@

 # Extra linker flags for linking against indirect dependencies (linking shared lib with dependencies)
 if (RPI)
-    # Extra linker flags for Raspbian because it installs VideoCore libraries in the "/opt/vc/lib" directory (no harm in doing so for other distros)
-    set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-rpath-link,\"${CMAKE_SYSROOT}/opt/vc/lib\"")      # CMAKE_SYSROOT is empty when not cross-compiling
+    if (NOT NATIVE_64BIT)
+        # Extra linker flags for Raspbian because it installs VideoCore libraries in the "/opt/vc/lib" directory (no harm in doing so for other distros)
+        set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-rpath-link,\"${CMAKE_SYSROOT}/opt/vc/lib\"")      # CMAKE_SYSROOT is empty when not cross-compiling
+    else ()
+        set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-rpath-link,\"${CMAKE_SYSROOT}/usr/lib/aarch64-linux-gnu\"")
+    endif ()
 elseif (APPLE AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0.0)
     set (INDIRECT_DEPS_EXE_LINKER_FLAGS "${INDIRECT_DEPS_EXE_LINKER_FLAGS} -Wl,-no_weak_imports")
 endif ()


RPI - initialize the default ABI correctly for 64-bit build.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -153,7 +153,7 @@
 if (ARM AND NOT ANDROID AND NOT RPI AND NOT APPLE)
     set (ARM_ABI_FLAGS "" CACHE STRING "Specify ABI compiler flags (ARM on Linux platform only); e.g. Orange-Pi Mini 2 could use '-mcpu=cortex-a7 -mfpu=neon-vfpv4'")
 endif ()
-if ((RPI AND "${RPI_ABI}" MATCHES NEON) OR (ARM AND (APPLE OR URHO3D_64BIT OR "${ARM_ABI_FLAGS}" MATCHES neon)))    # Stringify in case RPI_ABI/ARM_ABI_FLAGS is not set explicitly
+if (RPI OR (ARM AND (APPLE OR URHO3D_64BIT OR "${ARM_ABI_FLAGS}" MATCHES neon)))    # Stringify in case ARM_ABI_FLAGS is not set explicitly
     # TODO: remove this logic when the compiler flags are set in each toolchain file, such that the CheckCompilerToolchain can perform the check automatically
     set (NEON 1)
 endif ()
@@ -335,7 +335,11 @@
             message (FATAL_ERROR "Specified RPI_ABI = \"${RPI_ABI}\" is not supported${MSG_STR}. Supported values are: \"${PRINTABLE_RPI_SUPPORTED_ABIS}\".")
         endif ()
     else ()
-        set (RPI_ABI RPI1)
+        if (NATIVE_64BIT)
+            set (RPI_ABI RPI4)
+        else ()
+            set (RPI_ABI RPI1)
+        endif ()
     endif ()
     set (RPI_ABI ${RPI_ABI} CACHE STRING "Specify target ABI (RPI platform only), possible values are RPI0, RPI1, RPI2, RPI3, RPI4" FORCE)
 endif ()


BUGFIX Correctly handle lapacke found by package config

--- CMakeModules/FindLAPACKE.cmake
+++ CMakeModules/FindLAPACKE.cmake
@@ -143,7 +143,7 @@
     ENDIF(LAPACKE_ROOT_DIR)
 ENDIF(PC_LAPACKE_FOUND)

-IF(LAPACKE_LIB AND LAPACK_LIB)
+IF(PC_LAPACKE_FOUND OR (LAPACKE_LIB AND LAPACK_LIB))
     SET(LAPACK_LIBRARIES ${LAPACKE_LIB} ${LAPACK_LIB})
 ENDIF()
 IF(LAPACKE_INCLUDES)


hard-code boost search path in configure_boost

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1298 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/ModuleSetup.cmake
+++ CMakeModules/ModuleSetup.cmake
@@ -149,6 +149,12 @@
         NAMES Boost boost
         COMPONENTS date_time filesystem system thread program_options unit_test_framework
         PREFIXES ${ENV_NAALI_DEP_PATH})
+
+    if (MSVC)
+        set (BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${ENV_NAALI_DEP_PATH}/include)
+        set (BOOST_LIBRARY_DIRS ${BOOST_LIBRARY_DIRS} ${ENV_NAALI_DEP_PATH}/lib)
+    endif ()
+
 endmacro (configure_boost)

 macro (configure_poco)


Fix PATH for "make test-web-app" to find rake.

--- build/cmake/test/test-web-app.cmake
+++ build/cmake/test/test-web-app.cmake
@@ -1,6 +1,6 @@
 add_custom_target(
   test-web-app-target
-  env INTEGRATION_TEST_SUITE=true bundle exec rake
+  env PATH=${STAGE_EMBEDDED_DIR}/bin:$ENV{PATH} INTEGRATION_TEST_SUITE=true bundle exec rake
   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/src/api-umbrella/web-app
 )


Update detection of *-install file

Update detection of *-install file

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -197,30 +197,36 @@
   #     Check run needed. If 'Stamp/<name-...>/<name-...>-install' file
   #     detected, no need to generate/run project
   set(need_to_run FALSE)
-  string(COMPARE EQUAL "${HUNTER_CMAKE_GENERATOR}" "Xcode" is_xcode)
-  if(HUNTER_PACKAGE_VARIANTS)
-    foreach(variant ${HUNTER_PACKAGE_VARIANTS})
+
+  foreach(variant ${HUNTER_PACKAGE_VARIANTS} "-")
+    string(COMPARE EQUAL "${variant}" "-" is_empty)
+    if(is_empty)
+      set(x "${HUNTER_PACKAGE_BASENAME}")
+    else()
       set(x "${HUNTER_PACKAGE_BASENAME}-${variant}")
-      if(is_xcode)
-        set(x "${HUNTER_BASE}/Stamp/${x}/Debug-iphoneos/${x}-install")
-      else()
-        set(x "${HUNTER_BASE}/Stamp/${x}/${x}-install")
-      endif()
-      if(NOT EXISTS "${x}")
-        set(need_to_run TRUE)
-      endif()
-    endforeach()
-  else()
-    set(x "${HUNTER_PACKAGE_BASENAME}")
-    if(is_xcode)
-      set(x "${HUNTER_BASE}/Stamp/${x}/Debug-iphoneos/${x}-install")
+    endif()
+    set(HUNTER_STAMP_RESULT "STAMP-NOTFOUND") # search again
+    find_file(
+        HUNTER_STAMP_RESULT
+        "${x}-install"
+        PATHS
+        "${HUNTER_BASE}/Stamp/${x}/"
+        NO_DEFAULT_PATH
+        PATH_SUFFIXES
+        Debug # tested on windows with Visual Studio 2013
+        Debug-iphoneos # tested on Mac OS X with Xcode
+    )
+    if(NOT HUNTER_STAMP_RESULT)
+      hunter_status_debug(
+          "file `${x}-install` not found in `${HUNTER_BASE}/Stamp/${x}`"
+      )
+      set(need_to_run TRUE)
     else()
-      set(x "${HUNTER_BASE}/Stamp/${x}/${x}-install")
+      hunter_status_debug(
+          "file `${x}-install` found: `${HUNTER_STAMP_RESULT}`"
+      )
     endif()
-    if(NOT EXISTS "${x}")
-      set(need_to_run TRUE)
-    endif()
-  endif()
+  endforeach()

   if(NOT need_to_run)
     hunter_status_debug("Skip generate/run (already installed)")


fix eventually static lib renaming, if static and shared lib are built if platform is not windows

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@981 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -472,11 +472,18 @@
   endif(WIN32 OR (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE))

   if (_and_static)
-      add_custom_command (TARGET ${_target}Static POST_BUILD
-                          COMMAND ${CMAKE_COMMAND} -E
-                          copy_if_different
-                            $<TARGET_FILE:${_target}Static>
-                            ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/$<TARGET_FILE_NAME:${_target}Static>)
+    if( ${CMAKE_BUILD_TYPE} STREQUAL Debug )
+      set ( postfix ${CMAKE_DEBUG_POSTFIX} )
+    else ()
+      set ( postfix "" )
+    endif ()
+
+    set( fullname ${_target}${postfix} )
+    add_custom_command (TARGET ${_target}Static POST_BUILD
+                        COMMAND ${CMAKE_COMMAND} -E
+                        copy_if_different
+                          $<TARGET_FILE:${_target}Static>
+                          ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/lib${fullname}.a)

   endif ()


Add CEGUI_INCLUDE_DIRS parent dir only for CEGUI 0.8+

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -223,7 +223,7 @@
 ################################################################################
 macro(add_parent_dir VAR DIR)
     get_filename_component(${DIR}_TEMP "${${DIR}}/.." ABSOLUTE)
-    set(${VAR} ${${DIR}_TEMP})
+    set(${VAR} ${${VAR}} ${${DIR}_TEMP})
 endmacro(add_parent_dir)

 ################################################################################
@@ -488,7 +488,14 @@
 set(CEGUI_INCLUDE_DIR ${CEGUI_CONFIG_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR})
 list(REMOVE_DUPLICATES CEGUI_INCLUDE_DIR)
 findpkg_finish(CEGUI)
-add_parent_dir(CEGUI_INCLUDE_DIRS CEGUI_INCLUDE_DIR)
+
+# Starting CEGUI 0.8, the headers are in the CEGUI subdirectory, and we must include
+# its parent rather than directly the subdirectory. Otherwise we'll get compiler errors.
+if ("${CEGUI_VERSION}" VERSION_GREATER "0.8.0")
+    add_parent_dir(CEGUI_INCLUDE_DIRS_TEMP CEGUI_INCLUDE_DIR)
+    message(${CEGUI_INCLUDE_DIRS_TEMP})
+    set(${CEGUI_INCLUDE_DIRS} ${CEGUI_INCLUDE_DIRS_TEMP})
+endif()
 set(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})

 mark_as_advanced(CEGUI_CONFIG_INCLUDE_DIR)


Expand list of possible names for iconv to appease the windows idiosyncrasies.

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

--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
@@ -15,7 +15,7 @@

 FIND_PATH(ICONV_INCLUDE_DIR iconv.h)

-FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv c)
+FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c)

 IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
    SET(ICONV_FOUND TRUE)


err. incorrect cmake function called

err. incorrect cmake function called

--- cmake/SuperFind.cmake
+++ cmake/SuperFind.cmake
@@ -11,7 +11,7 @@

 function(super_find_package name)
   set(PKG_NAME ${name})
-  set(TOUPPER ${name} PKG_NAME_)
+  string(TOUPPER ${name} PKG_NAME_)
   set(PKG_REPO ${PKG_NAME})
   set (extra_args ${ARGN})
   list(LENGTH extra_args num_extra_args)
@@ -20,14 +20,16 @@
   endif ()

   if(EXISTS ${ep_base}/Build/${PKG_NAME}/${PKG_NAME}Config.cmake)
-    message(STATUS "[SuperFind] ${PKG_NAME} using config from ${ep_base}/Build/${PKG_NAME}")
+    message(STATUS "[SuperFind] ${PKG_NAME} found using config from ${ep_base}/Build/${PKG_NAME}")
     find_package(${PKG_NAME} PATHS ${ep_base}/Build/${PKG_NAME})
   else()
-    message(STATUS "[SuperFind] ${PKG_NAME} no config")
     set(${PKG_NAME_}_FIND_QUIETLY TRUE)
     find_package(${PKG_NAME} QUIET)
+    if(${PKG_NAME_}_FOUND)
+      message(STATUS "[SuperFind] ${PKG_NAME} found from system")
+    endif()
   endif()
-
+
   if(NOT ${PKG_NAME_}_FOUND)
     message(STATUS "[SuperFind] Adding ExternalProject ${PKG_NAME}. update add_dependencies() if needed")
     ExternalProject_Add(${PKG_NAME}


cmake template

cmake template

--- cmake/compilers.cmake
+++ cmake/compilers.cmake
@@ -1,9 +1,7 @@
-
 if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
-  add_compile_options(-march=native)
+# mtune instead of march for better CPU compatibility
+  add_compile_options(-mtune=native)
   set(old_flags -std=legacy -w)
-
-  set(CMAKE_Fortran_FLAGS_DEBUG " -ffpe-trap=invalid,zero,overflow")
 elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
   if(WIN32)
     add_compile_options(/arch:native)


Add support for always configuring a file

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -14,12 +14,7 @@

 add_custom_target(configure ALL)

-function (vistk_configure_file name source dest)
-  set(configure_script
-    "${CMAKE_CURRENT_BINARY_DIR}/configure.${name}.cmake")
-  set(configured_path
-    "${configure_script}.output")
-
+function (_vistk_configure_file name source dest)
   file(WRITE "${configure_script}"
     "# Configure script for \"${source}\" -> \"${dest}\"\n")

@@ -43,8 +38,27 @@
           \"${configured_path}\"
           \"${dest}\")\n")

+  set(clean_files
+    "${dest}"
+    "${configured_path}"
+    "${configure_script}")
+
+  set_directory_properties(
+    PROPERTIES
+      ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}")
+endfunction (_vistk_configure_file)
+
+function (vistk_configure_file name source dest)
+  set(configure_script
+    "${CMAKE_CURRENT_BINARY_DIR}/configure.${name}.cmake")
+  set(configured_path
+    "${configure_script}.output")
+
+  _vistk_configure_file(${name} "${source}" "${dest}" ${ARGN})
+
   add_custom_command(
     OUTPUT  "${dest}"
+            ${extra_output}
     COMMAND "${CMAKE_COMMAND}"
             -P "${configure_script}"
     MAIN_DEPENDENCY
@@ -54,20 +68,19 @@
     WORKING_DIRECTORY
             "${CMAKE_CURRENT_BINARY_DIR}"
     COMMENT "Configuring ${name} file \"${source}\" -> \"${dest}\"")
-  add_custom_target(configure-${name}
+  add_custom_target(configure-${name} ${all}
     DEPENDS
       "${dest}")
   add_dependencies(configure
     configure-${name})
+endfunction (vistk_configure_file)

-  set(clean_files
-    "${dest}"
-    "${configure_script}")
+function (vistk_configure_file_always name source dest)
+  set(extra_output
+    "${dest}.noexist")

-  set_directory_properties(
-    PROPERTIES
-      ADDITIONAL_MAKE_CLEAN_FILES "${clean_files}")
-endfunction (vistk_configure_file)
+  vistk_configure_file(${name} "${source}" "${dest}" ${ARGN})
+endfunction (vistk_configure_file_always)

 function (vistk_configure_pkgconfig module)
   if (UNIX)


removed unused param from cmake macro (#1847)

Signed-off-by: XiaotaoGuo <20dff5fbf9060c78a8d3449aba3394fdcc12871a@outlook.com>

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -22,7 +22,7 @@
     "${OPTIONS}" "${ONE_VALUE_ARG}" "${MULTI_VALUE_ARGS}" ${ARGS})
 endmacro(_parse_arguments)

-macro(_common_compile_stuff VISIBILITY)
+macro(_common_compile_stuff)
   set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}")

   set_target_properties(${NAME} PROPERTIES
@@ -34,7 +34,7 @@

 function(google_test NAME ARG_SRC)
   add_executable(${NAME} ${ARG_SRC})
-  _common_compile_stuff("PRIVATE")
+  _common_compile_stuff()

   # Make sure that gmock always includes the correct gtest/gtest.h.
   target_include_directories("${NAME}" SYSTEM PRIVATE
@@ -49,7 +49,7 @@

   add_executable(${NAME} ${ARG_SRCS})

-  _common_compile_stuff("PRIVATE")
+  _common_compile_stuff()

   install(TARGETS "${NAME}" RUNTIME DESTINATION bin)
 endfunction()


small fix

small fix

--- cmake/gsDataDir.cmake
+++ cmake/gsDataDir.cmake
@@ -20,6 +20,6 @@

 # Set default search paths
 if (NOT DEFINED GISMO_SEARCH_PATHS)
-	set(GISMO_SEARCH_PATHS "${GISMO_DATA_DIR}" CACHE string
+	set(GISMO_SEARCH_PATHS "${GISMO_DATA_DIR}" CACHE STRING
 		"Define paths where files should be searched; seperated by semicolon.")
 endif()


[brief] Changes linking flags for Unix systems.

[detailed]
- The previous flag (c++11) does not include all the functionality that is used in
  Atlas. This has now been changed to gcc++14.

--- config/Compiler.cmake
+++ config/Compiler.cmake
@@ -32,7 +32,7 @@
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zl")
 else()
     set(CMAKE_CXX_FLAGS_DEBUG "-g")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++14")

     # Clang requires an additional library to be linked to use C++11.
     if (ATLAS_COMPILER_CLANG)


Fix Boost variable usage, Boost is in lower case

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -168,7 +168,7 @@
   ${CEGUI_INCLUDE_DIRS}
   ${OIS_INCLUDE_DIRS}
   ${Cg_INCLUDE_DIRS}
-  ${BOOST_INCLUDE_DIRS}
+  ${Boost_INCLUDE_DIRS}
   ${X11_INCLUDE_DIR}
   ${DirectX_INCLUDE_DIRS}
   ${CppUnit_INCLUDE_DIRS}
@@ -178,7 +178,7 @@
 link_directories(
   ${OPENGL_LIBRARY_DIRS}
   ${Cg_LIBRARY_DIRS}
-  ${BOOST_LIBRARY_DIRS}
+  ${Boost_LIBRARY_DIRS}
   ${X11_LIBRARY_DIRS}
   ${DirectX_LIBRARY_DIRS}
   ${CppUnit_LIBRARY_DIRS}


MSVC: zlib, libtiff, libpng external for ITK

--- CMake/External_ITK.cmake
+++ CMake/External_ITK.cmake
@@ -15,10 +15,10 @@
   set(ITK_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
   set(ITK_SB_SRC_DIR ${CMAKE_BINARY_DIR}/${proj}/src/${proj})

-  if(MSVC)
-    set(ITK_SB_SRC_DIR "C:/Temp/ITK")
-    set(ITK_SB_BUILD_DIR ${ITK_SB_SRC_DIR}/build)
-  endif()
+  # if(MSVC)
+    # set(ITK_SB_SRC_DIR "C:/Temp/ITK")
+    # set(ITK_SB_BUILD_DIR ${ITK_SB_SRC_DIR}/build)
+  # endif()

   set(ITK_ENABLED_MODULES
     Common
@@ -132,7 +132,52 @@

   # TODO : handle different build type (Release/Debug)

-  # TODO : handle system zlib
+    if(USE_SYSTEM_TIFF)
+    set(ITK_SB_TIFF_CONFIG)
+  else()
+    set(ITK_SB_TIFF_CONFIG
+      -DTIFF_INCLUDE_DIR:STRING=${CMAKE_INSTALL_PREFIX}/include
+      -DTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/libtiff.so
+      )
+    list(APPEND ${proj}_DEPENDENCIES TIFF)
+  endif()
+
+    if(USE_SYSTEM_EXPAT)
+    set(ITK_SB_EXPAT_CONFIG)
+  else()
+    set(ITK_SB_EXPAT_CONFIG
+      -DEXPAT_INCLUDE_DIR:STRING=${CMAKE_INSTALL_PREFIX}/include
+      -DEXPAT_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/libexpat.so
+      )
+    list(APPEND ${proj}_DEPENDENCIES EXPAT)
+  endif()
+
+    if(USE_SYSTEM_PNG)
+    set(ITK_SB_PNG_CONFIG)
+  else()
+    set(ITK_SB_PNG_CONFIG
+      -DPNG_INCLUDE_DIR:STRING=${CMAKE_INSTALL_PREFIX}/include
+      -DPNG_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/libpng.so
+      )
+    list(APPEND ${proj}_DEPENDENCIES EXPAT)
+  endif()
+
+    if(USE_SYSTEM_ZLIB)
+    set(ITK_SB_ZLIB_CONFIG)
+  else()
+    set(ITK_SB_ZLIB_CONFIG
+      -DZLIB_INCLUDE_DIR:STRING=${CMAKE_INSTALL_PREFIX}/include
+      -DZLIB_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/libz.so
+      )
+    list(APPEND ${proj}_DEPENDENCIES ZLIB)
+  endif()
+
+  if(MSVC)
+    set(ITK_SB_ZLIB_CONFIG)
+    set(ITK_SB_EXPAT_CONFIG)
+    set(ITK_SB_TIFF_CONFIG)
+    set(ITK_SB_PNG_CONFIG)
+  endif()

   ExternalProject_Add(${proj}
     PREFIX ${proj}
@@ -151,7 +196,14 @@
       -DBUILD_TESTING:BOOL=OFF
       -DBUILD_EXAMPLES:BOOL=OFF
       -DITK_USE_SYSTEM_EXPAT:BOOL=ON
+      -DITK_USE_SYSTEM_ZLIB:BOOL=ON
+      -DITK_USE_SYSTEM_TIFF:BOOL=ON
+      -DITK_USE_SYSTEM_PNG:BOOL=ON
       ${ITK_SB_FFTW_CONFIG}
+      ${ITK_SB_TIFF_CONFIG}
+      ${ITK_SB_EXPAT_CONFIG}
+      ${ITK_SB_ZLIB_CONFIG}
+      ${ITK_SB_PNG_CONFIG}
     PATCH_COMMAND ${CMAKE_COMMAND} -E copy
       ${CMAKE_SOURCE_DIR}/patches/ITK/hashtable.hxx.in
       ${ITK_SB_SRC_DIR}/Modules/ThirdParty/KWSys/src/KWSys


Exlude __xmod__ directry as well

Exlude __xmod__ directry as well

--- test/claw_reference_test.cmake
+++ test/claw_reference_test.cmake
@@ -693,7 +693,8 @@
   file(GLOB children RELATIVE ${curdir} ${curdir}/*)
   set(dirlist "")
   foreach(child ${children})
-    if(IS_DIRECTORY ${curdir}/${child} AND NOT "${child}" STREQUAL "CMakeFiles")
+    if(IS_DIRECTORY ${curdir}/${child} AND NOT "${child}" STREQUAL "CMakeFiles"
+      AND NOT "${child}" STREQUAL "__xmod__")
       list(APPEND dirlist ${child})
     endif()
   endforeach()


fix for missing windows MSI script config.vbs

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -195,7 +195,7 @@
 	install ( DIRECTORY ${CPACK_WIX_BITMAP_FOLDER}
 			DESTINATION ${C_ETC}/WiX)

-	install ( FILES ${CONDOR_SOURCE_DIR}/msconfig/license.rtf ${CONDOR_SOURCE_DIR}/msconfig/do_wix.bat
+	install ( FILES ${CONDOR_SOURCE_DIR}/msconfig/license.rtf ${CONDOR_SOURCE_DIR}/msconfig/do_wix.bat ${CONDOR_SOURCE_DIR}/msconfig/WiX/config.vbs
 			  DESTINATION ${C_ETC}/WiX )

     # the following will dump a header used to insert file info into bin's


[CMake] Force into cache variable set if CMake < 3.14 (integrate eb3743)

--- cmake/modules/SearchRootCoreDeps.cmake
+++ cmake/modules/SearchRootCoreDeps.cmake
@@ -96,7 +96,7 @@

   find_package(NumPy)

-  set(PYTHON_VERSION_STRING "${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}")
+  set(PYTHON_VERSION_STRING "${PYTHON_VERSION_MAJOR}_${PYTHON_VERSION_MINOR}" CACHE INTERNAL "" FORCE)

 endif()


odb-boost: bump internal deps id

odb-boost: bump internal deps id

--- cmake/projects/odb-boost/hunter.cmake
+++ cmake/projects/odb-boost/hunter.cmake
@@ -27,5 +27,5 @@
     PACKAGE_UNRELOCATABLE_TEXT_FILES
     "lib/libodb-boost.la"
     "lib/pkgconfig/libodb-boost.pc"
-    PACKAGE_INTERNAL_DEPS_ID "2"
+    PACKAGE_INTERNAL_DEPS_ID "3"
 )


reversing accidental merge

reversing accidental merge

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@48327 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -10,18 +10,13 @@

 ## preprocessor definitions we want everywhere
 add_c_defines(
+  _SVID_SOURCE
+  _XOPEN_SOURCE=600
   _FILE_OFFSET_BITS=64
   _LARGEFILE64_SOURCE
   __STDC_FORMAT_MACROS
   __STDC_LIMIT_MACROS
-  __LONG_LONG_SUPPORTED
-  )
-if (NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
-  add_c_defines(
-    _SVID_SOURCE
-    _XOPEN_SOURCE=600
-    )
-endif ()
+  )

 ## add TOKU_PTHREAD_DEBUG for debug builds
 set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG)
@@ -94,12 +89,6 @@
 if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
   set_cflags_if_supported(
     -Wpacked
-    )
-endif ()
-
-if (CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
-  set_cflags_if_supported(
-    -Wno-error=unused-but-set-variable
     )
 endif ()


FIX: Forgot a NOT ;)

FIX: Forgot a NOT ;)

--- include/BALL/VIEW/KERNEL/sources.cmake
+++ include/BALL/VIEW/KERNEL/sources.cmake
@@ -3,7 +3,7 @@

 FILE(GLOB HEADERS_LIST "include/BALL/${GROUP}/*.h" "include/BALL/${GROUP}/*.iC")

-IF(BALL_HAS_ASIO)
+IF(NOT BALL_HAS_ASIO)
 	LIST(REMOVE_ITEM HEADERS_LIST "${CMAKE_CURRENT_SOURCE_DIR}/include/BALL/${GROUP}/serverWidget.h")
 ENDIF()


set dir for continuous build

set dir for continuous build

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3492 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/test/openVibeTests.cmake
+++ trunk/test/openVibeTests.cmake
@@ -56,7 +56,8 @@
 ENDIF(${CTEST_SCRIPT_ARG} MATCHES Continuous)

 IF(${MODEL} MATCHES Continuous)
-	set(OV-ROOT-DIR              "/tmp/con.ov")
+	set(OV-ROOT-DIR              "con.ov")
+	file(MAKE_DIRECTORY ${OV-ROOT-DIR})
 ELSE(${MODEL} MATCHES Continuous)
 	# create a temporary directory with very short name to host build
 	exec_program("mktemp" ARGS "--tmpdir -d ov.XXX" OUTPUT_VARIABLE OV-ROOT-DIR)


SH-2789 WIP - fix for linux build failure

--- indra/cmake/GooglePerfTools.cmake
+++ indra/cmake/GooglePerfTools.cmake
@@ -47,7 +47,7 @@
 # Apparently buggy - LL_USE_TCMALLOC never gets set. Fix when we have time to test the
 # corresponding source code.
 if (USE_TCMALLOC)
-  set(TCMALLOC_FLAG -ULL_USE_TCMALLOC=1)
+  set(TCMALLOC_FLAG -ULL_USE_TCMALLOC) # was -ULL_USE_TCMALLOC=1 which makes no sense.
 else (USE_TCMALLOC)
   set(TCMALLOC_FLAG -ULL_USE_TCMALLOC)
 endif (USE_TCMALLOC)


Sort mallctl, fix comment for mallinfo.

Sort mallctl, fix comment for mallinfo.

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

--- include/llvm/Config/config.h.cmake
+++ include/llvm/Config/config.h.cmake
@@ -148,7 +148,10 @@
 /* Define to 1 if you have the <mach/mach.h> header file. */
 #cmakedefine HAVE_MACH_MACH_H ${HAVE_MACH_MACH_H}

-/* Define if mallinfo() is available on this platform. */
+/* Define to 1 if you have the `mallctl` function. */
+#cmakedefine HAVE_MALLCTL ${HAVE_MALLCTL}
+
+/* Define to 1 if you have the `mallinfo' function. */
 #cmakedefine HAVE_MALLINFO ${HAVE_MALLINFO}

 /* Define to 1 if you have the <malloc.h> header file. */
@@ -159,9 +162,6 @@

 /* Define to 1 if you have the `malloc_zone_statistics' function. */
 #cmakedefine HAVE_MALLOC_ZONE_STATISTICS ${HAVE_MALLOC_ZONE_STATISTICS}
-
-/* Define to 1 if you have the `mallctl` function. */
-#cmakedefine HAVE_MALLCTL ${HAVE_MALLCTL}

 /* Define to 1 if you have the `mkdtemp' function. */
 #cmakedefine HAVE_MKDTEMP ${HAVE_MKDTEMP}


JIRA-1212: update boost build for shark

JIRA-1212: update boost build for shark

--- SuperBuild/CMake/External_boost.cmake
+++ SuperBuild/CMake/External_boost.cmake
@@ -2,30 +2,71 @@

 SETUP_SUPERBUILD(BOOST)

-#all we loose is one single test from not building boost unit-testing-framework.
-#That is single test code. I don't see why we can't use something in-house
-#change test code to not use boost unit-testing-framework and all is well.
+set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
+set(_SB_Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)

+set(BOOST_SB_CONFIG)
 if(MSVC)
-  set(BOOST_URL "http://download.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2")
-  set(BOOST_URL_MD5 "65a840e1a0b13a558ff19eeb2c4f0cbe")
+  if(OTB_MSVC_COMPILER_ARCH_IS_X64)
+    set(BOOST_SB_CONFIG architecture=x86 address-model=64)
+  else()
+    set(BOOST_SB_CONFIG architecture=x86)
+  endif()
+endif()
+
+set(BOOST_SB_CONFIG
+  ${BOOST_SB_CONFIG}
+  variant=release
+  link=shared
+  threading=single
+  runtime-link=shared
+  --prefix=${SB_INSTALL_PREFIX}
+  --includedir=${_SB_Boost_INCLUDE_DIR}
+  --libdir=${_SB_Boost_LIBRARY_DIR}
+  --layout=system
+  --with-system
+  --with-serialization
+  --with-filesystem
+  --with-test
+  -d0
+  )
+
+if(UNIX)
+  set(BOOST_BOOTSTRAP_FILE "./bootstrap.sh")
+  set(BOOST_B2_EXE "./b2")
 else()
-  set(BOOST_URL "http://download.sourceforge.net/project/boost/boost/1.50.0/boost_1_50_0.tar.bz2")
-  set(BOOST_URL_MD5 "52dd00be775e689f55a987baebccc462")
+  set(BOOST_BOOTSTRAP_FILE "bootstrap.bat")
+  set(BOOST_B2_EXE "b2.exe")
 endif()
+
+set(BOOST_CONFIGURE_COMMAND ${CMAKE_COMMAND}
+  -E chdir ${BOOST_SB_SRC}
+  ${BOOST_BOOTSTRAP_FILE}
+  --prefix=${SB_INSTALL_PREFIX}
+  )
+
+set(BOOST_BUILD_COMMAND ${CMAKE_COMMAND}
+  -E chdir ${BOOST_SB_SRC}
+  ${BOOST_B2_EXE}
+  ${BOOST_SB_CONFIG}
+  )
+
+set(BOOST_INSTALL_COMMAND ${CMAKE_COMMAND}
+  -E chdir ${BOOST_SB_SRC}
+  ${BOOST_B2_EXE}
+  ${BOOST_SB_CONFIG}
+  install
+  )

 ExternalProject_Add(BOOST
   PREFIX BOOST
-  URL "${BOOST_URL}"
-  URL_MD5 ${BOOST_URL_MD5}
+  URL "http://download.sourceforge.net/project/boost/boost/1.60.0/boost_1_60_0.tar.bz2"
+  URL_MD5 65a840e1a0b13a558ff19eeb2c4f0cbe
   BINARY_DIR ${BOOST_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-  CMAKE_CACHE_ARGS ${SB_CMAKE_CACHE_ARGS}
-  PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-  ${CMAKE_SOURCE_DIR}/patches/BOOST/CMakeLists.txt
-  ${BOOST_SB_SRC}
+  CONFIGURE_COMMAND ${BOOST_CONFIGURE_COMMAND}
+  BUILD_COMMAND ${BOOST_BUILD_COMMAND}
+  INSTALL_COMMAND ${BOOST_INSTALL_COMMAND}
   )

-set(_SB_Boost_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
-set(_SB_Boost_LIBRARY_DIR ${SB_INSTALL_PREFIX}/lib)


BUG:Add OpenGL library path. Save/Restore values of CMAKE_REQUIRED_INCLUDES/LIBRARIES

--- CMake/vtkTestGLX.cmake
+++ CMake/vtkTestGLX.cmake
@@ -76,8 +76,11 @@
 #unset(GLX_DEFINES_TYPE_GLXFBConfig CACHE)

 # for CHECK_C_SOURCE_COMPILES
+set(SAVE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+set(SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+
 set(CMAKE_REQUIRED_INCLUDES ${OPENGL_INCLUDE_DIR})
-
+set(CMAKE_REQUIRED_LIBRARIES ${OPENGL_gl_LIBRARY})

 # -----------------------------------------------------------------------------
 # GLX_DEFINES_MACRO_GLX_VERSION_1_1
@@ -236,9 +239,6 @@
 # -----------------------------------------------------------------------------
 # GLX_DECLARES_FUNCTION_glXGetProcAddressARB
 # -----------------------------------------------------------------------------
-set(SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
-set(CMAKE_REQUIRED_LIBRARIES "-lGL")
-
 CHECK_C_SOURCE_COMPILES(
 "
 #define GLX_GLXEXT_LEGACY
@@ -301,23 +301,24 @@
 "
 GLX_DECLARES_FUNCTION_glXGetProcAddress_AS_EMPTY)

-
 # -----------------------------------------------------------------------------
 # GLX_DEFINES_TYPE_GLXFBConfig
 # -----------------------------------------------------------------------------
+
+CHECK_C_SOURCE_COMPILES(
+"
+#define GLX_GLXEXT_LEGACY
+#include <GL/glx.h>
+int main()
+{
+ GLXFBConfig c;
+ return 0;
+}
+"
+GLX_DEFINES_TYPE_GLXFBConfig)
+
+set(CMAKE_REQUIRED_INCLUDES "${SAVE_CMAKE_REQUIRED_INCLUDES}")
 set(CMAKE_REQUIRED_LIBRARIES "${SAVE_CMAKE_REQUIRED_LIBRARIES}")
-
-CHECK_C_SOURCE_COMPILES(
-"
-#define GLX_GLXEXT_LEGACY
-#include <GL/glx.h>
-int main()
-{
- GLXFBConfig c;
- return 0;
-}
-"
-GLX_DEFINES_TYPE_GLXFBConfig)

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


minor fix in emscripten toolchain file for last PR

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -141,7 +141,8 @@
 if (FIPS_EMSCRIPTEN_USE_WASM)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=1 -s \"BINARYEN_METHOD='native-wasm'\"")
 else()
-    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS_RELEASE} -s WASM=0 -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
+    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s WASM=0")
+    set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
 endif()
 if (FIPS_EMSCRIPTEN_USE_CLOSURE)
     set(EMSC_LINKER_FLAGS_RELEASE "${EMSC_LINKER_FLAGS_RELEASE} --closure 1")


added version check for TBB. Lower than 4.3 problematic with clang

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1079,6 +1079,12 @@
   if(NOT builtin_tbb)
     message(STATUS "Looking for TBB")
     find_package(TBB)
+    if(TBB_FOUND)
+      if(${TBB_VERSION} VERSION_LESS 4.3)
+        message(STATUS "TBB version < 4.3. Switching on builtin_tbb option")
+        set(builtin_tbb ON CACHE BOOL "" FORCE)
+      endif()
+    endif()
     if(NOT TBB_FOUND)
       message(STATUS "TBB not found. Switching on builtin_tbb option")
       set(builtin_tbb ON CACHE BOOL "" FORCE)


Make guessing of library directory local to builtin_xrootd

This logic is not used anywhere else.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -12,14 +12,6 @@

 #---On MacOSX, try to find frameworks after standard libraries or headers------------
 set(CMAKE_FIND_FRAMEWORK LAST)
-
-#---Guess under which lib directory the external packages will install the libraires
-set(_LIBDIR_DEFAULT "lib")
-if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version")
-  if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
-    set(_LIBDIR_DEFAULT "lib64")
-  endif()
-endif()

 #---If -Dshared=Off, prefer static libraries-----------------------------------------
 if(NOT shared)
@@ -779,9 +771,17 @@
   string(REPLACE "-W " "" __cxxflags "${__cxxflags}")          # Otherwise it produces many warnings
   string(REPLACE "-Wshadow" "" __cxxflags "${__cxxflags}")          # Otherwise it produces many warnings
   string(REPLACE "-Woverloaded-virtual" "" __cxxflags "${__cxxflags}")  # Otherwise it produces manywarnings
-  set(XROOTD_LIBRARIES ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}
-                       ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdClient${CMAKE_SHARED_LIBRARY_SUFFIX}
-                       ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdCl${CMAKE_SHARED_LIBRARY_SUFFIX})
+
+  # Guess under which directory XRootD will install its libraires
+  set(XROOTD_LIBDIR "lib")
+  if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8
+     AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version")
+    set(XROOTD_LIBDIR "lib64")
+  endif()
+
+  set(XROOTD_LIBRARIES ${XROOTD_ROOTDIR}/${XROOTD_LIBDIR}/libXrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}
+                       ${XROOTD_ROOTDIR}/${XROOTD_LIBDIR}/libXrdClient${CMAKE_SHARED_LIBRARY_SUFFIX}
+                       ${XROOTD_ROOTDIR}/${XROOTD_LIBDIR}/libXrdCl${CMAKE_SHARED_LIBRARY_SUFFIX})
   ExternalProject_Add(
     XROOTD
     URL ${XROOTD_SRC_URI}
@@ -802,10 +802,11 @@
     BUILD_BYPRODUCTS ${XROOTD_LIBRARIES}
   )
   # We cannot call find_package(XROOTD) becuase the package is not yet built. So, we need to emulate what it defines....
+
   set(XROOTD_INCLUDE_DIRS ${XROOTD_ROOTDIR}/include/xrootd ${XROOTD_ROOTDIR}/include/xrootd/private)
   set(XROOTD_NOMAIN TRUE)
   set(XROOTD_CFLAGS "-DROOTXRDVERS=${XROOTD_VERSIONNUM}")
-  install(DIRECTORY ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "libXrd*")
+  install(DIRECTORY ${XROOTD_ROOTDIR}/${XROOTD_LIBDIR}/ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries FILES_MATCHING PATTERN "libXrd*")
   install(DIRECTORY ${XROOTD_ROOTDIR}/include/xrootd/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
   set(XROOTD_TARGET XROOTD)
   set(xrootd ON CACHE BOOL "Enabled because builtin_xrootd requested (${xrootd_description})" FORCE)


Do not enable builtin_unuran if unuran=OFF or fail-on-missing=ON

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -52,12 +52,16 @@
 endif()

 #---Check for Unuran ------------------------------------------------------------------
-if(NOT builtin_unuran)
+if(unuran AND NOT builtin_unuran)
   message(STATUS "Looking for Unuran")
-  find_Package(Unuran)
-  if(NOT UNURAN_FOUND)
-    message(STATUS "Unuran not found. Switching on builtin_unuran option")
-    set(builtin_unuran ON CACHE BOOL "" FORCE)
+  if(fail-on-missing)
+    find_package(Unuran REQUIRED)
+  else()
+    find_package(Unuran)
+    if(NOT UNURAN_FOUND)
+      message(STATUS "Unuran not found. Switching on builtin_unuran option")
+      set(builtin_unuran ON CACHE BOOL "" FORCE)
+    endif()
   endif()
 endif()


Avoid warnings when creating symlinks in ${CMAKE_BINARY_DIR}/include

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1347,9 +1347,13 @@
   # FIXME: This is a workaround to let ROOT find the headers at runtime if
   # they are in the build directory. This is necessary until we decide how to
   # treat externals with headers used by ROOT
-  add_custom_target(VC_SYMLINK COMMAND ${CMAKE_COMMAND} -E create_symlink
-    ${Vc_INCLUDE_DIR}/Vc ${CMAKE_BINARY_DIR}/include/Vc)
-  add_dependencies(VC VC_SYMLINK)
+  if(NOT EXISTS ${CMAKE_BINARY_DIR}/include/Vc)
+    if (NOT EXISTS ${CMAKE_BINARY_DIR}/include)
+      execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include)
+    endif()
+    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+      ${Vc_INCLUDE_DIR}/Vc ${CMAKE_BINARY_DIR}/include/Vc)
+  endif()
   # end of workaround

   install(DIRECTORY ${Vc_ROOTDIR}/ DESTINATION ".")
@@ -1433,9 +1437,13 @@
   # FIXME: This is a workaround to let ROOT find the headers at runtime if
   # they are in the build directory. This is necessary until we decide how to
   # treat externals with headers used by ROOT
-  add_custom_target(VECCORE_SYMLINK COMMAND ${CMAKE_COMMAND} -E create_symlink
-    ${VecCore_ROOTDIR}/include/VecCore ${CMAKE_BINARY_DIR}/include/VecCore)
-  add_dependencies(VECCORE VECCORE_SYMLINK)
+  if(NOT EXISTS ${CMAKE_BINARY_DIR}/include/VecCore)
+    if (NOT EXISTS ${CMAKE_BINARY_DIR}/include)
+      execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include)
+    endif()
+    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+      ${VecCore_ROOTDIR}/include/VecCore ${CMAKE_BINARY_DIR}/include/VecCore)
+  endif()
   # end of workaround

   install(DIRECTORY ${VecCore_ROOTDIR}/ DESTINATION ".")


[cmake] removed ADD_CXX_FLAGS refs #187

[cmake] removed ADD_CXX_FLAGS refs #187

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -8,14 +8,6 @@
 #   string(STRIP ${NEW_LIST_SPACE} NEW_LIST_SPACE)
   set(${OUTPUT_VAR} "${NEW_LIST_SPACE}" PARENT_SCOPE)
 endfunction()
-
-MACRO(ADD_CXX_FLAGS)
-    string(REPLACE " " ";" FLAGS ${ARGN})
-	FOREACH( ARG ${FLAGS} )
-# 		ADD_DEFINITIONS(${ARG})
-		LIST(APPEND MY_CXX_FLAGS ${ARG} )
-	ENDFOREACH( ARG )
-ENDMACRO(ADD_CXX_FLAGS)

 MACRO(INCLUDE_DIR)
 	FOREACH( ARG ${ARGN} )
@@ -44,7 +36,7 @@
 MACRO( HEADERCHECK )
 	ADD_CUSTOM_TARGET( headercheck SOURCES ${ARGN} )
 	FOREACH( HEADER ${ARGN} )
-		string(REPLACE "/" "_" fn ${HEADER})
+		string(REPLACE "/" "_" fn ${HEADER})
 		SET( TEST_NAME "headercheck_${fn}")
 		TO_LIST_SPACES( MY_CXX_FLAGS TEST_NAME_FLAGS )
 		SET(XARGS ${TEST_NAME_FLAGS} -DHAVE_CONFIG_H -c ${HEADER} -o ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.o )
@@ -57,7 +49,7 @@
 MACRO( DEPENDENCYCHECK )
     ADD_CUSTOM_TARGET( dependenycheck SOURCES ${ARGN} )
     FOREACH( HEADER ${ARGN} )
-	string(REPLACE "/" "_" fn ${HEADER})
+	string(REPLACE "/" "_" fn ${HEADER})
         SET( TEST_NAME "dependenycheck_${fn}")
         TO_LIST_SPACES( MY_CXX_FLAGS TEST_NAME_FLAGS )
         SET(XARGS ${TEST_NAME_FLAGS} -DHAVE_CONFIG_H -H -c ${HEADER} -w)
@@ -75,7 +67,7 @@
 		ENDIF()
 		FOREACH( SOURCEFILE ${ARGN} )
 			FILE( APPEND  ${CPPINLINST}  "${SOURCEFILE}\n" )
-		ENDFOREACH( SOURCEFILE )
+		ENDFOREACH( SOURCEFILE )
 		TO_LIST_SPACES( PLAIN_INCLUDE_DIRS CPPCHECK_FLAGS_SPLIT )
 		ADD_CUSTOM_TARGET(  cppcheck cppcheck --xml --enable=all --report-progress --file-list=${CPPINLINST}
 				${CPPCHECK_FLAGS_SPLIT}  2>cppcheck.xml )
@@ -93,7 +85,7 @@
 		find_library( ${MODULE}_FOUND ${LIBNAME} PATHS ${${MODULE}_LIBDIR})
 		if ( ${MODULE}_FOUND )
 			string(TOUPPER ${MODULE} UPMODULE )
-			ADD_CXX_FLAGS( -DHAVE_DUNE_${UPMODULE} )
+			ADD_DEFINITIONS( -DHAVE_DUNE_${UPMODULE} )
 			FILE( GLOB_RECURSE ${MODULE}_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/../dune-${MODULE}/dune/${MODULE}/*.hh" )
 			LIST( APPEND DUNE_HEADERS ${${MODULE}_HEADER} )
 			LIST( APPEND DUNE_LIBS ${${MODULE}_FOUND} )
@@ -133,7 +125,7 @@
 # 	set( tmp_flags "${bar} ${tmp_flags}" )
 # 	set_target_properties( ${target} PROPERTIES LINK_FLAGS  ${tmp_flags} )
 	TARGET_LINK_LIBRARIES(${target} ${libs} )
-
+
 	add_dependencies( ${target} config_refresh )
 ENDMACRO( ADD_DUNE_EXECUTABLE )

@@ -213,17 +205,17 @@
 	"CUSTOM FLAGS")
 SET( BOOST_ROOT
 	"/opt/boost-1.48" CACHE STRING
-	"" )
+	"" )

 SET( CMAKE_CXX_FLAGS_RELEASE
 	"-DDNDEBUG -funroll-loops -m64 -mfpmath=sse -falign-loops -mtune=native -march=native -O3 -pipe -fomit-frame-pointer " )

 SET( CMAKE_CXX_FLAGS_DEBUG
 	"-O0 -DDNDEBUG -g3 -ggdb" )
-
+
 FIND_PACKAGE( PkgConfig )
 FIND_PACKAGE(Boost 1.48.0 REQUIRED)
-ADD_CXX_FLAGS( "-DHAVE_CMAKE_CONFIG ${CXX_STD0X_FLAGS}" )
+ADD_DEFINITIONS( "-DHAVE_CMAKE_CONFIG ${CXX_STD0X_FLAGS}" )
 INCLUDE_SYS_DIR(${Boost_INCLUDE_DIRS})
 #INCLUDE_SYS_DIR(${CMAKE_CURRENT_SOURCE_DIR}/dune/stuff/test/)
 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})


New hwloc finder

New hwloc finder

--- cmake/FindHWLOC.cmake
+++ cmake/FindHWLOC.cmake
@@ -1,181 +1,44 @@
-#.rst:
-# FindHWLOC
-# ----------
+# Copyright (c)      2014 Thomas Heller
+# Copyright (c) 2007-2012 Hartmut Kaiser
+# Copyright (c) 2010-2011 Matt Anderson
+# Copyright (c) 2011      Bryce Lelbach
 #
-# Try to find Portable Hardware Locality (HWLOC) libraries.
-# http://www.open-mpi.org/software/hwloc
-#
-# You may declare HWLOC_ROOT environment variable to tell where
-# your hwloc library is installed.
-#
-# Once done this will define::
-#
-#   HWLOC_FOUND            - True if hwloc was found
-#   HWLOC_INCLUDE_DIRS     - include directories for hwloc
-#   HWLOC_LIBRARIES        - link against these libraries to use hwloc
-#   HWLOC_VERSION          - version
-#   HWLOC_CFLAGS           - include directories as compiler flags
-#   HWLOC_LDLFAGS          - link paths and libs as compiler flags
-#
+# Distributed under the Boost Software License, Version 1.0. (See accompanying
+# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

-#=============================================================================
-# Copyright 2014 Mikael Lepist
-#
-# Distributed under the OSI-approved BSD License (the "License");
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
+find_package(PkgConfig QUIET)
+pkg_check_modules(PC_HWLOC QUIET hwloc)

-if(WIN32)
-  find_path(HWLOC_INCLUDE_DIR
-    NAMES
-      hwloc.h
-    PATHS
-      ENV "PROGRAMFILES(X86)"
-      ENV HWLOC_ROOT
-    PATH_SUFFIXES
-      include
-  )
+find_path(HWLOC_INCLUDE_DIR hwloc.h
+  HINTS
+    ${HWLOC_ROOT} ENV HWLOC_ROOT
+    ${PC_HWLOC_MINIMAL_INCLUDEDIR}
+    ${PC_HWLOC_MINIMAL_INCLUDE_DIRS}
+    ${PC_HWLOC_INCLUDEDIR}
+    ${PC_HWLOC_INCLUDE_DIRS}
+  PATH_SUFFIXES include)

-  find_library(HWLOC_LIBRARY
-    NAMES
-      libhwloc.lib
-    PATHS
-      ENV "PROGRAMFILES(X86)"
-      ENV HWLOC_ROOT
-    PATH_SUFFIXES
-      lib
-  )
+find_library(HWLOC_LIBRARY NAMES hwloc libhwloc
+  HINTS
+    ${HWLOC_ROOT} ENV HWLOC_ROOT
+    ${PC_HWLOC_MINIMAL_LIBDIR}
+    ${PC_HWLOC_MINIMAL_LIBRARY_DIRS}
+    ${PC_HWLOC_LIBDIR}
+    ${PC_HWLOC_LIBRARY_DIRS}
+  PATH_SUFFIXES lib lib64)

-  #
-  # Check if the found library can be used to linking
-  #
-  SET (_TEST_SOURCE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/linktest.c")
-  FILE (WRITE "${_TEST_SOURCE}"
-    "
-    #include <hwloc.h>
-    int main()
-    {
-      hwloc_topology_t topology;
-      int nbcores;
-      hwloc_topology_init(&topology);
-      hwloc_topology_load(topology);
-      nbcores = hwloc_get_nbobjs_by_type(topology, HWLOC_OBJ_CORE);
-      hwloc_topology_destroy(topology);
-      return 0;
-    }
-    "
-  )
+set(HWLOC_LIBRARIES ${HWLOC_LIBRARY})
+set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR})

-  TRY_COMPILE(_LINK_SUCCESS ${CMAKE_BINARY_DIR} "${_TEST_SOURCE}"
-    CMAKE_FLAGS
-    "-DINCLUDE_DIRECTORIES:STRING=${HWLOC_INCLUDE_DIR}"
-    CMAKE_FLAGS
-    "-DLINK_LIBRARIES:STRING=${HWLOC_LIBRARY}"
-  )
+find_package_handle_standard_args(Hwloc DEFAULT_MSG
+  HWLOC_LIBRARY HWLOC_INCLUDE_DIR)

-  IF(NOT _LINK_SUCCESS)
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-      message(STATUS "You are building 64bit target.")
-    ELSE()
-      message(STATUS "You are building 32bit code. If you like to build x64 use e.g. -G 'Visual Studio 12 Win64' generator." )
-    ENDIF()
-    message(FATAL_ERROR "Library found, but linking test program failed.")
-  ENDIF()
-
-  #
-  # Resolve version if some compiled binary found...
-  #
-  find_program(HWLOC_INFO_EXECUTABLE
-    NAMES
-      hwloc-info
-    PATHS
-      ENV HWLOC_ROOT
-    PATH_SUFFIXES
-      bin
-  )
-
-  if(HWLOC_INFO_EXECUTABLE)
-    execute_process(
-      COMMAND ${HWLOC_INFO_EXECUTABLE} "--version"
-      OUTPUT_VARIABLE HWLOC_VERSION_LINE
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-    string(REGEX MATCH "([0-9]+.[0-9]+)$"
-      HWLOC_VERSION "${HWLOC_VERSION_LINE}")
-    unset(HWLOC_VERSION_LINE)
-  endif()
-
-  #
-  # All good
-  #
-
-  set(HWLOC_LIBRARIES ${HWLOC_LIBRARY})
-  set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR})
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(
-    HWLOC
-    FOUND_VAR HWLOC_FOUND
-    REQUIRED_VARS HWLOC_LIBRARY HWLOC_INCLUDE_DIR
-    VERSION_VAR HWLOC_VERSION)
-
-  mark_as_advanced(
-    HWLOC_INCLUDE_DIR
-    HWLOC_LIBRARY)
-
-  foreach(arg ${HWLOC_INCLUDE_DIRS})
-    set(HWLOC_CFLAGS "${HWLOC_CFLAGS} /I${arg}")
-  endforeach()
-
-  set(HWLOC_LDFLAGS "${HWLOC_LIBRARY}")
-
-else()
-
-  # Find with pkgconfig
-  find_package(PkgConfig)
-
-  if(HWLOC_ROOT)
-    set(ENV{PKG_CONFIG_PATH} "${HWLOC_ROOT}/lib/pkgconfig")
-  else()
-    foreach(PREFIX ${CMAKE_PREFIX_PATH})
-      set(PKG_CONFIG_PATH "${PKG_CONFIG_PATH}:${PREFIX}/lib/pkgconfig")
-    endforeach()
-    set(ENV{PKG_CONFIG_PATH} "${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}")
-  endif()
-
-  if(HWLOC_FIND_REQUIRED)
-    set(_HWLOC_OPTS "REQUIRED")
-  elseif(HWLOC_FIND_QUIETLY)
-    set(_HWLOC_OPTS "QUIET")
-  else()
-    set(_HWLOC_output 1)
-  endif()
-
-  if(HWLOC_FIND_VERSION)
-    if(HWLOC_FIND_VERSION_EXACT)
-      pkg_check_modules(HWLOC ${_HWLOC_OPTS} HWLOC=${HWLOC_FIND_VERSION})
-    else()
-      pkg_check_modules(HWLOC ${_HWLOC_OPTS} HWLOC>=${HWLOC_FIND_VERSION})
-    endif()
-  else()
-    pkg_check_modules(HWLOC ${_HWLOC_OPTS} HWLOC)
-  endif()
-
-  if(HWLOC_FOUND)
-    include(FindPackageHandleStandardArgs)
-    find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARIES)
-
-    if(NOT ${HWLOC_VERSION} VERSION_LESS 1.7.0)
-      set(HWLOC_GL_FOUND 1)
-    endif()
-
-    if(_HWLOC_output)
-      message(STATUS
-        "Found HWLOC ${HWLOC_VERSION} in ${HWLOC_INCLUDE_DIRS}:${HWLOC_LIBRARIES}")
-    endif()
+get_property(_type CACHE HWLOC_ROOT PROPERTY TYPE)
+if(_type)
+  set_property(CACHE HWLOC_ROOT PROPERTY ADVANCED 1)
+  if("x${_type}" STREQUAL "xUNINITIALIZED")
+    set_property(CACHE HWLOC_ROOT PROPERTY TYPE PATH)
   endif()
 endif()

+mark_as_advanced(HWLOC_ROOT HWLOC_LIBRARY HWLOC_INCLUDE_DIR)


[CMake] Hopefully fixed ARTK in MT_Config.cmake.

git-svn-id: efee09ee66643ea208db8880d8809c0954bd33d6@77 a658d305-d20c-4271-b950-7aa421b211f3

--- cmake/MT_Config.cmake
+++ cmake/MT_Config.cmake
@@ -36,3 +36,7 @@
   link_directories(${MT_OPENCV_LIB_DIR})
 endif()

+if(MT_HAVE_ARTK)
+  include_directories(${MT_ARTK_INCLUDE})
+  add_definitions(-DMT_HAVE_ARTK)
+endif()


[CMake] Properly detect whether we're building runtime for i386 or i686.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -1,3 +1,4 @@
+include(CMakePushCheckState)
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
 include(CheckSymbolExists)
@@ -70,19 +71,39 @@
 set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc)
 file(WRITE ${SIMPLE_SOURCE} "#include <stdlib.h>\n#include <limits>\nint main() {}\n")

-# test_target_arch(<arch> <target flags...>)
-# Sets the target flags for a given architecture and determines if this
-# architecture is supported by trying to build a simple file.
-macro(test_target_arch arch)
+function(check_compile_definition def argstring out_var)
+  if("${def}" STREQUAL "")
+    set(${out_var} TRUE PARENT_SCOPE)
+    return()
+  endif()
+  cmake_push_check_state()
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${argstring}")
+  check_symbol_exists(${def} "" ${out_var})
+  cmake_pop_check_state()
+endfunction()
+
+# test_target_arch(<arch> <def> <target flags...>)
+# Checks if architecture is supported: runs host compiler with provided
+# flags to verify that:
+#   1) <def> is defined (if non-empty)
+#   2) simple file can be successfully built.
+# If successful, saves target flags for this architecture.
+macro(test_target_arch arch def)
   set(TARGET_${arch}_CFLAGS ${ARGN})
-  set(argstring "${CMAKE_EXE_LINKER_FLAGS}")
+  set(argstring "")
   foreach(arg ${ARGN})
     set(argstring "${argstring} ${arg}")
   endforeach()
-  try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
-              COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"
-              OUTPUT_VARIABLE TARGET_${arch}_OUTPUT
-              CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}")
+  check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF)
+  if(NOT HAS_${arch}_DEF)
+    set(CAN_TARGET_${arch} FALSE)
+  else()
+    set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}")
+    try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
+                COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"
+                OUTPUT_VARIABLE TARGET_${arch}_OUTPUT
+                CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}")
+  endif()
   if(${CAN_TARGET_${arch}})
     list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "${arch}")
@@ -139,33 +160,34 @@
 else()
   if("${LLVM_NATIVE_ARCH}" STREQUAL "X86")
     if(NOT MSVC)
-      test_target_arch(x86_64 "-m64")
-      test_target_arch(i386 "-m32")
+      test_target_arch(x86_64 "" "-m64")
+      test_target_arch(i386 __i386__ "-m32")
+      test_target_arch(i686 __i686__ "-m32")
     else()
-      test_target_arch(i386 "")
+      test_target_arch(i386 "" "")
     endif()
   elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC")
     TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN)
     if(HOST_IS_BIG_ENDIAN)
-      test_target_arch(powerpc64 "-m64")
+      test_target_arch(powerpc64 "" "-m64")
     else()
-      test_target_arch(powerpc64le "-m64")
+      test_target_arch(powerpc64le "" "-m64")
     endif()
   elseif("${LLVM_NATIVE_ARCH}" STREQUAL "Mips")
     if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "mipsel|mips64el")
       # regex for mipsel, mips64el
-      test_target_arch(mipsel "-m32")
-      test_target_arch(mips64el "-m64")
+      test_target_arch(mipsel "" "-m32")
+      test_target_arch(mips64el "" "-m64")
     else()
-      test_target_arch(mips "-m32")
-      test_target_arch(mips64 "-m64")
+      test_target_arch(mips "" "-m32")
+      test_target_arch(mips64 "" "-m64")
     endif()
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm")
-    test_target_arch(arm "-march=armv7-a")
+    test_target_arch(arm "" "-march=armv7-a")
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32")
-    test_target_arch(aarch32 "-march=armv8-a")
+    test_target_arch(aarch32 "" "-march=armv8-a")
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64")
-    test_target_arch(aarch64 "-march=armv8-a")
+    test_target_arch(aarch64 "" "-march=armv8-a")
   endif()
   set(COMPILER_RT_OS_SUFFIX "")
 endif()


[CMake] Use -std=c++11 if supported

[CMake] Use -std=c++11 if supported

Summary: This patch adds a check for if -std=c++11 is a supported flag, and adds it to CMAKE_CXX_FLAGS if it is supported.

Reviewers: EricWF

Subscribers: cfe-commits

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -37,6 +37,11 @@
 check_cxx_compiler_flag(/EHs-                 LIBCXXABI_HAS_NO_EHS_FLAG)
 check_cxx_compiler_flag(/EHa-                 LIBCXXABI_HAS_NO_EHA_FLAG)
 check_cxx_compiler_flag(/GR-                  LIBCXXABI_HAS_NO_GR_FLAG)
+check_cxx_compiler_flag(-std=c++11            LIBCXXABI_HAS_STD_CXX11)
+
+if(LIBCXXABI_HAS_STD_CXX11)
+  list(APPEND CMAKE_CXX_FLAGS -std=c++11)
+endif()

 # Check libraries
 check_library_exists(c fopen "" LIBCXXABI_HAS_C_LIB)


Bumped the hardcoded version fallback

Bumped the hardcoded version fallback

--- cmake/DetermineTomvizVersion.cmake
+++ cmake/DetermineTomvizVersion.cmake
@@ -7,7 +7,7 @@
 #   tomviz_version
 #   tomviz_version_long

-set(hardcoded_tomviz_version "0.6.0")
+set(hardcoded_tomviz_version "0.6.1")

 function(_set_version_vars versiontext)
   string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" version_matches "${versiontext}")


[CMake] Use NO_CMAKE_FIND_ROOT_PATH when finding clang, llvm, and swift

When you cross-compile or specify a custom sysroot, it is possible that
the CMake toolchain files will set CMAKE_FIND_ROOT_PATH and set
CMAKE_FIND_ROOT_PATH_MODE_* VARIABLES to ONLY, so packages will only be
searched in a rerooted setting. This is an issue when we search for
clang, llvm, and swift, because we are usually passing them explicitly with
LLDB_PATH_TO_{CLANG,LLVM,SWIFT}_BUILD and do not want these paths to be
rerooted.

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -12,7 +12,7 @@
     set(FIND_PATHS "${LLDB_PATH_TO_LLVM_BUILD}/bin")
   endif()
   find_program(LLVM_CONFIG "llvm-config"
-    HINTS ${FIND_PATHS})
+    HINTS ${FIND_PATHS} NO_CMAKE_FIND_ROOT_PATH)

   if(LLVM_CONFIG)
     message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
@@ -127,9 +127,9 @@

   # Start Swift Mods
   find_package(Clang REQUIRED CONFIG
-    HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_DEFAULT_PATH)
+    HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   find_package(Swift REQUIRED CONFIG
-    HINTS "${PATH_TO_SWIFT_BUILD}" NO_DEFAULT_PATH)
+    HINTS "${PATH_TO_SWIFT_BUILD}" NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
   # End Swift Mods

   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")


[CMake] NFC. Cleanup unnecessary CMake policy

This is just setting to the default behavior, so it does nothing.

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -2,10 +2,6 @@
 # standalone project, using LLVM as an external library:
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   project(lldb)
-
-  if (POLICY CMP0022)
-    cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
-  endif()

   option(LLVM_INSTALL_TOOLCHAIN_ONLY "Only include toolchain files in the 'install' target." OFF)


At the request of Michael Spencer, make the VCS version detection logic
in CMake a bit more handy. Previously we would get such charming
versions as the following for revision NNNN and commit-ish XXXXX:
  3.1svnsvn-rNNNN
  3.1svngit-svn-rNNNN
  3.1svngit-svn-XXXXX

The mechanism selecting betwene the latter two was particularly odd, and
didn't work with all of the ways git-svn repos are set up apparently. It
also misses an important point -- both the revision *and* the git commit
might be relevant when working on a local branch some distance from
mainline. The new logic does several things:

1) It strips the redundant initial 'svn'.
2) It always looks for a git-svn revision number base, and when found
   includes it in the version.
3) If the git commit-ish for the current HEAD is not exactly that
   revision number, it is also included.

The resulting strings should roughly be:
  3.1svn-rNNNN
  3.1git-svn-rNNNN
  3.1git-svn-rNNNN-XXXXX

Suggestions on formatting etc always welcome. =] I've only looked at the
LLVM version string here, not Clang's (yet).

Note that the commit-ish reported is *not* terribly accurate. It updates
when 'cmake' is run, not when the binary is built. Still, it may be
better than nothing, especially if people have fairly long-lived git
repos and branches. This is not a new limitation, just didn't want
anyone to be surprised.

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

--- cmake/modules/VersionFromVCS.cmake
+++ cmake/modules/VersionFromVCS.cmake
@@ -3,7 +3,7 @@
 # existence of certain subdirectories under CMAKE_CURRENT_SOURCE_DIR.

 function(add_version_info_from_vcs VERS)
-  set(result ${${VERS}})
+  string(REPLACE "svn" "" result "${${VERS}}")
   if( EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn" )
     set(result "${result}svn")
     # FindSubversion does not work with symlinks. See PR 8437
@@ -21,24 +21,43 @@
     # Try to get a ref-id
     find_program(git_executable NAMES git git.exe git.cmd)
     if( git_executable )
-      execute_process(COMMAND ${git_executable} show-ref HEAD
+      set(is_git_svn_rev_exact false)
+      execute_process(COMMAND ${git_executable} svn log --limit=1 --oneline
                       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                       TIMEOUT 5
                       RESULT_VARIABLE git_result
                       OUTPUT_VARIABLE git_output)
       if( git_result EQUAL 0 )
-        string(SUBSTRING ${git_output} 0 7 git_ref_id)
-        set(result "${result}-${git_ref_id}")
-      else()
-        execute_process(COMMAND ${git_executable} svn log --limit=1 --oneline
+        string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
+        string(SUBSTRING "${git_svn_rev}" 1 -1 git_svn_rev_number)
+        set(git_svn_rev "-svn-${git_svn_rev}")
+
+        # Determine if the HEAD points directly at a subversion revision.
+        execute_process(COMMAND ${git_executable} svn find-rev HEAD
                         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
                         TIMEOUT 5
                         RESULT_VARIABLE git_result
                         OUTPUT_VARIABLE git_output)
         if( git_result EQUAL 0 )
-          string(REGEX MATCH r[0-9]+ git_svn_rev ${git_output})
-          set(result "${result}-svn-${git_svn_rev}")
+          string(STRIP "${git_output}" git_head_svn_rev_number)
+          if( git_head_svn_rev_number EQUAL git_svn_rev_number )
+            set(is_git_svn_rev_exact true)
+          endif()
         endif()
+      else()
+        set(git_svn_rev "")
+      endif()
+      execute_process(COMMAND
+                      ${git_executable} show-ref --abbrev --hash --head HEAD
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                      TIMEOUT 5
+                      RESULT_VARIABLE git_result
+                      OUTPUT_VARIABLE git_output)
+      if( git_result EQUAL 0 AND NOT is_git_svn_rev_exact )
+        string(STRIP "${git_output}" git_ref_id)
+        set(result "${result}${git_svn_rev}-${git_ref_id}")
+      else()
+        set(result "${result}${git_svn_rev}")
       endif()
     endif()
   endif()


refs #6566 Move xz sources into (tokudb)/third_party/ in preparation for git move

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@55401 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -46,9 +46,9 @@
   list(APPEND xz_configure_opts --enable-debug)
 endif ()

-set(XZ_SOURCE_DIR "${TOKU_SVNROOT}/xz-4.999.9beta" CACHE FILEPATH "Where to find sources for xz (lzma).")
+set(XZ_SOURCE_DIR "${TokuDB_SOURCE_DIR}/third_party/xz-4.999.9beta" CACHE FILEPATH "Where to find sources for xz (lzma).")
 if (NOT EXISTS "${XZ_SOURCE_DIR}/configure")
-  message(FATAL_ERROR "Can't find the xz sources.  Please check them out to ${XZ_SOURCE_DIR} or modify TOKU_SVNROOT (${TOKU_SVNROOT}) or XZ_SOURCE_DIR.")
+    message(FATAL_ERROR "Can't find the xz sources.  Please check them out to ${XZ_SOURCE_DIR} or modify TokuDB_SOURCE_DIR (${TokuDB_SOURCE_DIR}) or XZ_SOURCE_DIR.")
 endif ()

 FILE(GLOB XZ_ALL_FILES ${XZ_SOURCE_DIR}/*)


Adjust CONDOR_RPATH #4518

Adjust CONDOR_RPATH #4518

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -155,12 +155,12 @@
 		if ( ${SYSTEM_NAME} MATCHES "rhel3" )
 			message (FATAL_ERROR "ERROR: RHEL3 is EOL you are trying to build new packages on a deprecated platform")
 		else()
-			set( CONDOR_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor" )
+			set( CONDOR_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
 			set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib:/usr/lib:$ORIGIN/../lib/condor:/usr/lib/condor" )
 			set( PYTHON_RPATH "$ORIGIN/../:/lib:/usr/lib:$ORIGIN/../condor" )
 		endif()
 	else()
-		set( CONDOR_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor" )
+		set( CONDOR_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
 		set( EXTERNALS_RPATH "$ORIGIN/../lib:/lib64:/usr/lib64:$ORIGIN/../lib/condor:/usr/lib64/condor" )
 		set( PYTHON_RPATH "$ORIGIN/../:/lib64:/usr/lib64:$ORIGIN/../condor" )
 	endif()


Don't use mpicxx by default. We already set up all relevant compiler flags and libraries by hand

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

--- deal.II/cmake/configure/configure_1_mpi.cmake
+++ deal.II/cmake/configure/configure_1_mpi.cmake
@@ -40,14 +40,13 @@
   # The user has to know the location of the mpi headers as well:
   LIST(APPEND DEAL_II_USER_INCLUDE_DIRS ${MPI_CXX_INCLUDE_PATH})

-  # TODO:
-  SET(DEAL_II_USE_MPICXX ON CACHE BOOL
+  SET(DEAL_II_USE_MPICXX OFF CACHE BOOL # Disabled by default
     "Set the compiler to the detected mpi wrapper ${MPI_CXX_COMPILER}"
     )
-
   IF(DEAL_II_USE_MPICXX)
     SET(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER})
   ENDIF()
+
 ENDMACRO()


CMake:cpp: cleanup

CMake:cpp: cleanup

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -203,7 +203,9 @@
   set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
 else()
   # Clang don't support version x.y.z with z > 255
-  set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
+  set_target_properties(${PROJECT_NAME} PROPERTIES
+    INSTALL_RPATH "@loader_path"
+    VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
 endif()
 set_target_properties(${PROJECT_NAME} PROPERTIES
   SOVERSION ${PROJECT_VERSION_MAJOR}
@@ -212,11 +214,6 @@
 )
 set_target_properties(${PROJECT_NAME} PROPERTIES INTERFACE_${PROJECT_NAME}_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
 set_target_properties(${PROJECT_NAME} PROPERTIES COMPATIBLE_INTERFACE_STRING ${PROJECT_NAME}_MAJOR_VERSION)
-if(APPLE)
-  set_target_properties(${PROJECT_NAME} PROPERTIES
-    INSTALL_RPATH
-    "@loader_path")
-endif()

 # Dependencies
 target_link_libraries(${PROJECT_NAME} PUBLIC


COMP: fix module ordering

COMP: fix module ordering

--- Modules/ModuleList.cmake
+++ Modules/ModuleList.cmake
@@ -1,7 +1,8 @@
 set(mitk_modules
-  LegacyGL
   LegacyIO
   DataTypesExt
+  Overlays
+  LegacyGL
   AlgorithmsExt
   MapperExt
   DICOMReader
@@ -21,7 +22,6 @@
   PlanarFigureSegmentation
   OpenViewCore
   QmlItems
-  Overlays
   QtWidgets
   QtWidgetsExt
   SegmentationUI


Inviwo: Remove license agreement shown in the installer

--- apps/inviwo/packaging/packaging.cmake
+++ apps/inviwo/packaging/packaging.cmake
@@ -39,10 +39,6 @@
 set(CPACK_PACKAGE_VERSION_MINOR       "${IVW_MINOR_VERSION}")
 set(CPACK_PACKAGE_VERSION_PATCH       "${IVW_PATCH_VERSION}")
 set(CPACK_PACKAGE_DESCRIPTION_FILE    "${IVW_ROOT_DIR}/README.md")
-# Exclude license on macos dmg as it is deprecated since MacOS 12
-if(NOT IVW_PACKAGE_INSTALLER OR NOT APPLE)
-    set(CPACK_RESOURCE_FILE_LICENSE       "${IVW_ROOT_DIR}/LICENSE")
-endif()
 set(CPACK_PACKAGE_FILE_NAME           "${CPACK_PACKAGE_NAME}-v${IVW_VERSION}")

 set(CPACK_MONOLITHIC_INSTALL OFF)


Remove code for old ITK_WRAPPING option.

It is not reasonable to use SimpleITK along with native ITK wrapping.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -350,11 +350,6 @@
 # ITK
 #------------------------------------------------------------------------------

-set(ITK_WRAPPING OFF CACHE BOOL "Turn OFF wrapping ITK with WrapITK")
-mark_as_advanced( FORCE ITK_WRAPPING )
-if(ITK_WRAPPING)
-  list(APPEND ITK_DEPENDENCIES Swig)
-endif()
 option(SimpleITK_USE_SYSTEM_ITK "Use a pre-built version of ITK" OFF)
 sitk_legacy_naming( SimpleITK_USE_SYSTEM_ITK USE_SYSTEM_ITK )
 mark_as_advanced(SimpleITK_USE_SYSTEM_ITK)


cleanup after merge

cleanup after merge

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -97,11 +97,15 @@
 MARK_AS_ADVANCED(TRAVIS_BUILD)

 IF(TRAVIS_BUILD)
-  SET(BUILD_TESTING OFF)
-  SET(DOWNLOAD_TOOLKITS OFF)
-  SET(BUILD_HEADLESS ON)
-  SET(BUILD_WITH_PYTHON OFF)
+  IF(CMAKE_C_COMPILER_ID MATCHES "GNU")
+    SET(BUILD_TESTING OFF)
+    SET(DOWNLOAD_TOOLKITS OFF)
+    SET(BUILD_HEADLESS ON)
+    SET(BUILD_WITH_PYTHON OFF)
   SET(BUILD_WITH_SCIRUN_DATA OFF)
+  ELSE()
+    # try building everything with clang!
+  ENDIF()
   ADD_DEFINITIONS(-DTRAVIS_BUILD)
 ENDIF()

@@ -122,6 +126,8 @@
   ELSE()
     MESSAGE(FATAL_ERROR "QT ${QT_MIN_VERSION} or later is required for building the SCIRun GUI")
   ENDIF()
+ELSE()
+  ADD_DEFINITIONS(-DBUILD_HEADLESS)
 ENDIF()


Remove cmake reminder for something we didn't need to check.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -412,8 +412,6 @@
 		set(HAVE_SCHED_SETAFFINITY ON)
 	endif()

-	dprint ("TJ && TSTCLAIR We need this check in MSVC")
-
 	check_cxx_compiler_flag(-std=c++11 cxx_11)
 	check_cxx_compiler_flag(-std=c++0x cxx_0x)
 	if (cxx_11)


GCC version >= 4.8.0 required; error if lesser version detected.

--- cmake/gcc.cmake
+++ cmake/gcc.cmake
@@ -33,24 +33,19 @@
 SET(OSPRAY_ARCH_AVX512 "-mavx512f -mavx512pf -mavx512er -mavx512cd")

-# check whether gcc is new enough for AVX, AVX2
+# check whether GCC version is new enough for C++11
+SET(GCC_VERSION_REQUIRED "4.8.0")
+
 IF(NOT GCC_VERSION)
   EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
   SET(GCC_VERSION ${GCC_OUTPUT} CACHE STRING "GCC Version")
   MARK_AS_ADVANCED(GCC_VERSION)
 ENDIF()

-SET(GCC_VERSION_REQUIRED_AVX "4.4.0")
-SET(GCC_VERSION_REQUIRED_AVX2 "4.7.0")
-
-IF (GCC_VERSION VERSION_LESS GCC_VERSION_REQUIRED_AVX)
-  SET(OSPRAY_COMPILER_SUPPORTS_AVX FALSE)
-ELSE()
-  SET(OSPRAY_COMPILER_SUPPORTS_AVX TRUE)
+IF (GCC_VERSION VERSION_LESS GCC_VERSION_REQUIRED)
+  MESSAGE(FATAL_ERROR "GCC version 4.8.0 or greater is required to build OSPRay.")
 ENDIF()

-IF (GCC_VERSION VERSION_LESS GCC_VERSION_REQUIRED_AVX2)
-  SET(OSPRAY_COMPILER_SUPPORTS_AVX2 FALSE)
-ELSE()
-  SET(OSPRAY_COMPILER_SUPPORTS_AVX2 TRUE)
-ENDIF()
+# GCC 4.8.0 supports AVX and AVX2...
+SET(OSPRAY_COMPILER_SUPPORTS_AVX TRUE)
+SET(OSPRAY_COMPILER_SUPPORTS_AVX2 TRUE)


Made the changes as per Kent/wlad to include http://lists.mysql.com/commits/111802

--- cmake/ssl.cmake
+++ cmake/ssl.cmake
@@ -25,7 +25,7 @@
   SET(SSL_LIBRARIES  yassl taocrypt)
   SET(SSL_INCLUDE_DIRS ${INC_DIRS})
   SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
-  SET(SSL_DEFINES"-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DYASSL_THREAD_SAFE")
+  SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DYASSL_THREAD_SAFE")
   CHANGE_SSL_SETTINGS("bundled")
   #Remove -fno-implicit-templates
   #(yassl sources cannot  be compiled with  it)


update cmake

update cmake

--- cmake/3.6/Modules/FindCUDA/select_compute_arch.cmake
+++ cmake/3.6/Modules/FindCUDA/select_compute_arch.cmake
@@ -63,6 +63,7 @@
       "}\n")

     execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${cufile}"
+                    "-ccbin" ${CMAKE_CXX_COMPILER}
                     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                     RESULT_VARIABLE nvcc_res OUTPUT_VARIABLE nvcc_out
                     ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -116,13 +117,13 @@
       set(add_ptx TRUE)
       set(arch_name ${CMAKE_MATCH_1})
     endif()
-    if(arch_name MATCHES "([0-9]\\.[0-9])$")
+    if(arch_name MATCHES "(^[0-9]\\.[0-9](\\([0-9]\\.[0-9]\\))?)$")
       set(arch_bin ${CMAKE_MATCH_1})
       set(arch_ptx ${arch_bin})
     else()
       # Look for it in our list of known architectures
       if(${arch_name} STREQUAL "Fermi")
-        set(arch_bin 2.0 "2.1(2.0)")
+        set(arch_bin "2.0 2.1(2.0)")
       elseif(${arch_name} STREQUAL "Kepler+Tegra")
         set(arch_bin 3.2)
       elseif(${arch_name} STREQUAL "Kepler+Tesla")
@@ -173,11 +174,11 @@
   # Tell NVCC to add binaries for the specified GPUs
   foreach(arch ${cuda_arch_bin})
     if(arch MATCHES "([0-9]+)\\(([0-9]+)\\)")
-      # User explicitly specified PTX for the concrete BIN
+      # User explicitly specified ARCH for the concrete CODE
       list(APPEND nvcc_flags -gencode arch=compute_${CMAKE_MATCH_2},code=sm_${CMAKE_MATCH_1})
       list(APPEND nvcc_archs_readable sm_${CMAKE_MATCH_1})
     else()
-      # User didn't explicitly specify PTX for the concrete BIN, we assume PTX=BIN
+      # User didn't explicitly specify ARCH for the concrete CODE, we assume ARCH=CODE
       list(APPEND nvcc_flags -gencode arch=compute_${arch},code=sm_${arch})
       list(APPEND nvcc_archs_readable sm_${arch})
     endif()


Split crunch_add_test to crunch_add_test_executable and crunch_add_test_targets for better control in dependents

--- configure.cmake
+++ configure.cmake
@@ -13,7 +13,7 @@
   add_definitions("-DBOOST_TEST_DYN_LINK")
 endif()

-macro(crunch_add_test _name)
+macro(crunch_add_test_executable _name)
   # Add test executable, with main function defined by the boost unit testing framework
   add_executable(${_name}
     ${ARGN}
@@ -21,8 +21,10 @@

   target_link_libraries(${_name}
     boost_unit_test_framework)
+endmacro()

-  # Shared build target for all tests
+macro(crunch_add_test_targets _name)
+    # Shared build target for all tests
   if(NOT TARGET build-tests)
     add_custom_target(build-tests)
   endif()
@@ -44,3 +46,8 @@
   add_dependencies(run-tests "run-${_name}")
 endmacro()

+macro(crunch_add_test _name)
+  crunch_add_test_executable(${_name} ${ARGN})
+  crunch_add_test_targets(${_name})
+endmacro()
+


Support all possible CMake boolean literals for build options (1, ON, YES, TRUE, Y / 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, "")

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -2,8 +2,12 @@
 function(RootConfigure)

 #---Define all sort of variables to bridge between the old Module.mk and the new CMake equivalents-----------
-set(valueON yes)
-set(valueOFF no)
+foreach(v 1 ON YES TRUE Y)
+  set(value${v} yes)
+endforeach()
+foreach(v 0 OFF NO FALSE N IGNORE NOTFOUND)
+  set(value${v} no)
+endforeach()

 set(ROOT_DICTTYPE cint)
 set(ROOT_CONFIGARGS "")
@@ -349,13 +353,12 @@
 set(dicttype ${ROOT_DICTTYPE})

 #---RConfigure-------------------------------------------------------------------------------------------------
-set(hasON define)
-set(hasOFF undef)
-set(hason define)
-set(hasoff undef)
-set(has1 define)
-set(has0 undef)
-set(has undef)
+foreach(v 1 ON YES TRUE Y)
+  set(has${v} define)
+endforeach()
+foreach(v 0 OFF NO FALSE N IGNORE NOTFOUND "")
+  set(has${v} undef)
+endforeach()
 set(setresuid undef)
 set(hasmathmore ${has${mathmore}})
 set(haspthread ${has${CMAKE_USE_PTHREADS_INIT}})


Workaround a linker problem on OSX 10.4

Workaround a linker problem on OSX 10.4

--- configure.cmake
+++ configure.cmake
@@ -91,6 +91,12 @@
   IF(MINGW AND CMAKE_SIZEOF_VOIDP EQUAL 4)
    # mininal architecture flags, i486 enables GCC atomics
    ADD_DEFINITIONS(-march=i486)
+  ENDIF()
+  IF(APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET)
+    # Workaround linker problems  on OSX 10.4
+    IF(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.5")
+      ADD_DEFINITIONS(-fno-common)
+    ENDIF()
   ENDIF()
 ENDIF()


videoio: fix plugins build

videoio: fix plugins build

--- modules/videoio/cmake/plugin_standalone.cmake
+++ modules/videoio/cmake/plugin_standalone.cmake
@@ -34,7 +34,10 @@
   set(imgproc_ROOT "${modules_ROOT}/imgproc")
   set(imgcodecs_ROOT "${modules_ROOT}/imgcodecs")

-  add_library(${OPENCV_PLUGIN_NAME} MODULE "${videoio_ROOT}/src/${videoio_src_file}")
+  add_library(${OPENCV_PLUGIN_NAME} MODULE
+      "${videoio_ROOT}/src/${videoio_src_file}"
+      ${OPENCV_PLUGIN_EXTRA_SRC_FILES}
+  )
   target_include_directories(${OPENCV_PLUGIN_NAME} PRIVATE
     "${CMAKE_CURRENT_BINARY_DIR}"
     "${videoio_ROOT}/src"