Oscar Fuentes | fbfe899 | 2010-10-17 16:10:32 +0000 | [diff] [blame] | 1 | # We need to execute this script at installation time because the |
| 2 | # DESTDIR environment variable may be unset at configuration time. |
| 3 | # See PR8397. |
| 4 | |
| 5 | if(UNIX) |
| 6 | set(CLANGXX_LINK_OR_COPY create_symlink) |
| 7 | set(CLANGXX_DESTDIR $ENV{DESTDIR}) |
| 8 | else() |
| 9 | set(CLANGXX_LINK_OR_COPY copy) |
| 10 | endif() |
| 11 | |
Oscar Fuentes | cf603e1 | 2011-02-22 13:05:15 +0000 | [diff] [blame] | 12 | # CMAKE_EXECUTABLE_SUFFIX is undefined on cmake scripts. See PR9286. |
| 13 | if( WIN32 ) |
| 14 | set(EXECUTABLE_SUFFIX ".exe") |
| 15 | else() |
| 16 | set(EXECUTABLE_SUFFIX "") |
| 17 | endif() |
| 18 | |
Oscar Fuentes | fbfe899 | 2010-10-17 16:10:32 +0000 | [diff] [blame] | 19 | set(bindir "${CLANGXX_DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/") |
Oscar Fuentes | cf603e1 | 2011-02-22 13:05:15 +0000 | [diff] [blame] | 20 | set(clang "clang${EXECUTABLE_SUFFIX}") |
| 21 | set(clangxx "clang++${EXECUTABLE_SUFFIX}") |
Oscar Fuentes | fbfe899 | 2010-10-17 16:10:32 +0000 | [diff] [blame] | 22 | |
| 23 | message("Creating clang++ executable based on ${clang}") |
| 24 | |
Oscar Fuentes | 115bcd0 | 2010-10-18 02:25:54 +0000 | [diff] [blame] | 25 | execute_process( |
| 26 | COMMAND "${CMAKE_COMMAND}" -E ${CLANGXX_LINK_OR_COPY} "${clang}" "${clangxx}" |
| 27 | WORKING_DIRECTORY "${bindir}") |