Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Build project from top-level CMakeLists.txt #1

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

Conversation

aszlig
Copy link

@aszlig aszlig commented Jun 11, 2018

This should (hopefully, haven't tested) be backwards-compatible (especially for the buildbot-scripts) with the current top-level Makefile and it introduces just a new CMakeLists.txt at the top-level plus adds a few more fixes that might come up in the future once distros are picking up libinsane.

The idea is to switch to the top-level CMakeLists.txt for the buildbot scripts and then unify everything into one CMake project, so that there is only the target for the actual library and glib. This should also get rid of a few hacks that have been made to for example reference libinsane from libinsane-gobject.

In the long term I guess it would also make sense to flatten the tree a bit, so there is only src for the actual library and glib for the GLIB bindings.

We're going to add a top-level CMakeLists.txt, so whenever we use the
top-level one the CMAKE_SOURCE_DIR variable is the top-level of the
source tree.

Subprojects such as libinsane and libinsane-gobject won't find their
respective CMake includes because they're located one level deeper.

Signed-off-by: aszlig <[email protected]>
This also adds the corresponding LDFLAGS and CFLAGS to the test targets
and will only compile the tests if pkg-config was able to locate CUnit.

Signed-off-by: aszlig <[email protected]>
This is only in preparation to the transition to having one
CMakeLists.txt to build the base library and it's GLIB equivalents.

The GLIB bindings are only built if CMake was able to locate it.

Signed-off-by: aszlig <[email protected]>
The CMakeLists.txt in libinsane-gobject relies heavily on a specific
directory structure and also uses a few workarounds that reference
relative paths that might not be there when using our new top-level
CMakeLists.txt.

However, I've added a few workarounds as well, because right now we want
to still support the Makefile that resides in the top-level until the
buildbot scripts were adjusted so that they build from the top-level
CMakeLists.txt.

So for now this links the gobject bindings statically against libinsane,
which we don't want to necessarily have in the long term (only optional
at least).

Signed-off-by: aszlig <[email protected]>
@jflesch
Copy link
Member

jflesch commented Jun 11, 2018

Checking whether CMAKE_CURRENT_SOURCE_DIR equals CMAKE_SOURCE_DIR seems
to be not very reliable, so let's actually set a variable in the
top-level CMakeLists.txt which we can check in the individial projects.

Signed-off-by: aszlig <[email protected]>
@aszlig
Copy link
Author

aszlig commented Jun 11, 2018

@jflesch: Fixed.

@jflesch
Copy link
Member

jflesch commented Jun 11, 2018

https://origami.openpaper.work/#/builders/2/builds/464 : OK
(The tests are still running on the builder)

By the way, would it possible to make the root Makefile use this new CMakeLists.txt ? I think it would be the easiest way to make that this new CMakeLists.txt is actually maintained.

@aszlig
Copy link
Author

aszlig commented Jun 11, 2018

@jflesch: Why not move completely to CMake and delete it?

@jflesch
Copy link
Member

jflesch commented Jun 11, 2018

We can. I would have to update a little the scripts of the buildbot to generate the Makefile from the root CMakelists.txt, but that's no big deal.

To minimize the changes in the buildbot scripts, I would just need the "standard" make targets that I use in all the other OpenPaper.work repositories:

  • make clean: remove all build or temporary file (ideally, everything that is not versioned, but must remain independent from Git).
  • make test : run tests (must return a value !=0 if it fails)
  • make check : check the coding style + static analysis (must return a value != 0 if it fails)
  • make doc: generate the documentation (may run the install_py target if required, see buildbot script)
  • make build: build whatever can be built or compiled
  • make install : install the thingies system-wide
  • make install_py / make uninstall_py: install / uninstall just the Python parts (if there are any ; else do nothing)

Optionally, I also usually add:

  • make build_c : build the C parts
  • make build_py: build the Python parts
  • make install_c : install the C parts

GerHobbelt pushed a commit to GerHobbelt/libinsane that referenced this pull request Sep 13, 2023
Reduce requests to underlying API

Closes openpaperwork#1

See merge request World/OpenPaperwork/libinsane!6
GerHobbelt pushed a commit to GerHobbelt/libinsane that referenced this pull request Sep 13, 2023
Libinsane: normalizers/source_nodes: set the source as soon as options are requested

Closes openpaperwork#1

See merge request World/OpenPaperwork/libinsane!14
GerHobbelt pushed a commit to GerHobbelt/libinsane that referenced this pull request Sep 13, 2023
…_descriptor() before sane_control_option().

When using the backend 'net', if we got a SANE_INFO_RELOAD_OPTIONS,
we must first call sane_get_option_descriptor() before sane_control_option()
even if we just want to use sane_control_option() to get the number of options.
--> we make unused call here just to make backend 'net' reloads the options.

This change make the workaround 'set_opt_late' useless --> removed.

Fixes openpaperwork#1

Signed-off-by: Jerome Flesch <[email protected]>
GerHobbelt pushed a commit to GerHobbelt/libinsane that referenced this pull request Sep 13, 2023
Sane: backend 'net': item->get_options(): always call...

Closes openpaperwork#1

See merge request World/OpenPaperwork/libinsane!29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants