Re: [CMake] Beginning to compiling CMake file

2018-07-31 Thread Domen Vrankar
On Wed, Aug 1, 2018, 03:46 CrestChristopher wrote: > Hi, I'm using CMake for Windows as I was informed that I couldn't use > `make` as the CMakeLists.txt file was only for CMake. > CMake is a meta build system which means that on for example Linux it henerates make fliles so CMakeLists.txt shoul

[CMake] ctest to output files

2018-07-31 Thread Quang Ha
Hi all, Is there a way to let ctest create an output file after a certain test? Say I want to run test 1 (name "run_simulation"), which is a simulation and should produce an output file containing numerical results. I then want to compare it against analytical results in test 2 (name "compare_resu

Re: [CMake] Beginning to compiling CMake file

2018-07-31 Thread CrestChristopher
Hi, I'm using CMake for Windows as I was informed that I couldn't use `make` as the CMakeLists.txt file was only for CMake. Within CMake for Windows I select the location of the source code which is the cloned repository which include the CMakeLists.txt file that I want to compile, followed by

Re: [CMake] CMake for CUDA with MPICC still using gcc to link?

2018-07-31 Thread Robert Maynard
The CUDA_HOST_COMPILER must be specified as a -D option on the first invocation of cmake as it is used during the compiler detection process. The _LINKER_PREFERENCE is a numeric value that determines which language will be selected for linking when a library/executable has source files from multip

Re: [CMake] CMake for CUDA with MPICC still using gcc to link?

2018-07-31 Thread Quang Ha
Thanks Robert - specific at the cmake -D [...] command seemsd to work. Is it possible to set this inside a CMakeLists.txt? I have tried: set(CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER}) set(CUDA_LINKER_PREFERENCE ${CMAKE_CXX_COMPILER}) but it snaps back to gcc still. Thanks, QT On Tue, 31 Jul 2018

Re: [CMake] CMake for CUDA with MPICC still using gcc to link?

2018-07-31 Thread Robert Maynard
It is snapping back to g++ as that was the linker that nvcc uses when it builds an executable. CMake detects this as part of the compiler detection process. I haven't verified that this will work but you can try specifying the LINKER_LANGUAGE(https://cmake.org/cmake/help/v3.12/prop_tgt/LINKER_LANG

[CMake] CMake for CUDA with MPICC still using gcc to link?

2018-07-31 Thread Quang Ha
Hi all, Currently using cmake/3.11.1, I want to try and compile MPI/CUDA application with cmake. I kept running into problems of 'undefined MPI_Init', so I take a look at `make VERBOSE=1`. The output looks something like this ===

Re: [CMake] Beginning to compiling CMake file

2018-07-31 Thread Michael Ellery
typical usage would be something like (assuming you are at repo root) : mkdir mybuild && cd mybuild cmake -DCMAKE_BUILD_TYPE=Release .. cmake —build . you can also opt to configure cmake (the equivalent of the first cmake command above) using a GUI like ccmake or cmake-gui if you prefer. The cma

Re: [CMake] Get compiler command line (or json compilation database) for a target

2018-07-31 Thread Roman Popov
In general I don't understand why CMake provides a separate integration for each tool (_CLANG_TIDY _COMPILER_LAUNCHER _CPPCHECK _CPPLINT _INCLUDE_WHAT_YOU_USE), But a generic solution is not provided (or not documented clearly? ) вт, 31 июл. 2018 г. в 9:47, Roman Popov : > After day of googling

Re: [CMake] Get compiler command line (or json compilation database) for a target

2018-07-31 Thread Roman Popov
After day of googling I've found a solution that almost works for me. There is a CXX_CLANG_TIDY property that enables clang-tidy on a target. https://cmake.org/cmake/help/v3.12/prop_tgt/LANG_CLANG_TIDY.html But I can replace clang-tidy with my own Clang-based tool: set(CLANG_TIDY_EXE ${MY_CLANG_

Re: [CMake] issue with CPack: RPM package was not generated!

2018-07-31 Thread Eric Noulard
Hi Miroslav, Do you need something very specific that you need a custom spec file? If this is not the case you should try to let CPackRPM generate the spec file for you. This "USER spec file" feature was designed (quite a long time ago) when CPackRPM was lacking some features that came in after t

Re: [CMake] order of includes seems wrong (or please help me understand)

2018-07-31 Thread Robert Maynard
The BEFORE keyword places the includes before any other paths such as ones from other target_include_directories statements or from transitive propagation from targets you linked too. As to why `CMAKE_PREFIX_PATH` is being added, I expect that some find call is bring it in as an include directory.

Re: [CMake] issue with CPack: RPM package was not generated!

2018-07-31 Thread Miroslav Kubiczek
yes, there are install commands, one of CMakeLists.txt content: install(DIRECTORY ${PROJECT_SOURCE_DIR}/api/rest DESTINATION include) install(TARGETS Rest DESTINATION lib) I can see these files after running the 'make package': $ find ./_CPack_Packages/Linux/ ./_CPack_Packages/Linux/ ./_CPack_Pac

Re: [CMake] issue with CPack: RPM package was not generated!

2018-07-31 Thread Craig Scott
On Tue, Jul 31, 2018 at 9:56 PM, Miroslav Kubiczek < miroslav.kubic...@gmail.com> wrote: > Hi All, > > I'm running cmake 3.10.1 and have this issue: > > $ make package > [ 50%] Built target Rest > [100%] Built target UT_RestLibrary > Run CPack packaging tool... > CPack: Create package using RPM >

[CMake] issue with CPack: RPM package was not generated!

2018-07-31 Thread Miroslav Kubiczek
Hi All, I'm running cmake 3.10.1 and have this issue: $ make package [ 50%] Built target Rest [100%] Built target UT_RestLibrary Run CPack packaging tool... CPack: Create package using RPM CPack: Install projects CPack: - Run preinstall target for: XXXCommonCppLibrary CPack: - Install project: XX