Skip to content

Commit

Permalink
some updates for the osc client build process
Browse files Browse the repository at this point in the history
  • Loading branch information
himwho committed Oct 1, 2024
1 parent e0585eb commit ce8569f
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 145 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ env:
BUILD_TYPE: Release
OM_BUNDLE_ID: com.mach1.spatial.orientationmanager
OC_BUNDLE_ID: com.mach1.orientation.osc
JUCE_VERSION: 7.0.5
JUCE_VERSION: 7.1.2
CMAKE_VERSION: 3.21.x
VERSION: 0.9.0
VERSION: 0.9.1

jobs:
build:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
with:
repository: juce-framework/JUCE
path: JUCE
ref: 7.0.5
ref: 7.1.2

- name: OM Configure (macos)
if: runner.os == 'MacOS'
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ m1stereospatialize/m1-stereospatialize/Builds/*
*/Builds/
*/Builds/*
*/config.make
*/Makefile
!Makefile
*.xcconfig
*.plist
*/*.app/*
Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ option(JUCE_ENABLE_MODULE_SOURCE_GROUPS "Show all module sources in IDE projects
#static linking in Windows
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

# Adds the Mach1 math
# (Please ensure this is added before the `m1_orientation_client` JUCE module)
add_subdirectory(Modules/m1_orientation_client/libs/m1-mathematics)

# add JUCE and other custom modules
add_subdirectory(JUCE)
add_subdirectory(Modules)
Expand Down
2 changes: 1 addition & 1 deletion JUCE
Submodule JUCE updated 1643 files
63 changes: 63 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#! /bin/bash

# MACH1 ORIENTATION MANAGER Makefile

# getting OS type
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell uname)
endif

setup:

clean:
ifeq ($(detected_OS),Windows)
@if exist m1-orientationmanager\\build (rmdir /s /q m1-orientationmanager\\build)
@if exist m1-orientationmanager\\osc_client\\build (rmdir /s /q m1-orientationmanager\\osc_client\\build)
else
rm -rf m1-orientationmanager/build
rm -rf m1-orientationmanager/osc_client/build
endif

clean-dev:
ifeq ($(detected_OS),Windows)
@if exist m1-orientationmanager\\build-dev (rmdir /s /q m1-orientationmanager\\build-dev)
@if exist m1-orientationmanager\\osc_client\\build-dev (rmdir /s /q m1-orientationmanager\\osc_client\\build-dev)
else
rm -rf m1-orientationmanager/build-dev
rm -rf m1-orientationmanager/osc_client/build-dev
endif

clean-installs:
ifeq ($(detected_OS),Darwin)
sudo rm -rf /Library/LaunchAgents/com.mach1.spatial.orientationmanager.plist
sudo rm -rf /Library/Application Support/Mach1/m1-orientationmanager
endif

# configure for debug and setup dev envs with common IDEs
dev: clean-dev
ifeq ($(detected_OS),Darwin)
cmake . -Bbuild-dev -G "Xcode" -DENABLE_DEBUG_EMULATOR_DEVICE=ON -DCMAKE_INSTALL_PREFIX="/Library/Application Support/Mach1"
cmake osc_client -Bosc_client/build-dev -G "Xcode"
else ifeq ($(detected_OS),Windows)
cmake . -Bbuild-dev -DENABLE_DEBUG_EMULATOR_DEVICE=ON -DCMAKE_INSTALL_PREFIX="\Documents and Settings\All Users\Application Data\Mach1"
cmake osc_client -Bosc_client/build-dev
else
cmake . -Bbuild-dev -DENABLE_DEBUG_EMULATOR_DEVICE=ON -DCMAKE_INSTALL_PREFIX="/opt/Mach1"
cmake osc_client -Bosc_client/build-dev
endif

# clean and configure for release
configure: clean
ifeq ($(detected_OS),Darwin)
cmake . -Bbuild -G "Xcode" -DM1_ORIENTATION_MANAGER_EMBEDDED=1
cmake osc_client -Bosc_client/build -G "Xcode" -DM1_ORIENTATION_MANAGER_EMBEDDED=1
else
cmake . -Bbuild -DM1_ORIENTATION_MANAGER_EMBEDDED=1
cmake osc_client -Bosc_client/build -DM1_ORIENTATION_MANAGER_EMBEDDED=1
endif

build:
cmake --build build --config "Release"
cmake --build osc_client/build --config "Release"
4 changes: 4 additions & 0 deletions Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Adds the Mach1 math
# (Please ensure this is added before the `m1_orientation_client` JUCE module)
add_subdirectory(m1_orientation_client/libs/m1-mathematics)

juce_add_modules(
juce_murka
m1_orientation_client)
2 changes: 1 addition & 1 deletion Modules/m1_orientation_client
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ External orientation device manager and utilities geared toward aggregating diff

## Setup

It is recommended to build via CMake, there is an included `Makefile` that can be used to run the following commands:
- `make configure && make build`
or
- `make dev` and then open the configured IDE project files

### Build via CMake
- `cmake -Bbuild` Create project files by adding the appropriate `-G Xcode` or `-G "Visual Studio 16 2019"` to the end of this line
- `cmake --build build -DENABLE_DEBUG_EMULATOR_DEVICE=ON`
Expand Down
21 changes: 11 additions & 10 deletions osc_client/Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
#endif

#include <JuceHeader.h>
#include "MainComponent.h"

juce::Component* createMainContentComponent();

//==============================================================================
class M1OrientationDeviceClientTestApplication : public juce::JUCEApplication
Expand All @@ -28,12 +29,12 @@ class M1OrientationDeviceClientTestApplication : public juce::JUCEApplication
//==============================================================================
void initialise (const juce::String& commandLine) override
{
mainWindow.reset (new MainWindow (getApplicationName()));
juce::ignoreUnused (commandLine);
mainWindow = std::make_unique<MainWindow> (getApplicationName());
}

void shutdown() override
{
mainWindow = nullptr; // (deletes our window)
}

//==============================================================================
Expand All @@ -44,9 +45,7 @@ class M1OrientationDeviceClientTestApplication : public juce::JUCEApplication

void anotherInstanceStarted (const juce::String& commandLine) override
{
// When another instance of the app is launched while this one is running,
// this method is invoked, and the commandLine parameter tells you what
// the other instance's command-line arguments were.
juce::ignoreUnused (commandLine);
}

//==============================================================================
Expand All @@ -56,15 +55,19 @@ class M1OrientationDeviceClientTestApplication : public juce::JUCEApplication
*/
class MainWindow : public juce::DocumentWindow
{
juce::Component* component;

public:
MainWindow (juce::String name)
: DocumentWindow (name,
juce::Desktop::getInstance().getDefaultLookAndFeel()
.findColour (juce::ResizableWindow::backgroundColourId),
DocumentWindow::allButtons)
{
component = createMainContentComponent();

setUsingNativeTitleBar (true);
setContentOwned (new MainComponent(), true);
setContentOwned (component, true);

#if JUCE_IOS || JUCE_ANDROID
setFullScreen (true);
Expand All @@ -78,9 +81,7 @@ class M1OrientationDeviceClientTestApplication : public juce::JUCEApplication

void closeButtonPressed() override
{
// This is called when the user tries to close this window. Here, we'll just
// ask the app to quit when this happens, but you can change this to do
// whatever you need.
((juce::OpenGLAppComponent*)component)->shutdown();
JUCEApplication::getInstance()->systemRequestedQuit();
}

Expand Down
Loading

0 comments on commit ce8569f

Please sign in to comment.