diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2015-02-25 20:07:43 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-03-23 13:12:18 (GMT) |
commit | 3714955b9cded21b13064886b30a412211ce217e (patch) | |
tree | ba361c972d5fa02c267a54cc5df514294cd0141f /Source | |
parent | 54a5cdbb4c35aa8847d3eb0f7f418fad72563992 (diff) | |
download | CMake-3714955b9cded21b13064886b30a412211ce217e.zip CMake-3714955b9cded21b13064886b30a412211ce217e.tar.gz CMake-3714955b9cded21b13064886b30a412211ce217e.tar.bz2 |
OS X: Add handling for XCTest bundles
An XCTest bundle is a CFBundle with a special product-type and bundle
extension. For more information about XCTest visit the Mac Developer
library at:
http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/testing_with_xcode/
Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 12 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 16 | ||||
-rw-r--r-- | Source/cmTarget.h | 3 |
3 files changed, 28 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index bd8a1f5..d340e72 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -804,6 +804,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext, { sourcecode = "compiled.mach-o.objfile"; } + else if(ext == "xctest") + { + sourcecode = "wrapper.cfbundle"; + } else if(ext == "xib") { keepLastKnownFileType = true; @@ -2598,7 +2602,9 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget) case cmTarget::STATIC_LIBRARY: return "archive.ar"; case cmTarget::MODULE_LIBRARY: - if (cmtarget.IsCFBundleOnApple()) + if (cmtarget.IsXCTestOnApple()) + return "wrapper.cfbundle"; + else if (cmtarget.IsCFBundleOnApple()) return "wrapper.plug-in"; else return ((this->XcodeVersion >= 22)? @@ -2622,7 +2628,9 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(cmTarget& cmtarget) case cmTarget::STATIC_LIBRARY: return "com.apple.product-type.library.static"; case cmTarget::MODULE_LIBRARY: - if (cmtarget.IsCFBundleOnApple()) + if (cmtarget.IsXCTestOnApple()) + return "com.apple.product-type.bundle.unit-test"; + else if (cmtarget.IsCFBundleOnApple()) return "com.apple.product-type.bundle"; else return ((this->XcodeVersion >= 22)? diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index b70f60d..b3d1155 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -616,6 +616,13 @@ bool cmTarget::IsCFBundleOnApple() const } //---------------------------------------------------------------------------- +bool cmTarget::IsXCTestOnApple() const +{ + return (this->IsCFBundleOnApple() && + this->GetPropertyAsBool("XCTEST")); +} + +//---------------------------------------------------------------------------- bool cmTarget::IsBundleOnApple() const { return this->IsFrameworkOnApple() || this->IsAppBundleOnApple() || @@ -6791,7 +6798,14 @@ std::string cmTarget::GetCFBundleDirectory(const std::string& config, const char *ext = this->GetProperty("BUNDLE_EXTENSION"); if (!ext) { - ext = "bundle"; + if (this->IsXCTestOnApple()) + { + ext = "xctest"; + } + else + { + ext = "bundle"; + } } fpath += ext; fpath += "/Contents"; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 5170b31..a4ef977 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -527,6 +527,9 @@ public: /** Return whether this target is a CFBundle (plugin) on Apple. */ bool IsCFBundleOnApple() const; + /** Return whether this target is a XCTest on Apple. */ + bool IsXCTestOnApple() const; + /** Return whether this target is an executable Bundle on Apple. */ bool IsAppBundleOnApple() const; |