3

My system has some dlls that are linked in other embedded executables, like commands from MSYS.

Directories structure:

MySystem/
  |_ mysystem.exe
  |_ CMakeLists.txt
  |_ embedded system/
      |_ msys_command1.exe
      |_ msys_command2.exe
      |_ msys-1.0.dll

When it is running fixup_bundle from CMake, this warning is showed:

EXEC : warning : cannot resolve item 'msys-1.0.dll'

  possible problems:
    need more directories?
    need to use InstallRequiredSystemLibraries?
    run in install tree instead of build tree?

EXEC : -- warning : gp_resolved_file_type non-absolute file 'msys-1.0.dll' returning type 'other' -- possibly incorrect
--
EXEC : warning : cannot resolve item 'msys-1.0.dll'

  possible problems:
    need more directories?
    need to use InstallRequiredSystemLibraries?
    run in install tree instead of build tree?

The MSYS commands are within the software embedded directory. If I put the embedded directory on fixup_bundle paths, the dlls are copied to my executable directory, but I don't want that behavior.

Is there a way to ignore that dlls?

I've tried with fixup_bundle macro IGNORE_ITEM, but it didn't work.

Besides that, the problem propagates to CPack:

  CPack: Create package using NSIS
  CPack: Install projects
  CPack: - Install project: MySystem
  Error copying file "msys-1.0.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/msys-1.0.dll".
  Error copying file "msys-intl-8.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/msys-intl-8.dll".
  Error copying file "Qt5Core.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/Qt5Core.dll".
  Error copying file "Qt5Gui.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/Qt5Gui.dll".
  Error copying file "Qt5Network.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/Qt5Network.dll".
  Error copying file "Qt5Widgets.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/Qt5Widgets.dll".
  Error copying file "libprotobuf.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/libprotobuf.dll".
  Error copying file "lua.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/lua.dll".
  Error copying file "qwt.dll" to "D:/mysystem/solution/build/_CPack_Packages/win64/NSIS/MySystem/qwt.dll".
  CPack: Create package
Avancini
  • 53
  • 4

1 Answers1

0

Not sure if this is what you need but I made a custom fixup_bundle function which also uses the IGNORE_ITEM key to skip libraries.

I call fixup_bundle2 as follows:

install(CODE "
        set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/dist/cmake)
        include(InstallRequiredSystemLibraries)
        include(BundleUtilities)
        include(FixUp)
        fixup_bundle2(\"\${CMAKE_INSTALL_PREFIX}/${APPS}\" \"${LIBS}\" \"${DIRS}\" IGNORE_ITEM \"exe_with_z64;exe_with_zip;libopenvr_api_so\")"
       )

Note the set(CMAKE_MODULE_PATH... line which is there to include my own provided fixup_bundle2 from my FixUp.cmake file. Also note that I need to specify libopenvr_api_so while in reality it is libopenvr_api.so.

fixup_bundle2 is a copy of fixup_bundle with the following added in the foreach(key ${keys}) loop:

      # also ignore libs in INGORE_ITEM
      if(key IN_LIST CFG_IGNORE_ITEM)
        message(STATUS "skipping ${key}")
        continue()
      endif()

You'll also need to set

cmake_policy(SET CMP0057 NEW) 

in the FixUp.cmake file apparently.