diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index ca1a201..88c7a2f 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -4,6 +4,8 @@ name: CMake on multiple platforms on: push: + branches: + - main pull_request: jobs: @@ -21,29 +23,47 @@ jobs: # # To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list. matrix: - os: [ubuntu-latest, windows-latest] + os: [macos-latest] #, ubuntu-latest, windows-latest] build_type: [Release] - c_compiler: [gcc, clang, cl] + c_compiler: [cc] #, clang, gcc, cl] include: - - os: windows-latest - c_compiler: cl - cpp_compiler: cl - - os: ubuntu-latest - c_compiler: gcc - cpp_compiler: g++ - - os: ubuntu-latest - c_compiler: clang - cpp_compiler: clang++ - exclude: - - os: windows-latest - c_compiler: gcc - - os: windows-latest - c_compiler: clang - - os: ubuntu-latest - c_compiler: cl + - os: macos-latest + c_compiler: cc + cpp_compiler: c++ + # - os: windows-latest + # c_compiler: cl + # cpp_compiler: cl + # - os: ubuntu-latest + # c_compiler: gcc + # cpp_compiler: g++ + # - os: ubuntu-latest + # c_compiler: clang + # cpp_compiler: clang++ + # exclude: + # - os: windows-latest + # c_compiler: gcc + # - os: windows-latest + # c_compiler: clang + # - os: ubuntu-latest + # c_compiler: cl steps: - - uses: actions/checkout@v4 + - name: Checkout + id: checkout + uses: actions/checkout@v4 + with: + submodules: 'recursive' + + - name: Install Homebrew (macOS only) + id: install-homebrew + if: contains(matrix.os,'macos') + run: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + - name: Install dependencies (macOS only) + id: install-dependencies + if: contains(matrix.os,'macos') + run: | + brew install boost libmapper - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. @@ -55,6 +75,7 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + id: configure run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} @@ -65,10 +86,27 @@ jobs: - name: Build # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). - run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} + id: build + run: > + cmake --build ${{ steps.strings.outputs.build-output-dir }} + --config ${{ matrix.build_type }} + --target install - name: Test + id: test working-directory: ${{ steps.strings.outputs.build-output-dir }} # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail run: ctest --build-config ${{ matrix.build_type }} + + - name: Shorten SHA + id: shorten-sha + run: | + echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV + + - name: Upload artifact + id: upload-artifact + uses: actions/upload-artifact@v7 + with: + name: MapperUGen-${{ env.SHA_SHORT }}-${{matrix.os}}-${{matrix.build_type}}-${{matrix.c_compiler}} + path: build/MapperUGen/ diff --git a/.gitmodules b/.gitmodules index 624f5b2..0e8fe03 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "supercollider"] path = supercollider - url = https://github.com/supercollider/supercollider.git + url = https://github.com/supercollider/supercollider/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 8559780..a993e4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ set(FILENAME "Mapper.cpp") #specify the .cpp file here -cmake_minimum_required (VERSION 2.8) +cmake_minimum_required (VERSION 4.3) get_filename_component(PROJECT ${FILENAME} NAME_WE) #automatically sets project name from the filename # set(PROJECT "my_name") #alternatively set project name manually message(STATUS "Project name is ${PROJECT}") @@ -123,6 +123,16 @@ if(MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstackrealign") endif() +if(APPLE) + if(DEFINED ENV{HOMEBREW_PREFIX}) + message(STATUS "Homebrew detected with prefix " $ENV{HOMEBREW_PREFIX}) + include_directories(SYSTEM $ENV{HOMEBREW_PREFIX}/include) + link_directories(SYSTEM $ENV{HOMEBREW_PREFIX}/lib) + else() + message(STATUS "Homebrew not detected") + endif() +endif() + add_library(${PROJECT} MODULE ${FILENAME}) target_link_libraries(${PROJECT} ${MAPPER_LIB} ${Boost_libraries}) diff --git a/README.md b/README.md index 009d5d9..22c312f 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,32 @@ # MapperUGen + A SuperCollider UGen for using libmapper -## Installation +## Prerequisites + +### Install libmapper + +Please follow the [libmapper](https://github.com/libmapper/libmapper) documentation, unless your configuration is covered by specific cases below: + +#### macOS with homebrew + +- Install [Homebrew](https://brew.sh/) +- Install dependencies + ``` + brew install boost libmapper + ``` + +## Installation from releases + * Install [SuperCollider](https://supercollider.github.io/) -* Build and install [libmapper](https://github.com/libmapper/libmapper) -* Unzip MapperUGen.zip from [releases](https://github.com/mathiasbredholt/MapperUGen/releases) into SuperCollider extensions folder (Platform.userExtensionDir) +* Unzip MapperUGen.zip from [releases](https://github.com/IDMIL/MapperUGen/releases) into SuperCollider extensions folder (Platform.userExtensionDir) + +## Compilation from source -## Compile from source -* Build and install [libmapper](https://github.com/libmapper/libmapper) -### GNU/Linux -``` -git clone https://github.com/mathiasbredholt/MapperUGen.git -cd MapperUGen -mkdir build && cd build -cmake -DSUPERNOVA=ON .. -cmake --build . --target install -``` -### macOS/Windows ``` -git clone --recursive https://github.com/mathiasbredholt/MapperUGen.git +git clone --recursive https://github.com/IDMIL/MapperUGen.git cd MapperUGen -mkdir build && cd build -cmake -DSUPERNOVA=ON .. -cmake --build . --target install +mkdir -p build +cmake -B ./build -DSUPERNOVA=ON +cmake --build build --target install ``` diff --git a/supercollider b/supercollider index 95f7814..426edf6 160000 --- a/supercollider +++ b/supercollider @@ -1 +1 @@ -Subproject commit 95f78142b5a2a56ef642be9be499de29ebb0ce61 +Subproject commit 426edf6d8742e1cc3bd85b51ca0c4e595d37a903