Open torbjoernk opened 3 years ago
Thank you for the suggestions. We just started to refactor the build scripts, so we can incorporate these in the next release.
I don't have a workaround for Issue 1: building both libraries. In the future, we won't build a position independent library when building shared libraries.
For Issue 2, you could use ExternalProject_Add
and point it to the git repo. You can then override the installation behavior in a number of ways to achieve what you want above. For example you could use:
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_INSTALL_BINDIR})
And skip the install step, so the build puts the libraries where you want them.
I don't know much about GNUInstallDirs
, but we can look into using in the future.
When integrating Interop as a dependency into another CMake-driven C++ project, it is difficult to govern the parts of Interop that are being installed/deployed together with the parent project.
The current approach I'm following consists of pulling in this Git repo as a submodule into
$MY_PROJECT/external/interop
and including it viaadd_subdirectory(interop)
from within$MY_PROJECT/external/CMakeLists.txt
. Thereby, I pre-set several Interop CMake options viaset(... ON|OFF CACHE BOOL "" FORCE)
, e.g.set(ENABLE_CSHARP OFF CACHE BOOL "" FORCE)
before theadd_subdirectry(...)
statement.Issue 1 For my deployment scenario (Unix only) I'm preferring shared libraries. However, I don't see any possibility to select only one of
libinterop_fpic_lib.so
orlibinterop_lib.so
of ending up in$PREFIX/lib64
after amake install
of my project.Suggestion 1 add an option to choose between the position independent and the position dependent variants of libinterop while defaulting to the current behavior:
Issue 2 In addition, the
LIBRARY DESTINATION
andARCHIVE DESTINATION
paths are hard coded tolib64
. It would be great utilizing GNUInstallDirs'sLIBDIR
to get a consistent path across a CMake (super-)project on the same system.Suggestion 2 Use GNUInstallDirs's
LIBDIR
/BINDIR
when defining the destination ofLIBRARY
andARCHIVE
install targets: