diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-16 16:39:35 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-16 16:39:35 +0100 |
commit | 57ad67a4b4560a936f9bc7efa6a1a3778a1372fa (patch) | |
tree | 179c5874aef6cc980d6fd3bee1fff1b9ec1c27fe /contrib/torch/paths/CMakeLists.txt | |
parent | 8d080cdc349ee281701ae185d2053314611875da (diff) | |
download | rspamd-57ad67a4b4560a936f9bc7efa6a1a3778a1372fa.tar.gz rspamd-57ad67a4b4560a936f9bc7efa6a1a3778a1372fa.zip |
[Feature] Import torch to Rspamd...
Diffstat (limited to 'contrib/torch/paths/CMakeLists.txt')
-rw-r--r-- | contrib/torch/paths/CMakeLists.txt | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/contrib/torch/paths/CMakeLists.txt b/contrib/torch/paths/CMakeLists.txt new file mode 100644 index 000000000..c16abe13d --- /dev/null +++ b/contrib/torch/paths/CMakeLists.txt @@ -0,0 +1,55 @@ +cmake_minimum_required(VERSION 2.6) + +INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}") + +INCLUDE(CheckIncludeFiles) +INCLUDE(CheckFunctionExists) +INCLUDE(CheckLibraryExists) + +IF (UNIX OR NOT WIN32) + CHECK_INCLUDE_FILES(fcntl.h HAVE_FCNTL_H) + CHECK_INCLUDE_FILES(unistd.h HAVE_UNISTD_H) + CHECK_INCLUDE_FILES(dirent.h HAVE_DIRENT_H) + CHECK_INCLUDE_FILES(time.h HAVE_TIME_H) + CHECK_INCLUDE_FILES(sys/time.h HAVE_SYS_TIME_H) + CHECK_INCLUDE_FILES(sys/ndir.h HAVE_SYS_NDIR_H) + CHECK_INCLUDE_FILES(sys/utsname.h HAVE_SYS_UTSNAME_H) + CHECK_INCLUDE_FILES(sys/dir.h HAVE_SYS_DIR_H) + CHECK_INCLUDE_FILES(ndir.h HAVE_NDIR_H) + CHECK_FUNCTION_EXISTS(getcwd HAVE_GETCWD) + CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DLOPEN) +ENDIF (UNIX OR NOT WIN32) + +CONFIGURE_FILE("paths.h.in" "${CMAKE_CURRENT_BINARY_DIR}/paths.h") + +SET(src + "${CMAKE_CURRENT_SOURCE_DIR}/paths.c" + "${CMAKE_CURRENT_BINARY_DIR}/paths.h" ) + +SET(luasrc + "${CMAKE_CURRENT_SOURCE_DIR}/init.lua") + +# When using MSVC +IF(MSVC) + # we want to respect the standard, and we are bored of those **** . + ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE=1) +ENDIF(MSVC) + +ADD_LIBRARY("paths" MODULE ${src}) +SET_TARGET_PROPERTIES("paths" PROPERTIES + PREFIX "lib" + IMPORT_PREFIX "lib") + +IF(APPLE) + SET_TARGET_PROPERTIES("paths" PROPERTIES + LINK_FLAGS "-undefined dynamic_lookup") +ENDIF() + +INSTALL(FILES ${luasrc} DESTINATION ${LUALIBDIR}/paths) +INSTALL(TARGETS paths + LIBRARY DESTINATION ${LUALIBDIR} + RUNTIME DESTINATION ${LUALIBDIR}) + +IF(LUALIB) + TARGET_LINK_LIBRARIES(paths ${LUALIB}) +ENDIF() |