function(generate_output_files) set(content) foreach(tgt IN LISTS ARGN) get_property(type TARGET ${tgt} PROPERTY TYPE) if(NOT type STREQUAL "OBJECT_LIBRARY") set(file " [==[$]==]") set(filename " [==[$]==]") else() set(file) set(filename) endif() string(APPEND content "set(TARGET_FILE_${tgt}_$${file})\n") string(APPEND content "set(TARGET_FILE_NAME_${tgt}_$${filename})\n") if(type MATCHES "^(STATIC|MODULE|SHARED)_LIBRARY$") set(linker_file " [==[$]==]") set(linker_filename " [==[$]==]") else() set(linker_file) set(linker_filename) endif() string(APPEND content "set(TARGET_LINKER_FILE_${tgt}_$${linker_file})\n") string(APPEND content "set(TARGET_LINKER_FILE_NAME_${tgt}_$${linker_filename})\n") if(NOT WIN32 AND NOT CYGWIN AND type MATCHES "^(SHARED_LIBRARY)$") set(soname_file " [==[$]==]") set(soname_filename " [==[$]==]") else() set(soname_file) set(soname_filename) endif() string(APPEND content "set(TARGET_SONAME_FILE_${tgt}_$${soname_file})\n") string(APPEND content "set(TARGET_SONAME_FILE_NAME_${tgt}_$${soname_filename})\n") if(type MATCHES "^(EXECUTABLE)$") set(exe_file " [==[$/$$$]==]") set(exe_filename " [==[$$$]==]") if(WIN32 AND NOT generate_output_files_NO_EXE_LIB) set(exe_lib_file " [==[$/$$.lib]==]") string(APPEND content "set(TARGET_EXE_LIB_FILE_${tgt}_$${exe_lib_file})\n") endif() else() set(exe_file) set(exe_filename) endif() string(APPEND content "set(TARGET_EXE_FILE_${tgt}_$${exe_file})\n") string(APPEND content "set(TARGET_EXE_FILE_NAME_${tgt}_$${exe_filename})\n") string(APPEND content "set(TARGET_OBJECT_FILES_${tgt}_$ [==[$]==])\n") endforeach() file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/target_files_$.cmake" CONTENT "${content}") set(content) foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES) string(APPEND content "include(\${CMAKE_CURRENT_LIST_DIR}/target_files_${config}.cmake)\n") endforeach() file(WRITE "${CMAKE_BINARY_DIR}/target_files.cmake" "${content}") endfunction()