Skip to content

Commit b684f34

Browse files
author
Pavel Sukhov
committed
Cross platform changes
1 parent 1afb8e4 commit b684f34

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

perf/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(MSVC)
1212
endif()
1313

1414
add_executable(${target} ${srcs} ${hdrs})
15-
target_link_libraries(${target} gtest opencv_ptest ${LIBRARY} ${CMAKE_THREAD_LIBS_INIT} pthread)
15+
if (UNIX)
16+
target_link_libraries(${target} ${CMAKE_THREAD_LIBS_INIT} pthread)
17+
endif (UNIX)
18+
target_link_libraries(${target} gtest opencv_ptest ${LIBRARY})
1619

1720
add_custom_command(
1821
TARGET ${target}

sample/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ foreach(app_filename ${app_list})
66
get_filename_component(app ${app_filename} NAME_WE)
77
# Add and configure executable file to be produced
88
add_executable(${app} ${app_filename})
9-
target_link_libraries(${app} ${LIBRARY_DEPS} ${CMAKE_THREAD_LIBS_INIT})
9+
if (UNIX)
10+
target_link_libraries(${target} ${app} ${CMAKE_THREAD_LIBS_INIT})
11+
endif (UNIX)
12+
target_link_libraries(${target} ${app} ${LIBRARY_DEPS} )
1013
endforeach()

src/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ file(GLOB hdrs "*.h*")
44
file(GLOB srcs "*.cpp")
55

66
add_library(${target} STATIC ${srcs} ${hdrs})
7-
target_link_libraries(${target} ${LIBRARY_DEPS} ${CMAKE_THREAD_LIBS_INIT})
7+
if (UNIX)
8+
target_link_libraries(${target} ${CMAKE_THREAD_LIBS_INIT})
9+
endif (UNIX)
10+
target_link_libraries(${target} ${LIBRARY_DEPS})
811

912
set(LIBRARY_DEPS "${LIBRARY_DEPS};${target}" PARENT_SCOPE)

test/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ if(MSVC)
1212
endif()
1313

1414
add_executable(${target} ${srcs} ${hdrs})
15-
target_link_libraries(${target} gtest ${LIBRARY} ${CMAKE_THREAD_LIBS_INIT} pthread)
15+
if (UNIX)
16+
target_link_libraries(${target} gtest ${CMAKE_THREAD_LIBS_INIT} pthread)
17+
endif (UNIX)
18+
target_link_libraries(${target} gtest ${LIBRARY})
1619

1720
add_custom_command(
1821
TARGET ${target}

0 commit comments

Comments
 (0)