Re: [Interest] How to use Qt6::qmake ?

2021-02-03 Thread Joerg Bornemann

On 1/19/21 5:40 PM, Thiago Macieira wrote:


On Monday, 18 January 2021 19:13:08 PST Nicholas Yue wrote:

For the Qt5 cmake configuration, the setting of the path to the actual
qmake binary whereas in the Qt6 variant, is looks like a generic import
location not tied to qmake specifically. I am wondering if that is the
reason why trying to use Qt6::qmake results it not working because it was
not setup to an actual binary file location.


Please report the issue.

Because of Qt 6's switch to using CMake, there are a number of compatibility
issues with the generated .cmake files (as well as files for qmake and
possibly pkg-config) that weren't noticed during testing.


In this case, howeever, there's no bug. Copying my answer from 
QTBUG-90458 here as well:


execute_process does not take a target, unlike add_custom_target what 
Kai already suggested. I double-checked that Qt6::qmake is set up 
correctly, and the following working snippet proves its correctness:


---snip---
find_package(Qt6 COMPONENTS Core REQUIRED)
get_target_property(qmake_location Qt6::qmake LOCATION)
message("-- qmake location: ${qmake_location}")
message("-- calling qmake")
execute_process(COMMAND "${qmake_location}" -query
RESULT_VARIABLE exit_code
)
message("-- qmake returned with exit code '${exit_code}'")
---snap---


Cheers,

Joerg
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to use Qt6::qmake ?

2021-01-19 Thread Thiago Macieira
On Monday, 18 January 2021 19:13:08 PST Nicholas Yue wrote:
> For the Qt5 cmake configuration, the setting of the path to the actual
> qmake binary whereas in the Qt6 variant, is looks like a generic import
> location not tied to qmake specifically. I am wondering if that is the
> reason why trying to use Qt6::qmake results it not working because it was
> not setup to an actual binary file location.

Please report the issue.

Because of Qt 6's switch to using CMake, there are a number of compatibility 
issues with the generated .cmake files (as well as files for qmake and 
possibly pkg-config) that weren't noticed during testing.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to use Qt6::qmake ?

2021-01-18 Thread Nicholas Yue
Thanks Marius for gist, I am afraid it is unlikely to work out for me as it
still refers to QT_QMAKE_TARGET which is set to Qt6::qmake

In the cmake files ship with *Qt5* I see this (in Qt5CoreConfigExtras.cmake)

if (NOT TARGET Qt5::qmake)
add_executable(Qt5::qmake IMPORTED)

set(imported_location "${_qt5Core_install_prefix}/bin/qmake")
_qt5_Core_check_file_exists(${imported_location})

set_target_properties(Qt5::qmake PROPERTIES
IMPORTED_LOCATION ${imported_location}
)
endif()

In the cmake files ship with *Qt6* I see this
(in Qt6CoreToolsAdditionalTargetInfo.cmake)

# Default configuration


if(_qt_imported_location_default)
set_property(TARGET Qt6::qmake PROPERTY IMPORTED_LOCATION
"${_qt_imported_location_default}")
endif()

For the Qt5 cmake configuration, the setting of the path to the actual
qmake binary whereas in the Qt6 variant, is looks like a generic import
location not tied to qmake specifically. I am wondering if that is the
reason why trying to use Qt6::qmake results it not working because it was
not setup to an actual binary file location.

Cheers

On Mon, 18 Jan 2021 at 15:24, Marius Kittler  wrote:

> Hi,
>
> Qt's CMake modules should already make most paths available. I came up
> with
> the following approach to support Qt 5 and Qt 6:
> https://github.com/Martchus/
> qtutilities/blob/5960c215586cf0ca777a511c6f0830c1c63ddaa8/cmake/modules/
> QtLinkage.cmake#L124
> 
>
> It works at least for QT_INSTALL_TRANSLATIONS. Maybe it needed to be
> tweaked
> for other variables.
>
> This function also shows how to get the location of the qmake binary if
> you
> really need it after all.
>
> I'd also suggest to use the CMake modules Qt provides for using Linguist.
> This
> has already worked with Qt 5 and continues to work with Qt 6. When cross-
> compiling you currently need a workaround, though: https://github.com/
> Martchus/qtutilities/blob/5960c215586cf0ca777a511c6f0830c1c63ddaa8/cmake/
> modules/QtConfig.cmake#L303
> 
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
>


