From 2975069a9138cbaccc94ba6bf982c777b89d54b6 Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Fri, 18 Dec 2015 15:14:21 +0000 Subject: [PATCH] helper script for symlinks --- Builds/create-symlinks.sh | 38 ++++++++++++++++++++++++++++++++++++++ main.pro | 12 +----------- 2 files changed, 39 insertions(+), 11 deletions(-) create mode 100755 Builds/create-symlinks.sh diff --git a/Builds/create-symlinks.sh b/Builds/create-symlinks.sh new file mode 100755 index 0000000..aa15f27 --- /dev/null +++ b/Builds/create-symlinks.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +if [[ $# -ne 2 ]]; then + echo "Usage: `basename $0` LOCAL_LIB_DIR LOCAL_INCLUDE_DIR" + exit 2 +fi + +LOCAL_LIB_DIR="$1" +LOCAL_INCLUDE_DIR="$2" + +if [[ ! -d $LOCAL_LIB_DIR ]]; then + mkdir -p "$LOCAL_LIB_DIR" +fi + +if [[ ! -d $LOCAL_INCLUDE_DIR ]]; then + mkdir -p "$LOCAL_INCLUDE_DIR" +fi + +targetpath="/usr/lib/x86_64-linux-gnu/libOpenCL.so.1" +linkpath="$LOCAL_LIB_DIR/libOpenCL.so" + +if [[ ! -e $linkpath && -e $targetpath ]]; then + ln -s "$targetpath" "$linkpath" +fi + +targetpath=$(ls -d1 /usr/include/*/GL | head -n 1) +linkpath="$LOCAL_INCLUDE_DIR/GL" + +if [[ ! -e $linkpath && -e $targetpath ]]; then + ln -s "$targetpath" "$linkpath" +fi + +targetpath=$(ls -d1 /usr/include/*/CL | head -n 1) +linkpath="$LOCAL_INCLUDE_DIR/CL" + +if [[ ! -e $linkpath && -e $targetpath ]]; then + ln -s "$targetpath" "$linkpath" +fi diff --git a/main.pro b/main.pro index 5650e29..77a754a 100644 --- a/main.pro +++ b/main.pro @@ -4,17 +4,7 @@ CONFIG += ordered LOCAL_LIB_DIR = $$(PWD)/Builds/lib LOCAL_INCLUDE_DIR = $$(PWD)/Builds/include -unix { - symlinks.commands = \ - test -d $$LOCAL_LIB_DIR || mkdir -p $$LOCAL_LIB_DIR ; \ - test -d $$LOCAL_INCLUDE_DIR || mkdir -p $$LOCAL_INCLUDE_DIR ; \ - test -e $$LOCAL_LIB_DIR/libOpenCL.so || \ - ln -s /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 $$LOCAL_LIB_DIR/libOpenCL.so ; \ - test -e $$LOCAL_INCLUDE_DIR/GL || \ - ln -s /usr/include/nvidia-352/GL $$LOCAL_INCLUDE_DIR ; \ - test -e $$PWD/include/CL || \ - ln -s /usr/include/nvidia-352/CL $$LOCAL_INCLUDE_DIR ; -} +unix:symlinks.commands = $$(PWD)/Builds/create-symlinks.sh \"$$LOCAL_LIB_DIR\" \"$$LOCAL_INCLUDE_DIR\" SUBDIRS += Builds/QtCreator/Ember Builds/QtCreator/EmberCL Builds/QtCreator/EmberAnimate Builds/QtCreator/EmberGenome Builds/QtCreator/EmberRender Builds/QtCreator/Fractorium