Skip to content

Commit

Permalink
windows build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzel Jakob committed Nov 11, 2015
1 parent 0330a93 commit 41d558b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
20 changes: 20 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/$<CONFIGURATION>/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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ext/openexr
Submodule openexr updated 1 files
+0 −2 CMakeLists.txt
1 change: 1 addition & 0 deletions src/ext/zlib
Submodule zlib added at 54d591

0 comments on commit 41d558b

Please sign in to comment.