[llvm] r250333 - [CMake] Make LLVM_VERSION_* variables user definable
Chris Bieneman via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 14 14:50:09 PDT 2015
Author: cbieneman
Date: Wed Oct 14 16:50:09 2015
New Revision: 250333
URL: http://llvm.org/viewvc/llvm-project?rev=250333&view=rev
Log:
[CMake] Make LLVM_VERSION_* variables user definable
CMake's set command overwrites existing values. Package maintainers may want or need to set the version variables manually, so we need to only set them if they are not already defined. Note I use the "if(NOT DEFINED ...)" syntax deliberately in the last case because empty string is a valid value for the suffx, but not the other variables.
Modified:
llvm/trunk/CMakeLists.txt
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=250333&r1=250332&r2=250333&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Wed Oct 14 16:50:09 2015
@@ -26,10 +26,18 @@ else()
set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
endif()
-set(LLVM_VERSION_MAJOR 3)
-set(LLVM_VERSION_MINOR 8)
-set(LLVM_VERSION_PATCH 0)
-set(LLVM_VERSION_SUFFIX svn)
+if(NOT LLVM_VERSION_MAJOR)
+ set(LLVM_VERSION_MAJOR 3)
+endif()
+if(NOT LLVM_VERSION_MINOR)
+ set(LLVM_VERSION_MINOR 8)
+endif()
+if(NOT LLVM_VERSION_PATCH)
+ set(LLVM_VERSION_PATCH 0)
+endif()
+if(NOT DEFINED LLVM_VERSION_SUFFIX)
+ set(LLVM_VERSION_SUFFIX svn)
+endif()
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
More information about the llvm-commits
mailing list