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

CMake does not generate "toFloat.h" with Ninja #94

Closed
ghost opened this issue Apr 19, 2014 · 10 comments
Closed

CMake does not generate "toFloat.h" with Ninja #94

ghost opened this issue Apr 19, 2014 · 10 comments
Labels
Build A problem with building or installing the library.

Comments

@ghost
Copy link

ghost commented Apr 19, 2014

On Windows. Can someone check that?

ninja: error: 'C:/Users/Constantine/Desktop/openexr/IlmBase/Half/toFloat.h', needed
by 'Half/CMakeFiles/Half.dir/half.cpp.obj', missing and no known rule to make it
@ghost
Copy link
Author

ghost commented Apr 19, 2014

Is there a way to manually generate all the needed files?

@ghost
Copy link
Author

ghost commented Apr 19, 2014

I figure it out. Still a workaround, though.

cd IlmBase/Half/
g++ eLut.cpp -o eLut && ./eLut > eLut.h
g++ toFloat.cpp -o toFloat && ./toFloat > toFloat.h
*compile IlmBase*
cd OpenEXR/IlmImf/
g++ b44ExpLogTable.cpp -o b44ExpLogTable -pthread -I../../IlmBase/Half/ ../../IlmBase/Half/libHalf.a ../../IlmBase/Iex/libIex-2_1.a ../../IlmBase/IlmThread/libIlmThread-2_1.a
./b44ExpLogTable > b44ExpLogTable.h
./b44ExpLogTable > ../b44ExpLogTable.h

@ghost ghost changed the title CMake does not generate "toFloat.h" on Windows CMake does not generate "toFloat.h" with Ninja May 25, 2014
@francis-brissette
Copy link

francis-brissette commented Jan 16, 2018

I have the same issue with Ninja on Window:

cd openexr\IlmBase
mkdir build
cd build
cmake .. -G Ninja
cmake --build .

Output:
ninja: error: 'Half/toFloat.h', needed by 'Half/CMakeFiles/Half.dir/half.cpp.obj', missing and no known rule to make it

Anyone have a fix?

@TheRealJokerMan
Copy link

Anyone managed to get this working?

@francis-brissette
Copy link

francis-brissette commented Feb 5, 2018

@ZeroCrunch ,

In openexr/IlmBase/Half/CMakeLists.txt, I updated the code to the followin:g:

...
SET_SOURCE_FILES_PROPERTIES(
  half.cpp
  PROPERTIES
  OBJECT_DEPENDS
  toFloat
  OBJECT_DEPENDS
  eLut
  )

IF(BUILD_SHARED_LIBS)
    ADD_DEFINITIONS(-DHALF_EXPORTS)
ENDIF()

ADD_LIBRARY ( Half ${LIB_TYPE}
  half.cpp
  )

INSTALL ( TARGETS
  Half
  DESTINATION
  lib
)
...

It worked on my side.

Cheers,
Francis

@meshula
Copy link
Contributor

meshula commented Feb 5, 2018

This looks like the correct fix to me - it would be a good PR.

@TheRealJokerMan
Copy link

@francis-brissette,

What worked for me in the end was:

PROPERTIES
OBJECT_DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/toFloat.h;${CMAKE_CURRENT_BINARY_DIR}/eLut.h"

@francis-brissette
Copy link

@meshula, will you take care of this bug & fix?

@meshula
Copy link
Contributor

meshula commented May 1, 2018

@ZeroCrunch @francis-brissette This fix is on the develop branch, thanks Jamie!

@cary-ilm
Copy link
Member

cary-ilm commented Jul 4, 2019

Looking into the backlog of open OpenEXR issues. This seems to have been resolved in the v2.3.0 release.
Closing the issue for now, feel free to re-open or file a new issue if you need further help.

@cary-ilm cary-ilm closed this as completed Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build A problem with building or installing the library.
Projects
None yet
Development

No branches or pull requests

5 participants