Skip to content

Commit

Permalink
Added prefixes for zlib and hdf5 to avoid conflicts with other python…
Browse files Browse the repository at this point in the history
… libraries
  • Loading branch information
willyd committed Oct 14, 2016
1 parent a172f51 commit a36427d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build_v120_x64.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
:: Use shared libraries when possible
cmake -G Ninja ^
-D CB_BUILD_ALL:BOOL=ON ^
-D ZLIB_LIB_PREFIX:STRING=caffe ^
-D ZLIB_BUILD_SHARED_LIBS:BOOL=ON ^
-D GFLAGS_BUILD_SHARED_LIBS:BOOL=ON ^
-D GLOG_BUILD_SHARED_LIBS:BOOL=ON ^
-D HDF5_BUILD_SHARED_LIBS:BOOL=ON ^
-D HDF5_LIB_PREFIX:STRING=caffe ^
-D BOOST_BUILD_SHARED_LIBS:BOOL=ON ^
-D LEVELDB_BUILD_SHARED_LIBS:BOOL=OFF ^
-D LMDB_BUILD_SHARED_LIBS:BOOL=OFF ^
Expand Down
2 changes: 2 additions & 0 deletions build_v140_x64.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ call "%VS140COMNTOOLS%..\..\VC\vcvarsall.bat" amd64
:: Use shared libraries when possible
cmake -G Ninja ^
-D CB_BUILD_ALL:BOOL=ON ^
-D ZLIB_LIB_PREFIX:STRING=caffe ^
-D ZLIB_BUILD_SHARED_LIBS:BOOL=ON ^
-D GFLAGS_BUILD_SHARED_LIBS:BOOL=ON ^
-D GLOG_BUILD_SHARED_LIBS:BOOL=ON ^
-D HDF5_BUILD_SHARED_LIBS:BOOL=ON ^
-D HDF5_LIB_PREFIX:STRING=caffe ^
-D BOOST_BUILD_SHARED_LIBS:BOOL=ON ^
-D LEVELDB_BUILD_SHARED_LIBS:BOOL=OFF ^
-D LMDB_BUILD_SHARED_LIBS:BOOL=OFF ^
Expand Down
6 changes: 3 additions & 3 deletions packages/zlib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
option(BUILD_${PROJECT_NAME_UPPER} "Build ${PROJECT_NAME}" ${CB_BUILD_ALL})
option(${PROJECT_NAME_UPPER}_BUILD_SHARED_LIBS "Build shared libraries for ${PROJECT_NAME}" ${BUILD_SHARED_LIBS})
set(${PROJECT_NAME_UPPER}_LIB_PREFIX "" CACHE STRING "Library to prefix the binaries with to avoid name conflicts on windows")

set(${PROJECT_NAME_UPPER}_CMAKE_ARGS -DZLIB_TARGET_NAME_PREFIX=${${PROJECT_NAME_UPPER}_LIB_PREFIX})
if(BUILD_${PROJECT_NAME_UPPER})

# TODO handle the case where we don't have release and debug
Expand Down Expand Up @@ -34,14 +34,13 @@ set(ZLIB_LIBRARY_RELEASE \${CMAKE_CURRENT_LIST_DIR}/lib/${_rel_lib} CACHE FILEP

include(ExternalProject)

message(WARNING "Add patch to allow specifying prefix")

ExternalProject_Add(
${PROJECT_NAME}_download
URL https://github.com/madler/zlib/archive/v1.2.8.tar.gz
URL_MD5 1eabf2698dc49f925ce0ffb81397098f
DOWNLOAD_NAME ${PROJECT_NAME}-v1.2.8.tar.gz
DOWNLOAD_DIR ${CB_DOWNLOAD_DIR}
PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/patches/CMakeLists.txt.in CMakeLists.txt
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
Expand All @@ -65,6 +64,7 @@ set(ZLIB_LIBRARY_RELEASE \${CMAKE_CURRENT_LIST_DIR}/lib/${_rel_lib} CACHE FILEP
-DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
-DCMAKE_MODULE_PATH=${CB_CMAKE_MODULE_PATH}
-DCMAKE_DEBUG_POSTFIX=d
${${PROJECT_NAME_UPPER}_CMAKE_ARGS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${_config}
)
list(APPEND ${PROJECT_NAME}_targets ${PROJECT_NAME}_${_config_lower})
Expand Down

0 comments on commit a36427d

Please sign in to comment.