From 42208ce621a9e4da1155e0e5afbe2ab295c7607f Mon Sep 17 00:00:00 2001 From: redtide Date: Sun, 19 Jan 2020 01:10:42 +0100 Subject: [PATCH] Don't show build information when building from other projects --- CMakeLists.txt | 18 +----------------- cmake/SfizzConfig.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe18b6a3..b66a7c29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,20 +47,4 @@ if (SFIZZ_TESTS) add_subdirectory (tests) endif() -message (STATUS " -Project name: ${PROJECT_NAME} -Build type: ${CMAKE_BUILD_TYPE} -Build using LTO: ${ENABLE_LTO} -Build as shared library: ${SFIZZ_SHARED} -Build JACK stand-alone client: ${SFIZZ_JACK} -Build LV2 plug-in: ${SFIZZ_LV2} -Build benchmarks: ${SFIZZ_BENCHMARKS} -Build tests: ${SFIZZ_TESTS} - -Install prefix: ${CMAKE_INSTALL_PREFIX} -LV2 destination directory: ${LV2PLUGIN_INSTALL_DIR} - -Compiler CXX debug flags: ${CMAKE_CXX_FLAGS_DEBUG} -Compiler CXX release flags: ${CMAKE_CXX_FLAGS_RELEASE} -Compiler CXX min size flags: ${CMAKE_CXX_FLAGS_MINSIZEREL} -") +show_build_info_if_needed() diff --git a/cmake/SfizzConfig.cmake b/cmake/SfizzConfig.cmake index 01271759..d15b94b7 100644 --- a/cmake/SfizzConfig.cmake +++ b/cmake/SfizzConfig.cmake @@ -52,3 +52,27 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND NOT ANDROID) add_link_options(-stdlib=libc++) # New command on CMake master, not in 3.12 release add_link_options(-lc++abi) # New command on CMake master, not in 3.12 release endif() + +# Don't show build information when building a different project +function (show_build_info_if_needed) + if (CMAKE_PROJECT_NAME STREQUAL "sfizz") + message (STATUS " +Project name: ${PROJECT_NAME} +Build type: ${CMAKE_BUILD_TYPE} +Build using LTO: ${ENABLE_LTO} +Build as shared library: ${SFIZZ_SHARED} +Build JACK stand-alone client: ${SFIZZ_JACK} +Build LV2 plug-in: ${SFIZZ_LV2} +Build benchmarks: ${SFIZZ_BENCHMARKS} +Build tests: ${SFIZZ_TESTS} + +Install prefix: ${CMAKE_INSTALL_PREFIX} +LV2 destination directory: ${LV2PLUGIN_INSTALL_DIR} + +Compiler CXX debug flags: ${CMAKE_CXX_FLAGS_DEBUG} +Compiler CXX release flags: ${CMAKE_CXX_FLAGS_RELEASE} +Compiler CXX min size flags: ${CMAKE_CXX_FLAGS_MINSIZEREL} +") + endif() +endfunction() +