-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from ursfassler/less-boost
Remove dependency to Boost
- Loading branch information
Showing
18 changed files
with
150 additions
and
285 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
find_path(ASIO_INCLUDE_DIR asio.hpp) | ||
|
||
if (ASIO_INCLUDE_DIR) | ||
set(ASIO_FOUND TRUE) | ||
else () | ||
set(ASIO_FOUND FALSE) | ||
endif () | ||
|
||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Asio REQUIRED_VARS ASIO_INCLUDE_DIR) |
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,10 @@ | ||
find_path(TCLAP_INCLUDE_DIR tclap/CmdLine.h) | ||
|
||
if (TCLAP_INCLUDE_DIR) | ||
set(TCLAP_FOUND TRUE) | ||
else () | ||
set(TCLAP_FOUND FALSE) | ||
endif () | ||
|
||
include(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TCLAP REQUIRED_VARS TCLAP_INCLUDE_DIR) |
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,29 @@ | ||
function(git_get_version VERSION_VARIABLE) | ||
find_program(GIT_EXECUTABLE git) | ||
|
||
if(NOT GIT_EXECUTABLE) | ||
message(FATAL_ERROR "Git not found. Please install Git and make sure it is in your system's PATH.") | ||
endif() | ||
|
||
execute_process( | ||
COMMAND ${GIT_EXECUTABLE} describe --always --dirty | ||
OUTPUT_VARIABLE VERSION_STRING | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}" | ||
ERROR_VARIABLE GIT_DESCRIBE_ERROR | ||
RESULT_VARIABLE GIT_DESCRIBE_RESULT | ||
) | ||
|
||
if(NOT GIT_DESCRIBE_RESULT EQUAL 0) | ||
message(FATAL_ERROR "Error running 'git describe': ${GIT_DESCRIBE_ERROR}") | ||
endif() | ||
|
||
string(LENGTH "${VERSION_STRING}" VERSION_STRING_LENGTH) | ||
string(SUBSTRING "${VERSION_STRING}" 0 1 FIRST_CHARACTER) | ||
|
||
if("${FIRST_CHARACTER}" STREQUAL "v") | ||
string(SUBSTRING "${VERSION_STRING}" 1 ${VERSION_STRING_LENGTH} VERSION_STRING) | ||
endif() | ||
|
||
set(${VERSION_VARIABLE} ${VERSION_STRING} PARENT_SCOPE) | ||
endfunction() |
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 |
---|---|---|
@@ -1,42 +1,41 @@ | ||
#ifndef CUKE_REGISTRATIONMACROS_HPP_ | ||
#define CUKE_REGISTRATIONMACROS_HPP_ | ||
|
||
#if __cplusplus >= 201103L | ||
#define CUKE_OVERRIDE override | ||
#else | ||
#define CUKE_OVERRIDE | ||
#endif | ||
|
||
// ************************************************************************** // | ||
// ************** OBJECT NAMING MACROS ************** // | ||
// ************************************************************************** // | ||
|
||
// from https://www.boost.org/doc/libs/1_84_0/boost/config/helper_macros.hpp | ||
#define CUKE_JOIN(X, Y) CUKE_DO_JOIN(X, Y) | ||
#define CUKE_DO_JOIN(X, Y) CUKE_DO_JOIN2(X, Y) | ||
#define CUKE_DO_JOIN2(X, Y) X##Y | ||
|
||
#ifndef CUKE_OBJECT_PREFIX | ||
#define CUKE_OBJECT_PREFIX CukeObject | ||
#endif | ||
|
||
#ifdef __COUNTER__ | ||
#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(CUKE_OBJECT_PREFIX, __COUNTER__) | ||
#define CUKE_GEN_OBJECT_NAME_ CUKE_JOIN(CUKE_OBJECT_PREFIX, __COUNTER__) | ||
#else | ||
// Use a counter to be incremented every time cucumber-cpp is included | ||
// in case this does not suffice (possible with multiple files only) | ||
#define CUKE_GEN_OBJECT_NAME_ BOOST_JOIN(CUKE_OBJECT_PREFIX, __LINE__) | ||
#define CUKE_GEN_OBJECT_NAME_ CUKE_JOIN(CUKE_OBJECT_PREFIX, __LINE__) | ||
#endif | ||
|
||
// ************************************************************************** // | ||
// ************** CUKE OBJECTS ************** // | ||
// ************************************************************************** // | ||
|
||
#define CUKE_OBJECT_(class_name, parent_class, registration_fn, args) \ | ||
class class_name : public parent_class { \ | ||
public: \ | ||
void body() CUKE_OVERRIDE { return invokeWithArgs(*this, &class_name::bodyWithArgs); } \ | ||
void bodyWithArgs args; \ | ||
\ | ||
private: \ | ||
static const int cukeRegId; \ | ||
}; \ | ||
const int class_name ::cukeRegId = registration_fn; \ | ||
#define CUKE_OBJECT_(class_name, parent_class, registration_fn, args) \ | ||
class class_name : public parent_class { \ | ||
public: \ | ||
void body() override { return invokeWithArgs(*this, &class_name::bodyWithArgs); } \ | ||
void bodyWithArgs args; \ | ||
\ | ||
private: \ | ||
static const int cukeRegId; \ | ||
}; \ | ||
const int class_name ::cukeRegId = registration_fn; \ | ||
void class_name ::bodyWithArgs args /**/ | ||
|
||
#endif /* CUKE_REGISTRATIONMACROS_HPP_ */ |
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
Oops, something went wrong.