Skip to content
Snippets Groups Projects
Commit 4d4cad8b authored by Mathias Paulin's avatar Mathias Paulin :speech_balloon:
Browse files

Make H3D support as a build option

parent 3fcd650b
Branches
No related tags found
No related merge requests found
...@@ -24,6 +24,8 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) ...@@ -24,6 +24,8 @@ if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT False) set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT False)
endif () endif ()
option(WITH_H3D_SUPPORT "Compile with H3D loader support" OFF)
add_subdirectory(src) add_subdirectory(src)
# Add documentation directory # Add documentation directory
......
add_subdirectory(libRender) add_subdirectory(libRender)
add_subdirectory(libH3D) if (WITH_H3D_SUPPORT)
add_subdirectory(libH3D)
endif (WITH_H3D_SUPPORT)
add_subdirectory(Plugin) add_subdirectory(Plugin)
set(MARA_IN_BUILD_TREE True) set(MARA_IN_BUILD_TREE True)
add_subdirectory(Mara EXCLUDE_FROM_ALL) add_subdirectory(Mara EXCLUDE_FROM_ALL)
...@@ -28,6 +28,7 @@ set(CMAKE_CXX_STANDARD 17) ...@@ -28,6 +28,7 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(SHOWTREEVIEW "Compile with scene tree view widget" ON) option(SHOWTREEVIEW "Compile with scene tree view widget" ON)
option(WITH_H3D_SUPPORT "Compile with H3D loader support" OFF)
# /////////////////////////////// # ///////////////////////////////
find_package(Qt5 COMPONENTS Core Widgets REQUIRED) find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
...@@ -90,18 +91,28 @@ else () ...@@ -90,18 +91,28 @@ else ()
message(STATUS " *** ${PROJECT_NAME} *** Building application from the installed library") message(STATUS " *** ${PROJECT_NAME} *** Building application from the installed library")
# If the application is built as standalone, uses libGLTF from its installed tree # If the application is built as standalone, uses libGLTF from its installed tree
find_package(RadiumNBR REQUIRED) find_package(RadiumNBR REQUIRED)
find_package(RadiumH3D REQUIRED) if (WITH_H3D_SUPPORT)
find_package(RadiumH3D REQUIRED)
endif (WITH_H3D_SUPPORT)
endif () endif ()
target_link_libraries(${PROJECT_NAME} target_link_libraries(${PROJECT_NAME}
PUBLIC PUBLIC
Radium::Core Radium::Engine Radium::GuiBase Radium::IO Radium::Core Radium::Engine Radium::GuiBase Radium::IO
RadiumH3D::H3D
RadiumNBR::NBR RadiumNBR::NBR
RadiumNBR::NBRGui RadiumNBR::NBRGui
${Qt5_LIBRARIES} ${Qt5_LIBRARIES}
) )
if (WITH_H3D_SUPPORT)
message(STATUS " *** ${PROJECT_NAME} *** Compiling with treeview ...")
target_compile_definitions(${PROJECT_NAME} PRIVATE WITH_H3D_SUPPORT)
target_link_libraries(${PROJECT_NAME}
PUBLIC
RadiumH3D::H3D
)
endif (WITH_H3D_SUPPORT)
configure_radium_app( configure_radium_app(
NAME ${PROJECT_NAME} NAME ${PROJECT_NAME}
USE_PLUGINS USE_PLUGINS
......
...@@ -17,7 +17,9 @@ using namespace Ra::Core::Utils; // for LOG( logLEVEL ) ...@@ -17,7 +17,9 @@ using namespace Ra::Core::Utils; // for LOG( logLEVEL )
#include <RadiumNBR/Gui/NodeBasedRendererGui.hpp> #include <RadiumNBR/Gui/NodeBasedRendererGui.hpp>
#include <RadiumNBR/NodeBasedRenderer.hpp> #include <RadiumNBR/NodeBasedRenderer.hpp>
#ifdef WITH_H3D_SUPPORT
#include <RadiumH3D/h3DLoader.hpp> #include <RadiumH3D/h3DLoader.hpp>
#endif
namespace Mara { namespace Mara {
...@@ -52,9 +54,10 @@ RadiumPlayer::RadiumPlayer( int& argc, char** argv ) : ...@@ -52,9 +54,10 @@ RadiumPlayer::RadiumPlayer( int& argc, char** argv ) :
LOG( logINFO ) << "*** My Awesome Rendering Application (MARA) ***"; LOG( logINFO ) << "*** My Awesome Rendering Application (MARA) ***";
parseCommandLine(); parseCommandLine();
addConnections(); addConnections();
#ifdef WITH_H3D_SUPPORT
m_engine->registerFileLoader( m_engine->registerFileLoader(
std::shared_ptr<Ra::Core::Asset::FileLoaderInterface>( new H3D::H3DLoader ) ); std::shared_ptr<Ra::Core::Asset::FileLoaderInterface>( new H3D::H3DLoader ) );
#endif
m_engine->registerFileLoader( m_engine->registerFileLoader(
std::shared_ptr<Ra::Core::Asset::FileLoaderInterface>( new VolumeLoader ) ); std::shared_ptr<Ra::Core::Asset::FileLoaderInterface>( new VolumeLoader ) );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment