git-svn-id: svn://db.shs.com.ru/pip@663 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -94,6 +94,11 @@ endif()
|
||||
|
||||
# Compiler
|
||||
get_filename_component(C_COMPILER "${CMAKE_C_COMPILER}" NAME)
|
||||
set(INSTALL_PREFIX "")
|
||||
if(CMAKE_CROSSCOMPILING)
|
||||
set(INSTALL_PREFIX "${CMAKE_FIND_ROOT_PATH}/")
|
||||
endif()
|
||||
#link_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
#message("${C_COMPILER}")
|
||||
|
||||
|
||||
@@ -260,10 +265,12 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(PIP_LIBS)
|
||||
foreach(LIB_ ${LIBS_MAIN})
|
||||
find_library(${LIB_}_FOUND ${LIB_})
|
||||
if(${LIB_}_FOUND)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIB_})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${${LIB_}_FOUND})
|
||||
list(APPEND PIP_LIBS ${${LIB_}_FOUND})
|
||||
endif()
|
||||
endforeach()
|
||||
list(APPEND LIBS_STATUS ${LIBS_MAIN})
|
||||
@@ -292,7 +299,7 @@ set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
include(GenerateExportHeader)
|
||||
generate_export_header(pip)
|
||||
list(APPEND HDRS "${CMAKE_CURRENT_BINARY_DIR}/pip_export.h")
|
||||
target_link_libraries(pip ${LIBS_MAIN})
|
||||
target_link_libraries(pip ${PIP_LIBS})
|
||||
|
||||
|
||||
# Check if USB is supported
|
||||
@@ -301,7 +308,7 @@ if(usb_FOUND)
|
||||
message(STATUS "Building with USB support")
|
||||
add_definitions(-DPIP_USB)
|
||||
add_library(pip_usb SHARED ${CPP_LIB_USB})
|
||||
target_link_libraries(pip_usb pip usb)
|
||||
target_link_libraries(pip_usb pip ${usb_FOUND})
|
||||
list(APPEND LIBS_STATUS usb)
|
||||
list(APPEND PIP_LIBS_TARGETS pip_usb)
|
||||
else()
|
||||
@@ -315,7 +322,7 @@ if(sodium_FOUND)
|
||||
message(STATUS "Building with crypt support")
|
||||
add_definitions(-DPIP_CRYPT)
|
||||
add_library(pip_crypt SHARED ${CPP_LIB_CRYPT})
|
||||
target_link_libraries(pip_crypt pip sodium)
|
||||
target_link_libraries(pip_crypt pip ${sodium_FOUND})
|
||||
list(APPEND LIBS_STATUS sodium)
|
||||
list(APPEND PIP_LIBS_TARGETS pip_crypt)
|
||||
else()
|
||||
@@ -423,7 +430,7 @@ list(APPEND PIP_LIBS_TARGETS pip_io_utils)
|
||||
|
||||
# Test program
|
||||
add_executable(pip_test "main.cpp")
|
||||
target_link_libraries(pip_test pip pip_crypt)
|
||||
target_link_libraries(pip_test pip)
|
||||
|
||||
|
||||
# Install
|
||||
@@ -448,12 +455,12 @@ if(LIB)
|
||||
endif()
|
||||
else()
|
||||
if(APPLE)
|
||||
set(CMAKE_INSTALL_PREFIX /usr/local)
|
||||
set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX}/usr/local)
|
||||
else()
|
||||
if (DEFINED ANDROID_PLATFORM)
|
||||
set(CMAKE_INSTALL_PREFIX ${ANDROID_SYSTEM_LIBRARY_PATH}/usr)
|
||||
set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX}${ANDROID_SYSTEM_LIBRARY_PATH}/usr)
|
||||
else()
|
||||
set(CMAKE_INSTALL_PREFIX /usr)
|
||||
set(CMAKE_INSTALL_PREFIX ${INSTALL_PREFIX}/usr)
|
||||
endif()
|
||||
endif()
|
||||
install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/pip)
|
||||
|
||||
Reference in New Issue
Block a user