forked from robidev/iec61850_open_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
127 lines (102 loc) · 4.21 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
cmake_minimum_required(VERSION 2.8.12)
# automagically detect if we should cross-compile
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(iec61850-open-server)
ENABLE_TESTING()
set(PROJECT_VERSION_MAJOR "0")
set(PROJECT_VERSION_MINOR "9")
set(PROJECT_VERSION_PATCH "0")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
# feature checks
include(CheckLibraryExists)
check_library_exists(rt clock_gettime "time.h" CONFIG_SYSTEM_HAS_CLOCK_GETTIME)
# check if we are on a little or a big endian
include (TestBigEndian)
test_big_endian(PLATFORM_IS_BIGENDIAN)
include_directories(
./inc
)
set(open_server_SRCS
input/inputs.c
model/config_file_parser_extensions.c
model/dynamic_model_extensions.c
LNs/SMVPublisher.c
LNs/LNParse.c
LNs/CILO.c
LNs/CSWI.c
LNs/MMXU.c
LNs/PTOC.c
LNs/PTRC.c
LNs/RADR.c
LNs/XCBR.c
LNs/XSWI.c
LNs/LLN0.c
LNs/TVTR.c
LNs/TCTR.c
open_server.c
)
add_executable(open_server
${open_server_SRCS}
)
target_link_libraries(open_server
libiec61850.so
libiec61850.a
libhal.a
libhal-shared.a
pthread
m
)
# NOTE: this project uses a dual license scheme, as libiec61850 is covered by GPL 3.0
# this means that any software that incorporates this library should adhere to GPL 3.0 as well
# however, the circuit-simulator does not use libiec61850, and therefore this is apache licensed
# the circuit-simulator should normally be run on a separate, non-realtime test machine, and is
# therefore ommitted from the install script
install ( TARGETS open_server DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Applications)
install ( FILES Dockerfile.libiec61850_server DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Data)
install ( FILES make_model.sh DESTINATION ${CMAKE_PROJECT_NAME}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT Data
)
install ( FILES make_compose.sh DESTINATION ${CMAKE_PROJECT_NAME}
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
COMPONENT Data
)
install ( FILES README.md DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Data )
install ( FILES COPYING DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Data )
install ( FILES model_input_generator/genconfig.jar
DESTINATION ${CMAKE_PROJECT_NAME}/model_input_generator
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_READ
COMPONENT Data
)
install ( FILES model_input_generator/genconfig_input.jar
DESTINATION ${CMAKE_PROJECT_NAME}/model_input_generator
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_READ
COMPONENT Data
)
install ( FILES model_input_generator/gendocker.jar
DESTINATION ${CMAKE_PROJECT_NAME}/model_input_generator
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ GROUP_WRITE WORLD_READ
COMPONENT Data
)
install ( DIRECTORY cfg DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Data )
install ( DIRECTORY scd DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Data )
install ( DIRECTORY schema DESTINATION ${CMAKE_PROJECT_NAME} COMPONENT Data )
set(CPACK_PACKAGE_DESCRIPTION "IEC 61850 open server")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IEC 61850 open server")
set(CPACK_PACKAGE_VENDOR "https://github.com/robidev")
set(CPACK_PACKAGE_CONTACT "[email protected]")
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_COMPONENTS_ALL Applications Data)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}")
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
include(InstallRequiredSystemLibraries)
include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")