# CMake Error at CMakeLists.txt:249 (string): string sub-command COMPARE, mode EQUAL needs at least 5 arguments total to command.

**URL:** https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-249-string-string-sub-command-compare-mode-equal-needs-at-least-5-arguments-total-to-command/11151
**Category:** Code
**Tags:** os:windows
**Created:** [July 2, 2024, 8:23am UTC](https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-249-string-string-sub-command-compare-mode-equal-needs-at-least-5-arguments-total-to-command/11151 "2024-07-02T08:23:28Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dollPrincess](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dollprincess/32/4716_2.png) [@dollPrincess](https://discourse.cmake.org/u/dollPrincess)
#### Post date: [July 2, 2024, 8:23am UTC](https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-249-string-string-sub-command-compare-mode-equal-needs-at-least-5-arguments-total-to-command/11151/1 "2024-07-02T08:23:28Z")

</div>

I have downloaded a project called Febio Studio, for which I can have no help of those who I downloaded it from, and am running into a wall that I cannot comprehend. I hope someone here can shed some light to help this absolute noob understand what’s going on and maybe fix it. 😭 😭

I have a project that uses CMake to build and then to compile the project, and when I try to “configure” it for first, I get the error:  
“CMake Error at CMakeLists.txt:249 (string): string sub-command COMPARE, mode EQUAL needs at least 5 arguments total to command.”

The line 249 in question reads:  
" string(COMPARE EQUAL ${BRANCH\_NAME} “master” ISMASTER)"

How to solve it? Please ~Is there someone can help? I am really deseperate 😱 😣

---

<div class="post-metadata">

### Author: ![fenrir](https://discourse.cmake.org/user_avatar/discourse.cmake.org/fenrir/32/734_2.png) [@fenrir](https://discourse.cmake.org/u/fenrir)
#### Post date: [July 2, 2024, 8:49am UTC](https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-249-string-string-sub-command-compare-mode-equal-needs-at-least-5-arguments-total-to-command/11151/2 "2024-07-02T08:49:38Z")

</div>

It’s hard to tell for sure without analysing the project, but from the naming of the variables, I guess `BRANCH_NAME` is supposed to be automatically filled when the build is started from a (git?) repository.  
You probably only have a code snapshot, which makes `BRANCH_NAME` empty, causing the line

```auto
string(COMPARE EQUAL ${BRANCH_NAME} "master" ISMASTER)

```

to effectively become:

```auto
string(COMPARE EQUAL "master" ISMASTER)

```

and CMake rightfully complains about it.

Maybe try actually cloning the github repository ([GitHub - febiosoftware/FEBioStudio](https://github.com/febiosoftware/FEBioStudio)), and work with that?

---

<div class="post-metadata">

### Author: ![dollPrincess](https://discourse.cmake.org/user_avatar/discourse.cmake.org/dollprincess/32/4716_2.png) [@dollPrincess](https://discourse.cmake.org/u/dollPrincess)
#### Post date: [July 16, 2024, 1:49am UTC](https://discourse.cmake.org/t/cmake-error-at-cmakelists-txt-249-string-string-sub-command-compare-mode-equal-needs-at-least-5-arguments-total-to-command/11151/3 "2024-07-16T01:49:46Z")

</div>

Thank you very much,my dear friend! It has been a while since I solved it,so I cannot quite remember how to fix it.

Probably I downloaded git on my computer,then re-downloaded the FS but for the lateat version.  
After that I compiled the parallel code for a large open source project called FeBio than the error vanished.
