Re: [CMake] FindZLIB doesn't work for PGI compiler

2019-07-26 Thread Chuck Atkins
Hi Sanu, We test pgi pretty heavily so it should work okay. Can you show the output failure you get when trying to configure? - Chuck On Tue, Jul 23, 2019, 1:21 AM 李 三乎 wrote: > Dear CMake Community, > > I’m here to report an error occurred when using PGI compiler. The readme > for CMake asks

Re: [CMake] General question about variable scope.

2019-06-14 Thread Chuck Atkins
So, a couple things: string(TOUPPER ${lib} lib_upper) > set(WITH_LIB_${lib_upper}_EXAMPLES "") > > This needs to be outside the foreach loop. It's getting reset to empty on every iteration rather than accumulating results list(APPEND ${WITH_LIB_${lib_upper}_

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

2019-05-10 Thread Chuck Atkins via CMake
Hi John, Two different compilers in the same project for the same language is messy, but in your case it's directly supproted as a special case for cuda using the CMAKE_CUDA_HOST_COMPILER CMake variable or the CUDAHOSTCXX environment variable. -- Chuck Atkins Staff R&D

Re: [CMake] Basic question how to find -lm include and lib dir with find_package or otherwise

2019-03-15 Thread Chuck Atkins via CMake
UIRED_LIBRARIES) if(NOT HAVE_LIBM_MATH) message(FATAL_ERROR "Unable to use C math library functions") endif() set(LIBM_LIBRARIES m) endif() target_link_libraries(fooTarget PRIVATE ${LIBM_LIBRARIES}) -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On F

Re: [CMake] cmake cannot find source file (new to cmake)

2018-12-27 Thread Chuck Atkins via CMake
> > When I ran "cmake .." in bin, cmake complained that it could not find > source file src1.h in add_executable. What is wrong here? > Hi Lei, Alex hit several of these points, but to wrap it up together: A couple of things... - There's no need for a CMakeLists.txt in a directory if it's not

Re: [CMake] CopyOfCMakeCache.txt

2018-10-18 Thread Chuck Atkins
Hi Frank, What version of CMake are you running (cmake --version) and what is are you running on? Is this on the Windows Subsystem for Linux? Older CMake versions had similar trouble there that was resolved with more recent releases. - Chuck On Thu, Oct 18, 2018, 17:04 Jean-Christophe Fillion-R

Re: [CMake] Building arguments to target_comple_definitions()

2018-10-15 Thread Chuck Atkins
Hi Rob, How would one set a variable containing multiple definitions to be passed > to target_compile_definitions() ? > The example you gave works (adjusting for typos, PIC, and adding visibility specifier): ... set(COMMON_DEFINITIONS SOME_DEFINE_1 SOME_DEFINE_2 SOME_DEFINE_3) ... target_compile

Re: [CMake] Building arguments to target_comple_definitions()

2018-10-12 Thread Chuck Atkins
o.cxx - Chuck > > *From: *Chuck Atkins > *Date: *Thursday, October 11, 2018 at 2:55 PM > *To: *Rob Boehne > *Cc: *CMake Mail List > *Subject: *Re: [CMake] Building arguments to target_comple_definitions() > > > > So, are you suggesting that I make a “dummy” tar

Re: [CMake] Building arguments to target_comple_definitions()

2018-10-11 Thread Chuck Atkins
> > So, are you suggesting that I make a “dummy” target and fill it with the > common options in compile_definitions() and include_directories() (et. al.) > > Then make my OBJECT libraries (and the shared library) depend on the > “dummy” target? > > > If that’s not the suggestion, I’m afraid I don

Re: [CMake] Putting the git commit hash in a cmake variable

2018-10-11 Thread Chuck Atkins
> COMMAND "${GIT_EXECUTABLE}" describe --always HEAD > git describe is nice way to do it since you can get a monotonic-ish increasing version number > > string(REGEX REPLACE "^.*-(.*)-g.*$" "\\1" MYAPP_VERSION_MICRO > "${MYAPP_VERSION}") > ... > set(MYAPP_VERSION_MICRO "0") > Only t

Re: [CMake] Building arguments to target_comple_definitions()

2018-10-11 Thread Chuck Atkins
Hi Rob, > target_compile_definitions( CHUNK1 ${COMMON_DEFINITIONS} CHUNK1_STUFF > CHUNK_NAME=\”One\” ) > > target_compile_definitions( CHUNK2 ${COMMON_DEFINITIONS} CHUNK2_STUFF > CHUNK_NAME=\”Two\”) > > target_compile_definitions( FooBar ${COMMON_DEFINITIONS} ) > This is what I was referring

Re: [CMake] FindMPI.cmake in 3.11.4

2018-09-17 Thread Chuck Atkins
Hi Burlen Of course I read the documentation. > I certainly didn't mean for that to come off as an "rtfm", so my appologies if it did, that wasn't my intent. > why did they MPI_C_LIBRARIES and MPI_C_INCLUDE_DIRS/PATH get changed from > cache variables to not chached variables? that seems to be

