2013-07-17 05:10:18 +00:00
|
|
|
cmake_minimum_required (VERSION 2.8.7)
|
|
|
|
project (LEAN CXX)
|
|
|
|
set (LEAN_VERSION_MAJOR 0)
|
|
|
|
set (LEAN_VERSION_MINOR 1)
|
2013-07-17 05:11:48 +00:00
|
|
|
|
2013-07-17 05:10:18 +00:00
|
|
|
set (CMAKE_COLOR_MAKEFILE ON)
|
2013-07-17 05:11:48 +00:00
|
|
|
|
|
|
|
# Initialize CXXFLAGS.
|
|
|
|
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DLEAN_DEBUG -DLEAN_TRACE")
|
|
|
|
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
|
|
|
|
|
|
|
|
# Compiler-specific C++11 activation.
|
|
|
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
|
|
|
execute_process(
|
|
|
|
COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
|
|
|
if (NOT (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8))
|
|
|
|
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.8 or greater.")
|
|
|
|
endif ()
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
|
|
|
else ()
|
|
|
|
message(FATAL_ERROR "Your C++ compiler does not support C++11.")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
if (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
|
|
|
|
# Already in cache, be silent
|
|
|
|
set(GMP_FIND_QUIETLY TRUE)
|
|
|
|
endif (GMP_INCLUDE_DIR AND GMP_LIBRARIES)
|
|
|
|
|
|
|
|
find_path(GMP_INCLUDE_DIR NAMES gmp.h )
|
|
|
|
find_library(GMP_LIBRARIES NAMES gmp libgmp )
|
|
|
|
MESSAGE(STATUS "GMP: " ${GMP_LIBRARIES})
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMP DEFAULT_MSG GMP_INCLUDE_DIR GMP_LIBRARIES)
|
|
|
|
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)
|
|
|
|
|
|
|
|
set (CMAKE_CXX_COMPILER "g++-4.8")
|
2013-07-17 05:10:18 +00:00
|
|
|
|
|
|
|
add_subdirectory(util)
|
|
|
|
add_subdirectory(shell)
|
|
|
|
|