-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists-sample.txt
63 lines (50 loc) · 1.62 KB
/
CMakeLists-sample.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
54
55
56
57
58
59
60
61
cmake_minimum_required(VERSION 2.8)
set(_ECLIPSE_VERSION 4.6)
project(project_name)
add_definitions(-std=c99)
enable_language(C)
enable_unit_testing()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
include(PlatformSpecificSupport)
include(GenerateCtags)
set(CMAKE_COLOR_MAKEFILE ON)
option(WITH_COVERAGE "Build with code coverage support (requires lcov and build with tests)." OFF)
#option(WITH_DOC "Build API documentation (requires Doxygen)." OFF)
option(WITH_TESTS "Build tests (requires CppUTest)." OFF)
if(WITH_COVERAGE)
set(WITH_TESTS ON)
include(CodeCoverage)
# Enable code coverage.
# Build with debugging information to make the output meaningful.
# Disable optimizations to get the most accurate results.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -g -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage -g -O0")
if (NOT TARGET coverage)
SETUP_TARGET_FOR_COVERAGE(
coverage
ctest
coverage-report-fdb
libdict/*)
endif()
else()
message(STATUS "COVERAGE disabled. ")
endif()
if (WITH_TESTS)
include(UseCppUTest)
else()
message(STATUS "TESTS disabled.")
endif()
if (WITH_DOCS)
include(UseDoxygen)
else()
message(STATUS "DOCS disabled.")
endif()
# The version number
set (project_name_VERSION_MAJOR 0)
set (project_name_VERSION_MINOR 1)
# output directories
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
#include_directories(include)
#add_executable(program_name src/main.c)