[cmake-developers] [CMake 0012919]: Wrong include path passed to nasm

Mantis Bug Tracker mantis at public.kitware.com
Mon Jan 30 06:02:59 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://cmake.org/Bug/view.php?id=12919 
====================================================================== 
Reported By:                Cédric OCHS
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12919
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-01-30 06:02 EST
Last Modified:              2012-01-30 06:02 EST
====================================================================== 
Summary:                    Wrong include path passed to nasm
Description: 
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


Steps to Reproduce: 
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.

Additional Information: 
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

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-01-30 06:02 Cédric OCHS    New Issue                                    
======================================================================




More information about the cmake-developers mailing list