[Cmake] Using SET_TARGET_PROPERTIES LINK_FLAGS

Ian Scott ian.m.scott at stud.man.ac.uk
Wed, 25 Feb 2004 18:46:27 -0000




> From: Andy Cedilnik [mailto:andy.cedilnik at kitware.com]
...
> I just tried and it works fine. The question is are you doing
> it in the
> same CMakeLists.txt as you define target?
Yes

I've replicated my problem in the CMake/Example

C:\TEMP>cvs -q co -d Example CMake/Example
U Example/CMakeLists.txt
U Example/Demo/CMakeLists.txt
U Example/Demo/demo.cxx
U Example/Demo/demo_b.cxx
U Example/Hello/CMakeLists.txt
U Example/Hello/hello.cxx
U Example/Hello/hello.h

C:\TEMP>cat >> Example/Hello/CMakeLists.txt
SET_TARGET_PROPERTIES(Hello PROPERTIES LINK_FLAGS "WIBBLE")

C:\TEMP>more Example\Hello\CMakeLists.txt
# Create a library called "Hello" which includes the source file
"hello.cxx".
# The extension is already found.  Any number of sources could be listed
here.
ADD_LIBRARY(Hello hello.cxx)
SET_TARGET_PROPERTIES(Hello PROPERTIES LINK_FLAGS "WIBBLE")

C:\TEMP>mkdir bin

C:\TEMP>cd bin

C:\TEMP\bin>cmake ..\Example
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Configuring done
-- Generating done

C:\TEMP\bin>grep -r WIBBLE *

C:\TEMP\bin>grep WIBBLE Hello\Hello.dsp

It hasn't inserted WIBBLE into the dsp file (or anywhere else.)
I must be doing something wrong here.

Thanks for your help,
Ian.