diff options
author | David Neto <dneto@google.com> | 2019-02-05 16:29:53 -0500 |
---|---|---|
committer | David Neto <dneto@google.com> | 2019-02-06 14:29:11 -0500 |
commit | b93cb2bdda93ed98f253b75a59582780c8460cc1 (patch) | |
tree | 46d3be97c3c2ce3b19b58a8a022db4eb4677c8f5 /third_party/CMakeLists.txt | |
parent | 325bc224e7fbd12fc97e382ddc4cfb75fbf1cebc (diff) | |
parent | b83b58d177b797edd1f94c5f10837f2cc2863f0a (diff) | |
download | effcee-ndk-release-r21.tar.gz |
Merge remote-tracking branch 'aosp/upstream-master' into up-shaderc2ndk-r21endk-r21dndk-r21cndk-r21bndk-r21-rc1ndk-r21-beta2ndk-r21-beta1ndk-r21ndk-release-r21
Initial drop of google/effcee from GitHub
Test: checkbuild.py on Linux; unit tests on Windows
Change-Id: Id931fb12867fc221e3f449fc32bec428f54f5c70
Diffstat (limited to 'third_party/CMakeLists.txt')
-rw-r--r-- | third_party/CMakeLists.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt new file mode 100644 index 0000000..9ef4a22 --- /dev/null +++ b/third_party/CMakeLists.txt @@ -0,0 +1,44 @@ +# Suppress all warnings from third-party projects. +set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w) + +# Set alternate root directory for third party sources. +set(EFFCEE_THIRD_PARTY_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE STRING + "Root location of all third_party projects") + +# Find googletest and gmock +if(${googletest-distribution_SOURCE_DIR}) + set(EFFCEE_GOOGLETEST_DIR "${googletest-distribution_SOURCE_DIR}" CACHE STRING + "Location of googletest source") +else() + set(EFFCEE_GOOGLETEST_DIR "${EFFCEE_THIRD_PARTY_ROOT_DIR}/googletest" CACHE STRING + "Location of googletest source") +endif() + +# Find re2 +if(RE2_SOURCE_DIR) + set(EFFCEE_RE2_DIR "${RE2_SOURCE_DIR}" CACHE STRING "Location of re2 source" FORCE) +else() + set(EFFCEE_RE2_DIR "${EFFCEE_THIRD_PARTY_ROOT_DIR}/re2" CACHE STRING + "Location of re2 source") +endif() + +# Configure third party projects. +if(EFFCEE_BUILD_TESTING) + if (NOT TARGET gmock) + if (IS_DIRECTORY ${EFFCEE_GOOGLETEST_DIR}) + add_subdirectory(${EFFCEE_GOOGLETEST_DIR} googletest EXCLUDE_FROM_ALL) + endif() + endif() + if (NOT TARGET gmock) + message(FATAL_ERROR "gmock was not found - required for tests") + endif() +endif() + +if (NOT TARGET re2) + if (IS_DIRECTORY ${EFFCEE_RE2_DIR}) + add_subdirectory(${EFFCEE_RE2_DIR} re2 EXCLUDE_FROM_ALL) + endif() +endif() +if (NOT TARGET re2) + message(FATAL_ERROR "re2 was not found - required for compilation") +endif() |