Wrap FindBoost in if(BUILD_UNIT_TESTS) so that it can be excluded entirely
authorMatthew Bentham <matthew.bentham@arm.com>
Fri, 13 Nov 2020 12:04:01 +0000 (12:04 +0000)
committerTeresaARM <teresa.charlinreyes@arm.com>
Fri, 13 Nov 2020 15:10:44 +0000 (15:10 +0000)
Signed-off-by: Matthew Bentham <matthew.bentham@arm.com>
Change-Id: Iabe1b10e53d393a19e681156c001d6a2e9eb835e

cmake/GlobalConfig.cmake

index 01ce91f..360f068 100644 (file)
@@ -134,10 +134,12 @@ if (NOT BUILD_PIPE_ONLY)
   else()
     set(Boost_USE_STATIC_LIBS ON)
   endif()
-  add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
-  find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework)
-  include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
-  link_directories(${Boost_LIBRARY_DIRS})
+  if (BUILD_UNIT_TESTS)
+    add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually
+    find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework)
+    include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
+    link_directories(${Boost_LIBRARY_DIRS})
+  endif()
 endif()
 
 if (NOT BUILD_PIPE_ONLY)