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)
    project(cmaketest)

    find_package(Qt5Core REQUIRED)

    execute_process(
      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}
      COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generator.py 
${CMAKE_CURRENT_BINARY_DIR}/genoutput 5
    )

    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

 https://github.com/ske-ableton/generated-build-inputs

if that helps.

Thanks,

--
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

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to