From 7d898925a8728f15f0ab955ae65cd259d4933101 Mon Sep 17 00:00:00 2001 From: aceforeverd Date: Fri, 24 Nov 2023 14:59:16 +0800 Subject: [PATCH] build(cmake): respect third_party_dir env variable (#3497) * build(cmake): respect THIRD_PARTY_DIR env variable Fixes cmake configure issue where some editor utilize CMakeLists.txt directly * chore(cmake): add a message --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18f2dde3813..d9d6188a088 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,9 +30,14 @@ if (CMAKE_BUILD_TYPE STREQUAL "") endif () if (NOT DEFINED CMAKE_PREFIX_PATH) - set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/.deps/usr") + if (DEFINED ENV{THIRD_PARTY_DIR}) + set(CMAKE_PREFIX_PATH $ENV{THIRD_PARTY_DIR}) + else() + set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/.deps/usr") + endif() endif() +message (STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}") message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") set(OPENMLDB_VERSION_MAJOR 0) set(OPENMLDB_VERSION_MINOR 8)