X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=CMakeLists.txt;fp=CMakeLists.txt;h=f4f23bdce12166fd37c77ff14c9181e95f98b5f2;hb=a50400c186a05160e1164bf544571b739ff6fac8;hp=70f606ff237fb4c1428fe93c03fe4811b200575a;hpb=d6a5fdafd5490a20285566695c4aef16a2d57107;p=bamtools.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 70f606f..f4f23bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,44 +6,47 @@ # ========================== # set project name -project (BamTools) +project( BamTools ) # Cmake requirements -cmake_minimum_required (VERSION 2.6.4) +cmake_minimum_required( VERSION 2.6.4 ) + +# init CTest +enable_testing() # Force the build directory to be different from source directory -macro (ENSURE_OUT_OF_SOURCE_BUILD MSG) - string (COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource) - get_filename_component (PARENTDIR ${CMAKE_SOURCE_DIR} PATH) - string (COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir) - IF (insource OR insourcesubdir) - message (FATAL_ERROR "${MSG}") - ENDIF (insource OR insourcesubdir) -endmacro (ENSURE_OUT_OF_SOURCE_BUILD) - -ensure_out_of_source_build (" +macro( ENSURE_OUT_OF_SOURCE_BUILD MSG ) + string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" insource ) + get_filename_component( PARENTDIR ${CMAKE_SOURCE_DIR} PATH ) + string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PARENTDIR}" insourcesubdir ) + IF( insource OR insourcesubdir ) + message( FATAL_ERROR "${MSG}" ) + ENDIF( insource OR insourcesubdir ) +endmacro( ENSURE_OUT_OF_SOURCE_BUILD ) + +ensure_out_of_source_build( " ${PROJECT_NAME} requires an out of source build. $ mkdir build $ cd build $ cmake .. $ make -(or the Windows equivalent)\n") +(or the Windows equivalent)\n" ) # set BamTools version information -set (BamTools_VERSION_MAJOR 2) -set (BamTools_VERSION_MINOR 0) -set (BamTools_VERSION_BUILD 5) +set( BamTools_VERSION_MAJOR 2 ) +set( BamTools_VERSION_MINOR 0 ) +set( BamTools_VERSION_BUILD 5 ) # set our library and executable destination dirs -set (EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") -set (LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib") +set( EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin" ) +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) +set( CMAKE_BUILD_TYPE Release ) +add_definitions( -Wall -D_FILE_OFFSET_BITS=64 ) # add our includes root path -include_directories (src) +include_directories( src ) # list subdirectories to build in -add_subdirectory (src) +add_subdirectory( src )