cmake_minimum_required(VERSION 3.30)
project(BKTools LANGUAGES CXX)


add_executable(BKTools
    ../../shared/getopt.cpp
    ../src/ConvW2k.cpp
    ../src/pch.cpp
    BKCrun.cpp
    BKPack.cpp
    BKTools.cpp
    BKUnPack.cpp
)

set_target_properties(BKTools PROPERTIES
    OUTPUT_NAME "BKTools"
    MSVC_RUNTIME_LIBRARY "$<$<CONFIG:Debug>:MultiThreadedDebugDLL>"
)

target_compile_features(BKTools
    PUBLIC
        cxx_std_20
)

target_precompile_headers(BKTools
    PRIVATE
        ${CMAKE_CURRENT_SOURCE_DIR}/../src/pch.h
)

target_include_directories(BKTools
    PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}
        ${CMAKE_CURRENT_SOURCE_DIR}/../src
        ${CMAKE_SOURCE_DIR}/../shared
)

target_compile_definitions(BKTools
    PUBLIC
        _CONSOLE
        TARGET_BKTOOLS
        $<$<CONFIG:Debug>:_DEBUG>
        $<$<CONFIG:Release>:NDEBUG>

)

set(dir ${CMAKE_SOURCE_DIR}/../temp/BKTurbo8)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${dir})
set(CMAKE_BUILD_FILES_DIRECTORY ${dir})
set(CMAKE_BUILD_DIRECTORY ${dir})
set(dir1 ${CMAKE_SOURCE_DIR}/../out)
SET(EXECUTABLE_OUTPUT_PATH ${dir1}/BKTurbo8)
SET(CMAKE_INSTALL_PREFIX ${dir1})

install(TARGETS BKTools RUNTIME DESTINATION BKTurbo8)
