0
0
mirror of https://github.com/zeux/pugixml.git synced 2024-12-27 13:33:17 +08:00

42 Commits

Author SHA1 Message Date
Wolfgang Stöggl
8b074b171f Fix debug postfix in pkgconfig file
In case of USE_POSTFIX, the POSTFIX is dependent
on the CMAKE_BUILD_TYPE.
Use the correct POSTFIX also in the generated pugixml.pc file.

This results in the following contents of pugixml.pc:
- Release:
  Libs: -L${libdir} -lpugixml
- RelWithDebInfo
  Libs: -L${libdir} -lpugixml_r
- MinSizeRel:
  Libs: -L${libdir} -lpugixml_m
- Debug:
  Libs: -L${libdir} -lpugixml_d
2020-07-15 21:59:05 +02:00
Julian Xhokaxhiu
5fdc78b66b
[Cmake] Static build should not export APIs
Fixes #359
2020-07-06 10:22:21 +02:00
Kyle Edwards
d272f11073 Export targets from build directory
This will allow projects to use pugixml from its build directory
rather than having to install it.
2020-04-27 16:02:56 -04:00
Kyle Edwards
184e6ed916 Use COMPONENT arguments in install() commands 2020-04-27 13:47:58 -04:00
Kyle Edwards
8c74d8b198 Fix multiple-rules-for-target error
The old logic for BUILD_SHARED_LIBS and BUILD_SHARED_AND_STATIC_LIBS
would produce two targets with the same name and different build
rules. The Makefile generator tolerated this, but the Ninja generator
raised an error. Fix the logic so that only one shared and one static
target gets built, and make the pugixml target an ALIAS of the one
dictated by BUILD_SHARED_LIBS.
2020-04-27 13:47:58 -04:00
Gianfranco Costamagna
2c24e90c23
Update CMakeLists.txt to rename the static and shared libraries to pugixml
Don't call them pugixml-shared or pugixml-static, because this breaks pkgconfig calls and userspace tools.
2020-02-07 14:55:25 +01:00
Arnaud Botella
aa2e0909ac
Add POSITION_INDEPENDENT_CODE option
Allow to use the static library in other dynamic librairies. This is a standard cmake option https://cmake.org/cmake/help/v3.11/prop_tgt/POSITION_INDEPENDENT_CODE.html#prop_tgt:POSITION_INDEPENDENT_CODE
2019-12-06 17:25:37 +01:00
Isabella Muerte
99ad261611 🐛 Fix incorrect installation location for exported CMake targets 2019-10-17 21:44:48 -07:00
Isabella Muerte
6949232bbd 🐛 Fix install locations for pkgconfig *and* cmake 2019-10-06 13:08:01 -07:00
Isabella Muerte
3df5036344 🔥 Remove commented out CMake code 2019-10-06 12:33:03 -07:00
Isabella Muerte
ad93a373ab Adjust MSVC runtime settings as requested.
The block of code can be removed in the future if CMake 3.15 ever
becomes the minimum
2019-10-01 10:20:30 -07:00
Isabella Muerte
8a0aac18ea Update check command to output text on failure
Move pugixml-config.cmake.in to scripts/ to prevent polluting the root
2019-09-30 22:00:04 -07:00
Isabella Muerte
1c5a0bb325 Update CMake to modern approach
New Features:

pugixml-shared and pugixml-static are "always" available, but not always
built. This allows downstream projects to still use them, and to make
sure our configurations are correct regardless of if they are being
built. They are not always installed however.

pugixml-shared and pugixml-static have ALIAS libraries of
pugixml::shared and pugixml::static respectively. These names are also
respected in the `find_package(pugixml CONFIG)` generated files, so its
safe to use pugixml in a CMake project regardless of whether it is
installed locally, or if its a subproject via `add_subdirectory`.

pugixml will automatically select the correct library type based on
BUILD_SHARED_LIBS. A pugixml::pugixml ALIAS is also available.

CMAKE_MSVC_RUNTIME_LIBRARY from CMake 3.15 has been backported.

CMake will now rely on generator expressions (a powerful abstraction in
large projects with many subdirectories) for most work. This offloads
work from the single-threaded configure stage to the multithreaded
generation stage.

pugixml now uses CTest as the runner.

