voxelands/cmake/Modules/FindJthread.cmake

23 lines
721 B
CMake
Raw Normal View History

# Look for jthread, use our own if not found
2013-10-13 15:18:51 +02:00
FIND_PACKAGE(PkgConfig)
pkg_check_modules(PC_JTHREAD QUIET jthread)
FIND_PATH(JTHREAD_INCLUDE_DIR jthread.h
HINTS ${PC_JTHREAD_INCLUDEDIR} ${PC_JTHREAD_INCLUDE_DIRS})
FIND_LIBRARY(JTHREAD_LIBRARY NAMES jthread)
IF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR)
SET( JTHREAD_FOUND TRUE )
ENDIF(JTHREAD_LIBRARY AND JTHREAD_INCLUDE_DIR)
IF(JTHREAD_FOUND)
MESSAGE(STATUS "Found system jthread header file in ${JTHREAD_INCLUDE_DIR}")
MESSAGE(STATUS "Found system jthread library ${JTHREAD_LIBRARY}")
ELSE(JTHREAD_FOUND)
2013-10-13 15:18:51 +02:00
SET(JTHREAD_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/jthread")
SET(JTHREAD_LIBRARY jthread)
MESSAGE(STATUS "Using project jthread library")
ENDIF(JTHREAD_FOUND)