divyang4481 / photivo

Automatically exported from code.google.com/p/photivo
GNU General Public License v3.0
0 stars 0 forks source link

cmake: hg-root-dir not found #138

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

i have following directories:

* `photivo/build`
* `photivo/src`

if i run:

  cd photivo/build
  cmake ../src

it can not found `.hg`.

Patch followes...

Original issue reported on code.google.com by denis.kn...@gmail.com on 6 Apr 2014 at 4:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
diff -r d687864489da CMakeLists.txt
--- a/CMakeLists.txt    Sat Jan 18 15:17:05 2014 +0700
+++ b/CMakeLists.txt    Sun Apr 06 18:40:12 2014 +0200
@@ -105,11 +105,11 @@
 # Determine Photivo version with mercurial. Use current date if mercurial is unavailable.
   find_program( MERCURIAL hg )
   if( MERCURIAL )
-    execute_process( COMMAND hg branch OUTPUT_STRIP_TRAILING_WHITESPACE 
OUTPUT_VARIABLE BRANCH )
-    execute_process( COMMAND hg log --limit 1 --branch ${BRANCH} --template 
{date|shortdate}
+    execute_process( COMMAND hg -R ${PROJECT_SOURCE_DIR} branch 
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE BRANCH )
+    execute_process( COMMAND hg -R ${PROJECT_SOURCE_DIR} log --limit 1 
--branch ${BRANCH} --template {date|shortdate}
                      OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE REVDATE )
-    execute_process( COMMAND hg identify --id OUTPUT_STRIP_TRAILING_WHITESPACE 
OUTPUT_VARIABLE REVISION )
-    execute_process( COMMAND hg identify -n OUTPUT_STRIP_TRAILING_WHITESPACE 
OUTPUT_VARIABLE PACKREVISION )
+    execute_process( COMMAND hg -R ${PROJECT_SOURCE_DIR} identify --id 
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE REVISION )
+    execute_process( COMMAND hg -R ${PROJECT_SOURCE_DIR} identify -n 
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE PACKREVISION )
     set( APPVERSION "${REVDATE} (rev ${REVISION})" )
     string( REGEX REPLACE [+] "" REVISION ${REVISION} )
     string( REGEX REPLACE [+] "" PACKREVISION ${PACKREVISION} )

Original comment by denis.kn...@gmail.com on 6 Apr 2014 at 4:46

GoogleCodeExporter commented 9 years ago
Thanks. This patch is now included.

Original comment by salser...@gmail.com on 21 Mar 2015 at 5:50