diff --git a/CMakeLists.txt b/CMakeLists.txt index 799173f1f9e0a0463b20927f6e4a925f1c65fd2e..517fed7b7a7c33c0e92f8d719fb272954c84119d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,6 @@ IF(WIN32) ENDIF(WIN32) find_package(OpenGL REQUIRED) -find_package(Boost COMPONENTS regex REQUIRED) find_package(ZLIB REQUIRED) find_package(GLEW REQUIRED) @@ -130,7 +129,6 @@ SET (CGoGN_EXT_INCLUDES ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} - ${Boost_INCLUDE_DIRS} ) # define libs for external libs @@ -139,7 +137,6 @@ SET (CGoGN_EXT_LIBS ${OPENGL_LIBRARY} ${GLEW_LIBRARIES} ${ZLIB_LIBRARIES} - ${Boost_REGEX_LIBRARY} tinyxml2 ) diff --git a/include/Utils/shaderMutator.h b/include/Utils/shaderMutator.h index e2a9f9e813ef7e1fdceb90712a32bb05f9fbaccf..9e359a06f4ca02912c2cc7a128b7f4db705f49a1 100644 --- a/include/Utils/shaderMutator.h +++ b/include/Utils/shaderMutator.h @@ -29,7 +29,6 @@ #undef toupper #include "Utils/cgognStream.h" -#include #include #include diff --git a/src/Utils/shaderMutator.cpp b/src/Utils/shaderMutator.cpp index 8e19c4ded4fb7ea81d94fd46ed4788a7cc63eb99..54c8a46d7b674575b063677643d5a0ca5b7b54e3 100644 --- a/src/Utils/shaderMutator.cpp +++ b/src/Utils/shaderMutator.cpp @@ -23,6 +23,7 @@ *******************************************************************************/ #include "Utils/shaderMutator.h" +#include namespace CGoGN { @@ -451,15 +452,15 @@ bool ShaderMutator::srcContainsVariableDeclaration(const std::string& variableNa { // Regular expression for variable declaration // <',' OR white-space[1 or more times]> <',' OR ';' OR white-space> - boost::regex var_re("(,|\\s+)" + variableName + "(,|;|\\s)"); + std::regex var_re("(,|\\s+)" + variableName + "(,|;|\\s)"); // Matches results - boost::match_results matches; + std::match_results matches; // Search for the first expression that matches and isn't commented std::string::iterator start = src.begin(); std::string::iterator end = src.end(); - while (regex_search(start, end, matches, var_re, boost::format_first_only)) + while (std::regex_search(start, end, matches, var_re, std::regex_constants::format_first_only)) { // Start position of the match size_t startPosition = std::distance(src.begin(), matches[0].first); @@ -480,10 +481,10 @@ bool ShaderMutator::srcSetMinShadingLanguageVersion(int version, std::string& mo { // Regular expression for shading language version // <#version> [1 or more times] [1 or more times] - boost::regex version_re("#version\\s+(\\d+)"); + std::regex version_re("#version\\s+(\\d+)"); // Matches results - boost::match_results matches; + std::match_results matches; // Build the version string std::string versionStr; @@ -494,7 +495,7 @@ bool ShaderMutator::srcSetMinShadingLanguageVersion(int version, std::string& mo // Search for the first expression that matches and isn't commented std::string::iterator start = modifiedSrc.begin(); std::string::iterator end = modifiedSrc.end(); - while (regex_search(start, end, matches, version_re, boost::format_first_only)) + while (std::regex_search(start, end, matches, version_re, std::regex_constants::format_first_only)) { // Start position of the match size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first); @@ -535,10 +536,10 @@ bool ShaderMutator::srcChangeIntConstantValue(int newVal, const std::string& con { // Regular expression for constant expression // <#define> [1 or more times] [1 or more times] [1 or more times] - boost::regex const_re("#define\\s+" + constantName + "\\s+(\\d+)"); + std::regex const_re("#define\\s+" + constantName + "\\s+(\\d+)"); // Matches results - boost::match_results matches; + std::match_results matches; // Build the constant value string std::string newValStr; @@ -549,7 +550,7 @@ bool ShaderMutator::srcChangeIntConstantValue(int newVal, const std::string& con // Search for the first expression that matches and isn't commented std::string::iterator start = modifiedSrc.begin(); std::string::iterator end = modifiedSrc.end(); - while (regex_search(start, end, matches, const_re, boost::format_first_only)) + while (std::regex_search(start, end, matches, const_re, std::regex_constants::format_first_only)) { // Start position of the match size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first); @@ -582,10 +583,10 @@ bool ShaderMutator::srcChangeFloatConstantValue(float newVal, const std::string& // Regular expression for constant expression // <#define> [1 or more times] [1 or more times] // [1 or more times] <.>[0 or 1 time] [0 or more times] - boost::regex const_re("#define\\s+" + constantName + "\\s+(\\d+\\.?\\d*)"); + std::regex const_re("#define\\s+" + constantName + "\\s+(\\d+\\.?\\d*)"); // Matches results - boost::match_results matches; + std::match_results matches; // Build the constant value string std::string newValStr; @@ -596,7 +597,7 @@ bool ShaderMutator::srcChangeFloatConstantValue(float newVal, const std::string& // Search for the first expression that matches and isn't commented std::string::iterator start = modifiedSrc.begin(); std::string::iterator end = modifiedSrc.end(); - while (regex_search(start, end, matches, const_re, boost::format_first_only)) + while (std::regex_search(start, end, matches, const_re, std::regex_constants::format_first_only)) { // Start position of the match size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first); @@ -628,15 +629,15 @@ bool ShaderMutator::srcInsertCodeBeforeMainFunction(const std::string& insertedC { // Regular expression for main function // [1 or more times]
[0 or more times] <'('> - boost::regex main_re("(void)\\s+(main)\\s*\\("); + std::regex main_re("(void)\\s+(main)\\s*\\("); // Matches results - boost::match_results matches; + std::match_results matches; // Search for the first expression that matches and isn't commented std::string::iterator start = modifiedSrc.begin(); std::string::iterator end = modifiedSrc.end(); - while (regex_search(start, end, matches, main_re, boost::format_first_only)) + while (std::regex_search(start, end, matches, main_re, std::regex_constants::format_first_only)) { // Start position of the match size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first); @@ -664,15 +665,15 @@ bool ShaderMutator::srcInsertCodeAtMainFunctionBeginning(const std::string& inse // [1 or more times]
[0 or more times] // <'('> [0 or more times] <')'> // [0 or more times] <'{'> - boost::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{"); + std::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{"); // Matches results - boost::match_results matches; + std::match_results matches; // Search for the first expression that matches and isn't commented std::string::iterator start = modifiedSrc.begin(); std::string::iterator end = modifiedSrc.end(); - while (regex_search(start, end, matches, main_re, boost::format_first_only)) + while (std::regex_search(start, end, matches, main_re, std::regex_constants::format_first_only)) { // Start position of the match size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first); @@ -703,16 +704,16 @@ bool ShaderMutator::srcInsertCodeAtMainFunctionEnd(const std::string& insertedCo // [1 or more times]
[0 or more times] // <'('> [0 or more times] <')'> // [0 or more times] <'{'> - boost::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{"); + std::regex main_re("(void)\\s+(main)\\s*\\(\\s*\\)\\s*\\{"); // Matches results - boost::match_results matches; + std::match_results matches; // Search for the first expression that matches and isn't commented std::string::iterator start = modifiedSrc.begin(); std::string::iterator end = modifiedSrc.end(); size_t mainFirstBracePos = 0; // The aim is first to find this position - while (regex_search(start, end, matches, main_re, boost::format_first_only) && (mainFirstBracePos == 0)) + while (std::regex_search(start, end, matches, main_re, std::regex_constants::format_first_only) && (mainFirstBracePos == 0)) { // Start position of the match size_t startPosition = std::distance(modifiedSrc.begin(), matches[0].first);