From 441c234b7fbfed3f237ad94e16a6588e407d2b00 Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 30 Dec 2021 13:58:46 +0000 Subject: [PATCH] Tidied CMake file --- CMakeLists.txt | 51 +++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e93edd1d..1b877ec8 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,28 +33,6 @@ set(CMAKE_BUILD_RPATH_USE_ORIGIN true) set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") set(CMAKE_BUILD_RPATH ${CMAKE_INSTALL_RPATH}) -if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") - add_compile_definitions(BLOOM_DEBUG_BUILD) - - # BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE can be used to override the file path used for compiled resources. - # We override this path in debug builds to avoid using compiled resources. This makes debugging and small tweaks - # a lot easier, as it removes the need to recompile for each tweak. - # CAUTION: Although convenient, this does add a limitation; the debug build can only be run on the same machine - # that compiled it. Or a machine that has the Bloom source located in the same place. - # See Paths::compiledResourcesPath() for more. - add_compile_definitions(BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE="${CMAKE_CURRENT_SOURCE_DIR}") - - # BLOOM_HOME_DOMAIN_NAME_OVERRIDE can be used to override the domain name used in URLs to the Bloom website. - # I (Nav) use this in debug builds, so I can test local changes that involve the Bloom website as well as Bloom - # itself. Other users can comment out this override if they don't have a copy of the Bloom website running on their - # local machine. See Paths::homeDomainName() for more. - add_compile_definitions(BLOOM_HOME_DOMAIN_NAME_OVERRIDE="http://bloom.local") - - # CMAKE_SKIP_BUILD_RPATH needs to be set to true to use Gammaray during development. - # This is because the distributed Qt binaries may not be compatible with the local installation of Gammaray - set(CMAKE_BUILD_RPATH /opt/Qt/6.1.2/gcc_64/lib/) -endif() - add_executable(Bloom src/main.cpp src/Application.cpp @@ -210,7 +188,34 @@ add_executable(Bloom set_target_properties(Bloom PROPERTIES OUTPUT_NAME bloom) target_include_directories(Bloom PUBLIC ./) -target_include_directories(Bloom PUBLIC /opt/Qt/6.1.2/Src) + +if (${CMAKE_BUILD_TYPE} STREQUAL "Debug") + add_compile_definitions(BLOOM_DEBUG_BUILD) + + # BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE can be used to override the file path used for compiled resources. + # We override this path in debug builds to avoid using compiled resources. This makes debugging and small tweaks + # a lot easier, as it removes the need to recompile for each tweak. + # CAUTION: Although convenient, this does add a limitation; the debug build can only be run on the same machine + # that compiled it. Or a machine that has the Bloom source located in the same place. + # See Paths::compiledResourcesPath() for more. + add_compile_definitions(BLOOM_COMPILED_RESOURCES_PATH_OVERRIDE="${CMAKE_CURRENT_SOURCE_DIR}") + + # BLOOM_HOME_DOMAIN_NAME_OVERRIDE can be used to override the domain name used in URLs to the Bloom website. + # I (Nav) use this in debug builds, so I can test local changes that involve the Bloom website as well as Bloom + # itself. Other users can comment out this override if they don't have a copy of the Bloom website running on their + # local machine. See Paths::homeDomainName() for more. + add_compile_definitions(BLOOM_HOME_DOMAIN_NAME_OVERRIDE="http://bloom.local") + + # CMAKE_BUILD_RPATH needs to point to the local Qt installation, to use Gammaray during development. + # This is because the distributed Qt binaries may not be compatible with the local installation of Gammaray + set(CMAKE_BUILD_RPATH /opt/Qt/6.1.2/gcc_64/lib/) + + # When Qt isn't playing nice, it's very useful to have access to the Qt source code, to step through. + # The QT source directory is specified as an include path just so that CLion can navigate to the Qt implementation + # files, during debugging. No QT headers are actually included via this method. Feel free to comment this out if + # you don't possess the Qt source code on your machine. You may need to invalidate CMake cache. + target_include_directories(Bloom PUBLIC /opt/Qt/6.1.2/Src) +endif() # Copy AVR8 TDFs to build directory and construct JSON mapping of AVR8 target signatures to TDF paths. add_custom_command(