summaryrefslogtreecommitdiffstats
path: root/src/pthreads-test.cmake
blob: f818d909b4f78c4b17e5a3eb9845b385b7bbbfc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This file is part of MXE.
# See index.html for further information.

# partial module - included by src/cmake/CMakeLists.txt

set(TGT test-${PKG}-cmake)

enable_language(C)
add_executable(${TGT} ${CMAKE_CURRENT_LIST_DIR}/pthreads-test.c)

find_package(Threads REQUIRED)
if(Threads::Threads) # cmake 3.1.0+
    target_link_libraries(${TGT} Threads::Threads)
else()
    target_link_libraries(${TGT} ${CMAKE_THREAD_LIBS_INIT})
endif()

install(TARGETS ${TGT} DESTINATION bin)