Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake Error at programs/CMakeLists.txt:28 (string) #401

Closed
samfux84 opened this issue Jun 28, 2019 · 1 comment
Closed

CMake Error at programs/CMakeLists.txt:28 (string) #401

samfux84 opened this issue Jun 28, 2019 · 1 comment

Comments

@samfux84
Copy link

Hi,

I would like to report an issue regarding using CMake to build eman2.

When trying to build eman 2.3 from source (using the v2.3 release tarball from github), then I receive a CMake Error caused by programs/CMakeLists.txt

CMake Error at programs/CMakeLists.txt:28 (string):
string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.

According to

https://gitlab.kitware.com/cmake/cmake/issues/18737

this problem can be fixed by quoting the arguments of the function.

When changing programs/CMakeLists.txt:28 from

        string(REGEX REPLACE
                   "^.*-.*-g" ""
                   EMAN_GITHASH ${EMAN_GITHASH}
                   )

to

        string(REGEX REPLACE
                   "^.*-.*-g" ""
                   "EMAN_GITHASH" "${EMAN_GITHASH}"
                   )

then the error is no longer triggered

@shadowwalkersb
Copy link
Member

EMAN_GITHASH is a crucial variable that contains the git hash of the commit. Unfortunately, the tarballs do not contain any git information as far as I know. So, it is not a case we want to support, but we could still set it to something to prevent the error you see. Wrapping the variables is a good idea in any case, but they shouldn't be needed for the first variable.

        string(REGEX REPLACE
                   "^.*-.*-g" ""
                   EMAN_GITHASH "${EMAN_GITHASH}"
                   )

Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants