From 17d335c45569f28811f0fa1ad73cbf087cd5f817 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 24 Nov 2021 17:43:03 +0100 Subject: [PATCH] make it work on macos and some small fixes --- examples/.gitignore | 1 + examples/CMakeLists.txt | 3 +++ examples/text/main.cpp | 7 +++---- examples/watch-simple/CMakeLists.txt | 22 ---------------------- 4 files changed, 7 insertions(+), 26 deletions(-) delete mode 100644 examples/watch-simple/CMakeLists.txt diff --git a/examples/.gitignore b/examples/.gitignore index 3a95fcafb..71fe3de1d 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -2,3 +2,4 @@ max/ .* !/.gitignore +build/ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index e478ce6db..e2aa2ae5a 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -14,6 +14,9 @@ add_compile_definitions(FAKE_ARDUINO) file(GLOB OSWLIB_SRC_FILES ../*.cpp) add_library(oswLibrary STATIC ${OSWLIB_SRC_FILES}) include_directories(oswLibrary ${SDL2_INCLUDE_DIRS} ${SDL2IMAGE_INCLUDE_DIRS}) +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + link_directories(/usr/local/lib) +endif() target_link_libraries(oswLibrary PRIVATE ${SDL2_LIBRARY} ${SDL2IMAGE_LIBRARIES}) # examples diff --git a/examples/text/main.cpp b/examples/text/main.cpp index 0c888a541..aa4fab87e 100644 --- a/examples/text/main.cpp +++ b/examples/text/main.cpp @@ -3,7 +3,6 @@ #include "../../FakeArduino.h" #include "../../FakeArduinoWindowSDL.h" -#include "../../SDL2/SDL.h" #include "../../anim_water_ripple.h" #include "../../gfx_2d_print.h" #include "../../gfx_util.h" @@ -76,7 +75,7 @@ class RotationExampleWindow : public SDLWindowRGB565 { gfx->setTextSize(1); gfx->print("Font Serif Bold 9px"); gfx->clearFont(); - + /* gfx->fill(rgb565(0, 0, 0)); @@ -86,12 +85,12 @@ class RotationExampleWindow : public SDLWindowRGB565 { gfx->setTextSize(1); for(i=0; i<11; i++){ for(j=0;j<17;j++){ - gfx->setTextCursor(j*15+10,i*15+10); + gfx->setTextCursor(j*15+10,i*15+10); gfx->print(char(i*10+j+160)); } } */ - + } }; diff --git a/examples/watch-simple/CMakeLists.txt b/examples/watch-simple/CMakeLists.txt deleted file mode 100644 index 84160efe2..000000000 --- a/examples/watch-simple/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.10) - -# set the project name -set(CMAKE_CXX_STANDARD 11) -project(Example) -find_package(SDL2 CONFIG REQUIRED) -find_package(sdl2-image CONFIG REQUIRED) - -add_compile_definitions(FAKE_ARDUINO) - -file(GLOB SRC_FILES ../../*.cpp) - -add_library(oswLibrary STATIC - ${SRC_FILES} - ) -target_link_libraries(oswLibrary PRIVATE SDL2::SDL2main SDL2::SDL2-static SDL2::SDL2_image) - -# add the executable -add_executable(Example main.cpp) - -target_link_libraries(Example PRIVATE SDL2::SDL2main SDL2::SDL2-static SDL2::SDL2_image oswLibrary) -