summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAlan Antonuk <aega@med.umich.edu>2012-11-29 11:03:15 -0500
committerAlan Antonuk <aega@med.umich.edu>2012-11-29 11:03:15 -0500
commite9eb31fa14de6f04099d7da871deb1786dfd655c (patch)
tree04c67f5b9ce9cd5f1fa3f3af354965a699449c9f /cmake
parent596c6662f31b551761496250306f145fbf9d5fd5 (diff)
downloadrabbitmq-c-github-ask-e9eb31fa14de6f04099d7da871deb1786dfd655c.tar.gz
Install .pdb files where available
Diffstat (limited to 'cmake')
-rw-r--r--cmake/COPYING-CMAKE-SCRIPTS22
-rw-r--r--cmake/InstallMacros.cmake45
2 files changed, 67 insertions, 0 deletions
diff --git a/cmake/COPYING-CMAKE-SCRIPTS b/cmake/COPYING-CMAKE-SCRIPTS
new file mode 100644
index 0000000..53b6b71
--- /dev/null
+++ b/cmake/COPYING-CMAKE-SCRIPTS
@@ -0,0 +1,22 @@
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
diff --git a/cmake/InstallMacros.cmake b/cmake/InstallMacros.cmake
new file mode 100644
index 0000000..30cc47a
--- /dev/null
+++ b/cmake/InstallMacros.cmake
@@ -0,0 +1,45 @@
+#
+# This module install PDB files.
+#
+# Based on users posts:
+# http://www.cmake.org/pipermail/cmake/2007-October/016924.html
+#
+# Copyright (c) 2006-2011 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#
+# Redistribution and use is allowed according to the terms of the New
+# BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+
+macro (install_pdb library)
+ if (MSVC)
+ if(CMAKE_CONFIGURATION_TYPES)
+ # Visual Studio
+ # The following does not work with LOCATION keyword. See:
+ # http://www.cmake.org/pipermail/cmake/2011-February/042579.html
+ foreach(cfg ${CMAKE_CONFIGURATION_TYPES})
+ get_target_property(library_dll ${library} LOCATION_${cfg})
+ string(REPLACE .dll .pdb library_pdb ${library_dll})
+ string(TOLOWER ${cfg} lcfg)
+ if(lcfg STREQUAL "debug" OR lcfg STREQUAL "relwithdebinfo")
+ install (FILES ${library_pdb}
+ DESTINATION bin
+ CONFIGURATIONS ${cfg}
+ )
+ endif()
+ endforeach()
+ else()
+ # nmake
+ # Same as above we need the explicit location_<config> variable to account for
+ # the value of CMAKE_DEBUG_POSTFIX
+ get_target_property(library_dll ${library} LOCATION_${CMAKE_BUILD_TYPE})
+ string(REPLACE .dll .pdb library_pdb ${library_dll})
+ string(TOLOWER ${CMAKE_BUILD_TYPE} lcfg)
+ if(lcfg STREQUAL "debug" OR lcfg STREQUAL "relwithdebinfo")
+ install (FILES ${library_pdb}
+ DESTINATION bin
+ )
+ endif()
+ endif()
+ endif ()
+endmacro ()