In addition to cleaning things up, this allows more easy access to the 
variables. In the old version, it tried to pass variables as -D flags to cmake, 
but this didn't actually work. CMake drops all of those arguments on the floor 
(try passing garbage through them) and just picks up the limited subset of 
pre-defined macros. So, for example, this fixes the build with 
LLVM_LIBDIR_SUFFIX=64 which is how I ended up here. =]

http://reviews.llvm.org/D4151

Files:
  scripts/CMakeLists.txt
  scripts/lldb_python_module.cmake

Index: scripts/CMakeLists.txt
===================================================================
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -19,7 +19,8 @@
 
 # Install the LLDB python module on all operating systems (except Windows)
 if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
-  install(SCRIPT lldb_python_module.cmake 
-DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" 
-DCMAKE_BUILD_DIR=\"${CMAKE_BUILD_DIR}\")
+  install(DIRECTORY 
${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
+    DESTINATION lib${LLVM_LIBDIR_SUFFIX})
 endif()
 
 # build Python modules
Index: scripts/lldb_python_module.cmake
===================================================================
--- scripts/lldb_python_module.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-# This CMake script installs the LLDB python module from the build directory
-# to the install directory.
-
-# FIXME: if a non-standard version of python is requested, the cmake macro
-# below will need Python_ADDITIONAL_VERSIONS set in order to find it.
-include(FindPythonInterp)
-
-SET(PYTHON_DIRECTORY python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-
-SET(lldb_module_src ${CMAKE_CURRENT_BINARY_DIR}/lib/${PYTHON_DIRECTORY})
-SET(lldb_module_dest "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib")
-
-MESSAGE(STATUS "Installing LLDB python module from: ${lldb_module_src} to 
${lldb_module_dest}")
-FILE(COPY "${lldb_module_src}" DESTINATION "${lldb_module_dest}")
Index: scripts/CMakeLists.txt
===================================================================
--- scripts/CMakeLists.txt
+++ scripts/CMakeLists.txt
@@ -19,7 +19,8 @@
 
 # Install the LLDB python module on all operating systems (except Windows)
 if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
-  install(SCRIPT lldb_python_module.cmake -DCMAKE_INSTALL_PREFIX=\"${CMAKE_INSTALL_PREFIX}\" -DCMAKE_BUILD_DIR=\"${CMAKE_BUILD_DIR}\")
+  install(DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}
+    DESTINATION lib${LLVM_LIBDIR_SUFFIX})
 endif()
 
 # build Python modules
Index: scripts/lldb_python_module.cmake
===================================================================
--- scripts/lldb_python_module.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-# This CMake script installs the LLDB python module from the build directory
-# to the install directory.
-
-# FIXME: if a non-standard version of python is requested, the cmake macro
-# below will need Python_ADDITIONAL_VERSIONS set in order to find it.
-include(FindPythonInterp)
-
-SET(PYTHON_DIRECTORY python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-
-SET(lldb_module_src ${CMAKE_CURRENT_BINARY_DIR}/lib/${PYTHON_DIRECTORY})
-SET(lldb_module_dest "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/lib")
-
-MESSAGE(STATUS "Installing LLDB python module from: ${lldb_module_src} to ${lldb_module_dest}")
-FILE(COPY "${lldb_module_src}" DESTINATION "${lldb_module_dest}")
_______________________________________________
lldb-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to