Ver código fonte

Merge pull request #1755 from Xaymar/patch-generate-obs-rc

obs-studio: Create obs.rc out-of-tree using the build path
Jim 6 anos atrás
pai
commit
975aed836c
2 arquivos alterados com 12 adições e 11 exclusões
  1. 11 10
      CMakeLists.txt
  2. 1 1
      UI/CMakeLists.txt

+ 11 - 10
CMakeLists.txt

@@ -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"

+ 1 - 1
UI/CMakeLists.txt

@@ -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