fix cmake file

This commit is contained in:
Matheus Eduardo Garbelini 2021-09-10 04:34:18 +08:00
parent e6b337732c
commit c716d9cd3a
4 changed files with 11 additions and 7 deletions

View file

@ -5,15 +5,18 @@ project(
LANGUAGES CXX C LANGUAGES CXX C
VERSION 1.0) VERSION 1.0)
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
set(CMAKE_BUILD_RPATH $ORIGIN host_stack runtime/install/lib/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY host_stack)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY host_stack)
set(PYTHON3_URL set(PYTHON3_URL
"https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-unknown-linux-gnu-pgo+lto-20210506T0943.tar.zst" "https://github.com/indygreg/python-build-standalone/releases/download/20210506/cpython-3.8.10-x86_64-unknown-linux-gnu-pgo+lto-20210506T0943.tar.zst"
) )
set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
set(CMAKE_BUILD_RPATH $ORIGIN host_stack runtime/install/lib/)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/host_stack)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/host_stack)
# * pthreads
find_package(Threads REQUIRED)
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/runtime/success) if(NOT EXISTS ${PROJECT_SOURCE_DIR}/runtime/success)
file(DOWNLOAD ${PYTHON3_URL} ${PROJECT_SOURCE_DIR}/runtime.tar.zst file(DOWNLOAD ${PYTHON3_URL} ${PROJECT_SOURCE_DIR}/runtime.tar.zst
SHOW_PROGRESS) SHOW_PROGRESS)
@ -28,7 +31,8 @@ if(NOT EXISTS ${PROJECT_SOURCE_DIR}/runtime/success)
endif(PYTHON_ERROR) endif(PYTHON_ERROR)
# Install requirements from requirements.txt # Install requirements from requirements.txt
execute_process( execute_process(
COMMAND bash -c "./runtime/install/bin/python3 -m pip install -r ./requirements.txt" COMMAND bash -c
"./runtime/install/bin/python3 -m pip install -r ./requirements.txt"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
ERROR_VARIABLE PYTHON_ERROR) ERROR_VARIABLE PYTHON_ERROR)
if(PYTHON_ERROR) if(PYTHON_ERROR)
@ -80,7 +84,7 @@ foreach(BT_PROGRAM_FILE ${BT_PROGRAMS})
${BTSTACK_ROOT}/platform/posix/btstack_run_loop_posix.c ${BTSTACK_ROOT}/platform/posix/btstack_run_loop_posix.c
${PROJECT_SOURCE_DIR}/host_stack/bt_stack.cpp) ${PROJECT_SOURCE_DIR}/host_stack/bt_stack.cpp)
add_executable(${BT_PROGRAM} ${BT_PROGRAM_FILE}) add_executable(${BT_PROGRAM} ${BT_PROGRAM_FILE})
target_link_libraries(${BT_PROGRAM} btstack pthread) target_link_libraries(${BT_PROGRAM} ${CMAKE_THREAD_LIBS_INIT} btstack)
target_include_directories(${BT_PROGRAM} PRIVATE ${BT_INCLUDES}) target_include_directories(${BT_PROGRAM} PRIVATE ${BT_INCLUDES})
endforeach() endforeach()

Binary file not shown.

Binary file not shown.

Binary file not shown.