Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.5)
- set(CMAKE_CXX_COMPILER "/usr/bin/g++")
- set(CMAKE_C_COMPILER "/usr/bin/gcc")
- project(prj)
- if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE Release)
- endif()
- set(CMAKE_CXX_FLAGS_RELEASE "-O2")
- set(CMAKE_CXX_FLAGS_RELEASE "-g")
- #set(CMAKE_CXX_FLAGS_RELEASE "-pg")
- set (CMAKE_CXX_STANDARD 17)
- set(Boost_USE_STATIC_LIBS ON)
- set(Boost_USE_MULTITHREADED ON)
- set(Boost_USE_STATIC_RUNTIME OFF)
- find_package(Boost)
- IF (Boost_FOUND)
- include_directories(${Boost_INCLUDE_DIR})
- add_definitions( "-DHAS_BOOST" )
- ENDIF()
- set(Boost_USE_STATIC_LIBS ON)
- set(FARM_LIB ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/farmhash.cc ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/farmhash.h)
- set(FAST_LIB ${CMAKE_CURRENT_SOURCE_DIR}/fasthash/fasthash.c ${CMAKE_CURRENT_SOURCE_DIR}/fasthash/fasthash.h)
- set(CITY_LIB ${CMAKE_CURRENT_SOURCE_DIR}/cityhash/city.cc ${CMAKE_CURRENT_SOURCE_DIR}/cityhash/citycrc.h)
- set(METRO_LIB ${CMAKE_CURRENT_SOURCE_DIR}/metro_hash/metrohash64.cpp ${CMAKE_CURRENT_SOURCE_DIR}/metro_hash/metrohash64.h)
- set(SOURCE_LIB hash_wrappers.cpp)
- add_library(farmhash STATIC ${FARM_LIB})
- add_library(fasthash STATIC ${FAST_LIB})
- add_library(cityhash STATIC ${CITY_LIB})
- add_library(metrohash STATIC ${metro_LIB})
- add_library(hash_wrappers STATIC ${SOURCE_LIB})
- target_include_directories(hash_wrappers
- PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/)
- add_executable(main main.cpp)
- target_link_libraries(main hash_wrappers farmhash) #fasthash cityhash metrohash)
- if(FALSE)
- target_include_directories(main
- PUBLIC
- ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/)
- endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement