From 081af0f1c44f8d8bd3b04b99ca9b186214820f74 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Sat, 9 Oct 2021 15:57:44 +0200 Subject: [PATCH] common: CMake: make awk crlf agnostic when generating svgcolor_lib only when using Cygwin --- lib/common/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/common/CMakeLists.txt b/lib/common/CMakeLists.txt index 1b892a574..d153c7fb4 100644 --- a/lib/common/CMakeLists.txt +++ b/lib/common/CMakeLists.txt @@ -2,11 +2,15 @@ BISON_TARGET(HTMLparse ${CMAKE_CURRENT_SOURCE_DIR}/htmlparse.y ${CMAKE_CURRENT_B add_definitions(-DGVC_EXPORTS -D_BLD_gvc=1) +if(CYGWIN) +set(AWK_OPTIONS, -v RS="\\r*\\n") +endif() + # Generate colortbl.h from sources add_custom_command( OUTPUT svgcolor_lib DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/svgcolor_names ${TOP_SOURCE_DIR}/awk/svgcolor.awk - COMMAND ${AWK_EXECUTABLE} -v RS="\\r*\\n" -f ${TOP_SOURCE_DIR}/awk/svgcolor.awk + COMMAND ${AWK_EXECUTABLE} ${AWK_OPTIONS} -f ${TOP_SOURCE_DIR}/awk/svgcolor.awk ${CMAKE_CURRENT_SOURCE_DIR}/svgcolor_names > ${CMAKE_CURRENT_BINARY_DIR}/svgcolor_lib ) add_custom_command( -- 2.40.0