diff --git a/CMakeLists.txt b/CMakeLists.txt index 18d3b69..6f40b95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,15 +9,13 @@ if (POLICY CMP0141) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() -# Includes -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) - # CMAKE_TOOLCHAIN_FILE include("C:/vcpkg/scripts/buildsystems/vcpkg.cmake") - project ("xna") # Include sub-projects. +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc) add_subdirectory ("framework") +add_subdirectory ("samples") diff --git a/framework/CMakeLists.txt b/framework/CMakeLists.txt index 6a10b7d..af67c30 100644 --- a/framework/CMakeLists.txt +++ b/framework/CMakeLists.txt @@ -3,8 +3,8 @@ # # Add source to this project's executable. -add_executable (xna WIN32 -"xna.cpp" +add_library (Xn65 STATIC +"../samples/xna.cpp" "csharp/stream.cpp" "game/component.cpp" "content/manager.cpp" @@ -45,11 +45,11 @@ add_executable (xna WIN32 "platform-dx/audioengine.cpp" ) if (CMAKE_VERSION VERSION_GREATER 3.12) - set_property(TARGET xna PROPERTY CXX_STANDARD 20) + set_property(TARGET Xn65 PROPERTY CXX_STANDARD 20) endif() # TODO: Add tests and install targets if needed. find_package(directxtk CONFIG REQUIRED) -target_link_libraries(${PROJECT_NAME} D3d11.lib dxgi.lib dxguid.lib d3dcompiler.lib Microsoft::DirectXTK) +target_link_libraries(Xn65 D3d11.lib dxgi.lib dxguid.lib d3dcompiler.lib Microsoft::DirectXTK) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 0000000..18aea9f --- /dev/null +++ b/samples/CMakeLists.txt @@ -0,0 +1,13 @@ +# CMakeList.txt : CMake project for CmakeSharedExeTest, include source and define +# project specific logic here. +# + +# Add source to this project's executable. +add_executable (SampleApp WIN32 "xna.cpp") + +if (CMAKE_VERSION VERSION_GREATER 3.12) + set_property(TARGET SampleApp PROPERTY CXX_STANDARD 20) +endif() + +# TODO: Add tests and install targets if needed. +target_link_libraries(SampleApp Xn65) diff --git a/framework/xna.cpp b/samples/xna.cpp similarity index 96% rename from framework/xna.cpp rename to samples/xna.cpp index 0f74d87..6b03c09 100644 --- a/framework/xna.cpp +++ b/samples/xna.cpp @@ -27,7 +27,7 @@ namespace xna { void LoadContent() override { spriteBatch = New(*graphicsDevice); - texture = Content()->Load("idle"); + texture = Content()->Load("sampleTexture"); Game::LoadContent(); }