[CMake] Add new suffix rules

Lorensen, William E (GE, Research) lorensen at crd.ge.com
Mon Apr 17 09:50:17 EDT 2006


It has C++ code snippets in it. I #include in a C++ program. BTW, my code works for Visual Studio 7. It fails on Borland and linux.

Bill

-----Original Message-----
From: cmake-bounces+lorensen=crd.ge.com at cmake.org
[mailto:cmake-bounces+lorensen=crd.ge.com at cmake.org]On Behalf Of William
A. Hoffman
Sent: Monday, April 17, 2006 9:45 AM
To: Bill Lorensen; cmake at cmake.org
Subject: Re: [CMake] Add new suffix rules


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

_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list