diff options
Diffstat (limited to 'cmake/CMakeLists.txt')
-rw-r--r-- | cmake/CMakeLists.txt | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 02bba4c9..d36292df 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -8,11 +8,11 @@ if (MSVC) option(ZLIB "Build with zlib support" OFF) endif (MSVC) +add_definitions(-DGOOGLE_PROTOBUF_CMAKE_BUILD) + find_package(Threads REQUIRED) if (CMAKE_USE_PTHREADS_INIT) - set(HAVE_PTHREAD 1) -else (CMAKE_USE_PTHREADS_INIT) - set(HAVE_PTHREAD 0) + add_definitions(-DHAVE_PTHREAD) endif (CMAKE_USE_PTHREADS_INIT) if (MSVC) @@ -36,6 +36,10 @@ else (MSVC) endif (ZLIB_FOUND) endif (MSVC) +if (HAVE_ZLIB) + add_definitions(-DHAVE_ZLIB) +endif (HAVE_ZLIB) + if (MSVC) if (BUILD_SHARED_LIBS) add_definitions(-DPROTOBUF_USE_DLLS) @@ -43,10 +47,11 @@ if (MSVC) add_definitions(/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305) endif (MSVC) -include(find_hash_map.cmake) - -configure_file(config.h.in config.h) -configure_file(pbconfig.h.in google/protobuf/stubs/pbconfig.h) +if (MSVC) + string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR}) + string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR}) + configure_file(extract_includes.bat.in extract_includes.bat) +endif (MSVC) get_filename_component(protobuf_source_dir ${protobuf_SOURCE_DIR} PATH) @@ -67,6 +72,7 @@ endif (MSVC) include(libprotobuf-lite.cmake) include(libprotobuf.cmake) include(libprotoc.cmake) +include(protoc.cmake) if (BUILD_TESTING) - include(protoc.cmake) + include(tests.cmake) endif (BUILD_TESTING) |