|
40 | 40 | (define login_cmd (string-append "source " login_script)) |
41 | 41 | (define (system-env arg) (system (string-append login_cmd " && " arg))) |
42 | 42 |
|
43 | | -(define (libfreenect-installed?) |
44 | | - (display "Searching for libfreenect: ") |
45 | | - #t) |
46 | | - |
47 | 43 | ;; 7. For windows, we need to find out, which architecture DrRacket is built |
48 | 44 | (require (only-in ffi/unsafe ctype-sizeof _pointer)) |
49 | 45 | (define racket-bits (* 8 (ctype-sizeof _pointer))) |
| 46 | +(define cmake_flags (if (= racket-bits 32) |
| 47 | + "-DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32" |
| 48 | + "")) |
50 | 49 |
|
51 | 50 | ; 8. The compilation routine (at least for macosx and unix) |
52 | 51 | (if (or (equal? (system-type 'os) 'macosx) |
53 | 52 | (equal? (system-type 'os) 'unix)) |
54 | | - (if (libfreenect-installed?) |
55 | | - ;;LIBFREENECT is found! |
56 | | - (begin |
57 | | - (display "-------------- BUILDING LIBFREENECT-C-WRAPPER FOR KINECT GRABBING --------------") |
58 | | - (newline) |
59 | | - (current-directory kinect-grab_c-path) |
60 | | - (if (system-env (string-append " make " (symbol->string (system-type 'os)) (number->string racket-bits))) ; "make macosx32", "make macosx64", "make unix32" or "make unix64" |
61 | | - (begin |
62 | | - (copy-file (build-path (current-directory) "bin" dylib-file) dylib-path #t) |
63 | | - #t) |
64 | | - (error "making the kinect-grab_c lib failed, although libFreenect seems to be installed"))) |
65 | | - (error "LibFreenect is not found. Please check if the prefix path is set correctly in /.profile file!")) |
| 53 | + (begin |
| 54 | + (display "-------------- BUILDING LIBFREENECT-C-WRAPPER FOR KINECT GRABBING --------------") |
| 55 | + (newline) |
| 56 | + (current-directory kinect-grab_c-path) |
| 57 | + (if (system-env (string-append "mkdir build && cd build && cmake " cmake_flags " .. && make && cd ..")) |
| 58 | + (begin |
| 59 | + (copy-file (build-path (current-directory) "bin" dylib-file) dylib-path #t) |
| 60 | + #t) |
| 61 | + (error "Making the kinect-grab_c lib failed"))) |
66 | 62 | ;;For windows |
67 | 63 | (if (equal? (system-type 'os) 'windows) |
68 | 64 | (let ((bindir (build-path kinect-grab_c-path "bin" (string-append "win"(number->string racket-bits))))) |
|
0 commit comments