# Copyright (c) 2019 - 2026 Ember
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

set(EXECUTABLE_NAME dbutils)

# added so the files so up in an IDE's browser
set(EXECUTABLE_HDR
    DatabaseDetails.h
    QueryExecutor.h
    mysql/MySQLQueryExecutor.h
)

set(EXECUTABLE_SRC
    main.cpp
    mysql/MySQLQueryExecutor.cpp
)

if(WIN32)
    set(EXECUTABLE_SRC ${EXECUTABLE_SRC} resources.rc)
endif()

add_executable(${EXECUTABLE_NAME} ${EXECUTABLE_HDR} ${EXECUTABLE_SRC})
target_link_libraries(${EXECUTABLE_NAME} PRIVATE banner logger shared conpool ${MYSQLCCPP_LIBRARY} ${Boost_LIBRARIES} Threads::Threads)
install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/tools)
set_target_properties(dbutils PROPERTIES FOLDER "Tools")