Skip to content

Commit

Permalink
Fixing dynamic library adding and adding single dll or library additi…
Browse files Browse the repository at this point in the history
…on feature
  • Loading branch information
grf14003 committed Feb 20, 2020
1 parent c294c4e commit 7dd54da
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions bfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ foreach(IMPL IN LISTS IMPLEMENTAIONS)
# Including any DLLs or LIBs
set(ALL_LIBS "")
message("Libs Stored in ${N}_IMPL_DLLS: ${${N}_IMPL_LIBS}")
foreach(LIB_PATH IN ITEMS "${${N}_IMPL_LIBS}")
foreach(LIB_PATH IN ITEMS ${${N}_IMPL_LIBS})
set(LIB_ABS_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIB_PATH}")
if (IS_DIRECTORY ${LIB_ABS_PATH})
# Need to include all DLLs and LIBs in the directory
file(GLOB DLLS CONFIGURE_DEPENDS "${LIB_ABS_PATH}/*.dll")
file(GLOB LIBS CONFIGURE_DEPENDS "${LIB_ABS_PATH}/*.lib")
foreach(DLL IN ITEMS ${DLLS})
message("Adding DLL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/DLL_N")
get_filename_component(DLL_N ${DLL} NAME)
message("Adding DLL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DLL_N}")
configure_file(${DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DLL_N} COPYONLY)
endforeach()

Expand All @@ -139,7 +139,17 @@ foreach(IMPL IN LISTS IMPLEMENTAIONS)
endforeach()
else()
# Need to include just the given Library file (DLL or LIB)

get_filename_component(EXTENSION ${LIB_ABS_PATH} EXT)
if(${EXTENSION} STREQUAL ".dll")
get_filename_component(DLL_N ${LIB_ABS_PATH} NAME)
message("Adding DLL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DLL_N}")
configure_file(${LIB_ABS_PATH} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${DLL_N} COPYONLY)
elseif(${EXTENSION} STREQUAL ".lib")
get_filename_component(LIB_N ${LIB_ABS_PATH} NAME_WE)
find_library(${LIB_N} NAME ${LIB_N}.lib PATHS ${LIB_ABS_PATH})
message("Linking library: ${${LIB_N}}")
list(APPEND ALL_LIBS ${LIB_N})
endif()
endif()
endforeach()

Expand Down
2 changes: 1 addition & 1 deletion bfs/implementations/breadcrumbs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

set (VirtualOutputIOProcessor_IMPL_LIBS
ea_tdk
"ea_tdk"
PARENT_SCOPE)

0 comments on commit 7dd54da

Please sign in to comment.