diff options
author | Brad King <brad.king@kitware.com> | 2003-11-26 21:38:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2003-11-26 21:38:26 (GMT) |
commit | f764e1fcb2b23e4fac5579dbfefa18404dcc95b5 (patch) | |
tree | 6e524e1014d723a04184979e692d52346c29f33b /Source/cmake.cxx | |
parent | 587370e1e28e014d1d1a4a31d8332c2c3181315f (diff) | |
download | CMake-f764e1fcb2b23e4fac5579dbfefa18404dcc95b5.zip CMake-f764e1fcb2b23e4fac5579dbfefa18404dcc95b5.tar.gz CMake-f764e1fcb2b23e4fac5579dbfefa18404dcc95b5.tar.bz2 |
ENH: Added undocumented cmake_symlink_library to help with building versioned shared libraries.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index cf713a9..5a478d0 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -715,7 +715,33 @@ int cmake::CMakeCommand(std::vector<std::string>& args) } return 1; - } + } + + // Internal CMake shared library support. + else if (args[1] == "cmake_symlink_library" && args.size() == 5) + { + int result = 0; + std::string realName = args[2]; + std::string soName = args[3]; + std::string name = args[4]; + if(soName != realName) + { + std::string fname = cmSystemTools::GetFilenameName(realName); + if(!cmSystemTools::CreateSymlink(fname.c_str(), soName.c_str())) + { + result = 1; + } + } + if(name != soName) + { + std::string fname = cmSystemTools::GetFilenameName(soName); + if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str())) + { + result = 1; + } + } + return 0; + } #if defined(_WIN32) && !defined(__CYGWIN__) // Write registry value |