Hello everybody,

I have a problem with generated source and header files.
The main problem is, that I don't want to note each generated file's name 
manually in a CMakeLists.txt file, because the output of the file generator 
changes frequently.

The sequence of the build process shall be:
1. Go to build directory and execute "cmake <source-path>"
2. Execute "make"
3. The generator shall be called (but only if the source and header files are 
not yet generated).
4. The generator creates source and header files in folder 'generated'.
5. The source and header files in folder 'generated' shall be compiled.
6. The source and header files in folder 'generated' shall be added to library 
"libxyz.generated.so"
7. The library "libxyz.so" shall be built. "libxyz.so" shall be dependent on 
"libxyz.generated.so". The library "libxyz.generated.so" shall be linked to 
"libxyz.so".

The following attempt does not work, because the subdirectory "generated" is 
still empty, when FILE is called:
  FILE( GLOB SRCS ${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp )
  ADD_LIBRARY( xyz.generated SHARED ${SRCS} )
  ADD_DEPENDENCIES( xyz.generated generate_files )

How can I build a library from all sources which are previously generated in a 
defined folder, while not knowing each file's names in advance?

Best regards,
Joerg

_______________________________________________
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

Reply via email to