1 # ==========================
2 # BamTools CMakeLists.txt
3 # (c) 2010 Derek Barnett
6 # ==========================
12 cmake_minimum_required( VERSION 2.6.4 )
17 # Force the build directory to be different from source directory
18 macro( ENSURE_OUT_OF_SOURCE_BUILD MSG )
19 string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource )
20 get_filename_component( PARENTDIR ${CMAKE_SOURCE_DIR} PATH )
21 string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir )
22 IF( insource OR insourcesubdir )
23 message( FATAL_ERROR "${MSG}" )
24 ENDIF( insource OR insourcesubdir )
25 endmacro( ENSURE_OUT_OF_SOURCE_BUILD )
27 ensure_out_of_source_build( "
28 ${PROJECT_NAME} requires an out of source build.
33 (or the Windows equivalent)\n" )
35 # set BamTools version information
36 set( BamTools_VERSION_MAJOR 2 )
37 set( BamTools_VERSION_MINOR 0 )
38 set( BamTools_VERSION_BUILD 5 )
40 # set our library and executable destination dirs
41 set( EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin" )
42 set( LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib" )
44 # define compiler flags for all code
45 set( CMAKE_BUILD_TYPE Release )
46 add_definitions( -Wall -D_FILE_OFFSET_BITS=64 )
48 # add our includes root path
49 include_directories( src )
51 # list subdirectories to build in
52 add_subdirectory( src )