Skip to content

Commit

Permalink
Fix build errors for Linux/macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Mar 15, 2024
1 parent c88b13c commit bcc97e4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,10 @@ add_library(MayoIO STATIC ${MayoIO_HeaderFiles} ${MayoIO_SourceFiles})
target_include_directories(MayoIO PRIVATE ${Mayo_IncludeDirectories})
target_compile_definitions(MayoIO PRIVATE ${Mayo_CompileDefinitions})
target_compile_options(MayoIO PRIVATE ${Mayo_CompileOptions})
target_link_libraries(MayoIO PRIVATE ${MayoIO_LinkLibraries})
target_link_libraries(MayoIO PRIVATE MayoCore ${MayoIO_LinkLibraries})

add_library(MayoIOLib INTERFACE)
target_link_libraries(MayoIOLib INTERFACE MayoIO ${MayoIO_LinkLibraries})
target_include_directories(MayoIOLib INTERFACE ${Mayo_IncludeDirectories})
target_link_libraries(MayoIOLib INTERFACE MayoIO MayoCoreLib ${MayoIO_LinkLibraries})

##########
# Target: MayoApp
Expand Down Expand Up @@ -555,6 +554,8 @@ if(Mayo_BuildApp)
target_compile_definitions(mayo PRIVATE ${Mayo_CompileDefinitions})
target_compile_options(mayo PRIVATE ${Mayo_CompileOptions})
target_link_libraries(mayo PRIVATE ${MayoApp_LinkLibraries})
# Required by generated Qt UI files
target_include_directories(mayo PRIVATE ${PROJECT_SOURCE_DIR}/src/app)

set_target_properties(
mayo
Expand Down
3 changes: 2 additions & 1 deletion src/graphics/graphics_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "../base/math_utils.h"
#include "../base/tkernel_utils.h"

#include <Aspect_DisplayConnection.hxx>
#include <Bnd_Box.hxx>
#include <ElSLib.hxx>
#include <Image_PixMap.hxx>
Expand Down Expand Up @@ -206,7 +207,7 @@ int GraphicsUtils::AspectWindow_height(const Handle_Aspect_Window& wnd)
return h;
}

Handle_Aspect_DisplayConnection GraphicsUtils::AspectDisplayConnection_create()
OccHandle<Aspect_DisplayConnection> GraphicsUtils::AspectDisplayConnection_create()
{
#if (!defined(MAYO_OS_WINDOWS) && (!defined(MAYO_OS_MAC) || defined(MACOSX_USE_GLX)))
return new Aspect_DisplayConnection(std::getenv("DISPLAY"));
Expand Down
8 changes: 6 additions & 2 deletions src/graphics/graphics_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@

#pragma once

#include "../base/occ_handle.h"
#include "graphics_object_ptr.h"
#include <AIS_InteractiveContext.hxx>
#include <AIS_InteractiveObject.hxx>
#include <Aspect_DisplayConnection.hxx>
#include <Aspect_Grid.hxx>
#include <Aspect_Window.hxx>
#include <V3d_View.hxx>
#include <V3d_Viewer.hxx>
class Image_PixMap;
// Note: can't include Aspect_DisplayConnection.hxx as this is causing name conflicts
// with XLib in other files(with GraphicsObjectDriver::Support::None)
// This seems to happen only for OpenCascade <= v7.5
class Aspect_DisplayConnection;

namespace Mayo {

Expand Down Expand Up @@ -51,7 +55,7 @@ struct GraphicsUtils {

static int AspectWindow_width(const Handle_Aspect_Window& wnd);
static int AspectWindow_height(const Handle_Aspect_Window& wnd);
static Handle_Aspect_DisplayConnection AspectDisplayConnection_create();
static OccHandle<Aspect_DisplayConnection> AspectDisplayConnection_create();

static void Gfx3dClipPlane_setCappingHatch(
const Handle_Graphic3d_ClipPlane& plane, Aspect_HatchStyle hatch
Expand Down
2 changes: 0 additions & 2 deletions src/qtbackend/qt_app_translator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
** See license at https://github.com/fougue/mayo/blob/master/LICENSE.txt
****************************************************************************/

#pragma once

#include "qt_app_translator.h"

#include <QtCore/QCoreApplication>
Expand Down

0 comments on commit bcc97e4

Please sign in to comment.