Advertisement
HellFinger

Untitled

May 20th, 2022
882
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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(HASH_LIB ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/farmhash.cc ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/farmhash.h)
  36. set(SOURCE_LIB hash_wrappers.cpp)
  37.  
  38.  
  39.  
  40. add_library(farmhash STATIC ${HASH_LIB})
  41. add_library(hash_wrappers STATIC ${SOURCE_LIB})
  42.  
  43. target_include_directories(hash_wrappers
  44.     PUBLIC
  45.         ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/)
  46.  
  47.  
  48. add_executable(main main.cpp)
  49. target_link_libraries(main hash_wrappers farmhash)
  50. target_include_directories(main
  51.     PUBLIC
  52.         ${CMAKE_CURRENT_SOURCE_DIR}/farmhash/)
Advertisement
RAW Paste Data Copied
Advertisement