Merge pull request #3 from bagucode/master

CMake now uses configurable paths for libffi
This commit is contained in:
Erik Svedäng 2016-02-18 10:14:40 +01:00
commit a047930a42
2 changed files with 21 additions and 8 deletions

View File

@ -7,15 +7,23 @@ set(VERSION_MINOR "0")
set(VERSION_PATCH "1")
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
set(LIBFFI_INCLUDE_PATH
"${PROJECT_SOURCE_DIR}/../libffi/x86_64-apple-darwin15.3.0/include"
CACHE
PATH
"libffi include directory")
set(LIBFFI_LIBRARY
"${PROJECT_SOURCE_DIR}/../libffi/x86_64-apple-darwin15.3.0/.libs/libffi.a"
CACHE
FILEPATH
"libffi library")
set(SOURCE_DIR src)
include(globfiles.cmake)
# list(APPEND SOURCE_FILES src/main.c src/obj.c src/gc.c src/obj_string.c src/reader.c src/eval.c src/env.c src/primops.c src/repl.c)
# ${SOURCE_FILES}
include_directories(/usr/local/opt/libffi/lib/libffi-3.0.13/include)
link_directories(/usr/local/opt/libffi/lib/)
include_directories(${LIBFFI_INCLUDE_PATH})
link_directories(${LIBFFI_LIBRARY})
add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_h} ${${PROJECT_NAME}_c})
@ -23,6 +31,5 @@ target_link_libraries(${PROJECT_NAME} ffi)
set_target_properties(${PROJECT_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin"
)
RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")

6
xcode.sh Executable file
View File

@ -0,0 +1,6 @@
mkdir build
cd build
mkdir xcode
cd xcode
cmake ../../ -G Xcode
open carp-repl.xcodeproj