I'm trying to compile a ASM file using cmake 2.6 (patch 4).  I'm running visual 
studio 2008, under 64-bit Vista.  Neither Win32 or x64 build work.

I have a simple test app (attached), with a single CPP file and an asm file.  
My cmakelists.txt looks like this (I have to include the .asm extension on the 
asm file or I will get a "cannot find source file" error):

ENABLE_LANGUAGE(ASM_MASM)
PROJECT(AsmTest)

ADD_EXECUTABLE(AsmTest asmtest AsmTestFunc.asm)

On a win32 VS2008 command prompt the cmake step completes correctly, as shown 
below, and the asm file is added to the project.  But the custom build step for 
the ASM file is completely empty, so the assembler is never run.
C:\testcode\asmtest\cmake_win32>cmake -G "Visual Studio 9 2008" ..
-- Found assembler: C:/Program Files (x86)/Microsoft Visual Studio 
9.0/VC/bin/ml.exe
-- Loaded CMakeASM_MASMInformation - ASM_MASM support is still experimental, 
please report issues
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 
9.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 
9.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio 9.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio 9.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.6)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/testcode/asmtest/cmake_win32

On a x64 command prompt (using the compiler string -G "Visual Studio 9 2008 
Win64"), the result is identical except the cmake command outputs the error 
message "Assembler not found" (I'm guessing it still looking for ML.EXE instead 
of ML64.exe ?).

Any ideas ?  If I want to circumvent the cmake ASM system entirely and use set 
up custom build myself (say associated with .s files), is there a tutorial on 
how to do this (using add_custom_command I assume ?)




_________________________________________________________________
Windows Live Messenger: Happy 10-Year Anniversary—get free winks and emoticons.
http://clk.atdmt.com/UKM/go/157562755/direct/01/
#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>

extern "C" int f(int n);

int _tmain(int argc, _TCHAR* argv[])
{

	int n=f(2);
	printf("%d\n",n);
	return 0;
}

ENABLE_LANGUAGE(ASM_MASM)
PROJECT(AsmTest)

ADD_EXECUTABLE(AsmTest asmtest AsmTestFunc.asm)

; Listing generated by Microsoft (R) Optimizing Compiler Version 15.00.21022.08 

include listing.inc

INCLUDELIB LIBCMT
INCLUDELIB OLDNAMES

PUBLIC  f
; Function compile flags: /Odtp
_TEXT   SEGMENT
n$ = 8
f       PROC
; File c:\testcode\asmtest\testfunc.c
; Line 4
        mov     DWORD PTR [rsp+8], ecx
; Line 5
        mov     eax, DWORD PTR n$[rsp]
        shl     eax, 1
; Line 6
        ret     0
f       ENDP
_TEXT   ENDS
END
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to