[CMake] Question about Variables

Robert Maynard robert.maynard at kitware.com
Fri May 31 16:41:40 EDT 2019


The `${ }` syntax deferences the variable, so what you are asking is
if the variable `1_INC_PATH` exists.

What you want is `if(DEFINED WITH_LIB_GLAD_INC_PATH)` to check for the
existence of the variable `WITH_LIB_GLAD_INC_PATH`

On Fri, May 31, 2019 at 4:11 PM Steven Truppe <workbench at gmx.at> wrote:
>
> Hi everyone,
>
> i'm relative new to cmake (a few weeks now) and i have the following
> problem:
>
>
> set(WITH_LIB_GLAD 1)
>
> IF(DEFINED ${WITH_LIB_GLAD}_INC_PATH)
>
> I try to check if the variable WITH_LIB_GLAD_INC_PATH can be found.
>
>
> best regards!
>
>
>
> --
>
> 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


More information about the CMake mailing list