File: CMakeLists.txt

package info (click to toggle)
axe-demultiplexer 0.3.3+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 848 kB
  • sloc: ansic: 4,480; python: 352; makefile: 171; sh: 47
file content (62 lines) | stat: -rw-r--r-- 1,723 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
PROJECT(axe C)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules")

# Cmake options
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
ENABLE_TESTING()

IF (NOT CMAKE_BUILD_TYPE)
        SET(CMAKE_BUILD_TYPE Release)
ENDIF()

# Get version from debian changelog
EXECUTE_PROCESS(COMMAND dpkg-parsechangelog -S Version
		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
		OUTPUT_VARIABLE AXE_VERSION
		OUTPUT_STRIP_TRAILING_WHITESPACE)

MESSAGE(STATUS "${CMAKE_BUILD_TYPE} build of axe version: ${AXE_VERSION}")

###############################
## Find Packages and Headers ##
###############################

FIND_PACKAGE(ZLIB 1.2.5 REQUIRED)

FIND_PACKAGE(GSL)

IF (GSL_FOUND)
    SET(AXE_DEP_INCLUDES ${GSL_INCLUDE_DIRS})
    SET(AXE_DEP_LIBS ${GSL_LIBRARIES})
ENDIF()


##########################
## Set Compiler Options ##
##########################

# Set CFLAGS
SET(AXEWRN "${AXEWRN} -fstack-protector-all -Wstack-protector")
SET(AXEWRN "${AXEWRN} -Wall -Wextra -Wpedantic")

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${AXEWRN}")

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src
                    ${PROJECT_SOURCE_DIR}/src/datrie
                    ${PROJECT_SOURCE_DIR}/src/libqes/src
                    ${PROJECT_SOURCE_DIR}/src/gsl)
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib)

INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})

CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/src/axe_config.h.in
               ${CMAKE_BINARY_DIR}/axe_config.h)

ADD_SUBDIRECTORY(docs)
ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(src)