diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-07-22 21:40:22 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-25 13:59:15 +0200 |
commit | 189a5d8af12788a30121210066de647a6dc3a167 (patch) | |
tree | aebc213c29a70d00e704f9d9679a1f47622c7b5a /src/dbus/Qt5DBusConfigExtras.cmake.in | |
parent | 95191658d0b71017c8fcb19058ed900e97d8f81c (diff) |
Create IMPORTED CMake targets for executables.
Although IMPORTED executables are not extra special, this is more future-proof
in terms of both future CMake features and future our needs - it is possible
that we would want to add a property to an executable at TARGET scope, which
would not be possible if it is just a path.
Change-Id: I649c601e004b21603c5fa97de0b7c397813ed68d
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/dbus/Qt5DBusConfigExtras.cmake.in')
-rw-r--r-- | src/dbus/Qt5DBusConfigExtras.cmake.in | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/dbus/Qt5DBusConfigExtras.cmake.in b/src/dbus/Qt5DBusConfigExtras.cmake.in index 2aa857fecb..03640f8ccd 100644 --- a/src/dbus/Qt5DBusConfigExtras.cmake.in +++ b/src/dbus/Qt5DBusConfigExtras.cmake.in @@ -1,10 +1,29 @@ -get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) +get_filename_component(_qt5_dbus_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) +if (NOT TARGET Qt5::qdbuscpp2xml) + add_executable(Qt5::qdbuscpp2xml IMPORTED) + + set_target_properties(Qt5::qdbuscpp2xml PROPERTIES !!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) -set(QT_DBUSCPP2XML_EXECUTABLE \"${_qt5_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") -set(QT_DBUSXML2CPP_EXECUTABLE \"${_qt5_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") + IMPORTED_LOCATION \"${_qt5_dbus_install_prefix}/$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\" !!ELSE -set(QT_DBUSCPP2XML_EXECUTABLE \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\") -set(QT_DBUSXML2CPP_EXECUTABLE \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\") + IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}qdbuscpp2xml$$CMAKE_BIN_SUFFIX\" !!ENDIF + ) +endif() + +if (NOT TARGET Qt5::qdbusxml2cpp) + add_executable(Qt5::qdbusxml2cpp IMPORTED) + + set_target_properties(Qt5::qdbusxml2cpp PROPERTIES +!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE) + IMPORTED_LOCATION \"${_qt5_dbus_install_prefix}/$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\" +!!ELSE + IMPORTED_LOCATION \"$${CMAKE_BIN_DIR}qdbusxml2cpp$$CMAKE_BIN_SUFFIX\" +!!ENDIF + ) +endif() + +set(Qt5DBus_QDBUSCPP2XML_EXECUTABLE Qt5::qdbuscpp2xml) +set(Qt5DBus_QDBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp) |