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 <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2019-05-24 08:49:34 +02:00
parent 7418c4f1ee
commit 675ac662e9

View File

@@ -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