cmake_minimum_required(VERSION 3.19)
set(CMAKE_POLICY_DEFAULT_CMP0110 NEW) # requires CMake 3.19

project(CityHash CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

if(APPLE)
	set(CMAKE_MACOSX_RPATH OFF)
else()
	if(UNIX)
		set(BUILD_SHARED_LIBS ON)
	endif()
	set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
	set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()

add_library(CityHash INTERFACE)
target_include_directories(CityHash INTERFACE include)

install(
    DIRECTORY
        include/cityhash
    DESTINATION
        include
)
