[llvm] r189615 - Substitute LLVM's version into the msbuild property file at config time
Reid Kleckner
reid at kleckner.net
Thu Aug 29 15:09:43 PDT 2013
Author: rnk
Date: Thu Aug 29 17:09:43 2013
New Revision: 189615
URL: http://llvm.org/viewvc/llvm-project?rev=189615&view=rev
Log:
Substitute LLVM's version into the msbuild property file at config time
Requires shuffling the CPack code up before add_subdirectory(tools), but
that's where the version settings are anyway.
Added:
llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in
Removed:
llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/tools/msbuild/CMakeLists.txt
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=189615&r1=189614&r2=189615&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Thu Aug 29 17:09:43 2013
@@ -35,6 +35,27 @@ set(PACKAGE_NAME LLVM)
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "http://llvm.org/bugs/")
+# Configure CPack.
+set(CPACK_PACKAGE_VENDOR "LLVM")
+set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
+if( LLVM_APPEND_VC_REV )
+ add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH)
+else()
+ set(CPACK_PACKAGE_VERSION_PATCH "svn")
+endif()
+set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.TXT")
+if(WIN32 AND NOT UNIX)
+ set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\cmake\\\\nsis_logo.bmp")
+ set(CPACK_NSIS_MODIFY_PATH "ON")
+ set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
+ set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
+ "ExecWait '$INSTDIR/tools/msbuild/install.bat'")
+ set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
+ "ExecWait '$INSTDIR/tools/msbuild/uninstall.bat'")
+endif()
+include(CPack)
+
# Sanity check our source directory to make sure that we are not trying to
# generate an in-tree build (unless on MSVC_IDE, where it is ok), and to make
# sure that we don't have any stray generated files lying around in the tree
@@ -500,26 +521,6 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
)
endif()
-set(CPACK_PACKAGE_VENDOR "LLVM")
-set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
-set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR})
-if( LLVM_APPEND_VC_REV )
- add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH)
-else()
- set(CPACK_PACKAGE_VERSION_PATCH "svn")
-endif()
-set(CPACK_RESOURCE_FILE_LICENSE "${LLVM_MAIN_SRC_DIR}/LICENSE.TXT")
-if(WIN32 AND NOT UNIX)
- set(CPACK_PACKAGE_ICON "${LLVM_MAIN_SRC_DIR}\\\\cmake\\\\nsis_logo.bmp")
- set(CPACK_NSIS_MODIFY_PATH "ON")
- set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL "ON")
- set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
- "ExecWait '$INSTDIR/tools/msbuild/install.bat'")
- set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
- "ExecWait '$INSTDIR/tools/msbuild/uninstall.bat'")
-endif()
-include(CPack)
-
# Workaround for MSVS10 to avoid the Dialog Hell
# FIXME: This could be removed with future version of CMake.
if(MSVC_VERSION EQUAL 1600)
Modified: llvm/trunk/tools/msbuild/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/msbuild/CMakeLists.txt?rev=189615&r1=189614&r2=189615&view=diff
==============================================================================
--- llvm/trunk/tools/msbuild/CMakeLists.txt (original)
+++ llvm/trunk/tools/msbuild/CMakeLists.txt Thu Aug 29 17:09:43 2013
@@ -1,9 +1,15 @@
if (WIN32)
+ set(prop_file "Microsoft.Cpp.Win32.llvm.props")
+
+ # CPack will install a registry key in this format that we wish to reference.
+ set(REG_KEY "${CMAKE_PROJECT_NAME} ${CPACK_PACKAGE_VERSION}")
+ configure_file(${prop_file}.in ${prop_file})
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${prop_file}" DESTINATION tools/msbuild)
+
install(DIRECTORY .
DESTINATION tools/msbuild
FILES_MATCHING
PATTERN "*.targets"
- PATTERN "*.props"
PATTERN "*.bat"
PATTERN ".svn" EXCLUDE
)
Removed: llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props?rev=189614&view=auto
==============================================================================
--- llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props (original)
+++ llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props (removed)
@@ -1,9 +0,0 @@
-<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v100\Microsoft.Cpp.$(Platform).v100.props"/>
-
- <PropertyGroup>
- <ClangInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\LLVM 3.4.svn)</ClangInstallDir>
- <ClangInstallDir Condition="'$(ClangInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\LLVM 3.4.svn)</ClangInstallDir>
- <ExecutablePath>$(ClangInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
- </PropertyGroup>
-</Project>
Added: llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in?rev=189615&view=auto
==============================================================================
--- llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in (added)
+++ llvm/trunk/tools/msbuild/Microsoft.Cpp.Win32.llvm.props.in Thu Aug 29 17:09:43 2013
@@ -0,0 +1,9 @@
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(VCTargetsPath)\Platforms\$(Platform)\PlatformToolsets\v100\Microsoft.Cpp.$(Platform).v100.props"/>
+
+ <PropertyGroup>
+ <LLVMInstallDir>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\LLVM\@REG_KEY@)</LLVMInstallDir>
+ <LLVMInstallDir Condition="'$(LLVMInstallDir)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LLVM\@REG_KEY@)</LLVMInstallDir>
+ <ExecutablePath>$(LLVMInstallDir)\msbuild-bin;$(ExecutablePath)</ExecutablePath>
+ </PropertyGroup>
+</Project>
More information about the llvm-commits
mailing list