cmake: use cached results for RPM build & dont print annoying rpmbuild missing on...
authorCampbell Barton <ideasman42@gmail.com>
Fri, 14 Oct 2011 14:01:39 +0000 (14:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 14 Oct 2011 14:01:39 +0000 (14:01 +0000)
build_files/cmake/RpmBuild.cmake

index 2c821a9dd7a0270492357f8fd89ca5ae77c2baf3..2fdd0a729324e81521e9615276018cd0c6205d5f 100644 (file)
@@ -3,17 +3,24 @@
 # Authors: Rohit Yadav <rohityadav89@gmail.com>
 #
 
-find_program(RPMBUILD
-    NAMES rpmbuild
-    PATHS "/usr/bin")
+if(NOT DEFINED RPMBUILD)
 
-mark_as_advanced(RPMBUILD)
+       find_program(RPMBUILD
+               NAMES rpmbuild
+               PATHS "/usr/bin")
+
+       mark_as_advanced(RPMBUILD)
+
+       if(RPMBUILD)
+               message(STATUS "RPM Build Found: ${RPMBUILD}")
+       else(RPMBUILD) 
+               message(STATUS "RPM Build Not Found (rpmbuild). RPM generation will not be available")
+       endif()
+
+endif()
 
 if(RPMBUILD)
-    get_filename_component(RPMBUILD_PATH ${RPMBUILD} ABSOLUTE)
-    message(STATUS "Found rpmbuild : ${RPMBUILD_PATH}")
-    set(RPMBUILD_FOUND "YES")
+       set(RPMBUILD_FOUND TRUE)
 else(RPMBUILD) 
-    message(STATUS "rpmbuild NOT found. RPM generation will not be available")
-    set(RPMBUILD_FOUND "NO")
-endif()
+       set(RPMBUILD_FOUND FALSE)
+endif()
\ No newline at end of file