You can specify partial paths in CMakeLists files - that is, if you want an executable target created in the main directory, but the files are in the "src" directory, you can do something like add_executable(mytarget src/main.cpp)
It sounds like you might have a situation where you have multiple static library targets for the modules, and one executable target (needs at least 1 source file - which one has the "main()" function?) that links to these static library targets. Ryan On Wed, Feb 2, 2011 at 3:53 PM, Enrique Izaguirre <enrique.izagui...@gmail.com> wrote: > Thanks a lot Eric > > Actually I am trying to move a project already done to CMake, and it doesn't > have any executable in the top directory, it is now done in Windows under > Visual Studio. > > In the top directory I have a CMakeLists,txt that calls each one of the > subdirectories in which I have also their respective CMakeLIsts.txt. > > But I don't know at the end how to put everything together in an executable. > Because each directory compiles independently, like a module. I don't know > how it is done in Visual Studio. > > Thanks again > > Enrique > > On Wed, Feb 2, 2011 at 3:42 PM, Eric Noulard <eric.noul...@gmail.com> wrote: >> >> 2011/2/2 Enrique Izaguirre <enrique.izagui...@gmail.com>: >> > Hello, >> > >> > Is it possible to create an executable in your top directory if you >> > don't >> > have there any program? I mean, if all your programs .c and .cpp are in >> > subdirectories contained in your top directory, each one with its own >> > CMakeLists.txt. >> > I have three subdirectories, and all my programs are in these >> > subdirectories. I don't have any in my main directory, but the >> > executable >> > should be created in the main directoy. Is it possible? How? >> >> Yes you can. >> >> You can control the output directory for executable/library using >> EXECUTABLE_OUTPUT_PATH >> and/or >> LIBRARY_OUTPUT_PATH >> see; >> http://www.cmake.org/Wiki/CMake_Useful_Variables >> >> From your question, I think you may be trying to do something that >> is not in the CMake-way-of-building. >> >> First of all using CMake ones tends to suggest to build 'out-of-tree': >> http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees >> >> Then do you need your executables "in the top dir" for devel purpose >> or something else? >> >> >> -- >> Erk >> Membre de l'April - « promouvoir et défendre le logiciel libre » - >> http://www.april.org > > > _______________________________________________ > 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 > -- Ryan Pavlik HCI Graduate Student Virtual Reality Applications Center Iowa State University rpav...@iastate.edu http://academic.cleardefinition.com Internal VRAC/HCI Site: http://tinyurl.com/rpavlik _______________________________________________ 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