Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Set CMake options #303

Open
danielunderwood opened this issue Dec 6, 2016 · 3 comments
Open

Set CMake options #303

danielunderwood opened this issue Dec 6, 2016 · 3 comments

Comments

@danielunderwood
Copy link

It would be nice to have some interface to set CMake options and defines on a per-project basis. I know now we have the cmake.command config variable that one could set options such as defines or a build system, but that seems to be on a global level.

What I was thinking is to have something like the cmake portion of the config file per project, possibly with added options generated by something like the output of cmake -LAH to get project options. I'm not sure of what the best way to do this would be though as I'm not exactly a fan of IDE config files being tied to a project.

If this is something that would be wanted and we can agree on a way to do it, I can try to get the changes in a PR in a couple weeks when I have some spare time.

@eidheim
Copy link
Member

eidheim commented Dec 7, 2016

I might be misunderstanding here, but what I do if I want different CMake options that are not default is creating the build directory contents manually. For instance, let's say I want to test my project with the -Weverything flag turned on:

rm -r build # if it already exist
mkdir build && cd build
cmake -DCMAKE_CXX_FLAGS=-Weverything ..

Then when I open the project in juCi++, it will not touch these settings, but only run cmake again to create the needed compile_commands.json file.

There are other options as well that can automate this too, for instance:

rm -r build # if it already exist
CXXFLAGS=-Weverything juci .

@eidheim
Copy link
Member

eidheim commented Dec 7, 2016

Actually, this is now my favorite:

CXXFLAGS=-Weverything juci .

Then choose Recreate Build in the Project menu:)

edit: using the environment variable CXXFLAGS has the advantage of working for Meson builds as well.

@eidheim
Copy link
Member

eidheim commented Dec 7, 2016

I just realised that you can also add flags in build/compile_commands.json (after it is created) for individual files as well. But the source file in question has to be completely reparsed then. Either use Reload File in the File menu, or reopen the file manually.

edit: this is only with respect to libclang processing though, will not affect compilation.

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

No branches or pull requests

2 participants