This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 258209 - Help to set path to the cmake binary (to be used by NB)
Summary: Help to set path to the cmake binary (to be used by NB)
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-02 08:45 UTC by chakie
Modified: 2016-03-18 02:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot from the New Project dialog showing error message (200.33 KB, image/png)
2016-03-02 08:45 UTC, chakie
Details
Screenshot showing error (451.02 KB, image/png)
2016-03-03 07:06 UTC, chakie
Details
Different error (199.84 KB, image/png)
2016-03-03 07:13 UTC, chakie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chakie 2016-03-02 08:45:07 UTC
Created attachment 158705 [details]
Screenshot from the New Project dialog showing error message

I want to create a new project based on an existing CMake based project. In the "new Project" dialog it is not possible to set the path to the CMake binary. My cmake binary comes from Ports and is /opt/local/bin/cmake. It is of course in $PATH, also for Netbeans. 

The project setup dialog complains that it can not find cmake without giving me any way to see where it's looking, what it's really looking for nor any way to change it. Perhaps the "Custom command" could work, but then the next page in the dialog makes no sense really and as there is "native" support for CMake I want to use that.

Please let users know what they can do when something is wrong instead of just showing an unhelpful error.
Comment 1 chakie 2016-03-02 09:02:14 UTC
In my case cmake was installed after Netbeans was installed. The solution is to set the path to the cmake binary in Preferences -> C/C++ -> Build Tools. Would be nice if the New Project dialog could tell me about this possibility.
Comment 2 Vladimir Voskresensky 2016-03-02 13:02:26 UTC
Let me change this bug to enhancement, please.
We can do better job from the second page of the wizard and explain "where" to set path to cmake. Ok?
Comment 3 Vladimir Voskresensky 2016-03-02 13:03:50 UTC
I will leave it as usability bug ;-)
Comment 4 chakie 2016-03-03 07:06:56 UTC
Created attachment 158719 [details]
Screenshot showing error
Comment 5 chakie 2016-03-03 07:07:59 UTC
Well, take a look at this screenshot. I'm trying to configure out-of-source builds and tried to create a new project and fiddle with the exceptionally confusing settings in that dialog (apparently it can be done somehow, but Darwin knows how to set it up (it ought to be a simple checkbox "Build in separate build directory")). So I ran into this. Cmake not found but it's set just fine in the preferences. Just to be clear, I opened the preferences after seeing the error.
Comment 6 chakie 2016-03-03 07:13:02 UTC
Created attachment 158720 [details]
Different error
Comment 7 chakie 2016-03-03 07:15:06 UTC
If I toggle the "Script type" to, say, QMake and back to Cmake I get a different error. The CMakeLists.txt file is still there as stated in the edit field, but somehow it's now not found? I have to select the same script again. It seems the backend state clears the script internally, but doesn't update the UI to reflect that.
Comment 8 Vladimir Voskresensky 2016-03-03 12:49:36 UTC
(In reply to chakie from comment #5)
> Well, take a look at this screenshot. I'm trying to configure out-of-source
> builds and tried to create a new project and fiddle with the exceptionally
> confusing settings in that dialog (apparently it can be done somehow, but
> Darwin knows how to set it up (it ought to be a simple checkbox "Build in
> separate build directory")). So I ran into this. Cmake not found but it's
> set just fine in the preferences. Just to be clear, I opened the preferences
> after seeing the error.
Darwin allows to see two modal dialogs? Iteresting... 
On Linux I need to close project wizard, then open Options, adjust and then start project wizard again. I can not have two modal dialogs visible at once.

Btw, in your case what was the tool collection chosen on the first step of wizard? I see CLang and GNU. Does the "used one" have cmake specified?
Comment 9 Vladimir Voskresensky 2016-03-03 13:02:01 UTC
Btw, it's worth to specify in error message that cmake was not found in Toolchain_Name
Comment 10 Vladimir Voskresensky 2016-03-03 13:03:00 UTC
Also it can make sense to warn that "Run in Folder" for cmake is recommended to be changed not to clutter source tree
Comment 11 chakie 2016-03-03 14:31:43 UTC
Now that you mention the modality, it was really weird. I could move the preferences dialog separately, but if I tried to move the new project dialog, both window moved as one.

I was playing a lot of back and forth in that dialog, trying to understand how it works and get a setup that fit my needs. After cheking, I have specified the path to cmake only in one of those toolchains and it is quite possible I had picked the wrong one at the time of the screenshot.

It would help a lot if the error message told me what it looked for and where, and preferably even mention the toolchain.
Comment 12 Vladimir Voskresensky 2016-03-03 14:45:54 UTC
(In reply to chakie from comment #11)
> Now that you mention the modality, it was really weird. I could move the
> preferences dialog separately, but if I tried to move the new project
> dialog, both window moved as one.
> 
> I was playing a lot of back and forth in that dialog, trying to understand
> how it works and get a setup that fit my needs. After cheking, I have
> specified the path to cmake only in one of those toolchains and it is quite
> possible I had picked the wrong one at the time of the screenshot.
> 
> It would help a lot if the error message told me what it looked for and
> where, and preferably even mention the toolchain.
I agree. This is what I mean in comment https://netbeans.org/bugzilla/show_bug.cgi?id=258209#c9

Btw, I'm glad that "Run in Folder" solved your "cluttering" issue? :-)
Comment 13 Vladimir Voskresensky 2016-03-03 14:51:34 UTC
One important comment about "Run in Folder".
Let's say you specified on the first step
/some/path/project/src (which contains CMakeList.txt)
then you specified 
/some/path/project/build (to put build artifacts here by cmake)

In case when your build folder would contain some auto generated config specific sources/headers which you would like to see in project =>
I would recommend on the step "Source Files" 
 you should add /some/path/project
 and remove /some/path/project/src
to specify common root between
/some/path/project/src & /some/path/project/build
Comment 14 chakie 2016-03-03 15:06:59 UTC
"Run in folder" solved the clutter exactly as I wanted!
Comment 15 Alexander Simon 2016-03-17 15:54:39 UTC
fixed, change set:
http://hg.netbeans.org/cnd-main/rev/d81382e15aa8
Comment 16 Quality Engineering 2016-03-18 02:47:56 UTC
Integrated into 'main-silver', will be available in build *201603180001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/d81382e15aa8
User: Alexander Simon <alexvsimon@netbeans.org>
Log: fixed Bug #258209 Help to set path to the cmake binary (to be used by NB)