]> git.donarmstrong.com Git - bamtools.git/commitdiff
Version 2.2
authorDerek Barnett <derekwbarnett@gmail.com>
Thu, 18 Oct 2012 16:24:20 +0000 (12:24 -0400)
committerDerek Barnett <derekwbarnett@gmail.com>
Thu, 18 Oct 2012 16:24:20 +0000 (12:24 -0400)
 * Added support for running in NodeJS (fixed: piping issues)

CMakeLists.txt
src/api/CMakeLists.txt
src/api/internal/io/BamPipe_p.cpp
src/toolkit/CMakeLists.txt
src/toolkit/bamtools.cpp
src/utils/CMakeLists.txt

index b89990e0ecaba46096eb0bc0ef3b516e923954f9..944e01dbe8414b82326360ae82380c6a481f88a8 100644 (file)
@@ -31,8 +31,8 @@ ensure_out_of_source_build( "
 
 # set BamTools version information
 set( BamTools_VERSION_MAJOR 2 )
-set( BamTools_VERSION_MINOR 1 )
-set( BamTools_VERSION_BUILD 1 )
+set( BamTools_VERSION_MINOR 2 )
+set( BamTools_VERSION_BUILD 0 )
 
 # set our library and executable destination dirs
 set( EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin" )
@@ -41,10 +41,23 @@ set( LIBRARY_OUTPUT_PATH    "${CMAKE_SOURCE_DIR}/lib" )
 # define compiler flags for all code
 set( CMAKE_BUILD_TYPE Release )
 add_definitions( -Wall -D_FILE_OFFSET_BITS=64 )
+
+# -----------------------------------------------
+# handle platform-/environment-specific defines
+
+# If planning to run in Node.js environment, run:
+# cmake -DEnableNodeJS=true
+if( EnableNodeJS )
+    add_definitions( -DSYSTEM_NODEJS=1 )
+endif()
+
+# If running on SunOS
 if( "${CMAKE_SYSTEM_NAME}" MATCHES "SunOS" )
-       add_definitions( -DSUN_OS )
+    add_definitions( -DSUN_OS )
 endif()
 
+# -------------------------------------------
+
 # add our includes root path
 include_directories( src )
 
index 1af7a7f917a34077699408ab574586ab5a12c7ea..5b66ec024b072c50cd2941ca241e2df23f27aa4d 100644 (file)
@@ -34,7 +34,7 @@ set( BamToolsAPISources
 # create main BamTools API shared library
 add_library( BamTools SHARED ${BamToolsAPISources} )
 set_target_properties( BamTools PROPERTIES
-                       SOVERSION "2.1.0"
+                       SOVERSION "2.2.0"
                        OUTPUT_NAME "bamtools" )
 
 # create main BamTools API static library
index 2d571fd4c2500adbce043f59065a80f3ddc1efad..6af4af146410df491b01ee8f74937369fa12f27c 100644 (file)
@@ -2,7 +2,7 @@
 // BamPipe_p.cpp (c) 2011 Derek Barnett
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 10 November 2011 (DB)
+// Last modified: 18 October 2012 (DB)
 // ---------------------------------------------------------------------------
 // Provides BAM pipe-specific IO behavior
 // ***************************************************************************
@@ -29,10 +29,18 @@ bool BamPipe::Open(const IBamIODevice::OpenMode mode) {
     Close();
 
     // open stdin/stdout depending on requested openmode
+#if defined( SYSTEM_NODEJS ) && SYSTEM_NODEJS == 1
+    if ( mode == IBamIODevice::ReadOnly )
+        m_stream = stdin;
+    else if ( mode == IBamIODevice::WriteOnly )
+        m_stream = stdout;
+#else
     if ( mode == IBamIODevice::ReadOnly )
         m_stream = freopen(0, "rb", stdin);
     else if ( mode == IBamIODevice::WriteOnly )
         m_stream = freopen(0, "wb", stdout);
+#endif // SYSTEM_NODEJS
+
     else {
         const string errorType = string( (mode == IBamIODevice::ReadWrite) ? "unsupported"
                                                                            : "unknown" );
index a88cf7952cb91494798d7c4bdf2c347706603e13..1f198b37a70817c23e6f3a91a8b2d4de96e72475 100644 (file)
@@ -31,7 +31,7 @@ add_executable( bamtools_cmd
 
 # set BamTools application properties
 set_target_properties( bamtools_cmd PROPERTIES
-                       VERSION  2.1.1
+                       VERSION  2.2.0
                        OUTPUT_NAME "bamtools"
                      )
 # make version info available in application
index 97c032f6f70586382e10955de24f4bbf8d270e5d..29097d021bacbc9fb7a42fbf3ba773ee572a29c6 100644 (file)
@@ -2,7 +2,7 @@
 // bamtools.cpp (c) 2010 Derek Barnett, Erik Garrison
 // Marth Lab, Department of Biology, Boston College
 // ---------------------------------------------------------------------------
-// Last modified: 18 May 2011 (DB)
+// Last modified: 12 October 2012 (DB)
 // ---------------------------------------------------------------------------
 // Integrates a number of BamTools functionalities into a single executable.
 // ***************************************************************************
@@ -137,7 +137,7 @@ int Version(void) {
     cout << "bamtools " << versionStream.str() << endl;
     cout << "Part of BamTools API and toolkit" << endl;
     cout << "Primary authors: Derek Barnett, Erik Garrison, Michael Stromberg" << endl;
-    cout << "(c) 2009-2011 Marth Lab, Biology Dept., Boston College" << endl;
+    cout << "(c) 2009-2012 Marth Lab, Biology Dept., Boston College" << endl;
     cout << endl;
     return EXIT_SUCCESS;
 }
index e810eb36d548bac965d09ee815db5204786283e8..2d91ca39a34e2d63c73528ee0049237f5405d77e 100644 (file)
@@ -25,6 +25,6 @@ target_link_libraries( BamTools-utils BamTools )
 
 # set BamTools library properties
 set_target_properties( BamTools-utils PROPERTIES
-                       SOVERSION   2.1.0
+                       SOVERSION   2.2.0
                        OUTPUT_NAME bamtools-utils
                      )