aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/snowball/CMakeLists.txt
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2020-01-21 01:05:49 +0000
committerPeter Wu <peter@lekensteyn.nl>2020-01-21 01:30:48 +0000
commit425bb31e1dd095e16cdc463a636a78193e6c86b5 (patch)
treeb7d622fe68492cd7b6c50f840c30fb8e027ebf25 /contrib/snowball/CMakeLists.txt
parent0012f8ae53c613e980bd83423501f55098c9cc23 (diff)
downloadrspamd-425bb31e1dd095e16cdc463a636a78193e6c86b5.tar.gz
rspamd-425bb31e1dd095e16cdc463a636a78193e6c86b5.zip
[Minor] contrib/snowball: fix modules.h location
* Reproducible builds! No more absolute paths in source files, so the generated binary is also invariant of the build directory. * Output modules.h in snowball/libstemmer/ instead of snowball/. This allows removal of the extra include directory and -f option. * This partially reverts some changes in https://github.com/snowballstem/snowball/commit/d178f201fda878c26538401650a7d46c37a5e6f1 and matches the commands in GNUmakefile.
Diffstat (limited to 'contrib/snowball/CMakeLists.txt')
-rw-r--r--contrib/snowball/CMakeLists.txt7
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/snowball/CMakeLists.txt b/contrib/snowball/CMakeLists.txt
index 8674e2d88..7910c7b3a 100644
--- a/contrib/snowball/CMakeLists.txt
+++ b/contrib/snowball/CMakeLists.txt
@@ -37,14 +37,14 @@ MACRO(gen_stem IN ENCODING)
SET(_input "${CMAKE_CURRENT_SOURCE_DIR}/algorithms/${_it}/stem_${_in_enc}.sbl")
IF(${_in_enc} STREQUAL "Unicode" AND NOT EXISTS ${_input})
ADD_CUSTOM_COMMAND(OUTPUT ${_source}
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/snowball "${CMAKE_CURRENT_SOURCE_DIR}/algorithms/${_it}/stem_ISO_8859_1.sbl" -o ${_base} -eprefix ${_it}_${ENCODING}_ -r ${CMAKE_CURRENT_SOURCE_DIR}/runtime -u
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/snowball "${CMAKE_CURRENT_SOURCE_DIR}/algorithms/${_it}/stem_ISO_8859_1.sbl" -o ${_base} -eprefix ${_it}_${ENCODING}_ -r ../runtime -u
DEPENDS snowball)
LIST(APPEND STEMMER_SOURCES ${_source})
ELSE()
IF(EXISTS "${_input}")
ADD_CUSTOM_COMMAND(OUTPUT ${_source}
- COMMAND ${CMAKE_CURRENT_BINARY_DIR}/snowball ${_input} -o ${_base} -eprefix ${_it}_${ENCODING}_ -r ${CMAKE_CURRENT_SOURCE_DIR}/runtime -u
+ COMMAND ${CMAKE_CURRENT_BINARY_DIR}/snowball ${_input} -o ${_base} -eprefix ${_it}_${ENCODING}_ -r ../runtime -u
DEPENDS snowball)
LIST(APPEND STEMMER_SOURCES ${_source})
ENDIF()
@@ -53,12 +53,11 @@ MACRO(gen_stem IN ENCODING)
ENDMACRO()
INCLUDE_DIRECTORIES("include")
-INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/libstemmer")
ADD_EXECUTABLE(snowball ${COMPILER_SOURCES})
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libstemmer/modules.h
- COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/libstemmer/mkmodules.pl -f ${CMAKE_CURRENT_BINARY_DIR}/libstemmer/modules.h ${CMAKE_CURRENT_BINARY_DIR}/libstemmer ${CMAKE_CURRENT_SOURCE_DIR}/libstemmer/modules.txt ${CMAKE_CURRENT_BINARY_DIR}/libstemmer/mkinc.mak)
+ COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/libstemmer/mkmodules.pl libstemmer/modules.h libstemmer ${CMAKE_CURRENT_SOURCE_DIR}/libstemmer/modules.txt libstemmer/mkinc.mak)
ADD_CUSTOM_TARGET(modules DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/libstemmer/modules.h")
SET(STEMMER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/libstemmer/libstemmer.c")