Make sure that our thread api preferences are saved in the cache.

This commit is contained in:
Pavel Krajcevski 2012-10-02 18:34:25 -04:00
parent 78ed5f5e92
commit 04cbf615f5

View File

@ -34,14 +34,14 @@ INCLUDE_DIRECTORIES( ${TexC_BINARY_DIR}/IO/include )
INCLUDE_DIRECTORIES( ${TexC_SOURCE_DIR}/Core/include )
SET( THREAD_API "None" CACHE STRING "API used to implement threading operations")
SET( THREAD_API )
SET( THREAD_APIS_AVAILABLE "None" )
FIND_PACKAGE( Boost COMPONENTS thread system )
IF( Boost_FOUND )
SET( THREAD_APIS_AVAILABLE ${THREAD_APIS_AVAILABLE} "Boost" )
IF( THREAD_API MATCHES "None" )
SET( THREAD_APIS_AVAILABLE "Boost" ${THREAD_APIS_AVAILABLE} )
IF( "${THREAD_API}" STREQUAL "" )
SET( THREAD_API "Boost" )
ENDIF()
@ -50,13 +50,19 @@ ENDIF()
FIND_PACKAGE( Threads )
IF( CMAKE_USE_PTHREADS_INIT )
SET( THREAD_APIS_AVAILABLE ${THREAD_APIS_AVAILABLE} "PThread" )
IF( THREAD_API MATCHES "None" )
SET( THREAD_API "Boost" )
SET( THREAD_APIS_AVAILABLE "PThread" ${THREAD_APIS_AVAILABLE} )
IF( "${THREAD_API}" STREQUAL "" )
SET( THREAD_API "PThread" )
ENDIF()
ENDIF()
IF( "${THREAD_API}" STREQUAL "" )
SET( THREAD_API "None" )
ENDIF()
SET( THREAD_API_DESC "API used to implement threading operations")
SET( THREAD_API ${THREAD_API} CACHE STRING ${THREAD_API_DESC} FORCE )
SET_PROPERTY( CACHE THREAD_API PROPERTY STRINGS ${THREAD_APIS_AVAILABLE} )
IF( THREAD_API MATCHES "Boost")