[solved] qmake und irritierendes exists()

Alles rund um die Programmierung mit Qt
Antworten
Vrenn
Beiträge: 28
Registriert: 17. Oktober 2005 10:16

[solved] qmake und irritierendes exists()

Beitrag von Vrenn »

Hallo

Ich versuche mein qt-Projekt für debian und andere Linuxe gleichermaßen zu programmieren. allerdings verwendet debian eine ältere Bibliothek weshalb ich dafür eine Linkeroption streichen muss.
Versucht habe ich es im Projectfile zu lösen:

Code: Alles auswählen

 #check dcmtk-libs lower than 3.6.0 without -loflog
 !exists( /usr/include/dcmtk/oflog/oflog.h )
 {
  message( "Not found oflog-lib in usual path, testing second" )
  !exists( ../../binary/include/dcmtk/oflog/oflog.h )
  {
   message( "Not found oflog-lib in private path, assume dcmtk <=3.6.0" )
    LIBS -= -loflog   #this does work, but it shouldn't
  }
 }
Auf meinem Testsystem sollte erste Abfrage zustimmen, leider tuts die zweite auch. Dementsprechend weiß ich überhaut nicht mehr, ob ich die Funktion richtig anwende:

Code: Alles auswählen

bash ~/develop/cpp/dicomclient/cvs_sandbox/ourdicom $ qmake
Project MESSAGE: Not found oflog-lib in usual path, testing second
Project MESSAGE: Not found oflog-lib in private path, assume dcmtk <=3.6.0
bash ~/develop/cpp/dicomclient/cvs_sandbox/ourdicom $ ls /usr/include/dcmtk/oflog/oflog.h
ls: Zugriff auf /usr/include/dcmtk/oflog/oflog.h nicht möglich: Datei oder Verzeichnis nicht gefunden
bash ~/develop/cpp/dicomclient/cvs_sandbox/ourdicom $ ls ../../binary/include/dcmtk/oflog/oflog.h
../../binary/include/dcmtk/oflog/oflog.h
bash ~/develop/cpp/dicomclient/cvs_sandbox/ourdicom $ 
Weiß jemand Rat?
Vielen Dank für jede Antwort.
Zuletzt geändert von Vrenn am 15. Januar 2011 16:57, insgesamt 1-mal geändert.
padreigh
Beiträge: 340
Registriert: 13. Mai 2010 10:06

Beitrag von padreigh »

Ich hatte auch schon Probleme beim Einbinden von Libs mit relativen Pfaden. Gib mal testweise einen absoluten Pfad bei dem 2. Test ein. Wenn das tut, musst du basteln:

Code: Alles auswählen

INCLUDE_DIR_OFLOG = $${_PRO_FILE_PWD_}/../../binary/include/dcmtk/oflog/oflog.h
!exists($$INCLUDE_DIR_OFLOG) 
oder so ähnlich ... ansonsten schmeisst mir google (qmake exists) das hier raus:

http://www.qtcentre.org/threads/17761-q ... 9-function
Patrick (QtCreator 1.3.1, Qt 4.6.3)
---
template = subdirs
Vrenn
Beiträge: 28
Registriert: 17. Oktober 2005 10:16

Beitrag von Vrenn »

Habe tagelang gesucht, aber du hast recht, der Zeilenfehler wars.
Vielen Dank!
Antworten