From 675ac662e97766f36125311cdc0787cc4ae0308e Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Fri, 24 May 2019 08:49:34 +0200 Subject: [PATCH] Wizard: Fix AutoTest wizard for Boost with CMake While at it use the same environment variable used for Qmake or Qbs based project. Change-Id: Ieefb4e1da4ce4155863b80a1b275b67e664273c6 Reviewed-by: David Schulz --- .../templates/wizards/autotest/files/tst.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/templates/wizards/autotest/files/tst.txt b/share/qtcreator/templates/wizards/autotest/files/tst.txt index 150fc1d6328..2d3826d00b2 100644 --- a/share/qtcreator/templates/wizards/autotest/files/tst.txt +++ b/share/qtcreator/templates/wizards/autotest/files/tst.txt @@ -82,12 +82,14 @@ ENABLE_TESTING() add_executable(${PROJECT_NAME} %{MainCppName}) add_test(${PROJECT_NAME} COMMAND ${PROJECT_NAME}) -if ($ENV{BOOST_INC_DIR}) - set(BOOST_INC_DIR $ENV{BOOST_INC_DIR}) +if (DEFINED ENV{BOOST_INCLUDE_DIR}) + set(BOOST_INCLUDE_DIR $ENV{BOOST_INCLUDE_DIR}) else () - set(BOOST_INC_DIR "%{BoostIncDir}") # set by Qt Creator wizard + set(BOOST_INCLUDE_DIR "%{BoostIncDir}") # set by Qt Creator wizard endif () -if (EXISTS ${BOOST_INC_DIR}) - include_directories(${BOOST_INC_DIR}) +if (BOOST_INCLUDE_DIR STREQUAL "") + message("BOOST_INCLUDE_DIR is not set, assuming Boost can be found automatically in your system") +elseif (EXISTS ${BOOST_INCLUDE_DIR}) + include_directories(${BOOST_INCLUDE_DIR}) endif () @endif