mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2025-02-03 09:44:26 -05:00
Merge pull request #392 from cjcliffe/vsonnier-thread_clean_termination
OSX bundled font fix-up
This commit is contained in:
commit
d7f28ef2bd
@ -491,7 +491,7 @@ IF (USE_HAMLIB)
|
||||
ENDIF()
|
||||
|
||||
|
||||
SET (CUBICSDR_RESOURCES
|
||||
SET (CUBICSDR_FONTS
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono12.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono16.fnt
|
||||
${PROJECT_SOURCE_DIR}/font/vera_sans_mono18.fnt
|
||||
@ -648,17 +648,22 @@ IF (APPLE AND BUNDLE_APP)
|
||||
MACOSX_BUNDLE
|
||||
${cubicsdr_sources}
|
||||
${cubicsdr_headers}
|
||||
${CUBICSDR_RESOURCES}
|
||||
${CUBICSDR_FONTS}
|
||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.icns
|
||||
)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${CUBICSDR_RESOURCES}
|
||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.icns
|
||||
PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION Resources
|
||||
)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(
|
||||
${CUBICSDR_FONTS}
|
||||
PROPERTIES
|
||||
MACOSX_PACKAGE_LOCATION Resources/fonts
|
||||
)
|
||||
|
||||
IF(ENABLE_FFTW3)
|
||||
target_link_libraries(CubicSDR ${FFTW_LIB})
|
||||
ENDIF()
|
||||
@ -777,7 +782,7 @@ IF(APPLE AND NOT BUNDLE_APP)
|
||||
|
||||
INSTALL(TARGETS CubicSDR DESTINATION bin)
|
||||
install(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${CUBICSDR_FONTS}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
|
||||
@ -817,7 +822,7 @@ IF (WIN32 AND NOT BUILD_INSTALLER)
|
||||
ENDIF()
|
||||
|
||||
INSTALL(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${CUBICSDR_FONTS}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
ENDIF()
|
||||
@ -849,7 +854,7 @@ IF (WIN32 AND BUILD_INSTALLER)
|
||||
install(TARGETS CubicSDR RUNTIME DESTINATION .)
|
||||
|
||||
install(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${CUBICSDR_FONTS}
|
||||
${PROJECT_SOURCE_DIR}/icon/CubicSDR.ico
|
||||
${LIQUID_DLL}
|
||||
DESTINATION .)
|
||||
@ -939,7 +944,7 @@ IF (UNIX AND NOT APPLE AND BUILD_DEB)
|
||||
|
||||
INSTALL(TARGETS CubicSDR DESTINATION bin)
|
||||
install(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${CUBICSDR_FONTS}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
|
||||
@ -964,7 +969,7 @@ IF(UNIX AND NOT APPLE AND NOT BUILD_DEB)
|
||||
|
||||
INSTALL(TARGETS CubicSDR DESTINATION bin)
|
||||
install(FILES
|
||||
${CUBICSDR_RESOURCES}
|
||||
${CUBICSDR_FONTS}
|
||||
${PROJECT_SOURCE_DIR}/src/CubicSDR.png
|
||||
DESTINATION share/cubicsdr)
|
||||
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/CubicSDR.desktop"
|
||||
|
@ -149,17 +149,17 @@ bool CubicSDR::OnInit() {
|
||||
//better (by default, was "C" locale).
|
||||
std::setlocale(LC_ALL, "");
|
||||
|
||||
#ifdef _OSX_APP_
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
|
||||
char path[PATH_MAX];
|
||||
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
|
||||
{
|
||||
// error!
|
||||
}
|
||||
CFRelease(resourcesURL);
|
||||
chdir(path);
|
||||
#endif
|
||||
//#ifdef _OSX_APP_
|
||||
// CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
// CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
|
||||
// char path[PATH_MAX];
|
||||
// if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
|
||||
// {
|
||||
// // error!
|
||||
// }
|
||||
// CFRelease(resourcesURL);
|
||||
// chdir(path);
|
||||
//#endif
|
||||
|
||||
if (!wxApp::OnInit()) {
|
||||
return false;
|
||||
|
@ -5,6 +5,10 @@
|
||||
#include <algorithm>
|
||||
#include "cubic_math.h"
|
||||
|
||||
#ifdef _OSX_APP_
|
||||
#include "CoreFoundation/CoreFoundation.h"
|
||||
#endif
|
||||
|
||||
static std::wstring getExePath(void)
|
||||
{
|
||||
//get the dir path of the executable
|
||||
@ -201,8 +205,21 @@ void GLFont::loadFontOnce() {
|
||||
return;
|
||||
}
|
||||
|
||||
#if _OSX_APP_
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
CFURLRef resourcesURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
|
||||
char path[PATH_MAX];
|
||||
if (!CFURLGetFileSystemRepresentation(resourcesURL, TRUE, (UInt8 *)path, PATH_MAX))
|
||||
{
|
||||
// error!
|
||||
}
|
||||
CFRelease(resourcesURL);
|
||||
wxString resourceFolder = std::string(path) + "/";
|
||||
|
||||
#else
|
||||
wxString resourceFolder = RES_FOLDER;
|
||||
|
||||
#endif
|
||||
|
||||
//full font file path
|
||||
wxFileName fontDefFileName = wxFileName(resourceFolder + L"/" + fontDefFileSource);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user