[x265] [PATCH 2 of 4] cmake: add install targets, machine generate x265.def and x265_config.h

Rafaël Carré funman at videolan.org
Mon Oct 14 12:04:14 CEST 2013


Hi,

Le 12/10/2013 23:10, Steve Borho a écrit :
> # HG changeset patch
> # User Steve Borho <steve at borho.org>
> # Date 1381607058 18000
> #      Sat Oct 12 14:44:18 2013 -0500
> # Node ID 1097e547c441831734d3c66998325fe5532620a0
> # Parent  28690748ab1d6d913c2e0bab4d0365e0b6cc6db4
> cmake: add install targets, machine generate x265.def and x265_config.h
> 
> Now X265_BUILD is maintained in just a single place, souce/CMakeLists.txt.
> 
> The shared library is only installed if a valid tag is found; meaning the user
> must be building a Mercurial clone or a release tarball with .hg_archive.txt
> file in it (otherwise they must install the shared library themselves)
> 
> diff -r 28690748ab1d -r 1097e547c441 source/CMakeLists.txt

> @@ -165,6 +173,21 @@
>  # MINGW builds static: libx265-static.a shared: libx265.dll + libx265.dll.a
>  # *NIX  builds static: libx265.a        shared: libx265.so
>  
> +include(version) # determine X265_VERSION and X265_LATEST_TAG
> +if(X265_LATEST_TAG)
> +    # shared library is not installed if a tag is not found
> +    set_target_properties(x265-shared PROPERTIES VERSION ${X265_LATEST_TAG} SOVERSION ${X265_BUILD})
> +    install(TARGETS x265-shared
> +            RUNTIME DESTINATION bin
> +            LIBRARY DESTINATION lib
> +            ARCHIVE DESTINATION lib/x265)
> +endif()
> +install(TARGETS x265-static
> +        RUNTIME DESTINATION bin
> +        LIBRARY DESTINATION lib
> +        ARCHIVE DESTINATION lib/x265)

The archive should be installed in lib/ as well, no need for an
additional /x265 prefix.

That way it can be found by -lx265 without specifying -L${prefix}/lib/x265


More information about the x265-devel mailing list