[CMake] nasm and TRY_COMPILE problem

William A. Hoffman billlist at nycap.rr.com
Thu Mar 2 16:59:03 EST 2006


At 04:08 PM 3/2/2006, you wrote:
>Am Donnerstag März 2 2006 20:39 schrieb William A. Hoffman:
>> I found the problem with your example and checked in a fix into CVS.
>> The try_compile command was not sending the value of CMAKE_MOUDLE_PATH
>> into the try compile project.
>
>Thanks! It works now. Is there a way to check for the CMake Version pasing the 
>CMakeLists.txt file? I implemented a work-around for 2.2, as I don't want to 
>rely on the user fetching a cvs cmake.

When 2.4 comes out you can have a 
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
At the top of your cmakelist file.


>> IF(NOT CMAKE_ASM_LINK_EXECUTABLE)
>>   IF(UNIX)
>>     SET(CMAKE_ASM_LINK_EXECUTABLE
>>        "<CMAKE_ASM_COMPILER> -f elf <FLAGS> -o <TARGET> <OBJECTS>")
>>   ELSE(UNIX)
>>     SET(CMAKE_ASM_LINK_EXECUTABLE
>>        "<CMAKE_ASM_COMPILER> -f win32 -DWIN32 <FLAGS> -o <TARGET> <OBJECTS>
>> ") ENDIF(UNIX)
>> ENDIF(NOT CMAKE_ASM_LINK_EXECUTABLE)
>
>No this won't work, as nasm is only a compiler and not a linker. The the test 
>will alwas return fals. I just set SET(CMAKE_ASM_LINK_EXECUTABLE "") and this 
>does the trick. Is there a way to tell CMake that nasm cannot link?

OK, then this should be 
link -o <TARGET> <OBJECTS>
and 
ld -o <TARGET> <OBJECTS>

I think it would be safe to say that a linker should be around for ASM files.

-Bill




More information about the CMake mailing list