[CMake] CMake How to check target for build
Hi everyone, It is a copy of question in http://stackoverflow.com/ questions/43858722/cmake-how-to-check-target-for-build I am interesting in analog of *MAKECMDGOALS *in* Makefile *. For example if I use the following code for build *:* /home/username/Software/clion-2017.1.1/bin/cmake/bin/cmake --build /home/username/Projects/cppTests/cmake-build-debug --target cppTests -- -j 8 How can I check in *CMake* file target name that specified by: --target cppTests Does *CMake* have such possibility ? *Thanks,* *Best RegardsDenis Kotov* -- 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://public.kitware.com/mailman/listinfo/cmake
[CMake] RPATH for external library
Hello. I'm trying to make CMake add to the linker RPATH automatically. There is a library that is installed in a non-default location. I'm discovering the library using PkgConfig (custom CMAKE_APPBUNDLE_PATH) and add the library build options to the LINK_FLAGS (using set_property). I then set INSTALL_RPATH_USE_LINK_PATH and BUILD_WITH_INSTALL_RPATH to TRUE. The BUILD_WITH_INSTALL_RPATH supposedly should add any -R that are for installation to the built binary. The INSTALL_RPATH_USE_LINK_PATH should find any -L options and copy them as -R options (AFAIU). Changing RPATH flags happens before the target is created, or link flags are added to the target. The linker executed consistently lacks any -R options at all. Any advice on what I may be doing wrong, or am I misunderstanding the RPATH properties? One thing I believe may be a problem is that I treat LINK_FLAGS as a string, and not a set... cmake available : https://pastebin.com/Y67FerMd Thank you, Pawel. -- 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://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] How to detect MSVC 2015 update 3 (= presence of /fpermissive-)
On Monday May 15 2017 15:58:53 Konstantin Tokarev wrote: Hello, >Have you tried CHECK_CXX_COMPILER_FLAG? I forgot to mention: I don't have a MS dev set-up at the moment. This is for a cross-platform purposes (in KDE's extra-cmake-modules). Thanks, R -- 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://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] [cmake-developers] Does JOB_POOL_[COMPILE|LINK] work with custom_target?
On Mon, May 15, 2017 at 11:46:37 +0200, Eric Noulard wrote: > No answer whatsoever on this? I don't think it is supported right now. > I'd like to be able assign some custom targets to a ninja job pool. > If I were to implement the feature would it be acceptable upstream ? I think it'd be fine. --Ben -- 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://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] How to detect MSVC 2015 update 3 (= presence of /fpermissive-)
15.05.2017, 15:57, "René J.V. Bertin" : > Hello, > > A question that will hopefully have a quick/easy answer: > > I'd like to detect when the MSVC /fpermissive- (yes, that's a dash at the > end) can be used instead of /Za . I know that a later update bumped the > version to 14.0.25422.01 and thus undoubtedly _MSC_FULL_VER== 1402542201 in C > code so I could assume everyone keeps installs their updates and use that > value. Have you tried CHECK_CXX_COMPILER_FLAG? > > But what does this translate to in CMake code (MSVC_VERSION)? Probably not > just 1903 I presume? > > Thanks, > René > -- > > 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://public.kitware.com/mailman/listinfo/cmake -- Regards, Konstantin -- 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://public.kitware.com/mailman/listinfo/cmake
[CMake] How to detect MSVC 2015 update 3 (= presence of /fpermissive-)
Hello, A question that will hopefully have a quick/easy answer: I'd like to detect when the MSVC /fpermissive- (yes, that's a dash at the end) can be used instead of /Za . I know that a later update bumped the version to 14.0.25422.01 and thus undoubtedly _MSC_FULL_VER== 1402542201 in C code so I could assume everyone keeps installs their updates and use that value. But what does this translate to in CMake code (MSVC_VERSION)? Probably not just 1903 I presume? Thanks, René -- 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://public.kitware.com/mailman/listinfo/cmake
[CMake] Link order and interface multiplicity
Heya, I have a project with a layer consisting of interface libraries: add_library(I INTERFACE) These interface libraries are then implemented several times, to fit the different environments of applications: add_library(IA STATIC ...) target_link_libraries(IA PUBLIC I) add_library(IB STATIC ...) target_link_libraries(IB PUBLIC I) There are also application independent libraries, that make use of the interface libraries. add_library(Foo STATIC ...) target_link_libraries(Foo PUBLIC I) add_library(Bar STATIC ...) target_link_libraries(Bar PUBLIC I) And finally, the application defines which implementation of the interface library layer is being used. add_executable(ExeA ...) target_link_libraries(ExeA Foo Bar IA) add_executable(ExeB ...) target_link_libraries(ExeB Foo Bar IB) Luckily, this is okay, as long as IA is listed after Foo and Bar in the synthesized link command. However, certain implementations of I make use of the application independent libraries again. On these environments, the link command line becomes something like this: IA Foo Bar While it should be Foo Bar IA Foo Bar This make sense, because there is no explicit dependency being described that Foo / Bar depend on IA while compiling ExeA. In the simple case, we just get lucky, because it happens to be the default that link command line has the same order as in the target_link_libraries call. I'm working with gcc-arm-none-eabi cross compiler. Here's what I've tried: • LINK_INTERFACE_MULTIPLICITY Does not seem to work. The generated command line is still the same even with higher numbers. • set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--start-group") Linking succeeds, but the program does not run properly on the target hardware. Only after connecting a debugger and resetting, it runs. Strange behaviour. When I link Foo / Bar explicitly with IA instead of --start-group, the command line becomes Foo Bar IA Foo Bar, and then everything works fine. But I cannot do this in general, because of ExeB ^^ => Is there a way how I can define that Foo / Bar temporarily depend on IA while compiling ExeA, and temporarily depend on IB while compiling ExeB? => Is there a different approach on how to handle project structured like the one described above? Thanks Etan -- 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://public.kitware.com/mailman/listinfo/cmake
Re: [CMake] Does JOB_POOL_[COMPILE|LINK] work with custom_target?
Hi all, No answer whatsoever on this? Initial contributor of Ninja job pool appears to be Peter Kümmel: commit 7605e37aabae2678e5696a75e84aced2e84f9037 Author: Peter Kümmel Date: Sat Nov 23 10:49:36 2013 +0100 I'd like to be able assign some custom targets to a ninja job pool. If I were to implement the feature would it be acceptable upstream ? Eric 2017-05-05 16:16 GMT+02:00 Eric Noulard : > Hi all, > > We have a bunch of custom_target and a subset of them should be run in > sequence. > So we tried to define: > > set_property(GLOBAL PROPERTY JOB_POOLS exclusive=1) > > and then: > > set_property(TARGET my_custom_target PROPERTY JOB_POOL_COMPILE exclusive) > set_property(TARGET my_custom_target PROPERTY JOB_POOL_LINK exclusive) > > > This does not seem to reach build.ninja ? > > The new pool is defined but the concerned custom targets are never > assigned to the pool? > > May custom target be assigned to a ninja pool? > If so how can we do that? > -- > Eric > -- Eric -- 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://public.kitware.com/mailman/listinfo/cmake