git-svn-id: svn://db.shs.com.ru/pip@936 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2020-03-09 14:03:14 +00:00
parent cdbc586a50
commit 201b9dc256
8 changed files with 25 additions and 14 deletions

View File

@@ -27,6 +27,20 @@ endif()
set(CMAKE_CXX_STANDARD 11)
# Apple crosscompiling rpath patch
macro(apple_rpath_patch _T)
if (APPLE AND CMAKE_CROSSCOMPILING AND CMAKE_MACOSX_RPATH)
foreach(_RP ${CMAKE_INSTALL_RPATH})
add_custom_command(TARGET ${_T} POST_BUILD
COMMAND "${CMAKE_INSTALL_NAME_TOOL}"
"-add_rpath" "${_RP}"
"$<TARGET_FILE_DIR:${_T}>/$<TARGET_FILE_NAME:${_T}>"
COMMENT "Add to ${_T} rpath \"${_RP}\"")
endforeach()
endif()
endmacro()
# Basic
macro(gather_src DIR CPP H H_P)
set(CS)
@@ -600,6 +614,10 @@ else()
endif()
endif()
foreach(_T ${PIP_LIBS_TARGETS})
apple_rpath_patch(${_T})
endforeach()
if(NOT PIP_FREERTOS)
# Auxiliary
@@ -639,20 +657,6 @@ if(NOT PIP_FREERTOS)
endforeach()
endif()
# Apple crosscompiling rpath patch
if (APPLE AND CMAKE_CROSSCOMPILING AND CMAKE_MACOSX_RPATH)
foreach(_T ${PIP_LIBS_TARGETS})
foreach(_RP ${CMAKE_INSTALL_RPATH})
add_custom_command(TARGET ${_T} POST_BUILD
COMMAND "${CMAKE_INSTALL_NAME_TOOL}"
"-add_rpath" "${_RP}"
"$<TARGET_FILE_DIR:${_T}>/$<TARGET_FILE_NAME:${_T}>"
COMMENT "Add to ${_T} rpath \"${_RP}\"")
endforeach()
endforeach()
endif()
#
# Build Documentation
#

View File

@@ -3,6 +3,7 @@ file(GLOB CPPS "*.cpp")
file(GLOB HDRS "*.h")
add_executable(picloud ${CPPS} ${HDRS})
target_link_libraries(picloud pip pip_cloud)
apple_rpath_patch(picloud)
if (DEFINED LIB)
install(TARGETS picloud DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()

View File

@@ -1,6 +1,7 @@
message(STATUS "Building pip_cmg")
add_executable(pip_cmg "main.cpp")
target_link_libraries(pip_cmg pip)
apple_rpath_patch(pip_cmg)
if (DEFINED LIB)
install(TARGETS pip_cmg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()

View File

@@ -1,6 +1,7 @@
message(STATUS "Building picrypt")
add_executable(picrypt "main.cpp")
target_link_libraries(picrypt pip pip_crypt)
apple_rpath_patch(picrypt)
if (DEFINED LIB)
install(TARGETS picrypt DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()

View File

@@ -4,6 +4,7 @@ file(GLOB HDRS "*.h")
add_executable(pip_rc ${CPPS} ${HDRS})
set (PIRC_LIBS pip)
target_link_libraries(pip_rc ${PIRC_LIBS})
apple_rpath_patch(pip_rc)
if (DEFINED LIB)
install(TARGETS pip_rc DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()

View File

@@ -3,6 +3,7 @@ file(GLOB CPPS "*.cpp")
file(GLOB HDRS "*.h")
add_executable(pisd ${CPPS} ${HDRS})
target_link_libraries(pisd pip pip_crypt)
apple_rpath_patch(pisd)
if (DEFINED LIB)
install(TARGETS pisd DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()

View File

@@ -1,6 +1,7 @@
message(STATUS "Building pip_system_test")
add_executable(pip_system_test "main.cpp")
target_link_libraries(pip_system_test pip)
apple_rpath_patch(pip_system_test)
if (DEFINED LIB)
install(TARGETS pip_system_test DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
endif ()

View File

@@ -1,6 +1,7 @@
message(STATUS "Building pift")
add_executable(pift "main.cpp")
target_link_libraries(pift pip)
apple_rpath_patch(pift)
if (DEFINED LIB)
install(TARGETS pift DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
else()