2017-08-24 23:27:32 +08:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
|
|
|
project(rhash C)
|
|
|
|
|
|
|
|
file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/Makefile RHASH_SOURCES REGEX "^SOURCES = .*$")
|
|
|
|
string(REPLACE "SOURCES = " "" RHASH_SOURCES "${RHASH_SOURCES}")
|
|
|
|
string(REPLACE " " ";" RHASH_SOURCES "${RHASH_SOURCES}")
|
2020-11-06 10:24:53 +08:00
|
|
|
add_definitions(-DRHASH_XVERSION="${RHASH_XVERSION}")
|
2017-08-24 23:27:32 +08:00
|
|
|
add_library(rhash ${RHASH_SOURCES})
|
|
|
|
set_target_properties(rhash PROPERTIES COMPILE_DEFINITIONS "IN_RHASH" DEFINE_SYMBOL "RHASH_EXPORTS")
|
|
|
|
|
|
|
|
install(TARGETS rhash RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
|
|
|
|
|
|
|
|
if(NOT RHASH_SKIP_HEADERS)
|
|
|
|
install(FILES rhash.h rhash_torrent.h DESTINATION include)
|
|
|
|
endif()
|