2018-08-21 00:25:44 +02:00
|
|
|
## CMakeLists.txt
|
|
|
|
#
|
|
|
|
# @author Daniel Krebs <github@daniel-krebs.net>
|
2022-03-15 09:05:42 -04:00
|
|
|
# @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
2022-05-19 17:40:10 +02:00
|
|
|
# @license Apache License 2.0
|
2018-08-21 00:25:44 +02:00
|
|
|
#
|
2018-08-21 16:54:58 +02:00
|
|
|
# VILLAScommon
|
2018-08-21 00:25:44 +02:00
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
add_library(villas-common SHARED
|
2021-02-16 14:15:38 +01:00
|
|
|
base64.cpp
|
2019-04-07 15:12:32 +02:00
|
|
|
buffer.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
common.cpp
|
2019-04-07 15:12:32 +02:00
|
|
|
compat.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
cpuset.cpp
|
2019-04-12 09:45:12 +02:00
|
|
|
dsp/pid.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
hist.cpp
|
2019-04-07 15:12:32 +02:00
|
|
|
kernel/kernel.cpp
|
2018-10-19 16:32:44 +02:00
|
|
|
kernel/rt.cpp
|
2019-04-07 15:12:32 +02:00
|
|
|
list.cpp
|
2018-10-19 14:33:10 +02:00
|
|
|
log.cpp
|
2018-08-22 11:29:39 +02:00
|
|
|
memory_manager.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
memory.cpp
|
2018-08-22 11:29:39 +02:00
|
|
|
plugin.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
popen.cpp
|
2019-04-07 15:12:32 +02:00
|
|
|
table.cpp
|
|
|
|
task.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
terminal.cpp
|
2019-04-07 15:12:32 +02:00
|
|
|
timing.cpp
|
2021-02-16 14:15:38 +01:00
|
|
|
tool.cpp
|
2018-08-22 11:29:39 +02:00
|
|
|
utils.cpp
|
2021-09-19 19:05:53 +02:00
|
|
|
uuid.cpp
|
2018-08-27 11:09:25 +02:00
|
|
|
version.cpp
|
2018-08-21 00:25:44 +02:00
|
|
|
)
|
|
|
|
|
2019-06-27 01:37:56 +02:00
|
|
|
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
2019-04-07 15:12:32 +02:00
|
|
|
target_sources(villas-common PRIVATE tsc.cpp)
|
2018-10-21 20:25:55 +01:00
|
|
|
endif()
|
|
|
|
|
2018-08-22 11:29:39 +02:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
|
|
|
|
target_sources(villas-common PRIVATE
|
2019-04-07 15:12:32 +02:00
|
|
|
kernel/pci.cpp
|
2022-12-02 11:52:12 +01:00
|
|
|
kernel/vfio_device.cpp
|
|
|
|
kernel/vfio_group.cpp
|
|
|
|
kernel/vfio_container.cpp
|
2018-08-21 15:55:32 +02:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-08-21 00:25:44 +02:00
|
|
|
target_include_directories(villas-common PUBLIC
|
2018-08-22 11:29:39 +02:00
|
|
|
${OPENSSL_INCLUDE_DIR}
|
|
|
|
${CURL_INCLUDE_DIRS}
|
2018-08-23 13:15:20 +02:00
|
|
|
${PROJECT_BINARY_DIR}/include
|
|
|
|
${PROJECT_SOURCE_DIR}/include
|
2018-08-21 00:25:44 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(villas-common PUBLIC
|
2018-08-21 15:55:53 +02:00
|
|
|
PkgConfig::JANSSON
|
2020-08-25 20:08:29 +02:00
|
|
|
PkgConfig::UUID
|
2018-08-22 11:29:39 +02:00
|
|
|
${OPENSSL_LIBRARIES}
|
|
|
|
${CURL_LIBRARIES}
|
2018-08-21 12:19:41 +02:00
|
|
|
${CMAKE_DL_LIBS}
|
2019-09-03 21:32:44 +02:00
|
|
|
spdlog::spdlog
|
2019-09-03 22:58:56 +02:00
|
|
|
fmt::fmt
|
2018-12-04 14:12:22 +01:00
|
|
|
stdc++
|
2018-08-21 00:25:44 +02:00
|
|
|
)
|
2018-08-21 13:24:17 +02:00
|
|
|
|
2019-04-06 18:21:47 +02:00
|
|
|
if(WITH_CONFIG)
|
|
|
|
target_link_libraries(villas-common PUBLIC
|
|
|
|
PkgConfig::LIBCONFIG
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-08-23 16:02:02 +02:00
|
|
|
target_compile_definitions(villas-common PUBLIC
|
|
|
|
-D__STDC_FORMAT_MACROS -D_GNU_SOURCE
|
2018-08-21 13:24:17 +02:00
|
|
|
)
|
2019-01-07 14:46:40 +01:00
|
|
|
|
2019-01-13 00:43:17 +01:00
|
|
|
set_target_properties(villas-common PROPERTIES
|
|
|
|
VERSION ${CMAKE_PROJECT_VERSION}
|
|
|
|
SOVERSION 1
|
|
|
|
)
|
|
|
|
|
2019-01-07 14:46:40 +01:00
|
|
|
install(
|
|
|
|
TARGETS villas-common
|
|
|
|
EXPORT VILLASCommonConfig
|
|
|
|
COMPONENT lib
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY ${PROJECT_SOURCE_DIR}/include/villas/
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/villas
|
|
|
|
COMPONENT devel
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.h"
|
2019-01-13 00:43:04 +01:00
|
|
|
PATTERN "*.hpp"
|
2019-01-07 14:46:40 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
DIRECTORY ${PROJECT_BINARY_DIR}/include/villas/
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/villas
|
|
|
|
COMPONENT devel
|
|
|
|
FILES_MATCHING
|
|
|
|
PATTERN "*.h"
|
2019-01-13 00:43:04 +01:00
|
|
|
PATTERN "*.hpp"
|
2019-01-07 14:46:40 +01:00
|
|
|
)
|