diff --git a/CMakeLists.txt b/CMakeLists.txt index 35be6e286..cca75a122 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,9 @@ include(conan_setup) # The marked constants in application.hpp will be replaced with the following values set(INEXOR_ENGINE_NAME "Inexor Engine") +set(INEXOR_DEV_TEAM_NAME "Inexor Collective") set(INEXOR_APP_NAME "Inexor Vulkan-renderer example") +set(INEXOR_LICENSE "MIT License") set(INEXOR_ENGINE_VERSION_MAJOR 0) set(INEXOR_ENGINE_VERSION_MINOR 1) @@ -60,8 +62,13 @@ execute_process( ) add_subdirectory(shaders) + add_subdirectory(src) +if(MSVC) + add_subdirectory(platform/windows) +endif() + if(INEXOR_BUILD_BENCHMARKS) add_subdirectory(benchmarks) endif() diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 44d5eb47c..8f2bc1032 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,4 +1,13 @@ -add_executable(inexor-vulkan-renderer-example main.cpp) +if(MSVC) +add_executable(inexor-vulkan-renderer-example + main.cpp + ${CMAKE_BINARY_DIR}/include/inexor/vulkan-renderer/win_resource_file.rc +) +else() +add_executable(inexor-vulkan-renderer-example + main.cpp +) +endif() set_target_properties( inexor-vulkan-renderer-example PROPERTIES diff --git a/include/inexor/vulkan-renderer/meta.hpp.in b/include/inexor/vulkan-renderer/meta.hpp.in index 4c0b01c7a..c926a5d89 100644 --- a/include/inexor/vulkan-renderer/meta.hpp.in +++ b/include/inexor/vulkan-renderer/meta.hpp.in @@ -6,14 +6,16 @@ namespace inexor::vulkan_renderer { /// The following data will be replaced by CMake setup. constexpr const char *APP_NAME{"${INEXOR_APP_NAME}"}; -constexpr std::array APP_VERSION{${INEXOR_APP_VERSION_MAJOR}, ${INEXOR_APP_VERSION_MINOR}, - ${INEXOR_APP_VERSION_PATCH}}; +constexpr std::array APP_VERSION{${INEXOR_APP_VERSION_MAJOR}, ${INEXOR_APP_VERSION_MINOR}, ${INEXOR_APP_VERSION_PATCH}}; constexpr const char *APP_VERSION_STR{"${INEXOR_APP_VERSION_MAJOR}.${INEXOR_APP_VERSION_MINOR}.${INEXOR_APP_VERSION_PATCH}"}; constexpr const char* ENGINE_NAME{"${INEXOR_ENGINE_NAME}"}; -constexpr std::array ENGINE_VERSION{${INEXOR_ENGINE_VERSION_MAJOR}, ${INEXOR_ENGINE_VERSION_MINOR}, - ${INEXOR_ENGINE_VERSION_PATCH}}; +constexpr std::array ENGINE_VERSION{${INEXOR_ENGINE_VERSION_MAJOR}, ${INEXOR_ENGINE_VERSION_MINOR}, ${INEXOR_ENGINE_VERSION_PATCH}}; constexpr const char *ENGINE_VERSION_STR{"${INEXOR_ENGINE_VERSION_MAJOR}.${INEXOR_ENGINE_VERSION_MINOR}.${INEXOR_ENGINE_VERSION_PATCH}"}; constexpr const char *BUILD_GIT = "${INEXOR_GIT_SHA}"; -constexpr const char *BUILD_TYPE = "${CMAKE_BUILD_TYPE}"; +#ifdef NDEBUG +constexpr const char *BUILD_TYPE = "Release"; +#else +constexpr const char *BUILD_TYPE = "Debug"; +#endif } // namespace inexor::vulkan_renderer diff --git a/platform/windows/CMakeLists.txt b/platform/windows/CMakeLists.txt new file mode 100644 index 000000000..7c093b40f --- /dev/null +++ b/platform/windows/CMakeLists.txt @@ -0,0 +1 @@ +configure_file(win_resource_file.rc.in ${CMAKE_BINARY_DIR}/include/inexor/vulkan-renderer/win_resource_file.rc) diff --git a/platform/windows/inexor_icon_256px.ico b/platform/windows/inexor_icon_256px.ico new file mode 100644 index 000000000..ab3be7a55 Binary files /dev/null and b/platform/windows/inexor_icon_256px.ico differ diff --git a/platform/windows/win_resource_file.rc.in b/platform/windows/win_resource_file.rc.in new file mode 100644 index 000000000..2c1eb0801 --- /dev/null +++ b/platform/windows/win_resource_file.rc.in @@ -0,0 +1,40 @@ +#define APSTUDIO_READONLY_SYMBOLS +#include "winres.h" +#undef APSTUDIO_READONLY_SYMBOLS + +VS_VERSION_INFO VERSIONINFO + FILEVERSION ${INEXOR_APP_VERSION_MAJOR},${INEXOR_APP_VERSION_MINOR},${INEXOR_APP_VERSION_PATCH},0 + PRODUCTVERSION ${INEXOR_ENGINE_VERSION_MAJOR},${INEXOR_ENGINE_VERSION_MINOR},${INEXOR_ENGINE_VERSION_PATCH},0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040704b0" + BEGIN + // These placeholders will be filled out with the values specified by CMake + VALUE "CompanyName", "${INEXOR_DEV_TEAM_NAME}" + VALUE "FileDescription", "${INEXOR_APP_NAME}" + VALUE "FileVersion", "${INEXOR_APP_VERSION_MAJOR}.${INEXOR_APP_VERSION_MINOR}.${INEXOR_APP_VERSION_PATCH}" + VALUE "InternalName", "${INEXOR_ENGINE_NAME}" + VALUE "LegalCopyright", "${INEXOR_LICENSE}" + VALUE "OriginalFilename", "${INEXOR_APP_NAME}" + VALUE "ProductName", "${INEXOR_APP_NAME}" + VALUE "ProductVersion", "${INEXOR_ENGINE_VERSION_MAJOR}.${INEXOR_ENGINE_VERSION_MINOR}.${INEXOR_ENGINE_VERSION_PATCH}" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 1200 + END +END + +// Use Inexor logo as icon for executable +IDI_ICON1 ICON "${PROJECT_SOURCE_DIR}\\platform\\windows\\inexor_icon_256px.ico"