Mercurial > projects > qtd
comparison cmake/FindD.cmake @ 412:4189f1d51a7d
support for new dmd naming
author | Max Samukha <maxsamukha@gmail.com> |
---|---|
date | Thu, 05 May 2011 20:11:26 +0300 |
parents | 8564ab82ea42 |
children | bdc08c8391ad |
comparison
equal
deleted
inserted
replaced
411:6fe37cbd9510 | 412:4189f1d51a7d |
---|---|
8 get_filename_component(dc_path ${DC} PATH) | 8 get_filename_component(dc_path ${DC} PATH) |
9 if("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR}) | 9 if("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR}) |
10 get_filename_component(DC ${DC} NAME) | 10 get_filename_component(DC ${DC} NAME) |
11 endif("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR}) | 11 endif("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR}) |
12 exec_program(${DC} ARGS "" OUTPUT_VARIABLE d_output) | 12 exec_program(${DC} ARGS "" OUTPUT_VARIABLE d_output) |
13 string(REGEX MATCH "Digital Mars D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}") | 13 string(REGEX MATCH "(Digital Mars|DMD32) D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}") |
14 if (dmd_version) | 14 if (dmd_version) |
15 set(D_IS_MARS true) | 15 set(D_IS_MARS true) |
16 set(D_IS_DMD true) | 16 set(D_IS_DMD true) |
17 set(D_COMPILER_NAME "Digital Mars D Compiler") | 17 string(REGEX REPLACE "(.+) v([0-9])\\.([0-9])+" "\\1" D_COMPILER_NAME "${dmd_version}") |
18 string(REGEX REPLACE "Digital Mars D Compiler v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}") | 18 string(REGEX REPLACE "${D_COMPILER_NAME} v([0-9])\\.[0-9]+" "\\1" D_VERSION "${dmd_version}") |
19 string(REGEX REPLACE "Digital Mars D Compiler v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}") | 19 string(REGEX REPLACE "${D_COMPILER_NAME} v[0-9]\\.([0-9]+)" "\\1" D_FRONTEND "${dmd_version}") |
20 else (dmd_version) | 20 else (dmd_version) |
21 string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}") | 21 string(REGEX MATCH "LLVM-based D Compiler" is_ldc "${d_output}") |
22 if (is_ldc) | 22 if (is_ldc) |
23 exec_program(${DC} ARGS "--version" OUTPUT_VARIABLE d_output) | 23 exec_program(${DC} ARGS "--version" OUTPUT_VARIABLE d_output) |
24 string(REGEX MATCH "based on DMD v[0-9]\\.[0-9]+" ldc_version "${d_output}") | 24 string(REGEX MATCH "based on DMD v[0-9]\\.[0-9]+" ldc_version "${d_output}") |