Eric Clark wrote: > > Eric Clark wrote: > > > Hello, > > > > > > First off, you cannot call both add_executable and add_library in the > > > > > same CMakeLists file. Here is what I can say about your other questions: > > Of course you can. > > Yes, but only if you call project() twice, correct?
No, even if you don't call project at all (but you need to call project() in a higher level CMakeLists.txt then). > Maybe I should have been > more specific. What I meant was that you cannot create two targets for the > same project (i.e you cannot build an executable and a dll in the same > project). In the code that was posted, there was no call to project between > the call to add_library and add_executable. Certainly there is nothing > wrong with calling project more than once in a list file, but I have found > that it is a rare case that you want to do this... This could be just my > experience, but I can only speak for what I know. The only thing that does not work then is the projectname_SOURCE_DIR variable that is set by CMake when you call project(). But otherwise everything is fine. Eike --
signature.asc
Description: This is a digitally signed message part.
-- 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
