7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 11:21:41 +00:00

Gerbview: Add build option do enable/disable the 3Dconnexion support.

On msys2 a link issue (3 undefined symbols) prevent Gerbview to be built.
So I added this option (KICAD_ENABLE_3DMOUSE_GERBVIEW, enabled by default)
to disable 3Dconnexion support on request.
This commit is contained in:
jean-pierre charras 2024-09-21 13:24:43 +02:00
parent 2068ed31a4
commit 336532303e
4 changed files with 22 additions and 10 deletions

View File

@ -86,6 +86,10 @@ endif()
####################################
# Feature flags
####################################
option( KICAD_ENABLE_3DMOUSE_GERBVIEW
"Build the 3D mouse connexion support in Gerbview. does not work yet on MSYS2 (link issue)"
ON )
option( KICAD_SPICE_QA
"Build software Quality assurance unit tests for spice (default ON)"
ON )
@ -306,6 +310,10 @@ if( KICAD_IPC_API )
add_definitions( -DKICAD_IPC_API )
endif()
if( KICAD_ENABLE_3DMOUSE_GERBVIEW )
add_definitions( -DKICAD_ENABLE_3DMOUSE_GERBVIEW )
endif()
# Ensure DEBUG is defined for all platforms in Debug builds
add_compile_definitions( $<$<CONFIG:Debug>:DEBUG> )

View File

@ -136,12 +136,12 @@ target_link_libraries( gerbview_kiface_objects
core
)
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in gerbview" )
add_subdirectory( navlib )
target_link_libraries( gerbview_kiface_objects PUBLIC gerbview_navlib)
add_dependencies( gerbview_kiface_objects gerbview_navlib )
if( KICAD_ENABLE_3DMOUSE_GERBVIEW )
message( STATUS "Including 3Dconnexion SpaceMouse navigation support in gerbview" )
add_subdirectory( navlib )
target_link_libraries( gerbview_kiface_objects PUBLIC gerbview_navlib)
add_dependencies( gerbview_kiface_objects gerbview_navlib )
endif()
# the main gerbview program, in DSO form.
add_library( gerbview_kiface MODULE )

View File

@ -1072,7 +1072,7 @@ void GERBVIEW_FRAME::ActivateGalCanvas()
ReCreateOptToolbar();
ReCreateMenuBar();
#ifdef KICAD_ENABLE_3DMOUSE_GERBVIEW
try
{
if( !m_spaceMouse )
@ -1084,6 +1084,7 @@ void GERBVIEW_FRAME::ActivateGalCanvas()
{
wxLogTrace( wxT( "KI_TRACE_NAVLIB" ), e.what() );
}
#endif
}
@ -1255,15 +1256,17 @@ void GERBVIEW_FRAME::ToggleLayerManager()
void GERBVIEW_FRAME::handleActivateEvent( wxActivateEvent& aEvent )
{
EDA_DRAW_FRAME::handleActivateEvent(aEvent);
#ifdef KICAD_ENABLE_3DMOUSE_GERBVIEW
if( m_spaceMouse )
m_spaceMouse->SetFocus( aEvent.GetActive() );
#endif
}
void GERBVIEW_FRAME::handleIconizeEvent( wxIconizeEvent& aEvent )
{
EDA_DRAW_FRAME::handleIconizeEvent(aEvent);
#ifdef KICAD_ENABLE_3DMOUSE_GERBVIEW
if( m_spaceMouse )
m_spaceMouse->SetFocus( false );
#endif
}

View File

@ -531,8 +531,9 @@ private:
// relative to the m_SelAperAttributesBox
wxStaticText* m_dcodeText; // a message on the auxiliary toolbar,
// relative to the m_DCodeSelector
#ifdef KICAD_ENABLE_3DMOUSE_GERBVIEW
std::unique_ptr<NL_GERBVIEW_PLUGIN> m_spaceMouse;
#endif
};
#endif /* WX_GERBER_STRUCT_H */