Commit Graph

18 Commits

Author SHA1 Message Date
Sam Edwards 6097d34ead CMake: Neatly format everything for readability and consistency 2019-04-14 22:37:18 -06:00
Sam Edwards e49306fec9 CMake: Wrap target names in $<TARGET_NAME:...>
This helps CMake's export generator understand the expression.
2018-11-28 16:13:05 -07:00
Sam Edwards 3050203e24 CMake: Update add_metalib() to support exports
This allows exporting (a stub function that forwards to) a
function that returns a value - it's particularly useful in
the graphics plugins for the "get_pipe_type_foo()" functions.

This also frees up CMake from needing to use any of the source
files in the metalibs/*/ directories.
2018-11-08 20:15:08 -07:00
Sam Edwards dd5c411e88 CMake: When building metalib components, properly flag SYSTEM include dirs 2018-10-18 13:42:12 -06:00
Sam Edwards 1e38910d9d CMake: Fix BuildMetalib's BUILDING_ symbol propagation 2018-10-13 15:07:09 -06:00
Sam Edwards 32a6552af4 CMake: Make BuildMetalib's link override more like CMake 3.12 2018-10-11 17:38:30 -06:00
Sam Edwards 47b5a50688 CMake: Don't always override target_link_libraries()
Previously, we would override target_link_libraries() to support
object "linking" since this wasn't supported in versions of CMake
before 3.12. Now that 3.12 is released, we only do it for versions
of CMake before that release.
2018-10-10 20:16:33 -06:00
Sam Edwards a0d9a931e0 CMake: Simplify target_link_libraries "object" linking shim
This uses generator expressions instead, so that it's no longer
dependent on all linked component libraries existing first.
2018-10-10 20:16:32 -06:00
Sam Edwards e89621b88d CMake: "Flatten" metalibs more
By "flatten" I mean that component libraries aren't referenced by
genex anymore; instead, their include directories and libraries
are copied out of their interfaces and into the interface of
the metalib.

This prepares for exporting our targets, by making sure that the
component libraries don't have to be installed for CMake to be
able to export metalibs.
2018-10-10 20:16:32 -06:00
Sam Edwards b8fa692e2f CMake: Fix BuildMetalib on CMake 3.0.2
CMake now tests out correctly on 3.0.2 again.
2018-10-09 02:01:35 -06:00
Sam Edwards 9b4b83c0e1 CMake: Properly propagate INTERFACE_COMPILE_DEFINITIONS to component libs 2018-10-07 00:51:26 -06:00
Sam Edwards 1520d712d4 CMake: Remove target_use_packages
Instead, let's use a PKG::PKGNAME interface library, which simplifies
the linking and also allows us to use imported libraries from
find_package in the future.
2018-09-21 10:17:05 -06:00
Sam Edwards 2e98b68e3b CMake: Make directbase/pandabase INTERFACE libraries
They export no code, and are really only used to contain several
preprocessor macros relevant to their respective packages. On
Windows, they're a problem: MSVC doesn't generate a .lib when
compiling a .dll that exports nothing.
2018-06-10 02:29:49 -06:00
Sam Edwards a088e6aba5 CMake: Autogenerate metalib init files 2018-06-10 02:29:35 -06:00
Sam Edwards 5b3ca1bb05 CMake: Fix up the "transitive library" metalib logic
This fixes some cases where transitive libraries, as nominated
by a component library, were not being absorbed into a metalib,
due to the library actually not being defined yet. This makes the
logic a little more robust, first by explicitly requiring a metalib
definition to come after all component library definitions, and second
to assume a library "linked" to a component library is a non-component
if it isn't defined (yet).
2018-04-20 00:20:14 -06:00
Sam Edwards 218d0e8ade CMake: Build dtool metalibs as metalibs 2018-04-19 00:07:08 -06:00
Sam Edwards 5a31844e11 CMake: Slightly tweak component-library -D inheritance rules
This only inherits -D flags from another component library. The private
-D flags should not be inherited from regular libraries.
2018-04-19 00:07:08 -06:00
Sam Edwards 4cec331722 CMake: Add support for building metalibs as metalibs 2018-04-18 14:42:56 -06:00