Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make libartnet 99% CMake compatible #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

enwi
Copy link

@enwi enwi commented Nov 1, 2024

I added a CMakeLists.txt and edited the config.h.in accordingly. It works fine on my MacBook running MacOS Sonoma (M1). A few things still need to be fixed:

  • GNU libc compatible malloc -> HAVE_MALLOC
  • GNU libc compatible realloc -> HAVE_REALLOC
  • C99 stdbool.h -> HAVE_STDBOOL_H
  • Check for _Bool type -> HAVE__BOOL
  • Name of package -> PACKAGE
  • Bug report address -> PACKAGE_BUGREPORT
  • Full name of package -> PACKAGE_NAME
  • Full name and version of package -> PACKAGE_STRING
  • Symbol short name -> PACKAGE_TARNAME
  • Version -> PACKAGE_VERSION
  • Type of arg 1 of select -> SELECT_TYPE_ARG1
  • Type of arg 2,3 & 4 of select -> SELECT_TYPE_ARG234
  • Type of arg 5 of select -> SELECT_TYPE_ARG5
  • Ansi C header files -> STDC_HEADERS
  • Safely include both <sys/time.h> and <time.h> -> TIME_WITH_SYS_TIME
  • Version number -> VERSION
  • const does not conform to ANSI C -> const
  • rpl_malloc if the replacement function should be used -> malloc
  • rpl_realloc if the replacement function should be used -> realloc
  • unsigned int if <sys/types.h> does not define -> size_t

- Tested to work on MacOS Sonoma (M1)
@nomis52
Copy link
Member

nomis52 commented Nov 3, 2024

It's been a while since I've thought about autoconf & build tools, but f this is now generating config.h.in from CMakeLists.txt, does that mean that configure.ac is now redundant?

@enwi
Copy link
Author

enwi commented Nov 4, 2024

In theory you won't need to use configure anymore, unless you want to still be able to use the old build system. Therefore there are two options.

  1. Remove all of the old build system and only keep CMake
  2. Keep both build systems to be backwards compatible

For option two I would recommend renaming the config.h.in to something else for CMake as it currently breaks the configure command

@nomis52
Copy link
Member

nomis52 commented Nov 7, 2024

Let's go for option 2)

@enwi
Copy link
Author

enwi commented Nov 7, 2024

Then I will change a few things

@enwi
Copy link
Author

enwi commented Nov 10, 2024

@nomis52 I have updated the PR

@nomis52
Copy link
Member

nomis52 commented Nov 10, 2024

Thanks, do you mind adding to the README explaining how to build with cmake

Rest of it looks good.

@enwi
Copy link
Author

enwi commented Nov 12, 2024

Sure, I can do that. What about the open points? Not all flags/defines are set correctly

@MarcoHess
Copy link

We were trying to use this project with CMake and found that we needed to add an include directory reference to the artnet subdirectory in the CMakeList.txt to get our project to compile correctly:

# Include directories
target_include_directories(libartnet PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/artnet)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants