Skip to content

Commit

Permalink
Merge branch 'feature/CMake' of github.com:shogun-toolbox/shogun into…
Browse files Browse the repository at this point in the history
… feature/CMake
  • Loading branch information
vigsterkr committed Jun 12, 2013
2 parents 8e4822e + 7ea22c3 commit e4dbc7b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ IF (LZO_FOUND)
SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${LZO_LIBS})
ENDIF()

FIND_PACKAGE(Spinlock)
IF (SPINLOCK_FOUND)
SET(USE_SPINLOCKS 1)
LIST(APPEND DEFINES -DUSE_SPINLOCKS)
ENDIF()

# set DEFINES for defintions
add_definitions(${DEFINES})

Expand Down
11 changes: 11 additions & 0 deletions cmake/FindSpinlock.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

SET(_bindir "${CMAKE_MODULE_PATH}/")
TRY_COMPILE(HAVE_SPINLOCK "${_bindir}" "${CMAKE_MODULE_PATH}/spinlock-test.cpp")

if (HAVE_SPINLOCK)
MESSAGE(STATUS "Spinlock support found")
SET(SPINLOCK_FOUND TRUE)
else (HAVE_SPINLOCK)
MESSAGE(STATUS "Spinlock support not found")
SET(SPINLOCK_FOUND FALSE)
endif (HAVE_SPINLOCK)
6 changes: 6 additions & 0 deletions cmake/spinlock-test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <pthread.h>

int main()
{
pthread_spinlock_t spinlock;
}

0 comments on commit e4dbc7b

Please sign in to comment.