diff --git a/CMakeLists.txt b/CMakeLists.txt index a7897cfb0..b21df284e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,10 +145,10 @@ # zlib https://github.com/madler/zlib # UnitTest++ https://github.com/unittest-cpp/unittest-cpp # -# b) additional, for Linux & macOS platforms (but not for Android): +# b) additional, for Linux platforms (but not for Android or macOS): # fontconfig https://gitlab.freedesktop.org/fontconfig/fontconfig # -# It also uses (included as part of the surce tree): +# It also uses (included as part of the source tree): # utfcpp # agg # pugixml @@ -197,6 +197,11 @@ cmake_policy(SET CMP0042 NEW) #MACOSX_RPATH is enabled by default #Windows 10 camplains cmake_policy(SET CMP0054 NEW) # quoted arguments will not be further dereferenced +#OSX complains +if (${CMAKE_VERSION} GREATER "3.12") + cmake_policy(SET CMP0078 NEW) # evaluate generator expressions for install(CODE) and install(SCRIPT) +endif() + #prevent in-source builds # make sure the user doesn't play dirty with symlinks get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) @@ -632,7 +637,7 @@ if( LOMSE_ENABLE_PNG ) endif(LOMSE_ENABLE_PNG) # Check for fontconfig -if (UNIX) #Linux, macOS & Android +if (UNIX AND NOT APPLE) #Linux & Android - not macOS find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) find_library(FONTCONFIG_LIBRARIES NAMES fontconfig) if (("${FONTCONFIG_INCLUDE_DIR}" STREQUAL "FONTCONFIG_INCLUDE_DIR-NOTFOUND") @@ -875,12 +880,12 @@ endif(LOMSE_BUILD_EXAMPLE) if( UNIX ) # copy generated libraries - install( TARGETS ${LOMSE} DESTINATION ${LOMSE_LIBDIR} ) + install( TARGETS ${LOMSE_STATIC} DESTINATION ${LOMSE_LIBDIR} ) install( TARGETS ${LOMSE_SHARED} LIBRARY DESTINATION ${LOMSE_LIBDIR} ) #create symlink to library install( CODE - "EXECUTE_PROCESS(COMMAND ln -fs ${CMAKE_INSTALL_PREFIX}/lib/${LOMSE_SHARED} + "EXECUTE_PROCESS(COMMAND ln -fs ${CMAKE_INSTALL_PREFIX}/lib/$ ${CMAKE_INSTALL_PREFIX}/lib/liblomse.so )" ) @@ -889,7 +894,7 @@ elseif( WIN32 ) set(INSTALL_BRAVURA_FONT 1) # copy generated libraries - install( TARGETS ${LOMSE} DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) + install( TARGETS ${LOMSE_STATIC} DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) install( TARGETS ${LOMSE_SHARED} DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" ) endif() diff --git a/add-sources.cmake b/add-sources.cmake index 02afb0497..e32e6803d 100644 --- a/add-sources.cmake +++ b/add-sources.cmake @@ -2,7 +2,7 @@ # This is part of CMake configuration file for building makefiles and installfiles # for the Lomse library #------------------------------------------------------------------------------------- -# This moule is for defining the source files to compile for building the library +# This module is for defining the source files to compile for building the library # #------------------------------------------------------------------------------------- @@ -225,7 +225,7 @@ if( LOMSE_ENABLE_COMPRESSION ) endif() # platform dependent implementation files -if(UNIX) +if(UNIX AND NOT APPLE) set(PLATFORM_FILES ${LOMSE_SRC_DIR}/platform/lomse_linux.cpp ) diff --git a/examples/tutorials/tutorial-1-wx/tutorial-1-wx.cpp b/examples/tutorials/tutorial-1-wx/tutorial-1-wx.cpp index 05e479911..1d4fba13f 100644 --- a/examples/tutorials/tutorial-1-wx/tutorial-1-wx.cpp +++ b/examples/tutorials/tutorial-1-wx/tutorial-1-wx.cpp @@ -273,6 +273,11 @@ void MyFrame::initialize_lomse() //initialize the library with these values m_lomse.init_library(pixel_format,resolution, reverse_y_axis); + +#ifdef __APPLE__ + // Set fonts path manually on OSX, not using fontconfig + m_lomse.set_default_fonts_path("../../../fonts/"); +#endif } //--------------------------------------------------------------------------------------- diff --git a/examples/tutorials/tutorial-2-wx/tutorial-2-wx.cpp b/examples/tutorials/tutorial-2-wx/tutorial-2-wx.cpp index d02015e24..e58771763 100644 --- a/examples/tutorials/tutorial-2-wx/tutorial-2-wx.cpp +++ b/examples/tutorials/tutorial-2-wx/tutorial-2-wx.cpp @@ -307,6 +307,11 @@ void MyFrame::initialize_lomse() //initialize the library with these values m_lomse.init_library(pixel_format,resolution, reverse_y_axis); + +#ifdef __APPLE__ + // Set fonts path manually on OSX, not using fontconfig + m_lomse.set_default_fonts_path("../../../fonts/"); +#endif } //--------------------------------------------------------------------------------------- @@ -616,10 +621,13 @@ void MyCanvas::on_key(int x, int y, unsigned key, unsigned flags) spInteractor->switch_task(TaskFactory::k_task_selection); break; case '+': + case '=': // '+' is SHIFT = in UK & US + case WXK_NUMPAD_ADD: // support numpad + spInteractor->zoom_in(x, y); force_redraw(); break; case '-': + case WXK_NUMPAD_SUBTRACT: // support numpad - spInteractor->zoom_out(x, y); force_redraw(); break; diff --git a/examples/tutorials/tutorial-3-wx/tutorial-3-wx.cpp b/examples/tutorials/tutorial-3-wx/tutorial-3-wx.cpp index d47bb80d1..a3a949daf 100644 --- a/examples/tutorials/tutorial-3-wx/tutorial-3-wx.cpp +++ b/examples/tutorials/tutorial-3-wx/tutorial-3-wx.cpp @@ -391,6 +391,11 @@ void MyFrame::initialize_lomse() //initialize the library with these values m_lomse.init_library(pixel_format,resolution, reverse_y_axis); + +#ifdef __APPLE__ + // Set fonts path manually on OSX, not using fontconfig + m_lomse.set_default_fonts_path("../../../fonts/"); +#endif } //--------------------------------------------------------------------------------------- diff --git a/examples/tutorials/tutorial-4-wx/tutorial-4-wx.cpp b/examples/tutorials/tutorial-4-wx/tutorial-4-wx.cpp index dc5eb0191..0129a4817 100644 --- a/examples/tutorials/tutorial-4-wx/tutorial-4-wx.cpp +++ b/examples/tutorials/tutorial-4-wx/tutorial-4-wx.cpp @@ -451,6 +451,11 @@ void MyFrame::initialize_lomse() //set required callbacks m_lomse.set_notify_callback(this, wrapper_lomse_event); + +#ifdef __APPLE__ + // Set fonts path manually on OSX, not using fontconfig + m_lomse.set_default_fonts_path("../../../fonts/"); +#endif } //---------------------------------------------------------------------------------------