Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrating cURL into cmake #1329

Merged
merged 2 commits into from Sep 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -81,14 +81,14 @@ if( WIN32 )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )

set(CRYPTO_LIB)

if( MSVC )
#looks like this flag can have different default on some machines.
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")

# Probably cmake has a bug and vcxproj generated for executable in Debug conf. has disabled debug info
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG")

endif ( MSVC )
# On windows tcl should be installed to the directory pointed by setenv.bat script
SET(TCL_INCLUDE_PATH $ENV{TCL_ROOT}/include)
MESSAGE(STATUS "tcl INCLUDE PATH: ${TCL_INCLUDE_PATH}")
Expand Down
2 changes: 1 addition & 1 deletion docs
Submodule docs updated from 00bd50 to bd7209
18 changes: 12 additions & 6 deletions libraries/plugins/elasticsearch/CMakeLists.txt
Expand Up @@ -3,14 +3,20 @@ file(GLOB HEADERS "include/graphene/elasticsearch/*.hpp")
add_library( graphene_elasticsearch
elasticsearch_plugin.cpp
)

target_link_libraries( graphene_elasticsearch graphene_chain graphene_app curl )
target_include_directories( graphene_elasticsearch
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )

find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
if(MSVC)
set_source_files_properties(elasticsearch_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
set_source_files_properties(elasticsearch_plugin.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
endif(MSVC)
if(CURL_STATICLIB)
SET_TARGET_PROPERTIES(graphene_elasticsearch PROPERTIES
COMPILE_DEFINITIONS "CURL_STATICLIB")
endif(CURL_STATICLIB)
target_link_libraries( graphene_elasticsearch graphene_chain graphene_app ${CURL_LIBRARIES} )
target_include_directories( graphene_elasticsearch
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include"
PUBLIC "${CURL_INCLUDE_DIR}" )


install( TARGETS
graphene_elasticsearch
Expand Down
14 changes: 10 additions & 4 deletions libraries/plugins/es_objects/CMakeLists.txt
Expand Up @@ -3,14 +3,20 @@ file(GLOB HEADERS "include/graphene/es_objects/*.hpp")
add_library( graphene_es_objects
es_objects.cpp
)
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
if(CURL_STATICLIB)
SET_TARGET_PROPERTIES(graphene_es_objects PROPERTIES
COMPILE_DEFINITIONS "CURL_STATICLIB")
endif(CURL_STATICLIB)
if(MSVC)
set_source_files_properties(es_objects.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
endif(MSVC)

target_link_libraries( graphene_es_objects graphene_chain graphene_app curl )
target_link_libraries( graphene_es_objects graphene_chain graphene_app ${CURL_LIBRARIES} )
target_include_directories( graphene_es_objects
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )

if(MSVC)
set_source_files_properties(es_objects.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
endif(MSVC)

install( TARGETS
graphene_es_objects
Expand Down
9 changes: 7 additions & 2 deletions libraries/utilities/CMakeLists.txt
Expand Up @@ -19,11 +19,16 @@ 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")

find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
add_library( graphene_utilities
${sources}
${HEADERS} )
target_link_libraries( graphene_utilities fc )
if(CURL_STATICLIB)
SET_TARGET_PROPERTIES(graphene_utilities PROPERTIES
COMPILE_DEFINITIONS "CURL_STATICLIB")
endif(CURL_STATICLIB)
target_link_libraries( graphene_utilities fc ${CURL_LIBRARIES})
target_include_directories( graphene_utilities
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
if (USE_PCH)
Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Expand Up @@ -11,6 +11,7 @@ add_executable( chain_test ${COMMON_SOURCES} ${UNIT_TESTS} )
target_link_libraries( chain_test graphene_chain graphene_app graphene_witness graphene_account_history graphene_elasticsearch graphene_es_objects graphene_egenesis_none fc graphene_wallet ${PLATFORM_SPECIFIC_LIBS} )
if(MSVC)
set_source_files_properties( tests/serialization_tests.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
set_source_files_properties( tests/common/database_fixture.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
endif(MSVC)

file(GLOB PERFORMANCE_TESTS "performance/*.cpp")
Expand Down