zhangjiacool / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

CMake generator should use ${CMAKE_CURRENT_SOURCE_DIR} instead of ${CMAKE_SOURCE_DIR} #416

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If you include the gyp-generated CMakeLists.txt to a larger CMake project, it 
fails to compile properly because ${CMAKE_SOURCE_DIR} is not the gyp project 
directory, but the top level CMake project directory. Replacing 
${CMAKE_SOURCE_DIR} with ${CMAKE_CURRENT_SOURCE_DIR} fixes the problem. 
However, I'm not sure if this is intentional.

The same applies to ${CMAKE_BINARY_DIR} and ${CMAKE_CURRENT_BINARY_DIR}, but 
that doesn't cause build failures, it just generates files in the wrong 
directories.

Original issue reported on code.google.com by lalinsky on 14 Mar 2014 at 8:31

GoogleCodeExporter commented 9 years ago
I'm also hitting this issue. Patch attached.

Original comment by tomtheen...@gmail.com on 2 Sep 2014 at 11:30

Attachments: