file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/include/config.h" CONFIG_CONTENTS)
string(REGEX REPLACE ".*#define NETWORKS_CPP_VERSION_MAJOR ([0-9]+).*" "\\1" VERSION_MAJOR "${CONFIG_CONTENTS}")
string(REGEX REPLACE ".*#define NETWORKS_CPP_VERSION_MINOR ([0-9]+).*" "\\1" VERSION_MINOR "${CONFIG_CONTENTS}")
string(REGEX REPLACE ".*#define NETWORKS_CPP_VERSION_PATCH ([0-9]+).*" "\\1" VERSION_PATCH "${CONFIG_CONTENTS}")
set(DETECTED_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")

message(STATUS "Detected Version - ${DETECTED_VERSION}")