Skip to content

Commit

Permalink
Cmake now building OpenEXR successfully for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
meshula authored and nickrasmussen committed Aug 8, 2018
1 parent ac76edf commit 9651bb4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 35 deletions.
57 changes: 27 additions & 30 deletions IlmBase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ IF (BUILD_SHARED_LIBS)
ENDIF ()
ENDIF (BUILD_SHARED_LIBS)

IF (WIN32)
SET (RUNTIME_DIR bin)
ELSE ()
SET (RUNTIME_DIR lib)
ENDIF ()

ADD_SUBDIRECTORY ( Half )
ADD_SUBDIRECTORY ( Iex )
Expand Down Expand Up @@ -158,35 +163,26 @@ IF (NAMESPACE_VERSIONING)
SET ( ILMBASE_LIBSUFFIX "-${ILMBASE_VERSION_API}" )
ENDIF ()

SET_TARGET_PROPERTIES ( Half
PROPERTIES
VERSION 12.0.0
SOVERSION 12
)
SET_TARGET_PROPERTIES ( Iex
PROPERTIES
VERSION 12.0.0
SOVERSION 12
OUTPUT_NAME "Iex${ILMBASE_LIBSUFFIX}"
)
SET_TARGET_PROPERTIES ( Imath
PROPERTIES
VERSION 12.0.0
SOVERSION 12
OUTPUT_NAME "Imath${ILMBASE_LIBSUFFIX}"
)
SET_TARGET_PROPERTIES ( IlmThread
PROPERTIES
VERSION 12.0.0
SOVERSION 12
OUTPUT_NAME "IlmThread${ILMBASE_LIBSUFFIX}"
)
SET_TARGET_PROPERTIES ( IexMath
PROPERTIES
VERSION 12.0.0
SOVERSION 12
OUTPUT_NAME "IexMath${ILMBASE_LIBSUFFIX}"
)
SET (ILMBASE_LIBRARY_NAMES Half Iex Imath IlmThread IexMath)
FOREACH (LIBNAME ${ILMBASE_LIBRARY_NAMES})
IF (LIBNAME STREQUAL "Half")
SET(LIBNAMESUFFIX ${LIBNAME})
ELSE()
SET(LIBNAMESUFFIX ${LIBNAME}${ILMBASE_LIBSUFFIX})
ENDIF()
SET_TARGET_PROPERTIES ( ${LIBNAME}
PROPERTIES
VERSION 12.0.0
SOVERSION 12
OUTPUT_NAME "${LIBNAMESUFFIX}"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${RUNTIME_DIR}"
ARCHIVE_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${RUNTIME_DIR}"
)
ENDFOREACH()

IF ( NOT WIN32 )
CREATE_LIBTOOL_FILE ( Half /lib )
Expand All @@ -196,6 +192,7 @@ IF ( NOT WIN32 )
CREATE_LIBTOOL_FILE ( IlmThread /lib )
ENDIF ()


# Tests

ADD_SUBDIRECTORY ( HalfTest )
Expand All @@ -208,7 +205,6 @@ INSTALL ( FILES
${CMAKE_CURRENT_BINARY_DIR}/config/IlmBaseConfig.h
DESTINATION
include/OpenEXR

)

FILE ( WRITE ${CMAKE_BINARY_DIR}/IlmBase.pc "prefix=${CMAKE_INSTALL_PREFIX}\n" )
Expand All @@ -229,3 +225,4 @@ INSTALL ( FILES
DESTINATION
lib/pkgconfig
)

7 changes: 4 additions & 3 deletions IlmBase/Half/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ ADD_LIBRARY ( Half ${LIB_TYPE}
ADD_DEPENDENCIES ( Half toFloat eLut )

INSTALL ( TARGETS
Half
DESTINATION
lib
HALF
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION ${RUNTIME_DIR}
)

INSTALL ( FILES
Expand Down
5 changes: 5 additions & 0 deletions IlmBase/HalfTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@ ADD_EXECUTABLE ( HalfTest

TARGET_LINK_LIBRARIES ( HalfTest Half )

INSTALL ( TARGETS
HalfTest
RUNTIME DESTINATION bin
)

ADD_TEST ( TestHalf HalfTest )
6 changes: 4 additions & 2 deletions IlmBase/Imath/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ TARGET_LINK_LIBRARIES(Imath Iex)

INSTALL ( TARGETS
Imath
DESTINATION
lib
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION ${RUNTIME_DIR}
)


INSTALL ( FILES
ImathBoxAlgo.h
ImathBox.h
Expand Down
6 changes: 6 additions & 0 deletions IlmBase/ImathTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ ADD_EXECUTABLE ( ImathTest
testVec.cpp
)

INSTALL ( TARGETS
ImathTest
RUNTIME DESTINATION bin
)


ADD_TEST ( TestImath ImathTest )
TARGET_LINK_LIBRARIES ( ImathTest Imath Iex )

0 comments on commit 9651bb4

Please sign in to comment.