Skip to content

Commit

Permalink
Fix flags to always compile with libcurl (as HomeView needs net-lib t…
Browse files Browse the repository at this point in the history
…o load news)
  • Loading branch information
dacap committed Apr 23, 2015
1 parent 5ced5b2 commit d7bf504
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
32 changes: 17 additions & 15 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ if(UNIX)
endif()

######################################################################
# Updater
# Liburl

if (CMAKE_USE_PTHREADS_INIT)
set(sys_libs ${sys_libs} ${CMAKE_THREAD_LIBS_INIT})
Expand All @@ -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()

Expand Down Expand Up @@ -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()

Expand Down
4 changes: 1 addition & 3 deletions src/net/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d7bf504

Please sign in to comment.