Commit 570d75cc authored by Markus Mirz's avatar Markus Mirz
Browse files

restructure dpsim and cps cmake files

parent 10424bf9
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.12)
project(DPsim CXX)
set(PROJECT_AUTHOR "Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_COPYRIGHT "2017-2020, Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_DESCRIPTION "C++ Power System Simulation Library")
set(PROJECT_HOMEPAGE_URL "https://dpsim.fein-aachen.org/")
set(PROJECT_VCS_URL "https://git.rwth-aachen.org/acs/public/simulation/dpsim")
# Required for dpsim_python
cmake_policy(SET CMP0076 NEW)
# Allow setting Graphviz_ROOT for windows builds
cmake_policy(SET CMP0074 NEW)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
set(TOPLEVEL_PROJECT ON)
else()
set(TOPLEVEL_PROJECT OFF)
set(TOPLEVEL_PROJECT OFF)
endif()
# Enable C++11 support
......@@ -18,27 +27,24 @@ endif()
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
add_definitions(-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake;${PROJECT_SOURCE_DIR}/models/CMake")
if(NOT WIN32)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
set(PROJECT_AUTHOR "Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_COPYRIGHT "2017-2020, Institute for Automation of Complex Power Systems, RWTH Aachen University")
set(PROJECT_DESCRIPTION "C++ Power System Simulation Library")
set(PROJECT_HOMEPAGE_URL "http://www.fein-aachen.org/projects/dpsim/")
set(PROJECT_VCS_URL "https://git.rwth-aachen.org/acs/public/simulation/dpsim")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake;${PROJECT_SOURCE_DIR}/models/CMake")
include(CheckCXXCompilerFlag)
if(MSVC)
# Set exception handling for portability
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
check_cxx_compiler_flag("/W4 /WX" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
# TODO activate this again after fixing warnings
# set(DPSIM_CXX_FLAGS /W4 /WX)
endif()
else()
check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
set(DPSIM_CXX_FLAGS -Wall -Werror)
endif()
......@@ -54,27 +60,29 @@ include(GetVersion)
GetVersion(${PROJECT_SOURCE_DIR} "DPSIM")
find_package(Eigen3 3.0 REQUIRED)
# Workaround for spdlog in Windows
# A custom FindSpdlog does not work currently
option(SPDLOG_BUILD_TESTING "Build spdlog tests" OFF)
option(SPDLOG_BUILD_BENCH "Build spdlog benchmarks" OFF)
option(SPDLOG_BUILD_EXAMPLES "Build spdlog examples" OFF)
# Workaround for spdlog in Windows
# A custom FindSpdlog does not work currently
option(WITH_SPDLOG_SUBMODULE "Build with Spdlog as submodule" OFF)
if (WITH_SPDLOG_SUBMODULE OR WIN32)
set(SPDLOG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Dependencies/spdlog/include)
else()
find_package(spdlog REQUIRED)
endif()
find_package(CIMpp)
add_subdirectory(models)
find_package(PythonInterp 3.6)
find_package(PythonLibs 3.6)
find_package(Threads REQUIRED)
find_package(CIMpp)
find_package(Sundials)
find_package(OpenMP)
find_package(GSL)
find_package(Graphviz)
find_package(PythonInterp 3.6)
find_package(PythonLibs 3.6)
find_package(VILLASnode)
if(PythonInterp_FOUND AND PythonLibs_FOUND)
......@@ -83,67 +91,59 @@ endif()
if("${CMAKE_SYSTEM}" MATCHES "Linux")
set(Linux_FOUND ON)
elseif("${CMAKE_SYSTEM}" MATCHES "Darwin")
set(MacOS_FOUND ON)
endif()
# Options
include(CMakeDependentOption)
option(BUILD_SHARED_LIBS "Build shared library" OFF)
option(BUILD_EXAMPLES "Build C++ examples" ON)
option(COMPARE_REFERENCE "Download reference results and compare" OFF)
option(BUILD_SHARED_LIBS "Build shared library" ON)
option(BUILD_EXAMPLES "Build C++ examples" ON)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_SHMEM "Enable shared memory interface" ON "VILLASnode_FOUND" OFF)
cmake_dependent_option(WITH_RT "Enable real-time features" ON "Linux_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Enable OpenMP-based parallelisation" ON "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_SHMEM "Enable shared memory interface" ON "VILLASnode_FOUND" OFF)
cmake_dependent_option(WITH_RT "Enable real-time features" ON "Linux_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable CIM file parsing" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_OPENMP "Enable OpenMP parallelisation" ON "OPENMP_FOUND" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Enable Graphviz Graphs" ON "Graphviz_FOUND" OFF)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/dpsim/Config.h.in
${CMAKE_CURRENT_BINARY_DIR}/Include/dpsim/Config.h
)
set(INCLUDE_DIRS
set(DPSIM_INCLUDE_DIRS
${CMAKE_CURRENT_BINARY_DIR}/Include
${CMAKE_CURRENT_SOURCE_DIR}/Include
)
add_subdirectory(models)
add_subdirectory(Tests)
add_subdirectory(Source)
add_subdirectory(docs)
#add_subdirectory(Dependencies/pybind11)
#pybind11_add_module(dpsimpy Source/pybind/main.cpp)
#target_link_libraries(dpsimpy PRIVATE dpsim)
if(BUILD_EXAMPLES)
add_subdirectory(Examples)
endif(BUILD_EXAMPLES)
if(COMPARE_REFERENCE)
include(ExternalProject)
ExternalProject_Add(reference-results
GIT_REPOSITORY https://git.rwth-aachen.de/acs/public/simulation/reference-results.git
#GIT_TAG origin/master
PREFIX reference-results
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
endif()
message("Compiler Release Flags:")
message(${CMAKE_CXX_FLAGS_RELEASE})
message("Compiler Debug Flags:")
message(${CMAKE_CXX_FLAGS_DEBUG})
message(VERBOSE "Compiler Release Flags: " ${CMAKE_CXX_FLAGS_RELEASE})
message(VERBOSE "Compiler Debug Flags: " ${CMAKE_CXX_FLAGS_DEBUG})
if(TOPLEVEL_PROJECT)
# Show feature summary
include(FeatureSummary)
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Shmem WITH_SHMEM "Interface DPsim solvers via shared-memory interfaces")
add_feature_info(RT WITH_RT "Extended real-time features")
add_feature_info(GSL WITH_GSL "Use GNU Scientific library")
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Shmem WITH_SHMEM "Interface DPsim solvers via shared-memory interfaces")
add_feature_info(RT WITH_RT "Extended real-time features")
add_feature_info(GSL WITH_GSL "Use GNU Scientific library")
add_feature_info(Graphviz WITH_GRAPHVIZ "Graphviz Graphs")
add_feature_info(Sundials WITH_SUNDIALS "Sundials solvers")
feature_summary(WHAT ALL VAR enabledFeaturesText)
if (FOUND_GIT_VERSION)
......
......@@ -11,20 +11,20 @@ set(CIRCUIT_SOURCES
# Dynamic phasor examples
Circuits/DP_VS_RL1.cpp
Circuits/DP_Circuits.cpp
Circuits/DP_Basics_DP_Sims.cpp
Circuits/DP_Basics_DP_Sims.cpp
Circuits/DP_PiLine.cpp
Circuits/DP_DecouplingLine.cpp
Circuits/DP_Diakoptics.cpp
Circuits/DP_VSI.cpp
# EMT examples
Circuits/EMT_CS_RL1.cpp
Circuits/EMT_VS_RL1.cpp
Circuits/EMT_Circuits.cpp
Circuits/DP_Basics_EMT_Sims.cpp
Circuits/DP_Basics_EMT_Sims.cpp
#Circuits/EMT_ResVS_RL_Switch.cpp
Circuits/EMT_VSI.cpp
# Static Phasor examples
Circuits/SP_Circuits.cpp
......@@ -32,7 +32,7 @@ set(CIRCUIT_SOURCES
Circuits/DP_EMT_RL_SourceStep.cpp
)
set(SYNCGEN_SOURCES
set(SYNCGEN_SOURCES
Components/DP_SynGenDq7odTrapez_SteadyState.cpp
Components/DP_SynGenDq7odTrapez_ThreePhFault.cpp
Components/DP_SynGenTrStab_SteadyState.cpp
......@@ -45,7 +45,7 @@ set(SYNCGEN_SOURCES
set(INVERTER_SOURCES
Components/DP_Inverter_Grid.cpp
Components/DP_Inverter_Grid_Parallel_FreqSplit.cpp
Components/DP_Inverter_Grid_Sequential_FreqSplit.cpp
Components/DP_Inverter_Grid_Sequential_FreqSplit.cpp
)
if(WITH_SUNDIALS)
......@@ -91,19 +91,19 @@ if(WITH_CIM)
list(APPEND INCLUDE_DIRS ${CIMPP_INCLUDE_DIRS})
set(CIM_SOURCES
CIM/dpsim-cim.cpp
CIM/dpsim-cim.cpp
CIM/WSCC-9bus_CIM.cpp
CIM/WSCC-9bus_CIM_Dyn.cpp
CIM/WSCC-9bus_CIM_Dyn_Switch.cpp
# PF(Power Flow) example
# PF(Power Flow) example
CIM/Slack_Trafo_Load.cpp
CIM/Slack_TrafoTapChanger_Load.cpp
CIM/CIGRE_MV_PowerFlowTest.cpp
CIM/CIGRE_MV_PowerFlowTest_LoadProfiles.cpp
CIM/IEEE_LV_PowerFlowTest.cpp
CIM/IEEE_LV_PowerFlowTest_LoadProfiles.cpp
CIM/case145.cpp
CIM/case300.cpp
CIM/case9.cpp
......@@ -154,7 +154,9 @@ endforeach()
if(WITH_SHMEM)
add_executable(ShmemRealtimeExample Shmem/ShmemExample.cpp)
target_link_libraries(ShmemRealtimeExample ${LIBRARIES})
target_include_directories(ShmemRealtimeExample PRIVATE ${INCLUDE_DIRS})
target_include_directories(ShmemRealtimeExample PRIVATE ${INCLUDE_DIRS})
target_compile_definitions(ShmemRealtimeExample PUBLIC REALTIME)
endif()
add_subdirectory(cim_graphviz)
add_subdirectory(signals)
\ No newline at end of file
if(WITH_GRAPHVIZ AND WITH_CIM)
add_executable(cimviz cimviz.cpp)
target_link_libraries(cimviz PUBLIC cps ${CIMPP_LIBRARIES} ${GRAPHVIZ_LIBRARIES})
endif()
option(WITH_TESTS "Build Tests" ON)
set(SIGNALS_SRCS
FIRFilter.cpp
Exciter.cpp
TurbineGovernor.cpp
)
if(WITH_TESTS)
set(TEST_SRCS
FIRFilter.cpp
Exciter.cpp
TurbineGovernor.cpp
)
endif()
foreach(SOURCE ${TEST_SRCS})
foreach(SOURCE ${SIGNALS_SRCS})
get_filename_component(TARGET ${SOURCE} NAME_WE)
add_executable(${TARGET} ${SOURCE})
target_link_libraries(${TARGET} cps)
target_include_directories(${TARGET} PRIVATE ${INCLUDE_DIRS})
target_compile_options(${TARGET} PUBLIC ${CPS_CXX_FLAGS})
endforeach()
set(SOURCES
set(DPSIM_SOURCES
Simulation.cpp
RealTimeSimulation.cpp
MNASolver.cpp
......@@ -16,58 +16,54 @@ set(SOURCES
DiakopticsSolver.cpp
)
list(APPEND LIBRARIES cps)
if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
list(APPEND DPSIM_LIBRARIES cps)
if(WITH_RT AND HAVE_TIMERFD)
list(APPEND LIBRARIES "-lrt")
list(APPEND DPSIM_LIBRARIES "-lrt")
endif()
if(WITH_SUNDIALS)
list(APPEND SOURCES DAESolver.cpp)
list(APPEND DPSIM_SOURCES DAESolver.cpp)
#For ODE-Solver class:
list(APPEND SOURCES ODESolver.cpp)
list(APPEND INCLUDE_DIRS ${SUNDIALS_INCLUDE_DIRS})
list(APPEND LIBRARIES ${SUNDIALS_LIBRARIES})
list(APPEND DPSIM_SOURCES ODESolver.cpp)
list(APPEND DPSIM_INCLUDE_DIRS ${SUNDIALS_INCLUDE_DIRS})
list(APPEND DPSIM_LIBRARIES ${SUNDIALS_LIBRARIES})
endif()
if(WITH_GSL)
list(APPEND INCLUDE_DIRS ${GSL_INCLUDE_DIRS})
list(APPEND LIBRARIES ${GSL_LIBRARIES})
list(APPEND DPSIM_INCLUDE_DIRS ${GSL_INCLUDE_DIRS})
list(APPEND DPSIM_LIBRARIES ${GSL_LIBRARIES})
endif()
if(WITH_PYTHON)
list(APPEND INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
#list(APPEND LIBRARIES ${PYTHON_LIBRARIES})
list(APPEND DPSIM_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
#list(APPEND DPSIM_LIBRARIES ${PYTHON_LIBRARIES})
add_subdirectory(Python)
endif()
if(WITH_SHMEM)
list(APPEND SOURCES
list(APPEND DPSIM_SOURCES
Interface.cpp
PthreadPoolScheduler.cpp
)
list(APPEND LIBRARIES ${VILLASNODE_LIBRARIES} pthread)
list(APPEND INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS})
list(APPEND DPSIM_LIBRARIES ${VILLASNODE_LIBRARIES} pthread)
list(APPEND DPSIM_INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS})
endif()
if(WITH_OPENMP)
list(APPEND SOURCES
list(APPEND DPSIM_SOURCES
OpenMPLevelScheduler.cpp
)
list(APPEND DPSIM_CXX_FLAGS ${OpenMP_CXX_FLAGS})
list(APPEND LIBRARIES ${OpenMP_CXX_FLAGS})
list(APPEND DPSIM_LIBRARIES ${OpenMP_CXX_FLAGS})
endif()
add_library(dpsim ${SOURCES})
target_link_libraries(dpsim ${LIBRARIES})
target_include_directories(dpsim PUBLIC ${INCLUDE_DIRS})
add_library(dpsim ${DPSIM_SOURCES})
target_link_libraries(dpsim PUBLIC ${DPSIM_LIBRARIES})
target_include_directories(dpsim PUBLIC ${DPSIM_INCLUDE_DIRS} ${CPS_LIBRARIES})
target_compile_options(dpsim PUBLIC ${DPSIM_CXX_FLAGS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
......
cmake_minimum_required(VERSION 3.6)
project(CPowerSystems CXX)
if(${CMAKE_VERSION} VERSION_GREATER "3.12.0")
# Allow setting Graphviz_ROOT for windows builds
cmake_policy(SET CMP0074 NEW)
endif()
# Enable C++11 support
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
include(CheckCXXCompilerFlag)
if(MSVC)
check_cxx_compiler_flag("/W4 /WX" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
# TODO activate this again after fixing warnings
# set(CPS_CXX_FLAGS /W4 /WX)
endif()
else()
check_cxx_compiler_flag("-Wall -Werror" CXX_SUPPORTS_WERROR)
if(CXX_SUPPORTS_WERROR)
set(CPS_CXX_FLAGS -Wall -Werror)
endif()
endif()
set(Python_ADDITIONAL_VERSIONS 3.5 3.6 3.7)
find_package(Threads REQUIRED)
find_package(PythonInterp 3.5)
find_package(PythonLibs 3.5)
find_package(Graphviz)
find_package(Sundials)
find_package(GSL)
find_package(NumPy)
if(PythonInterp_FOUND AND PythonLibs_FOUND)
set(Python_FOUND ON)
endif()
if("${CMAKE_SYSTEM}" MATCHES "Linux")
set(Linux_FOUND ON)
elseif("${CMAKE_SYSTEM}" MATCHES "Darwin")
set(MacOS_FOUND ON)
endif()
include(CMakeDependentOption)
cmake_dependent_option(WITH_NUMPY "Enable NumPy" ON "NumPy_FOUND" OFF)
cmake_dependent_option(WITH_GSL "Enable GSL" ON "GSL_FOUND" OFF)
cmake_dependent_option(WITH_SUNDIALS "Enable sundials solver suite" ON "Sundials_FOUND" OFF)
cmake_dependent_option(WITH_PYTHON "Enable Python support" ON "Python_FOUND" OFF)
cmake_dependent_option(WITH_CIM "Enable support for parsing CIM files" ON "CIMpp_FOUND" OFF)
cmake_dependent_option(WITH_GRAPHVIZ "Enable support for Graphviz Graphs" ON "Graphviz_FOUND" OFF)
# Show feature summary
include(FeatureSummary)
add_feature_info(CIM WITH_CIM "Loading Common Information Model Files")
add_feature_info(Graphviz WITH_GRAPHVIZ "Graphviz Graphs")
add_feature_info(Python WITH_PYTHON "Use DPsim as a Python module")
add_feature_info(Sundials WITH_SUNDIALS "Sundials solvers")
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
feature_summary(WHAT ALL VAR enabledFeaturesText)
message(STATUS "Feature summary for CPS")
message(STATUS "${enabledFeaturesText}")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Include/cps/Config.h.in
${CMAKE_CURRENT_BINARY_DIR}/Include/cps/Config.h
)
set(INCLUDE_DIRS
set(CPS_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/Include
${CMAKE_CURRENT_BINARY_DIR}/Include
${EIGEN3_INCLUDE_DIR}
${SPDLOG_INCLUDE_DIR}
)
set(LIBRARIES
set(CPS_LIBRARIES
Threads::Threads
)
......@@ -89,9 +18,7 @@ if(Linux_FOUND OR MacOS_FOUND)
# TODO This doesn't actually depend on which OS or compiler is used, but which
# stdlib. For now, under Linux only GNU's libstdc++ seems to work anyway.
# With LLVM's libc++, -lc++fs should probably be used
list(APPEND LIBRARIES stdc++fs)
list(APPEND CPS_LIBRARIES stdc++fs)
endif()
add_subdirectory(Source)
add_subdirectory(Examples)
add_subdirectory(Tests)
set(LIBRARIES cps)
# targets
if(WITH_CIM)
list(APPEND INCLUDE_DIRS ${CIMPP_INCLUDE_DIRS})
list(APPEND LIBRARIES ${CIMPP_LIBRARIES})
endif()
if(WITH_GRAPHVIZ)
list(APPEND INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIRS})
list(APPEND LIBRARIES ${GRAPHVIZ_LIBRARIES})
endif()
if(WITH_GRAPHVIZ AND WITH_CIM)
add_executable(cimviz cimviz.cpp)
target_link_libraries(cimviz PUBLIC ${LIBRARIES})
target_include_directories(cimviz PUBLIC ${INCLUDE_DIRS})
target_compile_options(cimviz PUBLIC ${CPS_CXX_FLAGS})
endif()
if(NOT WIN32)
# we use PyArg_ParseTupleAndKeywords several times, which erroneously accepts
# a char* array instead of a const char* array
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
add_library(cps STATIC
Logger.cpp
MathUtils.cpp
Attribute.cpp
Attribute.cpp
TopologicalNode.cpp
TopologicalTerminal.cpp
SimNode.cpp
......@@ -17,7 +10,7 @@ add_library(cps STATIC
CSVReader.cpp
)
list(APPEND SOURCES
list(APPEND CPS_SOURCES
Base/Base_SynchronGenerator.cpp
DP/DP_Ph1_Capacitor.cpp
......@@ -52,7 +45,7 @@ list(APPEND SOURCES
DP/DP_Ph3_SynchronGeneratorDQTrapez.cpp
# DP/DP_Ph3_SynchronGeneratorDQSmpl.cpp
# DP/DP_Ph3_SynchronGeneratorVBR.cpp
# DP/DP_Ph3_SynchronGeneratorVBRStandalone.cpp
# DP/DP_Ph3_SynchronGeneratorVBRStandalone.cpp
EMT/EMT_Ph1_Capacitor.cpp
EMT/EMT_Ph1_CurrentSource.cpp
......@@ -84,7 +77,7 @@ list(APPEND SOURCES
# EMT/EMT_Ph3_SynchronGeneratorDQSmpl.cpp
# EMT/EMT_Ph3_SynchronGeneratorDQSmplCompSource.cpp
# EMT/EMT_Ph3_SynchronGeneratorVBR.cpp
# EMT/EMT_Ph3_SynchronGeneratorVBRStandalone.cpp
# EMT/EMT_Ph3_SynchronGeneratorVBRStandalone.cpp
SP/SP_Ph1_ControlledVoltageSource.cpp
SP/SP_Ph1_VoltageSource.cpp
......@@ -120,42 +113,42 @@ list(APPEND SOURCES
)
if(WITH_CIM)
list(APPEND SOURCES CIM/Reader.cpp)
list(APPEND CPS_SOURCES CIM/Reader.cpp)
list(APPEND INCLUDE_DIRS ${CIMPP_INCLUDE_DIRS})
list(APPEND LIBRARIES ${CIMPP_LIBRARIES})
list(APPEND CPS_INCLUDE_DIRS ${CIMPP_INCLUDE_DIRS})
list(APPEND CPS_LIBRARIES ${CIMPP_LIBRARIES})
endif()
if(WITH_PYTHON)
list(APPEND INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
list(APPEND LIBRARIES ${PYTHON_LIBRARIES})
list(APPEND CPS_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
list(APPEND CPS_LIBRARIES ${PYTHON_LIBRARIES})
if(WITH_NUMPY)
list(APPEND SOURCES AttributeNumPy.cpp)
list(APPEND INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS})
list(APPEND CPS_SOURCES AttributeNumPy.cpp)
list(APPEND CPS_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS})
endif()
endif()
if(WITH_GRAPHVIZ)
list(APPEND SOURCES Graph.cpp)
list(APPEND CPS_SOURCES Graph.cpp)
list(APPEND INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIRS})
list(APPEND LIBRARIES ${GRAPHVIZ_LIBRARIES})
list(APPEND CPS_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIRS})
list(APPEND CPS_LIBRARIES ${GRAPHVIZ_LIBRARIES})
endif()
if(WITH_SUNDIALS)
list(APPEND SOURCES DP/DP_Ph3_SynchronGeneratorDQODE.cpp)
list(APPEND SOURCES EMT/EMT_Ph3_SynchronGeneratorDQODE.cpp)
list(APPEND INCLUDE_DIRS ${SUNDIALS_INCLUDE_DIRS})
list(APPEND LIBRARIES ${SUNDIALS_LIBRARIES})
list(APPEND CPS_SOURCES DP/DP_Ph3_SynchronGeneratorDQODE.cpp)
list(APPEND CPS_SOURCES EMT/EMT_Ph3_SynchronGeneratorDQODE.cpp)
list(APPEND CPS_INCLUDE_DIRS ${SUNDIALS_INCLUDE_DIRS})
list(APPEND CPS_LIBRARIES ${SUNDIALS_LIBRARIES})
endif()
if(WITH_GSL)
list(APPEND INCLUDE_DIRS ${GSL_INCLUDE_DIRS})
list(APPEND LIBRARIES ${GSL_LIBRARIES})
list(APPEND CPS_INCLUDE_DIRS ${GSL_INCLUDE_DIRS})
list(APPEND CPS_LIBRARIES ${GSL_LIBRARIES})
endif()
target_link_libraries(cps PUBLIC ${LIBRARIES})
target_include_directories(cps PUBLIC ${INCLUDE_DIRS})
target_sources(cps PRIVATE ${SOURCES})
target_link_libraries(cps PUBLIC ${CPS_LIBRARIES})
target_include_directories(cps PUBLIC ${CPS_INCLUDE_DIRS})
target_sources(cps PRIVATE ${CPS_SOURCES})
target_compile_options(cps PUBLIC ${CPS_CXX_FLAGS})
\ No newline at end of file
Supports Markdown
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