Re: [CMake] FindMPI.cmake in 3.11.4

2018-09-14 Thread Chuck Atkins
determine the MPI installation? If that's the case then we should probably fix that issue instead. -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. (518) 881-1183 On Thu, Sep 13, 2018 at 4:46 PM Burlen Loring wrote: > Hi, > > I'm trying to transit

Re: [CMake] Is there a way to obtain the current compiler standard flag?

2018-05-30 Thread Chuck Atkins
Hi Chris. Try using the the CMAKE_CXX${std}_STANDARD_COMPILE_OPTION variable. For example, the folowing piece of CMake code: cmake_minimum_required(VERSION 3.9) project(foo CXX) foreach(std IN ITEMS 98 11 14 17) message("C++${std} std flags: ${CMAKE_CXX${std}_STANDARD_COMPILE_OPTION}") mess

Re: [CMake] failure to build Cmake to / against non-standard directory under Linux

2018-03-16 Thread Chuck Atkins
CMAKE_PREFIX_PATH just adds a set of search paths. To instead have it shift it's entire search infrastructure, you can use the CMAKE_FIND_ROOT_PATH CMake variable and a few associated with it, which will cause the entire set of search heuristics to be re-rooted in the specified path. First run th

Re: [CMake] how to detect architecture ?

2018-01-19 Thread Chuck Atkins
); printf("Library foo uses file %s\n", filename); return 0; } This will give you "libfoo.so" on Linux, "libfoo.dylib" on Apple, and " foo.dll" on Windows. -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Tue, Jan 9

Re: [CMake] Bootstrap fails to detect C++11 compiler on AIX 7.1/XL C 13.1.3 toolset

2017-12-19 Thread Chuck Atkins
Hi Nathan, I am able to reproduce this error on our Dashboard machine; it should be working and clearly it's not at the moment. I will investigate... -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Tue, Dec 19, 2017 at 11:48 AM, Nathan Strong wrote

Re: [CMake] Failed to build C++ source with CMakeLists.txt

2017-08-15 Thread Chuck Atkins
Hi Jupiter, Compiling the C compiler identification source file "CMakeCCompilerId.c" > failed. > Compiler: /usr/local/gcc/4.9.1/bin/gcc > Build flags: /usr/local/cppcms/1.1.0/include > It looks like you have an errant "/usr/local/cppcms/1.1.0/include" set in your CFLAGS environment variable, or

Re: [CMake] CPack Multicore Usage

2017-07-24 Thread Chuck Atkins
> > cause cpack does not "rebuild" the software again, it uses the compiled > software and just starts the "install" into its _CPack_Packages > subdirectories > Just running `cpack` does not. However, CMake does generate a "package" make target that is tied into your dependencies, so if instead o

Re: [CMake] CPack Multicore Usage

2017-07-21 Thread Chuck Atkins
> > In calls to cpack only one core is used if Makefiles are used. Is there > any option to enable multicore? > It depends on what your trying to achieve. Typically the bottleneck for CPack is in the compression step of the resulting tar (or rpm, etc.). In that case, CMake is limited by the liba

Re: [CMake] OBJECT libraries and working around lake of target_link_libraries

2017-07-17 Thread Chuck Atkins
Hi David, > Supporting OBJECT libraries in > target_link_libraries calls was mentioned mentioned right back here > https://cmake.org/pipermail/cmake-developers/2012-March/015422.html but > sadly seems still to be on the back burner. > It's not on the back burner! There has been progress on desi

Re: [CMake] Unable to build cmoka project using cmake

2017-06-30 Thread Chuck Atkins
n. Thanks. ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Fri, Jun 30, 2017 at 1:17 PM, Rajesh Kumar wrote: > Tried with cmake 3.8.2 version. Able to compile CMOCKA. > > Regards > Rajesh > > On Wed, Jun 21, 2017, 3:10 PM Rajesh Kumar wrote: > &

Re: [CMake] Unable to build cmoka project using cmake

2017-06-21 Thread Chuck Atkins
Hi Rajesh, We would need more information to be useful: - What version of CMake are you using? - What compiler and version are you using? - What OS and version are you using? - Do you have separate source and build directories? - How are you running cmake? -- Chuck

Re: [CMake] setting rpath-link

2017-06-16 Thread Chuck Atkins
Hi Petros, This doesn't really answer your question but it may solve your problem a different way. I've fought this very same boost problem many times in the past. In my case it was needing to link against Matlab dev libraries, which in turn pulled their own private copy of boost in. I tried a s

Re: [CMake] Different flags for compiling and linking with Fortran

2017-06-15 Thread Chuck Atkins
C++ compilers are detected as Clang then I suspect it's rather old. They should also be detected as XL like the Fortran compiler. Do you get the same XL Fortran errors using a new version of CMake? -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. -- Powered by w

