-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
111 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ | |
]] | ||
|
||
add_subdirectory(logger) | ||
add_subdirectory(version) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#[[ | ||
|
||
@brief Build ReSolve output log system | ||
|
||
@author Slaven Peles <[email protected]> | ||
|
||
]] | ||
|
||
set(Logger_SRC | ||
version.cpp | ||
) | ||
|
||
set(Logger_HEADER_INSTALL | ||
version.hpp | ||
) | ||
|
||
# Build shared library ReSolve | ||
add_library(resolve_version OBJECT ${Logger_SRC}) | ||
|
||
target_include_directories(resolve_version PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}> | ||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}> | ||
$<INSTALL_INTERFACE:include> | ||
) | ||
|
||
install(FILES ${Logger_HEADER_INSTALL} DESTINATION include/resolve/utilities/version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include <unordered_map> | ||
#include <string> | ||
|
||
#include "version.hpp" | ||
#include <resolve/resolve_defs.hpp> | ||
|
||
namespace ReSolve | ||
{ | ||
// Function that splits the verison in major minor and patch ints | ||
int VersionGetVersion(int* major, int* minor, int* patch) | ||
{ | ||
*major = atoi(RESOLVE_VERSION_MAJOR); | ||
*minor = atoi(RESOLVE_VERSION_MINOR); | ||
*patch = atoi(RESOLVE_VERSION_PATCH); | ||
return 0; | ||
} | ||
|
||
// Function that grabs ReSolves Version as a string | ||
int VersionGetVersionStr(std::string &str) | ||
{ | ||
str = RESOLVE_VERSION; | ||
return 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
namespace ReSolve | ||
{ | ||
|
||
/** | ||
* Sets major, minor, and patch versions for current ReSolve build. The user is | ||
* responsible for free'ing this memory. | ||
*/ | ||
int VersionGetVersion(int *, int *, int *); | ||
|
||
/** | ||
* Sets string with build version for current ExaGO build in format | ||
* "major.minor.patch". The user is responsible for free'ing this memory. | ||
*/ | ||
int VersionGetVersionStr(std::string &); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include <string> | ||
#include <iostream> | ||
|
||
|
||
#include <resolve/utilities/version/version.hpp> | ||
|
||
//author: RD | ||
//version test to check to make sure ReSolve's version can be printed | ||
|
||
/** | ||
* @brief Test ReSolve version | ||
* | ||
* The purpose of this mildly annoying test is to force developers | ||
* to change version at two different places. The hope is this test | ||
* will fail if the version is changed accidentally. | ||
* | ||
* @return int If test was successful return zero | ||
*/ | ||
int main() | ||
{ | ||
std::string answer("0.99.1"); | ||
std::string versionstr; | ||
ReSolve::VersionGetVersionStr(versionstr); | ||
std::cout << "ReSolveVersionGetVersionStr Test: " << versionstr << std::endl << std::endl; | ||
|
||
if (versionstr != answer) { | ||
std::cout << "ReSolve version set incorrectly!\n"; | ||
return 1; | ||
} | ||
|
||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.