diff --git a/fileformat/CMakeLists.txt b/fileformat/CMakeLists.txt index 3944ef9d..605fa27f 100644 --- a/fileformat/CMakeLists.txt +++ b/fileformat/CMakeLists.txt @@ -14,3 +14,9 @@ option(AW_ENABLE_IMAGE "Enable libawimage" OFF) if (AW_ENABLE_IMAGE) add_subdirectory(image) endif() + +## 3D mesh/scene file support +option(AW_ENABLE_MESH "Enable libawmesh" OFF) +if (AW_ENABLE_MESH) + add_subdirectory(mesh) +endif() diff --git a/fileformat/mesh/CMakeLists.txt b/fileformat/mesh/CMakeLists.txt new file mode 100644 index 00000000..0573568e --- /dev/null +++ b/fileformat/mesh/CMakeLists.txt @@ -0,0 +1,16 @@ + +aw_add_library(awmesh STATIC + GLOB_HEADERS + SOURCES + obj_loader.c++ mtl_loader.c++ shared.h + EXPORT_NAME + mesh) + + #AW_MANUAL_TEST +#target_compile_definitions(awmesh PRIVATE AW_MODULE_GRAPHICS) + +target_link_libraries(awmesh + PUBLIC + awio + awlog + awstring) diff --git a/graphics/meshes/data/test.png.txt b/fileformat/mesh/data/test.png.txt similarity index 100% rename from graphics/meshes/data/test.png.txt rename to fileformat/mesh/data/test.png.txt diff --git a/graphics/meshes/include/aw/fileformat/obj/loader.h b/fileformat/mesh/include/aw/fileformat/obj/loader.h similarity index 100% rename from graphics/meshes/include/aw/fileformat/obj/loader.h rename to fileformat/mesh/include/aw/fileformat/obj/loader.h diff --git a/graphics/meshes/mtl_loader.c++ b/fileformat/mesh/mtl_loader.c++ similarity index 100% rename from graphics/meshes/mtl_loader.c++ rename to fileformat/mesh/mtl_loader.c++ diff --git a/graphics/meshes/obj_loader.c++ b/fileformat/mesh/obj_loader.c++ similarity index 100% rename from graphics/meshes/obj_loader.c++ rename to fileformat/mesh/obj_loader.c++ diff --git a/graphics/meshes/shared.h b/fileformat/mesh/shared.h similarity index 100% rename from graphics/meshes/shared.h rename to fileformat/mesh/shared.h diff --git a/graphics/CMakeLists.txt b/graphics/CMakeLists.txt index 710abe0b..edab0ff9 100644 --- a/graphics/CMakeLists.txt +++ b/graphics/CMakeLists.txt @@ -1,4 +1,3 @@ add_subdirectory(test) add_subdirectory(gl) add_subdirectory(renderer) -add_subdirectory(meshes) diff --git a/graphics/meshes/CMakeLists.txt b/graphics/meshes/CMakeLists.txt deleted file mode 100644 index c38798bf..00000000 --- a/graphics/meshes/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ - -aw_add_library(awobj STATIC - GLOB_HEADERS - SOURCES - obj_loader.c++ mtl_loader.c++ shared.h - EXPORT_NAME - graphics-importer) - - #AW_MANUAL_TEST -#target_compile_definitions(awobj PRIVATE AW_MODULE_GRAPHICS) - -target_link_libraries(awobj - PUBLIC - awio - awlog - awstring) diff --git a/graphics/renderer/CMakeLists.txt b/graphics/renderer/CMakeLists.txt index 21b978d4..f17bfc34 100644 --- a/graphics/renderer/CMakeLists.txt +++ b/graphics/renderer/CMakeLists.txt @@ -25,6 +25,6 @@ target_link_libraries(awgraphics PUBLIC awio awmath - awimage - awobj + awimage # TODO: remove + awmesh # TODO: remove awgl) diff --git a/graphics/test/CMakeLists.txt b/graphics/test/CMakeLists.txt index 268d999a..17a09ebf 100644 --- a/graphics/test/CMakeLists.txt +++ b/graphics/test/CMakeLists.txt @@ -9,7 +9,7 @@ target_link_libraries(rendertest PUBLIC awio awgraphics - awobj + awmesh awimage awlog awhudf