Opened 6 years ago

Closed 3 years ago

Last modified 8 months ago

#932 closed patch (fixed)

improve static-library build

Reported by: basiliscos Owned by: geos-devel@…
Priority: major Milestone: 3.10.0
Component: Default Version: main
Severity: Unassigned Keywords:
Cc:

Description

When I launch CMake with the following parameters:

cmake -DGEOS_BUILD_STATIC=on -DGEOS_BUILD_SHARED=off ..

it fails with the error:

CMake Error at capi/CMakeLists.txt:45 (add_dependencies):
  Cannot add target-level dependencies to non-existent target "geos_c".

  The add_dependencies works for top-level logical targets created by the
  add_executable, add_library, or add_custom_target commands.  If you want to
  add file-level dependencies see the DEPENDS option of the add_custom_target
  and add_custom_command commands.

The provided patch makes it optional to build C API (on by default, as in master), and static library builds fine.

The geos version is 3.7.0

Attachments (1)

CMakeLists.txt.patch (1.8 KB ) - added by basiliscos 6 years ago.
CMakeLists patch to optionally build C API

Download all attachments as: .zip

Change History (6)

by basiliscos, 6 years ago

Attachment: CMakeLists.txt.patch added

CMakeLists patch to optionally build C API

comment:1 by basiliscos, 6 years ago

With the patch it is possible to configure CMake as

cmake -DGEOS_BUILD_STATIC=on -DGEOS_BUILD_SHARED=off -DGEOS_BUILD_CAPI=off ..

comment:2 by pramsey, 3 years ago

Milestone: 3.10.0

comment:3 by pramsey, 3 years ago

Resolution: worksforme
Status: newclosed

cmake has changed a lot since this ticket, and I find that cmake -DBUILD_SHARED_LIBS=OFF builds a libgeos.a just fine.

comment:4 by GitHub <noreply@…>, 9 months ago

Resolution: worksformefixed

In 87bf94a/git:

Fix CMake on Windows with Visual Studio (#945)

Avoid setting CMAKE_BUILD_TYPE default when multi-config generators are
used.

Avoid setting CMAKE_BUILD_TYPE STRINGS property if it is not a cache
variable. This avoids CMake errors if CMAKE_BUILD_TYPE isn't set on the
command-line.

Closes #932

comment:5 by Mike Taves <mwtoews@…>, 8 months ago

In 40da3a61/git:

Fix CMake on Windows with Visual Studio (#945)

Avoid setting CMAKE_BUILD_TYPE default when multi-config generators are
used.

Avoid setting CMAKE_BUILD_TYPE STRINGS property if it is not a cache
variable. This avoids CMake errors if CMAKE_BUILD_TYPE isn't set on the
command-line.

Closes #932

Note: See TracTickets for help on using tickets.