-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (42 loc) · 1.58 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )
PROJECT( MATH )
SET( CMAKE_COLOR_MAKEFILE ON )
SET( CMAKE_VERBOSE_MAKEFILE OFF )
SET( CMAKE_INCLUDE_CURRENT_DIR TRUE )
SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE )
SET( CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
)
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Debug )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG" )
ENDIF( )
# Versioning.
SET( ${PROJECT_NAME}_MAJOR_VERSION 0 )
SET( ${PROJECT_NAME}_MINOR_VERSION 1 )
SET( ${PROJECT_NAME}_PATCH_LEVEL 0 )
OPTION( BUILD_TESTS "Set to ON to build test programs" OFF )
FIND_PACKAGE( GMP REQUIRED )
INCLUDE_DIRECTORIES( ${GMP_INCLUDE_DIR} )
ADD_DEFINITIONS( "-Wall -Wno-unused-function" )
ADD_SUBDIRECTORY( src )
# Build test programs.
IF( BUILD_TESTS MATCHES ON )
ADD_SUBDIRECTORY( test )
ENDIF( )
# Add a target to generate API documentation with Doxygen.
FIND_PACKAGE( Doxygen )
IF( DOXYGEN_FOUND )
CONFIGURE_FILE( ${PROJECT_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( )
MESSAGE( STATUS "--------------------------------------------------" )
MESSAGE( STATUS "VERSION = ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL}" )
MESSAGE( STATUS "BUILD_TESTS = ${BUILD_TESTS}" )
MESSAGE( STATUS "--------------------------------------------------" )