[CMake] JWASM support

2009-01-31 Thread Dmitry Bely
I am trying to use JWASM (http://www.japheth.de/JWasm.html) with CMake
2.6.2 to do rather unusual thing: cross-compile a C++ project with
MASM-syntax .asm files for Linux under Windows. JWASM itself emulates
MASM excellently and has no problem generating COFF or ELF files but
now CMake comes into play.

First of all, I added JWASM config files into CMake:

*** CMakeASM_JWASMInformation.cmake
SET(ASM_DIALECT _JWASM)
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
IF(CMAKE_HOST_WIN32)
  SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT
CMAKE_ASM${ASM_DIALECT}_COMPILER -nologo -coff FLAGS -FoOBJECT
SOURCE)
ELSE(CMAKE_HOST_WIN32)
  SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT
CMAKE_ASM${ASM_DIALECT}_COMPILER -nologo -elf FLAGS -FoOBJECT
SOURCE)
ENDIF(CMAKE_HOST_WIN32)
INCLUDE(CMakeASMInformation)
SET(ASM_DIALECT)

*** CMakeDetermineASM_JWASMCompiler.cmake
# determine the compiler to use for ASM using Intel syntax

SET(ASM_DIALECT _JWASM)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT jwasm)
INCLUDE(CMakeDetermineASMCompiler)
SET(ASM_DIALECT)

*** CMakeTestASM_JWASMCompiler.cmake

# This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected ASM_JWASM compiler can actually compile
# and link the most basic of programs.   If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
SET(ASM_DIALECT _JWASM)
INCLUDE(CMakeTestASMCompiler)
SET(ASM_DIALECT)

and created a project CMakeLists.txt (omitting irrelevant detais):
...
project (TestProject CXX ASM_JWASM)
...
include_directories (
  c:/some/include/dir
)
...
add_library (${CMAKE_PROJECT_NAME} SHARED
test.cpp
test.asm
)

To build a project I used cygwin-compiled cmake as the gcc cross
compiler is also cygwin-compiled (but jwasm is a plain Win32 app).
Now there is a problem. During the build JWASM is invoked (and fails)
the following way:

/cygdrive/c/Util/jwasm.exe  -nologo -elf -DTestProject_EXPORTS
-I/cygdrive/c/some/include/dir -Fo`cygpath -w
CMakeFiles/TestProject.dir/test.asm.o` `cygpath -w
/cygdrive/c/Work/TestProject/test.asm`
Unknown option /cygdrive/c/some/include/dir
-FoCMakeFiles\TestProject.dir\test.asm.o c:\Work\TestProject\test.asm.
Use /? for list of options.

So there are some questions:
1. Why source and target parameters are wrapped with cygpath, but -I
options do not? What part of CMake is responsible for adding these
cygpaths?
2. Does include_directories always affect all compilers? Is it
possible to ignore them for some specific ones?

- Dmitry Bely
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cpack -G DEB for subdirectories

2009-01-31 Thread blinkeye
 You may want to use custom CPack scripts for different purposes. By default,
 CPack uses script generated by CMake in top-level directory, but you can
 write your own one (and as many as you want) and pass it to cpack as command
 line parameter.
 Of course, install components could be great help in packaging.
 

I take it you're talking about the '--config' option. That sounds like a
workaround if it's possible to use/include some globals to reduce the overhead.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake