From 2161823559d412f1fc23e9f69ff60b07e9e883fb Mon Sep 17 00:00:00 2001 From: Alex Martin Date: Mon, 17 Aug 2015 18:48:16 +0200 Subject: [PATCH] add option to disable install --- CMakeLists.txt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96dd8416..94f69fd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ if (NOT CMAKE_BUILD_TYPE) endif () option(FMT_PEDANTIC "Enable extra warnings and expensive tests." OFF) +option(FMT_INSTALL "Generate install target." ON) project(FORMAT) @@ -216,7 +217,9 @@ if (EXISTS .gitignore) endif () # Install targets. -set(FMT_LIB_DIR lib CACHE STRING - "Installation directory for libraries, relative to ${CMAKE_INSTALL_PREFIX}.") -install(TARGETS cppformat DESTINATION ${FMT_LIB_DIR}) -install(FILES format.h DESTINATION include/cppformat) +if (FMT_INSTALL) + set(FMT_LIB_DIR lib CACHE STRING + "Installation directory for libraries, relative to ${CMAKE_INSTALL_PREFIX}.") + install(TARGETS cppformat DESTINATION ${FMT_LIB_DIR}) + install(FILES format.h DESTINATION include/cppformat) +endif ()