From f6ba959b1b7f9d4bf8697e01ebc0fe7e9bea0578 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 12 Sep 2012 21:54:00 +0200 Subject: [PATCH] Moved threads package to X11 block. --- CMakeLists.txt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index abfee8c9..71014439 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,15 +17,6 @@ option(BUILD_SHARED_LIBS "Build shared libraries" OFF) find_package(OpenGL REQUIRED) -if (NOT WIN32) - set(CMAKE_THREAD_PREFER_PTHREADS YES) -endif() - -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 #-------------------------------------------------------------------- @@ -94,6 +85,12 @@ if (_GLFW_X11_GLX) find_package(X11 REQUIRED) + set(CMAKE_THREAD_PREFER_PTHREADS YES) + find_package(Threads) + if (CMAKE_THREAD_LIBS_INIT) + list(APPEND glfw_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + endif() + # Set up library and include paths list(APPEND glfw_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH} ${OPENGL_INCLUDE_DIR}) list(APPEND glfw_LIBRARIES ${X11_X11_LIB} ${OPENGL_gl_LIBRARY})