
cmake_minimum_required(VERSION 3.16)

project("examples")

set(CMAKE_CXX_STANDARD 17)

find_package(oosxl REQUIRED CONFIG PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../.. NO_DEFAULT_PATH)

set(SRC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
include_directories("${SRC_ROOT}/include")

file(GLOB_RECURSE SOURCE 
	"main/main.cpp"
	"src/*.cpp"
)

add_executable(${PROJECT_NAME} ${SOURCE})

target_compile_definitions(${PROJECT_NAME} PRIVATE
	PROJECT_ROOT_DIR="${CMAKE_SOURCE_DIR}"
)

target_include_directories(${PROJECT_NAME} PRIVATE include)
target_link_libraries(${PROJECT_NAME} oosxl::oosxl)

if (WIN32)
	add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
		COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OOSXL_DLL_PATH}" $<TARGET_FILE_DIR:${PROJECT_NAME}>
	)
endif()
