We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
From https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Exporting-and-Importing-Targets On Windows a .dll and its .lib import library may be imported together:
add_library(bar SHARED IMPORTED) set_property(TARGET bar PROPERTY IMPORTED_LOCATION c:/path/to/bar.dll) set_property(TARGET bar PROPERTY IMPORTED_IMPLIB c:/path/to/bar.lib) add_executable(myexe src1.c src2.c) target_link_libraries(myexe bar)
I am not sure how it works right now but in our code SHARED libraries are added as STATIC and there is no IMPORTED_IMPLIB. In current code there is:
add_library(${target_name} STATIC IMPORTED GLOBAL) set_target_properties(${target_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/${platform_name}" ) if(WINDOWS) set_target_properties(${target_name} PROPERTIES CC_DEPEND_DLLS "${platform_spec_path}/lib${lib_name}.dll" IMPORTED_LOCATION "${platform_spec_path}/lib${lib_name}.lib" )
The text was updated successfully, but these errors were encountered:
@drelaptop could you check it?
Sorry, something went wrong.
With IMPORTED_LOCATION set to dll file. Coping of dlls could be simplified to:
function(copy_imported_targets _target) foreach(_dep ${ARGN}) if(WIN32) add_custom_command(TARGET ${_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${_dep}> $<TARGET_FILE_DIR:${_target}> COMMENT "Copying required DLL for dependency ${_dep}" VERBATIM) endif() endforeach() endfunction() copy_imported_targets(app curl zlib ...)
thanks, I will check it after the modern cmake modified finish. the logic of source copy is complex too.
drelaptop
No branches or pull requests
From https://gitlab.kitware.com/cmake/community/wikis/doc/tutorials/Exporting-and-Importing-Targets
On Windows a .dll and its .lib import library may be imported together:
I am not sure how it works right now but in our code SHARED libraries are added as STATIC and there is no IMPORTED_IMPLIB.
In current code there is:
The text was updated successfully, but these errors were encountered: