plog icon indicating copy to clipboard operation
plog copied to clipboard

How to install plog

Open StefanPofahl opened this issue 5 years ago • 12 comments

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

StefanPofahl avatar Jun 03 '20 08:06 StefanPofahl

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 install and cmake find_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.

SergiusTheBest avatar Jun 03 '20 09:06 SergiusTheBest

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

StefanPofahl avatar Jun 03 '20 10:06 StefanPofahl

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.

SergiusTheBest avatar Jun 03 '20 10:06 SergiusTheBest

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

StefanPofahl avatar Jun 03 '20 13:06 StefanPofahl

  • use cmake install and cmake find_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.

bitmeal avatar Jul 16 '20 10:07 bitmeal

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 avatar Oct 25 '22 20:10 supermyle

@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

SergiusTheBest avatar Oct 26 '22 10:10 SergiusTheBest

Thanks Sergius!

StefanPofahl avatar Oct 26 '22 13:10 StefanPofahl

@SergiusTheBest Thanks for that information!

supermyle avatar Oct 26 '22 18:10 supermyle

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

kenkit avatar Jan 04 '23 21:01 kenkit

Thanks for the advice :-)

StefanPofahl avatar Jan 05 '23 00:01 StefanPofahl

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)

pmatos avatar Feb 15 '23 14:02 pmatos