Added threading support to CMake files.

This commit is contained in:
Camilla Berglund 2012-08-12 16:18:59 +02:00
parent fd125f7e54
commit 98c1c2fbf2
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,12 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
find_package(OpenGL REQUIRED) find_package(OpenGL REQUIRED)
set(CMAKE_THREAD_PREFER_PTHREADS YES)
find_package(Threads)
if (CMAKE_THREAD_LIBS_INIT)
list(APPEND glfw_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif()
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Enable all warnings on GCC, regardless of OS # Enable all warnings on GCC, regardless of OS
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -31,6 +31,10 @@ add_executable(peter peter.c)
add_executable(reopen reopen.c) add_executable(reopen reopen.c)
add_executable(threads threads.c ${TINYCTHREAD}) add_executable(threads threads.c ${TINYCTHREAD})
if (BUILD_SHARED_LIBS)
target_link_libraries(threads ${CMAKE_THREAD_LIBS_INIT})
endif()
add_executable(accuracy WIN32 MACOSX_BUNDLE accuracy.c) add_executable(accuracy WIN32 MACOSX_BUNDLE accuracy.c)
set_target_properties(accuracy PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Accuracy") set_target_properties(accuracy PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Accuracy")