diff --git a/inc/osvr/Client/GetRuntimeVersion.h b/inc/osvr/Client/GetRuntimeVersion.h index 33c964a03..68bc116f9 100644 --- a/inc/osvr/Client/GetRuntimeVersion.h +++ b/inc/osvr/Client/GetRuntimeVersion.h @@ -1,5 +1,9 @@ /** @file - @brief Header + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` @date 2015 diff --git a/inc/osvr/Common/GetRuntimeVersion.h b/inc/osvr/Common/GetRuntimeVersion.h new file mode 100644 index 000000000..4785a2ad3 --- /dev/null +++ b/inc/osvr/Common/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_5BF26574_26A9_4DB1_27B9_B5B8E69F2AE1 +#define INCLUDED_GetRuntimeVersion_h_GUID_5BF26574_26A9_4DB1_27B9_B5B8E69F2AE1 + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace common { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_COMMON_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_COMMON_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_COMMON_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_COMMON_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_COMMON_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_COMMON_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_COMMON_EXPORT const char *getModuleName(); +} // namespace common +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_5BF26574_26A9_4DB1_27B9_B5B8E69F2AE1 diff --git a/inc/osvr/Connection/GetRuntimeVersion.h b/inc/osvr/Connection/GetRuntimeVersion.h new file mode 100644 index 000000000..f7b123e4e --- /dev/null +++ b/inc/osvr/Connection/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_6FCB818C_A087_4CB8_E0C4_29B472CCE703 +#define INCLUDED_GetRuntimeVersion_h_GUID_6FCB818C_A087_4CB8_E0C4_29B472CCE703 + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace connection { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_CONNECTION_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_CONNECTION_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_CONNECTION_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_CONNECTION_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_CONNECTION_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_CONNECTION_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_CONNECTION_EXPORT const char *getModuleName(); +} // namespace connection +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_6FCB818C_A087_4CB8_E0C4_29B472CCE703 diff --git a/inc/osvr/PluginHost/GetRuntimeVersion.h b/inc/osvr/PluginHost/GetRuntimeVersion.h new file mode 100644 index 000000000..af52e783d --- /dev/null +++ b/inc/osvr/PluginHost/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_4A6A0FF9_4A87_4F9E_1192_82AEA1E1DF58 +#define INCLUDED_GetRuntimeVersion_h_GUID_4A6A0FF9_4A87_4F9E_1192_82AEA1E1DF58 + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace pluginhost { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_PLUGINHOST_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_PLUGINHOST_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_PLUGINHOST_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_PLUGINHOST_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_PLUGINHOST_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_PLUGINHOST_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_PLUGINHOST_EXPORT const char *getModuleName(); +} // namespace pluginhost +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_4A6A0FF9_4A87_4F9E_1192_82AEA1E1DF58 diff --git a/inc/osvr/Server/GetRuntimeVersion.h b/inc/osvr/Server/GetRuntimeVersion.h new file mode 100644 index 000000000..cbe750886 --- /dev/null +++ b/inc/osvr/Server/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_8513C123_CF38_4F9F_586F_1A1FDA5463BA +#define INCLUDED_GetRuntimeVersion_h_GUID_8513C123_CF38_4F9F_586F_1A1FDA5463BA + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace server { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_SERVER_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_SERVER_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_SERVER_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_SERVER_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_SERVER_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_SERVER_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_SERVER_EXPORT const char *getModuleName(); +} // namespace server +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_8513C123_CF38_4F9F_586F_1A1FDA5463BA diff --git a/inc/osvr/USBSerial/GetRuntimeVersion.h b/inc/osvr/USBSerial/GetRuntimeVersion.h new file mode 100644 index 000000000..4f08f141a --- /dev/null +++ b/inc/osvr/USBSerial/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_4458E735_A9DC_4F94_AE78_433B41E5147F +#define INCLUDED_GetRuntimeVersion_h_GUID_4458E735_A9DC_4F94_AE78_433B41E5147F + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace usbserial { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_USBSERIAL_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_USBSERIAL_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_USBSERIAL_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_USBSERIAL_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_USBSERIAL_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_USBSERIAL_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_USBSERIAL_EXPORT const char *getModuleName(); +} // namespace usbserial +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_4458E735_A9DC_4F94_AE78_433B41E5147F diff --git a/inc/osvr/Util/GetRuntimeVersion.h b/inc/osvr/Util/GetRuntimeVersion.h new file mode 100644 index 000000000..d7539bc5d --- /dev/null +++ b/inc/osvr/Util/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_FF76C4D7_2239_4DA3_0216_19D9473788E8 +#define INCLUDED_GetRuntimeVersion_h_GUID_FF76C4D7_2239_4DA3_0216_19D9473788E8 + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace util { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_UTIL_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_UTIL_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_UTIL_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_UTIL_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_UTIL_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_UTIL_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_UTIL_EXPORT const char *getModuleName(); +} // namespace util +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_FF76C4D7_2239_4DA3_0216_19D9473788E8 diff --git a/inc/osvr/VRPNServer/GetRuntimeVersion.h b/inc/osvr/VRPNServer/GetRuntimeVersion.h new file mode 100644 index 000000000..4f7112c30 --- /dev/null +++ b/inc/osvr/VRPNServer/GetRuntimeVersion.h @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_D58CA30A_7011_4BA6_509B_CF2A61DDF191 +#define INCLUDED_GetRuntimeVersion_h_GUID_D58CA30A_7011_4BA6_509B_CF2A61DDF191 + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace vrpnserver { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_VRPNSERVER_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_VRPNSERVER_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_VRPNSERVER_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_VRPNSERVER_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_VRPNSERVER_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_VRPNSERVER_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_VRPNSERVER_EXPORT const char *getModuleName(); +} // namespace vrpnserver +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_D58CA30A_7011_4BA6_509B_CF2A61DDF191 diff --git a/src/osvr/Client/GetRuntimeVersion.cpp b/src/osvr/Client/GetRuntimeVersion.cpp index 68f56bebd..e550a2a71 100644 --- a/src/osvr/Client/GetRuntimeVersion.cpp +++ b/src/osvr/Client/GetRuntimeVersion.cpp @@ -1,6 +1,10 @@ /** @file @brief Implementation + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + @date 2015 @author diff --git a/src/osvr/Common/CMakeLists.txt b/src/osvr/Common/CMakeLists.txt index 65f8d162e..2c089da9e 100644 --- a/src/osvr/Common/CMakeLists.txt +++ b/src/osvr/Common/CMakeLists.txt @@ -38,6 +38,7 @@ set(API "${HEADER_LOCATION}/DeviceComponentPtr.h" "${HEADER_LOCATION}/Endianness.h" "${HEADER_LOCATION}/GetEnvironmentVariable.h" + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/ImagingComponent.h" "${HEADER_LOCATION}/IntegerByteSwap.h" "${HEADER_LOCATION}/InterfaceCallbacks.h" @@ -101,6 +102,7 @@ set(SOURCE DeviceWrapper.h GetEnvironmentVariable.cpp GetJSONStringFromTree.h + GetRuntimeVersion.cpp ImagingComponent.cpp IPCRingBuffer.cpp IPCRingBufferResults.h diff --git a/src/osvr/Common/GetRuntimeVersion.cpp b/src/osvr/Common/GetRuntimeVersion.cpp new file mode 100644 index 000000000..ba36f6c8a --- /dev/null +++ b/src/osvr/Common/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace common { +#include +} // namespace common +} // namespace osvr diff --git a/src/osvr/Connection/CMakeLists.txt b/src/osvr/Connection/CMakeLists.txt index e9e60d14a..a9f07197f 100755 --- a/src/osvr/Connection/CMakeLists.txt +++ b/src/osvr/Connection/CMakeLists.txt @@ -11,6 +11,7 @@ set(API "${HEADER_LOCATION}/DeviceInitObject.h" "${HEADER_LOCATION}/DeviceToken.h" "${HEADER_LOCATION}/DeviceTokenPtr.h" + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/ImagingServerInterface.h" "${HEADER_LOCATION}/MessageType.h" "${HEADER_LOCATION}/MessageTypePtr.h" @@ -32,6 +33,7 @@ set(SOURCE GenerateVrpnDynamicServer.cpp GenerateVrpnDynamicServer.h GenericConnectionDevice.h + GetRuntimeVersion.cpp ImagingServerInterface.cpp MessageType.cpp SyncDeviceToken.cpp diff --git a/src/osvr/Connection/GetRuntimeVersion.cpp b/src/osvr/Connection/GetRuntimeVersion.cpp new file mode 100644 index 000000000..97226f1a9 --- /dev/null +++ b/src/osvr/Connection/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace connection { +#include +} // namespace connection +} // namespace osvr diff --git a/src/osvr/GenerateGetRuntimeVersion.cmake b/src/osvr/GenerateGetRuntimeVersion.cmake new file mode 100644 index 000000000..3bb892695 --- /dev/null +++ b/src/osvr/GenerateGetRuntimeVersion.cmake @@ -0,0 +1,29 @@ +# Manually-run script for generating the GetRuntimeVersion headers/implementations. +# Manually generated simply because they're identical except for module name. + +set(INPUT_H "${CMAKE_CURRENT_LIST_DIR}/GetRuntimeVersion.h.in") +set(INPUT_CPP "${CMAKE_CURRENT_LIST_DIR}/GetRuntimeVersion.cpp.in") +foreach(guidmod + 487199D9_CA87_4E85_52A2_D1BDBC119163:Client + 5BF26574_26A9_4DB1_27B9_B5B8E69F2AE1:Common + 6FCB818C_A087_4CB8_E0C4_29B472CCE703:Connection + 4A6A0FF9_4A87_4F9E_1192_82AEA1E1DF58:PluginHost + 8513C123_CF38_4F9F_586F_1A1FDA5463BA:Server + 4458E735_A9DC_4F94_AE78_433B41E5147F:USBSerial + FF76C4D7_2239_4DA3_0216_19D9473788E8:Util + D58CA30A_7011_4BA6_509B_CF2A61DDF191:VRPNServer) + + string(SUBSTRING "${guidmod}" 0 36 GUID) + string(SUBSTRING "${guidmod}" 37 -1 Modname) + message(STATUS "Module: '${Modname}'") + string(TOUPPER "${Modname}" MODNAME) + string(TOLOWER "${Modname}" modname) + configure_file("${INPUT_H}" + "${CMAKE_CURRENT_LIST_DIR}/../../inc/osvr/${Modname}/GetRuntimeVersion.h" + @ONLY + NEWLINE_STYLE LF) + configure_file("${INPUT_CPP}" + "${CMAKE_CURRENT_LIST_DIR}/${Modname}/GetRuntimeVersion.cpp" + @ONLY + NEWLINE_STYLE LF) +endforeach() diff --git a/src/osvr/GetRuntimeVersion.cpp.in b/src/osvr/GetRuntimeVersion.cpp.in new file mode 100644 index 000000000..1aab69164 --- /dev/null +++ b/src/osvr/GetRuntimeVersion.cpp.in @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace @modname@ { +#include +} // namespace @modname@ +} // namespace osvr diff --git a/src/osvr/GetRuntimeVersion.h.in b/src/osvr/GetRuntimeVersion.h.in new file mode 100644 index 000000000..1ab9ade5e --- /dev/null +++ b/src/osvr/GetRuntimeVersion.h.in @@ -0,0 +1,77 @@ +/** @file + @brief Header for accessing runtime version information. + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef INCLUDED_GetRuntimeVersion_h_GUID_@GUID@ +#define INCLUDED_GetRuntimeVersion_h_GUID_@GUID@ + +// Internal Includes +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace @modname@ { + /// @brief Returns the value of the version component (zero-indexed) + /// specified, in the inclusive range [0,3]. + /// @return version component value, or 0 if component out of range. + OSVR_@MODNAME@_EXPORT util::NumericVersionComponent + getVersionComponent(uint8_t componentIndex); + + /// @brief Gets all numeric components of the runtime version in a tuple. + OSVR_@MODNAME@_EXPORT util::RuntimeNumericVersion getRuntimeNumericVersion(); + + /// @brief Gets the Git commit hash corresponding to this library build. + /// @returns an empty string if the commit hash could not be detected. + OSVR_@MODNAME@_EXPORT const char *getCommit(); + + /// @brief Gets the full descriptive version string, typically including the + /// numerical version components and the commit hash. + OSVR_@MODNAME@_EXPORT const char *getVersionString(); + + /// @brief If this was built by the CI, return the "Build Tag" the CI + /// associated with the build job. (Unrelated to git tags.) + /// @returns empty string if we don't have a CI build tag recorded. + OSVR_@MODNAME@_EXPORT const char *getCIBuildTag(); + + /// @brief Does this build identify itself as a dev build, rather than a + /// CI-build "production" build? This is not necessarily 100% accurate - for + /// informational purposes only. + OSVR_@MODNAME@_EXPORT bool isKnownDevBuild(); + + /// @brief Gets the name of this library/module, or an empty string if the + /// build system did not incorporate this information into the build. + OSVR_@MODNAME@_EXPORT const char *getModuleName(); +} // namespace @modname@ +} // namespace osvr + +#endif // INCLUDED_GetRuntimeVersion_h_GUID_@GUID@ diff --git a/src/osvr/PluginHost/CMakeLists.txt b/src/osvr/PluginHost/CMakeLists.txt index afe2311d5..8fe9cfaba 100644 --- a/src/osvr/PluginHost/CMakeLists.txt +++ b/src/osvr/PluginHost/CMakeLists.txt @@ -1,6 +1,7 @@ osvr_setup_lib_vars(PluginHost) set(API + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/PluginSpecificRegistrationContext_fwd.h" "${HEADER_LOCATION}/PluginSpecificRegistrationContext.h" "${HEADER_LOCATION}/PluginRegPtr.h" @@ -11,6 +12,7 @@ set(API set(SOURCE BinaryLocation.cpp BinaryLocation.h + GetRuntimeVersion.cpp PluginSpecificRegistrationContext.cpp PluginSpecificRegistrationContextImpl.cpp PluginSpecificRegistrationContextImpl.h diff --git a/src/osvr/PluginHost/GetRuntimeVersion.cpp b/src/osvr/PluginHost/GetRuntimeVersion.cpp new file mode 100644 index 000000000..5d24ebddc --- /dev/null +++ b/src/osvr/PluginHost/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace pluginhost { +#include +} // namespace pluginhost +} // namespace osvr diff --git a/src/osvr/Server/CMakeLists.txt b/src/osvr/Server/CMakeLists.txt index bfb4b97b7..66c395e16 100644 --- a/src/osvr/Server/CMakeLists.txt +++ b/src/osvr/Server/CMakeLists.txt @@ -3,6 +3,7 @@ osvr_setup_lib_vars(Server) set(API "${HEADER_LOCATION}/ConfigureServer.h" "${HEADER_LOCATION}/ConfigureServerFromFile.h" + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/Server.h" "${HEADER_LOCATION}/ServerPtr.h" "${HEADER_LOCATION}/RegisterShutdownHandler.h" @@ -11,6 +12,7 @@ set(API set(SOURCE ConfigureServer.cpp + GetRuntimeVersion.cpp JSONResolvePossibleRef.h JSONResolvePossibleRef.cpp Server.cpp diff --git a/src/osvr/Server/GetRuntimeVersion.cpp b/src/osvr/Server/GetRuntimeVersion.cpp new file mode 100644 index 000000000..0dffd5247 --- /dev/null +++ b/src/osvr/Server/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace server { +#include +} // namespace server +} // namespace osvr diff --git a/src/osvr/USBSerial/CMakeLists.txt b/src/osvr/USBSerial/CMakeLists.txt index 2a84db157..c013faa81 100644 --- a/src/osvr/USBSerial/CMakeLists.txt +++ b/src/osvr/USBSerial/CMakeLists.txt @@ -1,9 +1,11 @@ osvr_setup_lib_vars(USBSerial) set(API + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/USBSerialDevice.h" "${HEADER_LOCATION}/USBSerialEnum.h") set(SOURCE + GetRuntimeVersion.cpp USBSerialDevInfo.h USBSerialDevInfo.cpp USBSerialDevInfo_Linux.h diff --git a/src/osvr/USBSerial/GetRuntimeVersion.cpp b/src/osvr/USBSerial/GetRuntimeVersion.cpp new file mode 100644 index 000000000..72463b3e8 --- /dev/null +++ b/src/osvr/USBSerial/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace usbserial { +#include +} // namespace usbserial +} // namespace osvr diff --git a/src/osvr/Util/CMakeLists.txt b/src/osvr/Util/CMakeLists.txt index 3aacef559..1eac2b1af 100644 --- a/src/osvr/Util/CMakeLists.txt +++ b/src/osvr/Util/CMakeLists.txt @@ -11,6 +11,37 @@ configure_file(Verbosity.h.in "${CMAKE_CURRENT_BINARY_DIR}/Verbosity.h") ### configure_file(Version.h.in "${CMAKE_CURRENT_BINARY_DIR}/Version.h") +### +# Version resource helper +### +set(OSVR_RC_COMMONCOMMENTS_STR "") +if(OSVR_BIT_VARIANT) + set(OSVR_RC_COMMONCOMMENTS_STR "${OSVR_BIT_VARIANT}") +endif() +# TODO make this actually update automatically +set(OSVR_RC_CURRENTYEAR_STR 2015) + +if(WIN32) + if(MSVC) + set(OSVR_RC_COMPILER_STR "MSVC ${MSVC_VERSION}") + elseif("${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}" MATCHES "/gcc/") + foreach(linkdir ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}) + if("${linkdir}" MATCHES "gcc/([^/]+/[.0-9]+)") + set(OSVR_RC_COMPILER_STR "GCC ${CMAKE_MATCH_1}") + break() + endif() + endforeach() + else() + set(OSVR_RC_COMPILER_STR "${CMAKE_CXX_COMPILER_ID}") + endif() +endif() +set(OSVR_RC_PRIVATEBUILDINFO "") +if(NOT OSVR_RC_RELEASEBUILD) + # TODO make this string descriptive + set(OSVR_RC_PRIVATEBUILDINFO "TODO") +endif() +configure_file(VersionResourceHelper.h.in "${CMAKE_CURRENT_BINARY_DIR}/VersionResourceHelper.h") + ### # Platform Config Header ### @@ -46,6 +77,7 @@ set(API "${HEADER_LOCATION}/Flag.h" "${HEADER_LOCATION}/GenericCaller.h" "${HEADER_LOCATION}/GenericDeleter.h" + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/GuardInterface.h" "${HEADER_LOCATION}/GuardInterfaceDummy.h" "${HEADER_LOCATION}/ImagingReportTypesC.h" @@ -82,15 +114,23 @@ set(API "${HEADER_LOCATION}/Vec3C.h" "${HEADER_LOCATION}/WindowsVariantC.h" "${CMAKE_CURRENT_BINARY_DIR}/PlatformConfig.h" + "${CMAKE_CURRENT_BINARY_DIR}/VersionResourceHelper.h" "${CMAKE_CURRENT_BINARY_DIR}/Version.h") +if(WIN32 AND FALSE) + list(APPEND API + "${HEADER_LOCATION}/SharedVersion.rc") +endif() + set(SOURCE AnyMap.cpp Deletable.cpp + GetRuntimeVersion.cpp GuardInterface.cpp TimeValueC.cpp MessageKeys.cpp PlatformConfig.h.in + VersionResourceHelper.h.in Version.h.in Verbosity.h.in ClientCallbackTypesC.h.in diff --git a/src/osvr/Util/GetRuntimeVersion.cpp b/src/osvr/Util/GetRuntimeVersion.cpp new file mode 100644 index 000000000..0c8d35ed3 --- /dev/null +++ b/src/osvr/Util/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace util { +#include +} // namespace util +} // namespace osvr diff --git a/src/osvr/VRPNServer/CMakeLists.txt b/src/osvr/VRPNServer/CMakeLists.txt index 41996dbda..7511ddbd6 100644 --- a/src/osvr/VRPNServer/CMakeLists.txt +++ b/src/osvr/VRPNServer/CMakeLists.txt @@ -1,10 +1,12 @@ osvr_setup_lib_vars(VRPNServer) set(API + "${HEADER_LOCATION}/GetRuntimeVersion.h" "${HEADER_LOCATION}/GetVRPNConnection.h" "${HEADER_LOCATION}/VRPNDeviceRegistration.h") set(SOURCE + GetRuntimeVersion.cpp GetVRPNConnection.cpp VRPNDeviceRegistration.cpp) diff --git a/src/osvr/VRPNServer/GetRuntimeVersion.cpp b/src/osvr/VRPNServer/GetRuntimeVersion.cpp new file mode 100644 index 000000000..57e729fec --- /dev/null +++ b/src/osvr/VRPNServer/GetRuntimeVersion.cpp @@ -0,0 +1,44 @@ +/** @file + @brief Implementation + + Generated by running: + + `cmake -P src/osvr/GenerateGetRuntimeVersion.cmake` + + @date 2015 + + @author + Sensics, Inc. + +*/ + +// Copyright 2015 Sensics, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Internal Includes +#include +#include +#include + +// Library/third-party includes +// - none + +// Standard includes +// - none + +namespace osvr { +namespace vrpnserver { +#include +} // namespace vrpnserver +} // namespace osvr