Remove GNUtoMS code in favor of CMake builtin version - Thanks Brad (Kitware)
authorjulie <julielangou@users.noreply.github.com>
Fri, 6 Dec 2013 03:59:31 +0000 (03:59 +0000)
committerjulie <julielangou@users.noreply.github.com>
Fri, 6 Dec 2013 03:59:31 +0000 (03:59 +0000)
CMAKE/GNUtoMS.cmake [deleted file]
CMAKE/GNUtoMS/lib.bat.in [deleted file]
CMAKE/GNUtoMS/lib.cmake [deleted file]
CMAKE/README-GNUtoMS.txt [deleted file]
CMAKE/lapack-config-build.cmake.in
CMAKE/lapack-config-install.cmake.in
CMakeLists.txt

diff --git a/CMAKE/GNUtoMS.cmake b/CMAKE/GNUtoMS.cmake
deleted file mode 100644 (file)
index 186b28a..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-
-#=============================================================================
-# GNUtoMS - CMake module for Windows import library conversion
-# Copyright 2010-2011 Kitware, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# * Neither the name of Kitware, Inc. nor the names of its
-#   contributors may be used to endorse or promote products derived
-#   from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-
-# GNUtoMS works only for the GNU toolchain on Windows (MinGW and MSys).
-set(GNUtoMS 0)
-if(NOT "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU" OR NOT WIN32 OR CYGWIN)
-  return()
-endif()
-
-# Locate auxiliary GNUtoMS files.
-get_filename_component(GNUtoMS_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
-set(GNUtoMS_DIR ${GNUtoMS_DIR}/GNUtoMS)
-
-if(NOT CMAKE_SIZEOF_VOID_P)
-  enable_language(C) # Find CMAKE_SIZEOF_VOID_P reliably.
-endif()
-
-# Find MS development environment setup script for this architecture.
-if("${CMAKE_SIZEOF_VOID_P}" EQUAL 4)
-  find_program(VCVARS32 NAMES vcvars32.bat
-    PATHS
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/bin"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir]/bin"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/bin"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir]/bin"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++;ProductDir]/bin"
-    )
-  set(GNUtoMS_ENV "${VCVARS32}")
-  set(GNUtoMS_ARCH x86)
-elseif("${CMAKE_SIZEOF_VOID_P}" EQUAL 8)
-  find_program(VCVARSAMD64 NAMES vcvarsamd64.bat
-    PATHS
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VC;ProductDir]/bin/amd64"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir]/bin/amd64"
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/bin/amd64"
-    )
-  set(GNUtoMS_ENV "${VCVARSAMD64}")
-  set(GNUtoMS_ARCH amd64)
-endif()
-
-if(GNUtoMS_ENV)
-  set(GNUtoMS 1)
-
-  # Create helper script to run lib.exe from MS environment.
-  string(REPLACE "/" "\\" GNUtoMS_BAT "${GNUtoMS_ENV}")
-  set(LIB ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/GNUtoMSlib.bat)
-  configure_file(${GNUtoMS_DIR}/lib.bat.in ${LIB})
-
-  # Teach CMake how to create a MS import library at link time.
-  set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
-    "${CMAKE_Fortran_CREATE_SHARED_LIBRARY} -Wl,--output-def,<TARGET_NAME>.def"
-    "<CMAKE_COMMAND> -Dlib=\"${LIB}\" -Ddef=\"<TARGET_NAME>.def\" -Ddll=\"<TARGET>\" -Dimp=\"<TARGET_IMPLIB>\" -P \"${GNUtoMS_DIR}/lib.cmake\""
-    )
-endif()
diff --git a/CMAKE/GNUtoMS/lib.bat.in b/CMAKE/GNUtoMS/lib.bat.in
deleted file mode 100644 (file)
index 70d5f73..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-@echo off\r
-call "@GNUtoMS_BAT@"\r
-lib /machine:"@GNUtoMS_ARCH@" %*\r
diff --git a/CMAKE/GNUtoMS/lib.cmake b/CMAKE/GNUtoMS/lib.cmake
deleted file mode 100644 (file)
index 6eaba62..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# Usage: cmake -Dlib=lib.bat -Ddef=out.def -Ddll=out.dll -Dimp=out.dll.a -P lib.cmake
-get_filename_component(name ${dll} NAME) # .dll file name
-string(REGEX REPLACE "\\.dll\\.a$" ".lib" out "${imp}") # .dll.a -> .lib
-execute_process(
-  COMMAND ${lib} /def:${def} /name:${name} /out:${out}
-  RESULT_VARIABLE res
-  )
-if(res)
-  message(FATAL_ERROR "lib failed: ${res}")
-endif()
diff --git a/CMAKE/README-GNUtoMS.txt b/CMAKE/README-GNUtoMS.txt
deleted file mode 100644 (file)
index 5844aae..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-The GNUtoMS CMake module helps LAPACK provide MS-compatible DLLs on
-Windows when built with a free GNU Fortran compiler (e.g. MinGW).  If
-MS Visual Studio tools are installed when one configures LAPACK to
-build with GNU tools the module extends the shared library link rule.
-The extended rule creates both a GNU-style .dll.a import library and a
-MS-format .lib import library.
-
-LAPACK CMake code installs the import libraries for both formats.
-Applications built using CMake can be configured automatically to use
-the import libraries matching the target toolchain.
index e1ea54f8258a4377634fe9839d5bdb67b322cf39..8d60cc8808abd24b32db2125b64f37b0a3709a74 100644 (file)
@@ -1,2 +1 @@
 include("@LAPACK_BINARY_DIR@/lapack-targets.cmake")
