mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 16:56:45 +08:00
target_include_directories
This commit is contained in:
parent
564f511a95
commit
faa2f10e3a
@ -4,14 +4,13 @@ project(cpp-ipc)
|
||||
option(LIBIPC_BUILD_TESTS "Build all of libipc's own tests." OFF)
|
||||
option(LIBIPC_BUILD_DEMOS "Build all of libipc's own demos." OFF)
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")
|
||||
if(NOT MSVC)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2")
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||
|
||||
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
|
||||
set(LIBIPC_PROJECT_DIR ${PROJECT_SOURCE_DIR})
|
||||
|
||||
@ -2,14 +2,6 @@ project(ipc)
|
||||
|
||||
option(LIBIPC_BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
|
||||
|
||||
if(NOT MSVC)
|
||||
add_compile_options(-fPIC)
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${LIBIPC_PROJECT_DIR}/include
|
||||
${LIBIPC_PROJECT_DIR}/src)
|
||||
|
||||
if(UNIX)
|
||||
file(GLOB SRC_FILES ${LIBIPC_PROJECT_DIR}/src/libipc/platform/*_linux.cpp)
|
||||
else()
|
||||
@ -37,6 +29,11 @@ else()
|
||||
add_library(${PROJECT_NAME} STATIC ${SRC_FILES} ${HEAD_FILES})
|
||||
endif()
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC ${LIBIPC_PROJECT_DIR}/include
|
||||
PRIVATE ${LIBIPC_PROJECT_DIR}/src
|
||||
)
|
||||
|
||||
if(NOT MSVC)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC
|
||||
pthread
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user