File tree Expand file tree Collapse file tree 2 files changed +24
-17
lines changed Expand file tree Collapse file tree 2 files changed +24
-17
lines changed Original file line number Diff line number Diff line change @@ -252,20 +252,3 @@ configure_file(cmake/llama.pc.in
252252
253253install (FILES "${CMAKE_CURRENT_BINARY_DIR} /llama.pc"
254254 DESTINATION ${CMAKE_INSTALL_LIBDIR} /pkgconfig)
255-
256- #
257- # copy the license files
258- #
259-
260- # Check if running in GitHub Actions
261- if (DEFINED ENV{GITHUB_ACTIONS} AND "$ENV{GITHUB_ACTIONS} " STREQUAL "true" )
262- message (STATUS "Running inside GitHub Actions - copying license files" )
263-
264- # Copy all files from licenses/ to build/bin/
265- file (GLOB LICENSE_FILES "${CMAKE_SOURCE_DIR} /licenses/*" )
266- foreach (LICENSE_FILE ${LICENSE_FILES} )
267- get_filename_component (FILENAME ${LICENSE_FILE} NAME )
268- configure_file (${LICENSE_FILE} "${CMAKE_BINARY_DIR} /bin/${FILENAME} " COPYONLY )
269- endforeach ()
270- endif ()
271-
Original file line number Diff line number Diff line change @@ -144,3 +144,27 @@ endif ()
144144target_include_directories (${TARGET} PUBLIC .)
145145target_compile_features (${TARGET} PUBLIC cxx_std_17)
146146target_link_libraries (${TARGET} PRIVATE ${LLAMA_COMMON_EXTRA_LIBS} PUBLIC llama Threads::Threads)
147+
148+
149+ #
150+ # copy the license files
151+ #
152+
153+ # Check if running in GitHub Actions
154+ if (DEFINED ENV{GITHUB_ACTIONS} AND "$ENV{GITHUB_ACTIONS} " STREQUAL "true" )
155+ message (STATUS "Running inside GitHub Actions - copying license files" )
156+
157+ # Copy all files from licenses/ to build/bin/
158+ file (GLOB LICENSE_FILES "${CMAKE_SOURCE_DIR} /licenses/*" )
159+ foreach (LICENSE_FILE ${LICENSE_FILES} )
160+ get_filename_component (FILENAME ${LICENSE_FILE} NAME )
161+ add_custom_command (
162+ POST_BUILD
163+ TARGET ${TARGET}
164+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
165+ "${LICENSE_FILE} "
166+ "$<TARGET_FILE_DIR:llama>/${FILENAME} "
167+ COMMENT "Copying ${FILENAME} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} " )
168+ message (STATUS "Copying ${LICENSE_FILE} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} /${FILENAME} " )
169+ endforeach ()
170+ endif ()
You can’t perform that action at this time.
0 commit comments