Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't go crazy trying to find the pkg-config file if pkg-config alrea…

…dy knows about it
  • Loading branch information...
commit 0e343302c0a142bd4136b8057d7c9cb9591688c0 1 parent 6268fb6
@scotchi scotchi authored
Showing with 27 additions and 23 deletions.
  1. +27 −23 Ruby/extconf.rb
View
50 Ruby/extconf.rb
@@ -5,35 +5,39 @@
$LIBS << " -lcurl"
-qmake_path = `which qmake`.chomp
+if system("pkg-config QtNetwork")
+ pkg_config("QtNetwork")
+else
+ qmake_path = `which qmake`.chomp
-if qmake_path.empty?
- warn "********************************************************************************"
- warn 'Cannot find qmake (should be installed with Qt development packages)'
- warn "********************************************************************************"
- exit
-end
+ if qmake_path.empty?
+ warn "********************************************************************************"
+ warn 'Cannot find qmake (should be installed with Qt development packages)'
+ warn "********************************************************************************"
+ exit
+ end
-qmake_path = Pathname.new(qmake_path).realpath
-qt_path = qmake_path.sub(/\/bin\/qmake.*$/, '')
+ qmake_path = Pathname.new(qmake_path).realpath
+ qt_path = qmake_path.sub(/\/bin\/qmake.*$/, '')
-if ENV['PKG_CONFIG_PATH']
- ENV['PKG_CONFIG_PATH'] += ":#{qt_path}/lib/pkgconfig"
-else
- ENV['PKG_CONFIG_PATH'] = "#{qt_path}/lib/pkgconfig"
-end
+ if ENV['PKG_CONFIG_PATH']
+ ENV['PKG_CONFIG_PATH'] += ":#{qt_path}/lib/pkgconfig"
+ else
+ ENV['PKG_CONFIG_PATH'] = "#{qt_path}/lib/pkgconfig"
+ end
-pc = "#{qt_path}/lib64/pkgconfig/QtNetwork.pc"
+ pc = "#{qt_path}/lib64/pkgconfig/QtNetwork.pc"
-if !File.exists? pc
- pc = "#{qt_path}/lib/pkgconfig/QtNetwork.pc"
-end
+ if !File.exists? pc
+ pc = "#{qt_path}/lib/pkgconfig/QtNetwork.pc"
+ end
-if !File.exists? pc
- warn "Could not find QtNetwork.pc"
- exit 1
-end
+ if !File.exists? pc
+ warn "Could not find QtNetwork.pc"
+ exit 1
+ end
-pkg_config(pc)
+ pkg_config(pc)
+end
create_makefile("QAR")
Please sign in to comment.
Something went wrong with that request. Please try again.