Re: [CMake] Emacs cmake-mode indentation flaw

2017-06-02 Thread Chuck Atkins
ar2 ) foo(bar1 bar2 ) All of which have their justifications. ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Fri, Jun 2, 2017 at 1:57 AM, Frank Roland wrote: > There is probably a faulty indentation implemented in cmake-mode for emacs > rega

Re: [CMake] CMAKE_SIZEOF_VOID_P question

2017-04-14 Thread Chuck Atkins
8 as expected. ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. -- 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 mo

Re: [CMake] Link to local glibc

2017-03-08 Thread Chuck Atkins
> > I'll try and see if I can compile a gcc 4.9.3 chain on the CentOS 5 > machine (I need C++11). > I'd suggest using the devtollset repo from https://people.centos.org/tru/devtools/devtools.repo > The docker container looks interesting but I haven't used it yet: does it > need some specific inst

Re: [CMake] Link to local glibc

2017-03-07 Thread Chuck Atkins
If you're using a newer Ubuntu environment, I'd suggest using a CentOS 5 docker container. Either that or the VM. - Chuck On Tue, Mar 7, 2017 at 1:53 PM, Marcel Loose wrote: > Hi Michele, > > This could become a painful exercise. You basically have two options: > 1) Treat it as a cross-compil

Re: [CMake] [cmake-developers] how to use cmake3.7 for building fast code infedora 24

2017-02-16 Thread Chuck Atkins
> All you should need to do is source the setup script as I described here: source /opt/intel/bin/compilervars.sh intel64 > That should place the compilers in the search path for your current shell. ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware,

Re: [CMake] Default CMAKE_C_FLAGS value by OS

2017-02-16 Thread Chuck Atkins
Hi YC, > cmake version on fedora 25: 3.6.2 > Fedora is specifically patching CMake in the RPM spec file to reduce the gcc flag from O3 to O2 so it's the distributuion's packaging making that change, not CMake itself. If you download and build the source from cmake.org then you'll get O3 as defa

Re: [CMake] cmake 3.7.2 centos 7 :: kwsys.testSystemTools (Failed)

2017-02-16 Thread Chuck Atkins
Hi Adrian, I'd suggest taking the issue up with the package maintainer. The upstream source for CMake 3.7.2 configures, builds, and passes all tests on EL7 so the problem seems to lie in how the RPM SPEC file is driving the build. -- Chuck Atkins Staff R&D Engineer, Scientific

Re: [CMake] cmake 3.7.2 centos 7 :: kwsys.testSystemTools (Failed)

2017-02-15 Thread Chuck Atkins
(1 test) Total Test time (real) = 247.03 sec [chuck.atkins@deepthought v3.7.2]$ What specific versionof EL7 are you running and which version of GCC? -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. -- Powered by www.kitware.com Please keep messages on-topic and c

Re: [CMake] Forcing linking compatability to old libc / libstdc++ (Linux)

2017-02-03 Thread Chuck Atkins
FWIW, we've moved to CentOS 6 for the binaries we package and distribute for ParaView. It's about the oldest widely deployed Linux distro that's still actively supported (EL5 is EOL'd and most deployments have long since moved to 6 or 7). it's binaries are compatible with virtually all current Li

Re: [CMake] OBJECT libraries and INTERFACE_SOURCES

2016-12-09 Thread Chuck Atkins
i.e.: add_library(lib1-obj OBJECT $(CMAKE_CURRENT_SOURCE_DIR}/lib1.cpp). -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Fri, Dec 9, 2016 at 5:26 AM, Giovanni Funchal wrote: > Hi, > > Apologies, the problem wasn't properly minimised becau

Re: [CMake] Duplicating a shared library and replacing target link libraries

2016-12-05 Thread Chuck Atkins
> > The library linking against "originalLibraryForward" has to be > compiled from the original sources too. Actually performing the linking step should be sufficient. Is there a way to accomplish that? > Object libraries are what you need here. See https://cmake.org/cmake/help/v3.7/manual/cmake

Re: [CMake] FindMPI

2016-12-01 Thread Chuck Atkins
> why does it not interrogate the MPI wrapper if set as FC or CC? > CC, CXX, and FC env vars are just used to initialize the CMAKE_{C,CXX,Fortran}_COMPILER variables wihch CMake will then use as the "regular" compilers for a given language. If those regular compilers already work with MPI then th

Re: [CMake] FindMPI

2016-12-01 Thread Chuck Atkins
> > As far as enhancements to FindMPI go, It might be worthwhile to check if > FC, CC,CXX match any obvious MPI wrappers, and then set MPI__compiler > and select the MPI version from there: If the user set the compiler > explicitly to an MPI wrapper, that's likely the MPI they intend to use > I

Re: [CMake] FindMPI

