CMakeLists.txt 3.4 KB
Newer Older
1
2
set(LIBRARIES "dpsim")

3
4
5
6
7
8
if (NOT WIN32)
	# needed so CIMParser and arabica (which are first compiled into static libs)
	# can be included in the .so
	set(CMAKE_CXX_FLAGS "-fPIC")
endif()

Steffen Vogel's avatar
Steffen Vogel committed
9
# targets
10
set(CIRCUIT_SOURCES
Markus Mirz's avatar
Markus Mirz committed
11
12
13
14
15
	# Dynamic phasor examples
	Circuits/DP_VS_R1.cpp
	Circuits/DP_CS_R1.cpp
	Circuits/DP_VS_RL1.cpp
	Circuits/DP_VS_RC1.cpp	
Petra Raussi's avatar
Petra Raussi committed
16
	Circuits/DP_CS_R2CL.cpp
Markus Mirz's avatar
Markus Mirz committed
17
18
19
20
21
22
23
24
25
26
27
	Circuits/DP_VS_CS_R4.cpp
	Circuits/DP_VS_R2L3.cpp

	#Circuits/DP_VS_PiLine_R.cpp
	#Circuits/DP_VS_Trafo_R.cpp
	#Circuits/DP_ResVS_RL_Switch.cpp	

	# EMT examples
	Circuits/EMT_VS_R1.cpp
	Circuits/EMT_CS_R1.cpp
	Circuits/EMT_VS_RL1.cpp
Petra Raussi's avatar
Petra Raussi committed
28
	Circuits/EMT_CS_R2CL.cpp
Markus Mirz's avatar
Markus Mirz committed
29
30
31
32
33
	Circuits/EMT_VS_R2L3.cpp
	Circuits/EMT_VS_CS_R4_AC.cpp
	Circuits/EMT_VS_CS_R4_DC.cpp	
	
	#Circuits/EMT_ResVS_RL_Switch.cpp
Steffen Vogel's avatar
Steffen Vogel committed
34
)
35

Steffen Vogel's avatar
Steffen Vogel committed
36
set(SYNCGEN_SOURCES
Markus Mirz's avatar
Markus Mirz committed
37
38
	SynchronGenerator/DP_SynGen_dq_SteadyState.cpp
	SynchronGenerator/DP_SynGen_dq_ThreePhFault.cpp
Markus Mirz's avatar
Markus Mirz committed
39
	SynchronGenerator/DP_SynGen_TrStab_SteadyState.cpp
Markus Mirz's avatar
Markus Mirz committed
40
	SynchronGenerator/DP_SynGen_TrStab_LoadStep.cpp
Markus Mirz's avatar
Markus Mirz committed
41
	#SynchronGenerator/DP_SynchronGenerator_BalancedResLoad.cpp
42
43
	#SynchronGenerator/DP_SynchronGenerator_ExciterAndTurbine.cpp
	#SynchronGenerator/DP_SynchronGenerator_SimpThreePhaseFault.cpp
44
	#SynchronGenerator/DP_SynchronGenerator_ThreePhaseFault.cpp
45
46
47
48
49
50
51
52
53
	#SynchronGenerator/DP_SynchronGenerator_VBR.cpp
	#SynchronGenerator/DP_SynchronGenerator_Simplified_ThreePhaseFault.cpp
	#SynchronGenerator/EMT_SynchronGenerator_BalancedResLoad.cpp
	#SynchronGenerator/EMT_SynchronGenerator_ExciterAndTurbine.cpp
	#SynchronGenerator/EMT_SynchronGenerator_PhaseToPhaseFault.cpp
	#SynchronGenerator/EMT_SynchronGenerator_ThreePhaseFault.cpp
	#SynchronGenerator/EMT_SynchronGenerator_VBR_ThreePhaseFault.cpp
	#SynchronGenerator/EMT_SynchronGenerator_Simplified_ThreePhaseFault.cpp
	#SynchronGenerator/EMT_Multimachine.cpp
54
)
55

