File tree Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Expand file tree Collapse file tree 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change 45
45
endif ()
46
46
47
47
if (POLICY CMP0026 )
48
- # silence cmake 3.0+ warnings about reading LOCATION attribute
49
- cmake_policy (SET CMP0026 OLD )
48
+ cmake_policy (SET CMP0026 NEW )
50
49
endif ()
51
50
52
51
if (POLICY CMP0042 )
@@ -1017,7 +1016,7 @@ if(HAVE_OPENCL)
1017
1016
set (__libs "" )
1018
1017
foreach (l ${OPENCL_LIBRARIES} )
1019
1018
if (TARGET ${l} )
1020
- get_target_property (p ${l} LOCATION )
1019
+ get_target_property (p ${l} IMPORTED_LOCATION )
1021
1020
if (p MATCHES NOTFOUND )
1022
1021
list (APPEND __libs "${l} " )
1023
1022
else ()
Original file line number Diff line number Diff line change @@ -309,9 +309,8 @@ macro(add_android_project target path)
309
309
LIBRARY_OUTPUT_DIRECTORY "${android_proj_bin_dir} /libs/${ANDROID_NDK_ABI_NAME} "
310
310
)
311
311
312
- get_target_property (android_proj_jni_location "${JNI_LIB_NAME} " LOCATION )
313
312
if (NOT (CMAKE_BUILD_TYPE MATCHES "debug" ))
314
- add_custom_command (TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${android_proj_jni_location} " )
313
+ add_custom_command (TARGET ${JNI_LIB_NAME} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "$<TARGET_FILE: ${JNI_LIB_NAME} > " )
315
314
endif ()
316
315
endif ()
317
316
Original file line number Diff line number Diff line change @@ -46,16 +46,16 @@ endif()
46
46
set (OpenCV_LIB_COMPONENTS_ )
47
47
foreach (CVLib ${OpenCV_LIB_COMPONENTS} )
48
48
49
- get_target_property (libloc ${CVLib} LOCATION_${CMAKE_BUILD_TYPE} )
50
- if (libloc MATCHES "3rdparty" )
51
- set (libpath "\$ {exec_prefix}/share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH} " )
52
- else ()
53
- set (libpath "\$ {exec_prefix}/${OPENCV_LIB_INSTALL_PATH} " )
49
+ get_target_property (libname ${CVLib} OUTPUT_NAME_${CMAKE_BUILD_TYPE} )
50
+ if (NOT libname )
51
+ get_target_property (libname ${CVLib} OUTPUT_NAME )
52
+ endif ()
53
+ if (NOT libname )
54
+ set (libname "${CVLib} " )
54
55
endif ()
55
- list (APPEND OpenCV_LIB_COMPONENTS_ "-L${libpath} " )
56
56
57
- get_filename_component ( libname ${CVLib} NAME_WE )
58
- string ( REGEX REPLACE "^lib" "" libname " ${libname } " )
57
+ set ( libpath " \$ {exec_prefix}/ ${OPENCV_LIB_INSTALL_PATH} " )
58
+ list ( APPEND OpenCV_LIB_COMPONENTS_ "-L ${libpath } " )
59
59
list (APPEND OpenCV_LIB_COMPONENTS_ "-l${libname} " )
60
60
61
61
endforeach ()
@@ -66,7 +66,7 @@ if(OpenCV_EXTRA_COMPONENTS)
66
66
if (TARGET "${extra_component} " )
67
67
get_target_property (extra_component_is_imported "${extra_component} " IMPORTED )
68
68
if (extra_component_is_imported )
69
- get_target_property (extra_component "${extra_component} " LOCATION )
69
+ get_target_property (extra_component "${extra_component} " IMPORTED_LOCATION )
70
70
endif ()
71
71
endif ()
72
72
Original file line number Diff line number Diff line change @@ -331,10 +331,9 @@ if(ANDROID)
331
331
332
332
# force strip library after the build command
333
333
# because samples and tests will make a copy of the library before install
334
- get_target_property (__opencv_java_location ${the_module} LOCATION )
335
334
# Turn off stripping in debug build
336
335
if ( NOT (CMAKE_BUILD_TYPE MATCHES "Debug" ))
337
- add_custom_command (TARGET ${the_module} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "${__opencv_java_location} " )
336
+ add_custom_command (TARGET ${the_module} POST_BUILD COMMAND ${CMAKE_STRIP} --strip-unneeded "$<TARGET_FILE: ${the_module} > " )
338
337
endif ()
339
338
endif ()
340
339
You can’t perform that action at this time.
0 commit comments