Compare commits
2 Commits
c3257c7c50
...
494b09847e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
494b09847e | ||
|
|
f1951ee711 |
108
CMakeLists.txt
108
CMakeLists.txt
@@ -77,7 +77,7 @@ set(PIP_SRC_DIRS ${PIP_SRC_MAIN}
|
||||
${PIP_SRC_IO_UTILS}
|
||||
${PIP_SRC_CONCURRENT}
|
||||
${PIP_SRC_CLOUD}
|
||||
)
|
||||
)
|
||||
set(PIP_LIBS_TARGETS pip)
|
||||
set(LIBS_MAIN)
|
||||
set(LIBS_STATUS)
|
||||
@@ -318,37 +318,37 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
if (NOT "x${_PIP_DEFS}" STREQUAL "x")
|
||||
file(APPEND ${_PIP_DEFS_FILE} "#ifndef ${_PIP_DEFS}\n# define ${_PIP_DEFS}\n#endif\n")
|
||||
endif()
|
||||
endif()
|
||||
list(APPEND HDRS ${_PIP_DEFS_FILE})
|
||||
#message("${_PIP_DEFS_CHANGED}")
|
||||
endif()
|
||||
list(APPEND HDRS ${_PIP_DEFS_FILE})
|
||||
#message("${_PIP_DEFS_CHANGED}")
|
||||
|
||||
|
||||
# Check if RT timers exists
|
||||
if(PIP_TIMER_RT_0 AND PIP_TIMER_RT_1 AND PIP_TIMER_RT_2)
|
||||
# Check if RT timers exists
|
||||
if(PIP_TIMER_RT_0 AND PIP_TIMER_RT_1 AND PIP_TIMER_RT_2)
|
||||
add_definitions(-DPIP_TIMER_RT)
|
||||
message(STATUS "Building PIP with timers: Thread, ThreadRT, Pool")
|
||||
else()
|
||||
else()
|
||||
message(STATUS "Building PIP with timers: Thread, Pool")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# Add main library
|
||||
if(APPLE)
|
||||
# Add main library
|
||||
if(APPLE)
|
||||
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE)
|
||||
endif()
|
||||
if ((NOT DEFINED LIBPROJECT) AND (DEFINED ANDROID_PLATFORM))
|
||||
endif()
|
||||
if ((NOT DEFINED LIBPROJECT) AND (DEFINED ANDROID_PLATFORM))
|
||||
include_directories(${ANDROID_SYSTEM_LIBRARY_PATH}/usr/include)
|
||||
#message("${ANDROID_SYSTEM_LIBRARY_PATH}/usr/include")
|
||||
#message("${ANDROID_NDK}/sysroot/usr/include")
|
||||
endif()
|
||||
if(NOT PIP_FREERTOS)
|
||||
if(WIN32)
|
||||
endif()
|
||||
if(NOT PIP_FREERTOS)
|
||||
if(WIN32)
|
||||
if(${C_COMPILER} STREQUAL "cl.exe")
|
||||
else()
|
||||
list(APPEND LIBS_MAIN ws2_32 iphlpapi psapi cfgmgr32 setupapi)
|
||||
endif()
|
||||
else()
|
||||
else()
|
||||
list(APPEND LIBS_MAIN dl)
|
||||
if(DEFINED ENV{QNX_HOST})
|
||||
list(APPEND LIBS_MAIN socket)
|
||||
@@ -357,12 +357,12 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
list(APPEND LIBS_MAIN pthread util)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(PIP_LIBS)
|
||||
if(PIP_FREERTOS)
|
||||
endif()
|
||||
endif()
|
||||
set(PIP_LIBS)
|
||||
if(PIP_FREERTOS)
|
||||
set(PIP_LIBS ${LIBS_MAIN})
|
||||
else()
|
||||
else()
|
||||
foreach(LIB_ ${LIBS_MAIN})
|
||||
find_library(${LIB_}_FOUND ${LIB_})
|
||||
if(${LIB_}_FOUND)
|
||||
@@ -370,31 +370,31 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
list(APPEND PIP_LIBS ${${LIB_}_FOUND})
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
list(APPEND LIBS_STATUS ${LIBS_MAIN})
|
||||
import_version(pip PIP)
|
||||
if(WIN32)
|
||||
endif()
|
||||
list(APPEND LIBS_STATUS ${LIBS_MAIN})
|
||||
import_version(pip PIP)
|
||||
if(WIN32)
|
||||
make_rc(pip _RC)
|
||||
add_definitions(-DPSAPI_VERSION=1)
|
||||
add_library(pip ${PIP_LIB_TYPE} ${CPP_LIB_MAIN} ${HDRS} ${PHDRS} ${_RC})
|
||||
if(${C_COMPILER} STREQUAL "cl.exe")
|
||||
set(CMAKE_CXX_FLAGS "/O2 /Ob2 /Ot /W0")
|
||||
endif()
|
||||
else()
|
||||
else()
|
||||
set(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
if(DEFINED ENV{QNX_HOST} OR PIP_FREERTOS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-32")
|
||||
else()
|
||||
endif()
|
||||
add_library(pip ${PIP_LIB_TYPE} ${CPP_LIB_MAIN})
|
||||
endif()
|
||||
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 ${PIP_LIBS})
|
||||
endif()
|
||||
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 ${PIP_LIBS})
|
||||
|
||||
if (NOT CROSSTOOLS)
|
||||
if (NOT CROSSTOOLS)
|
||||
if (NOT PIP_FREERTOS)
|
||||
# Check if USB is supported
|
||||
find_library(usb_FOUND usb SHARED)
|
||||
@@ -662,11 +662,11 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
list(APPEND PIP_LIBS_TARGETS pip_compress)
|
||||
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Install
|
||||
# Check if system or local install will be used (to system install use "-DLIB=" argument of cmake)
|
||||
if(LIB)
|
||||
# Install
|
||||
# Check if system or local install will be used (to system install use "-DLIB=" argument of cmake)
|
||||
if(LIB)
|
||||
if(WIN32)
|
||||
if(MINGW)
|
||||
if (NOT CROSSTOOLS)
|
||||
@@ -695,7 +695,7 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
message(STATUS "Install ${PROJECT_NAME} to system \"${CMAKE_INSTALL_PREFIX}\"")
|
||||
file(GLOB CMAKES "cmake/*.cmake" "cmake/*.in" "cmake/android_debug.keystore")
|
||||
install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules)
|
||||
else()
|
||||
else()
|
||||
if(NOT PIP_FREERTOS)
|
||||
if(WIN32)
|
||||
install(TARGETS ${PIP_LIBS_TARGETS} RUNTIME DESTINATION bin)
|
||||
@@ -706,16 +706,16 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
install(FILES ${HDRS} DESTINATION include/pip)
|
||||
message(STATUS "Install ${PROJECT_NAME} to local \"bin\", \"lib\" and \"include\"")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT PIP_FREERTOS)
|
||||
if(NOT PIP_FREERTOS)
|
||||
|
||||
# Auxiliary
|
||||
# Auxiliary
|
||||
if (NOT CROSSTOOLS)
|
||||
add_subdirectory("${PIP_SRC_MAIN}/auxiliary/piterminal")
|
||||
endif()
|
||||
|
||||
# Utils
|
||||
# Utils
|
||||
add_subdirectory("utils/code_model_generator")
|
||||
add_subdirectory("utils/resources_compiler")
|
||||
add_subdirectory("utils/deploy_tool")
|
||||
@@ -730,29 +730,29 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Libraries messages
|
||||
message(STATUS "Building PIP modules: ${PIP_LIBS_TARGETS}")
|
||||
if(DEFINED LIBPROJECT)
|
||||
# Libraries messages
|
||||
message(STATUS "Building PIP modules: ${PIP_LIBS_TARGETS}")
|
||||
if(DEFINED LIBPROJECT)
|
||||
set(PIP_LIBS_TARGETS ${PIP_LIBS_TARGETS} PARENT_SCOPE)
|
||||
list(APPEND _ALL_TARGETS ${PIP_LIBS_TARGETS})
|
||||
set(_ALL_TARGETS ${_ALL_TARGETS} PARENT_SCOPE)
|
||||
endif()
|
||||
if(NOT PIP_FREERTOS)
|
||||
endif()
|
||||
if(NOT PIP_FREERTOS)
|
||||
foreach(LIB_ ${LIBS_STATUS})
|
||||
message(STATUS "Library ${LIB_} -> " ${${LIB_}_FOUND})
|
||||
if(NOT ${LIB_}_FOUND)
|
||||
message(WARNING "Library ${LIB_} not found, please install it")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#
|
||||
# Build Documentation
|
||||
#
|
||||
if ((NOT PIP_FREERTOS) AND (NOT CROSSTOOLS))
|
||||
#
|
||||
# Build Documentation
|
||||
#
|
||||
if ((NOT PIP_FREERTOS) AND (NOT CROSSTOOLS))
|
||||
include(PIPDocumentation)
|
||||
find_package(Doxygen)
|
||||
if(DOXYGEN_FOUND)
|
||||
@@ -776,5 +776,5 @@ if ((NOT DEFINED _PIP_SAVED_DEFS) OR (NOT "x${_PIP_SAVED_DEFS}" STREQUAL "x${_PI
|
||||
add_documentation(doc doc/Doxyfile.in)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html DESTINATION ../share/doc/pip COMPONENT doc EXCLUDE_FROM_ALL OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user