[x265] [PATCH 2 of 3 RFC] cmake: ugly hacks for adding arbitrary link library
Steve Borho
steve at borho.org
Sat Jun 6 04:40:58 CEST 2015
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1433556854 18000
# Fri Jun 05 21:14:14 2015 -0500
# Node ID cbbb69f3c124cae348883414cb3ab5aaf0fbd995
# Parent fab8a1a09d1e8b01059f607daec278d4bf8b42fc
cmake: ugly hacks for adding arbitrary link library
(currently necessary for multilib library)
diff -r fab8a1a09d1e -r cbbb69f3c124 source/CMakeLists.txt
--- a/source/CMakeLists.txt Fri Jun 05 13:16:04 2015 -0500
+++ b/source/CMakeLists.txt Fri Jun 05 21:14:14 2015 -0500
@@ -270,6 +270,8 @@
# Build options
set(LIB_INSTALL_DIR lib CACHE STRING "Install location of libraries")
set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables")
+set(EXTRA_LIB "" CACHE STRING "Extra libraries to link against")
+mark_as_advanced(EXTRA_LIB)
if(X64)
# NOTE: We only officially support 16bit-per-pixel compiles of x265
@@ -391,6 +393,11 @@
if(NOT MSVC)
set_target_properties(x265-static PROPERTIES OUTPUT_NAME x265)
endif()
+if(EXTRA_LIB)
+ # ugly link path hack
+ link_directories(${CMAKE_BINARY_DIR}/../10bit)
+ target_link_libraries(x265-static ${EXTRA_LIB})
+endif()
install(TARGETS x265-static
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR})
More information about the x265-devel
mailing list