From: Derek Barnett Date: Thu, 18 Oct 2012 16:24:20 +0000 (-0400) Subject: Version 2.2 X-Git-Url: https://git.donarmstrong.com/?p=bamtools.git;a=commitdiff_plain;h=bafc03f4ed7ed9ff1b3fb24874dc8a4a6d58e605 Version 2.2 * Added support for running in NodeJS (fixed: piping issues) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b89990e..944e01d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 ) diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt index 1af7a7f..5b66ec0 100644 --- a/src/api/CMakeLists.txt +++ b/src/api/CMakeLists.txt @@ -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 diff --git a/src/api/internal/io/BamPipe_p.cpp b/src/api/internal/io/BamPipe_p.cpp index 2d571fd..6af4af1 100644 --- a/src/api/internal/io/BamPipe_p.cpp +++ b/src/api/internal/io/BamPipe_p.cpp @@ -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" ); diff --git a/src/toolkit/CMakeLists.txt b/src/toolkit/CMakeLists.txt index a88cf79..1f198b3 100644 --- a/src/toolkit/CMakeLists.txt +++ b/src/toolkit/CMakeLists.txt @@ -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 diff --git a/src/toolkit/bamtools.cpp b/src/toolkit/bamtools.cpp index 97c032f..29097d0 100644 --- a/src/toolkit/bamtools.cpp +++ b/src/toolkit/bamtools.cpp @@ -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; } diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index e810eb3..2d91ca3 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -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 )