-- 
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to use Qt6::qmake ?

2021-01-18 Thread Marius Kittler
Hi,

Qt's CMake modules should already make most paths available. I came up with 
the following approach to support Qt 5 and Qt 6: https://github.com/Martchus/
qtutilities/blob/5960c215586cf0ca777a511c6f0830c1c63ddaa8/cmake/modules/
QtLinkage.cmake#L124

It works at least for QT_INSTALL_TRANSLATIONS. Maybe it needed to be tweaked 
for other variables.

This function also shows how to get the location of the qmake binary if you 
really need it after all.

I'd also suggest to use the CMake modules Qt provides for using Linguist. This 
has already worked with Qt 5 and continues to work with Qt 6. When cross-
compiling you currently need a workaround, though: https://github.com/
Martchus/qtutilities/blob/5960c215586cf0ca777a511c6f0830c1c63ddaa8/cmake/
modules/QtConfig.cmake#L303


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to use Qt6::qmake ?

2021-01-18 Thread Nicholas Yue
I would like to run it at configure time because I need to extract the
relevant paths from the query command which I need as part of fixup_bundle
and language processing (Linguist)

cmake_minimum_required(VERSION 3.19)

project(Qt6Tutorial)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)

find_package(Qt6 COMPONENTS CoreTools UiTools LinguistTools Widgets OpenGL
OpenGLWidgets REQUIRED CONFIG)

set(some_file ${CMAKE_CURRENT_BINARY_DIR}/output.txt)
execute_process(COMMAND ${QT_CMAKE_EXPORT_NAMESPACE}::qmake -query
  OUTPUT_FILE ${some_file}
  )
#execute_process(COMMAND ls /tmp


#  OUTPUT_FILE ${some_file}


#  )

It seems that commands like `ls` works but not qmake

Cheers

On Mon, 18 Jan 2021 at 01:35, Kai Köhne  wrote:

> Hi,
>
>
>
> execute_process is done at CMake configure time. You should be able to use
> Qt6::qmake target if you use add_custom_command.
>
>
>
> Regards
>
>
>
> Kai
>
>
>
> *From:* Interest  *On Behalf Of *Nicholas
> Yue
> *Sent:* Monday, January 18, 2021 6:02 AM
> *To:* interest@qt-project.org
> *Subject:* [Interest] How to use Qt6::qmake ?
>
>
>
> Hi,
>
>
>
>   I would like to use qmake within a CMake build with the following
>
>
>
> find_package(Qt6 COMPONENTS CoreTools UiTools LinguistTools Widgets OpenGL
> OpenGLWidgets REQUIRED CONFIG)
>
>
>
> execute_process(Qt6::qmake
>   OUTPUT_VARIABLE
>   qmake_stdout
>   )
>
>
>
>   How ever, the following reports that Qt6::qmake is not found
>
>
>
>   execute_process given unknown argument "Qt6::qmake".
>
>
>
> Cheers
>
>
>


-- 
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] How to use Qt6::qmake ?

2021-01-18 Thread Kai Köhne
Hi,

execute_process is done at CMake configure time. You should be able to use 
Qt6::qmake target if you use add_custom_command.

Regards

Kai

From: Interest  On Behalf Of Nicholas Yue
Sent: Monday, January 18, 2021 6:02 AM
To: interest@qt-project.org
Subject: [Interest] How to use Qt6::qmake ?

Hi,

  I would like to use qmake within a CMake build with the following

find_package(Qt6 COMPONENTS CoreTools UiTools LinguistTools Widgets OpenGL 
OpenGLWidgets REQUIRED CONFIG)

execute_process(Qt6::qmake
  OUTPUT_VARIABLE
  qmake_stdout
  )

  How ever, the following reports that Qt6::qmake is not found

  execute_process given unknown argument "Qt6::qmake".

Cheers

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] How to use Qt6::qmake ?

2021-01-17 Thread Nicholas Yue
Hi,

  I would like to use qmake within a CMake build with the following

find_package(Qt6 COMPONENTS CoreTools UiTools LinguistTools Widgets OpenGL
OpenGLWidgets REQUIRED CONFIG)

execute_process(Qt6::qmake
  OUTPUT_VARIABLE
  qmake_stdout
  )

  How ever, the following reports that Qt6::qmake is not found

  execute_process given unknown argument "Qt6::qmake".

Cheers
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest