mdavidsaver / cmake4epics

support for using CMake to find EPICS and build IOCs
Other
6 stars 3 forks source link

Create Modules subdirectory in cmake #2

Closed mark0n closed 6 years ago

mark0n commented 6 years ago

Let's follow CMake conventions. See for example /usr/share/cmake-x.y/ or the CMake Wiki.

mark0n commented 6 years ago

EPICSMain.cpp and EPICSVersion.cmake.in should probably go into /usr/share/cmake-x.y/Templates. Not sure how to include them from there, though.

mark0n commented 6 years ago

OK, I have moved EPICSMain.cpp and EPICSVersion.cmake.in into /usr/share/cmake-x.y/Templates. Not sure if there is a better way to include them from there.

mark0n commented 6 years ago

OK, I think I finally got it right. The examples build as well as my device support module.

mdavidsaver commented 6 years ago

I wasn't immediately enthused about reorganizing the source tree. I'll agree to it once though. You'll need to update the README:

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/c4e/cmake)

It's probably time to start a changelog as well.

Also, using /usr/share/cmake-x.y for the deb packaging is going to impose an unnecessarily strict dependence on cmake version. However, I checked and unfortunately there really are no other paths searched. So you either need to use appropriately tight Depends and possibly Build-Depends, or use a trigger to inspect the cmake version and copy into the right place a la. dh_python.

mark0n commented 6 years ago

Sorry, I actually meant to say cmake/Templates in my second and third comment.

For the Debian package I was actually intending to install the cmake folder into /usr/lib/epics. Please see https://github.com/mark0n/cmake4epics/tree/debian for a first try in packaging it.

mark0n commented 6 years ago

Good catch with the README. I just fixed this.