[CMake] Extending CMake
dfeustel at mindspring.com
dfeustel at mindspring.com
Sun Apr 22 13:21:27 EDT 2007
I am trying to create the loadable command described
on page 147 of _Mastering CMake_ ver 2.2.
I have typed in the file cmHELLO_WORLD.c
#include "cmCPluginAPI.h"
static int InitialPass(void *inf, void *mf, int argc, char *argv[])
{
cmLoadedCommandinfo *info = (cmLoadedCommandInfo *)inf;
info->CAPI->AddDefinition(mf, "FOO", "DAR");
return 1;
}
void CM_PLUGIN_EXPORT
HELLO_WORLDInit (cmLoadedCommandInfo *info)
{
info->InitialPass = InitialPass;
info->Name = "HELLO_WORLD";
}
the file CMakeLists.txt
PROJECT (HELLO_WORLD)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}"
"${CMAKE_ANSI_CXXFLAGS}"
)
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}"
"${CMAKE_ANSI_CFLAGS}"
)
INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include
${CMAKE_ROOT}/Source
)
ADD_LIBRARY (cmHELLO_WORLD MODULE cmHELLO_WORLD.c)
When I run ccmake -, it seems to work.
But when I then run make, I get the error message
[100%] Building C object CMakeFiles/cmHELLO_WORLD.dir/cmHELLO_WORLD.o
*** Error code 1
Stop in /home/daf/Cm/Plugin (line 53 of CMakeFiles/cmHELLO_WORLD.dir/build.make).
*** Error code 1
Stop in /home/daf/Cm/Plugin (line 53 of CMakeFiles/Makefile2).
*** Error code 1
Stop in /home/daf/Cm/Plugin (line 66 of Makefile).
Are the source code files for this example available online for download?
Thanks,
Dave Feustel
More information about the CMake
mailing list