diff --git a/.gitmodules b/.gitmodules index 8ed95be..4c20f4a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "m4/nc"] path = m4/nc url = git://git.nerdcruft.net/autocruft +[submodule "cmake"] + path = cmake + url = git://git.nerdcruft.net/cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..70a005a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,96 @@ +############################################################################### +cmake_minimum_required(VERSION 3.7.1) +project(cruft-vulkan CXX) + +list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) +include (nc) + + +############################################################################### +include (FindVulkan) +if (NOT Vulkan_FOUND) + message (FATAL_ERROR "Vulkan client library not found") +endif () + + +##----------------------------------------------------------------------------- +include (FindLibXslt) +if (NOT LIBXSLT_XSLTPROC_EXECUTABLE) + message (FATAL_ERROR "xsltproc is required to generate the API headers") +endif() + + +############################################################################### +include_directories ("${CMAKE_CURRENT_BINARY_DIR}") + + +##----------------------------------------------------------------------------- +add_custom_command ( +OUTPUT + "${CMAKE_CURRENT_BINARY_DIR}/vk.hpp" +COMMENT + "[xsltproc] vk.hpp" +COMMAND + "${LIBXSLT_XSLTPROC_EXECUTABLE}" + --output "${CMAKE_CURRENT_BINARY_DIR}/vk.hpp" + "${CMAKE_CURRENT_SOURCE_DIR}/vk.xsl" + "${CMAKE_CURRENT_SOURCE_DIR}/vk.xml" +DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/vk.xsl" + "${CMAKE_CURRENT_SOURCE_DIR}/vk.xml" +) + + +##----------------------------------------------------------------------------- +list (APPEND sources + vk.hpp + fwd.hpp + object.cpp + object.hpp + buffer.cpp + buffer.hpp + command_buffer.cpp + command_buffer.hpp + command_pool.cpp + command_pool.hpp + device.cpp + device.hpp + device_memory.cpp + device_memory.hpp + event.cpp + event.hpp + except.cpp + except.hpp + fence.cpp + fence.hpp + framebuffer.cpp + framebuffer.hpp + instance.cpp + instance.hpp + image.cpp + image.hpp + physical_device.cpp + physical_device.hpp + pipeline.cpp + pipeline.hpp + pipeline_cache.cpp + pipeline_cache.hpp + queue.cpp + queue.hpp + render_pass.cpp + render_pass.hpp + semaphore.cpp + semaphore.hpp + shader_module.cpp + shader_module.hpp + traits.hpp +) + + +##----------------------------------------------------------------------------- +add_library (cruft-vk STATIC ${sources}) + + +############################################################################### +configure_file(libcruft-vk-system.pc.in libcruft-vk.pc) +configure_file(Doxyfile.in Doxyfile) diff --git a/cmake b/cmake new file mode 160000 index 0000000..c640c55 --- /dev/null +++ b/cmake @@ -0,0 +1 @@ +Subproject commit c640c55181ec55002c4a3e3101b1a6f8226a21bb