[Cmake] CMake confusing library and target name (bug?)

Andy Cedilnik andy.cedilnik at kitware.com
Thu, 18 Mar 2004 08:04:22 -0500


Hi Eric,

I do not thing CMake handles two targets with the same name. Visual
Studio problem, since all targets appear in the same space. Also each
target has some CMake cache values associated with it, which get
overwritten. So, rename lua or lua into something else.

			Andy

On Wed, 2004-03-17 at 16:41, Eric Wing wrote:
> I think I'm having problem with CMake being confused
> between the library name and target target name.
> 
> I'm trying to build the lua executable which is where
> things break.
> 
> The Lua source follows this directory structure:
> src/  <-- Where the core library code exists
>   lib/ <-- Auxilary (utililty) library for Lua
>   lua/  <-- Code for the runtime exe, depends on lua
> and lib
> 
> I place a CMakeLists.txt in each of these directories.
> In src, I create a library called "lua" using:
> ADD_LIBRARY(lua <all_library_source_files_here>)
> 
> Similarly in lib, I create a library called "lualib".
> 
> In the lua executable directory, I do:
> LINK_DIRECTORIES( 
> 	${lua_BINARY_DIR}/src/lib
> 	${lua_BINARY_DIR}/src
> )
> ADD_EXECUTABLE(lua lua.c)  # lua is the name of the
> exe
> TARGET_LINK_LIBRARIES(
> 	lua  # the name of the executable
> 	lualib  # the name of the lualib library
> 	lua  # the name of the lua library
> )
> 
> 
> But when I do as above, I get a long list of ld:
> undefined symbols which should be in the lua library
> during the build.
> 
> If I rename the lua executable to "Lua" (with a
> capital L" i.e. 
> ADD_EXECUTABLE(Lua lua.c)
> TARGET_LINK_LIBRARIES(Lua lualib lua)
> 
> then everything compiles.
> 
> I would like to stay within the standard lua naming
> convention though. This means everything is lowercase
> and follows the above names. Is there a way I can
> prevent CMake from getting confused here?
> 
> Thanks,
> Eric
> 
> 
> 
> _______________________________________________
> Cmake mailing list
> Cmake at www.cmake.org
> http://www.cmake.org/mailman/listinfo/cmake