Giter Club home page Giter Club logo

Comments (7)

vanrein avatar vanrein commented on September 7, 2024

I tried setting --git-dir and --work-tree and neither solved the problem.

FWIW, git operates fine in the source directory...

from arpa2cm.

vanrein avatar vanrein commented on September 7, 2024

Same with -C ${CMAKE_CURRENT_SOURCE_DIR}.

I also tried combinations with ${CMAKE_SOURCE_DIR} which is more accurate, at least for git diff, although I cannot think of a situation where the difference would be noticeable.

Anyway, none of the 2x3 combinations showed a difference.

from arpa2cm.

vanrein avatar vanrein commented on September 7, 2024

My hunch is correct; git is running in the current directory, which explains why builds work inside the source tree but not outside.

Before running CMake in /tmp/perpetuum, I ran git init in /tmp and got

-- Looking for git-versioning information.
running /usr/local/bin/git diff --quiet  2>&1
  Got version fatal: No names found, cannot describe anything..fatal: No names found, cannot describe anything..fatal: No names found, cannot describe anything.
-- Found program version fatal: No names found, cannot describe anything..fatal: No names found, cannot describe anything..fatal: No names found, cannot describe anything.
-- Git is /usr/local/bin/git
-- Git was tested: version-0.9-0-8-gbcb63c1

Yes, no tags were made. So from /tmp/perpetuum I did

touch ../x
git add ../x
git commit -m Blissfully_Empty
git tag version-6.6-6

The result after this was clearly wrong not what is intended:

-- Looking for git-versioning information.
running /usr/local/bin/git diff --quiet  2>&1
  Got version 6.6.6
-- Found program version 6.6.6
-- Git is /usr/local/bin/git
-- Git was tested: version-0.9-0-8-gbcb63c1

There would seem to be something forcing Git to look at the ${CMAKE_BINARY_DIR} instead of the ${CMAKE_SOURCE_DIR}, but I have no idea what it is. There are no environment variables to Git, as far as I can tell.

The error I got with .git.fatal indicated the absense of a Git repo, which make sense in this light.

from arpa2cm.

adriaandegroot avatar adriaandegroot commented on September 7, 2024

The first test produces:

-- Looking for git-versioning information.
running /usr/local/bin/git diff --quiet  2>&1

That, at least, is wrong. It may be because of your CMake version or platform, or because you're doing something weird with current source dir anyway. In my experiments not with perpetuum, the output looks like this:

-- Looking for git-versioning information.                                                   
running cd "/home/adridg/src/tmp" && /usr/bin/git diff --quiet  2>&1         

Notice the extra cd in the command.

from arpa2cm.

adriaandegroot avatar adriaandegroot commented on September 7, 2024

Properly tag a version: git tag version-0.9-0 version-0.9.0

That's not a proper tag according to the git-versioning module. It must be version-0.9-0 (with a dash).

from arpa2cm.

adriaandegroot avatar adriaandegroot commented on September 7, 2024

Perpetuum pretends to use ARPA2CM, but it has a cmake/ subdirectory that still contains old versions of, e.g., MacroGitVersionInfo.cmake. It uses those, and they don't have any of the fixes ever applied to ARPA2CM. Please remove them, remove the cmake/ directory if it is no longer needed (I don't think it is, everything looks boilerplate), remove setting of CMAKE_MODULE_PATH, and after finding ARPA2CM, add

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} 
    ${ARPA2CM_MODULE_PATH})

from arpa2cm.

vanrein avatar vanrein commented on September 7, 2024

from arpa2cm.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.