summaryrefslogtreecommitdiff
path: root/Source/cmTryCompileCommand.h
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2013-02-09 10:34:37 +0100
committerBrad King <brad.king@kitware.com>2013-02-22 08:35:39 -0500
commit236133e79e2d047810eeba90915e38d9861e2a22 (patch)
tree25265f06106cbc0403c53f6705e14baac002687c /Source/cmTryCompileCommand.h
parent1c0597c25bf69a9c73e3d4f6ab68d16b5e56a271 (diff)
downloadcmake-236133e79e2d047810eeba90915e38d9861e2a22.tar.gz
Handle targets in the LINK_LIBRARIES of try_compile.
Imported targets are re-exported so that they can be used by the try_compile generated code with target_link_libraries. This makes the use of the cmake_expand_imported_targets macro obsolete. The macro is not able to expand the generator expressions which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content. Instead it just sees them as 'not a target'.
Diffstat (limited to 'Source/cmTryCompileCommand.h')
-rw-r--r--Source/cmTryCompileCommand.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmTryCompileCommand.h b/Source/cmTryCompileCommand.h
index 68ec666ecc..6caa130ce0 100644
--- a/Source/cmTryCompileCommand.h
+++ b/Source/cmTryCompileCommand.h
@@ -67,6 +67,7 @@ public:
" try_compile(RESULT_VAR <bindir> <srcfile>\n"
" [CMAKE_FLAGS flags...]\n"
" [COMPILE_DEFINITIONS flags...]\n"
+ " [LINK_LIBRARIES libs...]\n"
" [OUTPUT_VARIABLE <var>]\n"
" [COPY_FILE <fileName>])\n"
"Try building a source file into an executable. "
@@ -90,7 +91,12 @@ public:
"Some extra flags that can be included are, "
"INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. "
"COMPILE_DEFINITIONS are -Ddefinition that will be passed to the "
- "compile line. "
+ "compile line.\n"
+ "The srcfile signature also accepts a LINK_LIBRARIES argument which "
+ "may contain a list of libraries or IMPORTED targets which will be "
+ "linked to in the generated project. If LINK_LIBRARIES is specified "
+ "as a parameter to try_compile, then any LINK_LIBRARIES passed as "
+ "CMAKE_FLAGS will be ignored.\n"
"try_compile creates a CMakeList.txt "
"file on the fly that looks like this:\n"
" add_definitions( <expanded COMPILE_DEFINITIONS from calling "