Mercurial > projects > qtd
diff cmake/FindD.cmake @ 215:8aaa84d48451
Improve examples.
author | SokoL_SD |
---|---|
date | Tue, 14 Jul 2009 15:25:45 +0000 |
parents | bc1525b955d8 |
children | 7f150ad4cb5f |
line wrap: on
line diff
--- a/cmake/FindD.cmake Tue Jul 14 14:37:23 2009 +0000 +++ b/cmake/FindD.cmake Tue Jul 14 15:25:45 2009 +0000 @@ -171,19 +171,19 @@ ## Parse parameters list. set(params_tmp SOURCES FLAGS) foreach(arg_tmp ${ARGN}) - set(founded_type_tmp) - if(NOT founded_type_tmp) + set(found_type_tmp) + if(NOT found_type_tmp) foreach(param_tmp ${params_tmp}) if(arg_tmp STREQUAL param_tmp) set(type_tmp ${param_tmp}) - set(founded_type_tmp 1) + set(found_type_tmp 1) break(param_tmp ${params_tmp}) endif(arg_tmp STREQUAL param_tmp) endforeach(param_tmp ${params_tmp}) - endif(NOT founded_type_tmp) - if(NOT founded_type_tmp) + endif(NOT found_type_tmp) + if(NOT found_type_tmp) set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp}) - endif(NOT founded_type_tmp) + endif(NOT found_type_tmp) endforeach(arg_tmp ${ARGN}) if(NOT SINGLE_D_OBJECT) @@ -290,28 +290,30 @@ set(OUTPUT_PATH_tmp ) set(compile_flags_tmp ${D_FLAGS}) set(additional_commands_tmp ) + set(detect_deps_tmp 1) set(link_flags_tmp ) ## Parse parameters list. set(params_tmp TYPE INCLUDES FLAGS SOURCES NO_DEPS_SOURCES OBJECTS LIBS LIB_PATHS DEPENDS OUTPUT_PATH) + foreach(arg_tmp ${ARGN}) - set(founded_type_tmp) - if(${arg_tmp} STREQUAL "DETECT_DEPENDS") - set(auto_detect_depentes_tmp 1) - set(founded_type_tmp 1) - endif(${arg_tmp} STREQUAL "DETECT_DEPENDS") - if(NOT founded_type_tmp) + set(found_type_tmp) + if(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS") + set(detect_deps_tmp 0) + set(found_type_tmp 1) + endif(${arg_tmp} STREQUAL "NOT_DETECT_DEPENDS") + if(NOT found_type_tmp) foreach(param_tmp ${params_tmp}) if(arg_tmp STREQUAL param_tmp) set(type_tmp ${param_tmp}) - set(founded_type_tmp 1) + set(found_type_tmp 1) break(param_tmp ${params_tmp}) endif(arg_tmp STREQUAL param_tmp) endforeach(param_tmp ${params_tmp}) - endif(NOT founded_type_tmp) - if(NOT founded_type_tmp) + endif(NOT found_type_tmp) + if(NOT found_type_tmp) set(${type_tmp}_tmp ${${type_tmp}_tmp} ${arg_tmp}) - endif(NOT founded_type_tmp) + endif(NOT found_type_tmp) endforeach(arg_tmp ${ARGN}) ## Init target type. @@ -405,10 +407,11 @@ set(compile_flags_tmp ${compile_flags_tmp} ${D_${CMAKE_BUILD_TYPE_UPPER}_FLAGS}) endif(CMAKE_BUILD_TYPE) - if(auto_detect_depentes_tmp) + if(detect_deps_tmp) + message(STATUS "Getting dependencies for ${name}") get_files_depends(tmp ${SOURCES_tmp}) set(SOURCES_tmp ${tmp}) - endif(auto_detect_depentes_tmp) + endif(detect_deps_tmp) set(SOURCES_tmp ${SOURCES_tmp} ${NO_DEPS_SOURCES_tmp}) set(used_ar_tmp) @@ -500,6 +503,7 @@ execute_process(COMMAND ${DC} -c -o- -v ${compile_flags_tmp} ${ARGN} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE dc_output_tmp + ) string(REGEX MATCHALL "import[^\\(]*([^\\)]*)" dc_output_tmp "${dc_output_tmp}") set(${imported})