56
set(VARFREQ_SOURCES
57
58
	#VariableTimeStep/RXLine_LoadStep_FreqStep_1.cpp
	#VariableTimeStep/RXLine_LoadStep_FreqStep_2.cpp
59
60
)

Steffen Vogel's avatar
Steffen Vogel committed
61
62
63
64
65
66
if(WITH_SUNDIALS)
	set(DAE_SOURCES
		DAE/DAE_DP_test.cpp
	)
endif()

Markus Mirz's avatar
Markus Mirz committed
67
68
69
70
71
72
if(WITH_RT)
	set(RT_SOURCES
		RealTime/RT_DP_CS_R_1.cpp
		RealTime/RT_DP_ResVS_RL1.cpp
	)
endif()
Steffen Vogel's avatar
Steffen Vogel committed
73

74
if(WITH_SHMEM)
75
76
77
	list(APPEND LIBRARIES ${VILLASNODE_LIBRARIES})
	list(APPEND INCLUDE_DIRS ${VILLASNODE_INCLUDE_DIRS})

78
	set(SHMEM_SOURCES
79
80
81
82
83
84
85
		Shmem/ShmemExample.cpp
		Shmem/ShmemDistributedReference.cpp
		Shmem/ShmemDistributedDirect.cpp
		Shmem/ShmemDistributedVillas.cpp
		Shmem/ShmemControllableSource.cpp
		Shmem/ShmemControllableFiltSource.cpp
		Shmem/ShmemRealTime.cpp
86
87
	)
endif()
Steffen Vogel's avatar
Steffen Vogel committed
88

89
90
91
92
if(WITH_CIM)
	list(APPEND LIBRARIES ${CIMPP_LIBRARIES})
	list(APPEND INCLUDE_DIRS ${CIMPP_INCLUDE_DIRS})

Markus Mirz's avatar
Markus Mirz committed
93
94
95
96
97
98
	if (NOT WIN32)
		set(CIM_SOURCES_POSIX
			CIM/dpsim-cim.cpp
		)
	endif()

99
	set(CIM_SOURCES
Markus Mirz's avatar
Markus Mirz committed
100
		
101
		CIM/WSCC-9bus_CIM.cpp
Markus Mirz's avatar
Markus Mirz committed
102
		CIM/WSCC-9bus_CIM_Dyn.cpp
Markus Mirz's avatar
Markus Mirz committed
103
		CIM/WSCC-9bus_CIM_Dyn_Switch.cpp
Markus Mirz's avatar
Markus Mirz committed
104
105
106
107
108
	)
endif()

if(WITH_CIM AND WITH_SHMEM)
	set(CIM_SHMEM_SOURCES
109
110
111
		Shmem/Shmem_WSCC-9bus.cpp
		Shmem/Shmem_WSCC-9bus_Ctrl.cpp
		Shmem/Shmem_WSCC-9bus_CtrlDist.cpp
112
113
114
	)
endif()

115
116
117
118
119
if(WITH_PYTHON)
	list(APPEND LIBRARIES ${PYTHON_LIBRARIES})
	list(APPEND INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS})
endif()

Markus Mirz's avatar
Markus Mirz committed
120
foreach(SOURCE ${CIRCUIT_SOURCES} ${SYNCGEN_SOURCES} ${VARFREQ_SOURCES} ${SHMEM_SOURCES} ${RT_SOURCES} ${CIM_SOURCES} ${CIM_SOURCES_POSIX} ${CIM_SHMEM_SOURCES} ${DAE_SOURCES})
Steffen Vogel's avatar
Steffen Vogel committed
121
122
123
124
	get_filename_component(TARGET ${SOURCE} NAME_WE)

	add_executable(${TARGET} ${SOURCE})

125
126
	target_link_libraries(${TARGET} ${LIBRARIES})
	target_include_directories(${TARGET} PRIVATE ${INCLUDE_DIRS})
127
	target_compile_options(${TARGET} PUBLIC ${DPSIM_CXX_FLAGS})
Steffen Vogel's avatar
Steffen Vogel committed
128
endforeach()
Steffen Vogel's avatar
Steffen Vogel committed
129