1 # Prepare imported targets that the exported project itself imported.
2 add_library(SubDirLinkAImported IMPORTED INTERFACE)
3 target_compile_definitions(SubDirLinkAImported INTERFACE DEF_SubDirLinkAImportedForImport)
4 add_library(SubDirLinkBImported IMPORTED INTERFACE)
5 target_compile_definitions(SubDirLinkBImported INTERFACE DEF_SubDirLinkBImportedForImport)
7 # Import targets from the exported build tree.
8 include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake)
10 # Import targets from the exported install tree.
11 include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake)
13 # Import two exports, where the Depends one depends on an exported target from the Required one:
14 include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibRequired/testLibRequiredTargets.cmake)
15 include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibDepends/testLibDependsTargets.cmake)
17 # Try referencing an executable imported from the install tree.
19 OUTPUT ${Import_BINARY_DIR}/exp_generated.c
20 COMMAND exp_testExe1 ${Import_BINARY_DIR}/exp_generated.c
24 OUTPUT ${Import_BINARY_DIR}/exp_generated3.c
25 COMMAND exp_testExe3 ${Import_BINARY_DIR}/exp_generated3.c
29 OUTPUT ${Import_BINARY_DIR}/exp_generated4.c
30 COMMAND exp_testExe4 ${Import_BINARY_DIR}/exp_generated4.c
34 add_executable(imp_testExe1
36 ${Import_BINARY_DIR}/exp_generated.c
37 ${Import_BINARY_DIR}/exp_generated3.c
38 ${Import_BINARY_DIR}/exp_generated4.c
41 function(checkForProperty _TARGET _PROP _EXPECTED)
42 get_target_property(EXPORTED_PROPERTY ${_TARGET} "${_PROP}")
43 if (NOT EXPORTED_PROPERTY STREQUAL "${_EXPECTED}")
44 message(SEND_ERROR "${_TARGET} was expected to export \"${_PROP}\" with value \"${_EXPECTED}\" but got \"${EXPORTED_PROPERTY}\"")
48 checkForProperty(bld_testLib3 "EXPORTED_PROPERTY1" "EXPORTING_TESTLIB3")
49 checkForProperty(exp_testLib3 "EXPORTED_PROPERTY1" "EXPORTING_TESTLIB3")
50 checkForProperty(bld_testLib4 "EXPORTED_PROPERTY2" "EXPORTING_TESTLIB4_1")
51 checkForProperty(exp_testLib4 "EXPORTED_PROPERTY2" "EXPORTING_TESTLIB4_1")
52 checkForProperty(bld_testLib4 "EXPORTED_PROPERTY3" "EXPORTING_TESTLIB4_2")
53 checkForProperty(exp_testLib4 "EXPORTED_PROPERTY3" "EXPORTING_TESTLIB4_2")
54 checkForProperty(bld_testLibDeprecation "DEPRECATION" "Deprecated version. Please use latest version")
55 checkForProperty(exp_testLibDeprecation "DEPRECATION" "Deprecated version. Please use latest version")
57 # Try linking to a deprecated library
58 target_link_libraries(imp_testExe1 exp_testLibDeprecation)
61 # Try linking to a library imported from the install tree.
62 target_link_libraries(imp_testExe1
70 exp_testLibPerConfigDest
71 exp_testStaticLibWithPlugin
74 add_library(imp_testInterfaceInclude1 STATIC imp_testInterfaceInclude1.c)
75 target_include_directories(imp_testInterfaceInclude1 SYSTEM PRIVATE testInterfaceIncludeSystem)
76 target_link_libraries(imp_testInterfaceInclude1 PRIVATE exp_testInterfaceIncludeUser)
78 add_executable(imp_UseSharedLibWithHelper1 ../../../InterfaceLinkLibrariesDirect/UseSharedLibWithHelper.c)
79 target_link_libraries(imp_UseSharedLibWithHelper1 PRIVATE exp_testSharedLibWithHelper testSharedLibHelperExclude)
81 # Try building a plugin to an executable imported from the install tree.
82 add_library(imp_mod1 MODULE imp_mod1.c)
83 target_link_libraries(imp_mod1 exp_testExe2)
85 add_library(imp_ExePlugin1 MODULE ../../../InterfaceLinkLibrariesDirect/ExePlugin.c)
86 target_link_libraries(imp_ExePlugin1 PRIVATE exp_testExeWithPluginHelper testExePluginHelperExclude)
88 # Try referencing an executable imported from the build tree.
90 OUTPUT ${Import_BINARY_DIR}/bld_generated.c
91 COMMAND bld_testExe1 ${Import_BINARY_DIR}/bld_generated.c
95 OUTPUT ${Import_BINARY_DIR}/bld_generated3.c
96 COMMAND bld_testExe3 ${Import_BINARY_DIR}/bld_generated3.c
100 OUTPUT ${Import_BINARY_DIR}/bld_generated4.c
101 COMMAND bld_testExe4 ${Import_BINARY_DIR}/bld_generated4.c
105 add_executable(imp_testExe1b
107 ${Import_BINARY_DIR}/bld_generated.c
108 ${Import_BINARY_DIR}/bld_generated3.c
109 ${Import_BINARY_DIR}/bld_generated4.c
112 # Try linking to a library imported from the build tree.
113 target_link_libraries(imp_testExe1b
121 bld_testLibPerConfigDest
122 bld_testStaticLibWithPlugin
125 add_library(imp_testInterfaceInclude1b STATIC imp_testInterfaceInclude1.c)
126 target_include_directories(imp_testInterfaceInclude1b SYSTEM PRIVATE testInterfaceIncludeSystem)
127 target_link_libraries(imp_testInterfaceInclude1b PRIVATE bld_testInterfaceIncludeUser)
129 add_custom_target(check_testLib1_genex ALL
130 COMMAND ${CMAKE_COMMAND} -DtestLib1=$<TARGET_FILE:exp_testLib1>
131 -Dprefix=${CMAKE_INSTALL_PREFIX}
132 -P ${CMAKE_CURRENT_SOURCE_DIR}/check_testLib1_genex.cmake
135 if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND
136 "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG")
138 get_property(configs TARGET ${ns}_testLib5 PROPERTY IMPORTED_CONFIGURATIONS)
139 foreach(c ${configs})
140 string(TOUPPER "${c}" CONFIG)
141 get_property(soname TARGET ${ns}_testLib5 PROPERTY IMPORTED_NO_SONAME_${CONFIG})
143 message(SEND_ERROR "${ns}_testLib5 has IMPORTED_NO_SONAME_${CONFIG} but should:\n ${soname}")
145 message(STATUS "${ns}_testLib5 does not have IMPORTED_NO_SONAME_${CONFIG} as expected")
149 get_property(configs TARGET ${ns}_testLibNoSONAME PROPERTY IMPORTED_CONFIGURATIONS)
150 foreach(c ${configs})
151 string(TOUPPER "${c}" CONFIG)
152 get_property(soname TARGET ${ns}_testLibNoSONAME PROPERTY IMPORTED_NO_SONAME_${CONFIG})
154 message(STATUS "${ns}_testLibNoSONAME has IMPORTED_NO_SONAME_${CONFIG} as expected")
156 message(SEND_ERROR "${ns}_testLibNoSONAME does not have IMPORTED_NO_SONAME_${CONFIG} but should")
160 # Parse the binary to check for SONAME if possible.
161 if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF")
162 find_program(READELF_EXE readelf)
164 add_custom_target(check_${ns}_testLib5_soname ALL COMMAND
165 ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE}
166 -Dlib=$<TARGET_FILE:${ns}_testLib5>
167 -P ${CMAKE_CURRENT_SOURCE_DIR}/check_lib_soname.cmake
169 add_custom_target(check_${ns}_testLibNoSONAME_soname ALL COMMAND
170 ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE}
171 -Dlib=$<TARGET_FILE:${ns}_testLibNoSONAME>
172 -P ${CMAKE_CURRENT_SOURCE_DIR}/check_lib_nosoname.cmake
179 add_executable(cmp0022OLD_test cmp0022OLD_test_vs6_1.cpp)
180 target_link_libraries(cmp0022OLD_test bld_cmp0022OLD)
181 add_executable(cmp0022NEW_test cmp0022NEW_test_vs6_1.cpp)
182 target_link_libraries(cmp0022NEW_test bld_cmp0022NEW)
184 add_executable(cmp0022OLD_exp_test cmp0022OLD_test_vs6_2.cpp)
185 target_link_libraries(cmp0022OLD_exp_test exp_cmp0022OLD)
186 add_executable(cmp0022NEW_exp_test cmp0022NEW_test_vs6_2.cpp)
187 target_link_libraries(cmp0022NEW_exp_test exp_cmp0022NEW)
189 add_executable(SubDirLink_bld SubDirLink.c)
190 target_link_libraries(SubDirLink_bld PRIVATE bld_TopDirLib bld_SubDirLinkA)
191 add_executable(SubDirLink_exp SubDirLink.c)
192 target_link_libraries(SubDirLink_exp PRIVATE exp_TopDirLib exp_SubDirLinkA)
194 add_executable(imp_UseSharedLibWithHelper1b ../../../InterfaceLinkLibrariesDirect/UseSharedLibWithHelper.c)
195 target_link_libraries(imp_UseSharedLibWithHelper1b PRIVATE bld_testSharedLibWithHelper testSharedLibHelperExclude)
197 # Try building a plugin to an executable imported from the build tree.
198 add_library(imp_mod1b MODULE imp_mod1.c)
199 target_link_libraries(imp_mod1b bld_testExe2)
201 add_library(imp_ExePlugin1b MODULE ../../../InterfaceLinkLibrariesDirect/ExePlugin.c)
202 target_link_libraries(imp_ExePlugin1b PRIVATE bld_testExeWithPluginHelper testExePluginHelperExclude)
204 # Export/CMakeLists.txt pretends the RelWithDebInfo (as well as Debug)
205 # configuration should link to debug libs.
206 foreach(c DEBUG RELWITHDEBINFO)
207 set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
208 set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
211 #-----------------------------------------------------------------------------
212 include(${CMAKE_INSTALL_PREFIX}/lib/expAbs/expAbs.cmake)
214 add_executable(imp_testExeAbs1
217 target_link_libraries(imp_testExeAbs1
221 #-----------------------------------------------------------------------------
222 # Create a custom target to generate a header for the libraries below.
223 # Drive the header generation through an indirect chain of imported
224 # target dependencies.
228 OUTPUT testLib2tmp1.h
230 ${CMAKE_COMMAND} -E echo "extern int testLib2(void);" > testLib2tmp1.h
233 # hdr_testLib2tmp1 needs testLib2tmp1.h
234 add_custom_target(hdr_testLib2tmp1 DEPENDS testLib2tmp1.h)
236 # exp_testExe2 needs hdr_testLib2tmp1
237 add_dependencies(exp_testExe2 hdr_testLib2tmp1)
239 # testLib2tmp.h needs exp_testExe2
242 VERBATIM COMMAND exp_testExe2
243 COMMAND ${CMAKE_COMMAND} -E copy testLib2tmp1.h testLib2tmp.h
246 # hdr_testLib2tmp needs testLib2tmp.h
247 add_custom_target(hdr_testLib2tmp DEPENDS testLib2tmp.h)
249 add_library(dep_testLib2tmp UNKNOWN IMPORTED)
250 set_property(TARGET dep_testLib2tmp PROPERTY
251 IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/testLib2tmp.h)
253 # dep_testLib2tmp needs hdr_testLib2tmp
254 add_dependencies(dep_testLib2tmp hdr_testLib2tmp)
256 # testLib2.h needs dep_testLib2tmp
259 VERBATIM COMMAND ${CMAKE_COMMAND} -E copy testLib2tmp.h testLib2.h
260 DEPENDS dep_testLib2tmp
263 # hdr_testLib2 needs testLib2.h
264 add_custom_target(hdr_testLib2 DEPENDS testLib2.h)
266 add_library(dep_testLib2 UNKNOWN IMPORTED)
268 # dep_testLib2 needs hdr_testLib2
269 add_dependencies(dep_testLib2 hdr_testLib2)
271 # exp_testLib2 and bld_testLib2 both need dep_testLib2
272 add_dependencies(bld_testLib2 dep_testLib2)
273 add_dependencies(exp_testLib2 dep_testLib2)
275 #-----------------------------------------------------------------------------
276 # Create a library to be linked by another directory in this project
277 # to test transitive linking to otherwise invisible imported targets.
278 include_directories(${CMAKE_CURRENT_BINARY_DIR})
279 add_library(imp_lib1 STATIC imp_lib1.c)
280 target_link_libraries(imp_lib1 exp_testLib2)
281 add_library(imp_lib1b STATIC imp_lib1.c)
282 target_link_libraries(imp_lib1b bld_testLib2)
284 if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
285 set(bld_objlib_type OBJECT_LIBRARY)
287 # Create executables using objects imported from the install tree
288 add_executable(imp_testLib8_src imp_testLib8.c $<TARGET_OBJECTS:exp_testLib8>)
289 add_executable(imp_testLib8_link imp_testLib8.c)
290 target_link_libraries(imp_testLib8_link exp_testLib8)
292 if(NOT CMAKE_GENERATOR STREQUAL "Xcode" OR NOT XCODE_VERSION VERSION_LESS 5)
293 # Create executables using objects imported from the build tree
294 add_executable(imp_testLib8b_src imp_testLib8.c $<TARGET_OBJECTS:bld_testLib8>)
295 add_executable(imp_testLib8b_link imp_testLib8.c)
296 target_link_libraries(imp_testLib8b_link bld_testLib8)
299 set(bld_objlib_type INTERFACE_LIBRARY)
302 # Create an executable that uses a library imported from the install tree
303 # that itself was built using an object library. Verify we get the usage
305 add_executable(imp_testLib9 imp_testLib9.c)
306 target_link_libraries(imp_testLib9 exp_testLib9)
307 # Similarly for importing from the build tree.
308 add_executable(imp_testLib9b imp_testLib9.c)
309 target_link_libraries(imp_testLib9b bld_testLib9)
311 # Check that object libraries were transformed on export as expected.
312 foreach(vis Pub Priv Iface)
313 get_property(type TARGET exp_testLib9Obj${vis} PROPERTY TYPE)
314 if(NOT type STREQUAL INTERFACE_LIBRARY)
315 message(FATAL_ERROR "exp_testLib9Obj${vis} type is '${type}', not 'INTERFACE_LIBRARY'")
317 get_property(type TARGET bld_testLib9Obj${vis} PROPERTY TYPE)
318 if(NOT type STREQUAL "${bld_objlib_type}")
319 message(FATAL_ERROR "bld_testLib9Obj${vis} type is '${type}', not '${bld_objlib_type}'")
323 #-----------------------------------------------------------------------------
324 # Test that handling imported targets, including transitive dependencies,
325 # works in CheckFunctionExists (...and hopefully all other try_compile() checks
326 include(CheckFunctionExists)
327 unset(HAVE_TESTLIB1_FUNCTION CACHE)
328 set(CMAKE_REQUIRED_LIBRARIES exp_testLib2)
329 check_function_exists(testLib1 HAVE_TESTLIB1_FUNCTION)
330 if (NOT HAVE_TESTLIB1_FUNCTION)
331 message(SEND_ERROR "Using imported target testLib2 in check_function_exists() failed !")
334 #-----------------------------------------------------------------------------
335 # Test that dependent imported targets have usable
336 # INTERFACE_COMPILE_DEFINITIONS and INTERFACE_INCLUDE_DIRECTORIES
338 add_executable(deps_iface deps_iface.c)
339 target_link_libraries(deps_iface testLibDepends)
341 add_executable(deps_shared_iface deps_shared_iface.cpp)
342 target_link_libraries(deps_shared_iface testSharedLibDepends)
343 target_compile_definitions(deps_shared_iface
345 $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON>
346 $<$<BOOL:$<TARGET_PROPERTY:CUSTOM_PROP>>:CUSTOM_PROPERTY_IS_ON>
347 $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH>
350 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC")
351 target_compile_definitions(deps_shared_iface
357 if (APPLE OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC")
358 include(CheckCXXCompilerFlag)
359 check_cxx_compiler_flag(-fPIE run_pic_test)
361 if (CMAKE_CXX_COMPILER_ID MATCHES "PGI"
362 OR CMAKE_CXX_COMPILER_ID MATCHES "PathScale"
363 OR CMAKE_CXX_COMPILER_ID MATCHES "Intel")
370 add_executable(exp_renamed_test renamed_test.cpp)
371 target_link_libraries(exp_renamed_test exp_renamed)
373 add_executable(bld_renamed_test renamed_test.cpp)
374 target_link_libraries(bld_renamed_test bld_renamed)
377 target_compile_definitions(deps_shared_iface PRIVATE CHECK_PIC_WORKS)
381 add_subdirectory(framework_interface)
384 #-----------------------------------------------------------------------------
385 # Test that targets imported from the build tree have their dependencies
386 # evaluated correctly. The above already tests the same for the install tree.
388 add_executable(deps_shared_iface2 deps_shared_iface.cpp)
389 target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib)
390 if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "LCC")
391 target_compile_definitions(deps_shared_iface2
396 target_compile_definitions(deps_shared_iface2
397 PRIVATE TEST_SUBDIR_LIB
398 $<$<BOOL:$<TARGET_PROPERTY:POSITION_INDEPENDENT_CODE>>:PIC_PROPERTY_IS_ON>
399 $<$<BOOL:$<TARGET_PROPERTY:CUSTOM_PROP>>:CUSTOM_PROPERTY_IS_ON>
400 $<$<STREQUAL:$<TARGET_PROPERTY:CUSTOM_STRING>,testcontent>:CUSTOM_STRING_IS_MATCH>
403 add_subdirectory(excludedFromAll)
405 add_executable(iface_test_bld iface_test.cpp)
406 target_link_libraries(iface_test_bld bld_testSharedLibDepends)
407 set_property(TARGET iface_test_bld PROPERTY NO_SYSTEM_FROM_IMPORTED 1)
409 set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY
410 LINK_INTERFACE_LIBRARIES
413 get_target_property(_configs bld_testSharedLibRequired IMPORTED_CONFIGURATIONS)
414 foreach(_config ${_configs})
415 set_property(TARGET bld_testSharedLibRequired APPEND PROPERTY
416 IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
421 add_executable(iface_test_exp iface_test.cpp)
422 target_link_libraries(iface_test_exp testSharedLibDepends)
424 set_property(TARGET testSharedLibDepends APPEND PROPERTY
425 LINK_INTERFACE_LIBRARIES
428 get_target_property(_configs testSharedLibDepends IMPORTED_CONFIGURATIONS)
429 foreach(_config ${_configs})
430 set_property(TARGET testSharedLibDepends APPEND PROPERTY
431 IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
437 if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4)
438 OR CMAKE_C_COMPILER_ID MATCHES "LCC"
439 OR (CMAKE_C_COMPILER_ID STREQUAL Clang AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC"))
440 AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja"))
441 include(CheckCXXCompilerFlag)
442 check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test)
443 if(run_sys_includes_test)
444 # The Bullseye wrapper appears to break the -isystem effect.
445 execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE out ERROR_VARIABLE out)
446 if("x${out}" MATCHES "Bullseye")
447 set(run_sys_includes_test 0)
450 if (run_sys_includes_test)
451 add_executable(test_system_exp test_system.cpp)
452 target_link_libraries(test_system_exp exp_systemlib)
453 target_compile_options(test_system_exp PRIVATE -Wunused-variable -Werror=unused-variable)
455 unset(EXP_ERROR_VARIABLE CACHE)
456 try_compile(EXP_ERROR_VARIABLE
457 "${CMAKE_CURRENT_SOURCE_DIR}/test_system"
458 "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
459 COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable"
460 LINK_LIBRARIES exp_systemlib
461 OUTPUT_VARIABLE OUTPUT
463 if(NOT EXP_ERROR_VARIABLE)
464 message(SEND_ERROR "EXP_ERROR_VARIABLE try_compile failed, but it was expected to succeed ${OUTPUT}.")
467 if(NOT CMAKE_CROSSCOMPILING)
468 unset(EXP_RUN_VAR CACHE)
469 unset(EXP_COMPILE_VAR CACHE)
470 try_run(EXP_RUN_VAR EXP_COMPILE_VAR
471 "${CMAKE_CURRENT_SOURCE_DIR}/test_system"
472 "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
473 COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable"
474 LINK_LIBRARIES exp_systemlib
475 OUTPUT_VARIABLE OUTPUT
477 if(NOT EXP_COMPILE_VAR)
478 message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.")
482 add_executable(test_system_bld test_system.cpp)
483 target_link_libraries(test_system_bld bld_systemlib)
484 target_compile_options(test_system_bld PRIVATE -Wunused-variable -Werror=unused-variable)
486 unset(BLD_ERROR_VARIABLE CACHE)
487 try_compile(BLD_ERROR_VARIABLE
488 "${CMAKE_CURRENT_SOURCE_DIR}/test_system"
489 "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
490 COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable"
491 LINK_LIBRARIES bld_systemlib
492 OUTPUT_VARIABLE OUTPUT
494 if(NOT BLD_ERROR_VARIABLE)
495 message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed.")
498 if(NOT CMAKE_CROSSCOMPILING)
499 unset(BLD_RUN_VAR CACHE)
500 unset(BLD_COMPILE_VAR CACHE)
501 try_run(BLD_RUN_VAR BLD_COMPILE_VAR
502 "${CMAKE_CURRENT_SOURCE_DIR}/test_system"
503 "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
504 COMPILE_DEFINITIONS "-Wunused-variable -Werror=unused-variable"
505 LINK_LIBRARIES bld_systemlib
506 OUTPUT_VARIABLE OUTPUT
508 if(NOT BLD_COMPILE_VAR)
509 message(SEND_ERROR "try_run compile failed, but it was expected to succeed ${OUTPUT}.")
515 #---------------------------------------------------------------------------------
516 # check that imported libraries have the expected INTERFACE_LINK_OPTIONS property
517 checkForProperty(bld_testLinkOptions "INTERFACE_LINK_OPTIONS" "INTERFACE_FLAG")
518 checkForProperty(Req::testLinkOptions "INTERFACE_LINK_OPTIONS" "INTERFACE_FLAG")
520 #---------------------------------------------------------------------------------
521 # check that imported libraries have the expected INTERFACE_LINK_DIRECTORIES property
522 checkForProperty(bld_testLinkDirectories "INTERFACE_LINK_DIRECTORIES" "/interface/build")
523 checkForProperty(Req::testLinkDirectories "INTERFACE_LINK_DIRECTORIES" "${CMAKE_INSTALL_PREFIX}/interface/install")
525 #---------------------------------------------------------------------------------
526 # check that imported libraries have the expected INTERFACE_LINK_DEPENDS property
527 if(CMAKE_GENERATOR MATCHES "Make|Ninja")
528 checkForProperty(bld_testLinkDepends "INTERFACE_LINK_DEPENDS" "BUILD_LINK_DEPENDS")
529 checkForProperty(Req::testLinkDepends "INTERFACE_LINK_DEPENDS" "${CMAKE_INSTALL_PREFIX}/INSTALL_LINK_DEPENDS")
532 #------------------------------------------------------------------------------
533 # test import of CUDA language level
535 checkForProperty(bld_cudaInterfaceLib "INTERFACE_COMPILE_FEATURES" "cuda_std_11")
536 checkForProperty(Req::cudaInterfaceLib "INTERFACE_COMPILE_FEATURES" "cuda_std_14")