[CMake] [CMAKE] setting list with different directories ?
Maxime Lecourt
maxime.lecourt at gmail.com
Wed Jun 1 05:18:50 EDT 2011
Hello,
I'm having what is probably a newbie problem, but a problem to me.
I have C source files in two different directories, that I use to build a
dll, that is loaded by another C++ project.
I tried to build C objects and link with C++
set_target_properties(ppc PROPERTIES LINK_FLAGS "-Wl,--kill-at"
LINKER_LANGUAGE "CXX")
but I have linker problem (undefined references) when trying to link my C++
project.
So I decided to build my library as C++ and not C.
I thought about setting language properties of my source files as CXX, so it
would compile as C++, but did not work.
set(ppc_sources
"operators.c"
"iss_types.c"
"iss_vars.c"
"iss_fetch.c"
"iss_instr.c"
"iss_decode.c"
"iss_mem.c"
"emul.c"
"iss_code.c"
"../extern/loader.c"
"../extern/system.c"
"../extern/exception.c"
"../extern/random.c"
"../extern/sys_call.c"
"../extern/dump.c"
)
set_source_files_properties(TARGET ${ppc_sources} PROPERTY LANGUAGE "CXX")
I tried that, which did not work, so I tried to add the files in extern
directory by first finding them with find_file. I found the files, added
them to the ppc_source list, but now have problems changing properties of
the files in current directory (either that or extern files are skipped at
compilation).
What is the right way to do ?
Regards,
Maxime Lecourt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110601/210ccc4c/attachment.htm>
More information about the CMake
mailing list