cmake_minimum_required(VERSION 3.16)

project(wfAnotate)

set(SOURCES
    "AcEdInputPointMonitorEx.cpp"
    "ArxMain.cpp"
    "CColorButton.cpp"
    "CharDlg.cpp"
    "CharToolbarDlg.cpp"
    "Dim.cpp"
    "DimMutiPipeEditDlg.cpp"
    "DimPipeElevationDlg.cpp"
    "DimPipeGradientDlg.cpp"
    "DimPipeRadiusDlg.cpp"
    "DimPipeSerialDlg.cpp"
    "DimSanitaryDlg.cpp"
    "DimSinglePipeRadiusDlg.cpp"
    "EditFloorRectDlg.cpp"
    "EditVPipeDimDlg.cpp"
    "FloorRect.cpp"
    "InsTextDlg.cpp"
    "jig.cpp"
    "LeaderDim.cpp"
    "LeaderEdjig.cpp"
    "LeaderTextDlg.cpp"
    "MirrorDim.cpp"
    "MoveDnDim.cpp"
    "mutirowtextdlg.cpp"
    "PipeElevationDlg.cpp"
    "SinglePipeElevation.cpp"
    "SprinklerDimPipeDnDlg.cpp"
    "StdAfx.cpp"
    "Test.cpp"
    "TLeaderAddOtherPtJig.cpp"
    "VPipeDim.cpp"
    "twt_anotate.rc"
    # "wfanotate.def"
)
add_def_file_name(SOURCES "wfanotate")

add_library(wfAnotate SHARED ${SOURCES})

target_set_name_and_suffix(wfAnotate "wfAnotate" ".arx")

target_compile_definitions(wfAnotate PRIVATE
    ACRXAPP
    S4FOX
    S4NT
    TAR_LANGUAGE=1
)

simple_link_cad_sdk(wfAnotate)

target_link_options(wfAnotate PRIVATE 
        "/NODEFAULTLIB:LIBCMT"      # 忽略 Release 版静态 CRT
)

target_link_directories(wfAnotate PRIVATE
    $<$<CONFIG:DEBUG>:${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG}>
    $<$<CONFIG:Release>:${CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE}>
)

target_link_libraries(wfAnotate PRIVATE
    ThirdParty::TG
    #shs_dbf
    #wfK
    #wfpipew
    #wfKernal
)

add_dependencies(wfAnotate wfKernal)

target_precompile_headers(wfAnotate PRIVATE StdAfx.h)
set_debug_post_build(wfAnotate "wfAnotate" ".arx")
