From 76cd51772a80cc814076ebf9ec6723b678ede843 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 15 Nov 2016 11:59:32 +0100 Subject: [PATCH] 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. --- qrenderdoc/CMakeLists.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/CMakeLists.txt b/qrenderdoc/CMakeLists.txt index b784ec71b..bb379c8ae 100644 --- a/qrenderdoc/CMakeLists.txt +++ b/qrenderdoc/CMakeLists.txt @@ -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)