CMake Error: Could not find CMAKE_ROOT?












1















I'm trying to build a github project using cmake and I've been having a lot of trouble.
I'm creating a build directory and calling cmake like so:



cd github_project_directory
mkdir build
cd build
cmake ..


This is the error I'm getting:



CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.


I think there is a problem with how cmake is installed but I can't seem to figure it out. I've tried uninstalling and reinstalling but...I think it might have created even more trouble.



I'm on Ubuntu 14.04. Happy to provide more information as required.



Thank you!










share|improve this question























  • Please edit your question to include the "project name" / a link to the git files.

    – Knud Larsen
    Mar 13 '18 at 22:27


















1















I'm trying to build a github project using cmake and I've been having a lot of trouble.
I'm creating a build directory and calling cmake like so:



cd github_project_directory
mkdir build
cd build
cmake ..


This is the error I'm getting:



CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.


I think there is a problem with how cmake is installed but I can't seem to figure it out. I've tried uninstalling and reinstalling but...I think it might have created even more trouble.



I'm on Ubuntu 14.04. Happy to provide more information as required.



Thank you!










share|improve this question























  • Please edit your question to include the "project name" / a link to the git files.

    – Knud Larsen
    Mar 13 '18 at 22:27
















1












1








1








I'm trying to build a github project using cmake and I've been having a lot of trouble.
I'm creating a build directory and calling cmake like so:



cd github_project_directory
mkdir build
cd build
cmake ..


This is the error I'm getting:



CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.


I think there is a problem with how cmake is installed but I can't seem to figure it out. I've tried uninstalling and reinstalling but...I think it might have created even more trouble.



I'm on Ubuntu 14.04. Happy to provide more information as required.



Thank you!










share|improve this question














I'm trying to build a github project using cmake and I've been having a lot of trouble.
I'm creating a build directory and calling cmake like so:



cd github_project_directory
mkdir build
cd build
cmake ..


This is the error I'm getting:



CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.


I think there is a problem with how cmake is installed but I can't seem to figure it out. I've tried uninstalling and reinstalling but...I think it might have created even more trouble.



I'm on Ubuntu 14.04. Happy to provide more information as required.



Thank you!







14.04 cmake






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 13 '18 at 18:53









ellenellen

1038




1038













  • Please edit your question to include the "project name" / a link to the git files.

    – Knud Larsen
    Mar 13 '18 at 22:27





















  • Please edit your question to include the "project name" / a link to the git files.

    – Knud Larsen
    Mar 13 '18 at 22:27



















Please edit your question to include the "project name" / a link to the git files.

– Knud Larsen
Mar 13 '18 at 22:27







Please edit your question to include the "project name" / a link to the git files.

– Knud Larsen
Mar 13 '18 at 22:27












2 Answers
2






active

oldest

votes


















1














I was getting the same error for anything cmake, including cmake --version, and the "reinstall cmake and cmake-data, then restart your shell" answers didn't work, so I tried manually setting CMAKE_ROOT to the path from dpkg -L cmake-data that contains the Modules directory.



export CMAKE_ROOT=/usr/share/cmake-3.5


That got cmake --version working, which revealed that I was somehow dealing with a cmake that reported itself as cmake 2.x, but a cmake-data package which created a cmake-3.5 folder for its resources.



It turned out that one of my PPAs was offering cmake 3.5 at the same package names that 14.04 uses for cmake 2.8 and, because of a dependency conflict, the cmake-data package had upgraded to 3.5, but the cmake package was getting held back at 2.8.



The following lines got things working for me:



sudo apt-get remove cmake cmake-data
sudo apt-get install cmake3 cmake3-data





