From d7bf5048877ff270f434607437180519d13ef389 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 23 Apr 2015 19:14:13 -0300 Subject: [PATCH] Fix flags to always compile with libcurl (as HomeView needs net-lib to load news) --- src/CMakeLists.txt | 32 +++++++++++++++++--------------- src/net/CMakeLists.txt | 4 +--- third_party/CMakeLists.txt | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9ca49d6b0..f53b85339 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -154,7 +154,7 @@ if(UNIX) endif() ###################################################################### -# Updater +# Liburl if (CMAKE_USE_PTHREADS_INIT) set(sys_libs ${sys_libs} ${CMAKE_THREAD_LIBS_INIT}) @@ -164,22 +164,24 @@ if(NOT "${CUSTOM_WEBSITE_URL}" STREQUAL "") add_definitions(-DCUSTOM_WEBSITE_URL="${CUSTOM_WEBSITE_URL}") endif() -if(ENABLE_UPDATER) - if(USE_SHARED_CURL) - find_library(LIBCURL_LIBRARY NAMES curl) - find_path(LIBCURL_INCLUDE_DIR NAMES curl/curl.h) +if(USE_SHARED_CURL) + find_library(LIBCURL_LIBRARY NAMES curl) + find_path(LIBCURL_INCLUDE_DIR NAMES curl/curl.h) - set(libs3rdparty ${libs3rdparty} ${LIBCURL_LIBRARY}) - include_directories(${LIBCURL_INCLUDE_DIR}) - else() - set(libs3rdparty ${libs3rdparty} libcurl) - include_directories(${CURL_DIR}/include) - if(CURL_STATICLIB) - add_definitions(-DCURL_STATICLIB) - endif() + set(libs3rdparty ${libs3rdparty} ${LIBCURL_LIBRARY}) + include_directories(${LIBCURL_INCLUDE_DIR}) +else() + set(libs3rdparty ${libs3rdparty} libcurl) + include_directories(${CURL_DIR}/include) + if(CURL_STATICLIB) + add_definitions(-DCURL_STATICLIB) endif() - set(aseprite_libraries ${aseprite_libraries} updater-lib net-lib) + set(aseprite_libraries ${aseprite_libraries} net-lib) +endif() + +if(ENABLE_UPDATER) + set(aseprite_libraries ${aseprite_libraries} updater-lib) add_definitions(-DENABLE_UPDATER) endif() @@ -217,9 +219,9 @@ add_subdirectory(scripting) add_subdirectory(she) add_subdirectory(ui) add_subdirectory(undo) +add_subdirectory(net) if(ENABLE_UPDATER) - add_subdirectory(net) add_subdirectory(updater) endif() diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt index 74542762c..d542dd39a 100644 --- a/src/net/CMakeLists.txt +++ b/src/net/CMakeLists.txt @@ -1,7 +1,5 @@ # ASEPRITE -# Copyright (C) 2001-2013 David Capello - -add_definitions(-DCURL_STATICLIB) +# Copyright (C) 2001-2013, 2015 David Capello add_library(net-lib http_headers.cpp diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index c34340fed..32810af31 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -32,7 +32,7 @@ if(NOT USE_SHARED_GTEST) add_subdirectory(gtest) endif() -if(ENABLE_UPDATER AND NOT USE_SHARED_CURL) +if(NOT USE_SHARED_CURL) set(BUILD_RELEASE_DEBUG_DIRS ON BOOL) add_subdirectory(curl) endif()