[CMake] CMake 3.0.1 missing CMakeLists.txt error

Nico Schlömer nico.schloemer at gmail.com
Wed Oct 1 03:11:20 EDT 2014


You could manually check for a file by the name of `CMakeLists.txt` to
exist, e.g.,
```
IF (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/subdir/
    AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/subdir/CMakeLists.txt)
  ADD_SUBDIRECTORY(subdir)
ENDIF()
```

Cheers,
Nico

On Mon, Sep 29, 2014 at 7:24 PM, Hansen, Glen A <gahanse at sandia.gov> wrote:
>
> Dear List:
>
> I recently upgraded to CMake 3.0.1, and I am now getting the error:
>
> <snip>
>
> CMake Error at packages/stratimikos/CMakeLists.txt:15 (ADD_SUBDIRECTORY):
>   The source directory
>
>     /lore/ghansen/nightly/repos/publicTrilinos/packages/stratimikos/doc
>
>   does not contain a CMakeLists.txt file.
>
> <snip>
>
> This used to be a warning in earlier versions of CMake. Does anyone know of
> a way to turn it back to a warning instead of an error?
>
> Thanks,
>
> Glen Hansen
>
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake


More information about the CMake mailing list