Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: third_party/protobuf/cmake/CMakeLists.txt

Issue 1322483002: Revert https://codereview.chromium.org/1291903002 (protobuf roll). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/protobuf/benchmarks/readme.txt ('k') | third_party/protobuf/cmake/README.md » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 cmake_minimum_required(VERSION 2.8)
2
3 project(protobuf C CXX)
4
5 option(BUILD_TESTING "Build tests" ON)
6 option(BUILD_SHARED_LIBS "Build Shared Libraries" OFF)
7 if (MSVC)
8 option(ZLIB "Build with zlib support" OFF)
9 endif (MSVC)
10
11 add_definitions(-DGOOGLE_PROTOBUF_CMAKE_BUILD)
12
13 find_package(Threads REQUIRED)
14 if (CMAKE_USE_PTHREADS_INIT)
15 add_definitions(-DHAVE_PTHREAD)
16 endif (CMAKE_USE_PTHREADS_INIT)
17
18 if (MSVC)
19 if (ZLIB)
20 set(HAVE_ZLIB 1)
21 find_path(ZLIB_INCLUDE_DIRECTORIES zlib.h ${protobuf_SOURCE_DIR})
22 find_library(ZLIB_LIBRARIES zdll ${protobuf_SOURCE_DIR})
23 else (ZLIB)
24 set(HAVE_ZLIB 0)
25 endif (ZLIB)
26 else (MSVC)
27 find_package(ZLIB)
28 if (ZLIB_FOUND)
29 set(HAVE_ZLIB 1)
30 else (ZLIB_FOUND)
31 set(HAVE_ZLIB 0)
32 # Explicitly set these to empty (override NOT_FOUND) so cmake doesn't
33 # complain when we use them later.
34 set(ZLIB_INCLUDE_DIRECTORIES)
35 set(ZLIB_LIBRARIES)
36 endif (ZLIB_FOUND)
37 endif (MSVC)
38
39 if (HAVE_ZLIB)
40 add_definitions(-DHAVE_ZLIB)
41 endif (HAVE_ZLIB)
42
43 if (MSVC)
44 if (BUILD_SHARED_LIBS)
45 add_definitions(-DPROTOBUF_USE_DLLS)
46 endif (BUILD_SHARED_LIBS)
47 add_definitions(/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd414 6 /wd4305)
48 endif (MSVC)
49
50 if (MSVC)
51 string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR})
52 string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR})
53 configure_file(extract_includes.bat.in extract_includes.bat)
54 endif (MSVC)
55
56 get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH)
57
58 include_directories(
59 ${ZLIB_INCLUDE_DIRECTORIES}
60 ${protobuf_BINARY_DIR}
61 ${protobuf_source_dir}/src)
62
63 if (MSVC)
64 # Add the "lib" prefix for generated .lib outputs.
65 set(LIB_PREFIX lib)
66 else (MSVC)
67 # When building with "make", "lib" prefix will be added automatically by
68 # the build tool.
69 set(LIB_PREFIX)
70 endif (MSVC)
71
72 include(libprotobuf-lite.cmake)
73 include(libprotobuf.cmake)
74 include(libprotoc.cmake)
75 include(protoc.cmake)
76 if (BUILD_TESTING)
77 include(tests.cmake)
78 endif (BUILD_TESTING)
OLDNEW
« no previous file with comments | « third_party/protobuf/benchmarks/readme.txt ('k') | third_party/protobuf/cmake/README.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698