diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 000000000..0411e7c40 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,50 @@ +name: cmake + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' + +env: + DEBIAN_FRONTEND: noninteractive + HOMEBREW_NO_AUTO_UPDATE: 1 + +jobs: + macos-11: + runs-on: macos-11 + steps: + - uses: actions/checkout@v3 + - name: Set up dependencies + run: | + brew install cmake fluid-synth libmagic libsndfile pkg-config + - name: configure + run: cmake -S cmake -B cmake + - name: build + run: make -C cmake -j $(sysctl -n hw.logicalcpu) + + ubuntu-20_04: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - name: Set up dependencies + run: | + sudo apt-get install -yqq cmake libfluidsynth-dev libmagic-dev libsndfile1-dev libx11-dev pkg-config + - name: configure + run: cmake -S cmake -B cmake + - name: build + run: make -C cmake -j $(nproc) + + ubuntu-22_04: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - name: Set up dependencies + run: | + sudo apt-get install -yqq cmake libfluidsynth-dev libmagic-dev libsndfile1-dev libx11-dev pkg-config + - name: configure + run: cmake -S cmake -B cmake + - name: build + run: make -C cmake -j $(nproc) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 34676f4a6..60120b764 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -16,7 +16,6 @@ set_property(GLOBAL PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) ####################################################################################################################### # required dependencies -find_package(PkgConfig) find_package(Threads REQUIRED) if(NOT (APPLE OR HAIKU OR WIN32)) @@ -30,6 +29,8 @@ endif() ####################################################################################################################### # optional dependencies +find_package(PkgConfig) + if(PKGCONFIG_FOUND) pkg_check_modules(FLUIDSYNTH IMPORTED_TARGET fluidsynth) pkg_check_modules(SNDFILE IMPORTED_TARGET sndfile) @@ -621,7 +622,7 @@ if (APPLE) ../source/backend/plugin/CarlaPluginCLAP.cpp ../source/backend/plugin/CarlaPluginVST2.cpp ../source/backend/plugin/CarlaPluginVST3.cpp - PROPERTIES COMPILE_FLAGS -ObjC++) + PROPERTIES COMPILE_FLAGS -ObjC++) endif() ####################################################################################################################### diff --git a/cmake/README.md b/cmake/README.md index 95b83dd80..f801013ef 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -1,4 +1,4 @@ -# carla cmake build setup +# Carla cmake build setup This directory contains a cmake build setup for a few Carla libraries and tools. It is not meant as a stock replacement for the regular Carla build, but simply as a way to more easily integrate Carla into other projects that already use cmake.