diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2015-08-25 02:56:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-09-21 14:12:13 (GMT) |
commit | b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f (patch) | |
tree | a43367338ec838ac31e7c2f8a693976618d33458 /Source/cmCoreTryCompile.cxx | |
parent | 9784af1b50a142c0160058734c7e12cee5f2a15e (diff) | |
download | CMake-b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f.zip CMake-b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f.tar.gz CMake-b15f4e9b86bc3dc31b6a01c0ffc30747f467ec1f.tar.bz2 |
try_compile: Propogate CMP0065 to the generated project.
Set policy CMP0065 to the value used in the calling project.
Set the the value of CMAKE_ENABLE_EXPORTS if set in the calling
project to initialize the target property appropriately.
Diffstat (limited to 'Source/cmCoreTryCompile.cxx')
-rw-r--r-- | Source/cmCoreTryCompile.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmCoreTryCompile.cxx b/Source/cmCoreTryCompile.cxx index 9411555..e489ad2 100644 --- a/Source/cmCoreTryCompile.cxx +++ b/Source/cmCoreTryCompile.cxx @@ -481,6 +481,16 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv) fprintf(fout, "set(CMAKE_LINK_SEARCH_END_STATIC \"%s\")\n", lssDef); } + /* Set the appropriate policy information for ENABLE_EXPORTS */ + fprintf(fout, "cmake_policy(SET CMP0065 %s)\n", + this->Makefile->GetPolicyStatus(cmPolicies::CMP0065) == + cmPolicies::NEW ? "NEW" : "OLD"); + if(const char *ee = this->Makefile->GetDefinition( + "CMAKE_ENABLE_EXPORTS")) + { + fprintf(fout, "set(CMAKE_ENABLE_EXPORTS %s)\n", ee); + } + /* Put the executable at a known location (for COPY_FILE). */ fprintf(fout, "set(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", this->BinaryDirectory.c_str()); |