2018-06-21 09:36:49 +02:00
|
|
|
# CMakeLists.
|
|
|
|
#
|
|
|
|
# @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
|
2020-01-20 17:17:00 +01:00
|
|
|
# @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
|
2018-06-21 09:36:49 +02:00
|
|
|
# @license GNU General Public License (version 3)
|
|
|
|
#
|
|
|
|
# VILLASnode
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
###################################################################################
|
|
|
|
|
2018-07-16 21:15:19 +02:00
|
|
|
if(DEFINED PROTOBUF_COMPILER AND PROTOBUF_FOUND)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
2018-08-20 11:03:06 +02:00
|
|
|
villas.pb.cc villas.pb.h
|
2018-07-16 21:15:19 +02:00
|
|
|
message.js sample.js timestamp.js value.js
|
|
|
|
COMMAND ${PROTOBUF_COMPILER}
|
|
|
|
--js_out=${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
--cpp_out=${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
villas.proto
|
|
|
|
MAIN_DEPENDENCY villas.proto
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED PROTOBUFC_COMPILER AND PROTOBUFC_FOUND)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT
|
|
|
|
villas.pb-c.c villas.pb-c.h
|
2018-07-19 14:52:39 +02:00
|
|
|
COMMAND ${PROTOBUFC_COMPILER}
|
2018-07-16 21:15:19 +02:00
|
|
|
--c_out=${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
villas.proto
|
|
|
|
MAIN_DEPENDENCY villas.proto
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
2018-06-21 09:36:49 +02:00
|
|
|
|
|
|
|
list(APPEND FORMAT_SRC
|
2019-04-07 15:13:40 +02:00
|
|
|
protobuf.cpp
|
2018-06-21 09:36:49 +02:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/villas.pb-c.c
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND INCLUDE_DIRS
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
list(APPEND LIBRARIES
|
2018-07-04 15:14:02 +02:00
|
|
|
PkgConfig::PROTOBUFC
|
2018-06-21 09:36:49 +02:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-07-16 21:15:19 +02:00
|
|
|
list(APPEND FORMAT_SRC
|
2019-04-07 15:13:40 +02:00
|
|
|
json.cpp
|
2020-03-10 18:34:54 +01:00
|
|
|
iotagent_ul.cpp
|
2019-04-07 15:13:40 +02:00
|
|
|
json_reserve.cpp
|
|
|
|
villas_binary.cpp
|
|
|
|
villas_human.cpp
|
|
|
|
csv.cpp
|
|
|
|
raw.cpp
|
|
|
|
msg.cpp
|
2020-07-05 11:31:33 +02:00
|
|
|
value.cpp
|
2018-07-16 21:15:19 +02:00
|
|
|
)
|
|
|
|
|
2018-07-03 18:24:20 +02:00
|
|
|
add_library(formats STATIC ${FORMAT_SRC})
|
|
|
|
target_include_directories(formats PUBLIC ${INCLUDE_DIRS})
|
2020-06-14 15:02:16 +02:00
|
|
|
target_link_libraries(formats PUBLIC ${LIBRARIES})
|