Closed mrp089 closed 11 months ago
Addresses #35.
I added the interface library to ./lib
. @ktbolt, do you know how to remove the ./include
and ./shared
folders?
I don't know much about CPack but I think you just need to set the components you want included using the install
command.
Because applications
does not have a CMakeLists.txt file there may not be as much control as to what is include because the Python interface is also there.
Maybe try
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN FALSE)
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED FALSE)
I tried a couple of things:
set(CPACK_COMPONENT_UNSPECIFIED_HIDDEN NO)
set(CPACK_COMPONENT_UNSPECIFIED_REQUIRED NO)
set(CPACK_ARCHIVE_COMPONENT_INSTALL NO)
set(CPACK_IGNORE_FILES "shared/*" "include/*")
set(CPACK_COMPONENTS_IGNORE_GROUPS "shared;include")
set(CPACK_SOURCE_IGNORE_FILES "*/_deps/*")
I still get the include
and shared
folders.
I'd be fine to live with that since we get what we need (bin/svzerodcalibrator
, bin/svzerodsolver
, lib/libsvzero_interface.dylib
), and the installer is still only 2.2M
big.
@mrp089 Let me have a look.
I think interface
needs to have an include file added to the installer too.
I think the source of these includes might be in the main CMakeLists.txt
, not in the distribution one.
I modified svZeroDPlus/distribution/CMakeLists.txt
with
# create the installer for both solver and calibrator
install(TARGETS svzerodsolver svzerodcalibrator
RUNTIME DESTINATION bin
COMPONENT applications)
# add the interface header
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../src/interface/interface.h DESTINATION include COMPONENT headers)
# add interface library
if(APPLE)
install(FILES ${CMAKE_BINARY_DIR}/src/interface/libsvzero_interface.dylib DESTINATION lib COMPONENT libraries)
elseif(LINUX)
install(FILES ${CMAKE_BINARY_DIR}/src/interface/libsvzero_interface.so DESTINATION lib COMPONENT libraries)
endif(APPLE)
set(CPACK_COMPONENTS_ALL applications libraries headers)
The installer now creates just the needed directories
$ ls /usr/local/sv/svZeroDPlus/2023-10-13
bin/ include/ lib/
/usr/local/sv/svZeroDPlus/2023-10-13/bin:
svzerodcalibrator* svzerodsolver*
/usr/local/sv/svZeroDPlus/2023-10-13/include:
interface.h
/usr/local/sv/svZeroDPlus/2023-10-13/lib:
libsvzero_interface.dylib
@mrp089 Looking good!
What should we do for Windows? Other SV projects use Cygwin/Make to build on WIndows. It would be better to use CMake of course.
@ktbolt, I made those changes (as a maintainer, you can also directly commit/push on my feature branch, which will appear in this pull request). I get:
/usr/local/sv/svZeroDPlus/2023-10-16/bin:
svzerodcalibrator svzerodsolver
/usr/local/sv/svZeroDPlus/2023-10-16/include:
interface.h
/usr/local/sv/svZeroDPlus/2023-10-16/lib:
libsvzero_interface.dylib
Ready to merge from my side!
I've never used cmake
or built installers for Windows.
All I can tell you is that pip install ...
worked fine with svZeroDSolver
under Ubuntu, Mac OS, and Windows. We still have the option to do that here.
I will later add support for Windows.
Eventually closes #50. Work in progress to check GitHub Actions.