2016-11-28 Thread Chuck Atkins
Hi Zaak, Sorry for the first mail being so abrupt, I didn't mean to hit "send" so soon. > I took a look at the FindMPI CMake module, and it seems as though you can > set MPI_HOME to a list of directories to search. > That's also another way of doing it, which would probably be easier than what

Re: [CMake] FindMPI

2016-11-28 Thread Chuck Atkins
ables the MPI wrappers. FindMPI will then interrogate the MPI wrappers to extract the appropriate include and link options. -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Mon, Nov 28, 2016 at 9:58 AM, Chuck Atkins wrote: > Pass the following CMak

Re: [CMake] FindMPI

2016-11-28 Thread Chuck Atkins
Pass the following CMake options at configure time: -DMPI_C_COMPILER=/path/to/mpicc -DMPI_CXX_COMPILER=/path/to/mpiCC -DMPI_Fortran_COMPILER=/path/to/mpif90 -- Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Wed, Nov 23, 2016 at 6:05 PM, Zaak Beekman w

Re: [CMake] Building CMake without Curl

2016-11-03 Thread Chuck Atkins
is: g++ Makefile processor on this system is: gmake g++ is GNU compiler g++ has setenv g++ has unsetenv g++ does not have environ in stdlib.h g++ has stl wstring - ... lots of compile output ... loading initial cache file /home/khq.kitware.com/chuck. atkins/Code/

Re: [CMake] Building CMake without Curl

2016-11-02 Thread Chuck Atkins
the world. The default configuration of the ./bootstrap command should be using internal versions of all of CMake's dependencies. Is that causing problems for you? ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Wed, Nov 2, 2016 at 1:08 PM, Jayesh Badwa

Re: [CMake] [SOLVED] RE: Crosscompilation woes

2016-10-11 Thread Chuck Atkins
that's exactly what you've done. Just confirming that yes that's a sane approach and that's how we do it to. ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Mon, Oct 10, 2016 at 9:56 AM, Robert Bielik wrote: > For reference: I went w

Re: [CMake] Correct way to use ARMCC (Files in Modules/Compiler/ARMCC*)

2016-09-30 Thread Chuck Atkins
> > 1. Toolchain needs to be in a separate file > Yes, that is certainly best practice and makes the rest of the cross-compiling infrastructure just work better. > 2. That file needs to be called before the project line of your > CMakeLists.txt > You actually shouldn't be "calling" it at all.

Re: [CMake] latest cmake 3.6.1 building in AIX can not find symbol `.w32attrset`

2016-08-19 Thread Chuck Atkins
rary. When configuring your build, try adding -DCURSES_NCURSES_LIBRARY=IGNORE to prevent FindCurses from picking the wrong one. ------ Chuck Atkins Staff R&D Engineer, Scientific Computing Kitware, Inc. On Fri, Aug 19, 2016 at 5:14 AM, Zeson Wu wrote: > /usr/bin/g++-Wl,-bnoipath -Wl

Re: [CMake] FindLibXml2.cmake: rename "LIBXML2_DEFINITIONS"

2016-08-01 Thread Chuck Atkins
Hi Yaron, I think it should b renamed to "LIBXML2_COMPILE_FLAGS". > Xxx_DEFINITIONS is one of the standard variable names for a given FindXxx.cmake find module, see https://cmake.org/cmake/help/v3.6/manual/cmake-developer.7.html#standard-variable-names . > If u wish, I can submit a patch. >

Re: [CMake] custom build

2016-07-29 Thread Chuck Atkins
Hi Lev, However, the target builds only if I explicitly say 'make foo_sqlite'. So > far > so good. Is there any way I can make it build if I just say 'make'? > See the add_custom_target documentation for the ALL option, https://cmake.org/cmake/help/v3.6/command/add_custom_target.html And, there

Re: [CMake] CMake Reports Incorrect HDF5 Libraries on OS X after 3.6.0 Upgrade

2016-07-14 Thread Chuck Atkins
Hi Brennan, We also just got the Homebrew cmake formula updated to explicitly include the patch. See https://github.com/Homebrew/homebrew-core/pull/2968 - Chuck On Wed, Jul 13, 2016 at 11:10 PM, Breannan Smith wrote: > Rad, I can verify that the issue is resolved in the git repo if anyone > e

Re: [CMake] Does Makefile generated by CMake support make -jN?

2016-07-13 Thread Chuck Atkins
> > Thanks for your analysis for me Andrew. I can't use "-j" options, i think > the reason is the project i dealed with is not parallel. Thus when i use "make > -jN", it couldn't work correctly every time. Obviously it caused by the > Makefile generated by CMake, so i wonder if there are some CMak

Re: [CMake] Finding libxml2 when building llvm/clang

2016-06-15 Thread Chuck Atkins
You could try to force libxml to be ignored by CMake so it will think it wasn't found and use the fallback configuration: cmake ... -DLIBXML2_LIBRARIES=IGNORE ... - Chuck On Tue, Jun 14, 2016 at 8:28 PM, Edward Diener < eldlistmaili...@tropicsoft.com> wrote: > Building llvm/clang from source in

