-
Notifications
You must be signed in to change notification settings - Fork 91
/
KDSoapMacros.cmake.in
43 lines (40 loc) · 1.62 KB
/
KDSoapMacros.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This file is part of the KD Soap project.
#
# SPDX-FileCopyrightText: 2011 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: MIT
#
macro(KDSOAP_GENERATE_WSDL _sources)
set(KDWSDL2CPP kdwsdl2cpp)
if(KDSOAP_KDWSDL2CPP_COMPILER)
set(KDWSDL2CPP ${KDSOAP_KDWSDL2CPP_COMPILER})
elseif(TARGET KDSoap::kdwsdl2cpp)
set(KDWSDL2CPP KDSoap::kdwsdl2cpp)
endif()
set(_KSWSDL2CPP_OPTION)
if(KSWSDL2CPP_OPTION)
set(_KSWSDL2CPP_OPTION ${KSWSDL2CPP_OPTION})
endif()
foreach(_source_FILE ${ARGN})
get_filename_component(_tmp_FILE ${_source_FILE} ABSOLUTE)
get_filename_component(_basename ${_tmp_FILE} NAME_WE)
set(_header_wsdl_FILE ${CMAKE_CURRENT_BINARY_DIR}/wsdl_${_basename}.h)
set(_source_wsdl_FILE ${CMAKE_CURRENT_BINARY_DIR}/wsdl_${_basename}.cpp)
add_custom_command(OUTPUT ${_header_wsdl_FILE}
COMMAND ${KDWSDL2CPP}
ARGS ${_KSWSDL2CPP_OPTION} ${_tmp_FILE} -o ${_header_wsdl_FILE}
MAIN_DEPENDENCY ${_tmp_FILE}
DEPENDS ${_tmp_FILE} ${KDWSDL2CPP})
add_custom_command(OUTPUT ${_source_wsdl_FILE}
COMMAND ${KDWSDL2CPP}
ARGS ${_KSWSDL2CPP_OPTION} -impl ${_header_wsdl_FILE} ${_tmp_FILE} -o ${_source_wsdl_FILE}
MAIN_DEPENDENCY ${_tmp_FILE} ${_header_wsdl_FILE}
DEPENDS ${_tmp_FILE} ${KDWSDL2CPP})
set_source_files_properties(${_header_wsdl_FILE} ${_source_wsdl_FILE} PROPERTIES
SKIP_AUTOMOC ON
SKIP_AUTOUIC ON
)
qt@QT_VERSION_MAJOR@_wrap_cpp(_sources_MOCS ${_header_wsdl_FILE})
list(APPEND ${_sources} ${_header_wsdl_FILE} ${_source_wsdl_FILE} ${_sources_MOCS})
endforeach()
endmacro()