summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindUSB.cmake28
-rw-r--r--cmake/Modules/GrMiscUtils.cmake25
-rw-r--r--cmake/Modules/GrPackage.cmake8
-rw-r--r--cmake/Modules/GrPlatform.cmake10
-rwxr-xr-xcmake/Packaging/preinst.in2
5 files changed, 70 insertions, 3 deletions
diff --git a/cmake/Modules/FindUSB.cmake b/cmake/Modules/FindUSB.cmake
new file mode 100644
index 000000000..97f3db675
--- /dev/null
+++ b/cmake/Modules/FindUSB.cmake
@@ -0,0 +1,28 @@
+if(NOT LIBUSB_FOUND)
+ pkg_check_modules (LIBUSB_PKG libusb-1.0)
+ find_path(LIBUSB_INCLUDE_DIR NAMES libusb.h
+ PATHS
+ ${LIBUSB_PKG_INCLUDE_DIRS}
+ /usr/include/libusb-1.0
+ /usr/include
+ /usr/local/include
+ )
+
+ find_library(LIBUSB_LIBRARIES NAMES usb-1.0
+ PATHS
+ ${LIBUSB_PKG_LIBRARY_DIRS}
+ /usr/lib
+ /usr/local/lib
+ )
+
+if(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+ set(LIBUSB_FOUND TRUE CACHE INTERNAL "libusb-1.0 found")
+ message(STATUS "Found libusb-1.0: ${LIBUSB_INCLUDE_DIR}, ${LIBUSB_LIBRARIES}")
+else(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+ set(LIBUSB_FOUND FALSE CACHE INTERNAL "libusb-1.0 found")
+ message(STATUS "libusb-1.0 not found.")
+endif(LIBUSB_INCLUDE_DIR AND LIBUSB_LIBRARIES)
+
+mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARIES)
+
+endif(NOT LIBUSB_FOUND)
diff --git a/cmake/Modules/GrMiscUtils.cmake b/cmake/Modules/GrMiscUtils.cmake
index 27003cf59..7b0c00272 100644
--- a/cmake/Modules/GrMiscUtils.cmake
+++ b/cmake/Modules/GrMiscUtils.cmake
@@ -208,3 +208,28 @@ function(GR_GEN_TARGET_DEPS name var)
set(${var} "DEPENDS;${name};COMMAND;${name}" PARENT_SCOPE)
endif()
endfunction(GR_GEN_TARGET_DEPS)
+
+
+########################################################################
+# Control availability of vmcircbuf methods.
+# For now, only allows disabling of shm methods, which cause uncatchable
+# segmentation faults on Cygwin with gcc 4.x (x <= 5)
+# Usage:
+# GR_VMCIRCBUF()
+#
+# Will set TRY_SHM_VMCIRCBUF to 1 by default except on Windows machines.
+# Can manually set with -DTRY_SHM_VMCIRCBUF=0|1
+########################################################################
+function(GR_VMCIRCBUF)
+ if(WIN32)
+ OPTION(TRY_SHM_VMCIRCBUF "Try SHM VMCIRCBUF" OFF)
+ else(WIN32)
+ OPTION(TRY_SHM_VMCIRCBUF "Try SHM VMCIRCBUF" ON)
+ endif(WIN32)
+
+ message(STATUS "TRY_SHM_VMCIRCBUF set to ${TRY_SHM_VMCIRCBUF}.")
+
+ if(TRY_SHM_VMCIRCBUF)
+ add_definitions( -DTRY_SHM_VMCIRCBUF )
+ endif(TRY_SHM_VMCIRCBUF)
+endfunction(GR_VMCIRCBUF)
diff --git a/cmake/Modules/GrPackage.cmake b/cmake/Modules/GrPackage.cmake
index 3aca79632..2d2dfa531 100644
--- a/cmake/Modules/GrPackage.cmake
+++ b/cmake/Modules/GrPackage.cmake
@@ -134,7 +134,13 @@ if((DEBIAN OR REDHAT) AND LSB_RELEASE_EXECUTABLE)
endif()
if(${CPACK_GENERATOR} STREQUAL NSIS)
- set(CPACK_PACKAGE_FILE_NAME "gnuradio_${CPACK_PACKAGE_VERSION}_win32")
+
+ ENABLE_LANGUAGE(C)
+
+ include(CheckTypeSize)
+ check_type_size("void*[8]" BIT_WIDTH BUILTIN_TYPES_ONLY)
+ SET(CPACK_PACKAGE_FILE_NAME "gnuradio_${CPACK_PACKAGE_VERSION}_Win${BIT_WIDTH}")
+
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
endif()
diff --git a/cmake/Modules/GrPlatform.cmake b/cmake/Modules/GrPlatform.cmake
index ce2e15fef..dde65cee5 100644
--- a/cmake/Modules/GrPlatform.cmake
+++ b/cmake/Modules/GrPlatform.cmake
@@ -37,10 +37,18 @@ if(LINUX AND EXISTS "/etc/redhat-release")
set(REDHAT TRUE)
endif()
+if(LINUX AND EXISTS "/etc/slackware-version")
+ set(SLACKWARE TRUE)
+endif()
+
########################################################################
# when the library suffix should be 64 (applies to redhat linux family)
########################################################################
-if(NOT DEFINED LIB_SUFFIX AND REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
+if (REDHAT OR SLACKWARE)
+ set(LIB64_CONVENTION TRUE)
+endif()
+
+if(NOT DEFINED LIB_SUFFIX AND LIB64_CONVENTION AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
set(LIB_SUFFIX 64)
endif()
set(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
diff --git a/cmake/Packaging/preinst.in b/cmake/Packaging/preinst.in
index c60d46568..cb7ee1bc4 100755
--- a/cmake/Packaging/preinst.in
+++ b/cmake/Packaging/preinst.in
@@ -1,5 +1,5 @@
#!/bin/sh
if [ "$1" = "install" ]; then
- ls
+ echo
fi