Commit 64895524 authored by Markus Mirz's avatar Markus Mirz
Browse files

cmake fetch villas src


Signed-off-by: Markus Mirz's avatarMarkus Mirz <mmirz@eonerc.rwth-aachen.de>
parent a5e78428
......@@ -194,6 +194,10 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/Include/dpsim/Config.h
)
if(WITH_SHMEM)
include(cmake/GetVillasDPsim.cmake)
endif()
set(DPSIM_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/Include
${CMAKE_CURRENT_SOURCE_DIR}/Include
......@@ -205,7 +209,6 @@ add_subdirectory(docs)
if(BUILD_EXAMPLES)
add_subdirectory(Examples)
add_subdirectory(villas-dpsim/examples)
endif(BUILD_EXAMPLES)
if(WITH_PYBIND)
......
......@@ -79,12 +79,12 @@ endif()
if(WITH_SHMEM)
set(DPSIM_VILLAS_SOURCES
${CMAKE_SOURCE_DIR}/villas-dpsim/src/InterfaceShmem.cpp
${CMAKE_SOURCE_DIR}/villas-dpsim/src/PthreadPoolScheduler.cpp
${CMAKE_BINARY_DIR}/_deps/villas-dpsim-src/src/InterfaceShmem.cpp
${CMAKE_BINARY_DIR}/_deps/villas-dpsim-src/src/PthreadPoolScheduler.cpp
)
set(DPSIM_VILLAS_LIBRARIES ${VILLASNODE_LIBRARIES} pthread)
set(DPSIM_VILLAS_INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR}/villas-dpsim/include)
set(DPSIM_VILLAS_INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS} ${CMAKE_BINARY_DIR}/_deps/villas-dpsim-src/include)
endif()
add_library(dpsim ${DPSIM_SOURCES} ${DPSIM_VILLAS_SOURCES})
......
include(FetchContent)
FetchContent_Declare(
villas-dpsim
GIT_REPOSITORY https://github.com/dpsim-simulator/villas-dpsim.git
GIT_TAG main
)
if(${CMAKE_VERSION} VERSION_LESS "3.14.0")
FetchContent_GetProperties(villas-dpsim)
if(NOT villas-dpsim_POPULATED)
FetchContent_Populate(villas-dpsim)
add_subdirectory(${villas-dpsim_SOURCE_DIR}/examples)
endif()
else()
FetchContent_MakeAvailable(villas-dpsim)
add_subdirectory(${villas-dpsim_SOURCE_DIR}/examples)
endif()
FetchContent_GetProperties(villas-dpsim)
message(STATUS "Path to villas-dpsim: " ${villas-dpsim_SOURCE_DIR})
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment