Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve dependency issue building eLut.h/toFloat.h with CMake/Ninja. #142

Merged
merged 1 commit into from
Jul 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions IlmBase/Half/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# yue.nicholas@gmail.com

ADD_EXECUTABLE ( eLut eLut.cpp )

ADD_CUSTOM_COMMAND (
TARGET eLut POST_BUILD
COMMAND eLut > ${CMAKE_CURRENT_BINARY_DIR}/eLut.h
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/eLut.h
COMMAND eLut ARGS > ${CMAKE_CURRENT_BINARY_DIR}/eLut.h
DEPENDS eLut
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_CURRENT_BINARY_DIR}/eLut.h
PROPERTIES HEADER_FILE_ONLY TRUE
)

ADD_EXECUTABLE ( toFloat toFloat.cpp )
ADD_CUSTOM_COMMAND (
TARGET toFloat POST_BUILD
COMMAND toFloat > ${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
COMMAND toFloat ARGS > ${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
DEPENDS toFloat
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
PROPERTIES HEADER_FILE_ONLY TRUE
Expand All @@ -27,9 +28,7 @@ SET_SOURCE_FILES_PROPERTIES(
half.cpp
PROPERTIES
OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/eLut.h
OBJECT_DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/toFloat.h
"${CMAKE_CURRENT_BINARY_DIR}/eLut.h;${CMAKE_CURRENT_BINARY_DIR}/toFloat.h"
)

IF(BUILD_SHARED_LIBS)
Expand Down