[CMake] Make variables appear in CCMake

Sensei senseiwa at gmail.com
Fri Nov 22 09:42:08 EST 2013


Dear all, I am trying to write a project file that is as simple as 
possible for non developers.

I need ccmake to show options to users regarding packages, but I am 
finding some difficulties. For example, when I want to show 
Boost-related variables, for instance the root, include and lib:

# Boost
FIND_PACKAGE(Boost 1.54.0 COMPONENTS program_options REQUIRED)
SET(Boost_DIR "${Boost_DIR}" CACHE STRING "Boost installation directory")
SET(Boost_INCLUDE_DIRS "${Boost_INCLUDE_DIRS}" CACHE STRING "Boost 
headers directory")
SET(Boost_LIBRARY_DIRS "${Boost_LIBRARY_DIRS}" CACHE STRING "Boost 
libraries directory")

However, in my ccmake (CMake Version 2.8.12.1) run, I only find these two:

  Boost_INCLUDE_DIRS   */usr/local/include
  Boost_LIBRARY_DIRS   */usr/local/lib

So, Boost_DIR isn't displayed at all.

If I press 't', I see that Boost_DIR set to "Boost_DIR-NOTFOUND", which 
is quite weird to me, since the other two are set, and I expected the 
Boost_DIR variable to be /usr/local.

I also tried to be using TBB:

FIND_PACKAGE(TBB REQUIRED)
SET(TBB_INCLUDE_DIRS "${TBB_INCLUDE_DIRS}" CACHE STRING "TBB headers 
directory (Threading Building Block)")
SET(TBB_LIBRARY_DIRS "${TBB_LIBRARY_DIRS}" CACHE STRING "TBB library 
directory (Threading Building Block)")
SET(TBB_LIBRARY_DDDD "${TBB_LIBRARY_DIRS}" CACHE STRING "TBBZ library 
directory (Threading Building Block)")

Here *both* variables are not displayed, but the third name-mangled one is.

The project works just fine, if I use cmake, but my non-tech-savvy 
colleagues use ccmake and the cmake (windows version), so I need to help 
them in configuring the paths.

Am I making some errors here?


Thanks!


More information about the CMake mailing list