[Piglit] [PATCH 1/4] cmake: Install under separate piglit directory

Dylan Baker baker.dylan.c at gmail.com
Fri May 2 18:31:28 PDT 2014


From: Jordan Justen <jordan.l.justen at intel.com>

Install paths updated:
* $PREFIX/share/doc => $PREFIX/share/doc/piglit
* $PREFIX/lib => $PREFIX/lib/piglit/lib
* $PREFIX/bin => $PREFIX/lib/piglit/bin
* etc...

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Dylan Baker <baker.dylan.c at gmail.com>
---
 CMakeLists.txt          | 23 +++++++++++++++++------
 cmake/piglit_util.cmake |  4 ++--
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a63b78..c2203d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.6)
 
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
 
+INCLUDE (GNUInstallDirs)
 INCLUDE (CheckCCompilerFlag)
 INCLUDE (CheckCSourceCompiles)
 INCLUDE (CheckCXXCompilerFlag)
@@ -383,6 +384,16 @@ check_include_file(sys/stat.h  HAVE_SYS_STAT_H)
 check_include_file(unistd.h    HAVE_UNISTD_H)
 check_include_file(fcntl.h     HAVE_FCNTL_H)
 
+set(PIGLIT_INSTALL_LIBDIR
+    "${CMAKE_INSTALL_LIBDIR}/piglit")
+if(NOT IS_ABSOLUTE ${PIGLIT_INSTALL_LIBDIR})
+	set(PIGLIT_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${PIGLIT_INSTALL_LIBDIR}")
+else()
+	set(PIGLIT_INSTALL_FULL_LIBDIR "${PIGLIT_INSTALL_LIBDIR}")
+endif()
+
+SET(CMAKE_INSTALL_RPATH "${PIGLIT_INSTALL_FULL_LIBDIR}/lib")
+
 configure_file(
 	"${piglit_SOURCE_DIR}/tests/util/config.h.in"
 	"${piglit_BINARY_DIR}/tests/util/config.h"
@@ -405,7 +416,7 @@ install (
 		COPYING
 		README
 		RELEASE
-	DESTINATION share/doc
+	DESTINATION share/doc/piglit
 )
 
 install (
@@ -417,30 +428,30 @@ install (
 		piglit-summary.py
 		piglit-summary-html.py
 		piglit-summary-junit.py
-	DESTINATION .
+	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
 )
 
 install (
 	DIRECTORY framework
-	DESTINATION .
+	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
 	FILES_MATCHING PATTERN "*.py"
 )
 
 install (
 	DIRECTORY templates
-	DESTINATION .
+	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
 )
 
 install (
 	DIRECTORY tests
-	DESTINATION .
+	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
 	FILES_MATCHING REGEX ".*\\.(py|program_test|shader_test|frag|vert|geom|ktx|cl|txt|vpfp)$"
 	REGEX "CMakeFiles|CMakeLists" EXCLUDE
 )
 
 install (
 	DIRECTORY ${CMAKE_BINARY_DIR}/generated_tests
-	DESTINATION .
+	DESTINATION ${PIGLIT_INSTALL_LIBDIR}
 	FILES_MATCHING REGEX ".*\\.(shader_test|program_test|frag|vert|geom|cl|txt)$"
 	REGEX "CMakeFiles|CMakeLists" EXCLUDE
 )
diff --git a/cmake/piglit_util.cmake b/cmake/piglit_util.cmake
index d3cab44..e2c3454 100644
--- a/cmake/piglit_util.cmake
+++ b/cmake/piglit_util.cmake
@@ -62,7 +62,7 @@ function(piglit_add_executable name)
     add_executable(${name} ${ARGV})
     add_dependencies(${name} piglit_dispatch_gen)
 
-    install(TARGETS ${name} DESTINATION bin)
+    install(TARGETS ${name} DESTINATION ${PIGLIT_INSTALL_LIBDIR}/bin)
 
 endfunction(piglit_add_executable)
 
@@ -81,7 +81,7 @@ function(piglit_add_library name)
         add_library(${name} STATIC ${ARGV})
     else(WIN32)
         add_library(${name} SHARED ${ARGV})
-        install(TARGETS ${name} DESTINATION lib)
+        install(TARGETS ${name} DESTINATION ${PIGLIT_INSTALL_LIBDIR}/lib)
     endif(WIN32)
     add_dependencies(${name} piglit_dispatch_gen)
 
-- 
2.0.0.rc0



More information about the Piglit mailing list