[CMake] Directory includes during assembling
Hi I new to CMake and trying to create a build system that uses a custom toolchain. So far I managed to get most of it working but have a small problem with some assembling. I have added this code to the toolchain file: find_program(CMAKE_ASM_COMPILER NAMES armasm PATHS ${CSR_SYNERGY_ARM_PATH_BIN}) set (ARM_PROCESSOR "--cpu ARM1176JZ-S --fpu SoftVFP+VFPv2") set (CMAKE_ASM_FLAGS_INIT "--predefine \"BDB SETA 2\"") set (CMAKE_ASM_COMPILE_OBJECT " -g --keep ${ARM_PROCESSOR} --apcs /interwork --no_unaligned_access -o ") The problem is the parameter inserts all the include directories as "DIR1" "DIR2" and not -I"DIR1" -I"DIR2". Does there exists some rule that defines how include directories are turned into ? Regards Martin Nielsen Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom ___ 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] Excluded from build
Does CMake allow to exclude from build some files but include them in the list of project like Visual Studio or NetBeans? Cheers ___ 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] Excluded from build
On 13. Oct, 2010, at 10:52 , Andrea Galeazzi wrote: > Does CMake allow to exclude from build some files but include them in the > list of project like Visual Studio or NetBeans? > Cheers Try this: set_source_files_properties(src1.c src2.c src3.c PROPERTIES HEADER_FILE_ONLY TRUE) Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken PGP.sig Description: This is a digitally signed message part ___ 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] Excluded from build
Not sure about files inside a typical target, but you can add a custom target that does nothing but has your desired files listed as sources. (Also, if you are looking to list files that aren't something that CMake knows should be compiled, like a text file/readme, configs, etc, those can just be included in the list of sources for any target no problem) Hope this helps! Ryan - Original message - Does CMake allow to exclude from build some files but include them in the list of project like Visual Studio or NetBeans? Cheers ___ 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 ___ 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] *.c compiled with C compiler after clearing CMAKE_C_SOURCE_FILE_EXTENSIONS
On Tuesday 12 October 2010, Jed Brown wrote: > On Tue, Oct 12, 2010 at 15:33, Michael Wild wrote: > > set(SRCS src1.c src2.c src3.c) > > set_source_files_properties(${SRCS} PROPERTIES LANGUAGE CXX) > > add_executable(strange_beast ${SRCS}) > > I can do that, but what's the point of the extension-based mapping if you > have to set properties by file? Is the observed behavior a functional bug > (should have worked) or a documentation bug? CMAKE__SOURCE_FILE_EXTENSIONS is used quite early in the enable-language process, i.e. when the CMakeFiles/CMakeCompiler.cmake file is generated. If the variable is changed after that happened, it doesn't have an effect anymore. Alex ___ 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] Directory includes during assembling
On Wednesday 13 October 2010, Martin Nielsen wrote: > Hi > > > > I new to CMake and trying to create a build system that uses a custom > toolchain. So far I managed to get most of it working but have a small > problem with some assembling. > > I have added this code to the toolchain file: > > > > find_program(CMAKE_ASM_COMPILER NAMES armasm PATHS > ${CSR_SYNERGY_ARM_PATH_BIN}) > > set (ARM_PROCESSOR "--cpu ARM1176JZ-S --fpu SoftVFP+VFPv2") > > set (CMAKE_ASM_FLAGS_INIT "--predefine \"BDB SETA 2\"") > > set (CMAKE_ASM_COMPILE_OBJECT " -g --keep > ${ARM_PROCESSOR} --apcs /interwork --no_unaligned_access -o > ") > > > > The problem is the parameter inserts all the include directories > as "DIR1" "DIR2" and not -I"DIR1" -I"DIR2". Does there exists some rule > that defines how include directories are turned into ? > Did you try the following ? SET(CMAKE_INCLUDE_FLAG_ASM "-I") Alex ___ 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] how to get cmake and custom qt widget to work?
On Tuesday 05 October 2010, e...@cs.bgu.ac.il wrote: > the project's one? > I've copied the hpp and cpp files into one of my src dirs. > still not compiling Don't use file(GLOB ...) to collect your source files. Use explicit set(GUI_SRCS a.cpp b.cpp ...) calls. This avoids problems like wrong files getting picked up or new files not getting picked up. Alex ___ 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] How to rename the resulting Makefile.
Nevertheless, I think may be you did not fully read my answer (unless I'm wrong) but you CAN call [part of] your home made makefile rules ** FROM THE SEPARATE CMAKE BUILD ** I read it, I just did not get it, being a newbie and all.:-) But, I see now. if you add some extra CMake lines like the following: add_custom_target(save COMMAND ${CMAKE_MAKE_PROGRAM} save WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMENT "Home brewed make save target") The previous line will create in the CMake generated makefile a rule which when invoked will call your makefile rule (same name) in the source tree. I leave my existing makefiles in the source tree and CMake will create the build Makefiles in the out-of-source area. In this way they will not step on my existing makefiles. Then, simple targets in the CMake makefiles can be used to run the real targets in my existing makefile (which live in the source area.) Very clever. Bill ___ 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] How to rename the resulting Makefile.
On 13. Oct, 2010, at 23:31 , william.croc...@analog.com wrote: > >> Nevertheless, >> I think may be you did not fully read my answer (unless I'm wrong) >> but you CAN call [part of] your home made makefile rules >> ** FROM THE SEPARATE CMAKE BUILD ** > > I read it, I just did not get it, being a newbie and all.:-) > But, I see now. > >> if you add some extra CMake lines like the following: >> add_custom_target(save >>COMMAND ${CMAKE_MAKE_PROGRAM} save >>WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} >>COMMENT "Home brewed make save target") >> The previous line will create in the CMake generated makefile >> a rule which when invoked will call your makefile rule >> (same name) in the source tree. >> > > I leave my existing makefiles in the source tree and CMake will > create the build Makefiles in the out-of-source area. > In this way they will not step on my existing makefiles. > > Then, simple targets in the CMake makefiles can be used > to run the real targets in my existing makefile (which live > in the source area.) > > Very clever. > > Bill But please, put something like this in your CMakeLists.txt: # detect symlink trickery get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) # prevent in-source builds if("${srcdir}" STREQUAL "${bindir}") message(FATAL_ERROR "In-source builds are forbidden!") endif() Otherwise it is all too easy to shoot yourself in the foot! Michael -- There is always a well-known solution to every human problem -- neat, plausible, and wrong. H. L. Mencken PGP.sig Description: This is a digitally signed message part ___ 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