TheGOro / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

add a post_project_set_up_hermetic_build cmake extension point #467

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
googletest does not provide an out-of-box install target which is 
understandable for its intended use. But cmake export mechanism allows build 
targets to be used by other projects without installing. As the export location 
will be project specific, a customizable step at the end of configuration would 
be really convenient. Without it I have to write a custom install step in an 
ExternalProject setup importing two libraries and setup their dependencies.

here is the patch:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bd78cfe..c692e70 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,8 @@ option(gtest_build_samples "Build gtest's sample programs." 
OFF)

 option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)

-# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
+# Defines pre_project_set_up_hermetic_build(), set_up_hermetic_build() and
+# post_project_set_up_hermetic_build()
 include(cmake/hermetic_build.cmake OPTIONAL)

 if (COMMAND pre_project_set_up_hermetic_build)
@@ -258,3 +259,7 @@ if (gtest_build_tests)
   cxx_executable(gtest_xml_output_unittest_ test gtest)
   py_test(gtest_xml_output_unittest)
 endif()
+
+if (COMMAND post_project_set_up_hermetic_build)
+  post_project_set_up_hermetic_build()
+endif()

Original issue reported on code.google.com by Dreifach...@gmail.com on 26 Jun 2014 at 11:24