Re: [CMake] Build and run an external project
Yes, I'm able to do it manually using the custom target I created with add_custom_target, by editing the debug properties to get a runnable object. I was hoping that the VS_DEBUGGER_COMMAND used for add_executable would also work with the add_custom_target, but alas they don't. On Tue, Dec 4, 2018 at 12:54 AM Eric Noulard wrote: > > > Le mar. 4 déc. 2018 à 06:11, James Bigler a > écrit : > >> Unfortunately I don't think your suggestion will work. >> >> I need to invoke a custom executable to build my project and not a >> msproject. I also need to copy the executable into the build directory. >> > > Sorry I miss the fact that you moved the executable around and was not a > "regular" compile. > I've read your message too fast, obviously, sorry. > > I'm not much a Visual Studio user and it has been a long time since I need > to compile something on windows. > > You basically require that an executable not built by VS appears as a > "runnable/debuggable" target in VS? > Are you able to do that from VS "manually" ? > > Again I'm no VS/Windows specialist so others may have more valuable remark > on that. > > -- > 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: https://cmake.org/mailman/listinfo/cmake
[CMake] Failing to set VS_DEBUGGER_* on target added via add_custom_target.
Hi, I - being new to CMake - somehow fail to set VS_DEBUGGER_* property values on a project added via add_custom_target(). The settings of those property values seem to be lost and not written to any .vcxproj file. Doing the same to a target added via add_executable() works on the other hand as expected, ie the debug property values show up correctly in the corresponding .vcxproj. (This is all tried with Visual Studio 2015.) What is the proposed way to achieve the settings of the property values on a project added via add_custom_target()? What am I doing wrong? _Details_ I have the helloWorld.cpp and CMakeLists.txt next to a subdirectory ext, containing both the test01.cpp and test01.exe. Ie CMakeLists.txt helloWorld.cpp ext/ test01.cpp test01.exe The CMake code in a nutshell: add_executable(helloWorld helloWorld.cpp) set(test_name "test01") set(test_target "${test_name}_build") add_custom_target(${test_target} #COMMAND ${CMAKE_COMMAND} -E env "PATH=${BUILD_DRIVER_NVMAKE_DIRECTORY};$ENV{PATH}" nvmake ... COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/ext/${test_name}.exe" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$" SOURCES "${CMAKE_SOURCE_DIR}/ext/${test_name}.cpp" ) set_property( TARGET ${test_target} PROPERTY FOLDER "nvmake tests" ) # from the following two set_property() calls only the first one has an effect in the generated .vcxproj files set_property( TARGET helloWorld PROPERTY VS_DEBUGGER_COMMAND "foo.exe" ) set_property( TARGET ${test_target} PROPERTY VS_DEBUGGER_COMMAND "foo.exe" ) I understand that using imported targets might be an even more appropriate solution for the problem at hand. But with imported targets, eg via add_executable(${test_target} IMPORTED), I fail to add those in a way that they show up as projects in Visual Studio. What is the recommended way for this approach? Thanks for any hints, Ali PS The custom target ends up as a project of configuration type Utility - is there a way to change it to type Executable? --- This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. --- -- 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: https://cmake.org/mailman/listinfo/cmake
Re: [CMake] New version forces rebuild all?
Le mar. 4 déc. 2018 à 11:44, Andy a écrit : > Problem are still. > Alone make also give me problems. > Do you have stripped down project example? > Ninja is replacement od cmake or make? > ninja (https://ninja-build.org/) is make replacement for which there is a CMake generator. https://cmake.org/cmake/help/v3.13/generator/Ninja.html > How work with ninja? > 1) install ninja (on debian the package is called ninja-build) 2) cmake -G Ninja 3) ninja this would rule out generator specific issue. -- 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: https://cmake.org/mailman/listinfo/cmake