Added cmake dyncall dependency search

This commit is contained in:
Snaipe 2015-09-03 18:20:17 +02:00
parent 06e87bf592
commit d8668e3ed8
3 changed files with 38 additions and 3 deletions

View file

@ -0,0 +1,31 @@
# Copyright (C) 2015 Franklin "Snaipe" Mathieu.
# Redistribution and use of this file is allowed according to the terms of the MIT license.
# For details see the LICENSE file distributed with Criterion.
# - Find dyncall
# Find the native libcsptr headers and libraries.
#
# DYNCALL_INCLUDE_DIRS - where to find smart_ptr.h, etc.
# DYNCALL_LIBRARIES - List of libraries when using libcsptr.
# DYNCALL_FOUND - True if libcsptr has been found.
# Look for the header file.
FIND_PATH(DYNCALL_INCLUDE_DIR dyncall.h)
# Look for the library.
FIND_LIBRARY(DYNCALL_LIBRARY NAMES dyncall_s)
# Handle the QUIETLY and REQUIRED arguments and set DYNCALL_FOUND to TRUE if all listed variables are TRUE.
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DYNCALL DEFAULT_MSG DYNCALL_LIBRARY DYNCALL_INCLUDE_DIR)
# Copy the results to the output variables.
IF(DYNCALL_FOUND)
SET(DYNCALL_LIBRARIES ${DYNCALL_LIBRARY})
SET(DYNCALL_INCLUDE_DIRS ${DYNCALL_INCLUDE_DIR})
ELSE(DYNCALL_FOUND)
SET(DYNCALL_LIBRARIES)
SET(DYNCALL_INCLUDE_DIRS)
ENDIF(DYNCALL_FOUND)
MARK_AS_ADVANCED(DYNCALL_INCLUDE_DIRS DYNCALL_LIBRARIES)

View file

@ -42,6 +42,7 @@ CHECK_LIBRARY_EXISTS(rt clock_gettime "time.h" HAVE_CLOCK_GETTIME)
find_package(PCRE)
find_package(Libcsptr REQUIRED)
find_package(Dyncall REQUIRED)
# List sources and headers
@ -118,12 +119,14 @@ if (LIBINTL_LIB_FOUND)
target_link_libraries(criterion ${LIBINTL_LIBRARIES})
endif()
if (DYNCALL_FOUND)
target_link_libraries(criterion ${DYNCALL_LIBRARIES})
endif()
if (COVERALLS)
coveralls_setup("${SOURCE_FILES}" ${COVERALLS_UPLOAD})
endif()
target_link_libraries(criterion dyncall_s)
install(FILES ${INTERFACE_FILES} DESTINATION include/criterion)
install(TARGETS criterion
RUNTIME DESTINATION bin

View file

@ -28,10 +28,11 @@ install:
# Hack to make git think it is on the tip of the repo branch
- 'git checkout -B %APPVEYOR_REPO_BRANCH%'
# Install dependencies
- 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; .ci/install-dyncall.sh; true"'
- 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; .ci/install-dyncall.sh; true"'
- 'bash -lc "cd $APPVEYOR_BUILD_FOLDER; .ci/install-libcsptr.sh -G \"MSYS Makefiles\"; true"'
# We need to manually make since the above command somehow crashes
- 'cd dependencies/libcsptr/build && make && make install && cd ../../../'
- 'cd dependencies/dyncall/build && make && make install && cd ../../../'
# Configure project
- 'mkdir build && cd build'
- 'cmake -DCMAKE_INSTALL_PREFIX=criterion-%APPVEYOR_REPO_TAG_NAME% -DCMAKE_PREFIX_PATH="%LOCAL_INSTALL%" -DCOVERALLS=ON -DCMAKE_BUILD_TYPE=Debug -G "MSYS Makefiles" ..'