matus-chochlik / oglplus

OGLplus is a collection of open-source, cross-platform libraries which implement an object-oriented facade over the OpenGL® (version 3 and higher) and also OpenAL® (version 1.1) and EGL (version 1.4) C-language APIs. It provides wrappers which automate resource and object management and make the use of these libraries in C++ safer and more convenient.
http://oglplus.org/
Boost Software License 1.0
492 stars 72 forks source link

cpp_feature_detection(THREADS) lack of pthread lib #131

Open KAlO2 opened 8 years ago

KAlO2 commented 8 years ago

Now GCC supports all the c++11 features, but when I use cmake on Ubuntu, I always get this message "Detecting support for c++ feature 'THREADS': false", and I see it try_compile the file oglplus/config/cpp/has_THREADS.cpp

when I use command gcc has_THREADS.cpp -Wall -lstdc++ -std=c++11 -pthread, it's OK. So I guess try_compile command is missing pthread lib, and finally it works. (What about Windows platform?)

try_compile( OGLPLUSHAS${FEATURE_NAME} ${PROJECT_BINARY_DIR}/cpp ${PROJECT_BINARYDIR}/cpp/has${FEATURE_NAME}.cpp COMPILE_DEFINITIONS ${OGLPLUS_CPP_STD_COMPILER_SWITCH} LINK_LIBRARIES pthread )

matus-chochlik commented 8 years ago

I pushed some changes on develop. Could You test if that fixes the problem for you?

KAlO2 commented 8 years ago

NO, it fails again.

-- Detecting support for c++ feature 'SCOPED_ENUMS': TRUE -- Detecting support for c++ feature 'SCOPED_ENUM_TEMPLATE_PARAMS': TRUE -- Detecting support for c++ feature 'VARIADIC_MACROS': TRUE -- Detecting support for c++ feature 'VARIADIC_TEMPLATES': TRUE -- Detecting support for c++ feature 'UNIFIED_INITIALIZATION_SYNTAX': TRUE -- Detecting support for c++ feature 'INITIALIZER_LISTS': TRUE -- Detecting support for c++ feature 'DEFAULTED_FUNCTIONS': TRUE -- Detecting support for c++ feature 'DELETED_FUNCTIONS': TRUE -- Detecting support for c++ feature 'EXPLICIT_CONVERSION_OPERATORS': TRUE -- Detecting support for c++ feature 'FUNCTION_TEMPLATE_DEFAULT_ARGS': TRUE -- Detecting support for c++ feature 'UNICODE_LITERALS': TRUE -- Detecting support for c++ feature 'USER_DEFINED_LITERALS': TRUE -- Detecting support for c++ feature 'INHERITED_CONSTRUCTORS': TRUE -- Detecting support for c++ feature 'GENERALIZED_ATTRIBUTES': TRUE -- Detecting support for c++ feature 'TEMPLATE_ALIASES': TRUE -- Detecting support for c++ feature 'CONSTEXPR': TRUE -- Detecting support for c++ feature 'NOEXCEPT': TRUE -- Detecting support for c++ feature 'OVERRIDE': TRUE -- Detecting support for c++ feature 'LAMBDAS': TRUE -- Detecting support for c++ feature 'CHRONO': TRUE -- Detecting support for c++ feature 'THREADS': FALSE -- Could NOT find Boost -- Skipping 'glx_main' because 'THREADS' not implemented properly.