Aim
This is an example to show how to use cmake to prepare a linux application and install it to a specific path with dynamic library.
Source
#include <iostream> #include "Logger.h" int main(int argc, char* argv[]) { LOGMSG_MSG_C("Hello\n"); return 0; }
Steps
$ cd InstallationExample $ mkdir build install $ cd build $ cmake -G Ninja ../InstallationExample/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=../install $ ninja $ ninja install $ cd ../install/bin $ export LD_LIBRARY_PATH=Path to/install/lib $ ./InstallationExample
沒有留言:
發佈留言