From 584fa85d18eca75e20e23ad7fd1710b2cb0c9b75 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 22 May 2016 16:07:50 -0700 Subject: [PATCH] Add fmt prefix to includes (#332) Technically it is not necessary, but prevents errors when people add the fmt directory itself rather than its parent to includes. (cherry picked from commit e160c2b79a405757c1a6dab7e5a41b81c9e5ed05) --- fmt/CMakeLists.txt | 2 +- fmt/format.cc | 2 +- fmt/ostream.cc | 2 +- fmt/ostream.h | 2 +- fmt/posix.cc | 2 +- fmt/posix.h | 2 +- test/CMakeLists.txt | 2 ++ 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt index c0ef02e5..f7d551c2 100644 --- a/fmt/CMakeLists.txt +++ b/fmt/CMakeLists.txt @@ -20,7 +20,7 @@ if (FMT_PEDANTIC) target_compile_options(fmt PRIVATE ${PEDANTIC_COMPILE_FLAGS}) endif () -target_include_directories(fmt INTERFACE +target_include_directories(fmt PUBLIC $ $) diff --git a/fmt/format.cc b/fmt/format.cc index ae5d1103..40b236e4 100644 --- a/fmt/format.cc +++ b/fmt/format.cc @@ -25,7 +25,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "format.h" +#include "fmt/format.h" #include diff --git a/fmt/ostream.cc b/fmt/ostream.cc index 0ba30347..3868d384 100644 --- a/fmt/ostream.cc +++ b/fmt/ostream.cc @@ -25,7 +25,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "ostream.h" +#include "fmt/ostream.h" namespace fmt { diff --git a/fmt/ostream.h b/fmt/ostream.h index 458d31de..5654eb1b 100644 --- a/fmt/ostream.h +++ b/fmt/ostream.h @@ -28,7 +28,7 @@ #ifndef FMT_OSTREAM_H_ #define FMT_OSTREAM_H_ -#include "format.h" +#include "fmt/format.h" #include namespace fmt { diff --git a/fmt/posix.cc b/fmt/posix.cc index 1ec746a4..c8f828a5 100644 --- a/fmt/posix.cc +++ b/fmt/posix.cc @@ -30,7 +30,7 @@ # define _CRT_SECURE_NO_WARNINGS #endif -#include "posix.h" +#include "fmt/posix.h" #include #include diff --git a/fmt/posix.h b/fmt/posix.h index ab6d12e8..a830f6b2 100644 --- a/fmt/posix.h +++ b/fmt/posix.h @@ -45,7 +45,7 @@ # include // for LC_NUMERIC_MASK on OS X #endif -#include "format.h" +#include "fmt/format.h" #ifndef FMT_POSIX # if defined(_WIN32) && !defined(__MINGW32__) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e4e868d5..7c8cc88c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -109,6 +109,7 @@ endif () check_cxx_compiler_flag(-fno-exceptions HAVE_FNO_EXCEPTIONS_FLAG) if (HAVE_FNO_EXCEPTIONS_FLAG) add_library(noexception-test ../fmt/format.cc) + target_include_directories(noexception-test PRIVATE ${PROJECT_SOURCE_DIR}) target_compile_options(noexception-test PRIVATE -fno-exceptions) endif () @@ -116,6 +117,7 @@ if (FMT_PEDANTIC) # Test that the library compiles without windows.h. if (CMAKE_SYSTEM_NAME STREQUAL "Windows") add_library(no-windows-h-test ../fmt/format.cc) + target_include_directories(no-windows-h-test PRIVATE ${PROJECT_SOURCE_DIR}) target_compile_definitions(no-windows-h-test PRIVATE FMT_USE_WINDOWS_H=0) endif ()