Mercurial > projects > qtd
comparison cmake/FindD.cmake @ 245:2d061b52e077
--
author | SokoL_SD |
---|---|
date | Tue, 21 Jul 2009 13:51:44 +0000 |
parents | 62d0dce52dac |
children | 17b5e13364b7 2161595da42b |
comparison
equal
deleted
inserted
replaced
244:405f49532492 | 245:2d061b52e077 |
---|---|
495 else(D_IS_MARS) | 495 else(D_IS_MARS) |
496 add_d_target(${name} TYPE SHARED ${ARGN}) | 496 add_d_target(${name} TYPE SHARED ${ARGN}) |
497 endif(D_IS_MARS) | 497 endif(D_IS_MARS) |
498 endmacro(add_d_lib name) | 498 endmacro(add_d_lib name) |
499 | 499 |
500 ## | 500 ## |
501 macro(get_imported_files_old imported) | 501 macro(get_imported_files_old imported) |
502 execute_process(COMMAND ${DC} -c -o- -v ${compile_flags_tmp} ${ARGN} | 502 execute_process(COMMAND ${DC} -c -o- -v ${compile_flags_tmp} ${ARGN} |
503 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | 503 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
504 OUTPUT_VARIABLE dc_output_tmp | 504 OUTPUT_VARIABLE dc_output_tmp |
505 | 505 |
506 ) | 506 ) |
507 string(REGEX MATCHALL "import[^\\(]*([^\\)]*)" dc_output_tmp "${dc_output_tmp}") | 507 string(REGEX MATCHALL "import[^(]*([^)]*)" dc_output_tmp "${dc_output_tmp}") |
508 | 508 |
509 ## Initial filter. | 509 ## Initial filter. |
510 regex_safe_string(tmp ${CMAKE_CURRENT_SOURCE_DIR}) | 510 regex_safe_string(tmp ${CMAKE_CURRENT_SOURCE_DIR}) |
511 regex_safe_string(tmp2 ${CMAKE_CURRENT_BINARY_DIR}) | 511 regex_safe_string(tmp2 ${CMAKE_CURRENT_BINARY_DIR}) |
512 set(regex_includes_tmp ${tmp}|${tmp2}) | 512 set(regex_includes_tmp "${tmp}|${tmp2}") |
513 | 513 |
514 set(${imported}) | 514 set(${imported}) |
515 foreach(import_tmp ${dc_output_tmp}) | 515 foreach(import_tmp ${dc_output_tmp}) |
516 ## Getting a next import. | 516 ## Getting a next import. |
517 string(REGEX REPLACE "import[^\\(]*\\(([^\\)]*)" "\\1" import_tmp ${import_tmp}) | 517 string(REGEX REPLACE "import[^(]*\\(([^)]*)" "\\1" import_tmp ${import_tmp}) |
518 ## Filtering. | 518 ## Filtering. |
519 file(TO_CMAKE_PATH import_tmp ${import_tmp}) | 519 string(REPLACE "\\" "/" import_tmp ${import_tmp}) |
520 string(REGEX MATCH "(${regex_includes_tmp})[^/]*" found "${import_tmp}") | 520 string(REGEX MATCH "(${regex_includes_tmp})" found "${import_tmp}") |
521 string(SUBSTRING "${import_tmp}" 0 1 first_sym_tmp) | 521 if(CMAKE_HOST_WIN32) |
522 set(full_path_tmp) | 522 string(SUBSTRING "${import_tmp}" 1 2 first_sym_tmp) |
523 if(${first_sym_tmp} STREQUAL "/") | 523 set(full_path_tmp) |
524 set(full_path_tmp 1) | 524 if(${first_sym_tmp} STREQUAL ":/") |
525 endif(${first_sym_tmp} STREQUAL "/") | 525 set(full_path_tmp 1) |
526 if(NOT found AND full_path_tmp) | 526 endif(${first_sym_tmp} STREQUAL ":/") |
527 else(NOT found AND full_path_tmp) | 527 elseif(CMAKE_HOST_UNIX) |
528 string(SUBSTRING "${import_tmp}" 0 1 first_sym_tmp) | |
529 set(full_path_tmp) | |
530 if(${first_sym_tmp} STREQUAL "/") | |
531 set(full_path_tmp 1) | |
532 endif(${first_sym_tmp} STREQUAL "/") | |
533 endif(CMAKE_HOST_WIN32) | |
534 if(found OR NOT full_path_tmp) | |
528 set(${imported} ${${imported}} ${import_tmp}) | 535 set(${imported} ${${imported}} ${import_tmp}) |
529 endif(NOT found AND full_path_tmp) | 536 endif(found OR NOT full_path_tmp) |
530 endforeach(import_tmp ${dc_output_tmp}) | 537 endforeach(import_tmp ${dc_output_tmp}) |
531 endmacro(get_imported_files_old imported) | 538 endmacro(get_imported_files_old imported) |
532 | 539 |
533 macro(filter_paths result) | 540 macro(filter_paths result) |
534 set(${result}) | 541 set(${result}) |