cmake_minimum_required(VERSION 2.4.2) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules") include(AppendCompilerFlags) project(openbwt C) set(PROJECT_VERSION "v1.5") set(LIBRARY_VERSION_FULL "1.5") set(LIBRARY_VERSION_MAJOR "1") set(CPACK_GENERATOR "ZIP") set(CPACK_SOURCE_GENERATOR "ZIP") include(ProjectCPack) option(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON) option(BUILD_SAMPLES "Build samples" ON) option(ENABLE_BWTWT64 "Enable 64-bit bwtwt support" OFF) option(WITH_LFS "Enable Large File Support" ON) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_VERBOSE_MAKEFILE ON) endif(NOT CMAKE_BUILD_TYPE) if(MSVC) append_c_compiler_flags("/W4" "VC" CMAKE_C_FLAGS) append_c_compiler_flags("/Oi;/Ot;/Ox;/Oy" "VC" CMAKE_C_FLAGS_RELEASE) elseif(BORLAND) append_c_compiler_flags("-w" "BCC" CMAKE_C_FLAGS) append_c_compiler_flags("-Oi;-Og;-Os;-Ov;-Ox" "BCC" CMAKE_C_FLAGS_RELEASE) else(MSVC) if(CMAKE_COMPILER_IS_GNUCC) append_c_compiler_flags("-Wall" "GCC" CMAKE_C_FLAGS) append_c_compiler_flags("-fomit-frame-pointer" "GCC" CMAKE_C_FLAGS_RELEASE) else(CMAKE_COMPILER_IS_GNUCC) append_c_compiler_flags("-Wall" "UNKNOWN" CMAKE_C_FLAGS) append_c_compiler_flags("-fomit-frame-pointer" "UNKNOWN" CMAKE_C_FLAGS_RELEASE) endif(CMAKE_COMPILER_IS_GNUCC) endif(MSVC) add_definitions(-DHAVE_CONFIG_H=1 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS) add_subdirectory(include) add_subdirectory(src) if(BUILD_SAMPLES) add_subdirectory(samples) endif(BUILD_SAMPLES) ## Add 'uninstall' target ## CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake" IMMEDIATE @ONLY) ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/CMakeModules/cmake_uninstall.cmake")