# yue.nicholas@gmail.com

ADD_EXECUTABLE ( eLut eLut.cpp )

ADD_CUSTOM_COMMAND (
  TARGET eLut POST_BUILD
  COMMAND eLut > ${CMAKE_SOURCE_DIR}/eLut.h
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/Half
)
SET_SOURCE_FILES_PROPERTIES(
  ${CMAKE_SOURCE_DIR}/eLut.h
  PROPERTIES HEADER_FILE_ONLY TRUE
  )

ADD_EXECUTABLE ( toFloat toFloat.cpp )
ADD_CUSTOM_COMMAND (
  TARGET toFloat POST_BUILD
  COMMAND toFloat > ${CMAKE_SOURCE_DIR}/toFloat.h
  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
SET_SOURCE_FILES_PROPERTIES(
  ${CMAKE_SOURCE_DIR}/toFloat.h
  PROPERTIES HEADER_FILE_ONLY TRUE
  )

SET_SOURCE_FILES_PROPERTIES(
  half.cpp
  PROPERTIES
  OBJECT_DEPENDS
  ${CMAKE_SOURCE_DIR}/eLut.h
  OBJECT_DEPENDS
  ${CMAKE_SOURCE_DIR}/toFloat.h
  )

ADD_LIBRARY ( Half STATIC
  half.cpp
  )


ADD_DEPENDENCIES ( Half toFloat eLut )

INSTALL ( TARGETS
  Half
  DESTINATION
  lib
)

INSTALL ( FILES 
  half.h
  halfFunction.h
  halfLimits.h
  DESTINATION
  include/OpenEXR
)

# yue.nicholas@gmail.com

ADD_EXECUTABLE ( eLut eLut.cpp )

ADD_CUSTOM_COMMAND (
  TARGET eLut POST_BUILD
  COMMAND eLut > ${CMAKE_CURRENT_SOURCE_DIR}/eLut.h
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
SET_SOURCE_FILES_PROPERTIES(
  ${CMAKE_SOURCE_DIR}/eLut.h
  PROPERTIES HEADER_FILE_ONLY TRUE
  )

ADD_EXECUTABLE ( toFloat toFloat.cpp )
ADD_CUSTOM_COMMAND (
  TARGET toFloat POST_BUILD
  COMMAND toFloat > ${CMAKE_CURRENT_SOURCE_DIR}/toFloat.h
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
SET_SOURCE_FILES_PROPERTIES(
  ${CMAKE_SOURCE_DIR}/toFloat.h
  PROPERTIES HEADER_FILE_ONLY TRUE
  )

SET_SOURCE_FILES_PROPERTIES(
  half.cpp
  PROPERTIES
  OBJECT_DEPENDS
  ${CMAKE_SOURCE_DIR}/eLut.h
  OBJECT_DEPENDS
  ${CMAKE_SOURCE_DIR}/toFloat.h
  )

ADD_LIBRARY ( Half STATIC
  half.cpp
  )


ADD_DEPENDENCIES ( Half toFloat eLut )

INSTALL ( TARGETS
  Half
  DESTINATION
  lib
)

INSTALL ( FILES 
  half.h
  halfFunction.h
  halfLimits.h
  DESTINATION
  include/OpenEXR
)

Fix eLut.h and toFloat.h header generation location
Fix eLut.h and toFloat.h header generation location
