diff options
author | Inki Dae <inki.dae@samsung.com> | 2018-06-28 19:59:32 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2018-09-06 10:10:38 +0900 |
commit | 13ad1dc0ab66865326d921858b308fd31bbc230c (patch) | |
tree | a54f2ffaf6e12f3801df0cd8e363fe82624ed436 | |
parent | e16036741d2da2ec7c06999f28e2cf936d03fd40 (diff) | |
download | armnn-13ad1dc0ab66865326d921858b308fd31bbc230c.tar.gz armnn-13ad1dc0ab66865326d921858b308fd31bbc230c.tar.bz2 armnn-13ad1dc0ab66865326d921858b308fd31bbc230c.zip |
cmake: remove build dependency of externel source
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | cmake/GlobalConfig.cmake | 58 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 2 |
2 files changed, 14 insertions, 46 deletions
diff --git a/cmake/GlobalConfig.cmake b/cmake/GlobalConfig.cmake index 47bdd5ca3..fe9c477ba 100644 --- a/cmake/GlobalConfig.cmake +++ b/cmake/GlobalConfig.cmake @@ -102,11 +102,14 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_P # Boost add_definitions("-DBOOST_ALL_NO_LIB") # Turn off auto-linking as we specify the libs manually -set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_LIBS OFF) find_package(Boost 1.59 REQUIRED COMPONENTS unit_test_framework system filesystem log program_options) -include_directories(SYSTEM "${Boost_INCLUDE_DIR}") +include_directories("${Boost_INCLUDE_DIR}") link_directories(${Boost_LIBRARY_DIR}) +add_definitions("-DBOOST_LOG_DYN_LINK") +set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY libboost_unit_test_framework.a) + # pthread find_package (Threads) @@ -129,7 +132,7 @@ if(BUILD_TF_PARSER OR BUILD_CAFFE_PARSER OR BUILD_ONNX_PARSER) NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) find_path(PROTOBUF_INCLUDE_DIRS "google/protobuf/message.h") - include_directories(SYSTEM "${PROTOBUF_INCLUDE_DIRS}") + include_directories("${PROTOBUF_INCLUDE_DIRS}") add_definitions(-DPROTOBUF_USE_DLLS) endif() @@ -139,7 +142,7 @@ if(BUILD_CAFFE_PARSER) find_path(CAFFE_GENERATED_SOURCES "caffe/proto/caffe.pb.h" HINTS ${CAFFE_BUILD_ROOT}/include) - include_directories(SYSTEM "${CAFFE_GENERATED_SOURCES}") + include_directories("${CAFFE_GENERATED_SOURCES}") endif() if(BUILD_TF_PARSER) @@ -151,7 +154,7 @@ if(BUILD_TF_PARSER) file(GLOB_RECURSE TF_PROTOBUFS "${TF_GENERATED_SOURCES}/*.pb.cc") # C++ headers generated for tf protobufs - include_directories(SYSTEM "${TF_GENERATED_SOURCES}") + include_directories("${TF_GENERATED_SOURCES}") endif() if(BUILD_ONNX_PARSER) @@ -217,43 +220,15 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) # Note that ARM Compute has a different folder layout depending on the branch but also on # whether it comes from a prepackaged archive (this is why we add several hints below) if(ARMCOMPUTENEON OR ARMCOMPUTECL) - find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h - PATHS ${ARMCOMPUTE_ROOT}/include - PATHS ${ARMCOMPUTE_ROOT}/applications/arm_compute - PATHS ${ARMCOMPUTE_ROOT} - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - find_path(ARMCOMPUTE_INCLUDE arm_compute/core/CL/ICLKernel.h) - include_directories(SYSTEM "${ARMCOMPUTE_INCLUDE}") - # Find the Arm Compute libraries if not already specified (the user may have already defined this in advance, # e.g. if building clframework as a dependent cmake project) if (NOT DEFINED ARMCOMPUTE_LIBRARIES) - # We link to the static variant so that customers don't need to find and build a compatible version of clframework. - # First try the folders specified ARMCOMPUTE_BUILD_DIR (with PATH_SUFFIXES for - # Windows builds) - find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static - PATHS ${ARMCOMPUTE_BUILD_DIR} - PATH_SUFFIXES "Debug" - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static - PATHS ${ARMCOMPUTE_BUILD_DIR} - PATH_SUFFIXES "Release" - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static - PATHS ${ARMCOMPUTE_BUILD_DIR} - PATH_SUFFIXES "Debug" - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static - PATHS ${ARMCOMPUTE_BUILD_DIR} - PATH_SUFFIXES "Release" - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - # In case it wasn't there, try a default search (will work in cases where # the library has been installed into a standard location) - find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute-static) - find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute-static) - find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core-static) - find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core-static) + find_library(ARMCOMPUTE_LIBRARY_DEBUG NAMES arm_compute) + find_library(ARMCOMPUTE_LIBRARY_RELEASE NAMES arm_compute) + find_library(ARMCOMPUTE_CORE_LIBRARY_DEBUG NAMES arm_compute_core) + find_library(ARMCOMPUTE_CORE_LIBRARY_RELEASE NAMES arm_compute_core) set(ARMCOMPUTE_LIBRARIES debug ${ARMCOMPUTE_LIBRARY_DEBUG} ${ARMCOMPUTE_CORE_LIBRARY_DEBUG} @@ -273,11 +248,6 @@ endif() # ARM Compute OpenCL backend if(ARMCOMPUTECL) - # Always use Arm compute library OpenCL headers - find_path(OPENCL_INCLUDE CL/cl2.hpp - PATHS ${ARMCOMPUTE_ROOT}/include - NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - find_library(OPENCL_LIBRARIES OpenCL) if (NOT OPENCL_LIBRARIES) # Link against libOpenCL in opencl-1.2-stubs, but don't search there at runtime @@ -285,8 +255,6 @@ if(ARMCOMPUTECL) set(OPENCL_LIBRARIES OpenCL) endif() - include_directories(${OPENCL_INCLUDE}) - # Add preprocessor definition for ARM Compute OpenCL add_definitions(-DARMCOMPUTECL_ENABLED) @@ -315,7 +283,7 @@ if(HEAP_PROFILING OR LEAK_CHECKING) find_path(HEAP_PROFILER_INCLUDE gperftools/heap-profiler.h PATHS ${GPERFTOOLS_ROOT}/include NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - include_directories(SYSTEM "${HEAP_PROFILER_INCLUDE}") + include_directories("${HEAP_PROFILER_INCLUDE}") find_library(GPERF_TOOLS_LIBRARY NAMES tcmalloc_debug HINTS ${GPERFTOOLS_ROOT}/lib) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 0979d552d..6c0b945de 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,7 +1,7 @@ # UnitTests include(CheckIncludeFiles) -include_directories(SYSTEM "${THIRD_PARTY_INCLUDE_DIRS}") +include_directories("${THIRD_PARTY_INCLUDE_DIRS}") # Setup the inference test framework set(inference_test_sources |