Loki-Astari / ThorsMongo

C++ MongoDB API and BSON/JSON Serialization library
GNU General Public License v3.0
316 stars 72 forks source link

Tags with header only #74

Closed DraTeots closed 3 years ago

DraTeots commented 3 years ago

Is your feature request related to a problem? Please describe. "I'm always frustrated when..." it is said there should be a single header file and I can't find it. Even more frustrating, when there is no CMake but old Makefiles (no complains to developers, just our system is CMake centric, so it is our problem, but still...)

Describe the solution you'd like Just make those header only version easy to download and attach to tags

Describe alternatives you've considered Use another library

DraTeots commented 3 years ago

Ok, there where no claims about single header. Only "header only". Sorry and thanks for the library!!!

Loki-Astari commented 3 years ago

The old Makefile stuff works everywhere (unlike CMake), no extra stuff required. Once it is built you can use it from you CMake files :-)

But the easy way to install is to use it via brew

> brew install thors-serializer`

But building it should be as easy as:

> ./configure
> make
> sudo make install

To use the header only version.

> git clone --single-branch --branch header-only https://github.com/Loki-Astari/ThorsSerializer.git
  /PATH/TO/WHERE/I/WANT/TO/INSTALL/ThorsSerializer

 g++ -I /PATH/TO/WHERE/I/WANT/TO/INSTALL/ThorsSerializer MyFile.cpp
DraTeots commented 3 years ago

"Once it is built you can use it from you CMake files :-)"

Do you generate thors-serializerConfig.cmake and thors-serializer.cmake files?

Loki-Astari commented 3 years ago

No. But they should be trival to do if you know CMake (which I don't).

The only things you need are:

Default values are (unless you do something special with the ./configure command)

ThorHeaderDir  => /usr/local/include
ThorLibraryDir  => /usr/local/lib
libraryName     => ThorSerialize17

If you build it but don't install it (i.e. you don't have root access).

THOR_ROOT    => <The director where you downloaded from git>/ThorsSerializer

ThorHeaderDir  => <THOR_ROOT>/build/include
ThorLibraryDir  => <THOR_ROOT>/build/lib
libraryName     => ThorSerialize17
Loki-Astari commented 3 years ago

If you create one I will add to the project for future developers to use.

Loki-Astari commented 3 years ago

According to this page: http://doc.aldebaran.com/qibuild/advanced/guide/cmake/writing_a_config_cmake.html

It should look like this:

thors-serializerConfig.cmake

clean(ThorsSerializer)
fpath(ThorsSerializer ThorSerialize/JsonThor.h)
flib(ThorsSerializer OPTIMIZED  ThorSerialize17)
flib(ThorsSerializer DEBUG  ThorSerialize17D)
export_lib(ThorsSerializer)

Let me know if this works.

Loki-Astari commented 1 year ago

Massively cleaned up the header only version.