diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 7bc7c40..9ab1535 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -34,15 +34,15 @@ 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_API "Boost" ) + SET( THREAD_APIS_AVAILABLE "Boost" ${THREAD_APIS_AVAILABLE} ) + IF( "${THREAD_API}" STREQUAL "" ) + SET( THREAD_API "Boost" ) ENDIF() 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")