comparison Resources/CMake/QtConfiguration.cmake @ 1044:b60d70e8b55c

compatibility macros for LSB and Qt
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 09 Oct 2019 15:58:39 +0200
parents 95939fa925f6
children 4f99c7905f8d 2d8ab34c8c91
comparison
equal deleted inserted replaced
1041:95939fa925f6 1044:b60d70e8b55c
35 ${LSB_PATH}/include/QtCore 35 ${LSB_PATH}/include/QtCore
36 ${LSB_PATH}/include/QtGui 36 ${LSB_PATH}/include/QtGui
37 ${LSB_PATH}/include/QtOpenGL 37 ${LSB_PATH}/include/QtOpenGL
38 ) 38 )
39 39
40 macro(ORTHANC_QT_WRAP_UI) 40 link_libraries(QtCore QtGui QtOpenGL)
41 QT4_WRAP_UI(${ARGN}) 41
42 endmacro() 42
43 ##
44 ## This part is adapted from file "Qt4Macros.cmake" shipped with
45 ## CMake 3.5.1, released under the following license:
46 ##
47 ##=============================================================================
48 ## Copyright 2005-2009 Kitware, Inc.
49 ##
50 ## Distributed under the OSI-approved BSD License (the "License");
51 ## see accompanying file Copyright.txt for details.
52 ##
53 ## This software is distributed WITHOUT ANY WARRANTY; without even the
54 ## implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
55 ## See the License for more information.
56 ##=============================================================================
57 ##
58 macro (ORTHANC_QT_WRAP_UI outfiles)
59 QT4_EXTRACT_OPTIONS(ui_files ui_options ui_target ${ARGN})
60 foreach (it ${ui_files})
61 get_filename_component(outfile ${it} NAME_WE)
62 get_filename_component(infile ${it} ABSOLUTE)
63 set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
64 add_custom_command(OUTPUT ${outfile}
65 COMMAND ${QT_UIC_EXECUTABLE}
66 ARGS ${ui_options} -o ${outfile} ${infile}
67 MAIN_DEPENDENCY ${infile} VERBATIM)
68 set(${outfiles} ${${outfiles}} ${outfile})
69 endforeach ()
70 endmacro ()
43 71
44 macro(ORTHANC_QT_WRAP_CPP) 72 macro (ORTHANC_QT_WRAP_CPP outfiles )
45 QT4_WRAP_CPP(${ARGN}) 73 QT4_GET_MOC_FLAGS(moc_flags)
46 endmacro() 74 QT4_EXTRACT_OPTIONS(moc_files moc_options moc_target ${ARGN})
75 foreach (it ${moc_files})
76 get_filename_component(outfile ${it} NAME_WE)
77 get_filename_component(infile ${it} ABSOLUTE)
78 set(outfile ${CMAKE_CURRENT_BINARY_DIR}/moc_${outfile}.cxx)
79 add_custom_command(OUTPUT ${outfile}
80 COMMAND ${QT_MOC_EXECUTABLE}
81 ARGS ${infile} "${moc_flags}" -o ${outfile}
82 MAIN_DEPENDENCY ${infile} VERBATIM)
83 set(${outfiles} ${${outfiles}} ${outfile})
84 endforeach ()
85 endmacro ()
86 ##
87 ## End of "Qt4Macros.cmake" adaptation.
88 ##
47 89
48 link_libraries(QtCore QtGui QtOpenGL)
49
50 else() 90 else()
51 # Not using Linux Standard Base 91 # Not using Linux Standard Base
52 # Find the QtWidgets library 92 # Find the QtWidgets library
53 find_package(Qt5Widgets QUIET) 93 find_package(Qt5Widgets QUIET)
54 94