Fwd: Re: [Cmake] problems custom target dependencies
Jeongnim Kim
jnkim at ncsa . uiuc . edu
Thu, 06 Nov 2003 13:14:35 -0600
>Date: Thu, 06 Nov 2003 13:11:14 -0600
>To: Andy Cedilnik <andy . cedilnik at kitware . com>
>From: Jeongnim Kim <jnkim at ncsa . uiuc . edu>
>Subject: Re: [Cmake] problems custom target dependencies
>
>Thank you so much. It worked!
>
>I changed few typos and attached the working version below for future
>references.
>------ CMakeList
>PROJECT(Abinit)
>
># list of fotran codes
>SET(FSOURCES recip cpointg speck bzdef bzred inbz listmg symgen pointg
>pgsymo trgsym fccsym bccsym bctsym group1 pgl1 rlv3 atftm1 rot1 symatm
>sort3 spchek trmlen)
>
>
>FOREACH(source ${FSOURCES})
> ADD_CUSTOM_COMMAND(
> OUTPUT ${Abinit_BINARY_DIR}/${source}.o
> DEPENDS ${Abinit_SOURCE_DIR}/${source}.f
> COMMAND g77
> ARGS -c -o ${Abinit_BINARY_DIR}/${source}.o
> ${Abinit_SOURCE_DIR}/${source}.f
> )
> SET(OUTPUTS ${OUTPUTS} ${Abinit_BINARY_DIR}/${source}.o)
>#not used any more
># SET(OUTPUTS_STRING
>"${OUTPUTS_STRING} ${Abinit_BINARY_DIR}/${source}.o")
>ENDFOREACH(source)
>
>ADD_CUSTOM_COMMAND(
> OUTPUT ${Abinit_BINARY_DIR}/libabinit.a
> DEPENDS ${OUTPUTS}
> COMMAND ar
> ARGS cr ${Abinit_BINARY_DIR}/libabinit.a ${OUTPUTS}
> )
>
>ADD_CUSTOM_TARGET(libabinit.a ALL ${CMAKE_COMMAND} -E echo DEPENDS
> ${Abinit_BINARY_DIR}/libabinit.a)
>
>
>
>Best wishes,
>Jeongnim Kim
>
>---------------------------------------------------------------
>Jeongnim Kim e-mail: jnkim at uiuc . edu
>NCSA Tel: 217-244-6319 (NCSA)
>Beckman Institute 217-333-3324 (MCC)
>405 N Mathews Av. Fax: 217-244-2909
>Urbana, IL 61801
>---------------------------------------------------------------
Best wishes,
Jeongnim Kim
---------------------------------------------------------------
Jeongnim Kim e-mail: jnkim at uiuc . edu
NCSA Tel: 217-244-6319 (NCSA)
Beckman Institute 217-333-3324 (MCC)
405 N Mathews Av. Fax: 217-244-2909
Urbana, IL 61801
---------------------------------------------------------------