Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
OXPHOS authored and vigsterkr committed Jul 14, 2016
1 parent 2a48c50 commit c36f10a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -590,6 +590,14 @@ IF (LAPACK_FOUND AND NOT (DARWIN AND RModular))
ENDIF()
ENDIF()

FIND_PACKAGE(Cereal)
IF(NOT CEREAL_FOUND)
include(external/Cereal)
LIST(APPEND INCLUDES ${CEREAL_INCLUDE_DIRS})
ELSE()
LIST(APPEND INCLUDES ${CEREAL_INCLUDE_DIRS})
ENDIF()

FIND_PACKAGE(GLPK)
IF (GLPK_FOUND)
SET(USE_GLPK 1)
Expand Down
19 changes: 19 additions & 0 deletions cmake/FindCereal.cmake
@@ -0,0 +1,19 @@
# - Try to find Cereal Serialization Library
#
# This sets the following variables:
# CEREAL_FOUND - True if Cereal was found.
# CEREAL_INCLUDE_DIRS - Directories containing the Cereal include files.

find_path(CEREAL_INCLUDE_DIR cereal
HINTS "$ENV{CMAKE_SOURCE_DIR}/include" "/usr/include" "$ENV{CMAKE_BINARY_DIR}/cereal/include")

set(CEREAL_INCLUDE_DIRS ${CEREAL_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Cereal DEFAULT_MSG CEREAL_INCLUDE_DIR)

mark_as_advanced(CEREAL_INCLUDE_DIR)

if(CEREAL_FOUND)
MESSAGE(STATUS "Found Cereal: ${CEREAL_INCLUDE_DIRS}")
endif(CEREAL_FOUND)
14 changes: 14 additions & 0 deletions cmake/external/Cereal.cmake
@@ -0,0 +1,14 @@
include(ExternalProject)
ExternalProject_Add(
Cereal
PREFIX ${CMAKE_BINARY_DIR}/Cereal
DOWNLOAD_DIR ${THIRD_PARTY_DIR}/Cereal
URL https://github.com/USCiLab/cereal/archive/v1.1.2.tar.gz
URL_MD5 34d4ad174acbff005c36d4d10e48cbb9
CMAKE_ARGS -DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}${CMAKE_DEFINITIONS}
-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}${CMAKE_DEFINITIONS}
INSTALL_COMMAND ""
)

SET(CEREAL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/Cereal/src/Cereal/include)
LIST(APPEND SHOGUN_DEPENDS Cereal)

0 comments on commit c36f10a

Please sign in to comment.