Re: [CMake] Provide configuration settings for users

2016-06-14 Thread Chuck Atkins
Hi Cedric, It sounds like creating a package config file is exactly what you need. When installed, a user will be able to consume your project with "find_package(Foo)". That will locate and read the package config file which will create an imported target Foo::Foo. This imported target will cary

Re: [CMake] How do you handle recursive dependencies in CMake

2016-06-08 Thread Chuck Atkins
different projects (I have actually > already seen this a lot). That is the case, because the FindFooBar.cmake > file is not provided by the FooBar project, unlike the FooBarConfig.cmake. > > Cheers, > Sven > > > On 06/08/2016 03:11 PM, Chuck Atkins wrote: > > Th

Re: [CMake] cpack ppc64le rhel7.2 CPACK_RPM_PACKAGE_ARCHITECTURE

2016-06-08 Thread Chuck Atkins
I was able to verify, btw, that Fedora 19 + Power8 outputs ppc64le for uname -m so I assume it works correctly on EL7 as well. Testead via an IBM machine hosted at the OSU Open Source Lab that we can access and use for testing. - Chuck On Wed, Jun 8, 2016 at 10:33 AM, M Kelly wrote: > Domen Vr

Re: [CMake] How do you handle recursive dependencies in CMake

2016-06-08 Thread Chuck Atkins
The FooBarConfig.cmake is something that should be generated by FooBar's build. The reason you don't get absolute paths for the "libraries" from a package config file is that they're not actually libraries but imported targets. The imported target let's you treat "foo" as though it were a librar

Re: [CMake] add_custom_command, POST_BUILD

2016-06-02 Thread Chuck Atkins
Could you just make the tests run in the post-build of the test? add_library(Foo Foo.cxx) add_executable(FooTest FooTest.cxx) target_link_libraries(FooTest Foo) add_custom_command(TARGET FooTest POST_BUILD COMMAND $ $ ) That way the the test is run as part of it's build. - Chuck On Wed, Ju

Re: [CMake] No debugging symbols found when using -DCMAKE_BUILD_TYPE=Debug

2016-06-01 Thread Chuck Atkins
my > system seems to be using. If requested, I can try to switch to normal gcc > to test that out. > > > On Wednesday, June 1, 2016 11:46:40 AM EEST Chuck Atkins wrote: > > Interesting. It seems CMake is having trouble identifying GCC in 6.1.1. > Do you have a 5.x compiler

Re: [CMake] No debugging symbols found when using -DCMAKE_BUILD_TYPE=Debug

2016-06-01 Thread Chuck Atkins
> [eschnigma@manjaro ~]$ g++ --version > g++ (GCC) 6.1.1 20160501 > Copyright (C) 2016 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > &

Re: [CMake] No debugging symbols found when using -DCMAKE_BUILD_TYPE=Debug

2016-06-01 Thread Chuck Atkins
> >[eschnigma@manjaro build]$ cmake .. -DCMAKE_BUILD_TYPE:STRING="Debug" > -- The C compiler identification is unknown > -- The CXX compiler identification is unknown > This is definitely the reason for no debug symbols. If the compiler is unknown then CMake won't know the right flags to pass

Re: [CMake] How to hundle gcc link options(like whole-archive, --allow-multiple-definition) in CMake?

2016-05-31 Thread Chuck Atkins
Hi Chao, You want to let CMake to as much of the work for you as possible. You're still trying to explicitly pass the path to the library file to target_link_libraries. If you look at the line: target_link_library(exe1 "-Wl, --whole-archive ../sub_dir1/liblib1.a --no-whole-archive") there's no

Re: [CMake] Fwd: Using CPack to package things not built using CMake

2016-05-23 Thread Chuck Atkins
Hi Bruce, CPack basically packages up everything that gets "installed". We've got a number of superbuilds as we call them that work this way. Basically you have all of your external projects perform their install into the same temporary location somewhere in the build tree, like ${project_name_B

Re: [CMake] How to use 'CMAKE_EXE_LINKER_FLAGS' correctly

2016-05-23 Thread Chuck Atkins
16 at 2:23 AM, Chaos Zhang wrote: > Thanks a lot! `set(FOO_LIBRARY "-Wl,--whole-archive ${FOO_LIBRARY} > -Wl,--no-whole-archive")` worked when the content of ${FOO_LIBRARY} look > like `-Ldir -llib`, if just use lib name as the content of ${FOO_LIBRARY}, > error whi

Re: [CMake] How to use 'CMAKE_EXE_LINKER_FLAGS' correctly

2016-05-20 Thread Chuck Atkins
> -rpath RPATHs are automatically added by CMake to executables so they can use libraries from the build tree. > -whole-archive > whole-archive is definitely trickier since you shouldn't be applying it to the entire executable but instead wrapping individual libraries with it. Conveniently,

Re: [CMake] How to use 'CMAKE_EXE_LINKER_FLAGS' correctly

