Mercurial > projects > ldc
comparison runtime/CMakeLists.txt @ 828:03b0c817a1a3
added install target and possibility to pre- and suffix ldc's executable name to cmake scripts
author | elrood |
---|---|
date | Thu, 04 Dec 2008 22:09:24 +0100 |
parents | 4ad1e7b10378 |
children | 0a31c60a6bc1 |
comparison
equal
deleted
inserted
replaced
827:489f6f39ca09 | 828:03b0c817a1a3 |
---|---|
26 endif(D_VERSION EQUAL 1) | 26 endif(D_VERSION EQUAL 1) |
27 get_directory_property(PROJECT_PARENT_DIR DIRECTORY ${PROJECT_SOURCE_DIR} PARENT_DIRECTORY) | 27 get_directory_property(PROJECT_PARENT_DIR DIRECTORY ${PROJECT_SOURCE_DIR} PARENT_DIRECTORY) |
28 set(RUNTIME_DIR ${PROJECT_PARENT_DIR}/${RUNTIME} CACHE PATH "runtime source dir" FORCE) | 28 set(RUNTIME_DIR ${PROJECT_PARENT_DIR}/${RUNTIME} CACHE PATH "runtime source dir" FORCE) |
29 | 29 |
30 if(D_VERSION EQUAL 1) | 30 if(D_VERSION EQUAL 1) |
31 set(LDC_EXE ldc) | |
32 # copy imports to runtime dir | 31 # copy imports to runtime dir |
33 add_custom_command( | 32 add_custom_command( |
34 OUTPUT ldc-imports | 33 OUTPUT ldc-imports |
35 COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/import/ldc ${RUNTIME_DIR}/ldc | 34 COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/import/ldc ${RUNTIME_DIR}/ldc |
36 COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/internal/ldc/bitmanip.d ${RUNTIME_DIR}/ldc | 35 COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/internal/ldc/bitmanip.d ${RUNTIME_DIR}/ldc |
46 set(RUNTIME_DC_DIR ${PROJECT_SOURCE_DIR}/internal) | 45 set(RUNTIME_DC_DIR ${PROJECT_SOURCE_DIR}/internal) |
47 set(RUNTIME_GC_DIR ${RUNTIME_DIR}/lib/gc/basic) | 46 set(RUNTIME_GC_DIR ${RUNTIME_DIR}/lib/gc/basic) |
48 file(GLOB CORE_D ${RUNTIME_DIR}/lib/common/tango/core/*.d) | 47 file(GLOB CORE_D ${RUNTIME_DIR}/lib/common/tango/core/*.d) |
49 file(GLOB CORE_C ${RUNTIME_DIR}/lib/common/tango/stdc/*.c) | 48 file(GLOB CORE_C ${RUNTIME_DIR}/lib/common/tango/stdc/*.c) |
50 elseif(D_VERSION EQUAL 2) | 49 elseif(D_VERSION EQUAL 2) |
51 set(LDC_EXE ldc2) | |
52 set(RUNTIME_CC druntime-core) | 50 set(RUNTIME_CC druntime-core) |
53 set(RUNTIME_GC druntime-gc-basic) | 51 set(RUNTIME_GC druntime-gc-basic) |
54 set(RUNTIME_DC druntime-rt-ldc) | 52 set(RUNTIME_DC druntime-rt-ldc) |
55 set(RUNTIME_AIO druntime-ldc) | 53 set(RUNTIME_AIO druntime-ldc) |
56 set(RUNTIME_DC_DIR ${RUNTIME_DIR}/src/compiler/ldc) | 54 set(RUNTIME_DC_DIR ${RUNTIME_DIR}/src/compiler/ldc) |
71 | 69 |
72 find_program(LDC_LOC ${LDC_EXE} ../bin DOC "path to ldc binary") | 70 find_program(LDC_LOC ${LDC_EXE} ../bin DOC "path to ldc binary") |
73 if(NOT LDC_LOC) | 71 if(NOT LDC_LOC) |
74 message(SEND_ERROR "ldc not found") | 72 message(SEND_ERROR "ldc not found") |
75 endif(NOT LDC_LOC) | 73 endif(NOT LDC_LOC) |
74 set(LDC_EXE_NAME ${LDC_EXE}) | |
76 endif(NOT LDC_LOC) | 75 endif(NOT LDC_LOC) |
77 | 76 |
78 configure_file(${PROJECT_PARENT_DIR}/${LDC_EXE}.conf.in ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE}.conf) | 77 configure_file(${PROJECT_PARENT_DIR}/${LDC_EXE}.conf.in ${PROJECT_BINARY_DIR}/../bin/${LDC_EXE_NAME}.conf) |
79 | 78 |
80 # patch runtime source, uses LDC_EXE for ldc / ldc2 | 79 # patch runtime source, uses LDC_EXE for ldc / ldc2 |
81 find_program(PATCH_EXE patch DOC "path to patch tool") | 80 find_program(PATCH_EXE patch DOC "path to patch tool") |
82 if(NOT PATCH_EXE) | 81 if(NOT PATCH_EXE) |
83 message(STATUS "patch tool not found, can't automatically patch runtime sources for ldc") | 82 message(STATUS "patch tool not found, can't automatically patch runtime sources for ldc") |
176 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/../lib | 175 LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/../lib |
177 ) | 176 ) |
178 | 177 |
179 # BCLIBS is empty if BUILD_BC_LIBS is not selected | 178 # BCLIBS is empty if BUILD_BC_LIBS is not selected |
180 add_custom_target(runtime DEPENDS ${LIBS} ${BCLIBS}) | 179 add_custom_target(runtime DEPENDS ${LIBS} ${BCLIBS}) |
180 | |
181 install(DIRECTORY ${PROJECT_BINARY_DIR}/../lib DESTINATION .) |