[CMake] explain usage of CMAKE_CONFIGURATION_TYPES

2019-01-22 Thread hex
good afternoon, I am following the CMake book to learn about CMake. I have trouble to follow chapter 3: build configurations (https://riptutorial.com/cmake/example/26702/setting-a-release-debug-configuration) In this part it is not very clear why these configurations are used, and how they

[CMake] can I use cmake in parallel with Eclipse IDE?

2019-01-26 Thread hex
hello, I want to use CMake as my primary build system. At some point I would like to take advantage of the tools provided by IDEs, such as stepping through code. I know I can use CMake to generate an eclipse project, or use Eclipse to generate a CMake project. My doubt is whether these

Re: [CMake] further configuration of generated projects outside of CMake?

2019-03-13 Thread hex
I see now the generators are part of CMake sources on gitlab... that answers my questions. thank you, Zan Lynx. On March 11, 2019 6:03:24 PM MDT, hex wrote: Another question, I didn't know there is a generator for sublime text 2: https://cmake.org/cmake/help/latest/generator/Sublime

Re: [CMake] further configuration of generated projects outside of CMake?

2019-03-12 Thread hex
is already configured for the standard build targets normally used. If I had a new build target at some point, like `make doxygen` I'd probably edit the project manually and add it. On 12/03/19 03:00, Zan Lynx wrote: On March 11, 2019 6:03:24 PM MDT, hex wrote: hi everyone, There are many

[CMake] further configuration of generated projects outside of CMake?

2019-03-11 Thread hex
hi everyone, There are many generators supported in CMake. A CMake build system allows me to generate the preferred build environment for everyone, visual studio, eclipse, ninja you name it. The problem I see with this is that projects are generated output files, and even if that gives

[CMake] Dependee "DependInfo.cmake" is newer than depender "depend.internal".

2019-02-06 Thread hex
hello community, During compilation, cmake shows the information message *Dependee "DependInfo.cmake" is newer than depender "depend.internal".* to explain why a file needs to be recompiled. imediately after *    -- Build files have been written to: ./build** **    /usr/bin/cmake -H.

[CMake] undefined reference to `_exit'

2019-02-01 Thread hex
hello, I am trying to include a static library that contains the startup code for ARM processor to my  CMake project for cross compilation. I included the linker script and added it to the executable. Flags and include files are properly set in the CMake build output. The path to the

Re: [CMake] undefined reference to `_exit'

2019-02-04 Thread hex
dear community, This question has originally been placed in another community [1]. I did read the mailing list netiquette before posting here but I was not aware this behaviour is discouraged. Therefore, I want to apologize. Good etiquette is important, I am grateful for any advice on how I

[CMake] Language Dependency for TCL?

2019-05-16 Thread hex
hello, I am setting up a TCL project so I disabled all language variables: *cmake_minimum_required(VERSION 2.4)** ** **project(P LANGUAGES NONE)** **find_package(TCL)* however, this fails with *-- Could NOT find TCL (missing: TCL_LIBRARY) ** **-- Could NOT find TCLTK (missing: TCL_LIBRARY

[CMake] hiding targets from cmake build?

2019-05-29 Thread hex
In cmake mark_as_advanced will not display variables in any of the cmake GUIs unless the show advanced option is on. I wonder if there is an equivalent for build targets? I have a bunch of custom_targets custom_a, custom_b, custom_c, ... which all depend on custom_all I don't want all

[CMake] install multiple versions of CMake on your system

2019-06-23 Thread hex
hello, I'd like to install CMake under /usr/local/cmake/3.15/bin/ or similar. Is it possible to add the version number to a build option, like -DCMAKE_INSTALL_PREFIX or do I need to modify CMake sources? thank you -- Powered by www.kitware.com Please keep messages on-topic and check the

Re: [CMake] c++2a

2019-05-09 Thread hex
ummh, sooo... h, do you like... cheese? On 5/9/19 7:21 AM, Stefan Fendt wrote: Am 07.05.2019 um 20:37 schrieb Angel Campoverde: Next time please ask what computer I am using. *What*? Really? *Please* give this a second thought... Stefan -- Powered by www.kitware.com Please keep messages

Re: [CMake] Language Dependency for TCL?

2019-05-18 Thread hex
I didn't know about Tclsh. I see now it is part of TCL. This is useful, thank you. Probably because the following isn't properly set if you don't enable a language: CMAKE_FIND_LIBRARY_SUFFIXES CMAKE_FIND_LIBRARY_PREFIXES You could probably just use "find_package(Tclsh)" to just find the

Re: [CMake] transitive linkage of OBJECT library targets

2019-05-22 Thread hex
Without cycling dependencies you can do something like this: /add_executable(test_object_lib_nesting main.cpp)// // //target_link_libraries(test_object_lib_nesting// //    second_object_lib// //    first_object_lib// //)/ The problem I have that the linker command line will have only the

[CMake] optional parameters in add_custom_target?

2019-05-20 Thread hex
The function is defined as *add_custom_target(Name [ALL] [command1 [args1...]]** **   [COMMAND command2 [args2...] ...]** **   [DEPENDS depend depend depend ... ]** **   [BYPRODUCTS [files...]]** **   [WORKING_DIRECTORY dir]** **   [COMMENT comment]** **   [VERBATIM] [USES_TERMINAL]** **  

[CMake] cmake doesn't run all tests

2019-05-21 Thread hex
hello, I have two modules in my CMake project: /root// //├── foo// //│   ├── CMakeLists.txt// //│   ├── src// //│   │   └── foo.c// //│   └── tests// //│   ├── foo_unit_test.c// //│   └── CMakeLists.txt// //├── CMakeLists.txt// //└── moo// //    ├── CMakeLists.txt// //    ├── src// //   

Re: [CMake] cmake doesn't run all tests

2019-05-21 Thread hex
hello Eric, Some of my recent changes prevented my function to add a build target. It was building either one or the other but not both. Therefore, half of the tests where missing. You are right it is working correctly now. thank you for your patience. This should work at least it

[CMake] how to fetch a git submodule for a build target?

2019-05-07 Thread hex
hello, I am using the following command to add a git submodule to an existing repository: add_custom_command(OUTPUT fetch   COMMAND git submodule add https://github.com/user/repo.git ) add_custom_target(new DEPENDS fetch) This is working as intended. Adding an already existing

Re: [CMake] CMake with two C++ compilers

2019-05-08 Thread Hex
set the compiler for each build: set(COMPILER /opt/gcc/bin) cmake_force_c_compiler( "${COMPILER}gcc" GNU) cmake_force_cxx_compiler("${COMPILER}g++" GNU) -- Sent from: http://cmake.3232098.n2.nabble.com/ -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at:

[CMake] CMake guidelines and design patterns - recommendations?

2019-07-11 Thread hex
hello community, Does anyone have a book recommendation for modern CMake with focus on design patterns? thank you -- 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] how to set current source directory relative to external project

2019-07-09 Thread hex
hello CMake community, I am experimenting with external projects. I have some files in an external project which are generated in `${CMAKE_SOURCE_DIR}`. When I add the external project, however, it is using `${CMAKE_SOURCE_DIR}` of the external project. I need `${CMAKE_SOURCE_DIR}` to

[CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
hello CMake community, I am experimenting with external projects. I have documentation in an external project which is generated in `${CMAKE_CURRENT_SOURCE_DIR}`. When I add the external project, however, it is using `${CMAKE_CURRENT_SOURCE_DIR}` of the "super build". I need

Re: [CMake] externalproject fails on submodule

2019-07-08 Thread hex
there was a merge conflict on the submodule. Fixing the issue resolved the problem. -- 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

Re: [CMake] modify cmake build arguments

2019-08-30 Thread Hex
thank you this is exactly what I am looking for. It is working well. From the documentation: «It is loaded after CMake’s builtin compiler and platform information modules have been loaded but before the information is used.» since CMakeCInformation.cmake: # compile a C file into an object file

Re: [CMake] modify cmake build arguments

2019-08-30 Thread hex
(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m)/ with: /list(APPEND CMAKE_C_SOURCE_FILE_EXTENSIONS c;m )/ ? On 30/08/2019 12:41, hex wrote: I am still facing a problem: The build step is skipped only the link step is performed (I missed that in the beginning). It seems like the build step does not have any dependencies

Re: [CMake] modify cmake build arguments

2019-08-30 Thread hex
I am still facing a problem: The build step is skipped only the link step is performed (I missed that in the beginning). It seems like the build step does not have any dependencies. This is because different file extension are used. I cannot set CMAKE_C_SOURCE_FILE_EXTENSIONS because I

Re: [CMake] modify cmake build arguments

2019-08-30 Thread hex
thank you this is exactly what I am looking for. It is working well. From the documentation: «It is loaded after CMake’s builtin compiler and platform information modules have been loaded but before the information is used.» since CMakeCInformation.cmake: # compile a C file into an object

[CMake] Fwd: modify cmake build arguments

2019-08-30 Thread hex
thank you this is exactly what I am looking for. It is working well. From the documentation: «It is loaded after CMake’s builtin compiler and platform information modules have been loaded but before the information is used.» since CMakeCInformation.cmake: # compile a C file into an object

[CMake] modify cmake build arguments

2019-08-29 Thread hex
hello community, CMake builds a C project with /gcc -o target_name/. I have a compiler very similar to GCC and I am trying configure CMake C language for it. The compiler does not support the -o argument when linking objects. I wonder if there is a way to remove or modify this argument,

[CMake] import objects to CMake

2019-07-23 Thread hex
hello community, Following an example on the usage of IMPORTED_OBJECTS from the book "Professional CMake" I receive the following error: /Error evaluating generator expression:// // //    $// // //  Expression did not evaluate to a known generator expression/ I wonder if there is a mistake

[CMake] relative path to toolchain does not work

2019-07-17 Thread hex
I specified my toolchain like so: 1|cmake -DCMAKE_TOOLCHAIN_FILE=myToolchain.cmake .. |// and created a toolchain file in|project/myToolchain.cmake|. Using relative path CMake first looks relative to the top of the build directory, then if not found there, relative to the top of the source

[CMake] question about version details in source code

2019-07-17 Thread hex
hello community, I am receiving a|fatal error: foobar_version.h: No such file or directory|for|foobar_version.h|. The reason is that the source file is generated in|${CMAKE_CURRENT_BINARY_DIR}/foobar_version.cpp|while the header file is in|${CMAKE_CURRENT_SOURCE_DIR}|as seen here:

Re: [CMake] relative path to toolchain does not work

2019-07-19 Thread hex
? The toolchain file is ignored once CMake has run and has done compiler detection. On Wed, Jul 17, 2019 at 11:29 AM hex wrote: I specified my toolchain like so: 1cmake -DCMAKE_TOOLCHAIN_FILE=myToolchain.cmake .. and created a toolchain file in project/myToolchain.cmake. Using relative path CMake

[CMake] add my own language-name using standard functions

2019-07-19 Thread hex
dear community, I want to make a module for a language that is not supported by CMake. are there any restrictions in using *add_executable* for any language other than C / C++, must the build be constructed very similar to C language? I was looking into Java module for reference and noted

[CMake] file dependency not working in external projects

2019-09-24 Thread hex
hello, I have a problem with a build step. The following command is run every time somefile changes: add_custom_command( OUTPUT out.put     COMMAND touch out.put     DEPENDS somefile.txt ) add_custom_target( sometarget DEPENDS out.put ) I move this snippet inside an external project (with

Re: [CMake] file dependency not working in external projects

2019-09-24 Thread hex
are expected to modify something the external project’s build depends on in a way that is not detectable via the step target dependencies (e.g. |SOURCE_DIR| is used without a download method and developers might modify the sources in |SOURCE_DIR|). Am 24.09.19 um 15:23 schrieb hex: hello

[CMake] externalproject fails on submodule

2019-07-08 Thread hex
hello CMake community, I am using a private git repository with SSH URL with two different git remote server. The repository on github is using an git submodule on bitbucket. /include( ExternalProject )// // //ExternalProject_Add(test// //    GIT_REPOSITORY

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
thank you J Decker for your reply. Your suggestion does work but I want to preserve standalone use of the project, meaning that I want a reference to CMake source root directory. Assuming there is only 1 hierarchy I could add an option: if ( SUPERBUILD ) /message("${CMAKE_SOURCE_DIR}/.. =

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
On 09/07/2019 18:25, J Decker wrote: On Tue, Jul 9, 2019 at 9:38 AM hex <mailto:hex...@gmail.com>> wrote: I think the better solution now is to make it relative to build directory and force out of source builds. +1 I think; You said it was generated?  It should be in

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
I don't know what sorts of files those are; they don't exist but they get created, they're not tracked, and not installed... They sounds like a build product, which is a target, (even it it's just part of a product, it's still a target) Exactly, these are mostly BYPRODUCTS, but also OUTPUT

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread hex
>   Except for my generators well, to be exact it's not /except for/ . I am using multiple generators which means multiple copies of build targets. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware

Re: [CMake] how to set current source directory relative to external project

2019-07-09 Thread Hex
When I use CMAKE_BINARY_DIR the problem remains. If I set( EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin ) in my external project the binary is placed in build/ext1-prefix/src/ext1-build/bin/. Wouldn't it be better to have all my binaries in a single location? Such as build/bin/ ? The only way

[CMake] Dependencies of an external project

2019-11-19 Thread hex
I have an external CMake project that gets exported on install. The root project uses it as a package. The external project must be installed prior being used as a package. I can solve this problem by using `ExternalProject` for both projects and declare their dependency. My setup is

[CMake] build step is not thread-safe for CMake

2020-02-10 Thread hex
hello, My build step is not thread-safe (the instruction in the COMMAND part). Every build step depends on one source file: /add_custom_command(// //    DEPENDS on_source.file// //    OUTPUT// //    object_file_for_source_file// //    COMMAND not-thread-safe-compiler