2016-05-20 Thread Chuck Atkins
Is there a reason to not use target_link_libraries here? For the purposes of your example there's no reason to be using CMAKE_EXE_LINKER_FLAGS. What are you actually trying to accomplish? Because there is almost certainly a better way to achieve your desired result than via CMAKE_EXE_LINKER_FLAGS.

Re: [CMake] Error if CMAKE_SYSTEM_NAME is placed wrongly

2016-05-18 Thread Chuck Atkins
> when I place set(CMAKE_SYSTEM_NAME Generic) after cmake_minimum_required() > and project() and set(VERSION_MAYOR/MINOR), > CMAKE_SYSTEM_NAME really shouldn't be in a CMakeLists.txt file at all. It should instead be in a stand alone toolchain file defining your various cross-compiling requiremen

Re: [CMake] Idomatic cmake: Supporting gcc, icc, and clang with custom flags for each?

2016-05-17 Thread Chuck Atkins
Hi TCW, A typical approach for this is in the top level CMakeLists.txt to have: include(CompilerFlags) And then you can isolate the detection and specialization logic in a separate CompilerFlags.cmake: if(CMAKE_COMPILER_IS_GNUC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS" -extra --gcc-options") elsei

Re: [CMake] [cmake-developers] [PATCH] FindBoost does not detect absence of header file

2016-05-11 Thread Chuck Atkins
I guess it doesn't really matter but for the libraries that don't have a single include header, should you be using these instead: - container/container_fwd.hpp - exception/all.hpp - filesystem.hpp - math_fwd.hpp (instead of math/quaternion.hpp) - system/config.hpp - type_erasure

Re: [CMake] Is there a better way to retrieve content from a remote zip file?

