[CMake] Add new suffix rules

William A. Hoffman billlist at nycap.rr.com
Mon Apr 17 09:45:18 EDT 2006


At 02:24 PM 4/16/2006, Bill Lorensen wrote:
>I have added a custom command to generate files with extension .clp.
>
>UTILITY_SOURCE(GENERATECLP_EXE GenerateCLP ./ GenerateCLP.cxx)
>MACRO(GENERATECLP XML)
>  # For each XML file
>  FOREACH(FILE ${XML})
>    # what is the filename without the extension
>    GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE)
>        
>    # the input file might be full path so handle that
>    GET_FILENAME_COMPONENT(TMP_FILEPATH ${FILE} PATH)
>
>    # compute the input filename
>    IF (TMP_FILEPATH)
>      SET(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.xml) 
>    ELSE (TMP_FILEPATH)
>      SET(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.xml)
>    ENDIF (TMP_FILEPATH)
>
>    # add custom command to output
>    ADD_CUSTOM_COMMAND(
>      OUTPUT ${TMP_FILENAME}.clp
>          DEPENDS GenerateCLP ${TMP_INPUT}
>          COMMAND ${GENERATECLP_EXE}
>          ${TMP_INPUT} ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.clp
>          )
>    ENDFOREACH(FILE)
>ENDMACRO(GENERATECLP)
>
>GENERATECLP(CLPExample1.xml)
>SET ( CLPEXAMPLE1_SOURCE CLPExample1.cxx CLPExample1.clp
>)
>ADD_EXECUTABLE ( CLPExample1 ${CLPEXAMPLE1_SOURCE})
>TARGET_LINK_LIBRARIES ( CLPExample1 ITKEXPAT)
>
>I get an error message:
>CMake Error: Source file "/home/lorensen/Projects/CommandLineAPI/CLPExample1.clp" has unknown type.

What is a .clp file, and what is supposed to be done with it?

-Bill



More information about the CMake mailing list