From 15f3ebfdd980301fe126539544576f6bed12bef5 Mon Sep 17 00:00:00 2001
From: Christopher Stawarz <cstawarz@mit.edu>
Date: Mon, 24 Oct 2016 12:32:41 -0400
Subject: [PATCH] Added Xcode project for NWBFormat plugin.  Addressed a
 compiler warning.

---
 .../contents.xcworkspacedata                  |   3 +
 .../xcshareddata/xcschemes/All.xcscheme       |  14 +
 .../NWBFormat.xcodeproj/project.pbxproj       | 246 ++++++++++++++++++
 .../Plugins/NWBFormat/NWBFormat/Info.plist    |  26 ++
 Source/Plugins/NWBFormat/NWBFormat.cpp        |   2 +-
 Source/Plugins/NWBFormat/OpenEphysLib.cpp     |   2 +-
 6 files changed, 291 insertions(+), 2 deletions(-)
 create mode 100644 Builds/MacOSX/Plugins/NWBFormat/NWBFormat.xcodeproj/project.pbxproj
 create mode 100644 Builds/MacOSX/Plugins/NWBFormat/NWBFormat/Info.plist

diff --git a/Builds/MacOSX/OpenEphys.xcworkspace/contents.xcworkspacedata b/Builds/MacOSX/OpenEphys.xcworkspace/contents.xcworkspacedata
index 9ff01afaa..5d8052eab 100644
--- a/Builds/MacOSX/OpenEphys.xcworkspace/contents.xcworkspacedata
+++ b/Builds/MacOSX/OpenEphys.xcworkspace/contents.xcworkspacedata
@@ -50,6 +50,9 @@
       <FileRef
          location = "group:NetworkEvents/NetworkEvents.xcodeproj">
       </FileRef>
+      <FileRef
+         location = "group:NWBFormat/NWBFormat.xcodeproj">
+      </FileRef>
       <FileRef
          location = "group:PhaseDetector/PhaseDetector.xcodeproj">
       </FileRef>
diff --git a/Builds/MacOSX/OpenEphys.xcworkspace/xcshareddata/xcschemes/All.xcscheme b/Builds/MacOSX/OpenEphys.xcworkspace/xcshareddata/xcschemes/All.xcscheme
index c311032a2..ef6878cd8 100644
--- a/Builds/MacOSX/OpenEphys.xcworkspace/xcshareddata/xcschemes/All.xcscheme
+++ b/Builds/MacOSX/OpenEphys.xcworkspace/xcshareddata/xcschemes/All.xcscheme
@@ -188,6 +188,20 @@
                ReferencedContainer = "container:Plugins/NetworkEvents/NetworkEvents.xcodeproj">
             </BuildableReference>
          </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "E1F91DE31DBE670500FF13EA"
+               BuildableName = "NWBFormat.bundle"
+               BlueprintName = "NWBFormat"
+               ReferencedContainer = "container:Plugins/NWBFormat/NWBFormat.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
          <BuildActionEntry
             buildForTesting = "YES"
             buildForRunning = "YES"