2016-04-28 Thread Chuck Atkins
This looks well suited to ExternalProject. Just give it an empty configure and build steps and then have the install step perform the copy: include(ExternalProject) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(3rdParty_SUBDIR x64) else() set(3rdParty_SUBDIR x86) endif() ExternalProject_Add( 3rdParty

Re: [CMake] project command not working, when used via macro (from an included file)

2016-04-27 Thread Chuck Atkins
os, such as > project_guarded > (see http://stackoverflow.com/a/33100078) > cannot be used everywhere, as a substitute for project. > > > > On Tue, Apr 26, 2016 at 8:04 PM, Chuck Atkins > wrote: > >> ajneu, >> >> The call to project(...) needs to be explicit. See &

Re: [CMake] project command not working, when used via macro (from an included file)

2016-04-26 Thread Chuck Atkins
ajneu, The call to project(...) needs to be explicit. See https://cmake.org/cmake/help/v3.5/command/project.html: The top-level CMakeLists.txt file for a project must contain a literal, direct call to the project() command;

Re: [CMake] How to link shared lib on windows (visual studio 2014).

2016-04-26 Thread Chuck Atkins
May others have mentioned the various different ways to address generating import libraries. One thing that will help with the "can't find .dll" issue is to change the default location that various components end up. With Windows shared libraries, you have both a runtime component (.dll) and a lin

Re: [CMake] CMake:question of the time when the command will happen in add_custom_command(...)

2016-04-22 Thread Chuck Atkins
Hi Chao, You can see this more clearly if you do a "make VERBOSE=1" : [chuck.atkins@hal9000 build]$ make VERBOSE=1 ... [ 50%] Building C object CMakeFiles/main.dir/main.c.o /usr/bin/cc -o CMakeFiles/main.dir/main.c.o -c /home/chuck.atkins/Code/tmp/source/main.c [100%] Linking C executable m

Re: [CMake] How to add dependency relations between libs and executable

2016-04-21 Thread Chuck Atkins
> in your proj_a example, when target_link_librairies invoke Lib B directly > which generated in another project b, how does proj_a recognize it > I think the reason is proj_a, b, c are all the sub directories of > project root, if no root layer, B can not be invoked in proj_a, right? > That's

Re: [CMake] How to add dependency relations between libs and executable

2016-04-20 Thread Chuck Atkins
> So for this parallel project structure, an upper level cmakelist used to > organize and setup relationship with lib A, B, C right? > Correct. The top level CMakeLists.txt lets A B and C all build under a single configuration. One more question is, if use the upper level cmake list, lib_B , li

Re: [CMake] CMake: how to use 'for cyclic sentence' in command add_custom_command(...)

2016-04-19 Thread Chuck Atkins
ir_name), $(file_name). Thanks again for your help, Chao Zhang 2016-04-19 22:20 GMT+08:00 Chuck Atkins : > Hi Chao, > > >> I was using 'for cyclic sentence' in command add_custom_command(...), the >> content of the CMakeLists.txt as below: >> add_custom_command(

Re: [CMake] How to add dependency relations between libs and executable

2016-04-19 Thread Chuck Atkins
> cmake, the old top layer project is proj_a, which at the same layer with > proj_b and proj_c, if I add an extra top layer as the root you mentioned, the generated make file structure will be changed, top layer make file will be root instead of proj_a. > > Is there any way to add the dependency

Re: [CMake] CMake: how to use 'for cyclic sentence' in command add_custom_command(...)

2016-04-19 Thread Chuck Atkins
Hi Chao, > I was using 'for cyclic sentence' in command add_custom_command(...), the > content of the CMakeLists.txt as below: > add_custom_command(TARGET temp_target > POST_BUILD > COMMAND for x in a b c\; >

Re: [CMake] Toolchains and CMAKE_FORCE_C_COMPILER in 3.5

2016-02-09 Thread Chuck Atkins
Hi Thibault, Can you post your toolchain file? - Chuck On Tue, Feb 9, 2016 at 9:10 AM, Thibault Genessay wrote: > Hi, > > I'm a long time user of CMake (and huge fan of it) but newly registered on > this list, so please forgive me if I have missed something regarding the > new 3.5 series. > >

Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Chuck Atkins
CMake strongly encourages the use of separate source and build directories (unlike autotools). So, try something like this: mkdir build cd build cmake -C /path/to/SuperCoolCacheFile.cmake /path/to/source - Chuck On Thu, Jan 21, 2016 at 10:10 AM, Cedric Doucet wrote: > > > Hi Petr, > > thank

Re: [CMake] How to pass a configuration file to CMake?

2016-01-21 Thread Chuck Atkins
Hi Cedric, The option can be a bit confusing. The cache file you pass is actually a CMake script that sets cache variables, rather than the cache variables as seen in CMakeCache.txt. So you would actually want your cache file to contain: set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type

Re: [CMake] find_library

2016-01-14 Thread Chuck Atkins
Hi Vania, find_library(SYSC_LIB systemc PATHS "${SYSTEMC_PATH}" > PATH_SUFFIXES lib-linux64 lib64-linux lib64-linux64) > In this first call, SYSTEMC_PATH is being dereferenced as a CMake variable. This works because in your invocation of CMake: cmake -G "Unix Makefiles" -DSYSTEMC

Re: [CMake] Is there a way to disable adding extra libraries at the end of a link line?

2015-12-30 Thread Chuck Atkins
The error itself I believe is a side effect of CMake trying to operate assuming it's using normal Linux, which makes some assumptions regarding shared runtime libraries for libc, position independent code, etc. The default behaviour of the Cray compiler wrappers, however, is to create fully static

Re: [CMake] Is there a way to disable adding extra libraries at the end of a link line?

2015-12-30 Thread Chuck Atkins
Hi John, Can you try using the new Cray platform file? It should better handle the implicit libs and dirs used by the compiler wrappers if you have the appropriate modules loaded (cray-hdf5 for HDF5 libs, craype-sandybridge or whatever your compute node CPU is for the -msse2 flag, etc.): cmake -

Re: [CMake] linking hared libraries

2015-10-20 Thread Chuck Atkins
> > On Mon, Oct 19, 2015 at 8:43 PM, Owen Alanzo Hogarth > wrote: > > Also you said the PROJECT() should only be defined once, but shouldn't > each > > cmakelists.txt contain a project() or else cmake complains at me. > > > According to the last paragraph of: > > https://cmake.org/cmake/help/v3.0/

Re: [CMake] CMake + MPI

2015-09-09 Thread Chuck Atkins
> > The only exception to that (which I am aware of) is if you are on a CRAY > system where the MPI (and BLAS and LAPACK) are baked into the compiler > wrappers (cc, ftn, etc). In those situations, you actually do not want to > run find_package(MPI) or it will throw errors. > Not true. The FindMP

Re: [CMake] No-op command?

2015-09-07 Thread Chuck Atkins
> > if(CMAKE_SYSTEM_NAME STREQUAL "Windows") >> else() >>... do something ... >> endif() >> > While you may need the empty if condition for something else, in this use case specifically you could just as easily avoid the empty conditional block and negate the expression with: if(NOT CMAKE_SYST

Re: [CMake] Linking error after having found a package

2015-07-23 Thread Chuck Atkins
Hi Cedric, FIND_PACKAGE(BLAS) > FIND_PACKAGE(LAPACK) > > # I should test with BLAS_FOUND and LAPACK_FOUND here but that's not the > problem > If they're actually required then you can skip the additional check by calling: FIND_PACKAGE(BLAS REQUIRED) FIND_PACKAGE(LAPACK REQUIRED) This will cause

Re: [CMake] Changes to CMAKE_CXX_FLAGS_RELEASE not reflected in GUI

2015-07-23 Thread Chuck Atkins
> Is this the intended behavior? Yes. The GUI is essentially an editor for the CMake cache. These variables are persistent with global scope. As such, only the cache values are reflected in the GUI. When you set the CMAKE_CXX_FLAGS_RELEASE with this form of the set command, you are changing i

Re: [CMake] find_package

2015-04-24 Thread Chuck Atkins
Hi Matt, 1) (... set boost_root ...) > 2) FIND_PACKAGE(Boost 1.57 COMPONENTS log thread filesystem system) > If you're using CMake >= 3.0, then there's a Boost_NAMESPACE variable you can set that will cause the find module look for mangled library names line myboostnamespace_datetime instead of b

Re: [CMake] FIND_PATH() search custom path first

2014-11-04 Thread Chuck Atkins
Hi George, Jakub, > NO_DEFAULT_PATH > > NO_CMAKE_ENVIRONMENT_PATH > > NO_CMAKE_PATH > > NO_SYSTEM_ENVIRONMENT_PATH > > NO_CMAKE_SYSTEM_PATH > The options specified are redundant. NO_DEFAULT_PATH implies the later 4. If you just specify NO_DEFAULT_PATH then only HINTS and user guess pa

Re: [CMake] Specifying different compilers for subsets of a project

2014-10-16 Thread Chuck Atkins
Hi George, > The obvious way to compile front-end tools is to create another directory, > e.g., "front-end-build" and run cmake therein to re-configure and build > with a front-end compiler. > > However, since only a relatively small subset of the files needs to be > compiled for the front-end,

Re: [CMake] FW: Parallel GNU make issue

2014-09-11 Thread Chuck Atkins
Hi Gary, Do you see either of these two warning messages show up: "warning: -jN forced in submake: disabling jobserver mode." or "warning: jobserver unavailable: using -j1. Add `+' to parent make rule." These warnings often accompany the forced serialization of a parallel make build, although us

Re: [CMake] Link step more than once

2014-09-11 Thread Chuck Atkins
Sounds like what you want is an object library, http://www.cmake.org/Wiki/CMake/Tutorials/Object_Library: set(FOO_SOURCES Foo1.cxx Bar2.cxx FooBar3.cxx ) add_library(FooObjLib OBJECT ${FOO_SOURCES}) add_executable(A $) set_target_properties(A PROPERTIES LINK_FLAGS "/Special /Flags /For /A")

Re: [CMake] Ctest building with Multiple Processors

2014-09-05 Thread Chuck Atkins
e packaged. We are eventually going to try to get "nightlies" of our > software going also. > > Thanks > Mike Jackson > dream3d.bluequartz.net > github.com/dream3d/dream3d > > On Sep 5, 2014, at 9:33 AM, Chuck Atkins wrote: > > > > > Actually my interpretati

Re: [CMake] Ctest building with Multiple Processors

2014-09-05 Thread Chuck Atkins
> Actually my interpretation of the manual says that the _tests_ will be run > in parallel. What I want is the _Build_ to be run in parallel. > Indeed that is just the parallel test execution. Parallel build is usually generator specific, controlled through CTEST_BUILD_FLAGS. For example: if you

Re: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ...

2014-09-04 Thread Chuck Atkins
> Command `if(a MATCHES ...)` has the same flaw: `if( > MATCHES regex)`: > .. > set(MYSTRING "B") > set(A "MYSTRING") > if("${A}" MATCHES "^MYSTRING$") > # do *not* go here even A is MYSTRING (use *variable* MYSTRING) > endif() > This should work without dereferencing A, i.e.: if(A MATCHES "^M

Re: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ...

2014-09-03 Thread Chuck Atkins
> But is there a way to check if the value of the variable a equals to "b" or "c"? Directly: if(a STREQUAL "b" OR a STREQUAL "c") But its a bit clumsy. Better would be to match a regex: if(a MATCHES "^(b|c)$") -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ

Re: [CMake] set(a b); set(b c); if(a STREQUAL b OR a STREQUAL c) ...

2014-09-03 Thread Chuck Atkins
Hi Clark The expression inside the if statement has it's variables dereferenced before evaluating and the non-variables are treated as constant expressions. In this case, a resolves to "b", b resolves to "c", and c is not a variable so it's treated as the constant expression "c". Thus if(a STRE

Re: [CMake] Merge "VS: Use full path to sources to allow deeper trees with VS >= 10" fix to release

2014-09-01 Thread Chuck Atkins
> > The next major release will likely be CMake 3.1 -- and the fix you've > found will be in that release automatically, as it will be based on > 'master' when it is created. > > Related, it should also include support for extended length paths at the cmake level. This converts paths to the specia

Re: [CMake] Autotools->cmake: Are these checks really needed anymore?

2014-08-30 Thread Chuck Atkins
On Sat, Aug 30, 2014 at 10:30 AM, Rolf Eike Beer wrote: > > # Checks for typedefs, structures, and compiler characteristics. > > #AC_C_CONST > > #AC_C_INLINE > ... > > #AC_TYPE_SIZE_T > ... > > #AC_C_RESTRICT > > #AC_C_VOLATILE > These should be generally safe to assume > #AC_STRUCT_TM > > #AC

  1   2   >