MantisBT - CMake
View Issue Details
0012919CMakeCMakepublic2012-01-30 06:022016-06-10 14:31
Cédric OCHS 
Alex Neundorf 
normalminoralways
closedmoved 
WindowsWindows 7Windows 7 x64
CMake 2.8.7 
 
0012919: Wrong include path passed to nasm
When ASM files are using %include, current CMake configuration for nasm is wrong and we got "Unable to open include file ...".

That's because nasm seems to need a trailing slash/backslash in path after a -I
Create a project with a .asm file which is including another file (%include "nasm.inc" for example), use nasm as ASM compiler with ENABLE_LANGUAGE(ASM_NASM).

Compilation will fail with a "fatal: unable to open include file `nasm.inc'" error.
Output example (without fix):

---
[ 56%] Building ASM_NASM object CMakeFiles/xvidcore.dir/src/bitstream/x86_asm/cb
p_mmx.asm.obj
        C:\Users\kervala\AppData\Local\nasm\nasm.exe -ID:\Neolinks\xvid\src -f win64 -o CMakeFiles\xvidcore.dir\src\bitstream\x86_asm\cbp_mmx.asm.obj D:\Neolinks\xvid\src\bitstream\x86_asm\cbp_mmx.asm
D:\Neolinks\xvid\src\bitstream\x86_asm\cbp_mmx.asm:32: fatal: unable to open include file `nasm.inc'
NMAKE : fatal error U1077: 'C:\Users\kervala\AppData\Local\nasm\nasm.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.exe"' : return code '0x2'
Stop.
---

If I try to launch (notice the backslash after -ID:\Neolinks\xvid\src):

C:\Users\kervala\AppData\Local\nasm\nasm.exe -ID:\Neolinks\xvid\src\ -f win64 -o CMakeFiles\xvidcore.dir\src\bitstream\x86_asm\cbp_mmx.asm.obj D:\Neolinks\xvid\src\bitstream\x86_asm\cbp_mmx.asm

It compiles fine even if you replace backslashes by slashes :)

The current ugly fix I'm using to compile my project is (in CMakeLists.txt):

SET(CMAKE_ASM_NASM_FLAGS_INIT "-I${CMAKE_CURRENT_SOURCE_DIR}/src/")

Please could you fix it ?

Thanks a lot
No tags attached.
Issue History
2012-01-30 06:02Cédric OCHSNew Issue
2012-01-30 06:26Cédric OCHSNote Added: 0028419
2012-02-01 12:13Alex NeundorfAssigned To => Alex Neundorf
2012-02-01 12:13Alex NeundorfStatusnew => assigned
2012-08-13 14:44Alex NeundorfNote Added: 0030578
2012-08-13 14:44Alex NeundorfStatusassigned => backlog
2016-06-10 14:28Kitware RobotNote Added: 0041974
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0028419)
Cédric OCHS   
2012-01-30 06:26   
I also posted a bug report on nasm bugzilla : http://bugzilla.nasm.us/show_bug.cgi?id=3392205 [^]

If the bug is fixed upstream, CMake won't need to be "fixed" :)
(0030578)
Alex Neundorf   
2012-08-13 14:44   
It would be good if this could be fixed upstream.
(0041974)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.