Add cmake parameters for linking qrenderdoc against static qt libs

* This is fine under LGPL as RenderDoc is also open source licensed, so
  any such builds can be fully recreated and linked against a new Qt.
This commit is contained in:
baldurk
2016-11-15 11:59:32 +01:00
parent 9bd02042d0
commit 76cd51772a
+11 -1
View File
@@ -3,12 +3,22 @@ set(output_dir ${CMAKE_BINARY_DIR}/bin)
get_git_hash(GIT_COMMIT_HASH)
string(STRIP ${GIT_COMMIT_HASH} GIT_COMMIT_HASH)
option(STATIC_QRENDERDOC "Compile qrenderdoc as static" OFF)
set(QMAKE_CONFIG "debug")
set(QMAKE_LDFLAGS "")
if(STATIC_QRENDERDOC)
set(QMAKE_CONFIG "debug static")
set(QMAKE_LDFLAGS "-static-libstdc++")
endif()
# The case here is deliberately not matching the executable name
# This means the custom command doesn't create this output file,
# which causes CMake to rerun this target every time so that Qt
# can do dependency checking and rebuild anything necessary.
add_custom_command(OUTPUT QRenderDoc
COMMAND qmake "CONFIG+=debug" "DEFINES+=GIT_COMMIT_HASH_LITERAL=${GIT_COMMIT_HASH}" "DESTDIR=${output_dir}" ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND qmake "CONFIG+=${QMAKE_CONFIG}" "QMAKE_LFLAGS+=${QMAKE_LDFLAGS}" "DEFINES+=GIT_COMMIT_HASH_LITERAL=${GIT_COMMIT_HASH}" "DESTDIR=${output_dir}" ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND MAKEFLAGS= make --no-print-directory)
add_custom_target(build-qrenderdoc ALL DEPENDS QRenderDoc)