cmake_minimum_required(VERSION 2.6) project(linea CXX) set(BOOST_LIBS) # The distribution findBoost.cmake is broken (based on old boost lib naming conventions), # so we do our own thing: if(BOOST_ROOT) set(BOOST_ROOT "${BOOST_ROOT}" CACHE PATH "The root of the boost installation") if (EXISTS ${BOOST_ROOT} AND IS_DIRECTORY ${BOOST_ROOT}) set(BOOST_INCLUDE_DIR ${BOOST_ROOT}/include) if (NOT IS_DIRECTORY ${BOOST_INCLUDE_DIR}) message(ERROR "BOOST include directory: ${BOOST_INCLUDE_DIR} is not a a directory") endif(NOT IS_DIRECTORY ${BOOST_INCLUDE_DIR}) include_directories(${BOOST_INCLUDE_DIR}) set(BOOST_FOUND TRUE CACHE BOOL "Boost has been found") foreach(LIBNAME ${BOOST_LIBS}) find_library(BOOST_${LIBNAME}_LIBRARY boost_${LIBNAME} PATHS ${BOOST_ROOT}/lib NO_DEFAULT_PATH) message( STATUS "Boost ${LIBNAME} library: ${BOOST_${LIBNAME}_LIBRARY}") endforeach(LIBNAME ${BOOST_LIBS}) else(EXISTS ${BOOST_ROOT} AND IS_DIRECTORY ${BOOST_ROOT}) message(ERROR "Provided BOOST_ROOT '${BOOST_ROOT}' does not exists") endif (EXISTS ${BOOST_ROOT} AND IS_DIRECTORY ${BOOST_ROOT}) else (BOOST_ROOT) # Yeah, right... foreach(LIBNAME ${BOOST_LIBS}) if( NOT BOOST_${LIBNAME}_LIBRARY ) find_library(BOOST_${LIBNAME}_LIBRARY boost_${LIBNAME}) endif( NOT BOOST_${LIBNAME}_LIBRARY ) message( STATUS "Boost ${LIBNAME} library: ${BOOST_${LIBNAME}_LIBRARY}") endforeach(LIBNAME ${BOOST_LIBS}) endif(BOOST_ROOT) include(CheckCXXCompilerFlag) check_cxx_compiler_flag("-std=c++11" HAS_CXX11) if (HAS_CXX11) message(STATUS "C++11 provided through -std=c++11") # Probably gnu based front ends for 4.7 and above set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else (HAS_CXX11) check_cxx_compiler_flag("-std=c++0x" HAS_CXX11) if (HAS_CXX11) message(STATUS "C++11 provided through -std=c++0x") # Probably gnu based front ends for 4.6 and below set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else (HAS_CXX11) message(STATUS "No specific flags for C++11") endif (HAS_CXX11) endif (HAS_CXX11) add_subdirectory(config) include_directories(${CMAKE_BINARY_DIR}/include ${CMAKE_SOURCE_DIR}) enable_testing() add_subdirectory(tests) add_subdirectory(doc) add_subdirectory(examples)