Warning, /network/ruqola/example/python/ruqola-python/cmake/modules/pyslide2uigenerator.cmake is written in an unsupported language. File is not indexed.

0001 #macro (PYSIDE2_UIC_GENERATOR _sources )
0002     #find_program(PYSIDE2-UIC NAMES pyside2-uic)
0003     #if (NOT PYSIDE2-UIC)
0004         #MESSAGE(ERROR "Impossible to find pyside2-uic.")
0005     #endif()
0006     #foreach (_current_FILE ${ARGN})
0007         #get_filename_component(_tmp_FILE ${_current_FILE} ABSOLUTE)
0008         #get_filename_component(_basename ${_tmp_FILE} NAME_WE)
0009 
0010     #MESSAGE(STATUS "ssssssssssss ${_current_FILE} ${PYSIDE2-UIC} ${_tmp_FILE}")
0011         #set(generated_pythonfile ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.py)
0012 
0013         #add_custom_command(OUTPUT ${generated_pythonfile}
0014          #COMMAND ${PYSIDE2-UIC} ${_current_FILE} -o ${generated_pythonfile}
0015          #MAIN_DEPENDENCY ${_tmp_FILE}
0016       #)
0017       #list(APPEND ${_sources} ${generated_pythonfile} )
0018     #endforeach()
0019 #endmacro ()
0020 
0021 
0022     #MACRO(PYSIDE_WRAP_UI outfiles)
0023     #set(UICOPTIONS "--generator=python")
0024         #find_program(PYSIDE2-UIC NAMES pyside2-uic)
0025         #if (NOT PYSIDE2-UIC)
0026             #MESSAGE(ERROR "Impossible to find pyside2-uic.")
0027         #endif()
0028     #FOREACH(it ${ARGN})
0029         #GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
0030         #GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
0031         #SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
0032         #MESSAGE(STATUS "${outfile}")
0033         #ADD_CUSTOM_TARGET(${it} ALL
0034          #DEPENDS ${outfile}
0035         #)
0036         #if(WIN32 OR APPLE)
0037             #ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
0038             #COMMAND ${PYSIDE2UICBINARY} ${UICOPTIONS} ${infile} -o ${outfile}
0039             #MAIN_DEPENDENCY ${infile}
0040             #)
0041         #else()
0042             #Especially on Open Build Service we don't want changing date like
0043             #pyside2-uic generates in comments at beginning., which is why
0044             #we follow the tool command with in-place sed.
0045             #ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
0046             #COMMAND "${PYSIDE2-UIC}" ${UICOPTIONS} "${infile}" -o "${outfile}"
0047             #COMMAND sed -i "/^# /d" "${outfile}"
0048             #MAIN_DEPENDENCY "${infile}"
0049             #)
0050         #endif()
0051         #list(APPEND ${outfiles} ${outfile})
0052         #MESSAGE(STATUS "${outfiles}")
0053     #ENDFOREACH(it)
0054     #ENDMACRO (PYSIDE_WRAP_UI)
0055 
0056 include(CMakeParseArguments)
0057 
0058 
0059 # qt5_wrap_ui(outfiles inputfile ... )
0060 
0061 function(PYSIDE_WRAP_UI outfiles )
0062     set(options)
0063     set(oneValueArgs)
0064     set(multiValueArgs OPTIONS)
0065 
0066         set(UICOPTIONS "--generator=python")
0067         find_program(PYSIDE2-UIC NAMES pyside2-uic)
0068         if (NOT PYSIDE2-UIC)
0069             MESSAGE(ERROR "Impossible to find pyside2-uic.")
0070         endif()
0071     cmake_parse_arguments(_WRAP_UI "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
0072 
0073     set(ui_files ${_WRAP_UI_UNPARSED_ARGUMENTS})
0074     set(ui_options ${_WRAP_UI_OPTIONS})
0075 
0076     foreach(it ${ui_files})
0077     MESSAGE(STATUS "FILE ${it}")
0078         get_filename_component(outfile ${it} NAME_WE)
0079         get_filename_component(infile ${it} ABSOLUTE)
0080         set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
0081         add_custom_command(OUTPUT ${outfile}
0082           COMMAND ${PYSIDE2-UIC}
0083           ARGS ${ui_options} -o ${outfile} ${infile}
0084           MAIN_DEPENDENCY ${infile} VERBATIM)
0085         list(APPEND ${outfiles} ${outfile})
0086     endforeach()
0087     set(${outfiles} ${${outfiles}} PARENT_SCOPE)
0088 endfunction()