Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.20)
- project(fillMongo C CXX)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
- #set(CMAKE_CXX_STANDARD 17)
- #set(CMAKE_CXX_STANDARD_REQUIRED ON)
- #set(CMAKE_CXX_EXTENSIONS OFF)
- find_package(mongocxx REQUIRED)
- #set(THREADS_PREFER_PTHREAD_FLAG ON)
- #find_package(Threads REQUIRED)
- set(${PROJECT_NAME}_SRC "./src/main.cpp")
- source_group(source FILES ${${PROJECT_NAME}_SRC})
- add_executable("${PROJECT_NAME}" "${${PROJECT_NAME}_SRC}")
- #target_link_libraries("${PROJECT_NAME}" PRIVATE mongo::mongocxx_static mongo::bsoncxx_static Threads::Threads)
- if(TARGET mongo::mongocxx_shared)
- target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_shared mongo::bsoncxx_shared)
- else()
- target_link_libraries(${PROJECT_NAME} PRIVATE mongo::mongocxx_static mongo::bsoncxx_static)
- endif()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement