restructure library location

This commit is contained in:
2023-02-16 02:26:14 -03:00
parent bf5033c70d
commit 48955026c4
10 changed files with 60 additions and 33 deletions

27
src/lib/include/obelisk.h Normal file
View File

@@ -0,0 +1,27 @@
#include <string>
/**
* @brief The obelisk namespace contains everything needed to compile obelisk.
* code.
*
*/
namespace obelisk
{
class Obelisk
{
public:
/**
* @brief Get the obelisk version.
*
* @return std::string The version.
*/
std::string getVersion();
/**
* @brief Get the obelisk library so version.
*
* @return int The version.
*/
int getLibVersion();
};
} // namespace obelisk

29
src/lib/meson.build Normal file
View File

@@ -0,0 +1,29 @@
conf_data = configuration_data()
conf_data.set('version', meson.project_version())
conf_data.set('so_version', project_version_lib)
configure_file(input : 'version.h.in',
output : 'version.h',
configuration : conf_data
)
obelisk_lib_sources = files(
'obelisk.cpp'
)
sqlite3 = dependency('sqlite3')
incdirs = include_directories(['.', 'include'])
lib = library('obelisk',
obelisk_lib_sources,
include_directories: incdirs,
dependencies : [sqlite3],
version : meson.project_version(),
soversion : project_version_lib,
install : true
)
libobelisk_dep = declare_dependency(
include_directories : incdirs,
link_with : lib,
sources : obelisk_lib_sources
)

14
src/lib/obelisk.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include "include/obelisk.h"
#include "version.h"
// TODO: Move the models to the library then link the compiler to the library
std::string obelisk::Obelisk::getVersion()
{
return obelisk::version;
}
int obelisk::Obelisk::getLibVersion()
{
return obelisk::soVersion;
}

16
src/lib/version.h.in Normal file
View File

@@ -0,0 +1,16 @@
namespace obelisk
{
/**
* @brief The current version of obelisk.
*
*/
const std::string version = "@version@";
/**
* @brief The current library version of obelisk.
*
*/
// clang-format off
const int soVersion = @so_version@;
// clang-format on
} // namespace obelisk