this repo has no description
1# Create developer dir symlinks
2
3add_custom_target(xcproj_symlinks
4 DEPENDS Foundation bsdln
5 COMMAND env BUILD=${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/Developer/symlinks.sh
6 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Developer
7)
8
9function(xcproj)
10 set(options)
11 set(oneValueArgs PROJECT)
12 set(multiValueArgs EXECUTABLES LIBRARIES FRAMEWORKS)
13 cmake_parse_arguments(xcproj "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
14
15 set(product_dir ${CMAKE_CURRENT_BINARY_DIR}/Build/Products/Release)
16
17 foreach(executable IN LISTS xcproj_EXECUTABLES)
18 set(output ${output} ${product_dir}/${executable})
19 endforeach()
20
21 foreach(library IN LISTS xcproj_LIBRARIES)
22 set(output ${output} ${product_dir}/${library}.dylib)
23 endforeach()
24
25 foreach(framework IN LISTS xcproj_FRAMEWORKS)
26 set(output ${output} ${product_dir}/${framework}.framework/${framework})
27 endforeach()
28
29 add_custom_command(
30 OUTPUT ${output}
31 COMMAND env RUNTIME_SPEC_PATH=${CMAKE_SOURCE_DIR}/src/external/xcbuild/Specifications DEVELOPER_DIR=${CMAKE_SOURCE_DIR}/Developer ${CMAKE_BINARY_DIR}/src/external/xcbuild/Libraries/xcdriver/xcodebuild -project ${CMAKE_CURRENT_SOURCE_DIR}/${xcproj_PROJECT} -derivedDataPath ${CMAKE_CURRENT_BINARY_DIR}
32 DEPENDS xcbuild xcproj_symlinks
33 )
34
35 foreach(framework IN LISTS xcproj_FRAMEWORKS)
36 add_custom_target(${framework} ALL
37 DEPENDS ${product_dir}/${framework}.framework/${framework}
38 )
39 endforeach()
40endfunction(xcproj)