cmake_minimum_required(VERSION 3.3)

set(LIBRARIES "C:/Users/Jim/Code/Libraries")

set(SKETCHUP_SDK ${LIBRARIES}/SketchUp/SDK_Win_16-0-18837)

set(SKETCHUP_HEADER_DIR ${SKETCHUP_SDK}/headers)
set(SKETCHUP_LIB_DIR ${SKETCHUP_SDK}/binaries/sketchup/x86)
set(SKETCHUP_DLL ${SKETCHUP_LIB_DIR}/SketchUpAPI.dll)

set(ASSIMP_HEADER_DIR "${LIBRARIES}/assimp/include")
set(ASSIMP_LIB_DIR "${LIBRARIES}/assimp/build/code/Release")
set(ASSIMP_DLL "${ASSIMP_LIB_DIR}/assimp-vc130-mt.dll")

project(a2s)

include_directories(${SKETCHUP_HEADER_DIR})
include_directories(${ASSIMP_HEADER_DIR})

find_library(SK sketchupapi "${SKETCHUP_LIB_DIR}")
find_library(AI assimp-vc130-mt "${ASSIMP_LIB_DIR}")

add_executable(a2s a2s.cpp)

target_link_libraries(a2s PUBLIC ${AI})
target_link_libraries(a2s PUBLIC ${SK})

add_custom_command(TARGET a2s POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SKETCHUP_DLL} $<TARGET_FILE_DIR:a2s>
    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ASSIMP_DLL} $<TARGET_FILE_DIR:a2s>
    )

