Installation and Reuse
November 1, 2017 ยท View on GitHub
There are a few different ways of installing/reusing mp::inplace_string in your project
Copy
mp::inplace_string is a standalone header-only library without any additional dependencies.
It can be simply copied to your source tree and used as a regular header file.
cmake
To use mp::inplace_string as a cmake imported library exported as cmake target via cmake
configuration files following steps may be done.
cmake install
mkdir build && cd build
cmake ../src -DCMAKE_INSTALL_PREFIX=<your_cmake_installation_dir> <your_cmake_configuration>
cmake --build . --target install <your_cmake_configuration>
To use such cmake target in your project it is enough to add following line to your CMakeList.txt file
find_package(inplace_string CONFIG REQUIRED)
and configure it with
cmake .. -DCMAKE_INSTALL_PREFIX=<your_cmake_installation_dir> <your_cmake_configuration>
cmake + conan
To use mp::inplace_string with cmake via conan it is enough to:
- add following remote to your local
conaninstance
conan remote add conan-mpusz https://bintray.com/mpusz/conan-mpusz
- add following dependency to your
conanfile.txtorconanfile.pyfiles:
requires = "inplace_string/0.0.3@mpusz/stable"
Full build, unit testing and installation
In case you would like to build all the code in that repository and run all unit tests before installation you can perform any of the following actions
conan
conan create <username>/<channel> --build=missing <your_profile_and_settings>
cmake
- Manually install
gtestwith the same configuration to your preferredCMAKE_INSTALL_PREFIXdirectory (e.g."~/local").
For example you can download googletest sources from github
and build them with:
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<your_cmake_installation_dir> <your_cmake_configuration>
cmake --build . --target install <your_cmake_configuration>
- Build, test and install
mp::inplace_string
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=<your_cmake_installation_dir> <your_cmake_configuration>
cmake --build . <your_cmake_configuration>
ctest <your_ctest_configuration>
cmake --build . --target install <your_cmake_configuration>
cmake + conan
mkdir build && cd build
conan install .. <your_profile_and_settings>
cmake .. <your_cmake_configuration>
cmake --build .
ctest
conan export -p .. <username>/<channel>