diff --git a/Builds/MacOSX/Plugins/NWBFormat/NWBFormat.xcodeproj/project.pbxproj b/Builds/MacOSX/Plugins/NWBFormat/NWBFormat.xcodeproj/project.pbxproj
new file mode 100644
index 000000000..4c60410d5
--- /dev/null
+++ b/Builds/MacOSX/Plugins/NWBFormat/NWBFormat.xcodeproj/project.pbxproj
@@ -0,0 +1,246 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		E1F91DFA1DBE69C400FF13EA /* NWBFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F91DF51DBE69C400FF13EA /* NWBFormat.cpp */; };
+		E1F91DFB1DBE69C400FF13EA /* NWBRecording.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F91DF71DBE69C400FF13EA /* NWBRecording.cpp */; };
+		E1F91DFC1DBE69C400FF13EA /* OpenEphysLib.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1F91DF91DBE69C400FF13EA /* OpenEphysLib.cpp */; };
+		E1F91DFF1DBE6B0400FF13EA /* libOpenEphysHDF5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = E1F91DFE1DBE6B0400FF13EA /* libOpenEphysHDF5.dylib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+		E1F91DE41DBE670500FF13EA /* NWBFormat.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NWBFormat.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+		E1F91DE71DBE670500FF13EA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		E1F91DF21DBE684700FF13EA /* Plugin_Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Plugin_Debug.xcconfig; sourceTree = "<group>"; };
+		E1F91DF31DBE684700FF13EA /* Plugin_Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Plugin_Release.xcconfig; sourceTree = "<group>"; };
+		E1F91DF51DBE69C400FF13EA /* NWBFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NWBFormat.cpp; sourceTree = "<group>"; };
+		E1F91DF61DBE69C400FF13EA /* NWBFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NWBFormat.h; sourceTree = "<group>"; };
+		E1F91DF71DBE69C400FF13EA /* NWBRecording.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NWBRecording.cpp; sourceTree = "<group>"; };
+		E1F91DF81DBE69C400FF13EA /* NWBRecording.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NWBRecording.h; sourceTree = "<group>"; };
+		E1F91DF91DBE69C400FF13EA /* OpenEphysLib.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OpenEphysLib.cpp; sourceTree = "<group>"; };
+		E1F91DFE1DBE6B0400FF13EA /* libOpenEphysHDF5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libOpenEphysHDF5.dylib; path = ../Frameworks/libOpenEphysHDF5.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		E1F91DE11DBE670500FF13EA /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E1F91DFF1DBE6B0400FF13EA /* libOpenEphysHDF5.dylib in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		E1F91DDB1DBE670500FF13EA = {
+			isa = PBXGroup;
+			children = (
+				E1F91DED1DBE67A600FF13EA /* Config */,
+				E1F91DE61DBE670500FF13EA /* NWBFormat */,
+				E1F91DFD1DBE6B0400FF13EA /* Frameworks */,
+				E1F91DE51DBE670500FF13EA /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		E1F91DE51DBE670500FF13EA /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				E1F91DE41DBE670500FF13EA /* NWBFormat.bundle */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		E1F91DE61DBE670500FF13EA /* NWBFormat */ = {
+			isa = PBXGroup;
+			children = (
+				E1F91DF41DBE698E00FF13EA /* Source */,
+				E1F91DE71DBE670500FF13EA /* Info.plist */,
+			);
+			path = NWBFormat;
+			sourceTree = "<group>";
+		};
+		E1F91DED1DBE67A600FF13EA /* Config */ = {
+			isa = PBXGroup;
+			children = (
+				E1F91DF21DBE684700FF13EA /* Plugin_Debug.xcconfig */,
+				E1F91DF31DBE684700FF13EA /* Plugin_Release.xcconfig */,
+			);
+			name = Config;
+			path = ../Config;
+			sourceTree = "<group>";
+		};
+		E1F91DF41DBE698E00FF13EA /* Source */ = {
+			isa = PBXGroup;
+			children = (
+				E1F91DF61DBE69C400FF13EA /* NWBFormat.h */,
+				E1F91DF51DBE69C400FF13EA /* NWBFormat.cpp */,
+				E1F91DF81DBE69C400FF13EA /* NWBRecording.h */,
+				E1F91DF71DBE69C400FF13EA /* NWBRecording.cpp */,
+				E1F91DF91DBE69C400FF13EA /* OpenEphysLib.cpp */,
+			);
+			name = Source;
+			path = ../../../../../Source/Plugins/NWBFormat;
+			sourceTree = "<group>";
+		};
+		E1F91DFD1DBE6B0400FF13EA /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				E1F91DFE1DBE6B0400FF13EA /* libOpenEphysHDF5.dylib */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		E1F91DE31DBE670500FF13EA /* NWBFormat */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = E1F91DEA1DBE670500FF13EA /* Build configuration list for PBXNativeTarget "NWBFormat" */;
+			buildPhases = (
+				E1F91DE01DBE670500FF13EA /* Sources */,
+				E1F91DE11DBE670500FF13EA /* Frameworks */,
+				E1F91DE21DBE670500FF13EA /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = NWBFormat;
+			productName = NWBFormat;
+			productReference = E1F91DE41DBE670500FF13EA /* NWBFormat.bundle */;
+			productType = "com.apple.product-type.bundle";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		E1F91DDC1DBE670500FF13EA /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0800;
+				ORGANIZATIONNAME = "Open Ephys";
+				TargetAttributes = {
+					E1F91DE31DBE670500FF13EA = {
+						CreatedOnToolsVersion = 8.0;
+						ProvisioningStyle = Automatic;
+					};
+				};
+			};
+			buildConfigurationList = E1F91DDF1DBE670500FF13EA /* Build configuration list for PBXProject "NWBFormat" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+			);
+			mainGroup = E1F91DDB1DBE670500FF13EA;
+			productRefGroup = E1F91DE51DBE670500FF13EA /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				E1F91DE31DBE670500FF13EA /* NWBFormat */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		E1F91DE21DBE670500FF13EA /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		E1F91DE01DBE670500FF13EA /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				E1F91DFC1DBE69C400FF13EA /* OpenEphysLib.cpp in Sources */,
+				E1F91DFA1DBE69C400FF13EA /* NWBFormat.cpp in Sources */,
+				E1F91DFB1DBE69C400FF13EA /* NWBRecording.cpp in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+		E1F91DE81DBE670500FF13EA /* Debug */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = E1F91DF21DBE684700FF13EA /* Plugin_Debug.xcconfig */;
+			buildSettings = {
+			};
+			name = Debug;
+		};
+		E1F91DE91DBE670500FF13EA /* Release */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = E1F91DF31DBE684700FF13EA /* Plugin_Release.xcconfig */;
+			buildSettings = {
+			};
+			name = Release;
+		};
+		E1F91DEB1DBE670500FF13EA /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				HEADER_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(MAC_PACKAGE_DIR)/include",
+				);
+				INFOPLIST_FILE = NWBFormat/Info.plist;
+				LIBRARY_SEARCH_PATHS = (
+					"$(CONFIGURATION_BUILD_DIR)/../Frameworks",
+					"$(inherited)",
+				);
+				PRODUCT_BUNDLE_IDENTIFIER = "org.open-ephys.gui.plugin.NWBFormat";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		E1F91DEC1DBE670500FF13EA /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				HEADER_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(MAC_PACKAGE_DIR)/include",
+				);
+				INFOPLIST_FILE = NWBFormat/Info.plist;
+				LIBRARY_SEARCH_PATHS = (
+					"$(CONFIGURATION_BUILD_DIR)/../Frameworks",
+					"$(inherited)",
+				);
+				PRODUCT_BUNDLE_IDENTIFIER = "org.open-ephys.gui.plugin.NWBFormat";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		E1F91DDF1DBE670500FF13EA /* Build configuration list for PBXProject "NWBFormat" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				E1F91DE81DBE670500FF13EA /* Debug */,
+				E1F91DE91DBE670500FF13EA /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		E1F91DEA1DBE670500FF13EA /* Build configuration list for PBXNativeTarget "NWBFormat" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				E1F91DEB1DBE670500FF13EA /* Debug */,
+				E1F91DEC1DBE670500FF13EA /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = E1F91DDC1DBE670500FF13EA /* Project object */;
+}
diff --git a/Builds/MacOSX/Plugins/NWBFormat/NWBFormat/Info.plist b/Builds/MacOSX/Plugins/NWBFormat/NWBFormat/Info.plist
new file mode 100644
index 000000000..f7dd1296e
--- /dev/null
+++ b/Builds/MacOSX/Plugins/NWBFormat/NWBFormat/Info.plist
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>NSHumanReadableCopyright</key>
+	<string>Copyright © 2016 Open Ephys. All rights reserved.</string>
+	<key>NSPrincipalClass</key>
+	<string></string>
+</dict>
+</plist>
diff --git a/Source/Plugins/NWBFormat/NWBFormat.cpp b/Source/Plugins/NWBFormat/NWBFormat.cpp
index 475e46c95..6194088e2 100644
--- a/Source/Plugins/NWBFormat/NWBFormat.cpp
+++ b/Source/Plugins/NWBFormat/NWBFormat.cpp
@@ -36,7 +36,7 @@
 #define SPIKE_CHUNK_YSIZE 40
 #endif
 
- NWBFile::NWBFile(String fName, String ver, String idText) : HDF5FileBase(), filename(fName), identifierText(idText), GUIVersion(ver), spikeMaxSize(0)
+ NWBFile::NWBFile(String fName, String ver, String idText) : HDF5FileBase(), filename(fName), GUIVersion(ver), spikeMaxSize(0), identifierText(idText)
  {
 	 //Init stuff
 	 readyToOpen=true; //In KWIK this is in initFile, but the new recordEngine methods make it safe for it to be here
diff --git a/Source/Plugins/NWBFormat/OpenEphysLib.cpp b/Source/Plugins/NWBFormat/OpenEphysLib.cpp
index 99aac97c7..f079ebf3f 100644
--- a/Source/Plugins/NWBFormat/OpenEphysLib.cpp
+++ b/Source/Plugins/NWBFormat/OpenEphysLib.cpp
@@ -28,7 +28,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <Windows.h>
 #define EXPORT __declspec(dllexport)
 #else
-#define EXPORT
+#define EXPORT __attribute__((visibility("default")))
 #endif
 
 
-- 
GitLab