Re: [CMake] simple program, os x library archive error, linux no issues
sorry, it seems that I replyed to the wrong thread... -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] multi core project
OK, thanks. But somehow complicated. I wonder If I couldn't (miss)use the UPDATE_COMMAND for this. Can I use a macro as UPDATE_COMMAND? My CMakeLists.txt looks like that right now: include(ExternalProject) SET(subprojects "core0" "core1" "core2") foreach(MYPROJ ${subprojects}) ExternalProject_Add( ${MYPROJ} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${MYPROJ} CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/MyToolChain.cmake UPDATE_COMMAND "" INSTALL_COMMAND "" ) ExternalProject_Add_Step(${MYPROJ} rescan COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/${MYPROJ}/CMakeLists.txt DEPENDEES forcebuild DEPENDERS build ALWAYS 1 ) ExternalProject_Add_Step(${MYPROJ} forcebuild COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BUILD_DIR}/${MYPROJ}-prefix/src/${MYPROJ}-stamp/${MYPROJ}-build DEPENDEES configure DEPENDERS rescan ALWAYS 1 ) endforeach(MYPROJ) I tried to play a little bit around with the prefix dir to make this a little bit more sens full, but not a real success so far. Any better Idea? Next I need to link the Outputs of the three cores together. Can I somehow automatically get the targets from each subproject? I also like to improve the "touch" thing for my globbing procedure, but maybe I will discuss this separately in an other thread. thanks Arne -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] simple program, os x library archive error, linux no issues
OK, thanks. But somehow complicated. I wonder If I couldn't (miss)use the UPDATE_COMMAND for this. Can I use a macro as UPDATE_COMMAND? My CMakeLists.txt looks like that right now: include(ExternalProject) SET(subprojects "core0" "core1" "core2") foreach(MYPROJ ${subprojects}) ExternalProject_Add( ${MYPROJ} SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${MYPROJ} CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/MyToolChain.cmake UPDATE_COMMAND "" INSTALL_COMMAND "" ) ExternalProject_Add_Step(${MYPROJ} rescan COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_SOURCE_DIR}/${MYPROJ}/CMakeLists.txt DEPENDEES forcebuild DEPENDERS build ALWAYS 1 ) ExternalProject_Add_Step(${MYPROJ} forcebuild COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BUILD_DIR}/${MYPROJ}-prefix/src/${MYPROJ}-stamp/${MYPROJ}-build DEPENDEES configure DEPENDERS rescan ALWAYS 1 ) endforeach(MYPROJ) I tried to play a little bit around with the prefix dir to make this a little bit more sens full, but not a real success so far. Any better Idea? Next I need to link the Outputs of the three cores together. Can I somehow automatically get the targets from each subproject? I also like to improve the "touch" thing for my globbing procedure, but maybe I will discuss this separately in an other thread. thanks Arne -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] multi core project
Dear all, I just tried to use the ExternalProject_Add for this multicore project, having different separate camke projects for each core Now I have 2 Problems: 1.) with the ExternalProject_Add and a given source dir it seams that my external projects are not rebuild if I made some changes there. Is there some nice way to rebuild the exeternal project all the time? This is how I call the External Project now: ExternalProject_Add( CORE0 SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/core0 CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/MyToolChain.cmake UPDATE_COMMAND "" INSTALL_COMMAND "" ) 2.) Since there is some code generation involved which produces a number of randomly named c files I have to use a globbing function to get all source files. This inherits, that before each build, I have to call "make rebuild_cache", in order to scan for these new C files. (Is ther maybe a smarter way to do this?) So I have to include also this step within the build, I tried ExternalProject_Add_Step, but so far I couldn't get it running make in the dir. Any suggestion for me? -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] multi core project
Dear all, I am using cmake for an embedded environment where I now have to add multi core support. In this case I have a Controller with up to 4 different cores! There is for example one core dedicated for fast peripheral access, one core for with additional dsp instructions and so on. For 3 Controllers I can use the same C Compiler, but with different Compiler Options, for the 4th core I even have to involve a different Compiler. What I see so far for this controllers are the use of hand made makefiles. Lets say there are four source directories, with more or less independent makefiles, later the output files are merged. (btw. does anyone know an elf merging tool? So far I use a very simple approach based on libelf, producing an hex file) Finally all these Cores are accessing the same flash area, and I need one final executable after my build process. Since there is a big dependency between the cores and code reallocation between the cores will happen quite often in the future, I want to treat everything as one project. So basically in cmake I need target dependent compiler options and toolchains. Does anyone have an Idea how to setup this with cmake in a smart way? regards Arne -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] specifying two (cross)compilers
Hello everyone, I have a project (for embedded controllers) where I have to use 2 different compilers for 2 targets. The output of the first target is included in to the elf-output of the second one. src_1/* -> 1.elf src_2/* -> 2.elf + 1.elf Currently I use this procedure with a hand written makefile, and now I want to switch to cmake, but I don't know how to specify a second compiler in camke. (I think both compilers have to be forced). I can use one major CmakeLists.txt and creating subprojects, which each of its own CMakelists.txt, but then I have no dependency, (src_2 just can be build when src_1 is has finished). I also want, that if I just modify src_1 (and I call make just from that source) src_2 is rebuild afterwards. Any Idea what might be the best solution for that? -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] cmake -E remove xx*, wildcards win32?
Hello, I am trying to use cmake for a cross platform project. I want to delete some files using cmake -E remove file* This works on an linux system, but on an windows system wildcards are not working, I just can delete files using their explicit name. In my case the file names are not known, since they have a date coded into it. Any Idea? regards Arne ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] ADD_CUSTOM_COMMAND, crating file with echo redirection, platform independent
Hello, I need a custom command in my build process. The tool that I am using has a small problem, I have to insert a line of code in the output file manually: #include I tried this with echo and output redirection: echo "#include " > images.c The tool, gdk-pixbuf-csource, is not able to generate a file, therefor its output has to be redirected to the file too: gdk-pixbuf-csource --raw pix1 ./images/pix1.png >> images.c I can get it work one linux and win32 system, but with different syntax: This works on a win32 System: ADD_CUSTOM_COMMAND (OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/images.c COMMAND ${CMAKE_COMMAND} -E echo "\#include " > images.c COMMAND gdk-pixbuf-csource --raw pix1 ./images/pix1.png >> images.c DEPENDS ./images/pix1.png ) This works on a linux System: ADD_CUSTOM_COMMAND (OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/images.c COMMAND echo "\"""#include""" "\"" > images.c COMMAND gdk-pixbuf-csource --raw pix1 ./images/pix1.png >> images.c DEPENDS ./images/pix1.png ) I tried many variations of above examples, but I can't get running on both systems with the same syntax, any idea what might be right? Perhaps there is another way then "echo" to write something in a file, I tried FILE(WRITE) but I failed with this. I could make a file with the include line already inserted and than try to copy it, I saw some commands for that, is this the better Way? Actually I don't prefer this, I don't want to have a strange single-line source file in the project. regards Arne ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] "rule" to generate assembler listings for each c file
Hi Luca, thank you for the idea, I will try it. It looks if this could help me, even if I don't understand every command in detail. I think I wouldn't have brought this out with reading the docs. best regards Arne Luca Cappa schrieb: Hi Arne, I think this cmake script shows what you need to do to add a compiler flag for each source file. It adds a dummy flag "/flagadded:FILE_NAME" for each source file according to its name. project(flags_per_file) cmake_minimum_required(VERSION 2.6) set(SOURCES x1.c x2.c x3.c) add_executable(executable ${SOURCES}) foreach(FILE ${SOURCES}) set_source_files_properties (${FILE} PROPERTIES COMPILE_FLAGS "/flagadded:${FILE}") message("${FILE} -->> /flagadded:${FILE}") endforeach(FILE in ${SOURCES}) ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] "rule" to generate assembler listings for each c file
> Are you sure you really need that ? > If you enter "make help" in the directory of your target, you will see that > there are also rules for building the object files foo.o and also for just > generating the assembler files (foo.s). > I.e. you can manually enter "make ...path/foo.s" and this will produce the > assembler file for you so you can look at it. > > From my experience this is the typical use case: if something goes wrong, look > at the assembler file of the file in question and check whether it makes > sense. Do you need it for something else ? Well, with the compiler Flags I will not have just an assembler file *.s, then I have a list file with more debug information like high level language comments, symbols an so on. But you are right, at the moment I have always a list file of the last changed file, I can control it easily with a dummy change. I didn't know the make help target, thank you for that hint. But the solution Luca suggest looks very interesting, I will try it out and look if it works. Best regards Arne ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
[CMake] "rule" to generate assembler listings for each c file
Hello, I try to use cmake for crosscompiling an embedded project with arm-elf-gcc. For a simple project, a CMakeLists.txt like this works fine for me: cmake_minimum_required(VERSION 2.6) SET(CMAKE_SYSTEM_NAME Generic) SET(CMAKE_C_COMPILER arm-elf-gcc) SET (CMAKE_SHARED_LINKER_FLAGS_INIT "") SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") SET (CMAKE_C_FLAGS "-O3 -g3 -Wall -L lib -mcpu=cortex-m3 -mthumb") SET (CMAKE_EXE_LINKER_FLAGS "-mcpu=cortex-m3 -mthumb -nostartfiles -T link.ld") add_executable (../test.elf startup.c main.c foo.c) TARGET_LINK_LIBRARIES (../test.elf ${CMAKE_CURRENT_SOURCE_DIR}/lib/bar.a) For debugging, I want gcc to export assembler listings for each c-file it compiles. This can be done with adding -Wa,-ahl=file.lst to the C-Flags SET (CMAKE_C_FLAGS "-O9 -g3 -Wall -L lib -mcpu=cortex-m3 -mthumb" -Wa,-ahl=file.lst) But this is not exactly what I want, instead of file.lst I want that "file" is replaced with the filename which make is currently processing. The result should be foo.lst while processing foo.c and main.lst for main.c. I know how I can solve it with make, but I have no idea how I could tell this to cmake. I found CMAKE_CURRENT_LIST_FILE, but I don't know if it helps me. Has anyone an Idea? Best Regards Arne ___ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake