project(mycurry_gamelib CXX)

PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2)
PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0)
find_package(PNG REQUIRED)

add_library(${PROJECT_NAME}
	csvloader.cpp
	sdlmain.cpp
	ingamescene.cpp
	sizenotifiable.cpp
	sizeratio.cpp
	gamescenebase.cpp
	worldgrid.cpp
	worldviewport.cpp
	inputbag.cpp
	tileiterator.cpp
	texture.cpp
	movingobject.cpp
	character.cpp
	rect_to_sdl.cpp
	worldsizenotifiable.cpp
	worlditems.cpp
	moveable.cpp
	fsgn.cpp
	grid_raytrace.cpp
)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14)
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)

target_include_directories(${PROJECT_NAME} SYSTEM
	PRIVATE ${SDL2_INCLUDE_DIR}
	PRIVATE ${SDL2IMAGE_INCLUDE_DIRS}
	PRIVATE ${PNG_INCLUDE_DIRS}
	PRIVATE ${Boost_INCLUDE_DIRS}
	PRIVATE ${CMAKE_SOURCE_DIR}/lib/tree-2.81/src
)
target_include_directories(${PROJECT_NAME}
	PUBLIC ${CMAKE_SOURCE_DIR}/lib/vectorwrapper/include
	PRIVATE ${CMAKE_BINARY_DIR}
)

target_link_libraries(${PROJECT_NAME}
	PRIVATE ${SDL2_LIBRARIES}
	PRIVATE ${SDL2IMAGE_LIBRARIES}
	PRIVATE ${PNG_LIBRARIES}
	PUBLIC mycurry_toplevel
)

target_compile_definitions(${PROJECT_NAME}
	PRIVATE ${PNG_DEFINITIONS}
	PUBLIC VWR_WITH_IMPLICIT_CONVERSIONS=1
	PUBLIC VWR_EXTRA_ACCESSORS
)
