mirror of
https://github.com/zeromq/libzmq.git
synced 2025-03-10 07:56:09 +00:00
Udpate unittests/CMakeLists.txt: use ZeroMQ_SOURCE_DIR, ZeroMQ_BINARY_DIR
Use ZeroMQ_SOURCE_DIR, ZeroMQ_BINARY_DIR instead of CMAKE_SOURCE_DIR, CMAKE_BINARY_DIR, which allows libzmq to become an "add_subdirectory" target (with static build). Otherwise, building unittest_xxx would complain header files not found.
This commit is contained in:
parent
cbb9925a10
commit
c981336445
@ -22,8 +22,8 @@ if(WIN32)
|
||||
link_libraries(ws2_32.lib)
|
||||
endif()
|
||||
|
||||
include_directories("${CMAKE_SOURCE_DIR}/include" "${CMAKE_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
|
||||
include_directories("${CMAKE_SOURCE_DIR}/external/unity")
|
||||
include_directories("${ZeroMQ_SOURCE_DIR}/include" "${ZeroMQ_SOURCE_DIR}/src" "${ZeroMQ_BINARY_DIR}")
|
||||
include_directories("${ZeroMQ_SOURCE_DIR}/external/unity")
|
||||
|
||||
foreach(test ${unittests})
|
||||
# target_sources not supported before CMake 3.1
|
||||
@ -31,7 +31,7 @@ foreach(test ${unittests})
|
||||
|
||||
# per-test directories not generated on OS X / Darwin
|
||||
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang.*")
|
||||
link_directories(${test} PRIVATE "${CMAKE_SOURCE_DIR}/../lib")
|
||||
link_directories(${test} PRIVATE "${ZeroMQ_SOURCE_DIR}/../lib")
|
||||
endif()
|
||||
|
||||
target_link_libraries(${test} libzmq-static ${OPTIONAL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} unity)
|
||||
|
Loading…
x
Reference in New Issue
Block a user