0

I have installed CMake 3.15.2 for my project.Then I configure and build VTK.Finally I install CCMake with following command.

sudo apt install cmake-curses-gui

The version of CCMake which has been installed is 3.10.2.After opening CCMake window,for setting up the paths and others, I get following image.

CCMake Window

Then when I press [c] for configuration, I get following error message.

CCMake Configuration Error

From the error , it seems to me that the version of CMake used by CCMake is lower than the version VTK requires.Though installed CMake version is 3.15.2.But CMake version in CCMake is 3.10.2.During configuration ,VTK checks this version which is creating problem.I have tried to upgrade the version of CCMake , but don't get anything above 3.10.2.I have also followed solutions of following question which is same as mine.

ccmake using cmake version 3.10

But can't solve. Dear altruists , how can I solve it? Any suggestion will be appreciated.And thanks in advance.

  • Ubuntu? If so, https://apt.kitware.com/ lets you install the latest CMake. I have an answer on askubuntu mentioning this: https://askubuntu.com/a/1138455/762119 – Justin Jun 24 '20 at 17:13
  • How did you install CMake 3.15.2? I would remove the CCMake installed via apt-get. IMHO the best bet is to compile and install your own CMake from the source code. – Dave Chen Jun 24 '20 at 17:15
  • I don't have problem using **CMake**. I have installed 3.15.2 from source code.But problem arises , when I go to use **CCMake**.What can I do to suggest CCMake to use **CMake** 3.15.2 instead of **3.10.2** – DIPANNOY DAS GUPTA Jun 24 '20 at 17:46
  • "I have also followed solutions of following question which is same as mine...But can't solve." - This is a problem statement, with which we simply cannot help you. What **exactly** is going wrong when you followed that approach about installing `cmake` with ncurses available? – Tsyvarev Jun 24 '20 at 23:30
  • 1
    If you have built and installed CMake from source, then CCMake should also have been built and installed at the same time. It should be in the same location (/usr/local/bin by default). – Dave Chen Jun 24 '20 at 23:47
  • @Tsyvarev problem is I am not able to configure CMake curses gui (CCMake). As a result I can't use the command line. Whenever I press **[c]** for configuration , It displays an error message (Kindly take a look at second image in my question). Actually, I need to configure CCMake successfully. – DIPANNOY DAS GUPTA Jun 25 '20 at 06:10
  • The screenshots in your question are (as far as I understand) about **building your project**, which uses VTK. [The answer](https://stackoverflow.com/a/48694539/3440745) you refers to is about **building CMake** itself. So, have you tried to: 1.Install development package of `ncurses`. 2. Build (or rebuild) CMake 3.15.2 from sources and install it. 3. Use `ccmake` provided by this installation? – Tsyvarev Jun 25 '20 at 07:39
  • Yes. I have tried all 3 things. They have been executed successfully.But this solution is not solving my issue.Due to similarity of question, I have referred to it.My ultimate problem is not **cmake building** .It is **version problem of cmake**.Now please focus on my last screenshot where it says **vtk found false**.Then **VTK requires cmake 3.12 in order to reliably be used**. At the bottom part u will see **cmake version 3.10.2** .This conflict needs to be resolved.Please consider it. – DIPANNOY DAS GUPTA Jun 25 '20 at 09:08

1 Answers1

0

Actually,the problem was created due to a condition in vtk-config.cmake file. The condition was

enter image description here

That's why

  • VTK_FOUND Set to False
  • Show the message VTK requires cmake 3.12 in order to reliably be used

I have changed the version of CMake in the condition like following image.

enter image description here

Now it works fine.Reason of giving 3.10 is my CMake version is 3.10.2 which you will find in the second screenshot of my question.You will update it according to your installed version. Finally I needed one more change.In the vtk-config.cmake file, you will see cmake_policy().With it the version of CMake can be set. Initially it was cmake_policy(VERSION 3.12). After my edition it is cmake_policy(VERSION 3.10). Without edition I have faced following error

  • An attempt was made to set the policy version of CMake to "3.12" which is greater than this version of CMake. This is not allowed because the greater version may have new policies not known to this CMake. You may need a newer CMake version to build this project.

That's all.