You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.3 KiB
74 lines
2.3 KiB
project (RPL)
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
set(CMAKE_BUILD_TYPE "Debug")
|
|
# pour rechercher les fonctions
|
|
include(CheckFunctionExists)
|
|
|
|
#ajoute les modules locaux
|
|
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeModules)
|
|
|
|
#recherche le package BOOST
|
|
set(Boost_NO_BOOST_CMAKE ON)
|
|
set(Boost_USE_STATIC_LIBS ON)
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
set(Boost_USE_STATIC_RUNTIME ON)
|
|
find_package(Boost 1.42 COMPONENTS iostreams unit_test_framework)
|
|
if (Boost_FOUND)
|
|
include_directories(${BOOST_INCLUDE_DIR})
|
|
endif(Boost_FOUND)
|
|
|
|
# recherche le package GMP
|
|
find_package(GMP)
|
|
if (GMP_FOUND)
|
|
include_directories(${GMP_INCLUDE_DIR})
|
|
endif()
|
|
|
|
# pour la doc auto-generee de RPL
|
|
find_package(Doxygen)
|
|
if(DOXYGEN_FOUND)
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
|
|
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
|
|
add_custom_target(doc ${DOXYGEN_EXECUTABLE}
|
|
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
COMMENT "Generating API documentation with Doxygen" VERBATIM)
|
|
endif(DOXYGEN_FOUND)
|
|
|
|
# test for GETRUSAGE
|
|
CHECK_FUNCTION_EXISTS(getrusage HAVE_GETRUSAGE)
|
|
if (HAVE_GETRUSAGE)
|
|
add_definitions(-DHAVE_GETRUSAGE)
|
|
endif(HAVE_GETRUSAGE)
|
|
|
|
#for the color
|
|
add_definitions(-DLIBQI_COLOR_SHELL)
|
|
|
|
#add flags for compilation
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
|
|
|
# pour les includes
|
|
include_directories(include/)
|
|
# pour les sources de test
|
|
add_subdirectory(src/libqi/rpl/tests)
|
|
# pour les sources de la lib
|
|
add_subdirectory(src/libqi/rpl/lib)
|
|
# pour les sources de la lib
|
|
add_subdirectory(src/libqi)
|
|
# pour les sources de program principal
|
|
add_subdirectory(src/qi/)
|
|
|
|
# pour les tests
|
|
enable_testing()
|
|
add_test(bigint src/libqi/rpl/tests/test_bigint)
|
|
add_test(bigfloat src/libqi/rpl/tests/test_bigfloat)
|
|
add_test(bigint_matrix src/libqi/rpl/tests/test_bigint_matrix)
|
|
add_test(polynomial src/libqi/rpl/tests/test_poly)
|
|
add_test(rational_factorization src/libqi/rpl/tests/test_rational_factorization)
|
|
# filtrage sur la sortie des tests
|
|
set(failRegex "^.*FAILED")
|
|
foreach(loop_var RANGE 1 121)
|
|
set(test_id "quad" ${loop_var})
|
|
add_test(quad-${loop_var} src/qi/debilos.sh ${loop_var})
|
|
set_property (TEST quad-${loop_var} PROPERTY FAIL_REGULAR_EXPRESSION "${failRegex}")
|
|
endforeach(loop_var)
|
|
|