add_library(
	OxModel
		desctypes.cpp
		descwrite.cpp
		modelvalue.cpp
)

if(NOT MSVC)
	target_compile_options(OxModel PRIVATE -Wconversion)
	target_compile_options(OxModel PRIVATE -Wsign-conversion)
endif()

target_link_libraries(
	OxModel PUBLIC
		OxStd
)

if(NOT OX_BARE_METAL)
	set_property(
		TARGET
			OxModel
		PROPERTY
			POSITION_INDEPENDENT_CODE ON
	)
endif()

install(
	FILES
		def.hpp
		descread.hpp
		desctypes.hpp
		descwrite.hpp
		optype.hpp
		metadata.hpp
		model.hpp
		modelhandleradaptor.hpp
		modelops.hpp
		modelvalue.hpp
		typenamecatcher.hpp
		types.hpp
		typestore.hpp
		walk.hpp
	DESTINATION
		include/ox/model
)

install(TARGETS OxModel
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib
)

if(OX_RUN_TESTS)
	add_subdirectory(test)
endif()