share|improve this answer































    0














    I had to re-install my cmake to correct this same error.



    sudo apt-get remove cmake cmake-data
    sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
    sudo -E apt-get update
    sudo apt-get install cmake


    Then be sure to re-source your rc.



    . ~/.bashrc





    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1014670%2fcmake-error-could-not-find-cmake-root%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      I was getting the same error for anything cmake, including cmake --version, and the "reinstall cmake and cmake-data, then restart your shell" answers didn't work, so I tried manually setting CMAKE_ROOT to the path from dpkg -L cmake-data that contains the Modules directory.



      export CMAKE_ROOT=/usr/share/cmake-3.5


      That got cmake --version working, which revealed that I was somehow dealing with a cmake that reported itself as cmake 2.x, but a cmake-data package which created a cmake-3.5 folder for its resources.



      It turned out that one of my PPAs was offering cmake 3.5 at the same package names that 14.04 uses for cmake 2.8 and, because of a dependency conflict, the cmake-data package had upgraded to 3.5, but the cmake package was getting held back at 2.8.



      The following lines got things working for me:



      sudo apt-get remove cmake cmake-data
      sudo apt-get install cmake3 cmake3-data





      share|improve this answer




























        1














        I was getting the same error for anything cmake, including cmake --version, and the "reinstall cmake and cmake-data, then restart your shell" answers didn't work, so I tried manually setting CMAKE_ROOT to the path from dpkg -L cmake-data that contains the Modules directory.



        export CMAKE_ROOT=/usr/share/cmake-3.5


        That got cmake --version working, which revealed that I was somehow dealing with a cmake that reported itself as cmake 2.x, but a cmake-data package which created a cmake-3.5 folder for its resources.



        It turned out that one of my PPAs was offering cmake 3.5 at the same package names that 14.04 uses for cmake 2.8 and, because of a dependency conflict, the cmake-data package had upgraded to 3.5, but the cmake package was getting held back at 2.8.



        The following lines got things working for me:



        sudo apt-get remove cmake cmake-data
        sudo apt-get install cmake3 cmake3-data





        share|improve this answer


























          1












          1








          1







          I was getting the same error for anything cmake, including cmake --version, and the "reinstall cmake and cmake-data, then restart your shell" answers didn't work, so I tried manually setting CMAKE_ROOT to the path from dpkg -L cmake-data that contains the Modules directory.



          export CMAKE_ROOT=/usr/share/cmake-3.5


          That got cmake --version working, which revealed that I was somehow dealing with a cmake that reported itself as cmake 2.x, but a cmake-data package which created a cmake-3.5 folder for its resources.



          It turned out that one of my PPAs was offering cmake 3.5 at the same package names that 14.04 uses for cmake 2.8 and, because of a dependency conflict, the cmake-data package had upgraded to 3.5, but the cmake package was getting held back at 2.8.



          The following lines got things working for me:



          sudo apt-get remove cmake cmake-data
          sudo apt-get install cmake3 cmake3-data





          share|improve this answer













          I was getting the same error for anything cmake, including cmake --version, and the "reinstall cmake and cmake-data, then restart your shell" answers didn't work, so I tried manually setting CMAKE_ROOT to the path from dpkg -L cmake-data that contains the Modules directory.



          export CMAKE_ROOT=/usr/share/cmake-3.5


          That got cmake --version working, which revealed that I was somehow dealing with a cmake that reported itself as cmake 2.x, but a cmake-data package which created a cmake-3.5 folder for its resources.



          It turned out that one of my PPAs was offering cmake 3.5 at the same package names that 14.04 uses for cmake 2.8 and, because of a dependency conflict, the cmake-data package had upgraded to 3.5, but the cmake package was getting held back at 2.8.



          The following lines got things working for me:



          sudo apt-get remove cmake cmake-data
          sudo apt-get install cmake3 cmake3-data






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 26 '18 at 8:07









          ssokolowssokolow

          810615




          810615

























              0














              I had to re-install my cmake to correct this same error.



              sudo apt-get remove cmake cmake-data
              sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
              sudo -E apt-get update
              sudo apt-get install cmake


              Then be sure to re-source your rc.



              . ~/.bashrc





              share|improve this answer




























                0














                I had to re-install my cmake to correct this same error.



                sudo apt-get remove cmake cmake-data
                sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
                sudo -E apt-get update
                sudo apt-get install cmake


                Then be sure to re-source your rc.



                . ~/.bashrc





                share|improve this answer


























                  0












                  0








                  0







                  I had to re-install my cmake to correct this same error.



                  sudo apt-get remove cmake cmake-data
                  sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
                  sudo -E apt-get update
                  sudo apt-get install cmake


                  Then be sure to re-source your rc.



                  . ~/.bashrc





                  share|improve this answer













                  I had to re-install my cmake to correct this same error.



                  sudo apt-get remove cmake cmake-data
                  sudo -E add-apt-repository -y ppa:george-edison55/cmake-3.x
                  sudo -E apt-get update
                  sudo apt-get install cmake


                  Then be sure to re-source your rc.



                  . ~/.bashrc






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 12 '18 at 0:01









                  D M LoweD M Lowe

                  1




                  1






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1014670%2fcmake-error-could-not-find-cmake-root%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