Skip to content

Commit 23c66f8

Browse files
committed
Allow for MediCorp / non Medic build
1 parent 58d5c26 commit 23c66f8

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ project(EDVoice)
55
set(CMAKE_CXX_STANDARD 17)
66
set(CMAKE_CXX_STANDARD_REQUIRED On)
77

8+
option(BUILD_MEDICORP "Build with MediCorp support" OFF)
9+
810
include(GNUInstallDirs)
911

1012
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})

assets/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ add_custom_target(copy_assets ALL
1313
COMMENT "Copying assets and default.json to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
1414
)
1515

16-
install(DIRECTORY ${VOICEPACK_DIR}/
16+
install(DIRECTORY ${VOICEPACK_DIR}/Aria
1717
DESTINATION config/VoicePack
1818
FILES_MATCHING PATTERN "*")
1919

20+
if(BUILD_MEDICORP)
21+
install(DIRECTORY ${VOICEPACK_DIR}/ALTA
22+
DESTINATION config/VoicePack
23+
FILES_MATCHING PATTERN "*")
24+
endif()
25+
2026
install(FILES ${DEFAULT_JSON}
2127
DESTINATION config
2228
)

plugins/voicepack/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ if(WIN32)
1010
set_target_properties(VoicePack PROPERTIES PREFIX "")
1111
endif()
1212

13+
if (BUILD_MEDICORP)
14+
target_compile_definitions(VoicePack PRIVATE BUILD_MEDICORP)
15+
message(STATUS "Building with MediCorp support")
16+
endif()
17+
1318
# plugins/
1419
set_target_properties(VoicePack PROPERTIES
1520
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}/plugins

plugins/voicepack/VoicePack.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ std::filesystem::path VoicePack::resolvePath(
421421
}
422422

423423

424+
#ifdef BUILD_MEDICORP
425+
426+
424427
// ----------------------------------------------------------------------------
425428
// Medic Compliant class implementation
426429
// ----------------------------------------------------------------------------
@@ -606,4 +609,6 @@ void Alta::onJournalEvent(const std::string& event, const std::string& journalEn
606609
else {
607610
_standardVoicePack.onJournalEvent(event, journalEntry);
608611
}
609-
}
612+
}
613+
614+
#endif // BUILD_MEDICORP

plugins/voicepack/VoicePack.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class VoicePack
8383
bool _isPriming = false;
8484
};
8585

86+
#ifdef BUILD_MEDICORP
8687

8788
class MedicCompliant
8889
{
@@ -123,6 +124,10 @@ class Alta
123124
bool _altaLoaded;
124125
};
125126

126-
127127
DECLARE_PLUGIN(Alta, "VoicePack", "0.1", "Siegfried-Origin")
128-
//DECLARE_PLUGIN(VoicePack, "VoicePack", "0.1", "Siegfried-Origin")
128+
129+
#else
130+
131+
DECLARE_PLUGIN(VoicePack, "VoicePack", "0.1", "Siegfried-Origin")
132+
133+
#endif // BUILD_MEDICORP

0 commit comments

Comments
 (0)