Skip to content

Commit

Permalink
Update to use newer cmake and for Wine/MSYS2
Browse files Browse the repository at this point in the history
  • Loading branch information
kovzol committed Aug 19, 2024
1 parent fc08222 commit 00f692b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ jobs:
cd orig
tar xzf ../sword-1.9.0.tar.gz || true
patch -i ../sword-patch-mingw64.diff -p1
cp ../FindRegex.cmake sword-1.9.0/cmake # avoid use /usr/include on Wine/MSYS2
sed -i 's/2.6.0/3.5.0/' CMakeLists.txt # eliminate some warnings and force newer cmake settings
cd sword-1.9.0
mkdir build
cd build
Expand Down
49 changes: 49 additions & 0 deletions FindRegex.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# - Try to find the Regex library
#
# Once done this will define
#
# REGEX_FOUND - system has libregex
# REGEX_INCLUDE_DIR - the libregex include directory
# REGEX_LIBRARIES - Link these to use libregex
#
# Copyright (c) 2018, Gilles Caulier, <caulier dot gilles at gmail dot com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if ( NOT MSVC AND NOT MINGW AND NOT MSYS )
find_path(Regex_INCLUDE_DIR
NAMES regex.h
DOC "libregex include directory"
)

mark_as_advanced(Regex_INCLUDE_DIR)

find_library(Regex_LIBRARY "regex"
DOC "libregex libraries"
)

mark_as_advanced(Regex_LIBRARY)

find_package_handle_standard_args(Regex
FOUND_VAR Regex_FOUND
REQUIRED_VARS Regex_INCLUDE_DIR
FAIL_MESSAGE "Failed to find libregex"
)

if(REGEX_FOUND)

set(REGEX_INCLUDE_DIRS ${Regex_INCLUDE_DIRS})

if(Regex_LIBRARY)

set(REGEX_LIBRARIES ${Regex_LIBRARY})

else()

unset(REGEX_LIBRARIES)

endif()

endif()
endif()

0 comments on commit 00f692b

Please sign in to comment.