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

Updating CMake #96

Merged
merged 48 commits into from
Dec 8, 2020
Merged

Updating CMake #96

merged 48 commits into from
Dec 8, 2020

Conversation

spaulaus
Copy link
Owner

@spaulaus spaulaus commented Dec 8, 2020

Description

  • Completely rewritten most of the CMake files to use more robust target specific commands. We no longer have globally defined includes or libraries. This makes it much clearer as to what program depends on what code/library.
  • Uses functionality that requires CMake 3.13+
  • Only build shared objects now. This reduces our exe size, and makes it easier to swap out components if needed.
  • Cleaned up compilation errors and ensure that all of the programs compile.
  • Dumped cmake flags that weren't needed, or didn't provide value.
  • Moved the flags in the files that they control. This gives a better coupling between the flag and what it toggles.
  • Relocated all testing related codes to the test folder.
  • Fixed FindPLX and FindXIA to take into account changes in those APIs.
  • Removed FindGSL as it is now bundled with CMake
  • Now always generate compile_commands.json, just makes it easier for those that need it. It's not like it's a lot of overhead.
  • Organized Acquisition utility codes to live in better spots.

Related Issue

#94

Motivation and Context

The CMake scripts were getting a little out of hand. They didn't conform to modern CMake best practices. I also found them hard to follow.

How Has This Been Tested?

Tested by

  • building the software with ALL flags enabled.
  • deploying to TravisCI and ensuring that the programs build
  • deploying to TravisCI and ensuring all tests still pass.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the Contributing document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Since we're only building SOs we need to make sure that all the headers get installed properly. We'll do this with the PUBLIC_HEADER property for the library.
The stock makefile generates PlxApi.a and PlxApi.so without lib on the front. I wanted to move this back to a more stock install, so we modified the variables to support the stock library names.
We're not installing this binary as it's meant for test purposes.
It was added to Cmake in version 3.2.
I hated that the install directory would be created no matter what. We now use the default install prefix and append the project name to it. This should help make us more portable.

Added a library configuration file since we're building only SOs now. This will make it easier for users to update ld's search paths.

Adjsuted the install paths for files to match where you should find them on *nix systems. Not perfect but makes things clearer.
@spaulaus spaulaus self-assigned this Dec 8, 2020
@spaulaus spaulaus added build Build platform updates/fixes/etc. enhancement New feature or request labels Dec 8, 2020
@spaulaus spaulaus merged commit dd811de into master Dec 8, 2020
@spaulaus spaulaus deleted the feature/94-updating-cmake branch December 8, 2020 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build platform updates/fixes/etc. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant