From: Michihiro NAKAJIMA Date: Tue, 27 Jan 2009 08:41:00 +0000 (-0500) Subject: Resolve the problem of list.h that compiling error X-Git-Tag: v2.7.0~397 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f34cab9fc6ccfcffd3fa2fe6c7177d7c8a4d6387;p=thirdparty%2Flibarchive.git Resolve the problem of list.h that compiling error (compiler can't find list.h) occured when using cmake and an "out-of-source" build. SVN-Revision: 496 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f4c8788d..a6c331abb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -635,6 +635,8 @@ IF(ENABLE_TEST) TARGET_LINK_LIBRARIES(libarchive_test ${ADDITIONAL_LIBS}) SET_PROPERTY(TARGET libarchive_test PROPERTY COMPILE_DEFINITIONS LIBARCHIVE_STATIC) + SET_PROPERTY(TARGET libarchive_test APPEND PROPERTY COMPILE_DEFINITIONS + LIST_H="${CMAKE_CURRENT_BINARY_DIR}/libarchive/test/list.h") ADD_TEST(libarchive_test libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR}/libarchive/test) ENDIF(ENABLE_TEST) @@ -705,6 +707,8 @@ IF(ENABLE_TAR AND ENABLE_TEST) # Register target # ADD_EXECUTABLE(bsdtar_test ${bsdtar_test_SOURCES}) + SET_PROPERTY(TARGET bsdtar_test PROPERTY COMPILE_DEFINITIONS + LIST_H="${CMAKE_CURRENT_BINARY_DIR}/tar/test/list.h") ADD_TEST(bsdtar_test bsdtar_test -v -p ${CMAKE_CURRENT_BINARY_DIR}/bsdtar @@ -778,6 +782,8 @@ IF(ENABLE_CPIO AND ENABLE_TEST) GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/cpio/test/list.h ${bsdcpio_test_SOURCES}) ADD_EXECUTABLE(bsdcpio_test ${bsdcpio_test_SOURCES}) + SET_PROPERTY(TARGET bsdcpio_test PROPERTY COMPILE_DEFINITIONS + LIST_H="${CMAKE_CURRENT_BINARY_DIR}/cpio/test/list.h") ADD_TEST(bsdcpio_test bsdcpio_test -v -p ${CMAKE_CURRENT_BINARY_DIR}/bsdcpio diff --git a/cpio/test/main.c b/cpio/test/main.c index 379968b1e..a418c6d49 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -56,7 +56,11 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kient */ #undef DEFINE_TEST #define DEFINE_TEST(name) void name(void); +#ifdef LIST_H +#include LIST_H +#else #include "list.h" +#endif /* Interix doesn't define these in a standard header. */ #if __INTERIX__ @@ -699,7 +703,11 @@ slurpfile(size_t * sizep, const char *fmt, ...) #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n }, struct { void (*func)(void); const char *name; } tests[] = { +#ifdef LIST_H + #include LIST_H +#else #include "list.h" +#endif }; /* diff --git a/libarchive/test/main.c b/libarchive/test/main.c index 2f1e49565..badbea86a 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -62,7 +62,11 @@ __FBSDID("$FreeBSD: src/lib/libarchive/test/main.c,v 1.17 2008/12/21 00:13:50 ki */ #undef DEFINE_TEST #define DEFINE_TEST(name) void name(void); +#ifdef LIST_H +#include LIST_H +#else #include "list.h" +#endif /* Interix doesn't define these in a standard header. */ #if __INTERIX__ @@ -718,7 +722,11 @@ slurpfile(size_t * sizep, const char *fmt, ...) #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n }, struct { void (*func)(void); const char *name; } tests[] = { +#ifdef LIST_H + #include LIST_H +#else #include "list.h" +#endif }; static void diff --git a/tar/test/main.c b/tar/test/main.c index c588c538a..fc0f45be3 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -56,7 +56,11 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientz */ #undef DEFINE_TEST #define DEFINE_TEST(name) void name(void); +#ifdef LIST_H +#include LIST_H +#else #include "list.h" +#endif /* Interix doesn't define these in a standard header. */ #if __INTERIX__ @@ -743,7 +747,11 @@ slurpfile(size_t * sizep, const char *fmt, ...) #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n }, struct { void (*func)(void); const char *name; } tests[] = { +#ifdef LIST_H + #include LIST_H +#else #include "list.h" +#endif }; /*