[Bf-blender-cvs] [6da8fa6] soc-2014-viewport_fx: More fixes for CMake, MSVC 2013, Windows 8

Jason Wilkins noreply at git.blender.org
Thu Jun 12 03:28:14 CEST 2014


Commit: 6da8fa60f58b458bca12e8655cea11c148e4fc2f
Author: Jason Wilkins
Date:   Mon Jun 9 12:06:28 2014 -0500
https://developer.blender.org/rB6da8fa60f58b458bca12e8655cea11c148e4fc2f

More fixes for CMake, MSVC 2013, Windows 8

The hard-coded path for OpenEXR library should include the -2_1 suffix.

Added /SAFESEH:NO flag to standalone Cycles application so it can link.

The standalone Cycles application needs both debug and optimized versions of the OpenEXR libraries.

===================================================================

M	CMakeLists.txt
M	intern/cycles/app/CMakeLists.txt

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8dd132a..893440e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1169,13 +1169,15 @@ elseif(WIN32)
 			set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
 			set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
 			set(OPENEXR_LIBPATH ${OPENEXR}/lib)
+			set(_openexr_suffix "-2_1")
 			set(OPENEXR_LIBRARIES
-				${OPENEXR_LIBPATH}/Iex.lib
-				${OPENEXR_LIBPATH}/Half.lib
-				${OPENEXR_LIBPATH}/IlmImf.lib
-				${OPENEXR_LIBPATH}/Imath.lib
-				${OPENEXR_LIBPATH}/IlmThread.lib
+				${OPENEXR_LIBPATH}/Iex${_openexr_suffix}.lib
+				${OPENEXR_LIBPATH}/Half.lib # Half doesn't have a suffix?
+				${OPENEXR_LIBPATH}/IlmImf${_openexr_suffix}.lib
+				${OPENEXR_LIBPATH}/Imath${_openexr_suffix}.lib
+				${OPENEXR_LIBPATH}/IlmThread${_openexr_suffix}.lib
 			)
+			unset(_openexr_suffix)
 			endif(NOT OPENEXR_FOUND)
 		endif()
 
diff --git a/intern/cycles/app/CMakeLists.txt b/intern/cycles/app/CMakeLists.txt
index 52806b0..64acedb 100644
--- a/intern/cycles/app/CMakeLists.txt
+++ b/intern/cycles/app/CMakeLists.txt
@@ -20,7 +20,6 @@ set(LIBRARIES
 	cycles_subd
 	cycles_util
 	${BOOST_LIBRARIES}
-	${OPENEXR_LIBRARIES}
 	${OPENGL_LIBRARIES}
 	${CYCLES_GLEW_LIBRARY}
 	${OPENIMAGEIO_LIBRARIES}
@@ -53,14 +52,30 @@ if(WITH_CYCLES_STANDALONE)
 		cycles_xml.cpp
 		cycles_xml.h
 	)
+
+	set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
+	set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /SAFESEH:NO")
+
 	add_executable(cycles ${SRC})
+
 	list(APPEND LIBRARIES ${PLATFORM_LINKLIBS})
 	target_link_libraries(cycles ${LIBRARIES} ${CMAKE_DL_LIBS})
 
+	if(WIN32 AND NOT UNIX AND NOT CMAKE_COMPILER_IS_GNUCC)
+		file_list_suffix(OPENEXR_LIBRARIES_DEBUG "${OPENEXR_LIBRARIES}" "_d")
+		target_link_libraries_debug(cycles "${OPENEXR_LIBRARIES_DEBUG}")
+		target_link_libraries_optimized(cycles "${OPENEXR_LIBRARIES}")
+		unset(OPENEXR_LIBRARIES_DEBUG)
+	else()
+		target_link_libraries(cycles ${OPENEXR_LIBRARIES})
+	endif()
+
 	if(UNIX AND NOT APPLE)
 		set_target_properties(cycles PROPERTIES INSTALL_RPATH $ORIGIN/lib)
 	endif()
+
 	unset(SRC)
+
 endif()
 
 if(WITH_CYCLES_NETWORK)
@@ -75,4 +90,3 @@ if(WITH_CYCLES_NETWORK)
 	endif()
 	unset(SRC)
 endif()
-




More information about the Bf-blender-cvs mailing list