-
Notifications
You must be signed in to change notification settings - Fork 15
/
build_config.h.in
89 lines (75 loc) · 2.57 KB
/
build_config.h.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef BUILD_CONFIG_H
#define BUILD_CONFIG_H
//------------------------------------------------------------
// Purpose:
// Define your source root and build root from CMake vars
// so you can pass paths from CMake into C++
//------------------------------------------------------------
// Notes:
// If you need these CMake variables for pure C code,
// then use the #define variables, otherwise, use the
// get methods defined in the gnsstk namespace.
//------------------------------------------------------------
#include <string>
namespace gnsstk
{
//----------------------------------------
// Purpose: get path separator character, e.g. ":" or ";"
// Usage: std::string file_sep = gnsstk::getPathSep()
//----------------------------------------
inline std::string getPathSep( void )
{
#ifdef WIN32
const std::string path_sep(";");
#else
const std::string path_sep(":");
#endif
return( path_sep );
}
//----------------------------------------
// Purpose: get file system file separator character, e.g. "/" or "\"
// Usage: std::string file_sep = gnsstk::getFileSep()
//----------------------------------------
inline std::string getFileSep( void )
{
#ifdef WIN32
const std::string file_sep("\\");
#else
const std::string file_sep("/");
#endif
return( file_sep );
}
//----------------------------------------
// Purpose: get file system path to top level of source tree
// Usage: std::string src_path = gnsstk::getPathSrc()
//----------------------------------------
inline std::string getPathSrc( void )
{
return( "@PROJECT_SOURCE_DIR@" );
}
//----------------------------------------
// Purpose: get file system path to the CMake build dir
// Usage: std::string build_path = gnsstk::getPathBuild()
//----------------------------------------
inline std::string getPathBuild( void )
{
return( "@PROJECT_BINARY_DIR@" );
}
//----------------------------------------
// Purpose: get file system path to location of gnsstk data files
// Usage: std::string data_path = gnsstk::getPathData()
//----------------------------------------
inline std::string getPathData( void )
{
return( "@GNSSTK_TEST_DATA_DIR@" );
}
//----------------------------------------
// Purpose: get file system path to location to write temp test output
// Usage: std::string temp_path = gnsstk::getPathTestTemp()
//----------------------------------------
inline std::string getPathTestTemp( void )
{
return( "@GNSSTK_TEST_OUTPUT_DIR@" );
}
}
#endif // BUILD_CONFIG_H