Making variables visible in ccmake

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Making variables visible in ccmake

Dorier, Matthieu

Hi,


How do I make a variable visible in the ccmake tool?

For example I would like the user to be able to edit BOOST_ROOT when calling ccmake, how can I do that?


Right now all I see when first running ccmake is "EMPTY_CACHE", and when typing "c" to configure (which fails because some variables aren't properly set) then "e" to exit, I see the variables I have defined with "option", and I can toggle those, but I don't see other variables. I have tried the following:


if(NOT DEFINED BOOST_ROOT)
  set(BOOST_ROOT "/usr" CACHE PATH "Root of the Boost installation")
endif(NOT DEFINED BOOST_ROOT)


But I still don't see it in the list of variables.


Additionally, is there a way to have set of variables (namely the options, as well as things like BOOST_ROOT, CMAKE_CXX_COMPILER, CMAKE_C_COMPILER) show up when first calling ccmake, instead of EMPTY_CACHE?


Thanks,


Matthieu


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Making variables visible in ccmake

Eric Noulard


Le ven. 28 sept. 2018 à 11:59, Dorier, Matthieu <[hidden email]> a écrit :

Hi,


How do I make a variable visible in the ccmake tool?

For example I would like the user to be able to edit BOOST_ROOT when calling ccmake, how can I do that?


Right now all I see when first running ccmake is "EMPTY_CACHE", and when typing "c" to configure (which fails because some variables aren't properly set) then "e" to exit, I see the variables I have defined with "option", and I can toggle those, but I don't see other variables. I have tried the following:


if(NOT DEFINED BOOST_ROOT)
  set(BOOST_ROOT "/usr" CACHE PATH "Root of the Boost installation")
endif(NOT DEFINED BOOST_ROOT)


But I still don't see it in the list of variables.


CACHE variables are "Advanced Variables" which are not displayed unless you toggle display advanced var in either ccmake or cmake-gui.
In ccmake you have to hit 't' in order to see advanced variables.
 


Additionally, is there a way to have set of variables (namely the options, as well as things like BOOST_ROOT, CMAKE_CXX_COMPILER, CMAKE_C_COMPILER) show up when first calling ccmake, instead of EMPTY_CACHE?


I don't know, CMAKE_<lang>_COMPILER is not meant to be set with cmake UI, they ought to be set in a toolchain or outside.
As noted in CMakeForceCompiler module you should not force them, use toolchain or env var before calling cmake* tool.


--
Eric

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Making variables visible in ccmake

Dorier, Matthieu

Ah then maybe I don't understand correctly what is supposed to be displayed by ccmake.


In general, how can I have in the ccmake screen some variables displayed to configure some paths to some libraries?


Thanks,


Matthieu


From: Eric Noulard <[hidden email]>
Sent: Friday, September 28, 2018 11:30:31 AM
To: Dorier, Matthieu
Cc: CMake Mailinglist
Subject: Re: [CMake] Making variables visible in ccmake
 


Le ven. 28 sept. 2018 à 11:59, Dorier, Matthieu <[hidden email]> a écrit :

Hi,


How do I make a variable visible in the ccmake tool?

For example I would like the user to be able to edit BOOST_ROOT when calling ccmake, how can I do that?


Right now all I see when first running ccmake is "EMPTY_CACHE", and when typing "c" to configure (which fails because some variables aren't properly set) then "e" to exit, I see the variables I have defined with "option", and I can toggle those, but I don't see other variables. I have tried the following:


if(NOT DEFINED BOOST_ROOT)
  set(BOOST_ROOT "/usr" CACHE PATH "Root of the Boost installation")
endif(NOT DEFINED BOOST_ROOT)


But I still don't see it in the list of variables.


CACHE variables are "Advanced Variables" which are not displayed unless you toggle display advanced var in either ccmake or cmake-gui.
In ccmake you have to hit 't' in order to see advanced variables.
 


Additionally, is there a way to have set of variables (namely the options, as well as things like BOOST_ROOT, CMAKE_CXX_COMPILER, CMAKE_C_COMPILER) show up when first calling ccmake, instead of EMPTY_CACHE?


I don't know, CMAKE_<lang>_COMPILER is not meant to be set with cmake UI, they ought to be set in a toolchain or outside.
As noted in CMakeForceCompiler module you should not force them, use toolchain or env var before calling cmake* tool.


--
Eric

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Making variables visible in ccmake

Eric Noulard


Le ven. 28 sept. 2018 à 13:03, Dorier, Matthieu <[hidden email]> a écrit :

Ah then maybe I don't understand correctly what is supposed to be displayed by ccmake.


My usage workflow, not sure it is the expected one but other CMake users/developers may correct me if my usage is wrong.

1) Launch ccmake in an empty buiddir :
    ccmake -G Ninja /path/to/source
 
2) Hit 'c' once to populate the cache

3) hand edit needed var

4) Hit 'c' again and check result

5) Hit 'g'.

Then I may have forgotten to toggle an option so I :

1) Launch ccmake in the populated build dir:
    ccmake .

2) hand edit the forgotten vars

3) Hit 'c' then 'g'.



In general, how can I have in the ccmake screen some variables displayed to configure some paths to some libraries?


You have to hit 'c' once to populate the cache and make ccmake/cmake-gui aware of the defined (may be void) variables/

There was a "wizard" mode for cmake some time ago that was asking questions for setting var values but it's gone:

$ cmake -i
The "cmake -i" wizard mode is no longer supported.
Use the -D option to set cache values on the command line.
Use cmake-gui or ccmake for an interactive dialog.


--
Eric

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake