From 41d558b4ad4a99bc92a28d991e53f00916f8d1fa Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Wed, 11 Nov 2015 16:31:30 +0100 Subject: [PATCH] windows build fixes --- .gitmodules | 3 +++ CMakeLists.txt | 20 ++++++++++++++++++++ src/ext/openexr | 2 +- src/ext/zlib | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) create mode 160000 src/ext/zlib diff --git a/.gitmodules b/.gitmodules index d5ac942c5b..b2dc2edefc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "src/ext/openexr"] path = src/ext/openexr url = https://github.com/wjakob/openexr +[submodule "src/ext/zlib"] + path = src/ext/zlib + url = https://github.com/mitsuba-renderer/zlib diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b2a755f44..a7aa72e383 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,18 @@ ELSE() ) ENDIF() +IF(WIN32) + # Build zlib (only on Windows) + SET(ZLIB_BUILD_STATIC_LIBS ON CACHE BOOL " " FORCE) + SET(ZLIB_BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE) + ADD_SUBDIRECTORY(src/ext/zlib) + + SET(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/ext/zlib") + SET(ZLIB_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/src/ext/zlib/$/zlibstatic.lib") + SET_PROPERTY(TARGET zlibstatic PROPERTY FOLDER "dependencies") + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/src/ext/zlib") +ENDIF() + SET(ILMBASE_NAMESPACE_VERSIONING OFF CACHE BOOL " " FORCE) SET(OPENEXR_NAMESPACE_VERSIONING OFF CACHE BOOL " " FORCE) SET(OPENEXR_BUILD_SHARED_LIBS OFF CACHE BOOL " " FORCE) @@ -218,6 +230,14 @@ ADD_LIBRARY ( pbrt STATIC ${PBRT_SOURCE} ) +IF (WIN32) + # Avoid a name clash when building on Visual Studio + SET_TARGET_PROPERTIES ( pbrt + PROPERTIES + OUTPUT_NAME libpbrt + ) +ENDIF() + FIND_PACKAGE ( Threads ) # Main renderer diff --git a/src/ext/openexr b/src/ext/openexr index 0d5873da81..5a7d765fcf 160000 --- a/src/ext/openexr +++ b/src/ext/openexr @@ -1 +1 @@ -Subproject commit 0d5873da81f47ae0fa4fe85b71200cd631aaeaa3 +Subproject commit 5a7d765fcf9dd229df80bdc87cdca001b108b507 diff --git a/src/ext/zlib b/src/ext/zlib new file mode 160000 index 0000000000..54d591eabf --- /dev/null +++ b/src/ext/zlib @@ -0,0 +1 @@ +Subproject commit 54d591eabf9fe0e84c725638f8d5d8d202a093fa