diff --git a/CMakeLists.txt b/CMakeLists.txt index cf16db8d91..faf3a59f6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,12 +82,14 @@ if( WIN32 ) set(CRYPTO_LIB) - #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") + 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) diff --git a/libraries/plugins/elasticsearch/CMakeLists.txt b/libraries/plugins/elasticsearch/CMakeLists.txt index f4815576d2..ce9c7c1d1d 100644 --- a/libraries/plugins/elasticsearch/CMakeLists.txt +++ b/libraries/plugins/elasticsearch/CMakeLists.txt @@ -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" ) 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 diff --git a/libraries/plugins/es_objects/CMakeLists.txt b/libraries/plugins/es_objects/CMakeLists.txt index 92e3d15020..42d18a6580 100644 --- a/libraries/plugins/es_objects/CMakeLists.txt +++ b/libraries/plugins/es_objects/CMakeLists.txt @@ -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 diff --git a/libraries/utilities/CMakeLists.txt b/libraries/utilities/CMakeLists.txt index 98086b1059..4311ef46cb 100644 --- a/libraries/utilities/CMakeLists.txt +++ b/libraries/utilities/CMakeLists.txt @@ -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) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4f3476448d..b863c6347e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -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")