[CMake] including paths - basic

Mark Wyszomierski markww at gmail.com
Sat Oct 20 19:15:50 EDT 2007


Hi Mike,

When I try CMAKE_BUILD_TYPE MATCHES Debug, it seems to never execute
the contents of that IF statement (as if I am never CMake'ing a DEBUG
build?).

I don't know if CMAKE_BUILD_TYPE is the same thing as what's in the
CMAKE_CONFIGURATION_TYPES field. I really need something like:

IF (CMAKE_CONFIGURATION_TYPE MATCHES Debug)
    // include some library....
ELSE
    // ...
ENDIF

I'm not sure if that's the same thing?

Thanks,
Mark


On 10/19/07, Mike Jackson <imikejackson at gmail.com> wrote:
> IF ( CMAKE_BUILD_TYPE MATCHES Debug )
>   ADD_DEFINITIONS(-DDEBUG)
>   ADD_DEFINITIONS(-Wall)
> ENDIF ( CMAKE_BUILD_TYPE MATCHES Debug )
>
>
>
> --
> Mike Jackson   Senior Research Engineer
> Innovative Management & Technology Services
>
>
> On Oct 19, 2007, at 9:34 AM, Mark Wyszomierski wrote:
>
> > It works fine now that I try it -
> >
> > Is there any way to switch on debug and release builds? Something
> > like:
> >
> > IF (DEBUG)
> > include_directories(...)
> > ELSE (DEBUG)
> > include_directories(...)
> > ENDIF (DEBUG)
> >
> > Thanks
> >
> > On 10/19/07, a.neundorf-work at gmx.net <a.neundorf-work at gmx.net> wrote:
> >> On Thursday 18 October 2007 19:32, Mark Wyszomierski wrote:
> >>> Hi,
> >>>
> >>> I'm new to cmake, it looks great. Is it possible to include
> >>> different
> >>> paths conditionally, like:
> >>>
> >>> include_directories (${MY_PROJECT_SOURCE_DIR}/my_lib)
> >>> IF (WIN32)
> >>> include_directories (C:/my_stuff/lib/something)
> >>> ELSE (WIN32)
> >>> include_directories (/usr/lib/something)
> >>> ENDIF (WIN32)
> >>
> >> The code looks good, do you have problems with it ?
> >>
> >> Alex
> >> _______________________________________________
> >> CMake mailing list
> >> CMake at cmake.org
> >> http://www.cmake.org/mailman/listinfo/cmake
> >>
> > _______________________________________________
> > CMake mailing list
> > CMake at cmake.org
> > http://www.cmake.org/mailman/listinfo/cmake
>
>


More information about the CMake mailing list