TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: Nicholas Boel
from: Nil Alexandrov
date: 2024-03-05 07:49:00
subject: Smapi

Hello, Nicholas!

Monday March 04 2024 22:28, from Nicholas Boel -> Nil Alexandrov:

 NB> For the record, I'm working on Smapinntpd a bit. It requires smapi
 NB> which, in turn, will require huskylib. I installed it fairly easy with
 NB> some tinkering, because I have all of the husky project already
 NB> installed and in use on my system, but for someone downloading the
 NB> program and trying to install it without the husky project already
 NB> installed will be confusing. I'm trying to figure out the easiest way
 NB> to do so, so I can either write up more current installation
 NB> instructions, or somehow provide these with the package so one can
 NB> just install everything in one shot.

I personally prefer cmake, not low-level make files. I use smapi+huskylib in my pet project. I just fetch and compile both smapi and huskylib from my main CMakeLists.txt. I also replace their CMakeLists.txt and apply my patch, otherwise I am having issue compiling for mingw64 and other fancy stuff.

# Import Husky libraries
include(FetchContent)
message(STATUS "Importing huskylib library from github")
FetchContent_Declare(
        huskylib
        GIT_REPOSITORY "https://github.com/huskyproject/huskylib.git"
        GIT_TAG d3c0c1c3b643d7fce45f82d6c8378802e85d9205
        # Patch command will ru-run every cmake reload, so the patch should not return an error.
        # This fix won't work in Windows environment.
        PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/huskylib.patch" || true
)
FetchContent_Populate(huskylib)
# replace the cmake file
configure_file(CMakeLists_huskylib.txt ${huskylib_SOURCE_DIR}/CMakeLists.txt COPYONLY)
# generate the date file, content is not that important
file(WRITE ${huskylib_SOURCE_DIR}/cvsdate.h "char cvs_date[]=\"2024-01-01\";")
# delete the version file which confuses the MacOSX12.sdk/usr/include/c++/v1/cstddef
file(REMOVE ${huskylib_SOURCE_DIR}/version)
add_subdirectory(${huskylib_SOURCE_DIR} huskylib)
target_compile_options(huskylib INTERFACE -Wno-register)
target_compile_options(huskylib PRIVATE -Wfatal-errors -Wno-register)

message(STATUS "Importing smapi library from github")
FetchContent_Declare(
        smapi
        GIT_REPOSITORY "https://github.com/huskyproject/smapi.git"
        GIT_TAG c2fc9ecb0dd1ec8909e9e9709bfdd0031d5b9bf2
)
FetchContent_Populate(smapi)
# replace the cmake file
configure_file(CMakeLists_smapi.txt ${smapi_SOURCE_DIR}/CMakeLists.txt COPYONLY)
# generate the date file, content is not that important
file(WRITE ${smapi_SOURCE_DIR}/cvsdate.h "char cvs_date[]=\"2024-01-01\";")
# delete the version file which confuses the MacOSX12.sdk/usr/include/c++/v1/cstddef
file(REMOVE ${smapi_SOURCE_DIR}/version)
add_subdirectory(${smapi_SOURCE_DIR} smapi)

Best Regards,
Nil
--- GoldED+/LNX 1.1.5
                                                                                            
* Origin: KC1GSH (1:16/101)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.