Commit 0b01cc1e authored by Giuseppe Corbelli's avatar Giuseppe Corbelli

[tests/CMakeLists.txt] Problem: The libzmq.lib search path should be set

only if the library is found at a specific path

Solution: Search for libzmq.lib in ../bin/Win32/Debug/v120/dynamic, don't
know how to automatically search in correct path based on current build
configuration
parent f9c86872
...@@ -132,19 +132,23 @@ if(WIN32) ...@@ -132,19 +132,23 @@ if(WIN32)
add_definitions(-DZMQ_CUSTOM_PLATFORM_HPP) add_definitions(-DZMQ_CUSTOM_PLATFORM_HPP)
add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
include_directories(../builds/msvc) include_directories(../builds/msvc)
# Same name on 64bit systems
link_libraries(Ws2_32.lib) link_libraries(Ws2_32.lib)
endif() endif()
# add library and include dirs for all targets # add library and include dirs for all targets
link_libraries(libzmq) link_libraries(libzmq)
include_directories("${CMAKE_SOURCE_DIR}/../include") include_directories("${CMAKE_SOURCE_DIR}/../include")
include_directories("${CMAKE_SOURCE_DIR}/src")
foreach(test ${tests}) foreach(test ${tests})
add_executable(${test} ${test}.cpp) add_executable(${test} ${test}.cpp)
if(WIN32) if(WIN32)
# it will only link correctly for DEBUG builds in Windows (I don't know how to specify the target and target library in CMake) # This is the output for Debug dynamic builds on Visual Studio 6.0
SET_TARGET_PROPERTIES( ${test} PROPERTIES LINK_FLAGS "/LIBPATH:../bin/Win32/Debug/v120/dynamic" ) # You should provide the correct directory, don't know how to do it automatically
find_path(LIBZMQ_PATH "libzmq.lib" PATHS "../bin/Win32/Debug/v120/dynamic")
if(NOT ${LIBZMQ_PATH} STREQUAL "LIBZMQ_PATH-NOTFOUND")
SET_TARGET_PROPERTIES( ${test} PROPERTIES LINK_FLAGS "/LIBPATH:${LIBZMQ_PATH}" )
endif()
else() else()
# per-test directories not generated on OS X / Darwin # per-test directories not generated on OS X / Darwin
if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang.*") if (NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang.*")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment