Closed gogins closed 2 months ago
# Ensure ExternalProject is available
include(ExternalProject)
# Define where to clone the csound-wasm repository
set(CSOUND_WASM_SOURCE_DIR ${CMAKE_BINARY_DIR}/csound-wasm-src)
# ExternalProject configuration for csound-wasm
ExternalProject_Add(csound-wasm
PREFIX ${CMAKE_BINARY_DIR}/csound-wasm
GIT_REPOSITORY https://github.com/csound/csound-wasm.git
GIT_TAG main # or specify a specific tag or branch
SOURCE_DIR ${CSOUND_WASM_SOURCE_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
BUILD_ALWAYS ON # Optionally always rebuild
)
# Specify dependency relationships if needed
add_dependencies(your_target csound-wasm)
# Include the install directory
include_directories(<INSTALL_DIR>/include)
link_directories(<INSTALL_DIR>/lib)
# Link the csound-wasm libraries to your project target
target_link_libraries(your_target csound-wasm-lib)
This is actually working, but there are obvious problems. I need to separate the build directory from the source directory in order to get dependency checking to work.
I an closing this as the objectives have changed somewhat. Will open a new issue to address both consolidation and porting to Csound version 7,
Bring into this project, most likely as ExternalTargets: