Re: [CMake] coding style for modules

2018-01-03 Thread Alan W. Irwin
On 2018-01-04 05:09+0300 Dave Milter wrote: Hello, If there is some libfoo that I want to use in my project, and this libfoo has it's own CMakeLists.txt I have 3 options to deal with such external dependency: a) Treat it like every other external dependency and write cmake code like FindLibFo

Re: [CMake] coding style for modules

2018-01-03 Thread Don Hinton
I normally see it like this: if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) project(foo) # ... endif() hth... don On Wed, Jan 3, 2018 at 6:09 PM, Dave Milter wrote: > Hello, > > If there is some libfoo that I want to use in my project, > and this libfoo has it's own CMakeLists.txt

[CMake] coding style for modules

2018-01-03 Thread Dave Milter
Hello, If there is some libfoo that I want to use in my project, and this libfoo has it's own CMakeLists.txt I have 3 options to deal with such external dependency: a) Treat it like every other external dependency and write cmake code like FindLibFoo.cmake to find libfoo on file system. b)Incl

Re: [CMake] modularizing, specifying dependencies in a project

2018-01-03 Thread Geogin Varghese
This works. Have pushed changes to the repo here: https://github.com/vargheseg/test Thank you On Wed, Jan 3, 2018 at 8:16 PM, Robert Maynard wrote: > You will want to use add_subdirectory instead of include in the root > CMakeLists.txt and remove all include statements from ModA and ModB > > It

[CMake] CPack per-component value for CPACK_PACKAGING_INSTALL_PREFIX when using RPM generator

2018-01-03 Thread Sam Lunt
I am trying to set a per-component value for CPACK_PACKAGING_INSTALL_PREFIX when using the RPM generator, but I haven't been able to do so. I would like to be able to: 1. Install using "make install" (or cmake --build ${BUILD_DIR} --target install) and have CMAKE_INSTALL_PREFIX control the install

Re: [CMake] RPATH for pkg-config

2018-01-03 Thread Andreas Naumann
What about using a FindPETSC-Module? Some hints are *http://jacobmerson.com/2016/01/17/cmake-petsc2.html *http://www.mcs.anl.gov/petsc/documentation/faq.html#cmake Regards, Andreas Am 03.01.2018 um 21:35 schrieb Alexander Neundorf: On 2018 M01 3, Wed 10:08:09 CET Franck Houssen wrote:

Re: [CMake] RPATH for pkg-config

2018-01-03 Thread Alexander Neundorf
On 2018 M01 3, Wed 10:08:09 CET Franck Houssen wrote: > Hello, > > How to ask cmake to add a library path (coming from pc file) to rpath ? > > I checked this https://cmake.org/Wiki/CMake_RPATH_handling, but still not > working. Can somebody help ? > >> more main.cpp > > #include > > int main(i

Re: [CMake] modularizing, specifying dependencies in a project

2018-01-03 Thread Robert Maynard
You will want to use add_subdirectory instead of include in the root CMakeLists.txt and remove all include statements from ModA and ModB It total the changes needed to get everything to work are: diff --git a/CMakeLists.txt b/CMakeLists.txt index e611a37..b6968c1 100644 --- a/CMakeLists.txt +++ b

[CMake] modularizing, specifying dependencies in a project

2018-01-03 Thread Geogin Varghese
Hello, Recently came across these presentations on cmake: Using Modern CMake Patterns to Enforce a Good Modular Design (https://www.youtube.com/watch?v=bsXLMQ6WgIk) Effective CMake (https://www.youtube.com/watch?v=eC9-iRN2b04) They encourage using target_* command variants for scripting CMakeLis

[CMake] RPATH for pkg-config

2018-01-03 Thread Franck Houssen
Hello, How to ask cmake to add a library path (coming from pc file) to rpath ? I checked this https://cmake.org/Wiki/CMake_RPATH_handling, but still not working. Can somebody help ? >> more main.cpp #include int main(int argc, char ** argv) { PetscInitialize(&argc, &argv, NULL, ""); Pe