darling-grep/CMakeLists.txt

75 lines
1.7 KiB
CMake
Raw Permalink Normal View History

2016-02-09 21:50:52 +00:00
project(grep)
2023-07-26 17:11:51 +00:00
cmake_minimum_required(VERSION 3.13)
2016-02-09 21:50:52 +00:00
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
include(darling_exe)
add_definitions(-DHAVE_CONFIG_H)
2016-11-23 03:24:44 +00:00
# Hide warnings
add_definitions(
-Wno-pointer-sign
-Wno-shift-negative-value
-Wno-format-security
-Wno-implicit-function-declaration
-Wno-format
)
2016-02-09 21:50:52 +00:00
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_POSIX_C_SOURCE -D__DARWIN_UNIX03 -nostdinc -fblocks -fPIC -ggdb -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${CMAKE_CURRENT_SOURCE_DIR}/grep/config.h")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/grep)
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/grep/lib)
include_directories(${DARLING_TOP_DIRECTORY}/src/external/pcre/pcre)
include(InstallSymlink)
set(BINARY_PACKAGING_MODE ON)
set(grep_sources
grep/src/dfa.c
grep/src/grep.c
grep/src/grepmat.c
grep/src/kwset.c
grep/src/search.c
grep/lib/alloca.c
2017-01-17 19:28:43 +00:00
#grep/lib/atexit.c
2016-02-09 21:50:52 +00:00
grep/lib/closeout.c
grep/lib/error.c
grep/lib/exclude.c
grep/lib/fnmatch.c
grep/lib/getopt1.c
grep/lib/getopt.c
grep/lib/hard-locale.c
grep/lib/isdir.c
grep/lib/malloc.c
grep/lib/memchr.c
grep/lib/obstack.c
grep/lib/quotearg.c
grep/lib/realloc.c
grep/lib/regex.c
grep/lib/savedir.c
grep/lib/stpcpy.c
grep/lib/strtol.c
grep/lib/strtoul.c
grep/lib/strtoull.c
grep/lib/strtoumax.c
grep/lib/xmalloc.c
grep/lib/xstrtol.c
grep/lib/xstrtoumax.c
)
add_darling_executable(grep ${grep_sources})
target_link_libraries(grep pcre)
install(TARGETS grep
DESTINATION libexec/darling/bin)
2016-11-22 16:03:20 +00:00
install(FILES grep.1 egrep.1 fgrep.1 DESTINATION libexec/darling/usr/share/man/man1)
2017-01-17 19:28:43 +00:00
InstallSymlink("grep" "${CMAKE_INSTALL_PREFIX}/libexec/darling/bin/egrep")
InstallSymlink("grep" "${CMAKE_INSTALL_PREFIX}/libexec/darling/bin/fgrep")