# HG changeset patch # User SokoL_SD # Date 1242578504 0 # Node ID bfc76a437a62c02c58efbf99588b092f143686db # Parent eb3b5bbffc8f935d16ff017b21144eb1bab3f570 CMake: autodetection of CMAKE_INSTALL_PREFIX. By default, command install will copy data to compiler directory. diff -r eb3b5bbffc8f -r bfc76a437a62 CMakeLists.txt --- a/CMakeLists.txt Sun May 17 15:53:27 2009 +0000 +++ b/CMakeLists.txt Sun May 17 16:41:44 2009 +0000 @@ -53,12 +53,23 @@ message(FATAL_ERROR "D compliler not founded") endif (DC) -# find_program(DC_TMP ${DC}) -# mark_as_advanced(DC_TMP) -# string(REGEX MATCH "([A-Za-z\\.0-9/_\\ ]+)(/bin)/[A-Za-z\\.0-9/_\\ ]+" "\\1" dc_path "${DC_PATH}") -# if(NOT "${DC_TMP}" STREQUAL "${dc_path}") -# set(CMAKE_INSTALL_PREFIX ${dc_path}) -# endif(NOT "${DC_TMP}" STREQUAL "${dc_path}") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "") + get_filename_component(dc_path ${DC} PATH) + if("${dc_path}" STREQUAL "") + find_program(dc_path_tmp ${DC}) + get_filename_component(dc_path ${dc_path_tmp} PATH) + mark_as_advanced(dc_path_tmp) + endif("${dc_path}" STREQUAL "") + get_filename_component(dc_parent_dir ${dc_path} NAME) + if("${dc_parent_dir}" STREQUAL "bin") + get_filename_component(dc_path ${dc_path} PATH) + messagE(${dc_path}) + endif("${dc_parent_dir}" STREQUAL "bin") + set(CMAKE_INSTALL_PREFIX + ${dc_path} CACHE PATH "QtD install prefix" FORCE + ) +endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "") + if(D_IS_MARS) option(SINGLE_D_OBJECT "Build all d sources to one object file" "ON")