Some settings are automatically disabled if pugixml is used as a
subdirectory. These are still able to be manually set, but are hidden
from folks who choose to use CMake GUI.
2019-09-28 13:02:55 -07:00
Isabella Muerte
195dfe1d8d 🚧 Begin moving pugixml to modern(ish) CMake
⬆️ Bump CMake minimum to 3.4
🐛 pugixml no longer requires a C compiler to be found or set to
compile correctly. This speeds up configuration and building on windows.
🚧 Begin laying groundwork to backport MSVC_RUNTIME_LIBRARY
property
2019-09-28 10:47:15 -07:00
Arseny Kapoulkine
6934b123d4 Move pugixml.rc to scripts/
This keeps src/ folder clean of auxiliary files only required for
special builds; note that CMakeLists.txt already depends on scripts/
(specifically for pkgconfig setup).
2019-09-21 09:21:13 -07:00
lady mesh
6fb765ca9d Add: Windows DLL version info header (#298)
Closes #294
2019-09-19 07:27:40 -07:00
Arseny Kapoulkine
44e4d7e40b Update version to 1.10
Note: this chang also updates PUGIXML_VERSION macro to allow for
double-digit minor versions; this preserves the continuity of versions
so PUGIXML_VERSION >= 190 will still work.
2019-09-11 21:09:50 -07:00
Matan Nassau
4f6e7454fd fix cmake option USE_POSTFIX (#283)
appending the suffix to the build product need not be a function of
whether CMAKE_CONFIGURATION_TYPES is set.  for example, having two ninja
build trees---one for debug and another for release---is a fine use-case
for USE_POSTFIX.
2019-08-04 13:15:10 -07:00
Artur Leonov
c5752917c7 fix running tests (#280) 2019-07-25 19:14:39 -07:00
Arseny Kapoulkine
d902709da2 Refactor CMakeLists.txt support for multiple targets
We now have a ${LIBRARY} variable that we can either use directly or in
a foreach loop to be able to process either pugixml or pugixml-static
and pugixml-shared targets.

Also fixes incorrect shared library assignment when
BUILD_SHARED_AND_STATIC_LIBS is defined, and only links the static
library in for make check.
2019-02-06 08:15:27 -08:00
basti171
1d59e4d9d8 make pugixml build static and shared via cmake (#257) 2019-02-06 07:39:23 -08:00
Millian Poquet
b3db08ffcc pkg-config: Use CMake GnuInstallDirs FULL vars
Fixes an installation problem in Nix packages, as non-FULL variables are
already absolute paths in this case.
2018-12-10 11:12:36 -08:00
Arseny Kapoulkine
cb4a74d5e5 Minor CMakeLists.txt cleanup
Instead of hardcoding SOVERSION, use CMake variables to set it up.

Closes #220.
2018-08-13 21:38:44 -07:00
Wolfgang Stöggl
c12889f7cc Use CMAKE_INSTALL_LIBDIR for pugixml.pc (#215)
- Up to now, the libdir was hardcoded to "lib" inside pugixml.pc and
  the install directory of pugixml.pc was "lib/pkgconfig"
- Adds support for lib and lib64 by using CMAKE_INSTALL_LIBDIR variable
2018-06-26 15:53:42 -07:00
Bernd Amend
12139f587b fix cmake warning "Policy CMP0048 is not set" (#214)
This also bumps the minimum CMake version to 3.0 (from 2.8.12).
2018-06-20 07:55:14 -07:00
Arseny Kapoulkine
51322cffa1 Move CMake build postfix setup behind an off-by-default USE_POSTFIX
This setup can interfere with existing workflows in two ways:

- If the target application used CMake and configured custom postfixes,
this change would override them

- If the target application did *not* use CMake, it'd have to abide by
these conventions even if the target configuration used is unexpected -
for example, the default "preferred" configuration is frequently
RelWithDebugInfo, not Release, which now has a postfix.

Fixes #198.
2018-04-27 08:13:08 -07:00
Alexander Straub
4c791586ee Suffixes for different build types (#191) 2018-04-11 08:13:50 -07:00
Eli Schwartz
daeb8013b2 cmake: always install the pkg-config file (#193)
There's really never a reason to *not* want this installed. If an option
is needed to specify installing in a versioned subdirectory, this option
should be explicitly described rather than hidden in something else.

As an added bonus, this makes the CMake install code slightly *less*
complicated.
2018-04-09 10:48:53 -07:00
Arseny Kapoulkine
0c74e117b8 Update version to 1.9 2018-04-02 21:46:14 -07:00
Ben Boeckel
7fcfb72dcd cmake: keep sources and headers separate 2018-01-29 13:50:31 -05:00
Ben Boeckel
0df7adb680 cmake: set the minimum version before the project call 2018-01-29 13:50:30 -05:00
Arseny Kapoulkine
6016e2180e CMake: Add __declspec(dllexport) for shared library builds
This makes sure that MSVC shared library build actually exports all the
needed symbols and generates import table.

Somehow, this is actually enough to make pugixml link as a DLL - there's
no need to specify __declspec(dllimport) even though pugixml exports
classes via DLL.

Fixes #113.
2017-11-12 20:21:46 -08:00
Arseny Kapoulkine
52da6f71d0 Increase the minimum CMake version to 2.8.12
This is a followup to 198900eff403982f080958459f1ccb45cdefe9a4.

target_include_directories was introduced in 2.8.12, thus CMake 2.6 no
longer works.
2017-06-14 23:06:32 -07:00
Daniel Knibbe
198900eff4 Added target_include_directories() to properly export include directories (#130)
Fixes #126
2017-01-17 09:30:01 -08:00
Arseny Kapoulkine
c75e3c45e5 Update version to 1.8 everywhere 2016-11-09 09:02:44 -08:00
Arseny Kapoulkine
2933a03d09 CMake: Simplify install path logic
Select correct suffix to use for pkg-config
2016-09-20 22:16:47 -07:00
Arseny Kapoulkine
fd896d2476 CMake: Simplify pkg-config support
Merge USEOWNSUBDIR and PKGCONFIG build flags; move the pkg-config source file
to scripts/.
2016-09-20 22:11:42 -07:00
peterbud
0918dd2b99 Adding options PKGCONFIG build options 2016-09-13 21:03:11 +02:00
peterbud
6d69483bbc Adding PKG-CONFIG support
Also creating a separate install directory under INCLUDE and LIB directories
2016-09-12 21:44:20 +02:00
Arseny Kapoulkine
4dbb564619 Only enable cxx_long_long_type if it is in the list of features
Fixes #99.
2016-06-18 01:51:28 -07:00
Jippe Holwerda
4469a32970 Change paths according to new CMakeLists.txt location. 2016-02-25 20:38:07 +01:00
Jippe Holwerda
806c75652a Put CMakeLists.txt in the project root.
Having CMakeLists.txt in the project root makes it so much easier to use pugixml
as an external dependency in another CMake project.
2016-02-25 19:30:03 +01:00