]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Resolve the problem of list.h that compiling error
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 27 Jan 2009 08:41:00 +0000 (03:41 -0500)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Tue, 27 Jan 2009 08:41:00 +0000 (03:41 -0500)
(compiler can't find list.h) occured when using
cmake and an "out-of-source" build.

SVN-Revision: 496

CMakeLists.txt
cpio/test/main.c
libarchive/test/main.c
tar/test/main.c

index 5f4c8788dac2ecf84be1ce4072f0aeeee69499bd..a6c331abb744502f5659484bc65fadccf958b7e8 100644 (file)
@@ -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
index 379968b1e1b525fe760743b2c2011eb91ed8ae18..a418c6d49fbe18c35e609e05e0cafa4abb25c63f 100644 (file)
@@ -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
 };
 
 /*
index 2f1e49565dab7301d09f9ca79f1faa09f242afbd..badbea86ae425e92c768a8dfe645fc1f560a1bd6 100644 (file)
@@ -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
index c588c538a24cd8b69dfa36bd6073c35930b51470..fc0f45be377e951356f60e2ea53c3c9f8acb5f11 100644 (file)
@@ -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
 };
 
 /*