Browse Source

Fixes out-of-source builds and minor build issues

Suren A. Chilingaryan 8 years ago
parent
commit
4535ac71e0
17 changed files with 42 additions and 20 deletions
  1. 22 20
      CMakeLists.txt
  2. 1 0
      apps/pio_test.c
  3. 1 0
      apps/xilinx.c
  4. 2 0
      dma/CMakeLists.txt
  5. 1 0
      dma/ipe.c
  6. 1 0
      dma/ipe_benchmark.c
  7. 1 0
      dma/nwl.c
  8. 1 0
      dma/nwl_engine.c
  9. 1 0
      dma/nwl_loopback.c
  10. 2 0
      pcilib/CMakeLists.txt
  11. 1 0
      pcilib/bar.c
  12. 1 0
      pcilib/error.c
  13. 1 0
      pcilib/fifo.c
  14. 1 0
      pcilib/pci.c
  15. 2 0
      pcitool/CMakeLists.txt
  16. 1 0
      pcitool/cli.c
  17. 2 0
      protocols/CMakeLists.txt

+ 22 - 20
CMakeLists.txt

@@ -9,6 +9,28 @@ set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
 
 #list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
 
+if(NOT DEFINED BIN_INSTALL_DIR)
+    set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif(NOT DEFINED BIN_INSTALL_DIR)
+
+if(NOT DEFINED LIB_INSTALL_DIR)
+    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+endif(NOT DEFINED LIB_INSTALL_DIR)
+
+if(NOT DEFINED INCLUDE_INSTALL_DIR)
+    set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
+endif(NOT DEFINED INCLUDE_INSTALL_DIR)
+
+if(NOT DEFINED DATA_INSTALL_DIR)
+    set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
+endif(NOT DEFINED DATA_INSTALL_DIR)
+
+if(NOT DEFINED LOCALE_INSTALL_DIR)
+    set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale")
+endif(NOT DEFINED LOCALE_INSTALL_DIR)
+
+SET(ENV{PKG_CONFIG_PATH} "${LIB_INSTALL_DIR}/pkgconfig:$ENV{PKG_CONFIG_PATH}")
+
 find_package(PkgConfig REQUIRED)
 find_package(Threads REQUIRED)
 
@@ -45,26 +67,6 @@ set(PACKAGE_TARNAME "${TARNAME}")
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_BUGREPORT "http://ufo.kit.edu/ufo/newticket")
 
-if(NOT DEFINED BIN_INSTALL_DIR)
-    set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
-endif(NOT DEFINED BIN_INSTALL_DIR)
-
-if(NOT DEFINED LIB_INSTALL_DIR)
-    set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib")
-endif(NOT DEFINED LIB_INSTALL_DIR)
-
-if(NOT DEFINED INCLUDE_INSTALL_DIR)
-    set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")
-endif(NOT DEFINED INCLUDE_INSTALL_DIR)
-
-if(NOT DEFINED DATA_INSTALL_DIR)
-    set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share")
-endif(NOT DEFINED DATA_INSTALL_DIR)
-
-if(NOT DEFINED LOCALE_INSTALL_DIR)
-    set(LOCALE_INSTALL_DIR "${DATA_INSTALL_DIR}/locale")
-endif(NOT DEFINED LOCALE_INSTALL_DIR)
-
 set(PCILIB_PLUGIN_DIR "${LIB_INSTALL_DIR}/pcilib" CACHE PATH "Directory to install plugins")
 set(PCILIB_DATA_DIR "${DATA_INSTALL_DIR}/pcilib" CACHE PATH "Directory to install data files")
 set(PCILIB_MODEL_DIR "${PCILIB_DATA_DIR}/models" CACHE PATH "Directory to install XML models")

+ 1 - 0
apps/pio_test.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 199309L
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
apps/xilinx.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 199309L
 #include <stdio.h>
 #include <stdlib.h>

+ 2 - 0
dma/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
 )
 
 set(HEADERS ${HEADERS} nwl.h nwl_private.h nwl_engine.h nwl_irq.h nwl_loopback.h ipe.h ipe_private.h)

+ 1 - 0
dma/ipe.c

@@ -1,5 +1,6 @@
 #define _PCILIB_DMA_IPE_C
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
dma/ipe_benchmark.c

@@ -1,5 +1,6 @@
 #define _PCILIB_DMA_IPE_C
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
dma/nwl.c

@@ -1,5 +1,6 @@
 #define _PCILIB_DMA_NWL_C
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _GNU_SOURCE
 
 #include <stdio.h>

+ 1 - 0
dma/nwl_engine.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
dma/nwl_loopback.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

+ 2 - 0
pcilib/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
 )
 
 set(HEADERS pcilib.h pci.h export.h bar.h fifo.h model.h bank.h register.h kmem.h irq.h locking.h lock.h dma.h event.h plugin.h tools.h error.h debug.h env.h version.h config.h)

+ 1 - 0
pcilib/bar.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>

+ 1 - 0
pcilib/error.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 1 - 0
pcilib/fifo.c

@@ -1,4 +1,5 @@
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>

+ 1 - 0
pcilib/pci.c

@@ -1,6 +1,7 @@
 //#define PCILIB_FILE_IO
 #define _XOPEN_SOURCE 700
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 #define _POSIX_C_SOURCE 200809L
 
 #include <stdio.h>

+ 2 - 0
pcitool/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
     ${FASTWRITER_INCLUDE_DIRS}
 )
 

+ 1 - 0
pcitool/cli.c

@@ -1,6 +1,7 @@
 #define _XOPEN_SOURCE 700
 #define _POSIX_C_SOURCE 200112L
 #define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <stdio.h>
 #include <stdlib.h>

+ 2 - 0
protocols/CMakeLists.txt

@@ -1,6 +1,8 @@
 include_directories(
     ${CMAKE_SOURCE_DIR}
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_SOURCE_DIR}/pcilib
+    ${CMAKE_BINARY_DIR}/pcilib
 )
 
 set(HEADERS ${HEADERS} default.h software.h)