/ src / xcselect / CMakeLists.txt
CMakeLists.txt
 1  project(xcselect)
 2  include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
 3  
 4  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fblocks")
 5  
 6  add_definitions(-nostdinc)
 7  
 8  set(DYLIB_INSTALL_NAME "/usr/lib/libxcselect.dylib")
 9  set(DYLIB_COMPAT_VERSION "1.0.0")
10  set(DYLIB_CURRENT_VERSION "1.0.0")
11  
12  add_darling_library(xcselect xcselect.c)
13  target_link_libraries(xcselect system CoreFoundation)
14  
15  add_darling_executable(xcrun xcrun.c)
16  target_link_libraries(xcrun system xcselect)
17  
18  add_darling_executable(xcode-select xcode-select.c)
19  target_link_libraries(xcode-select system xcselect)
20  
21  install(TARGETS xcselect DESTINATION libexec/darling/usr/lib)
22  install(TARGETS xcrun xcode-select DESTINATION libexec/darling/usr/bin)
23  install(PROGRAMS clt_install.py DESTINATION libexec/darling/usr/libexec/darling)
24  
25  function(add_shim name require_xc)
26  	add_darling_executable("${name}_shim" xcrun-shim.c)
27  
28  	set_target_properties("${name}_shim"
29  		PROPERTIES
30  			OUTPUT_NAME "${name}"
31  			COMPILE_FLAGS "-DTOOL_NAME=\\\"${name}\\\" -DREQUIRE_XCODE=${require_xc}"
32  	)
33  
34  	target_link_libraries("${name}_shim" system xcselect)
35  	install(TARGETS "${name}_shim" DESTINATION libexec/darling/usr/bin)
36  endfunction(add_shim)
37  
38  function(add_shims require_xc) 
39  	foreach(tool ${ARGN})
40  		add_shim(${tool} ${require_xc})
41  	endforeach()
42  endfunction(add_shims)
43  
44  # TODO: c++, cc, llvm-g++, llvm-gcc -- symlinks to clang
45  
46  add_shims(0
47  	BuildStrings CpMac DeRez GetFileInfo MergePef MvMac
48  	ResMerger Rez RezDet RezWack SetFile SplitForks UnRezWack
49  	ar as asa bison clang clang++ cmpdylib codesign_allocate
50  	cpp ctags ctf_insert dsymutil dwarfdump flex flex++ g++
51  	gatherheaderdoc gcc gcov git git-cvsserver git-receive-pack
52  	git-shell git-upload-archive git-upload-pack gm4 gnumake
53  	gperf hdxml2manxml headerdoc2html indent install_name_tool
54  	ld lex libtool lipo lldb llvm-g++ llvm-gcc lorder m4 make
55  	mig mkdep nasm ndisasm nm nmedit objdump otool pagestuff
56  	ranlib rebase redo_prebinding resolveLinks rpcgen segedit
57  	size strings strip svn svnadmin svndumpfilter svnlook
58  	svnserve svnsync svnversion swift swiftc unifdef unifdefall
59  	xml2man yacc)
60  
61  add_shims(1
62  	agvtool desdp genstrings ibtool ictool instruments
63  	iprofiler opendiff sdef sdp xcodebuild xcscontrol
64  	xcsdiagnose xed)
65  
66  InstallSymlink(clang ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/cc)
67  InstallSymlink(clang++ ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/c++)