-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
26 lines (20 loc) · 1012 Bytes
/
CMakeLists.txt
File metadata and controls
26 lines (20 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FIND_PACKAGE (Ruby)
IF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR)
SET (RUBY_INSTALL_DIR ${RUBY_VENDORARCH_DIR})
ELSE (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR)
SET (RUBY_INSTALL_DIR ${RUBY_SITEARCH_DIR})
ENDIF (USE_VENDORDIRS AND RUBY_VENDORARCH_DIR)
MESSAGE (STATUS "Ruby executable: ${RUBY_EXECUTABLE}")
MESSAGE (STATUS "Ruby installation dir: ${RUBY_INSTALL_DIR}")
ADD_CUSTOM_COMMAND (
OUTPUT solv_ruby.c
COMMAND ${SWIG_EXECUTABLE} -ruby ${SWIG_FLAGS} -I${CMAKE_SOURCE_DIR}/src -o solv_ruby.c ${CMAKE_SOURCE_DIR}/bindings/solv.i
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_SOURCE_DIR}/bindings/solv.i
)
ADD_DEFINITIONS(-Wno-unused)
INCLUDE_DIRECTORIES (${RUBY_INCLUDE_PATH})
ADD_LIBRARY (bindings_ruby MODULE solv_ruby.c)
SET_TARGET_PROPERTIES (bindings_ruby PROPERTIES PREFIX "" OUTPUT_NAME "solv")
TARGET_LINK_LIBRARIES (bindings_ruby libsolvext libsolv ${RUBY_LIBRARY} ${SYSTEM_LIBRARIES})
INSTALL (TARGETS bindings_ruby LIBRARY DESTINATION ${RUBY_INSTALL_DIR})