diff --git a/ext/ghoul b/ext/ghoul index 5c11a98058..246f3a0417 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 5c11a98058a10078c7802006563a9d8989bd7e27 +Subproject commit 246f3a041751cf48a7321b04c80884e57cb50431 diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index ea7e9f8f68..cc16bef537 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -59,8 +59,8 @@ #include #include -// std #include +#include #include #ifdef OPENSPACE_MODULE_ONSCREENGUI_ENABLED @@ -211,15 +211,17 @@ bool OpenSpaceEngine::create( _engine = new OpenSpaceEngine(std::string(argv[0]), windowWrapper); // Query modules for commandline arguments - const bool gatherSuccess = _engine->gatherCommandlineArguments(); + bool gatherSuccess = _engine->gatherCommandlineArguments(); if (!gatherSuccess) return false; // Parse commandline arguments - _engine->_commandlineParser->setCommandLine(argc, argv, &sgctArguments); - const bool executeSuccess = _engine->_commandlineParser->execute(); - if (!executeSuccess) - return false; + sgctArguments = *(_engine->_commandlineParser->setCommandLine(argc, argv)); + bool showHelp = _engine->_commandlineParser->execute(); + if (showHelp) { + _engine->_commandlineParser->displayHelp(); + return false; + } // Find configuration std::string configurationFilePath = commandlineArgumentPlaceholders.configurationName; @@ -428,26 +430,25 @@ void OpenSpaceEngine::clearAllWindows() { bool OpenSpaceEngine::gatherCommandlineArguments() { // TODO: Get commandline arguments from all modules - + commandlineArgumentPlaceholders.configurationName = ""; - CommandlineCommand* configurationFileCommand = new SingleCommand( - &commandlineArgumentPlaceholders.configurationName, "-config", "-c", - "Provides the path to the OpenSpace configuration file"); - _commandlineParser->addCommand(configurationFileCommand); + _commandlineParser->addCommand(std::make_unique>( + &commandlineArgumentPlaceholders.configurationName, "-config", "-c", + "Provides the path to the OpenSpace configuration file" + )); commandlineArgumentPlaceholders.sgctConfigurationName = ""; - CommandlineCommand* sgctConfigFileCommand = new SingleCommand( - &commandlineArgumentPlaceholders.sgctConfigurationName, "-sgct", "-s", - "Provides the path to the SGCT configuration file, overriding the value set in" - "the OpenSpace configuration file"); - _commandlineParser->addCommand(sgctConfigFileCommand); + _commandlineParser->addCommand(std::make_unique>( + &commandlineArgumentPlaceholders.sgctConfigurationName, "-sgct", "-s", + "Provides the path to the SGCT configuration file, overriding the value set in " + "the OpenSpace configuration file" + )); commandlineArgumentPlaceholders.sceneName = ""; - CommandlineCommand* sceneFileCommand = new SingleCommand( - &commandlineArgumentPlaceholders.sceneName, "-scene", "", - "Provides the path to the scene file, overriding the value set in the OpenSpace" - " configuration file"); - _commandlineParser->addCommand(sceneFileCommand); + _commandlineParser->addCommand(std::make_unique>( + &commandlineArgumentPlaceholders.sceneName, "-scene", "", "Provides the path to " + "the scene file, overriding the value set in the OpenSpace configuration file" + )); return true; } diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index dff35e5e66..59e62b45bc 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -76,7 +76,7 @@ endfunction () function (set_compile_settings project) - set_property(TARGET ${project} PROPERTY CXX_STANDARD 11) + set_property(TARGET ${project} PROPERTY CXX_STANDARD 14) set_property(TARGET ${project} PROPERTY CXX_STANDARD_REQUIRED On) if (MSVC)