cmake: Generate obs.rc out-of-tree

Fixes the `obs.rc` file appearing in the UI source tree and moves it
into the out-of-tree build directories provided by CMake. Projects
requiring this can use it by adding `${obs-studio_BINARY_DIR}/obs.rc`
to their source list.
上级 6550c0df
......@@ -32,16 +32,6 @@ include(ObsHelpers)
include(ObsCpack)
include(GNUInstallDirs)
if(WIN32)
string(REPLACE "-" ";" UI_VERSION_SPLIT ${OBS_VERSION})
list(GET UI_VERSION_SPLIT 0 UI_VERSION)
string(REPLACE "." ";" UI_VERSION_SEMANTIC ${UI_VERSION})
list(GET UI_VERSION_SEMANTIC 0 UI_VERSION_MAJOR)
list(GET UI_VERSION_SEMANTIC 1 UI_VERSION_MINOR)
list(GET UI_VERSION_SEMANTIC 2 UI_VERSION_PATCH)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/UI/obs.rc.in ${CMAKE_CURRENT_SOURCE_DIR}/UI/obs.rc)
endif()
# Must be a string in the format of "x.x.x-rcx"
if(DEFINED RELEASE_CANDIDATE)
set(OBS_VERSION "${RELEASE_CANDIDATE}")
......@@ -59,6 +49,17 @@ else()
set(OBS_RELEASE_CANDIDATE 0)
endif()
# Binary Versioning for Windows
if(WIN32)
string(REPLACE "-" ";" UI_VERSION_SPLIT ${OBS_VERSION})
list(GET UI_VERSION_SPLIT 0 UI_VERSION)
string(REPLACE "." ";" UI_VERSION_SEMANTIC ${UI_VERSION})
list(GET UI_VERSION_SEMANTIC 0 UI_VERSION_MAJOR)
list(GET UI_VERSION_SEMANTIC 1 UI_VERSION_MINOR)
list(GET UI_VERSION_SEMANTIC 2 UI_VERSION_PATCH)
configure_file(UI/obs.rc.in ${PROJECT_BINARY_DIR}/obs.rc)
endif()
if(MSVC AND NOT EXISTS "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user")
file(GENERATE
OUTPUT "${CMAKE_BINARY_DIR}/ALL_BUILD.vcxproj.user"
......
......@@ -97,7 +97,7 @@ if(WIN32)
win-update/update-window.cpp
win-update/win-update.cpp
win-update/win-update-helpers.cpp
obs.rc)
${obs-studio_BINARY_DIR}/obs.rc)
set(obs_PLATFORM_HEADERS
win-update/update-window.hpp
win-update/win-update.hpp
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册