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

Cmake #9

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

Cmake #9

wants to merge 5 commits into from

Conversation

chrisrichardson77
Copy link

This might take the project in a direction you don't want it to go, but in this branch I've replaced the makefile and xcode build system with cmake, which brings the following advantages:

  1. Out-of-source builds
  2. Generation of project files for many of the mainstream IDE (inc. makefiles and xcode)
  3. Automatic detection of mysql, sqlite and curl and inclusion of the relevant code files
  4. Detection of Flex and automatic regeneration of code from the .lex file if Flex is present (uses fallback version otherwise)
  5. Generation of cmake configuration files for discovery by other (cmake) projects wishing to use the lib
  6. While CMake can generate static libs, this version generates dynamic libs (which is generally preferable from a licensing point of view)

CPU target:
The previous makefile-based system offered a range of CPU targets which is not directly covered in this CMake solution, but can still be achieved my modifying the compiler environment settings or by passing switches to the compiler using the command-line CMAKE_CXX_FLAGS variable (also modifiable via the cmake UIs).

Versioning:
I've implemented a simple, standard major.minor.patch scheme in the version.cmake file; this can easily be modified at the SET_TARGET_PROPERTIES stage in the main CMakeLists.txt file should another versioning scheme be desired.

General structure:
In order to make the installation of includes and the separation of generated code simpler and clearer, the source/header and flex-related files were moved to separate directories.

DB client lib discovery:
Since the mysql and sqlite client libraries do not provide a discovery interface (at least not to cmake, which can also piggyback pkgconfig) simple discovery scripts were added to cmake/Modules. Should the client libraries provide their own versions in the future, these files could be deleted.

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.

1 participant