[CMake] multiple cmake files in one directory

David Cole david.cole at kitware.com
Tue Sep 22 12:12:32 EDT 2009


How about:
if(building_project_1)
  include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists-1.txt)
endif()

if(building_project_2)
  include(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists-2.txt)
endif()


On Tue, Sep 22, 2009 at 11:55 AM, <th.tom at gmx.de> wrote:

> Hi,
>
> I have seen a thread about this issue but there was not a real solution, so
> I try to ask that again: Is there a way to define a specific
> CMakeLists.txt-file with a cmake call.
>
> I have two projects, which have the same root directory (what is really
> nasty but I can't change it actually):
>
> -data
>  - subdir1
>  - subdir2
>  - subdir3
>
> These two projects need some subdirectories, so the cmake files would look
> like this:
>
> CMakeLists-1.txt: (Project 1)
> [..]
> SUBDIRS(
>   subdir1
>   subdir3
> )
> [..]
>
> and
>
> CMakeLists-2.txt: (Project 2)
> [..]
> SUBDIRS(
>   subdir2
> )
> [..]
>
> I want to build project 1 completly independent from project 2.
>
> Thanks in advance - tom
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090922/8734b30b/attachment.htm>


More information about the CMake mailing list