diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-03-14 00:17:05 +0100 |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-03-14 00:30:02 +0100 |
commit | b493f2871d9068e826c4e34098b8b71995c1f340 (patch) | |
tree | 77cabc87a49f8401d421ed9d356ecd2a0fe916f1 | |
parent | 8640583580fc69e15c8b8ad705c1e2cf8cb6eda9 (diff) | |
download | extra-cmake-modules-b493f2871d9068e826c4e34098b8b71995c1f340.tar.gz extra-cmake-modules-b493f2871d9068e826c4e34098b8b71995c1f340.tar.bz2 |
Add more convenient fragments until it appears upstream.
This in particular helps the Windows build when using cmake master.
-rw-r--r-- | find-modules/FindQt5Transitional.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/find-modules/FindQt5Transitional.cmake b/find-modules/FindQt5Transitional.cmake index 8b0f700e..7d7f78fc 100644 --- a/find-modules/FindQt5Transitional.cmake +++ b/find-modules/FindQt5Transitional.cmake @@ -67,6 +67,29 @@ if (Qt5Core_FOUND) endif() endforeach() + set_property(TARGET Qt5::Core + PROPERTY + INTERFACE_POSITION_INDEPENDENT_CODE ON + ) + + if (WIN32 AND NOT Qt5_NO_LINK_QTMAIN) + set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>) + set(_isWin32 $<BOOL:$<TARGET_PROPERTY:WIN32_EXECUTABLE>>) + set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:Qt5_NO_LINK_QTMAIN>>>) + get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS) + foreach(_config ${_configs}) + set_property(TARGET Qt5::Core APPEND PROPERTY + IMPORTED_LINK_INTERFACE_LIBRARIES_${_config} + $<$<AND:${_isExe},${_isWin32},${_isNotExcluded}>:Qt5::WinMain> + ) + endforeach() + unset(_configs) + unset(_isExe) + unset(_isWin32) + unset(_isNotExcluded) + endif() + # End upstreamed stuff. + get_filename_component(_modules_dir "${CMAKE_CURRENT_LIST_DIR}/../modules" ABSOLUTE) include("${_modules_dir}/ECMQt4To5Porting.cmake") # TODO: Port away from this. include_directories(${QT_INCLUDES}) # TODO: Port away from this. |