Skip to content

Commit 713be2f

Browse files
Use FetchContent to get Windows bison dependency at configure time
1 parent f4700a2 commit 713be2f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

parsedate/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
2+
include(FetchContent)
3+
FetchContent_Declare(download_bison
4+
URL "http://user.xmission.com/~legalize/trn/bison-2.4.1.zip"
5+
URL_MD5 "6d728df45f1cf60f5569da4963322ec3"
6+
DOWNLOAD_EXTRACT_TIMESTAMP FALSE)
7+
FetchContent_MakeAvailable(download_bison)
8+
set(BISON_ROOT "${download_bison_SOURCE_DIR}/bin")
9+
message(STATUS "BISON_ROOT=${BISON_ROOT}")
10+
endif()
111
find_package(BISON REQUIRED)
212

313
bison_target(parsedate parsedate.y ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c)

0 commit comments

Comments
 (0)