Logo
Explore Help
Sign In
fmtlib/fmt
1
0
Fork 1
You've already forked fmt
mirror of https://github.com/fmtlib/fmt.git synced 2025-11-06 00:51:40 +01:00
Code Issues Packages Projects Releases Wiki Activity
Files
daf74ae0b11d4e6517151038b32aa0f4b731a3d3
fmt/support/cmake/cppformatConfig.cmake.in

5 lines
120 B
CMake
Raw Normal View History

upgrades to cmake 2.8.12 and adds config and export support This commit upgrades cmake to 2.8.12 to implement proper cmake `find_package` support using config and export file generation. Having this support enables users to use installed cppformat with a simple `find_package` call. Directly using a version from a build directory is also supported. main.cpp: ``` #include <cppformat/format.h> int main(int argc, char** argv) { for(int i = 0; i < argc; ++i) fmt::print("{}: {}\n",i,argv[i]); return 0; } ``` CMakeLists.txt: ``` cmake_minimum_required(VERSION 2.8.12) project(cppformat-test) find_package(cppformat REQUIRED) add_executable(cppformat-test "main.cpp") target_link_libraries(cppformat-test cppformat) ``` Configuring when cppformat is installed under `CMAKE_INSTALL_PREFIX`: `cmake <PATH_TO_TEST_SRC>` Configuring when cppformat is installed `ELSEWHERE`: `cmake -Dcppformat_DIR=<ELSEWHERE>/lib/cmake/cppformat <PATH_TO_TEST_SRC>` Configuring when cppformat is only built: `cmake -Dcppformat_DIR=<cppformat_BUILD_DIR> <PATH_TO_TEST_SRC>`
2016-01-11 19:01:49 +01:00
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
check_required_components("cppformat")
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 20ms Template: 1ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API