Advertisement
HellFinger

Untitled

May 20th, 2022
2,390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.65 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.5)
  2.  
  3. set(CMAKE_CXX_COMPILER "/usr/bin/g++")
  4. set(CMAKE_C_COMPILER "/usr/bin/gcc")
  5.  
  6. project(prj)
  7.  
  8. if(NOT CMAKE_BUILD_TYPE)
  9.   set(CMAKE_BUILD_TYPE Release)
  10. endif()
  11.  
  12. set(CMAKE_CXX_FLAGS_RELEASE "-O2")
  13. set(CMAKE_CXX_FLAGS_RELEASE "-g")
  14. #set(CMAKE_CXX_FLAGS_RELEASE "-pg")
  15.  
  16. set (CMAKE_CXX_STANDARD 17)
  17.  
  18.  
  19.  
  20.  
  21. set(Boost_USE_STATIC_LIBS        ON)
  22. set(Boost_USE_MULTITHREADED      ON)
  23. set(Boost_USE_STATIC_RUNTIME    OFF)
  24.  
  25. find_package(Boost)
  26.  
  27. IF (Boost_FOUND)
  28.     include_directories(${Boost_INCLUDE_DIR})
  29.     add_definitions( "-DHAS_BOOST" )
  30. ENDIF()
  31.  
  32. set(Boost_USE_STATIC_LIBS ON)
  33.  
  34.  
  35. set(FARM_LIB ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/farmhash.cc ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/farmhash.h)
  36. set(FAST_LIB ${CMAKE_CURRENT_SOURCE_DIR}/fasthash/fasthash.c ${CMAKE_CURRENT_SOURCE_DIR}/fasthash/fasthash.h)
  37. set(CITY_LIB ${CMAKE_CURRENT_SOURCE_DIR}/cityhash/city.cc ${CMAKE_CURRENT_SOURCE_DIR}/cityhash/citycrc.h)
  38. set(METRO_LIB ${CMAKE_CURRENT_SOURCE_DIR}/metro_hash/metrohash64.cpp ${CMAKE_CURRENT_SOURCE_DIR}/metro_hash/metrohash64.h)
  39. set(SOURCE_LIB hash_wrappers.cpp)
  40.  
  41.  
  42.  
  43. add_library(farmhash STATIC ${FARM_LIB})
  44. add_library(fasthash STATIC ${FAST_LIB})
  45. add_library(cityhash STATIC ${CITY_LIB})
  46. add_library(metrohash STATIC ${metro_LIB})
  47. add_library(hash_wrappers STATIC ${SOURCE_LIB})
  48.  
  49. target_include_directories(hash_wrappers
  50.     PUBLIC
  51.         ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/)
  52.  
  53.  
  54. add_executable(main main.cpp)
  55. target_link_libraries(main hash_wrappers farmhash) #fasthash cityhash metrohash)
  56.  
  57. if(FALSE)
  58. target_include_directories(main
  59.     PUBLIC
  60.         ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/)
  61. endif()
  62.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement