From 74fde3ae9398eeb567b97d2ba77d5a949a80ad49 Mon Sep 17 00:00:00 2001
From: Pere Mato <pere.mato@cern.ch>
Date: Wed, 17 Sep 2014 22:58:36 +0200
Subject: [PATCH] Align recent changes in patches to master.

---
 CMakeLists.txt                              |  1 +
 cmake/modules/RootCTest.cmake               |  3 ---
 cmake/modules/SearchInstalledSoftware.cmake | 13 ++++++++-----
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2124b84f23b..a9d03362733 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -162,6 +162,7 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_INSTALL_PREFIX)
 endif()
 
 #---Configure Testing using CTest----------------------------------------------------------------
+configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/CTestCustom.cmake ${CMAKE_BINARY_DIR} COPYONLY)
 if(testing)
   if(gnuinstall)
     message(FATAL_ERROR "You cannot enable to run the tests in the build directory (testing=ON) and at the same time select a GNU style installation (gnuinstall=ON). This is because the code is built with the final installation location (CMAKE_INSTALL_PREFIX) for many ancillary files (tutorials, etc, icons, macros, etc.) and these are not available before installation. Tests can be run against the installation once is completed. See the instructions in the web")
diff --git a/cmake/modules/RootCTest.cmake b/cmake/modules/RootCTest.cmake
index 8e4bc3fd296..59934b18f7e 100644
--- a/cmake/modules/RootCTest.cmake
+++ b/cmake/modules/RootCTest.cmake
@@ -26,9 +26,6 @@ if(WIN32)
   endforeach()
 endif()
 
-#---Copy CTestCustom.cmake to binary directory--------------------------------------------------
-configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/CTestCustom.cmake ${CMAKE_BINARY_DIR} COPYONLY)
-
 #---Add all subdirectories with tests-----------------------------------------------------------
 
 get_property(test_dirs GLOBAL PROPERTY ROOT_TEST_SUBDIRS)
diff --git a/cmake/modules/SearchInstalledSoftware.cmake b/cmake/modules/SearchInstalledSoftware.cmake
index 1f49e1aba4f..836d0fcf2dd 100644
--- a/cmake/modules/SearchInstalledSoftware.cmake
+++ b/cmake/modules/SearchInstalledSoftware.cmake
@@ -23,7 +23,9 @@ if(NOT builtin_zlib)
    endif()
 endif()
 if(builtin_zlib)
-  set(ZLIB_LIBRARY "")
+  if(WIN32)
+    set(ZLIB_LIBRARY "")
+  endif()
 endif()
 
 #---Check for Freetype---------------------------------------------------------------
@@ -181,6 +183,7 @@ if(asimage)
   find_Package(PNG)
   if(PNG_FOUND)
     set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${PNG_LIBRARIES})
+    list(GET PNG_INCLUDE_DIRS 0 PNG_INCLUDE_DIR)
   endif()
   find_Package(JPEG)
   if(JPEG_FOUND)
@@ -206,7 +209,7 @@ if(mathmore OR builtin_gsl)
       GSL
       URL http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${gsl_version}.tar.gz
       INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --enable-shared=no
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --enable-shared=no CFLAGS=${CMAKE_C_FLAGS}
     )
     set(GSL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
     foreach(l gsl gslcblas)
@@ -615,7 +618,7 @@ if(builtin_xrootd)
   set(XROOTD_CFLAGS "-DROOTXRDVERS=${xrootd_versionnum}")
   install(DIRECTORY ${CMAKE_BINARY_DIR}/${_LIBDIR_DEFAULT}/ DESTINATION ${CMAKE_INSTALL_LIBDIR}
                     COMPONENT libraries
-                    FILES_MATCHING PATTERN "libXrd*${CMAKE_SHARED_LIBRARY_SUFFIX}")
+                    FILES_MATCHING PATTERN "libXrd*")
   set(xrootd ON CACHE BOOL "" FORCE)
 endif()
 if(xrootd AND xrootd_versionnum VERSION_GREATER 300030005)
@@ -830,8 +833,8 @@ if(vc)
       set(vc OFF CACHE BOOL "" FORCE)
     endif()
   elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)  # equivalent to MSVC 2010
-      message(STATUS "VC requires MSVC version >= 2010; switching OFF 'vc' option")
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)  # equivalent to MSVC 2010
+      message(STATUS "VC requires MSVC version >= 2011; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
     endif()
   endif()
-- 
GitLab