changeset 49:e00776053828

CMake: command "cmake -DDC=compiler_name" work correctly now.
author SokoL_SD
date Mon, 18 May 2009 06:50:10 +0000
parents 2085c2157b50
children cc557203146c
files CMakeLists.txt
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Mon May 18 00:22:14 2009 +0000
+++ b/CMakeLists.txt	Mon May 18 06:50:10 2009 +0000
@@ -19,8 +19,13 @@
 find_program(STRIP strip)
 
 ## Find D compiler and parsing its version.
+
 find_program(DC dmd ldc)
 if (DC)   
+    get_filename_component(dc_path ${DC} PATH)
+    if("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR})
+	get_filename_component(DC ${DC} NAME)
+    endif("${dc_path}" STREQUAL ${CMAKE_BINARY_DIR})
     exec_program(${DC} ARGS "" OUTPUT_VARIABLE d_output)   
     string(REGEX MATCH "Digital Mars D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}")
     if (dmd_version)