-@LAPACK_GNUtoMS_BUILD@
index b0e917d30e9166903bb4d6bc52680efbe1a1c25f..0c55fc17c5f113ba3eacfd4cd5bf45771d46f7cb 100644 (file)
@@ -1,3 +1,2 @@
 get_filename_component(_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include(${_SELF_DIR}/lapack-targets.cmake)
-@LAPACK_GNUtoMS_INSTALL@
index 126760ad9512c9c1c8553e148320c15f1ee8cc06..3d4ccada0b7625a418029248eca48c42050db106 100644 (file)
@@ -1,4 +1,5 @@
 cmake_minimum_required(VERSION 2.8.7)
+set(CMAKE_GNUtoMS ON CACHE INTERNAL "")
 project(LAPACK Fortran)
 
 # Configure the warning and code coverage suppression file
@@ -31,26 +32,12 @@ if (PYTHONINTERP_FOUND)
 endif()
 # --------------------------------------------------
 
-# On Windows-GNU builds try to provide MS import libraries too.
-if(BUILD_SHARED_LIBS)
-  include(GNUtoMS)
-endif()
-
-if(GNUtoMS)
-  set(LAPACK_GNUtoMS_IMPORT ${LAPACK_SOURCE_DIR}/CMAKE/lapack-GNUtoMS.cmake)
-  set(LAPACK_GNUtoMS_INSTALL "include(\${_SELF_DIR}/lapack-GNUtoMS.cmake)")
-  set(LAPACK_GNUtoMS_BUILD "include(\"${LAPACK_GNUtoMS_IMPORT}\")")
-endif()
-
 macro(lapack_install_library lib)
   install(TARGETS ${lib} EXPORT lapack-targets
     ARCHIVE DESTINATION lib${LIB_SUFFIX}
     LIBRARY DESTINATION lib${LIB_SUFFIX}
     RUNTIME DESTINATION bin
   )
-  if(GNUtoMS)
-    install(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/lib${lib}.lib DESTINATION lib)
-  endif()
 endmacro()
 
 # --------------------------------------------------
@@ -280,7 +267,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lapack.pc.in ${CMAKE_CURRENT_BINARY_D
 configure_file(${LAPACK_SOURCE_DIR}/CMAKE/lapack-config-install.cmake.in
   ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake @ONLY)
 install(FILES
-  ${LAPACK_GNUtoMS_IMPORT}
   ${LAPACK_BINARY_DIR}/CMakeFiles/lapack-config.cmake
   ${LAPACK_BINARY_DIR}/lapack-config-version.cmake
   DESTINATION lib/cmake/lapack-${LAPACK_VERSION}