[Development] Notes on "Qt Build Systems" @ QtCon 2016

Stephen Kelly stephen.kelly at ableton.com
Fri Sep 9 12:58:36 CEST 2016

On 08/09/16 14:34, Christian Kandeler wrote:
> On 09/08/2016 02:03 PM, Bo Thorsen wrote:
>> Ok, go try it. Create a simple python or perl script that reads a file.
>> The file just has a single number N inside it. And based on N the script
>> outputs those files:

Here's the CMake version:

     cmake_minimum_required(VERSION 3.5.0)

     find_package(Qt5Core REQUIRED)

       COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/generator.py --list ${CMAKE_CURRENT_BINARY_DIR}/genoutput 5
       OUTPUT_VARIABLE fileList

     string(REPLACE "\n" ";" fileList ${fileList})

     add_custom_command(OUTPUT ${fileList}

     qt5_wrap_cpp(moc_files ${fileList})

     add_executable(servertest servertest.cpp ${fileList} ${moc_files})
     target_link_libraries(servertest Qt5::Core)
     target_include_directories(servertest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/genoutput)

However, it is cheating in the same way that the QBS version from
Christian is cheating - it assumes '--list' exists:

> In qbs:
>      outputArtifacts: {
>          var p = new Process();
>          try {
>              p.exec("path_to_script", ["--list", input.filePath]);
>              var files = p.readStdout.split("\n");

Christian, can you create a version which does not require --list? As 
far as I understand, that is the point of the QBS dynamic build graph. I 
would like to make sure my understanding is correct. You can find my code at


if that helps.


Ableton AG, Schoenhauser Allee 6-7, 10119 Berlin, Germany
Management Board: Gerhard Behles, Jan Bohl
Chair of the Supervisory Board: Uwe Struck
Registered Office: Berlin, Amtsgericht Berlin-Charlottenburg, HRB 72838

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20160909/b3037e53/attachment.html>

More information about the Development mailing list