Skip to content

Commit

Permalink
move logic to main CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjatlanta committed Jul 29, 2019
1 parent be417d3 commit 98bd37e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Expand Up @@ -29,6 +29,19 @@ list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
include(CheckCCompilerFlag)
include(Utils)

# function to help with cUrl
macro(FIND_CURL)
if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
set (OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_package(CURL REQUIRED)
list(APPEND CURL_LIBRARIES ssl crypto)
set (CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
else (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(CURL REQUIRED)
endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
endmacro()

# Fortify source
if (CMAKE_COMPILER_IS_GNUCXX)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
Expand Down
11 changes: 2 additions & 9 deletions libraries/plugins/elasticsearch/CMakeLists.txt
Expand Up @@ -3,15 +3,8 @@ file(GLOB HEADERS "include/graphene/elasticsearch/*.hpp")
add_library( graphene_elasticsearch
elasticsearch_plugin.cpp
)
if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
set (OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_package(CURL REQUIRED)
list(APPEND CURL_LIBRARIES ssl crypto)
set (CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
else (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(CURL REQUIRED)
endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)

find_curl()

include_directories(${CURL_INCLUDE_DIRS})
if(MSVC)
Expand Down
10 changes: 1 addition & 9 deletions libraries/plugins/es_objects/CMakeLists.txt
Expand Up @@ -4,15 +4,7 @@ add_library( graphene_es_objects
es_objects.cpp
)

if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
set (OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_package(CURL REQUIRED)
list(APPEND CURL_LIBRARIES ssl crypto)
set (CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
else (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(CURL REQUIRED)
endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_curl()

include_directories(${CURL_INCLUDE_DIRS})
if(CURL_STATICLIB)
Expand Down
10 changes: 1 addition & 9 deletions libraries/utilities/CMakeLists.txt
Expand Up @@ -20,15 +20,7 @@ set(sources
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/git_revision.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp" @ONLY)
list(APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/git_revision.cpp")

if (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
set (OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
set (CMAKE_FIND_LIBRARY_SUFFIXES .a)
find_package(CURL REQUIRED)
list(APPEND CURL_LIBRARIES ssl crypto)
set (CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_SUFFIXES})
else (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_package(CURL REQUIRED)
endif (NOT WIN32 AND NOT APPLE AND CURL_STATICLIB)
find_curl()

include_directories(${CURL_INCLUDE_DIRS})
add_library( graphene_utilities
Expand Down

0 comments on commit 98bd37e

Please sign in to comment.