From 1aba4b5a6c41a3ff7936313b3e81644ada4e37dd Mon Sep 17 00:00:00 2001 From: king Date: Tue, 11 Aug 2009 13:07:42 +0000 Subject: [PATCH] Create cmTarget DLL query methods We creates methods IsDLLPlatform() and HasImportLibrary(). The former returns true on Windows. The latter returns whether the target has a DLL import library. It is true on Windows for shared libraries and executables with exports. --- Source/cmTarget.cxx | 16 +++++++++++----- Source/cmTarget.h | 10 ++++++++-- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 5842762e7..394168dbd 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmTarget.cxx,v $ Language: C++ - Date: $Date: 2009-07-30 14:59:37 $ - Version: $Revision: 1.266 $ + Date: $Date: 2009-08-11 13:07:42 $ + Version: $Revision: 1.267 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -1023,6 +1023,14 @@ bool cmTarget::IsLinkable() } //---------------------------------------------------------------------------- +bool cmTarget::HasImportLibrary() +{ + return (this->DLLPlatform && + (this->GetType() == cmTarget::SHARED_LIBRARY || + this->IsExecutableWithExports())); +} + +//---------------------------------------------------------------------------- bool cmTarget::IsFrameworkOnApple() { return (this->GetType() == cmTarget::SHARED_LIBRARY && @@ -3635,9 +3643,7 @@ void cmTarget::ComputeImportInfo(std::string const& desired_config, // On a DLL platform there may be only IMPORTED_IMPLIB for a shared // library or an executable with exports. - bool allowImp = - this->DLLPlatform && (this->GetType() == cmTarget::SHARED_LIBRARY || - this->IsExecutableWithExports()); + bool allowImp = this->HasImportLibrary(); // Look for a mapping from the current project's configuration to // the imported project's configuration. diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 4dda0852c..9a67b0189 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmTarget.h,v $ Language: C++ - Date: $Date: 2009-07-10 17:53:28 $ - Version: $Revision: 1.138 $ + Date: $Date: 2009-08-11 13:07:42 $ + Version: $Revision: 1.139 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -413,6 +413,12 @@ public: /** Return whether this target may be used to link another target. */ bool IsLinkable(); + /** Return whether or not the target is for a DLL platform. */ + bool IsDLLPlatform() { return this->DLLPlatform; } + + /** Return whether or not the target has a DLL import library. */ + bool HasImportLibrary(); + /** Return whether this target is a shared library Framework on Apple. */ bool IsFrameworkOnApple(); -- 2.11.4.GIT