diff options
author | Ken Moore <moorekou@gmail.com> | 2016-01-08 16:54:43 -0500 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2016-01-08 16:54:43 -0500 |
commit | 85d9932824853a4567bf37d6ed2f6d2ab2b6ba05 (patch) | |
tree | 77e8828b83ea3b5da4d33f0e52b7588a882bf600 /OS-detect.pri | |
parent | Setup the dialog to use for file operation errors as the scroll dialog (in ca... (diff) | |
download | lumina-85d9932824853a4567bf37d6ed2f6d2ab2b6ba05.tar.gz lumina-85d9932824853a4567bf37d6ed2f6d2ab2b6ba05.tar.bz2 lumina-85d9932824853a4567bf37d6ed2f6d2ab2b6ba05.zip |
Start the work of abstracting out the OS-detection/build system from the individual projects. Currently used for the library mainly - still working on fleshing it out before switching all the project files to use it.
Diffstat (limited to 'OS-detect.pri')
-rw-r--r-- | OS-detect.pri | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/OS-detect.pri b/OS-detect.pri new file mode 100644 index 00000000..d334476d --- /dev/null +++ b/OS-detect.pri @@ -0,0 +1,50 @@ +# ============================================= +# Subroutine for project files to detect which OS is compiling the project +# Generic variables it sets for internal use: OS, LINUX_DISTRO (if OS=="Linux") +# ============================================= +# Main Build Variables: +# PREFIX: Base install directory (${PREFIX}/[bin/share/etc/include] will be used) +# LIBPREFIX: Base install directory for libraries (usually ${PREFIX}/lib) +# QTLIBDIR: Directory where the Qt libraries are currently installed +# +# ============================================= +# Note: Make sure the OS variable matches the name of a libLumina/LuminaOS-<OS>.cpp file +# ============================================= +!defined(OS){ + message("Build OS Info: $${QMAKE_HOST.os}, $${QMAKE_HOST.arch}, $${QMAKE_HOST.version_string}") + OS=$$QMAKE_HOST.os + + #Setup the default values for build settings (if not explicitly set previously) + !defined(PREFIX){ PREFIX=/usr/local/ } + !defined(LIBPREFIX){ LIBPREFIX=$${PREFIX}/lib } + !defined(QTLIBDIR){ QTLIBDIR=$${LIBPREFIX}/qt5 } + + #Now go through and setup any known OS build settings + # which are different from the defaults + equals(OS, "NetBSD"){ + PREFIX=/usr/local + LIBPREFIX=/usr/local/lib + QTLIBDIR=/usr/local/lib/qt5 + }else:contains(OS, "Linux"){ + OS=Linux + exists(/bin/lsb_release){ + LINUX_DISTRO = $$system(lsb_release -si) + } else:exists(/usr/bin/lsb_release){ + LINUX_DISTRO = $$system(lsb_release -si) + } + + #Now switch through known Linux distro templates + equals(LINUX_DISTRO, "Fedora"){ + PREFIX=/usr/local + LIBPREFIX=/lib64 + QTLIBDIR=/lib/qt5 + + } + + } + MSG="Build Settings Loaded: $${OS}" + equals(OS,"Linux"){ MSG+="-$${LINUX_DISTRO}" } + message( $$MSG ) + #now remove the temporary MSG variable + +}
\ No newline at end of file |