-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·70 lines (51 loc) · 1.72 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# CMakeLists.txt
#
# Top-level CMake file for the iec61850 client.
#
#*******************************************************************************
# This is part of the Paho MQTT C++ client library.
#
# Copyright (c) 2021-2022, chao.xia
#
#
# Contributors:
# chao.xia
#*******************************************************************************/
## Note: on OS X you should install XCode and the associated command-line tools
## cmake flags
cmake_minimum_required(VERSION 3.10)
## --- TOOLCHAIN options ---
# if(DEFINED ENV{TOOLCHAIN})
# set(CMAKE_C_COMPILER $ENV{TOOLCHAIN}gcc)
# set(CMAKE_CXX_COMPILER $ENV{TOOLCHAIN}g++)
# set(CMAKE_AR "$ENV{TOOLCHAIN}ar" CACHE FILEPATH "CW archiver" FORCE)
# endif()
## project name
project("iec61850_client"
VERSION "1.0.0"
LANGUAGES CXX
)
## --- Build options ---
option(IEC61850_BUILD_TESTS "Build tests" FALSE)
option(IEC61850_BUILD_DOCUMENTATION "Create and install the API documentation (requires Doxygen)" FALSE)
## --- C++11 build flags ---
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# set(CMAKE_C_FLAGS "-O3 -g -ggdb -pthread")
# set(CMAKE_C_FLAGS_DEBUG "-O3 -g -Wall -ggdb -Werror -Wno-unused -pthread")
# set(CMAKE_CXX_FLAGS "-O3 -g -ggdb -pthread")
# set(CMAKE_CXX_FLAGS_DEBUG "-O3 -g -Wall -ggdb -Werror -Wno-unused -pthread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -pthread")
# For the paho_mqtt_c module
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# --- Documentation ---
if(IEC61850_BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif()
# --- Unit Tests ---
if(IEC61850_BUILD_TESTS)
add_subdirectory(test)
endif()
## --- build execute ---
add_subdirectory(src)