Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7554477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:20:47+00:00 2026-05-30T11:20:47+00:00

Here is my problem: I want have my qmake script detect my opencv version

  • 0

Here is my problem:
I want have my qmake script detect my opencv version and save the result in the CONFIG variable. I need the result to have this form : “opencv20″,”opencv21″,”opencv22”,etc.
I know that I can use the system() function to call bash commands and wanted to use something like this :

CONFIG += opencv$$system(pkg-config --modversion opencv | cut -d. -f'1,2' | sed 's/\.//g')

It works fine in my terminal, but qmake gives me “opencv2.” when I try to print the output. The outputs of pkg-config and cut commands alone are correct so I assume the sed call is confusing qmake somehow… any hints ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T11:20:48+00:00Added an answer on May 30, 2026 at 11:20 am

    system() commands are executed in a subshell. That’s why you have to escape your strings:

    CONFIG += opencv$$system(pkg-config --modversion opencv | cut -d . -f \'1,2\' | sed \'s/\.//g\')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my Problem, I want to pass the integer 1 when this canvas
I have a problem here. My Zend_Forms do not render in view script. Via
Here is the problem : I want to split a string to have the
here's my problem. I have this piece of code that sets the user location
So here is my problem. I want to redirect name.domain.com/trips/1 to domain.com?username=name&trip=1 using modrewrite.
So here is my problem. I want to store 2-tuple (key, val) and want
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
I'm having a strange problem here... I have an ASP.NET 3.5 application that has
Here's my problem: Lets say I have two dictionaries, dict_a and dict_b. Each of
Here's my problem: I want to hide content behind a button, then when the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.