CMakeLists.txt 838 B

123456789101112131415161718192021222324
  1. AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources)
  2. SOURCE_FILES(LibrarySources file2)
  3. ADD_LIBRARY(CMakeTestLibrary LibrarySources)
  4. SOURCE_FILES(SharedLibrarySources sharedFile)
  5. ADD_LIBRARY(CMakeTestLibraryShared SHARED SharedLibrarySources)
  6. UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx)
  7. ADD_EXECUTABLE(create_file create_file.cxx)
  8. ADD_DEPENDENCIES(CMakeTestLibraryShared create_file)
  9. # Attach a post-build custom-command to the lib.
  10. # It run ${CREATE_FILE_EXE} which will create the file
  11. # ${Complex_BINARY_DIR}/postbuild.txt.
  12. # The 'complex' executable will then test if this file exists,
  13. # and remove it.
  14. ADD_CUSTOM_COMMAND(SOURCE CMakeTestLibraryShared
  15. COMMAND ${CREATE_FILE_EXE}
  16. ARGS "${Complex_BINARY_DIR}/postbuild.txt"
  17. TARGET CMakeTestLibraryShared)