Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use -pthread option rather than CMake script

  • Loading branch information...
commit 8b6f6cb9bf477e1ecf450b4b4ad40b98a88374d4 1 parent b3963c0
@Neverlord Neverlord authored
Showing with 6 additions and 60 deletions.
  1. +6 −4 CMakeLists.txt
  2. +0 −56 FindPTHREAD.cmake
View
10 CMakeLists.txt
@@ -162,11 +162,13 @@ if (BOOST_ROOT)
set(Boost_NO_SYSTEM_PATHS true)
endif ()
-find_package(PTHREAD REQUIRED)
-
-set(INCLUDE_DIRS . ${PTHREAD_INCLUDE_DIR})
+set(INCLUDE_DIRS .)
set(LD_DIRS)
-set(LD_FLAGS ${CMAKE_LD_LIBS} ${PTHREAD_LIBRARIES})
+set(LD_FLAGS ${CMAKE_LD_LIBS})
+
+if (UNIX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+endif (UNIX)
if (ENABLE_OPENCL)
find_package(OPENCL REQUIRED)
View
56 FindPTHREAD.cmake
@@ -1,56 +0,0 @@
-# - Find pthread
-# Find the native PTHREAD headers and libraries.
-#
-# PTHREAD_INCLUDE_DIR - where to find pthread.h, etc.
-# PTHREAD_LIBRARIES - List of libraries when using pthread.
-# PTHREAD_FOUND - True if pthread found.
-
-GET_FILENAME_COMPONENT(module_file_path ${CMAKE_CURRENT_LIST_FILE} PATH )
-
-# Look for the header file.
-FIND_PATH(PTHREAD_INCLUDE_DIR NAMES pthread.h
- PATHS $ENV{H3D_EXTERNAL_ROOT}/include
- $ENV{H3D_EXTERNAL_ROOT}/include/pthread
- $ENV{H3D_ROOT}/../External/include
- $ENV{H3D_ROOT}/../External/include/pthread
- ../../External/include
- ../../External/include/pthread
- ${module_file_path}/../../../External/include
- ${module_file_path}/../../../External/include/pthread)
-
-MARK_AS_ADVANCED(PTHREAD_INCLUDE_DIR)
-
-# Look for the library.
-
-IF(WIN32)
- FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthreadVC2
- PATHS $ENV{H3D_EXTERNAL_ROOT}/lib
- $ENV{H3D_ROOT}/../External/lib
- ../../External/lib
- ${module_file_path}/../../../External/lib)
-ELSE(WIN32)
- FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthread)
-ENDIF(WIN32)
-MARK_AS_ADVANCED(PTHREAD_LIBRARY)
-
-# Copy the results to the output variables.
-IF(PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
- SET(PTHREAD_FOUND 1)
- SET(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY})
- SET(PTHREAD_INCLUDE_DIR ${PTHREAD_INCLUDE_DIR})
-ELSE(PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
- SET(PTHREAD_FOUND 0)
- SET(PTHREAD_LIBRARIES)
- SET(PTHREAD_INCLUDE_DIR)
-ENDIF(PTHREAD_INCLUDE_DIR AND PTHREAD_LIBRARY)
-
-# Report the results.
-IF(NOT PTHREAD_FOUND)
- SET(PTHREAD_DIR_MESSAGE
- "PTHREAD was not found. Make sure PTHREAD_LIBRARY and PTHREAD_INCLUDE_DIR are set. Pthread is required to compile.")
- IF(PTHREAD_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${PTHREAD_DIR_MESSAGE}")
- ELSEIF(NOT PTHREAD_FIND_QUIETLY)
- MESSAGE(STATUS "${PTHREAD_DIR_MESSAGE}")
- ENDIF(PTHREAD_FIND_REQUIRED)
-ENDIF(NOT PTHREAD_FOUND)
Please sign in to comment.
Something went wrong with that request. Please try again.