Advertisement
Vlad3955

CMakeLists.txt

Aug 19th, 2023
2,166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.90 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.20)
  2.  
  3. project(fillMongo C CXX)
  4.  
  5. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
  6. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
  7.  
  8. #set(CMAKE_CXX_STANDARD 17)
  9. #set(CMAKE_CXX_STANDARD_REQUIRED ON)
  10. #set(CMAKE_CXX_EXTENSIONS OFF)
  11.  
  12. find_package(mongocxx REQUIRED)
  13. #set(THREADS_PREFER_PTHREAD_FLAG ON)
  14. #find_package(Threads REQUIRED)
  15.  
  16. set(${PROJECT_NAME}_SRC "./src/main.cpp")
  17.  
  18. source_group(source FILES ${${PROJECT_NAME}_SRC})
  19.  
  20. add_executable("${PROJECT_NAME}" "${${PROJECT_NAME}_SRC}")
  21.  
  22. #target_link_libraries("${PROJECT_NAME}" PRIVATE mongo::mongocxx_static mongo::bsoncxx_static Threads::Threads)
  23.  
  24. if(TARGET mongo::mongocxx_shared)
  25.   target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_shared mongo::bsoncxx_shared)
  26. else()
  27.   target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_static mongo::bsoncxx_static)
  28. endif()
  29.  
  30.  
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement