@@ -39,39 +39,41 @@ add_library(${EXTENSION_NAME} STATIC ${EXTENSION_SOURCES})
39
39
# link to their own dependencies if they are building locally. If they have a
40
40
# local (compatible) GDAL installation, we should use that instead of building
41
41
# our own. (unless a static build is requested)
42
- execute_process (
43
- # Generate project
44
- COMMAND
45
- ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
46
- -DDUCKDB_ENABLE_DEPRECATED_API=1
47
- -DWASM_LOADABLE_EXTENSIONS=1
48
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
49
- -DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
50
- -DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
51
- -DOPENSSL_ROOT_DIR=$ENV{OPENSSL_ROOT_DIR}
52
- -DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR} '
53
- -DVCPKG_INSTALLED_DIR='${CMAKE_BINARY_DIR} /vcpkg_installed'
54
- -DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE} '
55
- -DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET} '
56
- -S ${CMAKE_CURRENT_SOURCE_DIR} /deps -B ${CMAKE_BINARY_DIR} /deps
57
- RESULT_VARIABLE DEPENDENCIES_GENERATE_RESULT)
58
- if (NOT DEPENDENCIES_GENERATE_RESULT EQUAL 0)
59
- message (FATAL_ERROR "Could not generate dependencies project" )
60
- endif ()
61
- execute_process (
62
- # Build project
63
- COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} /deps --config
64
- ${CMAKE_BUILD_TYPE} RESULT_VARIABLE DEPENDENCIES_BUILD_RESULT)
65
- if (NOT DEPENDENCIES_BUILD_RESULT EQUAL 0)
66
- message (FATAL_ERROR "Could not build dependencies project" )
42
+
43
+ if (NOT EXISTS ${CMAKE_BINARY_DIR} /deps)
44
+ execute_process (
45
+ # Generate project
46
+ COMMAND
47
+ ${CMAKE_COMMAND} -G ${CMAKE_GENERATOR}
48
+ -DDUCKDB_ENABLE_DEPRECATED_API=1
49
+ -DWASM_LOADABLE_EXTENSIONS=1
50
+ -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
51
+ -DOSX_BUILD_ARCH=${OSX_BUILD_ARCH}
52
+ -DSPATIAL_USE_NETWORK=${SPATIAL_USE_NETWORK}
53
+ -DOPENSSL_ROOT_DIR=$ENV{OPENSSL_ROOT_DIR}
54
+ -DVCPKG_MANIFEST_DIR='${VCPKG_MANIFEST_DIR} '
55
+ -DVCPKG_INSTALLED_DIR='${CMAKE_BINARY_DIR} /vcpkg_installed'
56
+ -DCMAKE_TOOLCHAIN_FILE='${CMAKE_TOOLCHAIN_FILE} '
57
+ -DVCPKG_TARGET_TRIPLET='${VCPKG_TARGET_TRIPLET} '
58
+ -S ${CMAKE_CURRENT_SOURCE_DIR} /deps -B ${CMAKE_BINARY_DIR} /deps
59
+ RESULT_VARIABLE DEPENDENCIES_GENERATE_RESULT)
60
+ if (NOT DEPENDENCIES_GENERATE_RESULT EQUAL 0)
61
+ message (FATAL_ERROR "Could not generate dependencies project" )
62
+ endif ()
63
+
64
+ execute_process (
65
+ # Build project
66
+ COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} /deps --config
67
+ ${CMAKE_BUILD_TYPE} RESULT_VARIABLE DEPENDENCIES_BUILD_RESULT)
68
+ if (NOT DEPENDENCIES_BUILD_RESULT EQUAL 0)
69
+ message (FATAL_ERROR "Could not build dependencies project" )
70
+ endif ()
67
71
endif ()
68
72
69
- # Add dependencies
70
- set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
71
- ${CMAKE_BINARY_DIR} /deps/local)
72
- set (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} MD .lib
73
- )# annoyingly for expat on windows
73
+ # annoyingly for expat on windows
74
+ set (CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} MD .lib)
74
75
76
+ # Add dependencies
75
77
list (APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_BINARY_DIR} /deps/local/" )
76
78
list (APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR} /deps/local/" )
77
79
0 commit comments