comparison CMakeLists.txt @ 43:bfc76a437a62

CMake: autodetection of CMAKE_INSTALL_PREFIX. By default, command install will copy data to compiler directory.
author SokoL_SD
date Sun, 17 May 2009 16:41:44 +0000
parents eb3b5bbffc8f
children 3cb15c92ac28
comparison
equal deleted inserted replaced
42:eb3b5bbffc8f 43:bfc76a437a62
51 message(STATUS "D compiler founded -- ${D_COMPILER_NAME} v${D_VERSION}.${D_FRONTEND}") 51 message(STATUS "D compiler founded -- ${D_COMPILER_NAME} v${D_VERSION}.${D_FRONTEND}")
52 else (DC) 52 else (DC)
53 message(FATAL_ERROR "D compliler not founded") 53 message(FATAL_ERROR "D compliler not founded")
54 endif (DC) 54 endif (DC)
55 55
56 # find_program(DC_TMP ${DC}) 56 if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "")
57 # mark_as_advanced(DC_TMP) 57 get_filename_component(dc_path ${DC} PATH)
58 # string(REGEX MATCH "([A-Za-z\\.0-9/_\\ ]+)(/bin)/[A-Za-z\\.0-9/_\\ ]+" "\\1" dc_path "${DC_PATH}") 58 if("${dc_path}" STREQUAL "")
59 # if(NOT "${DC_TMP}" STREQUAL "${dc_path}") 59 find_program(dc_path_tmp ${DC})
60 # set(CMAKE_INSTALL_PREFIX ${dc_path}) 60 get_filename_component(dc_path ${dc_path_tmp} PATH)
61 # endif(NOT "${DC_TMP}" STREQUAL "${dc_path}") 61 mark_as_advanced(dc_path_tmp)
62 endif("${dc_path}" STREQUAL "")
63 get_filename_component(dc_parent_dir ${dc_path} NAME)
64 if("${dc_parent_dir}" STREQUAL "bin")
65 get_filename_component(dc_path ${dc_path} PATH)
66 messagE(${dc_path})
67 endif("${dc_parent_dir}" STREQUAL "bin")
68 set(CMAKE_INSTALL_PREFIX
69 ${dc_path} CACHE PATH "QtD install prefix" FORCE
70 )
71 endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR "${CMAKE_INSTALL_PREFIX}" STREQUAL "")
72
62 73
63 if(D_IS_MARS) 74 if(D_IS_MARS)
64 option(SINGLE_D_OBJECT "Build all d sources to one object file" "ON") 75 option(SINGLE_D_OBJECT "Build all d sources to one object file" "ON")
65 elseif(D_IS_LLVM) 76 elseif(D_IS_LLVM)
66 option(SINGLE_D_OBJECT "Build all d sources to one object file" "OFF") 77 option(SINGLE_D_OBJECT "Build all d sources to one object file" "OFF")