[CMake] cmake trouble

Andreas Pakulat apaku at gmx.de
Mon Oct 22 13:17:04 EDT 2012


Hi,

On Mon, Oct 22, 2012 at 6:04 PM, Eric Clark <eclark at ara.com> wrote:
>
> First off, you cannot call both add_executable and add_library in the same
> CMakeLists file.

I think there's something missing here, but its perfectly possible to
have one or more library and executable targets specified in the same
cmake file. So this works just fine:

add_library(foo bar.cpp)
add_executable(bar foo.cpp)

There are build-systems that have such limitations, but cmake is not one.

Andreas


More information about the CMake mailing list