cmake_minimum_required(VERSION 3.30)
project(BKbin2obj LANGUAGES CXX)


add_executable(BKbin2obj
    ../../shared/getopt.cpp
    ../../shared/StringUtil.cpp
    ../src/Assemble.cpp
    ../src/ConvW2k.cpp
    ../src/ErrorManager.cpp
    ../src/Globals.cpp
    ../src/LabelManager.cpp
    ../src/LabelTable.cpp
    ../src/Listing.cpp
    ../src/Object.cpp
    ../src/Parser.cpp
    ../src/Parser2.cpp
    ../src/pch.cpp
    ../src/Reader.cpp
    ../src/ScriptAsm.cpp
    BKbin2obj.cpp
)

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

target_compile_features(BKbin2obj
    PUBLIC
        cxx_std_20
)

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

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

target_compile_definitions(BKbin2obj
    PUBLIC
        _CONSOLE
        TARGET_BIN2OBJ
        $<$<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 BKbin2obj RUNTIME DESTINATION BKTurbo8)
