plog
plog copied to clipboard
How to install plog
Hi,
Plog is mentioned here: more-debugging-tactics now I wonder how can I install "plog".
It would be nice to add information for new-commers how to install the library.
I use mingw32-make.exe to compile my octave project and now I wonder if there is something
like an install routine.
And what is the recommended way to download it? Is it via pip?
Regards,
Stefan
Hi @StefanPofahl ,
This is a header-only library, so basically you just need to put plog files into your include path.
There are several methods to accomplish that, choose the one that suits you best:
- add a git submodule (for example,
src/3rd-party/plog-> https://github.com/SergiusTheBest/plog) - use cmake
installand cmakefind_library - just copy files (for example into
src/3rd-party/plog) - use vcpkg (I'm not sure whether it works with
mingw32-make.exe)
My favorite method is to use git submodules.
Thanks Sergius!
Could you add these kind of information also in readme.md?
Which file do I need to copy and paste.
Do I need all in plog/include/plog/?
Regards, Stefan
It's better to copy everything but the necessary part is plog/include/plog/.
Could you add these kind of information also in readme.md?
I'll keep this issue open to remind me about that.
Thanks :-)
Am Mi., 3. Juni 2020 um 12:58 Uhr schrieb Sergey Podobry < [email protected]>:
It's better to copy everything but the necessary part is plog/include/plog/.
Could you add these kind of information also in readme.md?
I'll keep this issue open to remind me about that.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SergiusTheBest/plog/issues/167#issuecomment-638121073, or unsubscribe https://github.com/notifications/unsubscribe-auth/APREBE6BNZMKELFEI2PNBELRUYUFNANCNFSM4NROMFRQ .
-- Stefan Pofahl Zollgasse 5 8020 Graz Österreich Tel.: +43 (316) 33 2001
- use cmake
installand cmakefind_library
The find_library needs a lot of hints to work properly.
I added #171 to be able to use an installed version of plog by calling find_package(plog) and using it with target_link_libraries().
This as well streamlines the process for pulling in plog as a dependency by using CMake ExternalProject.
On linux you can $ sudo git clone https://github.com/SergiusTheBest/plog.git into /usr/lib and then Symlink into /usr/include from the /usr/lib directory you just cloned the project into $ sudo ln -s $(readlink -f plog/include/plog) /usr/include/plog Hope this helps
@supermyle Also you can use make install:
git clone https://github.com/SergiusTheBest/plog.git
cd plog
cmake -Bbuild
cd build
make
sudo make install
and to uninstall run from the build directory:
sudo xargs rm < install_manifest.txt
Thanks Sergius!
@SergiusTheBest Thanks for that information!
You should add support for cmake
add_subdirectory(plog )
Most libraries i've used support that then you can use target_link_libraries(target plog
Thanks for the advice :-)
FWIW I have successfully done it with a CMake declaration:
FetchContent_Declare(
plog GIT_REPOSITORY https://github.com/SergiusTheBest/plog GIT_TAG 1.1.9
)
FetchContent_MakeAvailable(plog)
include_directories(${plog_SOURCE_DIR}/include)
add_compile_definitions(PLOG_ENABLE_WCHAR_INPUT)