aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-03-28 18:38:47 -0700
committerJosh Blum <josh@joshknows.com>2011-03-28 18:38:47 -0700
commit834bcbad6e632d872a5867801b2e4a5c9a5f95cd (patch)
tree06beaea913c277de4cb69a36904d18f3f4537ed5 /host
parent2ce39c4de5f98cb51eeb6498c6c3d23c873d0ebc (diff)
downloaduhd-834bcbad6e632d872a5867801b2e4a5c9a5f95cd.tar.gz
uhd-834bcbad6e632d872a5867801b2e4a5c9a5f95cd.tar.bz2
uhd-834bcbad6e632d872a5867801b2e4a5c9a5f95cd.zip
uhd: set LIB_SUFFIX automatically (all 64-bit redhats)
Check for and define DEBIAN and REDHAT detection vars. Added LIB_SUFFIX check in top level cmakelists. Use CMAKE_SYSTEM_PROCESSOR rather than exec uname -m. Cleans up release mode logic.
Diffstat (limited to 'host')
-rw-r--r--host/CMakeLists.txt4
-rw-r--r--host/Modules/UHDPackage.cmake35
2 files changed, 22 insertions, 17 deletions
diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
index 8516da401..db100129f 100644
--- a/host/CMakeLists.txt
+++ b/host/CMakeLists.txt
@@ -33,6 +33,10 @@ INCLUDE(UHDPackage) #setup cpack
########################################################################
# Install Dirs
########################################################################
+#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$")
+ SET(LIB_SUFFIX 64)
+ENDIF()
SET(LIB_SUFFIX ${LIB_SUFFIX} CACHE STRING "lib directory suffix")
SET(RUNTIME_DIR bin)
SET(LIBRARY_DIR lib${LIB_SUFFIX})
diff --git a/host/Modules/UHDPackage.cmake b/host/Modules/UHDPackage.cmake
index 1bae55b4c..ef1a82c9a 100644
--- a/host/Modules/UHDPackage.cmake
+++ b/host/Modules/UHDPackage.cmake
@@ -19,6 +19,17 @@
INCLUDE(UHDVersion) #sets version information
########################################################################
+# Setup additional defines for OS types
+########################################################################
+IF(UNIX AND EXISTS "/etc/debian_version")
+ SET(DEBIAN TRUE)
+ENDIF()
+
+IF(UNIX AND EXISTS "/etc/redhat-release")
+ SET(REDHAT TRUE)
+ENDIF()
+
+########################################################################
# Setup package file name
########################################################################
IF(UHD_RELEASE_MODE)
@@ -28,41 +39,31 @@ IF(UHD_RELEASE_MODE)
SET(CPACK_GENERATOR PackageMaker)
ELSEIF(WIN32)
SET(CPACK_GENERATOR NSIS)
- ELSEIF(UNIX AND EXISTS "/etc/debian_version")
+ ELSEIF(DEBIAN)
SET(CPACK_GENERATOR DEB)
- ELSEIF(UNIX AND EXISTS "/etc/redhat-release")
+ ELSEIF(REDHAT)
SET(CPACK_GENERATOR RPM)
ELSE()
SET(CPACK_GENERATOR TGZ)
ENDIF()
FIND_PROGRAM(LSB_RELEASE_EXECUTABLE lsb_release)
- FIND_PROGRAM(UNAME_EXECUTABLE uname)
- IF(LSB_RELEASE_EXECUTABLE AND UNAME_EXECUTABLE)
+ IF(LSB_RELEASE_EXECUTABLE)
#extract system information by executing the commands
EXECUTE_PROCESS(
COMMAND ${LSB_RELEASE_EXECUTABLE} --short --id
- OUTPUT_VARIABLE _os_name OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE LSB_ID OUTPUT_STRIP_TRAILING_WHITESPACE
)
EXECUTE_PROCESS(
COMMAND ${LSB_RELEASE_EXECUTABLE} --short --release
- OUTPUT_VARIABLE _os_version OUTPUT_STRIP_TRAILING_WHITESPACE
+ OUTPUT_VARIABLE LSB_RELEASE OUTPUT_STRIP_TRAILING_WHITESPACE
)
- EXECUTE_PROCESS(
- COMMAND ${UNAME_EXECUTABLE} --machine
- OUTPUT_VARIABLE _machine OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- #when the library suffix should be 64 (applies to redhat linux family)
- IF(CPACK_GENERATOR STREQUAL RPM AND _machine MATCHES "64$")
- SET(LIB_SUFFIX 64)
- ENDIF()
#set a more sensible package name for this system
- SET(CPACK_PACKAGE_FILE_NAME "UHD-${UHD_VERSION}-${_os_name}-${_os_version}-${_machine}")
+ SET(CPACK_PACKAGE_FILE_NAME "UHD-${UHD_VERSION}-${LSB_ID}-${LSB_RELEASE}-${CMAKE_SYSTEM_PROCESSOR}")
- ENDIF(LSB_RELEASE_EXECUTABLE AND UNAME_EXECUTABLE)
+ ENDIF(LSB_RELEASE_EXECUTABLE)
ENDIF(UHD_RELEASE_MODE)