[CMake] Windows build behavior change

2020-03-06 Thread J Decker
I'm building this new windows system... I installed the latest cmake
I'm attempting to build this project with visual studio
1) it couldn't find an assembler until I put gcc in the path (i'm not sure
what part is requiring assembly I'll dig into that later)  I added NASM to
the path, and that didn't help.

2) I've been specifying libraries to link against as just their name in my
cmakelists files; so that I can build with gcc and get 'libodbc32.a' or
MSVC and get 'odbc32.lib'  but the .lib extension isn't being added to the
libraries specifed in the generated VS(2019) project files
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org


Re: [CMake] Missing dll on program startup - a way automate it?

2019-11-21 Thread J Decker
Can also add install rules so you get an INSTALL target, and then you can
just build that, and everything will end up in the right place.


On Thu, Nov 21, 2019 at 3:56 AM Fred Baksik  wrote:

> Adding the relevant directories to PATH in the debugger or build
> environment should allow them to be found.
>
> On Wed, Nov 20, 2019, at 3:32 AM, Petr Kmoch wrote:
>
> Hi.
>
> I haven't used it yet, but I believe the target property
> https://cmake.org/cmake/help/latest/prop_tgt/VS_DEBUGGER_ENVIRONMENT.html
> might help you.
>
> Petr
>
> On Wed, 20 Nov 2019 at 01:02, cen  wrote:
>
> Hi
>
> Perhaps not really a cmake problem but here we go. An exe depends on a
> few DLLs which I ship in the repo so the rest of the devs don't have to
> build them or fetch them somewhere else. Cmake finds the libraries and
> project builds just fine, until you run it from VS.. you are welcomed by
> the "missing dll" windows error. So I have to copy all the dlls to the
> build/run folder to make it work but this is a manual step. Is there
> some way in cmake/VS to somehow tell the IDE to append the execution
> $PATH with all the specified library dependencies or something along
> those lines? Ideally my goal is to just run cmake, open VS, build the
> project and run, all automagical.
>
> I would prefer to keep the dynamic linking.
>
>
> Best regards, cen
>
> --
>
> Powered by kitware.com/cmake
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit https://cmake.org/services
>
> Visit other Kitware open-source projects at
> https://www.kitware.com/platforms
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
> This mailing list is deprecated in favor of https://discourse.cmake.org
>
> --
>
> Powered by kitware.com/cmake
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit https://cmake.org/services
>
> Visit other Kitware open-source projects at
> https://www.kitware.com/platforms
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
> This mailing list is deprecated in favor of https://discourse.cmake.org
>
>
> --
>
> Powered by kitware.com/cmake
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit https://cmake.org/services
>
> Visit other Kitware open-source projects at
> https://www.kitware.com/platforms
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
> This mailing list is deprecated in favor of https://discourse.cmake.org
>
-- 

Powered by kitware.com/cmake

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit https://cmake.org/services

Visit other Kitware open-source projects at https://www.kitware.com/platforms

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

This mailing list is deprecated in favor of https://discourse.cmake.org


Re: [CMake] ExternalProject_Add Visual Studio build Install Target

2019-10-20 Thread J Decker
On Sat, Aug 31, 2019 at 9:56 PM J Decker  wrote:

> Why does it seem I'm the only one with this problem?
>

This is an external CMakeLists.txt that fails.

cmake_minimum_required(VERSION 3.15)

set_property(GLOBAL PROPERTY USE_FOLDERS On)

project( B )
include( ExternalProject )

add_executable( b b.c )

## Specifically this line causes the fails #
SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "install" )

install( TARGETS b )
-





A full Test  ...
--- CMakeLists.txt---
cmake_minimum_required(VERSION 3.15)

if( NOT EXISTS b )
file(MAKE_DIRECTORY b)
file( WRITE b/b.c "#include \nint main(void) { printf(
\"Program.\\n\" ); }" )
file( WRITE b/CMakeLists.txt  "cmake_minimum_required(VERSION
3.15)\n\nset_property(GLOBAL PROPERTY USE_FOLDERS On)\n\nproject( B
)\ninclude( ExternalProject )\n\nadd_executable( b b.c
)\nSET_TARGET_PROPERTIES(b PROPERTIES\n  FOLDER \"install\"
)\n\ninstall( TARGETS b )\n" )

endif( NOT EXISTS b )

set_property(GLOBAL PROPERTY USE_FOLDERS On)

project( Test )

include( ExternalProject )

ExternalProject_Add( b
PREFIX b-src
SOURCE_DIR ${CMAKE_SOURCE_DIR}/b
BINARY_DIR b_exe
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
BUILD_ALWAYS 1
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
-DCMAKE_BUILD_TYPE:PATH=${CMAKE_BUILD_TYPE}
)

--- End CMakeLists.txt---

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=output
cmake --build . --target install

Error Output:
 MSBUILD : error MSB1009: Project file does not exist.
[M:\tmp\cmake_vs_install\build\b.vcxproj]
  Switch: install


---

  SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "Install" ) # capitalize I
bypasses the issue
  SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "Install and Deploy" ) # make
it really log also bypasses the issue...

otherwise capitalizing --target INSTALL in the ExternalProject.cmake, for
visual studio, also fixed the problem, since the real target is 'INSTALL'
and not 'install'
-- 

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] How to make a hierarchical application using CMake?

2019-10-14 Thread J Decker
In the build directory, the build rules are generally like the would be in
the source too... so you can just go into src/libwhatever and do 'make' in
that branch.
like if your target was visual studio or some IDE, you could click on a
single project to build, and it would of course  check and build related
projects.

basically you don't even need ../ inclusions just a root that
add_subdirectory( lib1 ) ... 2, 3, utils (which itself adds other utiliy
thins that reference other lib targets )...


On Mon, Oct 14, 2019 at 11:11 AM Fred Baksik  wrote:

>
>
> On Mon, Oct 14, 2019, at 9:13 AM, David Aldrich wrote:
>
> Hi
>
>
>
> I am trying to convert a large software project from makefiles to CMake.
> The project is organised as a set of shared ‘star’ libraries, linked to a
> static ‘kernel’ library. The current directory arrangement is:
>
>
>
> |--stars
>
> | |-- star1_lib
>
> |  |-- source files
>
> |  |-- makefile
>
> | |-- star2_lib
>
> |  |-- source files
>
> |  |-- makefile
>
> | |-- solibs
>
> |  |-- Release
>
> | |-- .so files
>
> |
>
> |--kernel
>
> | |-- source files
>
> | |-- makefile
>
> | |-- Release
>
> |  |-- kernel.a
>
> |
>
> |--application
>
>   |-- makefile
>
>   |-- Release
>
>|-- myapp.exe
>
>
>
> In high-level terms, how could I implement this using CMake, such that
> invoking ‘make’ in directory ‘application’ invokes a make of each shared
> and static library, and links them to form ‘myapp.exe’?
>
>
>
> (I understand the basics of CMake, the issue here is how to handle the
> make of source code and libraries spread across a directory hierarchy).
>
>
>
> Best regards
>
>
>
> David
>
>
>
> add_subdirectory() can accept relative paths to outside the "root" source
> tree.
> So the main CMakeLists.txt would be located in ./application.
> Then do:
> add_subdirectory(../kernel kernel)
> add_subdirectory(../stars/stars1_lib stars1_lib)
>
> ./kernel/CMakeLists.txt would list it's files, and etcetera.
>
> I've use this method in the past for handling applications that are meant
> to target Windows, Linux, and embedded systems.
> Then by using variables to determine with platform / target ertain kernel
> and library characteristics are used.
> Everything is built in the build directory for that particular platform /
> target.
> This allows for app_target1, app_target2, app_target3, ..., build
> directories to be totally independent.
>
> --
> F
> --
>
> 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
>
-- 

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] ?==?utf-8?q? Looking for an explanation: What exactly means "install" in cmake language?

2019-10-07 Thread J Decker
A note - INSTALL( FILES ) is only good for data files, if you have scripts
that have executable permissions using INSTALL( PROGRAMS ) will get execute
flag set too.

On Mon, Oct 7, 2019 at 7:49 AM Cornelis Bockemühl 
wrote:

> Thanks to both you and J Decker: I would say that this is still the part
> that I understood! So basically the word "install" in cmake language could
> be replaced by "copy" more or less in common human language - right?
>
> But then, if it is about "installing" a "target", which is libraries in my
> case, I would expect the shared libraries to be copied - no?
>
> Targets use  ,... depending on add_executable, or add_library was used(
and/or if STATIC/SHARED is specified in add library )


> And this is exactly what does not happen - for no obvious reason! Because
> some days ago it even happened in my project ONCE - and then not any more.
> But debugging is not easy because since that moment I changed many things,
> and basically the reason for my question is that I have no clear idea what
> EXACTLY should happen if I put a
>
> install(TARGETS mylibrary)
>
I usally put it immediately after the thing that added the target...

>
> into my CMakeLists.txt. Well, like you explained, and like what I also
> thought I had understood: nothing should happen during the configure and
> generate runs of cmake, and also not during the "ninja all" build run, but
> only during the "ninja install". or else cmake --build . --target install
> (which in turn calls ninja in my case). Indeed I observed that it does a
> build for "all" first if the initial project is not up to date.
>
right, it's an 'install' target.. make install ; ninja install, ... etc ya

>
> But then it tells me that it is successfully "installing" mylibrary, but I
> see no shared library appearing in the install tree! Or rather: it happened
> once, but not any more - and I should find out what is missing...
>
When I have issues like that, `cmake --trace ...`  option gives a good idea
of what cmake thinks it's doing...  or maybe ninja V=1 install ?
It is copy-if-different, so if the build re-builds and generates the same
output library it won't re-install...

You can set set( CMAKE_INSTALL_MESSAGE "LAZY" )  which only emits messages
for things it actually installs (just a side note)

But I don't know why it's not going where you think it is ( somewhere in
CMAKE_BINARY_DIR IIRC?  or did you use CMAKE_CURRENT_BINARY_DIR which can
be deeply in install)  I do often set my install to 'output' which by
default is put into the build directory...


> My current workaround is indeed that I am trying to avoid the install step
> altogether and build a crazy construction with configure_file stuff in
> order to get the libraries to the right place - and I know pretty well that
> this is NOT the way how things should be done properly. But I am afraid I
> will be ready with this workaround way faster than I will understand what
> is going on during this miraculous "install" process! --
>
> 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
>
-- 

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] Looking for an explanation: What exactly means "install" in cmake language?

2019-10-07 Thread J Decker
Install steps are done with `cmake --build . --target install`  (or
--target INSTALL on some generators)
It's done after the build is complete, if the build step fails, it will not
install.  (Install depends on build automatically)

The install steps can also be used by --target package - which you can use
a packager to .tar.gz or NSIS(?) Executable or.  It needs some CPACK
instructions set.


On Mon, Oct 7, 2019 at 6:44 AM Cornelis Bockemühl 
wrote:

> Constantly I am stumbling over the word "install" in the context of cmake
> scripts - while it is pretty clear that the word cannot mean what nowadays
> people would understand by that term! But even reading the docs forwards
> and backwards, studying examples and some generic cmake tutorials I still
> do hot have a PRECISE idea about what it is actually doing and what the
> purpose is. Well, I can see everywhere HOW it is done - but it is sometimes
> an advantage if you also know WHAT!
>
> I know that this question is probably so stupid that I do not really
> expect anybody to answer it here in the mailing list, but maybe somebody
> can point me to a resource that explains it in a language that a "mere
> mortal programmer" can follow?
>
> So far I have a certain kind of understanding, and sometimes it looks like
> this is correct, but then again I have my certain doubts. I am using
> install(TARGETS), install(FILES) and install(EXPORT) so far, and the way I
> am doing it I mostly picked from some general intros and tutorials. And
> from what I understand, this is what I expect to happen:
>
> install(FILES): some files are copied from some location in the build tree
> to some installation location
> install(EXPORT): some cmake script is written that a "derived" project can
> call (through find_package) in order to get knowledge about my project
> install(TARGET): not really an idea what should happen: also some copying
> from build tree to installation tree I suppose
>
> Now I also learned that the install step does not happen during a normal
> build "all" - like "ninja all", but requires an extra "ninja install" step.
> And also I saw that you can adapt the target of the installation process
> like this in your project - if you never ever expect the build to be
> "installed" anywhere else:
>
> set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/../install CACHE PATH
> "" FORCE)
>
> With this I would expect to generate an install folder in parallel to the
> bin, lib64 and other folders in the build tree, collecting there all the
> "products" of the build for further processing by a derived project.
>
> But what I see is actually - almost nothing!
>
> Well, the install(FILES) actually copies a file, and the install(EXPORT)
> indeed generates a cmake script, but from the install(TARGET) I see no
> effect: the install folder remains completely empty! Still I see in the log
> many things like "Installing: /.../install/bin/" - but I never
> find then  in that indicated location. But yes, it said
> "installing", not "copying" - so I am back to my initial question: what the
> hell is "installing" in cmake language?
>
> So basically my problem is: I cannot judge whether my script is working
> because I simply do not know what SHOULD be the effect of install(TARGET)!
>
> Ah yes, my build tree is after a "normal build" ("all", not "install")
> full of cmake_install.cmake files that would probably have something to do
> with that "installation" process, but what? Am I supposed to call them on
> any occasion or are they supposed to be called automatically at some moment?
>
> Finally, I managed to get also some find_package() working for my project.
> The "heart" of this is a Config.cmake script that I am generating
> during the project build, and which I can write in whatever way I want. For
> example, I am reading everywhere that I am supposed to do an
> install(EXPORT) in order to make that find_package() happen, but since I do
> not really understand what it is supposed to do, and I also see that I can
> simply write that Config file in such a way that it picks things from where
> the build process puts them, I do not really see the point.
>
> In other words: I tend to simply write config scripts for the import that
> rely on the build tree and simply skip that install step - because getting
> this to work is so difficult if you never know what is supposed to happen
> how and at what stage of the process and under which conditions!
>
> But then I see that others are still using the install() steps, so there
> is probably still some meaning in it...
>
> So IF such a thing exists, like a comprehensive explanation about what
> "install" actually means and what it is supposed to do at what stage of the
> process, I would be very happy and thankful!
>
> Best regards,
> Cornelis
>   --
>
> 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 

Re: [CMake] Single library with both shared and static binaries

2019-09-26 Thread J Decker
I ended up using external_project() because unless you also copy the source
files, each source file each only gets one set of flags... so if you have
different compile options (the config file I suppose) the sources will only
build with one or the other.

If you copy all of the sources to the CMAKE_BiNARY_DIR (which can be done
passing a list of sources to a macro, which can then extract the path part
and append it) then use copy_file_if_different()  (And I additionally touch
that file to make sure the copy definitely gets built when it dos get
copied)  then you can build two targets with different options for the
sources.

Otherwise, an internal external project works pretty well.
https://github.com/d3x0r/SACK/blob/master/binary/CMakeLists.txt#L61

I kinda moved away from building both dynamic static libaries,and the
static binaries are just external projects that reference the original
sources.


On Thu, Sep 26, 2019 at 1:06 PM Avraham Shukron 
wrote:

> There is no hard requirement for shipping both static and shared. With the
> back against the wall I could get away with SHARED only, since it is the
> most common way the library will be consumed. I wanted to also distribute a
> static version just for those who want a single, self-contained executable.
>
> I understand that static and shared libraries ARE in fact two different
> target, but for the most part they are configured the same way and have the
> same properties.
>
> The fact that the recommended practice is to NOT specify SHARED / STATIC
> in add_library and let the user decide which one to compile using
> BUILD_SHARED_LIBS, proves that a library target is expected to be
> independent on whether it is compiled as a shared object or static library.
>
> I agree that it would be great to have the ability to produce both shared
> and static binaries from a single library target, although we need to think
> of how users importing such target, will be able to specify if they want to
> link against the static or the shared binary.
>
>
> On Thu, Sep 26, 2019 at 5:38 PM Juan Sanchez 
> wrote:
>
>> Here is an example where two libraries are created from object files that
>> have only been compiled once:
>>
>> ADD_LIBRARY(symdiff_objects OBJECT ${CXX_SRCS} ${MC_SRCS})
>> set_property(TARGET symdiff_objects PROPERTY POSITION_INDEPENDENT_CODE ON)
>> ADD_LIBRARY(symdiff_dynamic STATIC $)
>> ADD_LIBRARY(symdiff SHARED $)
>>
>> The "symdiff_dynamic" library is a static archive that can then be linked
>> into another shared library or an executable. The "symdiff" library is a
>> standalone object.  The POSITION_INDEPENDENT_CODE property is required for
>> the linux platform, but not for macOS or Windows.  If the original poster
>> is comfortable with having a PIC static library, this is an approach they
>> can take.
>>
>> Regards,
>>
>> Juan
>>
>> On Wed, Sep 25, 2019 at 8:43 AM Kyle Edwards via CMake 
>> wrote:
>>
>>> On Tue, 2019-09-24 at 23:41 +0300, Avraham Shukron wrote:
>>> > Hi!
>>> >
>>> > I have a library which I want to distribute in both shared object and
>>> > static library forms.
>>> > Is there a modern way to do it without creating two completely
>>> > separate library targets?
>>> > Since I want to be a good CMake citizen I use `target_*` and
>>> > `set_target_properties` as much as possible, and creating two
>>> > different libraries will force me to duplicate that information about
>>> > each one of them.
>>> >
>>> > I also tries not specifying STATIC/SHARED, and then running cmake
>>> > twice - once with BUILD_SHARED_LIBS=ON and once OFF and then
>>> > installing to the same directory. I got my both .a and .so libraries
>>> > installed, but I couldn't get the Config file correctly for this
>>> > arrangement.
>>> >
>>> > So - what is the community-recommended pattern to do this?
>>>
>>> Unfortunately, the recommendation is to do exactly what you don't want
>>> to do: create a shared target and a static target.
>>>
>>> To make this slightly simpler, you can use functions to de-duplicate
>>> the target_* and set_target_properties calls:
>>>
>>> function(create_foo_target name type)
>>>   add_library(${name} ${type} foo.c foo.h)
>>>   set_target_properties(${name} OUTPUT_NAME foo)
>>> endfunction()
>>>
>>> create_foo_target(foo_shared SHARED)
>>> create_foo_target(foo_static STATIC)
>>>
>>> Kyle
>>> --
>>>
>>> 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:
>>> 

Re: [CMake] ExternalProject_Add Visual Studio build Install Target

2019-08-31 Thread J Decker
Why does it seem I'm the only one with this problem?
I've recently updated this other portable system while I'm on the road, and
the latest version of course fails the same way.

 The Current build output

1>-- Build started: Project: intershell
(ExternalProjectTargets\intershell\intershell), Configuration:
RelWithDebInfo x64 --
1>  Performing install step for 'intershell'
1>  Microsoft (R) Build Engine version 14.0.23107.0
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>MSBUILD : error MSB1009: Project file does not exist.
1>  Switch: install
== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==

-
share\cmake-3.15\Modules\ExternalProject.cmake
line 1853

  if(step STREQUAL "INSTALL")
list(APPEND args --target install)
  endif()


Change to
  if(step STREQUAL "INSTALL")
list(APPEND args --target INSTALL)
  endif()

 ---

And then the output looks like
 --
1>-- Build started: Project: intershell
(ExternalProjectTargets\intershell\intershell), Configuration:
RelWithDebInfo x64 --
1>  Performing install step for 'intershell'
1>  Microsoft (R) Build Engine version 14.0.23107.0
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>InterShell.Service.vcxproj ->
M:\javascript\sack-gui\build\sack-src\src\intershell-build\service.shell\RelWithDebInfo\InterShell.Service.exe
..
(completes successfully )



On Thu, Apr 25, 2019 at 1:27 AM J Decker  wrote:

> I've had to make this modification the last few versions...
>
> cmake/share/cmake-3.14/Modules/ExternalProject.cmake
>
> line 1870 from
>
>   if(step STREQUAL "INSTALL")
> list(APPEND args --target install)
>   endif()
>
> to
>
>   if(step STREQUAL "INSTALL")
> list(APPEND args --target INSTALL)
>   endif()
>
> Otherwise, when building with visual studio, and trying to run the
> -install.rule  rule, it says 'no such project'
>
> I don't think the same issue happens when building from the command line.
>
-- 

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] How to specify VS2017 compilers when on VS2019

2019-08-16 Thread J Decker
can just specify the 2017 generator, 2019 will load an build it just fine.
If 2017 is still opening when you double-click a solution, change your
default handler for .sln files to 2019.

Again, 2019 can build projects as is for 2017, 2015, etc...

On Fri, Aug 16, 2019 at 11:19 AM Michael Jackson <
mike.jack...@bluequartz.net> wrote:

> Why can't I do -T v141?
>
> --
> Mike Jackson
>
> On 8/16/19, 2:09 PM, "Kyle Edwards"  wrote:
>
> On Fri, 2019-08-16 at 13:54 -0400, Michael Jackson wrote:
> > What are the values to the -T argument that are to be used so that I
> > can use VS2019 but have the 2017 compilers?
>
> Rather than using a -T argument, you want to set the CC environment
> variable or -DCMAKE_C_COMPILER on the command line (likewise for CXX
> and CMAKE_CXX_COMPILER.)
>
> Kyle
>
>
>
> --
>
> 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
>
-- 

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] Cmake Path Please

2019-07-30 Thread J Decker
THere's (some) error messages that don't include the full path of the
CMakeLists.txt, so I don't know what 'top level' is.

It would be nice if CMakeLists.txt had the full ${CMAKE_SOURCE_DIR} (?)
prepended to it.

This is built as an external project of another top level project, which
itself is built from some other top level cmakelists.txt.

```
[636/1094] Performing configure step for 'sack_vfs_command_portable'
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
```
-- 

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] how to set current source directory relative to external project

2019-07-09 Thread J Decker
On Tue, Jul 9, 2019 at 1:24 PM hex  wrote:

> On 09/07/2019 18:25, J Decker wrote:
>
>
> On Tue, Jul 9, 2019 at 9:38 AM hex  wrote:
>
>>
>> I think the better solution now is to make it relative to build directory
>> and force out of source builds.
>>
>>
>> +1 I think; You said it was generated?  It should be in the build
> directory anyway :)
> And out of source always.  (makes it easier to source version control)
>
>
> Now that I look at it it seems very obvious. I still have doubts, though:
>
> I guess I am seeing the contents of a build directory as somewhat
> volatile. For most files I want that, to either clean the project or
> override the files.
>
> But what about files I want to archive, such as a tarball or zipped
> documentation: does it make sense to place them into the build directory?
> The files belong to the project, though are not source controlled but
> aren't install targets either.
>
I don't know what sorts of files those are; they don't exist but they get
created, they're not tracked, and not installed...
They sounds like a build product, which is a target, (even it it's just
part of a product, it's still a target)


> Another thing I noticed is that my CMAKE_GENERATOR are now buried in
> subfolders. To change that I set PREFIX "${CMAKE_BINARY_DIR}/workspaces".
> Now all external projects are using the same prefix and are therefore
> generated into the same directory 'workspaces'.
>
right ?

> I could even set PREFIX "${CMAKE_SOURCE_DIR}/workspaces" which I'd
> actually prefer.
>
that makes it an insource product, which, if it's not in source control
shouldn't be in the source

> The default binary directory is per project so I'd also change this to
> BINARY_DIR=${CMAKE_BINARY_DIR}
>
there's CMAKE_CURRENT_BINARY_DIR and that's per project, otherwise
CMAKE_BINARY_DIR is a constant for all things within a single cmake
invocation.

> I'm not concerned about *how* to do it but rather *if* it should be done.
> The documentation recommends to stick with the defaults.
>
>
> Any thoughts on this?
> --
>
> 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
>
-- 

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] how to set current source directory relative to external project

2019-07-09 Thread J Decker
On Tue, Jul 9, 2019 at 9:38 AM hex  wrote:

> thank you J Decker for your reply.
>
>
> Your suggestion does work but I want to preserve standalone use of the
> project, meaning that I want a reference to CMake source root directory.
>
> Assuming there is only 1 hierarchy I could add an option:
>
>
> if ( SUPERBUILD )
>
> *message("${CMAKE_SOURCE_DIR}/.. = /home/user/super/ext1/..")*
>
> *else ()*
>
> *message("${CMAKE_SOURCE_DIR} = /home/user/super/ext1")*
>
> endif ()
>
>
> I think the better solution now is to make it relative to build directory
> and force out of source builds.
>
>
> +1 I think; You said it was generated?  It should be in the build
directory anyway :)
And out of source always.  (makes it easier to source version control)


> On 09/07/2019 14:26, J Decker wrote:
>
>
>
> *message("${CMAKE_SOURCE_DIR}/.. = /home/user/super/ext1/..")*  which ==
> /home/user/super
>
>>
>>
>> --
>
> 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
>
-- 

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] how to set current source directory relative to external project

2019-07-09 Thread J Decker
On Tue, Jul 9, 2019 at 5:35 AM hex  wrote:

> hello CMake community,
>
>
> I am experimenting with external projects. I have some files in an
> external project which are generated in `${CMAKE_SOURCE_DIR}`.
>
>
> When I add the external project, however, it is using
> `${CMAKE_SOURCE_DIR}` of the external project.
>
>
> I need `${CMAKE_SOURCE_DIR}` to be relative to the "super build", instead
> of the external project path.
>
>
> Example:
>
> *message("${CMAKE_SOURCE_DIR} = /home/user/super")*
>
> *ExternalProject_Add(ext1*
> *# directory options*
> *SOURCE_DIR  "${CMAKE_SOURCE_DIR}/ext1"*
> *)*
>
>
> ${CMAKE_SOURCE_DIR}/ext1/CMakeLists.txt:
>
>
> *message("${CMAKE_SOURCE_DIR} = /home/user/super/ext1")*
>

*message("${CMAKE_SOURCE_DIR}/.. = /home/user/super/ext1/..")*  which ==
/home/user/super

>
>
>
> The desired outcome would be to have the path /home/user/super in both
> messages.
> How can I do this?
>
>
> thank you
> --
>
> 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
>
-- 

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] CMake is Converting lists to strings

2019-06-12 Thread J Decker
I know... just need to rebuild a new list... something like

 set( _ALL_INCLUDES )
foreach( INC ${ALL_INCLUDES})
string(REPLACE "../" "" INC ${INC})
LIST( APPEND _ALL_INCLUDES ${INC} )
endforeach( INC )
set( ALL_INCLUDES ${_ALL_INCLUDES})

On Wed, Jun 12, 2019 at 3:10 AM J Decker  wrote:

> I'm collecting sources and includes into a parent scope variable, and then
> attempting to use that variable to reference the right sources.
> Sources get added to the list as ../(theirpath)/(source) so in the parent
> level I can simply replace "../" with "" and then they are relative in the
> right place.
> This works; as far as, the includes, sources and defines get all collected
> into the top level, but when i try to remove the ../ the list gets
> converted into a string.
>
> # Create a list of things
> set( SIMPLE_LIST -I../lib1/include -I../lib2/include -I../lib3/include )
> # set a variable using that list...
>   set( AMALG_COMMAND echo ${SIMPLE_LIST}  )
> # this outputs
> COMMAND:echo;-I../lib1/include;-I../lib2/include;-I../lib3/include
>   message( "COMMAND:${AMALG_COMMAND}")
>
> # replace ../ with nothing
> STRING( REPLACE "../" "" SIMPLE_LIST ${SIMPLE_LIST} )
> # re-set a variable with the eventual command to run
>   set( AMALG_COMMAND echo ${SIMPLE_LIST}  )
> # this outputs COMMAND:echo;-Ilib1/include -Ilib2/include -Ilib3/include
>   message( "COMMAND:${AMALG_COMMAND}")
>
> When that final command actually gets run in a
>   add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/out.c   COMMAND
> ${AMALG_COMMAND}  )
>
> Then the command is 'echo "-Ilib1/include -Ilib2/include -Ilib3/include"'
> which is incorrect.
>
>
> I tried first LIST(JOIN) but that defiantly makes a string and doesn't
> help.
> string(REPLACE " " ";" SIMPLE_LIST ${SIMPLE_LIST})  to try and reverse it
> back to a list doesn't seem to help...
>
-- 

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] CMake is Converting lists to strings

2019-06-12 Thread J Decker
I'm collecting sources and includes into a parent scope variable, and then
attempting to use that variable to reference the right sources.
Sources get added to the list as ../(theirpath)/(source) so in the parent
level I can simply replace "../" with "" and then they are relative in the
right place.
This works; as far as, the includes, sources and defines get all collected
into the top level, but when i try to remove the ../ the list gets
converted into a string.

# Create a list of things
set( SIMPLE_LIST -I../lib1/include -I../lib2/include -I../lib3/include )
# set a variable using that list...
  set( AMALG_COMMAND echo ${SIMPLE_LIST}  )
# this outputs
COMMAND:echo;-I../lib1/include;-I../lib2/include;-I../lib3/include
  message( "COMMAND:${AMALG_COMMAND}")

# replace ../ with nothing
STRING( REPLACE "../" "" SIMPLE_LIST ${SIMPLE_LIST} )
# re-set a variable with the eventual command to run
  set( AMALG_COMMAND echo ${SIMPLE_LIST}  )
# this outputs COMMAND:echo;-Ilib1/include -Ilib2/include -Ilib3/include
  message( "COMMAND:${AMALG_COMMAND}")

When that final command actually gets run in a
  add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/out.c   COMMAND
${AMALG_COMMAND}  )

Then the command is 'echo "-Ilib1/include -Ilib2/include -Ilib3/include"'
which is incorrect.


I tried first LIST(JOIN) but that defiantly makes a string and doesn't help.
string(REPLACE " " ";" SIMPLE_LIST ${SIMPLE_LIST})  to try and reverse it
back to a list doesn't seem to help...
-- 

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] Question about getting git branch name.

2019-06-08 Thread J Decker
On Sat, Jun 8, 2019 at 3:25 PM Steven Truppe  wrote:

> Hi everyone,
>
> i want to have code lines like:
>
> #define BUILD_VERSION
>
> and the BUILD_VERSION should be the name of the actual branch the code
> was compiled with, this way i can create a branch for each version and
> name it like 0.1 so each version i'm using for release is an own branch.
>
> I found many examples that shows me the branch name (like git status)
>
git branch
Hmm this shows a list of things, have to extract the one with a * on the
beginning... cam probably use CMAKE list functions on the output.


EXECUTE_PROCESS(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND git rev-list
--max-count=1 HEAD OUTPUT_VARIABLE CURRENT_REPO_REVISION )

gives me the last hash...

but i don't know a way to get only the name of the current branch so i
> can for example execute_process to get the revision number into a
> variable and then use add_definition(..) to add it as a compile definition.
>
>
> best regards!
>
> --
>
> 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
>
-- 

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] MSVC: How to configure manifest settings?

2019-05-02 Thread J Decker
Depends on your generator.  It can be as simple as including the .manifest
in your sources list.
Otherwise you may have to make an extra mt.exe invokation...

https://github.com/d3x0r/SACK/blob/master/src/utils/service/CMakeLists.txt#L42-L53


On Thu, May 2, 2019 at 12:48 AM Fredrik Orderud  wrote:

> Hi,
> I'm working on a project where I need to configure non-default
> manifest settings when building on Windows. More specifically, I need
> to inject the following tags in the generated vcxproj project:
> 
>   $(TargetName)$(TargetExt)
>   AdditionalRegEntries.rgs
> 
>
> Any advise on how to achieve this from CMake?
>
> I've already thought about writing a custom script to modify the
> generated vcxproj file, but want to avoid that if possible.
>
> Thanks in advance,
> Fredrik Orderud
> --
>
> 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
>
-- 

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] ExternalProject_Add Visual Studio build Install Target

2019-04-25 Thread J Decker
I've had to make this modification the last few versions...

cmake/share/cmake-3.14/Modules/ExternalProject.cmake

line 1870 from

  if(step STREQUAL "INSTALL")
list(APPEND args --target install)
  endif()

to

  if(step STREQUAL "INSTALL")
list(APPEND args --target INSTALL)
  endif()

Otherwise, when building with visual studio, and trying to run the
-install.rule  rule, it says 'no such project'

I don't think the same issue happens when building from the command line.
-- 

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] Add Custom Command after strip

2019-04-22 Thread J Decker
I'm trying to use MingW64-x86 to compile this project. I'm using MingW
Makefiles as the generator.

Some of the executable files need 'mt.exe' run to add a manifest to them
(on windows).
The MT.exe breaks the .exe for strip such that it says 'file has been
truncated' and the build stops.  Strip is run against the executable during
release builds...

The documentation of course saying POST_BUILD on the add_custom_command
says 'after all the build steps' but apparently strip is some sort of
post-build thing itself.
-- 

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] 3.14.1 Issue with external project?

2019-04-07 Thread J Decker
>
> Sorry it's probably a user error.
>
>
-- 

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] 3.14.1 Issue with external project?

2019-04-07 Thread J Decker
Under linux, I recently updated everything, and now have cmake 3.14.1.
It's failing to build a project which has external projects with external
projects itself...

I'm not sure what a simple case is that fails.
The previous version that worked was 3.13.4 (3.12.4 also)

On Windows I was using  cmake version 3.10.0-rc3  without issue, I grabbed
the latest 3.14.1 zip and swapped to that, and it's having similar issues.

Linux defaulted initially to ninja; but I overrode that and used 'Unix
Makefiles' as a generator and the same issue happened.

The project has an external project from a git repository, which it
downloads, updates, configures, and builds; that project also has external
projects (ppc is one of them)  Well here; this log isn't huge.


-- Configuring done
-- Generating done
-- Build files have been written to:
/home/d3x0r/work/javascript/sack-gui/build/sack-src/src/sack-build
[3/5] Performing build step for 'sack'
[1/3] Performing build step for 'ppc_portable'
ninja: no work to do.
[2/3] Performing install step for 'ppc_portable'
[0/1] Install the project...
-- Install configuration: "Debug"
-- Up-to-date: /home/d3x0r/work/javascript/sack-gui/build/sack-Debug/bin/ppc
[3/3] Completed 'ppc_portable'
[4/5] Performing install step for 'sack'
[1/4] Performing build step for 'ppc_portable'
ninja: no work to do.
[2/4] Performing install step for 'ppc_portable'
[0/1] Install the project...
-- Install configuration: "Debug"
-- Up-to-date: /home/d3x0r/work/javascript/sack-gui/build/sack-Debug/bin/ppc
[3/4] Completed 'ppc_portable'
[3/4] Install the project...
-- Install configuration: "Debug"
[5/5] Completed 'sack'

---
And then it ends, and doesn't build either the second external project, or
the main project itself which depends on the external project

-

Windows is somehow getting up to installing sack, ppc like above, but then
fails with 'project file does not exist' and yet a directory of that name
shows it does exist.

  Performing install step for 'sack'  Microsoft (R) Build Engine version
14.0.25420.1
  Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
[M:\javascript\sack-gui\build\sack.vcxproj]
  Switch: install
ERR! OMG Process terminated: 1

M:\javascript\sack-gui>dir M:\javascript\sack-gui\build\sack.vcxproj
 Volume in drive M is Work3
 Volume Serial Number is 5EC6-2ABD

 Directory of M:\javascript\sack-gui\build


This branch of this repository
https://github.com/d3x0r/sack.vfs/tree/sack-gui
mkdir build
cd build
cmake -DMAKE_GUI=1 -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .


and it ends with building sack and nothing else.
-- 

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] Warning when building static & shared library (DLL) on Windows

2018-09-30 Thread J Decker
On Sun, Sep 30, 2018 at 3:12 AM Kim Walisch  wrote:

> Hi,
>
> I have recently found out about CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS which
> allows
> to easily build a shared library i.e. DLL on Windows. It works great and
> it is an awesome
> feature however I have run into a warning on Windows (using cmake, ninja,
> MSVC) because
> my CMakeLists.txt builds both a static and shared library.
>
> Here is what my CMakeLists.txt does:
>
> if(WIN32)
> set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
> endif()
>
> add_library(mylib SHARED ${LIB_SRC})
>
make this 'mylib-sh'

> ...
> add_library(mylib STATIC ${LIB_SRC})
>
make this 'mylib-st'

> ...
>
> This works without any issues on all Unix-like OSes. However on Windows
> with MSVC I found
> out that building the shared library creates both mylib.dll and mylib.lib.
> And building the static
> library also creates mylib.lib which causes ninja to issue the following
> warning:
>
> ninja: warning: multiple rules generate mylib.lib. builds involving this
> target will not be correct; continuing anyway [-w dupbuild=warn]
>
> So my question is how to best deal with this warning:
>
> 1) Should I ignore it?
>
you need the .lib to later link to the .dll so no...

>
> 2) Should I use add_library(... MODULE ...) instead of SHARED on Windows?
> The ninja
> maintainer's have suggested this when another user reported the issue here:
> https://github.com/ninja-build/ninja/issues/1128#issuecomment-207058115
>
> One issue I see with this approach is that apparently when building a
> shared library using
> add_library(... MODULE ...) one should avoid
> using target_link_libraries(binary mylib)
> as mentioned in this stackoverflow answer:
> https://stackoverflow.com/a/4968940/363778
> However the author of the stackoverflow answer also mentions that on
> Windows you
> could probably still use target_link_libraries(binary mylib)!?
>
> 3) Or is there another known workaround for this issue.
>
Could just use unique names.
There's little use in practice in linking against both... if you really
want to do both and have it be either
just use add_library and let the user of the library deside if static or
shared should be enabled.

>
> Thanks,
> Kim
> --
>
> 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
>
-- 

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] How to duplicate a source file and rename it

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 3:29 PM J Decker  wrote:

>
>
> On Fri, Sep 21, 2018 at 3:24 PM Ke Gao  wrote:
>
>> Thanks. I forgot to say my CMakeList.txt is not located together with the
>> source files. So I used the following, it seems not working:
>> add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>>DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../
>> file.c
>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>> ${CMAKE_CURRENT_SOURCE_DIR}/../../file.c
>> ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>> )
>> Is there an easier way to do this?
>>
> not really...
> NOt sure why it wouldn't work unless current_source_dir isn't what you
> think it is.
> I actually copy mine into
>

It also wouldn't work if you didn't use
${CMAKE_CURRENT_SORUCE_DIR}/../../aaa_file.c in another target.
(and by the same path... which is partially why I copy into BINARY_DIR,
then it's in a known place for all projects int he tree

>
>

>COMMAND ${CMAKE_COMMAND} -E copy_if_different
> ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}
>
>  (basename is the path part of the ${SOURCE})
>
>>
>>
>> On Fri, Sep 21, 2018 at 4:10 PM J Decker  wrote:
>>
>>>
>>>
>>> On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:
>>>
>>>> Hi,
>>>>
>>>> In a project, I need to first duplicate a source file and rename it.
>>>> For example, I want to change "file.c" to "aaa_file.c", and after
>>>> compiling, I will delete it. This is similar to using "cp file.c
>>>> aaa_file.c". How to easily do this in CMake? I found "file" command doesn't
>>>> work well for this.
>>>>
>>>>
>>> add_custom_command( OUTPUT aaa_file.c
>>>DEPENDS file.c
>>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>>> file.c aaa_file.c
>>> )
>>>
>>> then you just have to reference the source file 'aaa_file.c' and it will
>>> get updated if file.c is different. I also do
>>>  COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c
>>>
>>> just to make sure it is new.
>>>
>>>
>>>
>>>> Thank you very much.
>>>>
>>>> --
>>>>
>>>> ..
>>>> Ke Gao
>>>> --
>>>>
>>>> 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
>>>>
>>> --
>>>
>>> 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
>>>
>>
>>
>> --
>>
>> ..
>> Ke Gao
>>
>
-- 

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] How to duplicate a source file and rename it

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 3:24 PM Ke Gao  wrote:

> Thanks. I forgot to say my CMakeList.txt is not located together with the
> source files. So I used the following, it seems not working:
> add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
>DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../../
> file.c
>COMMAND ${CMAKE_COMMAND} -E copy_if_different
> ${CMAKE_CURRENT_SOURCE_DIR}/../../file.c
> ${CMAKE_CURRENT_SOURCE_DIR}/../../aaa_file.c
> )
> Is there an easier way to do this?
>
not really...
NOt sure why it wouldn't work unless current_source_dir isn't what you
think it is.
I actually copy mine into

   COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}

 (basename is the path part of the ${SOURCE})

>
>
> On Fri, Sep 21, 2018 at 4:10 PM J Decker  wrote:
>
>>
>>
>> On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:
>>
>>> Hi,
>>>
>>> In a project, I need to first duplicate a source file and rename it. For
>>> example, I want to change "file.c" to "aaa_file.c", and after compiling, I
>>> will delete it. This is similar to using "cp file.c aaa_file.c". How to
>>> easily do this in CMake? I found "file" command doesn't work well for this.
>>>
>>>
>> add_custom_command( OUTPUT aaa_file.c
>>DEPENDS file.c
>>COMMAND ${CMAKE_COMMAND} -E copy_if_different
>> file.c aaa_file.c
>> )
>>
>> then you just have to reference the source file 'aaa_file.c' and it will
>> get updated if file.c is different. I also do
>>  COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c
>>
>> just to make sure it is new.
>>
>>
>>
>>> Thank you very much.
>>>
>>> --
>>>
>>> ..
>>> Ke Gao
>>> --
>>>
>>> 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
>>>
>> --
>>
>> 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
>>
>
>
> --
>
> ..
> Ke Gao
>
-- 

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] How to duplicate a source file and rename it

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 3:00 PM Ke Gao  wrote:

> Hi,
>
> In a project, I need to first duplicate a source file and rename it. For
> example, I want to change "file.c" to "aaa_file.c", and after compiling, I
> will delete it. This is similar to using "cp file.c aaa_file.c". How to
> easily do this in CMake? I found "file" command doesn't work well for this.
>
>
add_custom_command( OUTPUT aaa_file.c
   DEPENDS file.c
   COMMAND ${CMAKE_COMMAND} -E copy_if_different
file.c aaa_file.c
)

then you just have to reference the source file 'aaa_file.c' and it will
get updated if file.c is different. I also do
 COMMAND ${CMAKE_COMMAND} -E touch aaa_file.c

just to make sure it is new.



> Thank you very much.
>
> --
>
> ..
> Ke Gao
> --
>
> 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
>
-- 

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] How to have Visual Studio 15 2017 actually use a 64 bit toolchain.

2018-09-21 Thread J Decker
On Fri, Sep 21, 2018 at 1:32 PM Michael Jackson 
wrote:

> Nope. That just tells what _version_ of the compiler suite to use, but not
> the architecture.
>
Oh right, I understand now.


-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 14.0/VC/bin/amd64/cl.exe -- works

do this first.

set PreferredToolArchitecture=x64




>
> -- The C compiler identification is MSVC 19.0.24234.1
> -- The CXX compiler identification is MSVC 19.0.24234.1
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/x86_amd64/cl.exe
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
>
> C:\Users\mjackson\DREAM3D-Dev\DREAM3D-Builds\Test>set
> PreferredToolArchitecture=x64
> C:\Users\mjackson\DREAM3D-Dev\DREAM3D-Builds\Test>cmake -G "Visual Studio
> 15 2017 Win64" -T "v140" -DDREAM3D_SDK=C:/DREAM3D_SDK ../../DREAM3D
> --  *
> -- ***
> -- The C compiler identification is MSVC 19.0.24234.1
> -- The CXX compiler identification is MSVC 19.0.24234.1
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/amd64/cl.exe
> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
> Studio 14.0/VC/bin/amd64/cl.exe -- works
>
>
> _____
> Mike Jackson  mike.jack...@bluequartz.net
>
>
>
> On Fri, Sep 21, 2018 at 4:02 PM J Decker  wrote:
>
>> "C:/tools/unix/cmake/bin/cmake.exe" -G "Visual Studio 15 2016 Win64" -T
>> "v140" ..
>> C:\tools\unix\cmake\bin\cmake.exe --build . --config "Debug" --target
>> "INSTALL"
>>
>> On Fri, Sep 21, 2018 at 8:26 AM Michael Jackson <
>> mike.jack...@bluequartz.net> wrote:
>>
>>> So I tried using "-DCMAKE_GENERATOR_TOOLSET=x64" while configuring a
>>> clean build directory but it still picked up the x86 compiler. I ended up
>>> going into the "Settings" of Windows 10 and added the environment variable
>>> PreferredToolArchitecture=x64 to my account. Logged out, Logged back in and
>>> then did another configuration run and now during the cmake configuration
>>> run the proper 64 bit compiler is picked up and used. Still probably
>>> missing something obvious in the CMake file that I can add
>>>
>>> --
>>> Mike Jackson
>>>
>>> On 9/21/18, 10:28 AM, "CMake on behalf of Mateusz Loskot" <
>>> cmake-boun...@cmake.org on behalf of mate...@loskot.net> wrote:
>>>
>>> On Fri, 21 Sep 2018 at 16:13, Michael Jackson
>>>  wrote:
>>> >
>>> > For those that want to actually use Visual Studio 15 2017 is there
>>> anything in CMake or an environment variable that can be set?
>>>
>>> Isn't host=x64 for that purpose?
>>>
>>>
>>> https://cmake.org/cmake/help/v3.12/variable/CMAKE_GENERATOR_TOOLSET.html
>>>
>>> Best regards
>>> --
>>> Mateusz Loskot, http://mateusz.loskot.net
>>> --
>>>
>>> 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
>>>
>>>
>>>
>>> --
>>>
>>> Powered by www.kitware.com
>>>
>>> 

Re: [CMake] How to have Visual Studio 15 2017 actually use a 64 bit toolchain.

2018-09-21 Thread J Decker
"C:/tools/unix/cmake/bin/cmake.exe" -G "Visual Studio 15 2016 Win64" -T
"v140" ..
C:\tools\unix\cmake\bin\cmake.exe --build . --config "Debug" --target
"INSTALL"

On Fri, Sep 21, 2018 at 8:26 AM Michael Jackson 
wrote:

> So I tried using "-DCMAKE_GENERATOR_TOOLSET=x64" while configuring a clean
> build directory but it still picked up the x86 compiler. I ended up going
> into the "Settings" of Windows 10 and added the environment variable
> PreferredToolArchitecture=x64 to my account. Logged out, Logged back in and
> then did another configuration run and now during the cmake configuration
> run the proper 64 bit compiler is picked up and used. Still probably
> missing something obvious in the CMake file that I can add
>
> --
> Mike Jackson
>
> On 9/21/18, 10:28 AM, "CMake on behalf of Mateusz Loskot" <
> cmake-boun...@cmake.org on behalf of mate...@loskot.net> wrote:
>
> On Fri, 21 Sep 2018 at 16:13, Michael Jackson
>  wrote:
> >
> > For those that want to actually use Visual Studio 15 2017 is there
> anything in CMake or an environment variable that can be set?
>
> Isn't host=x64 for that purpose?
>
>
> https://cmake.org/cmake/help/v3.12/variable/CMAKE_GENERATOR_TOOLSET.html
>
> Best regards
> --
> Mateusz Loskot, http://mateusz.loskot.net
> --
>
> 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
>
>
>
> --
>
> 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
>
-- 

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] cmake prebuilt binaries won't work if bin folder is renamed.

2018-09-05 Thread J Decker
You will need to rename the directory containing bin; the share folder
scripts is often very dependant on the bin (or vice versa) ...
better to just keep like 'cmake' and then 'cmake-3.xx' directories
containing the whole cmake package...

On Tue, Sep 4, 2018 at 11:47 PM Vinitha  wrote:

>  Hi,
> I have downloaded cmake binaries from cmake website. As I had to keep
> cmake binaries for different platforms in specific folder as per my build
> system requirements, I have renamed the 'bin' folder to for eg. lin, win,
> mac etc. This seems to work fine till cmake version 3.7. From this version
> onwards, I get the following error while invoking cmake after renaming the
> bin folder.
>
> *$pwd*
> */home/neo/cmake/cmake-3.10.2-Linux-x86_64/lin86*
> *$   *
> *$./cmake --version*
> *CMake Error: Could not find CMAKE_ROOT !!!*
>
> *CMake has most likely not been installed correctly.*
> *Modules directory not found in*
>
> *cmake version 3.10.2*
>
> *CMake suite maintained and supported by Kitware (kitware.com/cmake
> ).*
>
>
> If I am renaming back to bin directory, there is no issues observed.
> I have observed that, from version 3.7 onwards cmake has a new configure
> flag introduced to specify bin directory name, *--bindir=DIR*.
>
> So now if I want to use any other name for 'bin' dir, I need to configure
> and build the cmake while specifiying the bin directory name I need.
>
> Is there a way by using any environment variable or something I can modify
> the bin directory name of the downloaded cmake binary from cmake website
> and use it without the above mentioned error ?
>
>
> Regards,
>
> Vinitha
> --
>
> 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
>
-- 

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] Why does CMake 3.9.0 open VS2017 when targeting 2013 after installing 2017... sigh.

2018-08-16 Thread J Decker
On Thu, Aug 16, 2018 at 9:18 AM Brian Davis  wrote:

>
>
> On Wed, Aug 15, 2018 at 11:58 AM, Robert Maynard <
> robert.mayn...@kitware.com> wrote:
>
>> The MSVC / CUDA support recently has been very challenging to keep track
>> of. In general CUDA will only support a single patch release of MSVC, and
>> given how MSVC 2017 doesn't easily allow rollbacks and has a pretty
>> aggressive update policy ( compared to older MSVC versions ) causes lots of
>> pain. This in general has been a community wide MSVC+CUDA issue.
>>
>> CUDA 8 has zero support for VS2017 (
>> https://docs.nvidia.com/cuda/archive/8.0/cuda-installation-guide-microsoft-windows/index.html
>> )
>> CUDA 9.0 and 9.1 only supports VS 2017 15.0 (
>> https://docs.nvidia.com/cuda/archive/9.0/cuda-installation-guide-microsoft-windows/index.html,
>>
>> https://docs.nvidia.com/cuda/archive/9.1/cuda-installation-guide-microsoft-windows/index.html
>> )
>> CUDA 9.2 only supports VS 2017 15.0 and 15.6
>>
>> When using MSVC 2017 and CUDA you will need to specify an explicit host
>> side compiler with -T version=15.## including the minor version (
>> https://cmake.org/cmake/help/v3.12/release/3.12.html#id3 ).
>>
>
>
> Can't that be set by passing the toolset with a -T ? like -T "v120_xp"
or -T "v120"

This is an article about side-by-side toolsets
https://blogs.msdn.microsoft.com/vcblog/2017/11/15/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/
but it looks like it only goes back to 2015...

(and sorry to ramble a bit)
Slightly off topic; but I ran into a feature of the new optimizer that
shuffles commands I had a critical section lock that it ended up
clearing the locking bit, before releasing the other value; can defiantly
see lots of code breaking from that; firefox wants to only build with 15.6
but community is only 15.5 or 15.8 preview...  (I fixed the codea dding
'volatile , and referencing the other value with a computation that
resulted with 0 instead.)

Sometimes code is in a certain order for specific reasons :) Sometims, it
can be shuffled    (a=1;b=2;) ~~ (b=2;a=1) (same result different order)




> sigh... of course (though be careful with the term does not and cannot and
> zero support - I am a thinkin I could get CMake to support CUDA 8 in VS2017
> - if I realy wanted to - I mean it's not realy VS/MSVC doing the compiling
> is it?-rhetorical).  This is making the case for what I had to do in the
> 2.8 days (well also again when NVIDIA could not decide on where to put
> their stuff in the file system and CMake was always one version or so
> behind) and roll my own CMake cuda support... yes this happened... and it
> could again.  Time to look back into my old svn tree.  sweet... kickin it
> with svn again the good old days.
>
>
> --
>
> 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
>
-- 

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] Why does CMake 3.9.0 open VS2017 when targeting 2013 after installing 2017... sigh.

2018-08-14 Thread J Decker
Visual studio 2017 is able to keep old project types and build them as
is... so it is using the 2013 tools even though loaded in the 2017 IDE.
I noticed this because the command line build tools are 2015, so if I
configure a project for node; it gets built as 2015, and the visual studio
project when loaded in 2017 shows (Visual Studio 2015) after the project in
solution explorer...

And/or you should be able to set the platform toolset

(in the project property dialog, General) Platform toolset : Visual Studio
2015 (v140)
I've seen it with other IDE projects; I don't have that system available
though (back to v110_xp)

On Tue, Aug 14, 2018 at 3:20 PM Brian Davis  wrote:

>
> Why does CMake 3.9.0 open VS2017 when targeting 2013 after installing
> 2017... sigh.
>
> Without even regenerating or re configuring (even though that has no
> effect either) when "Open Project" is selected 2017 is opened and not
> 2013... errr what am I targeting again?  Happened after 2017 install.  How
> does CMake Decide which app to call err I got a sneaky suspicion as to
> how in a not so goodly way.
>
> Sure wishI could get CMake to open VS2013 with the environment vars I ahve
> set when it was called... guess  I'll have to settle for the new and
> improved VS2017 I can't use on the project.
>
>
>
>
> --
>
> 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
>
-- 

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] Add Windows library dependency

2018-07-27 Thread J Decker
should just be add_executable( whatever_target secur32 )


On Fri, Jul 27, 2018 at 8:05 PM Theodore Hall  wrote:

> Greetings,
>
> I'm building a project that depends on a Windows library -- Secur32.Lib --
> that is included in the regular library search path but is not one of the
> specific libraries that the compiler normally links to.  In *NIX
> command-line terms, the "-L" is OK, I only need to specify the
> "-lSecur32" part.
>
> If I put "#pragma comment (lib, "Secur32.Lib")" in the cpp file, the
> system finds and links it.  If I omit that, then the build fails with an
> unresolved external symbol.
>
> I cannot find a way to accomplish this in the CMakeLists.txt file rather
> than relying on the #pragma.  CMake complains that it doesn't know how to
> build it, though I've (tried to) set the IMPORTED property.  I've tried
> various combinations of:
>
> find_library(SECUR32 Secur32)
> add_library(Secur32 SHARED IMPORTED)
> target_link_libraries(MyTarget
> Secur32)
>
> I have not tried to set IMPORTED_LOCATION, because libraries with that
> name exist in several locations, and the compiler actually knows better
> than I do which one to use -- e.g., one of them is in:
>
> C:\Program Files (x86)\Windows Kits\10\Lib\10.0.16299.0\um\x64\Secur32.Lib
>
> We're building in VisualStudio 2017 as a CMake project.  We have not
> generated and are not using VS ",proj" or ".sln" files.  We're aiming to
> build this as a multi-platform application.  (The dependence on this
> library is wrapped in the appropriate #if defined ... #endif directives.)
>
> Any enlightenment would be greatly appreciated.  Thanks.
>
> --
>
> Ted Hall
>
> --
>
> 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
>
-- 

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] CMakeLists.txt in different place than source

2018-06-13 Thread J Decker
On Wed, Jun 13, 2018 at 9:46 PM Andrew White 
wrote:

> J Decker wrote:
>
> You can define a variable to define the base of the sources
>
> set( SOURCE_ROOT /some/path )
>
>
>
> could be set relative to the current cmake path per cmake that uses those
>
> souces... and then just prefix it
>
>
>
> add_library(my_lib
>
> ${SOURCE_ROOT}/src/a.c
>
> ${SOURCE_ROOT}/include/a.h
>
> )
>
>
>
> Thanks, but that’s approximately exactly what I’m trying to avoid doing.
> I cheat a little, in that I have a macro that will prepend a prefix to
> every element of a list.  My motivation is avoiding situations where I add
> the prefix to the files but forget to add the prefix when I call
> target_include_directories or suchlike.
>
>
>
> I’m not sure anything trickier is workable in the CMake model, however.
> For example, hacking CMAKE_CURRENT_SOURCE_DIR might make sense for file
> paths, but if I then call add_subdirectory should it be rooted at the
> CMakeList directory or the source root directory.
>
>
>
CMAKE_CURRENT_LIST_DIR
https://stackoverflow.com/questions/15662497/difference-between-cmake-current-source-dir-and-cmake-current-list-dir

yes that's an option also.
It will be pretty clear there's an error if something is omitted later;
and/or referenced from a different place.
 and then it's not just a matter of


> --
>
> Andrew
>
>
> --
>
> 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
>
-- 

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] CMakeLists.txt in different place than source

2018-06-13 Thread J Decker
On Tue, Jun 12, 2018 at 7:22 PM Andrew White 
wrote:

> I have a situation where I want my CMakeLists.txt in a different place
> than my source.
>
> e.g.:
>
> /some/path/project/CMakeLists.txt
> /other/path/source/src/a.c
> /other/path/source/include/a.h
>
> Is there an easy way to say "process this CMakeLists.txt as if it were in
> /other/path/source" (at least as far as file paths are concerned)?
>
> e.g.:
>
> add_library(my_lib
> src/a.c
> include/a.h
> )
>
> target_include_directories(my_lib PUBLIC include)
>
> I know I can add a full path prefix to every file, but there are a lot of
> them.  I'm hoping for a shortcut.
>

You can define a variable to define the base of the sources
set( SOURCE_ROOT /some/path )

could be set relative to the current cmake path per cmake that uses those
souces... and then just prefix it

add_library(my_lib
${SOURCE_ROOT}/src/a.c
${SOURCE_ROOT}/include/a.h
)



>
> --
> Andrew
>
>
> --
>
> 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
>
-- 

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] include restbed in my project

2018-05-09 Thread J Decker
So I have all these third party libraries I keep a copy of...
https://github.com/d3x0r/SACK/tree/master/src/contrib

So libressl for example, has cmakelists.txt

https://github.com/d3x0r/SACK/blob/master/CMakeLists.txt#L680
add_subdirectory( src/contrib/libressl/${LIBRESSL_VERSION} )

which I aliased a bit for upgrade/migration/regression...

I also link optionally to bullet...

IF( EXISTS ${BULLET_SOURCE}/CMakeLists.txt )
   # setup a bunch of options...
add_subdirectory( ${BULLET_SOURCE} bullet )


In the second case, bullet is outside my source tree, (next to it with
other top level projects), so I have to specify a name to be used in the
CMAKE_BINARY_DIR  (bullet) to use for temporary space to build...

and then just link like any other included target

target_link_libaraies( myThing bullet ssl tls crypto )


it's really not that hard, and if you don't understand add_subdirectory
well... I can't imagine such a world it's so good for breaking up things
into related funcational groups...


On Wed, May 9, 2018 at 4:10 PM, Christofer Jennings <boz...@gmail.com>
wrote:

> Thanks for the reply. I haven't figured out how to use add_subdirectories
> like you suggested but I was able to get it working based on this
> https://github.com/josesj/rest-json-cpp-boilerplate
>
> It uses find_package and etc. ... maybe a little overkill, I don't know.
> But at least I got off the ground. :)
>
> On Sat, May 5, 2018 at 12:09 PM J Decker <d3c...@gmail.com> wrote:
>
>> for such things I often include the sources in my tree and just
>> 'add_subdirectory( "extra/restbed" )'
>> it's cleaner to do a external project rule...
>> which can download/checkout sources and then build those and the output
>> is findable by other projects just by referencing the targets.
>> https://cmake.org/cmake/help/latest/module/ExternalProject.html
>>
>> On Sat, May 5, 2018 at 11:21 AM, Christofer Jennings <boz...@gmail.com>
>> wrote:
>>
>>> Hi All,
>>>
>>> How do you use a 3rd party dependency like restbed in a cmake build?
>>>
>>> Total nube here. First dive into CMake and haven't done C++ for a long
>>> long time. So forgive my ignorance :) This could just as easily be an "I
>>> forgot C++" as an "I don't know CMake"...
>>>
>>> I'm trying to use restbed. I've got it to compile and self test with
>>> `cmake, `make install`, and `make test` as directed on the site:
>>> https://github.com/Corvusoft/restbed#build
>>> It makes a `distribution` folder with `include` and `library`
>>> sub-folders. The `library` has .a and .so or .dylib files. The `include`
>>> folder just has headers, and a `restbed` file with #includes in it.
>>>
>>> I'm using the example on the same page as starting point:
>>> https://github.com/Corvusoft/restbed#example
>>>
>>> ... I could list out my failed attempts but I don't think it'd help.
>>> Basically find_package doesn't find it, and other things I've tried don't
>>> work. I'm digging around online but so far nothing seems to fit--which
>>> makes me think it's something really really simple that I just don't
>>> understand.
>>>
>>> Thanks!
>>> -Chris
>>>
>>>
>>>
>>>
>>> --
>>>
>>> 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
>>>
>>>
>>
-- 

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] include restbed in my project

2018-05-05 Thread J Decker
for such things I often include the sources in my tree and just
'add_subdirectory( "extra/restbed" )'
it's cleaner to do a external project rule...
which can download/checkout sources and then build those and the output is
findable by other projects just by referencing the targets.
https://cmake.org/cmake/help/latest/module/ExternalProject.html

On Sat, May 5, 2018 at 11:21 AM, Christofer Jennings 
wrote:

> Hi All,
>
> How do you use a 3rd party dependency like restbed in a cmake build?
>
> Total nube here. First dive into CMake and haven't done C++ for a long
> long time. So forgive my ignorance :) This could just as easily be an "I
> forgot C++" as an "I don't know CMake"...
>
> I'm trying to use restbed. I've got it to compile and self test with
> `cmake, `make install`, and `make test` as directed on the site:
> https://github.com/Corvusoft/restbed#build
> It makes a `distribution` folder with `include` and `library` sub-folders.
> The `library` has .a and .so or .dylib files. The `include` folder just has
> headers, and a `restbed` file with #includes in it.
>
> I'm using the example on the same page as starting point:
> https://github.com/Corvusoft/restbed#example
>
> ... I could list out my failed attempts but I don't think it'd help.
> Basically find_package doesn't find it, and other things I've tried don't
> work. I'm digging around online but so far nothing seems to fit--which
> makes me think it's something really really simple that I just don't
> understand.
>
> Thanks!
> -Chris
>
>
>
>
> --
>
> 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
>
>
-- 

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] PreprocessToFile

2018-05-05 Thread J Decker
On Sat, May 5, 2018 at 9:57 AM, KK <kristianonlin...@gmail.com> wrote:

> Oh, maybe you misunderstood me. I know, that CMake does no preprocessing.
> This is done by the preprocessor.
>
Right; that's not what I was saying; it doesn't generte projects with
preprocesssing enabled, so the options ARE false already in the generated
projects.

> But, what I want, is that the generated solution/VS-project with CMake
> gives me the result like in the part I've pasted below. This should be part
> of the generated files. And my question is, is it possible to generate this
> and if, how?
>
It does.
Oh I see, it doesn't actually write that out; but the default IS false...
so it shouldn't have to.
I did some testing, and setting a project to preprocess to a file,
it(visual studio)   writes true
If I reset that back to default/inhert from project; it deletes that entry
entirely from the project.
So; unless you want it ENABLED correct behavior should be to not write it
(which, like I said, cmake already does (or rather doesn't do))



> =
> 
>
> 
>
> false
>
> 
>
> 
>
> false
>
> 
>
> 
>
> =
>
> Am 05.05.2018 um 16:31 schrieb J Decker:
>
>
>
> On Sat, May 5, 2018 at 7:02 AM, Kristian <kristianonlin...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I have a Visual Studio 2015 Solution with some C++ projects in it. I
>> try to generate the same solution and the projects with CMake. Now,
>> there is a part, where I do not know how to solve this.
>>
>> In a vcxproj file, there is something like this written:
>>
>> =
>> 
>>
>>   
>> false
>>   
>>
>>   > Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
>> false
>>   
>> 
>> =
>>
>> So, now my question: Is it possible, to get the same result with CMake
>> here?
>> --
>>
>
> Yes; and you don't need to do anything; cmake doesn't preprocess to a file
> by default (or by any option I know of).
> So what you have indicated... 'false' 'false' is what cmake generates.
>
>
>>
>> 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
>>
>
>
>
>
>
-- 

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] PreprocessToFile

2018-05-05 Thread J Decker
On Sat, May 5, 2018 at 7:02 AM, Kristian  wrote:

> Hi,
>
> I have a Visual Studio 2015 Solution with some C++ projects in it. I
> try to generate the same solution and the projects with CMake. Now,
> there is a part, where I do not know how to solve this.
>
> In a vcxproj file, there is something like this written:
>
> =
> 
>
>   
> false
>   
>
>Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
> false
>   
> 
> =
>
> So, now my question: Is it possible, to get the same result with CMake
> here?
> --
>

Yes; and you don't need to do anything; cmake doesn't preprocess to a file
by default (or by any option I know of).
So what you have indicated... 'false' 'false' is what cmake generates.


>
> 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
>
-- 

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] Multiple "projects" one directory

2018-04-27 Thread J Decker
You can solve this by treating those local projects as external projects;
then they can be built with independant flags

include( ExternalProject )

https://github.com/d3x0r/SACK/blob/master/CMakeLists.txt#L1769

ExternalProject_Add( ppc_portable
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/makefiles/prog/ppc
BINARY_DIR ppc_portable
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
BUILD_ALWAYS 1
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
..
 (more args...) )

I find, because it's a local project; the build_always is kinda required,
if you make changes to the sources it doesn't even check to see if it needs
to build without BUILD_ALWAYS.


On Fri, Apr 27, 2018 at 3:06 PM, Scott Bloom  wrote:

> I have a rather complicated Qt based project.
>
>
>
> We are looking at rolling out a subset tool, and it will be significantly
> smaller in functionality.
>
>
>
> For that mode, I would like to set a CMake variable LITEVERSION that
> builds the tool with -DLITEVERSION defined.
>
> however, one (or two) folders, the main executable (and possibly the main
> window folder), and I would like include into the tool with this turned on,
> and with it turned off
>
>
>
> Is that possible?
>
>
>
> Other times I have done this, I just have two build areas.. But 90% of
> this code base is the same, and will be built independent of the flag. So
> Id rather not build it twice
>
>
>
> Scott
>
> --
>
> 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
>
>
-- 

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] Relaying all command line arguments from SuperBuild to ExternalProject_Add

2018-01-31 Thread J Decker
(platfrom defines is a variable suitable for like ADD_DEFINITIONS(
${PLATFORM_DEFINES} )


  string( REPLACE ";" " " PLATFORM_DEFINES_ARG "${PLATFORM_DEFINES}" )
  ExternalProject_Add( target

CMAKE_ARGS -DPLATFORM_DEFINES=${PLATFORM_DEFINES_ARG}
..
 )


and in the target cmakelists to use the argument


STRING( REPLACE " " ";" PLATFORM_DEFINES ${PLATFORM_DEFINES} )

add_definitions( ${PLATFORM_DEFINES} )



On Wed, Jan 31, 2018 at 9:36 AM, Saad Khattak  wrote:

> I have the following setup:
> Superbuild
>- ExternalProject_Add(a...)
>- ExternalProject_Add(b...)
>- ExternalProject_Add(c...)
>- ExternalProject_Add(d...)
>
> The SuperBuild is built from command line with some options e.g.
> -DMY_OPTION=TRUE. I would like all these options to be passed to each of
> the ExternalProject_Add CMAKE_ARGS.
>
> I tried to capture the arguments using the solution posted here:
> https://stackoverflow.com/a/10218582/368599
>
> The arguments are captured properly (i.e. I printed them out to make sure
> they are correct) but relaying them to ExternalProject_Add appears to be
> problematic. I tried the following ways to forward the arguments (as
> outlined in the stackoverflow solution):
>
> ExternalProject_Add(...
>   CMAKE_ARGS ${CMAKE_ARGS}
>   )
>
> ExternalProject_Add(...
>   CMAKE_ARGS "${CMAKE_ARGS}" # quotes
>   )
>
> ExternalProject_Add(...
>   CMAKE_ARGS "${MY_CMAKE_ARGS}" # changed the variable name in case it
> conflicts
>   )
>
> None of that seems to work. CMake appears to ignore the commands forwarded.
>
> Is there something I am missing?
>
> Thanks,
> Saad
>
>
> --
>
> 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
>
>
-- 

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] Hard to do if in Macro

2018-01-30 Thread J Decker
Okay... but then with function I can't set external variables; but if(
__ANDROID__ ) works.

`result` never changes.

---

set( __ANDROID__ 1 )

function( test __ANDROID__ RETVAL )

  if( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
set( ${RETVAL} ${${RETVAL}} qwer2 )
message( "Included. " )
  endif( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")

  if( __ANDROID__ )
set( ${RETVAL} ${${RETVAL}} asdf )
message( "ALWAYS Included ${__ANDROID__}" )
  endif( __ANDROID__ )

endfunction( test )


set( result "default" )

test( __ANDROID__ "result" )
message( "REsult:${result}" )

test( ${__ANDROID__} "result" )
message( "REsult:${result}" )

test( OFF  "result")
message( "REsult:${result}" )

---




On Tue, Jan 30, 2018 at 12:35 AM, Petr Kmoch <petr.km...@gmail.com> wrote:

> Macros aren't functions, and macro parameters aren't CMake variables.
> Expanding a macro parameter is effectively *textual* substitution, whereas
> dereferencing a CMake variable is a semantic one.
>
> In other words, inside your macro, the text __ANDROID__ (when not
> expanded) never refers to the macro parameter. Macro parameters "don't
> exist" outside of expansion context. The `if(__ANDROID__)` bit therefore
> always refers to the variable __ANDROID__, never to the macro parameter
> __ANDROID__.
>
> You still don't have to spell out the conditional as explicitly as you're
> doing it now, but you have to expand the parameter:
>
> macro(test __ANDROID__)
>   if(${__ANDROID__})
> message( "Included. " )
>   endif()
> endmacro()
>
> This is what the evaluation will look like based on how you call it:
>
> test(__ANDROID__)   -> if(__ANDROID__) -> refers to the variable
> set(__ANDROID__ 1)
> test(${__ANDROID__})   -> if(1)
> set(__ANDROID__ 0)
> test(${__ANDROID__})   -> if(0)
> test(OFF)   -> if(OFF)
>
> CMake macros have a lot of specific and potentially weird/counterintuitive
> behaviour. In general, you should always write your commands as functions
> and only resort to macros if you explicitly need their specific behaviour.
>
> Petr
>
>
>
> On 30 January 2018 at 09:11, J Decker <d3c...@gmail.com> wrote:
>
>> Why do I have to do
>>
>> if( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")
>> endif( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")
>>
>> in a macro like...
>> --
>>
>> set( __ANDROID__ 1 )
>>
>> macro( test __ANDROID__ )
>>
>>   if( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
>> message( "Included. " )
>>   endif( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
>>
>>   if( __ANDROID__ )
>> message( "ALWAYS Included ${__ANDROID__}" )
>>   endif( __ANDROID__ )
>>
>> endmacro( test )
>>
>> test( __ANDROID__ )
>> test( ${__ANDROID__} )
>> test( OFF )
>>
>> --
>> Output
>>
>> Included.
>> ALWAYS Included __ANDROID__
>> Included.
>> ALWAYS Included 1
>> ALWAYS Included OFF
>>
>> --
>>
>> 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
>>
>>
>
-- 

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] Hard to do if in Macro

2018-01-30 Thread J Decker
Why do I have to do

if( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")
endif( ${M__ANDROID__} EQUAL 1 OR ${M__ANDROID__} STREQUAL "ON")

in a macro like...
--

set( __ANDROID__ 1 )

macro( test __ANDROID__ )

  if( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")
message( "Included. " )
  endif( ${__ANDROID__} EQUAL 1 OR ${__ANDROID__} STREQUAL "ON")

  if( __ANDROID__ )
message( "ALWAYS Included ${__ANDROID__}" )
  endif( __ANDROID__ )

endmacro( test )

test( __ANDROID__ )
test( ${__ANDROID__} )
test( OFF )

--
Output

Included.
ALWAYS Included __ANDROID__
Included.
ALWAYS Included 1
ALWAYS Included OFF
-- 

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] Recommandation for macOS framework install rules

2018-01-17 Thread J Decker
It's not entirely related other than Mac

I had to test

if( __COMPILER_GNU AND NOT CMAKE_COMPILER_IS_GNUCC )

instead of just CMAKE_COMPILER_IS_GNUCC (which was unset)

__COMPILER_GNU was found after doing a dump...

I suppose there's some modern way I'm supposed to test GCC that works on
all systems?


On Wed, Jan 17, 2018 at 2:49 PM, Lucas Soltic 
wrote:

> Hello,
>
> By default library install() command uses CMAKE_INSTALL_PREFIX (/usr/local
> by default) as a base for relative install paths. But when you define
> install rules for macOS frameworks, it doesn't make much sense to install
> them there. I'd rather expect something like /Library/Frameworks.
>
> On the other side, if you have more things to install like a "readme" or
> documentation that should go into /usr/local/share, it doesn't make sense
> to have them installed in /Library/Frameworks. So you can't just change
> CMAKE_INSTALL_PREFIX to be /Library/Frameworks.
>
> What do you recommend to keep installation rules simple (ie. remain
> relative) and yet support installation of both frameworks and other things?
>
> Best regards,
> Lucas
> --
>
> 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
>
-- 

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] How can I create a C executable and C++ library from the same source

2018-01-17 Thread J Decker
No.
CMake tracks each source file name exactly once.  If you set properties on
it, it will be treated that way always.  Have to make  a copy of the source
to cpp...

copies to cmake_binary_dir/
plusplus_file_dup is the resulting list
( https://github.com/d3x0r/SACK/blob/master/CMakeLists.txt#L655 )

(really this is just for headers... src/csrc.h should be
${binary}/src/csrc.h in target too because #include "crsc.h"

FOREACH(SOURCE ${PLUSPLUS_FILES_TO_COPY})
   if( ${SOURCE} MATCHES "${SOURCES_ROOT}(.*)$" )
   set( BASENAME ${CMAKE_MATCH_1} )
   set( plusplus_file_dup ${plusplus_file_dup}
${CMAKE_BINARY_DIR}/${BASENAME} )
   add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${BASENAME}
   DEPENDS ${SOURCE}
   COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}
   #COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_BINARY_DIR}/${BASENAME}
   )
   else()
   endif()
ENDFOREACH(SOURCE)


-
( https://github.com/d3x0r/SACK/blob/master/CMakeLists.txt#L672 )
THis make s abetter copy routine; it tests to see the type of header(file)
and possible substitutions...  still kinda some debugging coments (#)  in
there... this adds it as a rule, so it only generates the target source if
the source is referenced.  therefore also onlly when those C files change
do new copies get made.

macro( COPY_CPLUSPLUS FILE_LIST )
FOREACH(SOURCE ${ARGN} )
   if( ${SOURCE} MATCHES "${SACK_BASE}/(.*)\\.c$" )
  set( FILEOK 1 )
  set( BASENAME ${CMAKE_MATCH_1} )
  set( FILEEXT .cpp )
   elseif( ${SOURCE} MATCHES "${SACK_BASE}/(.*)\\.h$" )
  set( FILEOK 1 )
  set( BASENAME ${CMAKE_MATCH_1} )
  set( FILEEXT .h )
   elseif( ${SOURCE} MATCHES "(.*)\\.c$" )
  set( FILEOK 1 )
  set( BASENAME ${CMAKE_MATCH_1} )
  set( FILEEXT .cpp )
   elseif( ${SOURCE} MATCHES "(.*)\\.h$" )
  set( FILEOK 1 )
  set( BASENAME ${CMAKE_MATCH_1} )
  set( FILEEXT .h )
   else()
  set( FILEOK 0 )
  set( BASENAME "" )
   endif()

   if( FILEOK )
   get_source_file_property(SOURCE_FOLDER ${SOURCE} FOLDER)

   if( ${SOURCE} MATCHES "^${PROJECT_SOURCE_DIR}.*" )
  if( NOT ${SOURCE_FOLDER} MATCHES "NOTFOUND" )
#message( "err folder : ${SOURCE_FOLDER} " )
SOURCE_GROUP( ${SOURCE_FOLDER} FILES ${SOURCE} )
SOURCE_GROUP( ${SOURCE_FOLDER} FILES
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT} )
  endif()
  add_custom_command( OUTPUT
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
  DEPENDS ${SOURCE}
  COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
  #COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
  )
  #EXECUTE_PROCESS(COMMAND cmake -E copy_if_different ${SOURCE}
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT} )

   else( ${SOURCE} MATCHES "^${PROJECT_SOURCE_DIR}.*" )
 if( NOT ${SOURCE_FOLDER} MATCHES "NOTFOUND" )
   #message( "err folder : ${SOURCE_FOLDER} " )
   SOURCE_GROUP( ${SOURCE_FOLDER} FILES
${PROJECT_SOURCE_DIR}/${SOURCE} )
   SOURCE_GROUP( ${SOURCE_FOLDER} FILES
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT} )
 endif()
 add_custom_command( OUTPUT
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
 DEPENDS ${PROJECT_SOURCE_DIR}/${SOURCE}
 COMMAND ${CMAKE_COMMAND} -E copy_if_different
${PROJECT_SOURCE_DIR}/${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
 #COMMAND ${CMAKE_COMMAND} -E touch
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
 )
 #EXECUTE_PROCESS(COMMAND cmake -E copy_if_different
${PROJECT_SOURCE_DIR}/${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT} )
 #message( "LIB2_SOURCE2 : ${BASENAME}  ${SOURCE}" )
   endif()
 set( ${FILE_LIST} ${${FILE_LIST}}
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT} )
 #set( cplusplus_sources ${cplusplus_sources}
${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT} )
   else()
  #message( "NOT THING ${SOURCE}" )
   endif()
ENDFOREACH(SOURCE)
endmacro( COPY_CPLUSPLUS )



On Wed, Jan 17, 2018 at 10:05 AM, Jimi Damon  wrote:

> Hi,
>
> I want to use Gtest for some unit tests on a number of the C functions
> that comprise my C executable.  However, Gtest ( And gMock ) are C++
> testing frameworks.
>
> What I would like to have is a project for my exe and then a separate
> project for my C++ library and be able to change the source properties to
> use the language CXX just before compiling.
>
> The problem I'm having is that CMake uses the CXX compiler for the C files.
>
>
> Here's what I would like to have
>
> project(cexe)
> set(SOURCES foo.c bar.c )
> add_executable( cexe  ${SOURCES} )
>
> 

Re: [CMake] Making sure dependent projects are up-to-date

2018-01-13 Thread J Decker
maybehttps://cmake.org/cmake/help/v3.2/module/ExternalProject.html

BUILD_ALWAYS 1No stamp file, build step always runs

On Fri, Jan 12, 2018 at 7:41 PM, Saad Khattak  wrote:

> Hi,
>
> Let's say I have several CMake enabled libraries that have their own
> respective build directories and have been installed:
>
> LibA
> LibB (depends on A)
> LibC
> LibD (depends on LibC and LibA)
>
> I then create a new executable project ProjExe that depends on LibD. Now,
> I am working on LibA, LibB, LibC, LibD and ProjExe simultaneously (e.g.
> building up functionality in the libraries that the executable uses, fixing
> bugs etc.).
>
> What I would like, is a way to ensure that when ProjExe is built, it first
> checks whether LibD is up-to-date (i.e. does it have any out of source
> build files?), if not, it builds LibD first. But LibD depends on LibC and
> LibA, and then LibD ensures that LibC and LibA are up-to-date before
> building itself.
>
> Is something like this possible in CMake? This is  similar to the
> 'solution' concept in Visual C++ where a 'solution' can have several
> projects. ProjExe in the solution can be dependent on external libraries
> (like the above) and they are part of the 'solution' and are checked to be
> up-to-date before ProjExe is compiled/linked.
>
> Thanks,
> Saad
>
> --
>
> 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
>
>
-- 

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] Source file property INCLUDE_DIRECTORIES

2018-01-12 Thread J Decker
On Fri, Jan 12, 2018 at 5:26 AM, CHEVRIER, Marc <marc.chevr...@sap.com>
wrote:

> Because this property is not yet supported for source files (see #17507
> <https://gitlab.kitware.com/cmake/cmake/issues/17507>).
>
> FYI, I worked on this support and the merge request is under process… (see
> !1596 <https://gitlab.kitware.com/cmake/cmake/merge_requests/1596>).
>
>
>

Okay :) Glad someone is on it.

Will also work for set_property( SOURCE ... APPEND PROPERTY
INCLUDE_DIRECTORIES ) ?


>
>
> *From: *CMake <cmake-boun...@cmake.org> on behalf of J Decker <
> d3c...@gmail.com>
> *Date: *Friday 12 January 2018 at 14:22
> *To: *CMake Mail List <cmake@cmake.org>
> *Subject: *[CMake] Source file property INCLUDE_DIRECTORIES
>
>
>
> Why can't I set INCLUDE_DIRECTORIES for a source file?
>
>
>
> https://cmake.org/cmake/help/v3.0/manual/cmake-properties.7.html
>
>
>
> I can probably use COMPILE_FLAGS ; but how to guarantee that -I is the
> proper option for every compiler?
>
>
>
-- 

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] Source file property INCLUDE_DIRECTORIES

2018-01-12 Thread J Decker
Why can't I set INCLUDE_DIRECTORIES for a source file?

https://cmake.org/cmake/help/v3.0/manual/cmake-properties.7.html

I can probably use COMPILE_FLAGS ; but how to guarantee that -I is the
proper option for every compiler?
-- 

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] how to detect architecture ?

2018-01-09 Thread J Decker
On Tue, Jan 9, 2018 at 6:57 AM, Franck Houssen 
wrote:

> Is there a way to detect architecture ?
>
> Seems there is nothing simple since these old threads :
> https://stackoverflow.com/questions/11944060/how-to-
> detect-target-architecture-using-cmake/12024211#12024211
> https://stackoverflow.com/questions/16796629/cmake-
> create-architecture-aware-makefile
>
> Is there a solution now ?
>
> My need is quite simple: I have an executable who needs dlopen. To test
> it, I planned to write a bash script that would have done "./exe
> /path/to/lib.*so*" on linux (debian, ...) OR "./exe /path/to/lib.*dylib*"
> on osx. To replace correctly so/dylib in the bash script I need to know the
> architecture. Any idea how to do this ?
>
>
https://cmake.org/Wiki/CMake_Useful_Variables
https://cmake.org/Wiki/CMake_Checking_Platform

if( APPLE )
   install( PROGRAMS apple.script.sh DESTINATION script.sh )
elseif( UNIX )
   install( PROGRAMS linux.script.sh DESTINATION script.sh )
endif( )
# not sure what the correct tag in endif should be.

so you can just keep 2 scripts and install approrpiately


> Franck
>
> --
>
> 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
>
>
-- 

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] configure_file: escaping (single) quotes

2018-01-09 Thread J Decker
On Tue, Jan 9, 2018 at 1:29 AM, J Decker <d3c...@gmail.com> wrote:

>
>
> On Tue, Jan 9, 2018 at 1:24 AM, Franck Houssen <franck.hous...@inria.fr>
> wrote:
>
>> Hello,
>>
>> I need configure_file to produce a bash file containing this line:
>> VAR="${VAR//*'*#*'*/}"
>>
>>
> maybe
>
> VAR="$" "{VAR//*'*#*'*/}"
>
Oh nevermind I was doing that sort of thing using FILE( APPEND ... )


>
>
>
>> I tried without success VAR="${VAR//*'*#*'*/}" and VAR="${VAR//*\'*#*\'*/}"
>> with and without ESCAPE_QUOTES in configure_file : always get an error
>> like "Syntax error in cmake code when parsing string".
>> Not a bash guru, and, can't get if the problem comes from bash or
>> cmake... Can somebody help on this ?
>>
>> Franck
>>
>> --
>>
>> 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
>>
>>
>
-- 

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] configure_file: escaping (single) quotes

2018-01-09 Thread J Decker
On Tue, Jan 9, 2018 at 1:24 AM, Franck Houssen 
wrote:

> Hello,
>
> I need configure_file to produce a bash file containing this line:
> VAR="${VAR//*'*#*'*/}"
>
>
maybe

VAR="$" "{VAR//*'*#*'*/}"


> I tried without success VAR="${VAR//*'*#*'*/}" and VAR="${VAR//*\'*#*\'*/}"
> with and without ESCAPE_QUOTES in configure_file : always get an error
> like "Syntax error in cmake code when parsing string".
> Not a bash guru, and, can't get if the problem comes from bash or cmake...
> Can somebody help on this ?
>
> Franck
>
> --
>
> 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
>
>
-- 

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] CMake: using dlopen

2018-01-08 Thread J Decker
On Mon, Jan 8, 2018 at 1:50 AM, Franck Houssen 
wrote:

> And so, if I have an executable (add_executable), the default thing to do
> is to use target_link_libraries(mylib PRIVATE ...). Not PUBLIC (as I do).
> Correct ?
>

Yes, unless you have plugins that then back-ljnk against that executable.
(and that also use the libraries that executable uses... if it just uses
things from that library/executable then private should always be used)


>
> - Mail original -
> > De: "Franck Houssen" 
> > À: "Rainer Poisel" 
> > Cc: "CMake Mail List" 
> > Envoyé: Lundi 8 Janvier 2018 10:41:25
> > Objet: Re: [CMake] CMake: using dlopen
> >
> >
> >
> > - Mail original -
> > > De: "Rainer Poisel" 
> > > À: "Franck Houssen" 
> > > Envoyé: Dimanche 7 Janvier 2018 19:34:21
> > > Objet: Re: [CMake] CMake: using dlopen
> > >
> > > Hi,
> > >
> > > On Sun, Jan 7, 2018 at 7:13 PM, Franck Houssen <
> franck.hous...@inria.fr>
> > > wrote:
> > > > Difference between PUBLIC/PRIVATE has never been clear to me
> (usually I
> > > > always use PUBLIC).
> > > > main.cpp includes dlfcn.h and uses it: not sure to get what you meant
> > > > (PRIVATE is for templates ? when a header include headers ?)
> > >
> > > you are looking for the "Transitive Dependencies" feature of CMake:
> >
> > OK, I didn't get that. It's more clear to me now. Thanks !
> >
> > >   *
> > >   https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.
> 7.html#transitive-usage-requirements
> > >
> > > Generally speaking and from my personal experience, use the
> > > target_-commands as much as possible because properties are bound to
> > > targets and their dependencies rather than a file/directory structure.
> > >
> > > So, that means, use target_include_directories(),
> > > target_compile_options(), target_compile_definitions(),
> > > target_sources(), ... for your targets. The magic keyword to propagate
> > > the properties of your targets is target_link_libraries(). Depending
> > > on what scope (PRIVATE, PUBLIC, INTERFACE) the properties have been
> > > defined using the other target_-commands, the target_link_libraries()
> > > command propagates these properties to other targets. E. g.
> > >
> > > add_library(otherlib SHARED
> > >   foo.c
> > > )
> > >
> > > target_include_directories(otherlib PRIVATE
> > >   dirPrivate
> > > )
> > >
> > > target_include_directories(otherlib PUBLIC
> > >   dirPublic
> > > )
> > >
> > > add_library(mylib SHARED
> > >   bar.c
> > > )
> > >
> > > target_link_libraries(mylib PRIVATE
> >
> > Is this a typo ?
> > For the example to work I would have done: target_link_libraries(mylib
> PUBLIC
> > otherLib), no ? (mylib needs only PUBLIC stuff's from otherLib but not
> > PRIVATE one's). Correct ?
> >
> >
> > >   otherlib
> > > )
> > >
> > > In this case, mylib will use all PUBLIC or INTERFACE properties of
> > > otherlib for its build. Thus, dirPublic will be added to the include
> > > directory search path for the compilation of bar.c of mylib. PRIVATE
> > > properties will not be propagated. In the above mentioned example,
> > > dirPrivate will NOT be added to the include directory search path for
> > > the compilation of bar.c of mylib.
> > >
> >
> > The example is illustrative (transitivity - PRIVATE is not propagated)
> >
> > > This is a very short summary, but I hope it is of help to you. There
> > > are other ressources on the Internet. E. g.
> > >   *
> > >   https://stackoverflow.com/questions/26037954/cmake-
> target-link-libraries-interface-dependencies
> > >   * https://rix0r.nl/blog/2015/08/13/cmake-guide/
> > >
> > > Regards,
> > >   Rainer
> > >
> > --
> >
> > 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
> >
> --
>
> 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 

Re: [CMake] CMake: using dlopen

2018-01-08 Thread J Decker
On Mon, Jan 8, 2018 at 1:41 AM, Franck Houssen 
wrote:

>
>
> - Mail original -
> > De: "Rainer Poisel" 
> > À: "Franck Houssen" 
> > Envoyé: Dimanche 7 Janvier 2018 19:34:21
> > Objet: Re: [CMake] CMake: using dlopen
> >
> > Hi,
> >
> > On Sun, Jan 7, 2018 at 7:13 PM, Franck Houssen 
> > wrote:
> > > Difference between PUBLIC/PRIVATE has never been clear to me (usually I
> > > always use PUBLIC).
> > > main.cpp includes dlfcn.h and uses it: not sure to get what you meant
> > > (PRIVATE is for templates ? when a header include headers ?)
> >
> > you are looking for the "Transitive Dependencies" feature of CMake:
>
> OK, I didn't get that. It's more clear to me now. Thanks !
>
> >   *
> >   https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.
> 7.html#transitive-usage-requirements
> >
> > Generally speaking and from my personal experience, use the
> > target_-commands as much as possible because properties are bound to
> > targets and their dependencies rather than a file/directory structure.
> >
> > So, that means, use target_include_directories(),
> > target_compile_options(), target_compile_definitions(),
> > target_sources(), ... for your targets. The magic keyword to propagate
> > the properties of your targets is target_link_libraries(). Depending
> > on what scope (PRIVATE, PUBLIC, INTERFACE) the properties have been
> > defined using the other target_-commands, the target_link_libraries()
> > command propagates these properties to other targets. E. g.
> >
> > add_library(otherlib SHARED
> >   foo.c
> > )
> >
> > target_include_directories(otherlib PRIVATE
> >   dirPrivate
> > )
> >
> > target_include_directories(otherlib PUBLIC
> >   dirPublic
> > )
> >
> > add_library(mylib SHARED
> >   bar.c
> > )
> >
> > target_link_libraries(mylib PRIVATE
>
> Is this a typo ?
> For the example to work I would have done: target_link_libraries(mylib
> PUBLIC otherLib), no ? (mylib needs only PUBLIC stuff's from otherLib but
> not PRIVATE one's). Correct ?
>
>
Public is whether it propagates outside of the current target to things
that then require 'mylib'
private keeps it within that target, has nothing to do with what it's
pulling from any linked library.


>
> >   otherlib
> > )
> >
> > In this case, mylib will use all PUBLIC or INTERFACE properties of
> > otherlib for its build. Thus, dirPublic will be added to the include
> > directory search path for the compilation of bar.c of mylib. PRIVATE
> > properties will not be propagated. In the above mentioned example,
> > dirPrivate will NOT be added to the include directory search path for
> > the compilation of bar.c of mylib.
> >
>
> The example is illustrative (transitivity - PRIVATE is not propagated)
>
> > This is a very short summary, but I hope it is of help to you. There
> > are other ressources on the Internet. E. g.
> >   *
> >   https://stackoverflow.com/questions/26037954/cmake-
> target-link-libraries-interface-dependencies
> >   * https://rix0r.nl/blog/2015/08/13/cmake-guide/
> >
> > Regards,
> >   Rainer
> >
> --
>
> 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
>
-- 

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] CMake: using dlopen

2018-01-06 Thread J Decker
CMake/shared/modules will define the CMAKE_DL_LIBS  which a very high
percentage of the time will just be library 'dl' .

Pretty much any man page on dlopen defines 'dl'

http://man7.org/linux/man-pages/man3/dlopen.3.html

 Link with *-ldl*.

specifying just the library name adds it as a -L option to be
searched with standard library functions.

On Sat, Jan 6, 2018 at 8:41 AM, Franck Houssen <franck.hous...@inria.fr>
wrote:

>
> --
>
> *De: *"J Decker" <d3c...@gmail.com>
> *À: *"Franck Houssen" <franck.hous...@inria.fr>
> *Cc: *"CMake Mail List" <cmake@cmake.org>
> *Envoyé: *Samedi 6 Janvier 2018 16:19:33
> *Objet: *Re: [CMake] CMake: using dlopen
>
> probably just need target_link_libraries(  dl )
>
>
> But so, who defined the dl target ?
>
>
> On Sat, Jan 6, 2018 at 6:34 AM, Franck Houssen <franck.hous...@inria.fr>
> wrote:
>
>> Hello,
>>
>> I have an executable that needs dlopen.
>>
>> Googled this a bit: seems (surprisingly) there is no FindDLUtils ?!..
>> Correct ? If so, why is this ?
>> My understanding is that I need to go:
>> ~BUILD> cmake -DCMAKE_LD_LIBS="-ldl -L/path/to/dl" ..
>> which is, basically, telling to CMake where dl is (although this is the
>> job of a build system, no ?!)
>>
>> Did I understand correctly ? Did I miss something ?
>>
>> Franck
>>
>> --
>>
>> 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
>>
>>
>
>
-- 

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] CMake: using dlopen

2018-01-06 Thread J Decker
probably just need target_link_libraries(  dl )

On Sat, Jan 6, 2018 at 6:34 AM, Franck Houssen 
wrote:

> Hello,
>
> I have an executable that needs dlopen.
>
> Googled this a bit: seems (surprisingly) there is no FindDLUtils ?!..
> Correct ? If so, why is this ?
> My understanding is that I need to go:
> ~BUILD> cmake -DCMAKE_LD_LIBS="-ldl -L/path/to/dl" ..
> which is, basically, telling to CMake where dl is (although this is the
> job of a build system, no ?!)
>
> Did I understand correctly ? Did I miss something ?
>
> Franck
>
> --
>
> 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
>
>
-- 

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] MinGW Compilers on Windows

2017-12-15 Thread J Decker
On Fri, Dec 15, 2017 at 7:39 AM, Kevan Hashemi  wrote:

> Dear Alan,
>
> Thank you for your encouragement to use the "MinGW Makefiles" generator on
> Windows, and for pointing out the mingw32-make alternative to just "make"
> in MSYS.
>
> So if you are further interested in the "MinGW Makefiles" generator,
>> you should remove all sh.exe versions from your PATH (including sh.exe
>> provided by raw Windows), get into a CMD environment, execute cmake
>> with the "MinGW Makefiles", and then build your software with
>>
>> mingw32-make.exe
>>
>
> I installed the latest version of MinGW with MSYS on my 32-bit Windows 7
> virtual machine (which is running in VMBox on a MacOS 10.12.6 host
> computer). I open a CMD terminal (DOS prompt). I do not move any sh.exe
> files. I run cmake with -G "MinGW Makefiles" for Executable_A. The
> configuration and generation complete with no errors and only one warning.
> In the CMD terminal, I use mingw32-make.exe to build Executable_A. The
> executable runs perfectly when linked dynamically to libraries I previously
> built with "MSYS Makefiles".
>
> I repeat the above process, but when it comes to the build itself, I
> switch from the CMD terminal to the MSYS terminal, and use mingw32-make.exe
> instead of just "make" (as noted previously, "make" takes me to an
> alternate shell with a Microsoft copyright). The build completes and
> Executable_A runs just fine.
>
> I rebuild my libraries with the "MinGW Makefiles" process, staying in the
> CMD terminal for both stages. The CMake completes with a few minor
> warnings. The CMD build proceeds at about the same speed as the MSYS build
> (you found the CMD build to be faster). When the build completes, I run
> Executable_A linking dynamically to the new set of "MinGW Makefiles"
> libraries. The executable runs perfectly.
>
> Conclusion: Easiest way to get MinGW Makefile generation is to do it in
> the CMD terminal. After that, you make with mingw32-make in eithger CMD or
> MSYS. Libraries compiled with either process are compatible with one
> another at any stage of compiling or linking.
>
>
I just want to throw out there, I use MinGW (with MingW Makefiles) wihtout
MSYS just fine for most things including OpenCV which I tested first
day and had no issues... but by then others had already commented.All
that requires is mingw(64).bin and cmake/bin in your path



> Yours, Kevan
>
> --
> Kevan Hashemi, Electrical Engineer
> Physics Department, Brandeis University
> http://alignment.hep.brandeis.edu/
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
-- 

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] externalproject_add install_dir doesn't work

2017-10-22 Thread J Decker
A smiple cmakelists like this.  Without specifying the CMAKE_ARGS
CMAKE_INSTALL_PREFIX this tries to install into c:\program files.

-
cmake_minimum_required(VERSION 3.6)

include( ExternalProject )

ExternalProject_Add( external
PREFIX ${CMAKE_BINARY_DIR}/tmpout
   SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern
   INSTALL_DIR ${CMAKE_BINARY_DIR}/output
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/output

)

 ./extern/cmakelists.txt
cmake_minimum_required(VERSION 3.6)

INSTALL( FILES tmp.bat DESTINATION data )



I was trying to figure out why the install is failing on another project,
it says (using vs 2015 generator)

MSBUILD : error MSB1009: Project file does not exist.
[M:\javascript\vfs\native\build\sack.vcxproj]
  Switch: install

in which the rule that runs
C:\tools\unix\cmake\bin\cmake.exe --build . --config Debug --target install

is failling... to work it would have to be INSTALL.

but my simple case isn't causing the same failure


Been tinkering with this for a couple hours trying to make the example more
close to the full case, but cannot; if I edit the rule and make the
'--target INSTALL'  then it works in the actual case... although the same
thing works fine in the simplified example



Line 1766 of ExternalProject in latest cmake download
list(APPEND args --target install)

should(could) be

if( MSVC )
list(APPEND args --target INSTALL)
else( MSVC )
list(APPEND args --target install)
endif( MSVC )


which fixes my issue.
-- 

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-developers] GCC x cmake

2017-09-19 Thread J Decker
On Tue, Sep 19, 2017 at 11:34 AM, Ivam Pretti 
wrote:

> I would like to know what are the advantages or difference when compared
> to GCC compiler.
>
>
I understand from the topic you mean compared to cmake; but the two are two
different things
gcc is a compiler
cmake is a build system that uses compilers
it'd be more meaningful to say make v cmake...

so there is no comparison... definatly an apples and steak comparison (or
orange would at least be fruit)


> --
>
> 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-developers
>
-- 

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-developers

[CMake] Howto rerun ExternalProject Install

2017-09-18 Thread J Decker
I have quite a few sub-projects in this project.  I had added a few
projects on windows that statically linked to the runtime (to make the
product more portable).  I realized yesterday that it was causing the
static runtime flags to be applied for all projects above it too (including
the core libraries).  So when I was testing a very high level project that
pulled the C and C++ versions of the same library to have different
runtimes linked (because they each had their own static version).

Anyway to I was replacing add_subdirectory for a few projects with
ExternalProject_add()'s so they would get their own runtime compile
flags but if I do a build, and then wipe out the target install
directory and then rerun the install target, the products from the
externalprojects don't re-install.
If I just rerun building those targets, it also doesn't re-install...

So how can I trigger external projects to re-install without figuring out
what sources they depend on and touching them.
-- 

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] Changing the actual "src" directory where VS project and/or sln files are rooted

2017-09-16 Thread J Decker
On Sat, Sep 16, 2017 at 2:25 PM, Michael Powell 
wrote:

> Hello,
>
> Sorry if this seems like a rookie/novice question. I'm not new to
> CI/CD, however; this question may have been asked before, I don't
> know.
>
> I'll preface with a little background. It's been a little while for me
> using and truly "grokking" CMake, but if memory serves, CMake lifts
> raw source inputs and drops them into what becomes a meta-description
> for what is ultimately being built. That could overlay the source
> directories, but may not. That's if memory serves.
>
> Now, I am trying to configure and generated CMake targeting the Visual
> Studio 2015 environment.
>
> My repository is organized something like:
>
> $/CMakeLists.txt
> $/src
> $/src/CMakeLists.txt
> $/src/... (for things like tests, etc)
>
> And so on.
>
> Solution files are landing in the $/ directory, but I want them to
> land in the $/src directory as is customary for Visual Studio
> solutions.
>

Then you're doing an in-source build which is not really the proper
thing... they should land in something like $/build or $/../build even.
and then it wouldn't matter where they were.



>
> First, as far as I know, the OA (original author) is dropping
> CMake-driven output in the same context as the source files. Maybe
> that's good and/or acceptable, maybe not, considering the
> meta-descriptive nature of CMake.
>
> So the first question is how to cause CMake to respect the $/src
> objective. Otherwise, perhaps I simply have CMake generate the
> penultimate build structure.
>
> Close behind those questions is how to avoid outputs like ALL_BUILD
> and ZERO_CHECK. Those are not necessary, or perhaps are don't care,
> especially if output can land in $/src as envisioned.
>
> Thank you!
>
> Regards,
>
> Michael Powell
> --
>
> 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
>
-- 

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] Replace default "make all" with "make help"

2017-08-02 Thread J Decker
On Wed, Aug 2, 2017 at 8:12 AM, DKLind  wrote:

> Is it possible to replace the default target of the "Unix Makefiles"
> generated Makefile of 'all' with 'help'? By default, I mean when no target
> is specified when invoking 'make', the 'all' target is assumed.


Because cmake works with so many targets, it's unlikely this would be of
much use; ninja itself has ability to specify default target, but that's
not available from CMake; also generators like Visual Studio, et al.  don't
have 'all' they have ALL_BUILD and no 'help' target.

https://cmake.org/cmake/help/v3.0/command/build_command.html
I suppose you could wrap your CMakeLists in another that checks $
and if not set, then trigger cmake --build with --target help

that's probably a really bad idea in general though.

If someone is using cmake to build though; one would think they would just
'know' that make help is a thing to do...

Or - why would you want your one project to behave any different than all
the others in the world? (or perhaps a nicer phrasing)  Why do you want to
do this?


>
> --
> View this message in context: Replace default "make all" with "make help"
> 
> Sent from the CMake mailing list archive
>  at Nabble.com.
>
> --
>
> 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
>
-- 

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] What is the default build type?

2017-08-02 Thread J Decker
On Wed, Aug 2, 2017 at 8:55 AM, Marcus D. Hanwell <
marcus.hanw...@kitware.com> wrote:

> On Wed, Aug 2, 2017 at 3:03 AM, Bo Zhou  wrote:
>
>> It depends on the Generator.
>>
>> To the Makefile, the actual type was controlled by the compiler options.
>> If you don't specific any type, usually it means non-debug and
>> non-optimization because the CMAKE_CXX_FLAGS is empty as default. This is
>> critical, so usually people should specific the actual type they want to
>> build.
>>
>> To the generator of the IDE, such as Visual Studio and Xcode, the
>> CMAKE_BUILD_TYPE doesn't make sense but we have to use
>> CMAKE_CONFIGURATION_TYPES, then CMake will create the several configuration
>> sets for the IDE from the CMAKE_C|CXX_FLAGS_{CONFIG} .
>>
>
> This thread inspired me to write up how we have been doing it in some of
> the projects I work on for quite a while now,
>
> https://blog.kitware.com/cmake-and-the-default-build-type/
>
>
These should use lower case 'debug' 'release' etc.  Because if it's not VS,
it's probably also not windows, and case matters.


> It certainly isn't the only way, but it provides an easy path to ensure
> things show up in the GUIs, respect build types passed in, etc.
>
> --
>
> 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
>
-- 

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] What is the default build type?

2017-08-02 Thread J Decker
On Wed, Aug 2, 2017 at 11:50 AM, David Cole via CMake 
wrote:

> Yes, your code is a good example Marcus. It was one of the previous
> suggestions on this thread which had example code setting
> CMAKE_CONFIGURATION_TYPES.
>
> I would recommend against setting this variable because in some places
> in CMake code, it is used as an approximate proxy for whether or not a
> multi-configuration generator is being used.
>
>
> For a few examples, see the CMake code base itself:
>
> MinGW Makefiles supports multiple configurations; one at a time.  And
reading a few of these...


> $ git grep CMAKE_CONFIGURATION_TYPES | grep -Ev
> "Auxiliary/vim/syntax/cmake.vim|Help/|Tests/"

CMakeCPack.cmake:  if(CMAKE_CONFIGURATION_TYPES)
>
this one is not distributed, and I don't have it.


> Modules/CMakeExpandImportedTargets.cmake:#
> ${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.
> Modules/CMakeExpandImportedTargets.cmake:
> if(CMAKE_CONFIGURATION_TYPES)
> Modules/CMakeExpandImportedTargets.cmake: list(GET
> CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION)
>

the whole point is to get a good setting list for CMAKE_BUILD TYPE so this
is harmless because built type will override the default behavior...
# CONFIGURATION is given, it uses the first configuration from
# ${CMAKE_CONFIGURATION_TYPES} if set, otherwise ${CMAKE_BUILD_TYPE}.



> Modules/CTestTargets.cmake:if(CMAKE_CONFIGURATION_TYPES)
>

I would want this to pass CONFIGURATION_TYPES to included external projects
because it's missing otherwise anyway.


> Modules/DeployQt4.cmake:if(configurations AND
> (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE))
> Modules/DeployQt4.cmake:if(CMAKE_CONFIGURATION_TYPES
> OR CMAKE_BUILD_TYPE)
>

This is used to use the argument passed to the macro if CMAKE_BUILD_TYPE
(this is what we want set anyway) OR CMAKE_CONFIGUATION_TYPES is set.


> Modules/ExternalProject.cmake:  if(CMAKE_CONFIGURATION_TYPES)
> Modules/ExternalProject.cmake:if(CMAKE_CONFIGURATION_TYPES)
> Modules/ExternalProject.cmake:  if(CMAKE_CONFIGURATION_TYPES)
> Modules/ExternalProject.cmake:if(CMAKE_CONFIGURATION_TYPES)
> Modules/ExternalProject.cmake:  foreach(cfg
> ${CMAKE_CONFIGURATION_TYPES})
>

In these cases, it makes sure to pass the build configuration passed from
the core project, otherwise it leaves it blank.  Since I want to specify
the build configuration anyway, this should always be set if
externalproject is  used.


> Modules/FindBoost.cmake:  if(CMAKE_CONFIGURATION_TYPES OR
> CMAKE_BUILD_TYPE)
>

if neither of these are set it sets release output.  and we're trying to
make sure that CMAKE_BUILD_TYPE is set to something not blank anyway.


> Modules/FindCUDA.cmake:# Makefile and similar generators don't define
> CMAKE_CONFIGURATION_TYPES, so we
> Modules/FindCUDA.cmake:set(CUDA_configuration_types
> ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} Debug MinSizeRel
> Release RelWithDebInfo)
>

This one includes already set configuration types, and add capitalized
versions; then builds a list and removes duplicate because it sets all
configurations to UPPER(); so this is harmless.  and is a better
implementation than the below SelectLibraryConfigurations.cmake:

(comment block in FindCUDA)
# Makefile and similar generators don't define CMAKE_CONFIGURATION_TYPES,
so we
# need to add another entry for the CMAKE_BUILD_TYPE.  We also need to add
the
# standerd set of 4 build types (Debug, MinSizeRel, Release, and
RelWithDebInfo)
# for completeness.  We need run this loop in order to accomodate the
addition
# of extra configuration types.  Duplicate entries will be removed by
# REMOVE_DUPLICATES.

...and yet they[makefile and similar] should have configuration types;
because they can build all of those configurations.




> Modules/FindQt4.cmake:if (CMAKE_CONFIGURATION_TYPES OR
> CMAKE_BUILD_TYPE)
>


again- cmake_build_type is being set, so don't default to Release



> Modules/SelectLibraryConfigurations.cmake:   (
> CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) )
>

Would be triggered because we're setting CMAKE_BUILD_TYPE anyway..; and
also does not support minreldebinfo or MinSizeRel; and instead only checks
_DEBUG and _RELEASE targets.



> Source/cmGlobalVisualStudio7Generator.cxx:  if
> (!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
> Source/cmGlobalVisualStudio7Generator.cxx:
> "CMAKE_CONFIGURATION_TYPES",
> "Debug;Release;MinSizeRel;RelWithDebInfo",

Source/cmGlobalXCodeGenerator.cxx:  if
> (!mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
> Source/cmGlobalXCodeGenerator.cxx:  "CMAKE_CONFIGURATION_TYPES",
> "Debug;Release;MinSizeRel;RelWithDebInfo",
> Source/cmGlobalXCodeGenerator.cxx:
> this->CurrentMakefile->GetRequiredDefinition("CMAKE_CONFIGURATION_TYPES");
> Source/cmMakefile.cxx:
> this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) {
> Utilities/Release/WiX/CMakeLists.txt:if(CMAKE_CONFIGURATION_TYPES)
>

These 

Re: [CMake] What is the default build type?

2017-08-01 Thread J Decker
I like having something like this defines CMAKE_BUILD_TYPE to be a
droplist of choices...



if( NOT CMAKE_CONFIGURATION_TYPES )
set( CMAKE_CONFIGURATION_TYPES debug release )
endif( NOT CMAKE_CONFIGURATION_TYPES )

set( CMAKE_BUILD_TYPE release CACHE STRING "Cached cmake build type"  )
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
${CMAKE_CONFIGURATION_TYPES} )


-

https://cmake.org/cmake/help/v3.0/variable/CMAKE_CONFIGURATION_TYPES.html

On Mon, Jul 31, 2017 at 9:28 PM, Michael Ellery 
wrote:

>
>
> > On Jul 31, 2017, at 8:48 PM, Florian Lindner 
> wrote:
> >
> > Hello
> >
> > ccmake shows CMAKE_BUILD_TYPE as unset. From the compile commands it
> looks like also nothing like Debug nor Release.
> >
> > Why is there no well-defined default set? How can I set a default?
> >
> > Thanks,
> > Florian
> > --
> >
> > 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
>
>
> my recollection is that an unspecified build type results in a build that
> has no optimizations and no debug symbols generated. I’m not sure what the
> motivation for those default flags is. If you want to default to DEBUG,
> something like this should work:
>
> if (NOT CMAKE_BUILD_TYPE)
>   set(CMAKE_BUILD_TYPE Debug)
> endif()
>
>
> -MIke
>
> --
>
> 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
>
-- 

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] error on using cmake

2017-07-28 Thread J Decker
You need visual studio build tools...

https://www.visualstudio.com/downloads/
way at the bottom of the page... Build Tools for Visual Studio 2017

or for 2015... https://www.microsoft.com/en-us/download/details.aspx?id=
48159

On Thu, Jul 27, 2017 at 11:20 PM, c <1026863...@qq.com> wrote:

> Hello.
> I tried to compile LTP using cmake on Windows 10 with Visual Studio
> compiler ...
> However, "CMakeOutput.log" says that The system is: Windows - 10.0.14393
> - AMD64.
> And I Installed Windows 10 SDK but the same error keeps occurring.
> Hope your help.
> Waiting for your reply.
>
> --
>
> 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
>
-- 

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] Correct handling of absolute/relative installation paths

2017-07-27 Thread J Decker
It's also handy to get installation paths from GNUInstallDirs

https://cmake.org/cmake/help/v3.4/module/GNUInstallDirs.html  especially if
you expect to install libs on linux which either go to lib or lib64.

many things that install to windows just supply a standard base path
(/program files/) and then still use bin, lib, share, etc in that
path...

It is an annoyance to have to override dll installation to bin instead of
lib on windows

include( GNUInstallDirs )

if( WIN32 )
set( BINARY_OUTPUT_DIR ${CMAKE_INSTALL_BINDIR} )
set( SHARED_LIBRARY_OUTPUT_DIR ${CMAKE_INSTALL_BINDIR} )
set( SHARED_LIBRARY_LINK_DIR ${CMAKE_INSTALL_LIBDIR} )
else( WIN32 )
  set( BINARY_OUTPUT_DIR ${CMAKE_INSTALL_BINDIR} )
  set( SHARED_LIBRARY_OUTPUT_DIR ${CMAKE_INSTALL_LIBDIR} )
  set( SHARED_LIBRARY_LINK_DIR ${CMAKE_INSTALL_LIBDIR} )
endif( WIN32 )

and then use the aliased path instead

macro( install_my_thing )
install( TARGETS ${ARGV}
RUNTIME DESTINATION ${BINARY_OUTPUT_DIR}
LIBRARY DESTINATION ${SHARED_LIBRARY_OUTPUT_DIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
endmacro( install_my_thing )

People will inevitably also respond and say 'but dlls install as runtime'
which is probably true these days.  All I can do is copy the cmake stuff I
have that definitely works; which has been around since 2.6 or something...

So it's probably simpler than what I've shared above.


On Thu, Jul 27, 2017 at 4:08 AM, Eric Noulard 
wrote:

>
>
> 2017-07-27 12:28 GMT+02:00 David Demelier :
>
>> Hello,
>>
>> I'm still trying to find a correct solution to handle user specified
>> installation paths.
>>
>> Let's consider two kind of paths:
>>
>>   - WITH_BINDIR (default: bin/) where to install executables,
>>   - WITH_DATADIR (default: share/project_name/) where to install extra
>> data.
>>
>> I want to let the user configuring those paths because not all
>> distributions use the same paths (e.g. bin vs usr/bin).
>>
>> Then, I also like to build the whole CMake project by creating the
>> hierarchy as it would be installed like:
>>
>> /WITH_BINDIR/myapp
>> /WITH_DATADIR/somestuff.txt
>>
>
> Do you mean here that you setup CMAKE__OUTPUT_DIRECTORY (variable or
> target property) to your favorite value
> or
> You build and then install with the / prefix?
>
>
>>
>> Using relative paths makes the application relocatable, if I keep
>> WITH_BINDIR set as "bin" I can get the executable path at runtime, going
>> through its parent (bin/../) and then I can go share/project_name.
>> Obviously this is only valid for relative paths.
>>
>> However, a very high number of package managers build programs by
>> specifying absolute paths, it is not an issue: instead of getting the
>> directories at runtime, I use directly the absolute ones.
>>
>> On unix it can still work because it will just be translated as:
>>
>> /usr/local/bin/myapp
>> /usr/local/share/project_name/somestuff.txt
>>
>> This is much bigger an issue on Windows if the user set WITH_BINDIR to
>> something like D:/alt/bin
>>
>> The path would be translated to
>>
>> D:/alt/bin
>>
>> which is invalid on Windows.
>>
>> I like very much having this kind of `fakeroot' directory where you can
>> have a preview on how the project looks like but I don't know what to do if
>> paths are absolute, especially on Windows.
>>
>
> My opinion is that you should never use absolute path (besides some very
> specific case on unix where you want to put something in /etc/...)
> You should ask your user for
>
>DATADIR
>BINDIR
>etc...
>
> all those var should be relative path.
>
> and an eventual
>INSTALL_PREFIX
> which could be absolute.
>
> In any case if you really want to tolerate absolute path given by the
> user, but still want to mimic install location during the build
> then you'll have to escape it.
>
> For each path you expect from the user:
>
> check the path with if(IS_ABSOLUTE path) and compute some relative path
>   a) if you are on Windows remove the drive letter, i.e. D:/alt/bin
> becomes alt/bin
>   (or network drive share name //shairedisk/alt/bin  becomes
> alt/bin)
>   b) if you are on Unix
>
>
>>
>> What are your thoughts on that, recommandations?
>>
>
> I wouldn't try to mimic install tree during the build (if it is what you
> are doing),
> If I have a need to "verify" install tree structure then **after the
> build** I would do a fake install with a particular
> local prefix (as CPack does before packaging).
>
> Note that for similar reason CPack has to track files installed with
> absolute destination and
> possibly error out when it cannot handle it, particularly on Windows
> oriented generator:
> see e.g.:
> https://cmake.org/cmake/help/v3.7/variable/CPACK_ERROR_ON_
> ABSOLUTE_INSTALL_DESTINATION.html
>
> AFAIK, IFW and NSIS do not work with, absolute installed files.
>
>
> --
> Eric
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> 

Re: [CMake] Cannot get a 64-bit build of MySQL on a 64-bit Windows machine

2017-07-11 Thread J Decker
Alternatively you could use cmake-gui and on first generation in an empty
directoy, a popup window appears allowing you to select the generator.

mkdir build2
cd build2
cmake-gui ..

then set the various flags in the gui.


On Tue, Jul 11, 2017 at 3:13 AM, A.M. Sabuncu  wrote:

> Petr,
>
> Thank you so much.  The following command you suggested fixed the problem,
> and I was able to run a successful build:
>
> cmake .. -G "Visual Studio 15 2017 Win64"
>
> I am grateful for your help.  This may have been a minor item for you, but
> for me, it was a real stumbling block.
>
> By the way, the other alternative you suggested did not work:
>
> cmake .. -A Win64   (or "Win64")
>
> The result was:
>
> -- Building for: Visual Studio 15 2017
> -- Running cmake version 3.8.2
> -- Found Git: C:/Program Files/Git/cmd/git.exe (found version
> "2.10.2.windows.1")
> -- Configuring with MAX_INDEXES = 64U
> -- The C compiler identification is unknown
> -- The CXX compiler identification is unknown
> CMake Error at CMakeLists.txt:126 (PROJECT):
>   No CMAKE_C_COMPILER could be found.
>
> The funny thing is that the use of the -G flag does not issue a "Building
> for..." message, but correctly locates the necessary compiler, whereas the
> -A flag seems to know what target it is building for, but cannot find the
> compiler!
>
> Thank you again,
>
> A. M. Sabuncu
>
> On Tue, Jul 11, 2017 at 10:12 AM, Petr Kmoch  wrote:
>
>> Hi,
>>
>> when generating a Visual Studio buildsystem with CMake, you can specify
>> the target architecture. If you don't, the default is 32-bit.
>>
>> To specify the architecture, either put it into the generator name:
>>
>>   cmake .. -G "Visual Studio 15 2017 Win64" 
>>
>> or specify just the architecture using -A:
>>
>>   cmake .. -A Win64 
>>
>> See description of -G and -A in CMake docs:
>> https://cmake.org/cmake/help/latest/manual/cmake.1.html
>>
>> Petr
>>
>> On 10 July 2017 at 22:06, A.M. Sabuncu  wrote:
>>
>>> I am completely new to CMake, and am using to build MySQL 5.7.18 on
>>> Windows 10 x64, using the following command:
>>>
>>> cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST="C:\Boost" -DENABLE_DOWNLOADS=1
>>>
>>> I have VS 2017 installed, and I am on 64 bit machine, but for some
>>> reason, the above command produces the following output:
>>>
>>> The CXX compiler identification is MSVC 19.10.25019.0
>>> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
>>> Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX
>>> 86/x86/cl.exe
>>> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual
>>> Studio/2017/Professional/VC/Tools/MSVC/14.10.25017/bin/HostX86/x86/cl.exe
>>> -- works
>>>
>>> The correct compiler is in the HostX64/x64 folder.
>>>
>>> Thinking that CMake might be looking it up from there, I checked the
>>> processor architecture environment variable from the same cmd.exe that I
>>> launched the CMake command from, and here's the result:
>>>
>>> PROCESSOR_ARCHITECTURE=AMD64
>>>
>>> When I follow the above CMake command with the following:
>>>
>>> devenv MySQL.sln /build RelWithDebInfo
>>>
>>> I get 32-bit results generated, which is not what I want.
>>>
>>> How can I get CMake to generate a 64-bit build?
>>>
>>> Thanks so much.
>>>
>>>
>>> --
>>>
>>> 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
>>>
>>
>>
>
> --
>
> 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
>
-- 

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 

Re: [CMake] Help on first cmake project

2017-07-07 Thread J Decker
On Thu, Jul 6, 2017 at 11:45 PM, Florian Lindner 
wrote:

> Hello,
>
> coming from scons I want to take a look into cmake...
>
> My CMakeList.txt looks like:
>
>
> cmake_minimum_required (VERSION 3.0)
> project (ASTE)
>
> add_executable(readMesh readMesh.cpp)
>
> find_library(precice precice PATHS $ENV{PRECICE_ROOT}/build/last)
> target_link_libraries(readMesh ${precice})
> set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} $ENV{PRECICE_ROOT}/build/last)
>
>
> find_package(Boost 1.60.0
>   COMPONENTS program_options filesystem
>   REQUIRED)
> target_link_libraries(readMesh ${Boost_LIBRARIES})
>
> find_package(MPI REQUIRED)
> target_link_libraries(readMesh ${MPI_LIBRARIES})
> set(COMPILE_FLAGS  ${COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
> set(LINK_FLAGS ${LINK_FLAGS} ${MPI_LINK_FLAGS})
>
>
> and does it job, i.e. the target builds. precice is out own, independently
> build library.
>
> However, I have several questions:
>
> * Can I make target_link_libraries add a library for all defined targets?
> At the moment, there is only one, but in the
> projekt there are multiple, very similiar targets built.
>
No; each target needs to have target_link_libaries.  You can build a list
of libs to add like set( common_deps ${Boost_LIBRARIES} ${MPI_LIBRARIES} )
; or appending to a variable like you did with COMPILE_FLAGS.


> * Can I make find_library to treat the library as required, as with
> find_package?
>

can add if( -NOTFOUND ) message( ERROR "xxx not found" )
can wrap that in a macro for simplification...

macro( my_find_library var )
  find_library( ${var} ${ARGN} )
  if( ${var}-NOTFOUND )
message( FATAL_ERROR "${ARG2} was not found" )
  endif()
endmacro()

(assumes that you're using the single name version, and not multiple names
using NAME command in find_library)

>
> * Can I reused the value of find_library's PATH setting? Especially if
> there are multiple PATHs, wouldn't it be nice to
> have a precice-LIBPATH that contains the path, where the library was
> found? So I can add this to CMAKE_LIBRARY_PATH? Or
> is there another function that does all that?
>
> Yes, these become available for all sub projects also.
INCLUDE_DIRECTORIES() and LINK_DIRECTORIES() will also get inherited by
child projects.


> * Is there a way to clean cmake cache, other than rm -rf CMakeFiles
> CMakeCache.txt. Would be nice, when playing around
> and frequently changing the CMakeLists.txt
>
> really just remove CMakeCache.txt is sufficient; though generally you
won't have to remove the cache; it redoes the generation if one of the
cmakelists.txt is updated (or included dependancies).  If you're moving
librarites to be found, then yes you will have to remove the cmakecache.


> * I am a bit suprised that finding/or not finding MPI or precice is not
> printed out when executing cmake.
>
> * Any other advises you want to give me?
>
> Thanks for helping a beginner!
>
> Florian
>
> --
>
> 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
>
-- 

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] CmakeLists chain cannot find source added with add_custom_command

2017-07-05 Thread J Decker
On Wed, Jul 5, 2017 at 4:05 AM, J Decker <d3c...@gmail.com> wrote:

> Was more of a style thing... I had (from another project) a cmakelists
> includable script that builds an amalgamation of sources (makes the
> compilation much faster overall because it doesn't have to read megs of
> headers for windows.h et al. for 50 sources but then only 1.) so I was
> updating to use this script, I already had a folder 'portable' which did
> more of a source based build instead of pulling various DLLs so it was
> like
> .../loader (the main project, that links to dlls)  included common
> amalgamation maker here
> .../loader/portable  (the static builds of the same sources) that really
> only contains a single CMakeLists.txt, so rather than use the sources,
> updated to use the amalgamation instead, and it blew up.
>
> I ended up just moving the portable/CMakeLists.txt to
> CMakeLists.portable.txt and including that instead.
>
> Just caught me off guard that it would keep custom targets private to a
> directory instead of making it globally available.  Which would complicate
> implementing this more in lots of other 'portable' (single exe, no DLL
> builds)  But I guess I could create a target that's that amalgamation
> compiled to a static library that could then be referenced by other
> projects.
>

hmm that won't work, the source has the target name compiled into it, so it
would really have to be recompiled anyway  and various other definition
options might be applied...


>
>
> On Wed, Jul 5, 2017 at 3:34 AM, Eric Noulard <eric.noul...@gmail.com>
> wrote:
>
>> OK right.
>> I missed the proper FAQ entry, thanks Nicholas for pointing it out.
>>
>> Eric
>>
>> 2017-07-05 12:10 GMT+02:00 Nicholas Devenish <ndeven...@gmail.com>:
>>
>>> Hi,
>>>
>>> It looks like this is the issue covered in
>>> https://cmake.org/Wiki/CMake_FAQ#How_can_I_add_a_dependency_
>>> to_a_source_file_which_is_generated_in_a_subdirectory.3F
>>> and bug https://gitlab.kitware.com/cmake/cmake/issues/14633 ? I
>>> suppose if you are writing your own systems from scratch it's easy not
>>> to run into this, but a lot easier when converting existing
>>> complicated build systems.
>>>
>>> I kind of agree that it's easy to miss this constraint reading the
>>> documentation, but there doesn't seem to be a better suggested
>>> solution yet.
>>>
>>> Nick
>>>
>>>
>>> On Sun, Jul 2, 2017 at 11:57 AM, Eric Noulard <eric.noul...@gmail.com>
>>> wrote:
>>> > Ok,
>>> >
>>> > I reproduced your issue and I can then confirm it.
>>> > I tried several thing including:
>>> >- generating the file is the buildtree
>>> >- refering to the same file with another target in the same dir
>>> >- using absolute path in the sub2/add_executable
>>> >
>>> > nothing works.
>>> > it looks like a generated file cannot be referred outside the directory
>>> > where the custom command generates it ???
>>> >
>>> > Here comes an archive with an example similar to the one descrived by
>>> J.
>>> > Decker.
>>> > If you build it without option it wokrs (because I used an intermediate
>>> > object lib)
>>> > If you (try to) build it with
>>> >
>>> > cmake -DBROKEN=1
>>> >
>>> > then it'll fails with "Cannot find source file..."
>>> >
>>> > This is definitely weird and I never encountered this after +10 years
>>> of
>>> > CMake usage!!
>>> > So I guess I have always used generated file locally to build exe or
>>> lib and
>>> > then refer to the lib.
>>> > If this is the intended behaviour then it should be documented more
>>> > explicitely.
>>> >
>>> > Now re-reading the doc of add_custom_command:
>>> >
>>> > "This defines a command to generate specified ``OUTPUT`` file(s).
>>> > A target created in the same directory (``CMakeLists.txt`` file)
>>> > that specifies any output of the custom command as a source file
>>> > is given a rule to generate the file using the command at build time."
>>> >
>>> > So the "same directory" should be underlined!! Or may be another
>>> sentence
>>> > saying that in fact you CANNOT refer to outputed files outside the
>>> > directory...
>>> >
>>> > In fact it is possible to h

Re: [CMake] CmakeLists chain cannot find source added with add_custom_command

2017-07-05 Thread J Decker
Was more of a style thing... I had (from another project) a cmakelists
includable script that builds an amalgamation of sources (makes the
compilation much faster overall because it doesn't have to read megs of
headers for windows.h et al. for 50 sources but then only 1.) so I was
updating to use this script, I already had a folder 'portable' which did
more of a source based build instead of pulling various DLLs so it was
like
.../loader (the main project, that links to dlls)  included common
amalgamation maker here
.../loader/portable  (the static builds of the same sources) that really
only contains a single CMakeLists.txt, so rather than use the sources,
updated to use the amalgamation instead, and it blew up.

I ended up just moving the portable/CMakeLists.txt to
CMakeLists.portable.txt and including that instead.

Just caught me off guard that it would keep custom targets private to a
directory instead of making it globally available.  Which would complicate
implementing this more in lots of other 'portable' (single exe, no DLL
builds)  But I guess I could create a target that's that amalgamation
compiled to a static library that could then be referenced by other
projects.



On Wed, Jul 5, 2017 at 3:34 AM, Eric Noulard <eric.noul...@gmail.com> wrote:

> OK right.
> I missed the proper FAQ entry, thanks Nicholas for pointing it out.
>
> Eric
>
> 2017-07-05 12:10 GMT+02:00 Nicholas Devenish <ndeven...@gmail.com>:
>
>> Hi,
>>
>> It looks like this is the issue covered in
>> https://cmake.org/Wiki/CMake_FAQ#How_can_I_add_a_dependency_
>> to_a_source_file_which_is_generated_in_a_subdirectory.3F
>> and bug https://gitlab.kitware.com/cmake/cmake/issues/14633 ? I
>> suppose if you are writing your own systems from scratch it's easy not
>> to run into this, but a lot easier when converting existing
>> complicated build systems.
>>
>> I kind of agree that it's easy to miss this constraint reading the
>> documentation, but there doesn't seem to be a better suggested
>> solution yet.
>>
>> Nick
>>
>>
>> On Sun, Jul 2, 2017 at 11:57 AM, Eric Noulard <eric.noul...@gmail.com>
>> wrote:
>> > Ok,
>> >
>> > I reproduced your issue and I can then confirm it.
>> > I tried several thing including:
>> >- generating the file is the buildtree
>> >- refering to the same file with another target in the same dir
>> >- using absolute path in the sub2/add_executable
>> >
>> > nothing works.
>> > it looks like a generated file cannot be referred outside the directory
>> > where the custom command generates it ???
>> >
>> > Here comes an archive with an example similar to the one descrived by J.
>> > Decker.
>> > If you build it without option it wokrs (because I used an intermediate
>> > object lib)
>> > If you (try to) build it with
>> >
>> > cmake -DBROKEN=1
>> >
>> > then it'll fails with "Cannot find source file..."
>> >
>> > This is definitely weird and I never encountered this after +10 years of
>> > CMake usage!!
>> > So I guess I have always used generated file locally to build exe or
>> lib and
>> > then refer to the lib.
>> > If this is the intended behaviour then it should be documented more
>> > explicitely.
>> >
>> > Now re-reading the doc of add_custom_command:
>> >
>> > "This defines a command to generate specified ``OUTPUT`` file(s).
>> > A target created in the same directory (``CMakeLists.txt`` file)
>> > that specifies any output of the custom command as a source file
>> > is given a rule to generate the file using the command at build time."
>> >
>> > So the "same directory" should be underlined!! Or may be another
>> sentence
>> > saying that in fact you CANNOT refer to outputed files outside the
>> > directory...
>> >
>> > In fact it is possible to have cross-directory reference to generated
>> file
>> > but this is
>> > more like a workaround. You'll have to:
>> >
>> > define your custom_command and an associated custom target in dir1
>> > define your exe/lib in dir2 and explicitely:
>> >- flag the referred cross-dir generated source as GENERATED
>> >- make your exe/lib depend on the cross-dir custom target in order to
>> > trigger the file generation.
>> >
>> >
>> > The second zip implement that workaround. This is nasty, I wouldn't do
>> that.
>> > Shall we open a bug for this misleading behavior or shall we

Re: [CMake] CmakeLists chain cannot find source added with add_custom_command

2017-07-02 Thread J Decker
It is not generated; because it is generated during a the build phase not
the generate phase.  So only the logical idea of the file exists.

On Sun, Jul 2, 2017 at 12:12 AM, Eric Noulard <eric.noul...@gmail.com>
wrote:

> Needless to say that your example should work but somehow CMake does not
> see that the referred file is GENERATED.
>
> Le 2 juil. 2017 09:11, "Eric Noulard" <eric.noul...@gmail.com> a écrit :
>
>> Is the referred file created?
>> Does your actual command creating the file doing it in the source tree
>> and not in the build tree?
>> Are you building in-source or out of source?
>>
>> Could you give us us a toy example which shows the issue?
>>
>> Le 2 juil. 2017 04:32, "J Decker" <d3c...@gmail.com> a écrit :
>>
>> Known issue?  Or just doesn't require a response?
>>
>> On Wed, Jun 28, 2017 at 6:05 AM, J Decker <d3c...@gmail.com> wrote:
>>
>>> I have this chain of makefiles.  It adds a custom rule to build a source
>>> file, and then a subdirectory cannot reference that file.
>>>
>>> The first is added custom rule for M:/tmp/cmake-chain/sub/src/sack.c
>>> and then later cannot find M:/tmp/cmake-chain/sub/src/sack.c
>>> though it's really referencing it as M:/tmp/cmake-chain/sub/sub2
>>> /../src/sack.c
>>>
>>> tested with 3.6.0-rc4 and 3.9.0-rc5
>>>
>>> if the add_custom_rule and add_executable are in the same makefile even
>>> if there's a added path to make it not exactly the same source as the
>>> 'referencing source' message logs; it works.
>>>
>>>
>>> --- CMakeLists.txt ---
>>> cmake_minimum_required(VERSION 2.8)
>>>
>>> message( "Adding custom rule for ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c"
>>> )
>>>   add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c
>>>   COMMAND cmake -E echo do something to make src/sack.c
>>>   )
>>> add_subdirectory( sub2 )
>>> -
>>>
>>> --- sub2/CmakeLists.txt ---
>>> message( "referencing source ${CMAKE_CURRENT_SOURCE_DIR}/../src/sack.c"
>>> )
>>> add_executable( something ${CMAKE_CURRENT_SOURCE_DIR}/../src/sack.c )
>>>
>>> -
>>>
>>> --- Truncated output log --
>>> Adding custom rule for M:/tmp/cmake-chain/sub/src/sack.c
>>> referencing source M:/tmp/cmake-chain/sub/sub2/../src/sack.c
>>> -- Configuring done
>>> CMake Error at sub2/CMakeLists.txt:3 (add_executable):
>>>   Cannot find source file:
>>>
>>> M:/tmp/cmake-chain/sub/src/sack.c
>>>
>>>   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm
>>> .hpp
>>>   .hxx .in .txx
>>> --
>>>
>>>
>>> -- Flat CmakeLists.txt which works ---
>>> cmake_minimum_required(VERSION 2.8)
>>>
>>> message( "Adding custom rule for ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c"
>>> )
>>>   add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c
>>> COMMAND cmake -e echo make file.
>>>   )
>>>
>>> message( "referencing source ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
>>> add_executable( something ${CMAKE_CURRENT_SOURCE_DIR}/sub2/../src/sack.c
>>> )
>>> --
>>>
>>> - flat cmakelists output ---
>>> Adding custom rule for M:/tmp/cmake-chain-flat/src/sack.c
>>> referencing source M:/tmp/cmake-chain-flat/sub2/../src/sack.c
>>> -- Configuring done
>>> --
>>>
>>>
>>
>> --
>>
>> 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
>>
>>
>>
-- 

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] CmakeLists chain cannot find source added with add_custom_command

2017-07-01 Thread J Decker
Known issue?  Or just doesn't require a response?

On Wed, Jun 28, 2017 at 6:05 AM, J Decker <d3c...@gmail.com> wrote:

> I have this chain of makefiles.  It adds a custom rule to build a source
> file, and then a subdirectory cannot reference that file.
>
> The first is added custom rule for M:/tmp/cmake-chain/sub/src/sack.c
> and then later cannot find M:/tmp/cmake-chain/sub/src/sack.c
> though it's really referencing it as M:/tmp/cmake-chain/sub/
> sub2/../src/sack.c
>
> tested with 3.6.0-rc4 and 3.9.0-rc5
>
> if the add_custom_rule and add_executable are in the same makefile even if
> there's a added path to make it not exactly the same source as the
> 'referencing source' message logs; it works.
>
>
> --- CMakeLists.txt ---
> cmake_minimum_required(VERSION 2.8)
>
> message( "Adding custom rule for ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
>   add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c
>   COMMAND cmake -E echo do something to make src/sack.c
>   )
> add_subdirectory( sub2 )
> -
>
> --- sub2/CmakeLists.txt ---
> message( "referencing source ${CMAKE_CURRENT_SOURCE_DIR}/../src/sack.c" )
> add_executable( something ${CMAKE_CURRENT_SOURCE_DIR}/../src/sack.c )
>
> -
>
> --- Truncated output log --
> Adding custom rule for M:/tmp/cmake-chain/sub/src/sack.c
> referencing source M:/tmp/cmake-chain/sub/sub2/../src/sack.c
> -- Configuring done
> CMake Error at sub2/CMakeLists.txt:3 (add_executable):
>   Cannot find source file:
>
> M:/tmp/cmake-chain/sub/src/sack.c
>
>   Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
>   .hxx .in .txx
> --
>
>
> -- Flat CmakeLists.txt which works ---
> cmake_minimum_required(VERSION 2.8)
>
> message( "Adding custom rule for ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
>   add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c
> COMMAND cmake -e echo make file.
>   )
>
> message( "referencing source ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
> add_executable( something ${CMAKE_CURRENT_SOURCE_DIR}/sub2/../src/sack.c )
> --
>
> - flat cmakelists output ---
> Adding custom rule for M:/tmp/cmake-chain-flat/src/sack.c
> referencing source M:/tmp/cmake-chain-flat/sub2/../src/sack.c
> -- Configuring done
> --
>
>
-- 

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] CmakeLists chain cannot find source added with add_custom_command

2017-06-28 Thread J Decker
I have this chain of makefiles.  It adds a custom rule to build a source
file, and then a subdirectory cannot reference that file.

The first is added custom rule for M:/tmp/cmake-chain/sub/src/sack.c
and then later cannot find M:/tmp/cmake-chain/sub/src/sack.c
though it's really referencing it
as M:/tmp/cmake-chain/sub/sub2/../src/sack.c

tested with 3.6.0-rc4 and 3.9.0-rc5

if the add_custom_rule and add_executable are in the same makefile even if
there's a added path to make it not exactly the same source as the
'referencing source' message logs; it works.


--- CMakeLists.txt ---
cmake_minimum_required(VERSION 2.8)

message( "Adding custom rule for ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
  add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c
  COMMAND cmake -E echo do something to make src/sack.c
  )
add_subdirectory( sub2 )
-

--- sub2/CmakeLists.txt ---
message( "referencing source ${CMAKE_CURRENT_SOURCE_DIR}/../src/sack.c" )
add_executable( something ${CMAKE_CURRENT_SOURCE_DIR}/../src/sack.c )

-

--- Truncated output log --
Adding custom rule for M:/tmp/cmake-chain/sub/src/sack.c
referencing source M:/tmp/cmake-chain/sub/sub2/../src/sack.c
-- Configuring done
CMake Error at sub2/CMakeLists.txt:3 (add_executable):
  Cannot find source file:

M:/tmp/cmake-chain/sub/src/sack.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
--


-- Flat CmakeLists.txt which works ---
cmake_minimum_required(VERSION 2.8)

message( "Adding custom rule for ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
  add_custom_command( OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c
COMMAND cmake -e echo make file.
  )

message( "referencing source ${CMAKE_CURRENT_SOURCE_DIR}/src/sack.c" )
add_executable( something ${CMAKE_CURRENT_SOURCE_DIR}/sub2/../src/sack.c )
--

- flat cmakelists output ---
Adding custom rule for M:/tmp/cmake-chain-flat/src/sack.c
referencing source M:/tmp/cmake-chain-flat/sub2/../src/sack.c
-- Configuring done
--
-- 

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 with VS2015 C++ Build Tools and missing ucrtbased.dll

2017-03-10 Thread J Decker
or copy ucrtbased.dll into your program directory...
ucrtbaseD.dll is the debug version, and is only installed with the
compilers, and not just the windows kits(?).


On Fri, Mar 10, 2017 at 8:47 AM, TT  wrote:

> I'm having the same problem with "missing" ucrtbased.dll even though it is
> present in all the platforms under C:\Program Files (x86)\Windows
> Kits\10\bin\
>
> I have tried reinstalling the Windows SDK and the Microsoft C++ Build Tools
> (2015).
>
> Here are some related links with no solutions:
>
> 1)
> https://social.msdn.microsoft.com/Forums/en-US/25a64cd8-
> 1482-4cc4-9dbb-3a420c7a31be/visual-c-build-tools-doesnt-
> install-ucrtbaseddll?forum=vssetup
>  - I can't reinstall Visual Studio, because I never installed it, only the
> aforementioned Build Tools.
>
> 2)
> http://stackoverflow.com/questions/33743493/why-visual-
> studio-2015-cant-run-exe-file-ucrtbased-dll/41970093
>  - This one says "This problem is from VS 2015 silently failing to copy
> ucrtbased.dll (debug) and ucrtbase.dll (release) into the appropriate
> system
> folders.."
>
> Here is a recent answer that seems to be getting at the root cause of the
> problem:
> http://stackoverflow.com/a/35466136/3066295
>
> Which links to this,
> https://blogs.msdn.microsoft.com/vcblog/2015/03/03/
> introducing-the-universal-crt/
>
> Which has a comment part way down that says "When debugging on machines
> that
> do not have the Windows SDK installed, we would recommend copying the debug
> Universal CRT (ucrtbased.dll) app-locally with your app, or copying it to
> the system directory yourself."
>
> So the solution seems to be install either the Windows SDK (10 not just 8.1
> as I have) or copy the ucrtbased.dll to C:\Windows\System32
>
>
>
> --
> View this message in context: http://cmake.3232098.n2.
> nabble.com/CMake-with-VS2015-C-Build-Tools-and-missing-ucrtbased-dll-
> tp7593931p7595151.html
> Sent from the CMake mailing list archive at Nabble.com.
> --
>
> 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
>
-- 

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] Intel C Generator for Cmake?

2017-02-15 Thread J Decker
Toolchain is probably what you want

http://stackoverflow.com/questions/9129233/recommended-ways-to-use-cmake-with-icc-via-configuration-options

https://cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F

"cmake intel toochain" search.

On Wed, Feb 15, 2017 at 6:42 AM, Thompson, KT  wrote:

> Tony,
>
>
>
> I don’t have access to the Intel compiler on Windows to try this out.
> However, in an old post I found, it was suggested that you can use cmake’s
> “-T” option to select the Intel compiler when the generator is “Visual
> Studio”.
>
>
>
> For example:  -T"Intel C++ Compiler XE 13.0"
>
>
>
> Ref: https://software.intel.com/en-us/forums/intel-c-compiler/topic/456288
>
>
>
> -kt
>
>
>
>
>
> *From:* CMake [mailto:cmake-boun...@cmake.org] *On Behalf Of *Tony Garratt
> *Sent:* Wednesday, February 15, 2017 6:21 AM
> *To:* Petr Kmoch 
> *Cc:* cmake@cmake.org
> *Subject:* Re: [CMake] Intel C Generator for Cmake?
>
>
>
>
>
> Re: my previous email. To use the Intel C compilers I just can modify the
> VS settings. So I have a way forward.
>
>
>
> Regards,
>
> Tony
>
>
>
> On Wed, Feb 15, 2017 at 12:25 PM, Petr Kmoch  wrote:
>
> Hi Tony,
>
> generators are for different *buildsystems*: a generator for Makefiles, a
> generator for Visual Studio solutions, a generator for Ninja files, a
> generator for Eclipse projects etc.
>
> Intel C and Intel Fortran are compilers, not buildsystems. You should be
> able to use them with any generator whose buildsystem supports those
> compilers.
>
> On Windows, CMake supports generation of vfproj files using the Visual
> Studio generator. I don't know if Intel C has its own Visual Studio project
> type in the same fashion, and if so, whether CMake supports it.
>
> One of the setups I maintain uses Visual Studio's C++ compiler and Intel
> Fortran compiler on Windows using the Visual Studio generator, and
> conceptually, it's as simple as this:
>
> call ...\ifortvars.bat ...
>
> set FC=ifort
>
> cmake ...
>
> Petr
>
>
>
> On 15 February 2017 at 12:34, Tony Garratt  wrote:
>
> I am having to switch to cmake from autotools for a third party tool I
> want to build. We use Intel C and Intel Fortran on Windows. I see no
> mention of an Intel C generator for cmake. I presume this means there is
> not one? If so, can I create my own Intel C generator please?
>
>
>
> Rgeards,
>
> Tony
>
>
>
> --
>
> *Dr Tony Garratt*
>
>
>
>
>
>
>
>
>
> --
>
> *Dr Tony Garratt*
>
> Tel: +44 7624 309933 <+44%2076%202430%209933>
>
> --
>
> 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
>
-- 

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] Proper way to support 64bit and 32bit builds

2016-10-29 Thread J Decker
I would think the find is using something like...  so you'll need to adjust
cmake_sizeof_void_p

if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
DEFINE_DEFAULT( __64__ ON )
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
DEFINE_DEFAULT( __64__ OFF )
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
SET( __64__ ${__64__} CACHE BOOL "Enable 64 considerations" )


On Sat, Oct 29, 2016 at 3:22 AM, cen  wrote:

> Hi
>
> Once I switch to 32bit builds, CMake fails to recognise that
> glibc-devel.i686 is not installed resulting in an error when running make.
> In the same way, my own FindGMP fails to recognize that gmp-devel.i686 is
> not installed. I need CMake to fail if these things are missing.
> At least for the compiler part, I'm pretty sure I am missing some var or
> flag to tell CMake I expect a 32 bit build.
>
> This is what I use to switch between builds in CMakeLists.txt (ARCH var is
> irrelevant here,  I use it later on for CPack):
>
> if (BUILD_32)
> set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
> "-m32" LINK_FLAGS "-m32")
> MESSAGE(STATUS "Excluding 64bit library paths from search.")
> set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
> set(ARCH i686)
> elseif (BUILD_64)
> set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS
> "-m64" LINK_FLAGS "-m64")
> set(ARCH amd64)
> else()
> set(ARCH amd64)
> endif()
>
>
> For the FindGMP module, I am not really sure what the best practice
> is.Does the BUILD_32 and BUILD_64 flag propagate into the FindGMP? Do I
> explicitly specify paths for 32bit libs (eg: /usr/lib64) or can  cmake be
> smarter than this?
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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] is it worth using cmake to cross-compile for embedded arm device?

2016-10-19 Thread J Decker
to gcc you can pass --sysroot which will bias it's internal referenced
includes and libraries

On Wed, Oct 19, 2016 at 9:57 AM, Gunter, Walter E  wrote:

> The toolchain was a great suggestion.
>
>
>
> I am still having problems, but at least I know I am using the right
> toolchain:
>
> Currently, this is what I have for my toolchain:
>
>
>
> set(CMAKE_SYSTEM_NAME Linux)
>
> set(CMAKE_SYSTEM_PROCESSOR arm)
>
> set(TOOLCHAIN_PATH /opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi)
>
>
>
> # where is the target environment
>
> set(CMAKE_FIND_ROOT_PATH /opt/toolchains/arm-2008q3/
> arm-none-linux-gnueabi)
>
>
>
> # specify the cross compiler
>
> set(CMAKE_CXX_COMPILER /opt/toolchains/arm-2008q3/
> bin/arm-none-linux-gnueabi-g++)
>
> set(CMAKE_C_COMPILER /opt/toolchains/arm-2008q3/
> bin/arm-none-linux-gnueabi-gcc)
>
>
>
> #set(CMAKE_AR /opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-ar)
>
>
>
> set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
>
> set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
>
> set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
>
> set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
>
>
>
> set(COMPILE_FLAGS "-lrt -Wall -lpthread")
>
>
>
>
>
> I run cmake with the reference to that toolchain file, cmake
> –DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake
>
>
>
> I can see it finds the right toolchain and compilers.
>
> Now I am having some issues where it is getting conflicted between using
> sys or linux headers….
>
> Is this just a header issue?
>
>
>
> CMAKE question:  What is the difference between the two variables?
>
> TOOLCHAIN_PATH
>
> CMAKE_FIND_ROOT_PATH
>
> Should they be the same reference location?
>
>
> This is the folder structure at the /opt/toolchains/arm-2008q3/
> bin/arm-none-linux-gnueabi
>
> /bin
>
> /include
>
> /lib
>
> /libc
>
>
>
> Thoughts?
>
>
>
> Thanks!
>
>
>
> *From:* dfloge...@gmail.com [mailto:dfloge...@gmail.com] *On Behalf Of *Dave
> Flogeras
> *Sent:* Friday, September 16, 2016 5:43 PM
> *To:* Gunter, Walter E
> *Subject:* Re: [CMake] is it worth using cmake to cross-compile for
> embedded arm device?
>
>
>
> I personally use cmake with multiple cross toolchains successfully.  I
> guess it depends on what you are trying to achieve.  I prefer it because I
> can use the same CMakeLists.txt to build natively on linux/mac/windows, as
> well as cross-compile against an embedded arm linux.  I'd also agree with
> the previous discussion about using a toolchain file for your platform, it
> does simplify things.
>
>
>
> On Fri, Sep 16, 2016 at 5:26 PM, Gunter, Walter E <
> walter.gun...@dematic.com> wrote:
>
> I am having some troubles getting cmake setup and wonder if cmake is the
> right tool.
>
> Thoughts? Suggestions?
>
>
>
> --
>
> 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
>
-- 

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] try_compile additional include FILES

2016-10-01 Thread J Decker
to fit in with the exsting schema.
Docs also say it's only available after 8.1 so it's really not; and
depending on the toolkit used .. which I guess is another version that
could be checked instead.

On Sat, Oct 1, 2016 at 1:49 AM, Hendrik Sattler <p...@hendrik-sattler.de>
wrote:

> Hi,
>
> If you know that you are on Windows and know all that, why do you want an
> expensive check for it?
>
> HS
>
>
> Am 30. September 2016 19:57:07 MESZ, schrieb J Decker <d3c...@gmail.com>:
> >I've been playing with libressl; which has quite a few
> >'check_function_exists'
> >
> >In particular 'check-function-exists( inet_pton HAVE_INET_PTON )'
> >
> >this is failing, because, directly, there is no 'inet_pton' in windows,
> >but
> >by including ws2tcpip.h there is a #define that changes it to
> >InetPton[A/W]
> >
> >but I don't see any way to specify additional files to include.
> >
> >
> >
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
>
-- 

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] try_compile additional include FILES

2016-09-30 Thread J Decker
I've been playing with libressl; which has quite a few
'check_function_exists'

In particular 'check-function-exists( inet_pton HAVE_INET_PTON )'

this is failing, because, directly, there is no 'inet_pton' in windows, but
by including ws2tcpip.h there is a #define that changes it to InetPton[A/W]

but I don't see any way to specify additional files to include.
-- 

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] Wrong version of cl.exe for x64

2016-08-22 Thread J Decker
On Mon, Aug 22, 2016 at 1:33 AM, Nils Gladitz <nilsglad...@gmail.com> wrote:

> On 08/22/2016 10:28 AM, J Decker wrote:
>
> Maybe you need a diferent parameter to vcvarsall before running cmake
>
> https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx
>
> >
> How to: Enable a 64-Bit Visual C++ Toolset on the Command Line
>
>
> To run vcvarsall.bat to use a 64-bit toolset
>
>1.
>
>At the command prompt, change to the Visual C++ installation
>directory. (The location depends on the system and the Visual Studio
>installation, but a typical location is C:\Program Files (x86)\Microsoft
>Visual Studio *version*\VC\.) For example, enter:
>
> To configure this Command Prompt window for 64-bit command-line builds
that target x86 platforms, at the command prompt, enter:
*vcvarsall amd64_x86*

*shjrug* the article spells it out.

>
> The visual studio command line environments should have no effect when
> using the visual studio generators.
> They should only be relevant when you use one of the command line
> generators (e.g. makefiles or ninja).
>
> Nils
>
-- 

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] Wrong version of cl.exe for x64

2016-08-22 Thread J Decker
Maybe you need a diferent parameter to vcvarsall before running cmake

https://msdn.microsoft.com/en-us/library/x4d2c09s.aspx

On Mon, Aug 22, 2016 at 1:01 AM, Nils Gladitz  wrote:

> On 08/22/2016 09:27 AM, tonka tonka wrote:
>
> Hey,
>>
>> I have recently switched to cmake (instead of plain visual studio).
>> Now i discovered a problem.cmake choose the wrong cl.exe for my x64
>> project.
>>
>>
> I don't think CMake chooses the compiler when using the visual studio
> generators.
> Visual Studio chooses and CMake just records that choice in
> CMAKE__COMPILER.
>
> Nils
>
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-- 

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] howto retrigger check_function_exists

2016-08-18 Thread J Decker
I don't understand how this works

info_size[1] will return 'N'
how will it know it has to pass like 14 arguments to get the right
character?  And even then the character '4' is not the value 4.



- this is the code generated for check_type_size

#include 
#include 
#include 
#include "time.h"


#undef KEY
#if defined(__i386)
# define KEY '_','_','i','3','8','6'
#elif defined(__x86_64)
# define KEY '_','_','x','8','6','_','6','4'
#elif defined(__ppc__)
# define KEY '_','_','p','p','c','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
#endif

#define SIZE (sizeof(time_t))
char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
  ('0' + ((SIZE / 1)%10)),
  ('0' + ((SIZE / 1000)%10)),
  ('0' + ((SIZE / 100)%10)),
  ('0' + ((SIZE / 10)%10)),
  ('0' +  (SIZE% 10)),
  ']',
#ifdef KEY
  ' ','k','e','y','[', KEY, ']',
#endif
  '\0'};

#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
  int require = 0;
  require += info_size[argc];
  (void)argv;
  return require;
}






On Thu, Aug 18, 2016 at 11:50 AM, J Decker <d3c...@gmail.com> wrote:

> I was trying to add some libraries for CMAKE_REQUIRED_LIBRARIES to be able
> to find more symbols, but changing that didn't cause the
> check_function-0exists to re-run; is there a shorter way to get it to
> re-run without deleting CMakeCache.txt?
> I'm not abject to manually editing files; I had tried to remove just the
> cached variable reference, but that didn't help.
>
> Same for check_type_size() I guess
>
-- 

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] howto retrigger check_function_exists

2016-08-18 Thread J Decker
I was trying to add some libraries for CMAKE_REQUIRED_LIBRARIES to be able
to find more symbols, but changing that didn't cause the
check_function-0exists to re-run; is there a shorter way to get it to
re-run without deleting CMakeCache.txt?
I'm not abject to manually editing files; I had tried to remove just the
cached variable reference, but that didn't help.

Same for check_type_size() I guess
-- 

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] Why is cmake deleting my files?

2016-08-05 Thread J Decker
On Fri, Aug 5, 2016 at 12:46 PM, J Decker <d3c...@gmail.com> wrote:

>
>
> On Fri, Aug 5, 2016 at 11:59 AM, J Decker <d3c...@gmail.com> wrote:
>
>> I'm using "MinGW Makefiles" as a generator...
>>
>>
>> When I change a cmakelists.txt file, a bunch of sources I specify to copy
>> from /.../.c to ${CMAKE_BINARY_DIR}/.../.cpp get deleted in binary by cmake.
>>
>> There are no rules in the makefiles for those files to depend on anything
>> other than the original .c file, so I was really confused why they kept
>> getting regenerated... I started to pay attention and found that cmake,
>> during configure, if a cmakeLists.txt changes goes through and deletes all
>> those files.
>>
>>
>> add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
>>   DEPENDS ${SOURCE}
>>   COMMAND ${CMAKE_COMMAND} -E
>> copy_if_different ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
>>   )
>>
>>
>> all outputs get deleted?
>>
> The file is opened with CreateFile, then
>
> SetDispositionInformationFile \Device\HarddiskVolume15\
> mingw64-x86\sack-r\release_solution\core\src\utils\
> deploy\CMakeFiles\sack_deploy.dir\DependInfo.cmake.tmp SUCCESS Delete:
> True
>
> so when the file is closed it's deleted...
>
> Seems to be set from __archive_mktemp(const char *tmpdir)  passing
> FILE_FLAG_DELETE_ON_CLOSE; but my files aren't temporary
> that's the only thing that seems to set that flag
>
> -
> trying to make a simple case; but it's not doing it.
>

--
in the simple case, modifying the COMMANDs in  add_custom_command() deletes
the output file; I can understand that
In the complex case, I'm modifying a CMakeLists.txt which doesn't have any
bearing on the commands applied to the sources or the other libraries using
those sources; but it's still deleting them.

In the root CMakeLists.txt, I setup the list of sources for the main
project 'bag' and then for each of those sources copy them to
${CMAKE_BINARY_DIR}/original/path/to/source/file[s/.c/.cpp/] and add
another library 'bag++' with those sources.  I then include a bunch of
various subdirectories, one of which I'm currently working in, and while
that references the original C source names in the original tree, it
doesn't reference any of the C++ sources...  or even the built libraries;
it's a target that links from all the original sources directly; with a
different path than originally specified even  (original paths would be
like add_library( bag M:/sack/src/memlib/sharemem.c  ) where the paths
used in thie project would be add_exeutable( something
"../../../../../src/memlib/sharemem.c" )



It's also different whether I do 'make' which ends up trigger the cmake
generation which doesn't delete the files.   if I just call 'cmake .' the
files do get deleted.  no that's not it either... this time after the build
finished I re-saved the cmakelists that I've been working on with no
changes, and the files all copied again running with just 'make'

I dunno maybe I'm using some common variable like MORE_SOURCES or
EXTRA_SOURCES or something that's somehow related inadvertantly
-- 

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] Why is cmake deleting my files?

2016-08-05 Thread J Decker
On Fri, Aug 5, 2016 at 11:59 AM, J Decker <d3c...@gmail.com> wrote:

> I'm using "MinGW Makefiles" as a generator...
>
>
> When I change a cmakelists.txt file, a bunch of sources I specify to copy
> from /.../.c to ${CMAKE_BINARY_DIR}/.../.cpp get deleted in binary by cmake.
>
> There are no rules in the makefiles for those files to depend on anything
> other than the original .c file, so I was really confused why they kept
> getting regenerated... I started to pay attention and found that cmake,
> during configure, if a cmakeLists.txt changes goes through and deletes all
> those files.
>
>
> add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
>   DEPENDS ${SOURCE}
>   COMMAND ${CMAKE_COMMAND} -E
> copy_if_different ${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
>   )
>
>
> all outputs get deleted?
>
The file is opened with CreateFile, then

SetDispositionInformationFile
\Device\HarddiskVolume15\mingw64-x86\sack-r\release_solution\core\src\utils\deploy\CMakeFiles\sack_deploy.dir\DependInfo.cmake.tmp
SUCCESS Delete: True

so when the file is closed it's deleted...

Seems to be set from __archive_mktemp(const char *tmpdir)  passing
FILE_FLAG_DELETE_ON_CLOSE; but my files aren't temporary
that's the only thing that seems to set that flag

-
trying to make a simple case; but it's not doing it.
-- 

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] Why is cmake deleting my files?

2016-08-05 Thread J Decker
I'm using "MinGW Makefiles" as a generator...


When I change a cmakelists.txt file, a bunch of sources I specify to copy
from /.../.c to ${CMAKE_BINARY_DIR}/.../.cpp get deleted in binary by cmake.

There are no rules in the makefiles for those files to depend on anything
other than the original .c file, so I was really confused why they kept
getting regenerated... I started to pay attention and found that cmake,
during configure, if a cmakeLists.txt changes goes through and deletes all
those files.


add_custom_command( OUTPUT ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
  DEPENDS ${SOURCE}
  COMMAND ${CMAKE_COMMAND} -E copy_if_different
${SOURCE} ${CMAKE_BINARY_DIR}/${BASENAME}${FILEEXT}
  )


all outputs get deleted?
-- 

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 Makefile generated by CMake support make -jN?

2016-07-12 Thread J Decker
On Tue, Jul 12, 2016 at 7:54 PM, Chaos Zhang  wrote:

> Hi, all,
>
> I was trying to compile my project using CMake, after CMake generated
> Makefile.
> I used `/usr/bin/time -v make` to make the Makefile,  got the result:
> 'Percent of CPU this job got: 96%'.
> Then i used `/usr/bin/time -v make -j8` to make the Makefile, the result of
> CPU used is  'Percent of CPU this job got: 648%'.
> So i wonder if Makefile generated by CMake support make -jN, BTW my CPU is
> I7-4790, and after i use 'cat /proc/cpuinfo', there are 8 processors.
>
>
All the sources, headers, etc come from the IO system, from the disk,
probably you're running into the bottleneck of how long it takes to move
the memory for the compiler to do work on?  did you profile IO ?


> Thanks a lot,
> Chao
>
>
>
> --
> View this message in context:
> http://cmake.3232098.n2.nabble.com/Does-Makefile-generated-by-CMake-support-make-jN-tp7593949.html
> Sent from the CMake mailing list archive at Nabble.com.
> --
>
> 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
>
-- 

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] cmp0065

2016-07-06 Thread J Decker
M:/tmp/cmake_cmp0065/CMakeLists.txt(1):  cmake_minimum_required(VERSION 3.0
)
M:/tmp/cmake_cmp0065/CMakeLists.txt(2):  project(cmake-test )
M:/tmp/cmake_cmp0065/CMakeLists.txt(3):  add_executable(myExe main.c )
M:/tmp/cmake_cmp0065/CMakeLists.txt(4):  target_compile_definitions(myExe
PRIVATE MY_DEFINITION )
M:/tmp/cmake_cmp0065/CMakeLists.txt(5):  target_compile_definitions(myExe
PRIVATE VERSION_STRING="0.8.15" )
M:/tmp/cmake_cmp0065/CMakeLists.txt(6):  set(project myExe )

-- Configuring done
CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0065 is not set: Do not add flags to export symbols from
  executables without the ENABLE_EXPORTS target property.  Run "cmake
  --help-policy CMP0065" for policy details.  Use the cmake_policy command
to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, additional flags may be
  added to export symbols on all executables regardless of thier
  ENABLE_EXPORTS property.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: M:/tmp/cmake_cmp0065/build

---
you have cmake_minimum_required(VERSION 3.5 ) in your example... setting
3.0 instead and adding --trace shows the warning...

-
then command you said to use is doing exactly the same thing I'm doing to
the same target property... of course it should generate the same
result and it does.
-- 

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] Fwd: cmp0065

2016-07-06 Thread J Decker
(probably breaks thread coherance; misreplied)
-- Forwarded message --
From: J Decker <d3c...@gmail.com>
Date: Wed, Jul 6, 2016 at 8:43 AM
Subject: Re: [CMake] cmp0065
To: Johannes Zarl-Zierl <johannes.zarl-zi...@jku.at>




On Wed, Jul 6, 2016 at 2:52 AM, Johannes Zarl-Zierl <
johannes.zarl-zi...@jku.at> wrote:

> Hi,
>
> On Tuesday 05 July 2016 23:46:16 J Decker wrote:
> > https://cmake.org/cmake/help/v3.4/policy/CMP0065.html
> > while I like the idea it suggests, I don't use the flags for -rdynamic so
> > this is meaningless to me
>
> I'm not sure I understood you correctly, but if the policy is meaningless
> to
> you, it shouldn't affect you...
>
> >
> https://cmake.org/cmake/help/v3.4/prop_tgt/ENABLE_EXPORTS.html#prop_tgt:ENAB
> > LE_EXPORTS
> >   SET_PROPERTY(TARGET ${project} APPEND PROPERTY COMPILE_DEFINITIONS
> > TARGET_LABEL=${TARGET_LABEL};TARETNAME=\"${TARGETNAME}\" )
> >
> > or
> >
> > SET_PROPERTY( TARGET ${project} APPEND PROPERTY COMPILE_DEFINITIONS
> > "CONSOLE_SHELL" )
> >
> > to indicate it's non-WIN32
>
> First of all, there are the usual standard definitions provided by the
> compiler, so you can just use
>
> #if defined(WIN32)
> #endif
>

not WIN32 that way... as in add_executable( something WIN32 ... )  (or not
WIN32)


>
> target_compile_definitions( yourTarget PRIVATE COMPILE_SHELL)
> https://cmake.org/cmake/help/v3.4/command/target_compile_definitions.html
>
> Is that what you are searching for?
>

it says "tems will populate theCOMPILE_DEFINITIONS
<https://cmake.org/cmake/help/v3.4/prop_tgt/COMPILE_DEFINITIONS.html#prop_tgt:COMPILE_DEFINITIONS>
property
of"
sounds like that will trigger the same CMP0065 warnings.


>
> > I noted at the bottom of that the the default behavior will eventually be
> > phased out... but then can we have some other flag to phase it back in?
>
> You can always set policies to “OLD” to revert to the old behavior (until
> it
> is finally phased out). In the case of cmp0065 the documentation explains
> what
> you can do to have the same behavior with the policiy enabled:
> Just set the ENABLE_EXPORTS property on the targets that need to export
> their
> symbols.
>

again though; the flags specified have nothing to do with exporting
symbols; so enabling that is false;  I want to provide COMPILE_DEFINITIONS
for many targets that don't export symbols and are DLLs.



>
> HTH,
>   Johannes
> --
>
> 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
-- 

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-developers] How to set startup project in Visual Studio

2016-06-20 Thread J Decker
One might be able to use FILE() to generate a .vcxproj.user if( NOT EXISTS )

This is a version from 2012 project.  ALL_BUILD.vcxproj.user  (it's the
default project. so it's the one i usually set, unless something clever
along these lines happened )



http://schemas.microsoft.com/developer/msbuild/2003;>
  

C:\General\Build\karaway\chatment\output\bin\chatment.exe

C:\General\Build\karaway\chatment\output\bin
WindowsLocalDebugger
  



-
That's not even a very large file to write the whole thing

Another for VS14


http://schemas.microsoft.com/developer/msbuild/2003;>
  

C:\General\Build\sack-x64\Debug_out\core\bin\test.json.parser.exe



C:\General\Build\sack-x64\Debug_out\core\bin
WindowsLocalDebugger
  


---
I guess there's some platform settings that will make it bigger, but done
in a

foreach( target )
  writeProjectUser( target )

shouldn't be too painful...

On Mon, Jun 20, 2016 at 2:11 PM, Stephen Kelly <steve...@gmail.com> wrote:

> J Decker wrote:
>
> > The setting is in a different file that's .vcproj.user (or .user.vcproj)
>
> And there is not one of these for each project() command?
>
> It seems to me that this should either be a GLOBAL property, or the
> documentation which directory to set the DIRECTORY property on. I have no
> idea what the answer is.
>
> Thanks,
>
> Steve.
>
>
> --
>
> 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-developers
>
-- 

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-developers

Re: [cmake-developers] How to set startup project in Visual Studio

2016-06-19 Thread J Decker
The setting is in a different file that's .vcproj.user (or .user.vcproj)

and cmake doesn't write that... would be nice if it could at least write
those entiries required... nice thing about xml should be that what's there
can be read and used and filled in with the rest of the settings?  Well I
guess that's really implementation dependant.

On Sun, Jun 19, 2016 at 2:42 PM, Mike Gelfand  wrote:

> Hello,
>
> On 06/18/2016 03:15 PM, Stephen Kelly wrote:
> > a DIRECTORY property VS_STARTUP_PROJECT which sets the start up project
> in
> > Visual Studio. I tried it in the 3.6 RC and it works fine if I set the
> > property in the top-level directory, so thanks for that.
> >
> > However, the documentation does not say which directory to set it in, or
> why
> > it is a DIRECTORY property.
> >
> > Why is this not a GLOBAL property?
> My guess would be because CMake generates .sln file for each project()
> call (e.g. if you have additional project() calls in subdirectories
> apart from the top-level one), and then for each .sln file it would be
> possible to specify different startup [VS] project. So it's not exactly
> a directory, but a project property I would say, but there're no
> "project properties" in CMake.
>
> Regards,
> Mike
> --
>
> 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-developers
>
-- 

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-developers

Re: [CMake] MinGW and sh.exe

2016-06-19 Thread J Decker
I was searching for 'cmake disable check sh.exe' which is not a problem
(anymore?)

If I do
cmake -G "MinGW Makefiles" /some/path
it complains; then the same command again succeeds; so it's not a
problem... it only causes a stutter in startup; which is a problem; and the
project builds and installs just fine. (it doesn't do find required system
libraries to pull in the libgcc-sjlj-something-threads library and
potentially others on 'findrequiredsystemlibraries?'  but that's a side
issue.


sh.exe comes with git.exe  there's just no two ways about it.

and not in MSYS; just an installed mingw64 from sourceforge and cmake


On Wed, Jun 17, 2015 at 1:25 AM, Jörg Kreuzberger  wrote:

> Hi!
>
> i get an error at cmake configure step on windows with -G "MinGW
> Makefiles", if the OpenSSH bin folder is in the PATH environment cause
> cmake detects sh.exe and then throws an error. This seems to be intended
> due to this link
> http://www.cmake.org/Wiki/CMake_MinGW_Compiler_Issues
> But if i now configure a second time, everything is fine and the generated
> MinGW Makefiles are generated properly and could be build normaly with
> mingw32-make wihtout any msys or sh environment.
>
> So is the first cmake error an error? The link ist quite old (2006)
>
> Thanks for any help.
> Joerg
>
> --
>
> 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
>
-- 

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] Debug vs Release "install" area

2016-05-13 Thread J Decker
I meant to also add; when I first was porting my projects to cmake, I
thought this was a thing I wanted to do also... turns out, it's just a
lot easier to make 2 build trees and build one release and one debug
and have the same output image exactly for both... then install one or
the other for use with other projects  (no renaming files and
adding 'd', no extra subdirectories... bin/debug and bin/release... )

On Thu, May 12, 2016 at 1:07 PM, Scott Aron Bloom  wrote:
> Looking for some advice.
>
>
>
> In order to make our Visual Studio debugging environment, as self-contained
> (and easy to use for the developers) as possible, we use developers must run
> an install.  We also use the resulting release based Install for our
> packaging into our installer.
>
>
>
> We change the prefix variable CMAKE_INSTALL_PREFIX, to
> ${CMAKE_BINARY_DIR}/Install, as well as having a each application call a
> function that places a .user.vcxproj that sets the PATH appropriately.
>
>
>
> It really works great, except there is one caveat.  VC++ has libraries that
> are debug vs release dependent, so if your debug build happens to pick up a
> release DLL (or vice versa) you can (will) be in trouble in random ways.
>
>
>
> Typically, when I change over, I simply delete the install, and re-install.
>
>
>
> Ideally, I would like to know is there any way to set the
> CMAKE_INSTALL_PREFIX variable separately for debug vs release? If so how?
>
>
>
> A second option, which I thought of…
>
>
>
> Is to generate a file “DEBUG.BUILD.TXT” and then at the START of the
> installation process, run a script for debug builds, that says if the file
> doesn’t exist, delete everything and carry on.  If running for a release
> install, if it DOES exist delete and carry on.
>
>
>
>
>
> Any thoughts on this?
>
> Thanks
>
>
> Scott
>
>
>
>
>
>
> --
>
> 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
-- 

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] Debug vs Release "install" area

2016-05-13 Thread J Decker
there is also BUILD_TYPE (not CMAKE_BUILD_TYPE, which is the initial
condition) that often gets translated into.  BUILD_TYPE seems to get
set to the current building configuration.

http://cmake.limitpoint.com/installing-multiple-build-types-in-cmake-generated-visual-studio-projects-2/


https://cmake.org/pipermail/cmake/2011-June/044851.html

if(SUPPORTS_PARALLEL_BUILD_TYPE)
>>>
>>>  CMAKE_INSTALL_CONFIG_NAME is set to the current configuration name
>>> (DEbug, release, minsizerel) as chosen in the visual studio
>>> environment so to choose which you build - you choose which you
>>> build.
>>>
>>> It doesn't package multiple configurations at once into a single NSIS,
>>> but it will package any single configuration.





On Fri, May 13, 2016 at 1:43 PM, Roman Wüger  wrote:
> You could use conditional generator expressions e.g $ with a
> combination of add_custom_command stuff like "${CMAKE_COMMAND} -P
> yourscript.cmake " to handle the rest.
>
> Best Regards
> Roman
>
> Am 12.05.2016 um 22:07 schrieb Scott Aron Bloom :
>
> Looking for some advice.
>
>
>
> In order to make our Visual Studio debugging environment, as self-contained
> (and easy to use for the developers) as possible, we use developers must run
> an install.  We also use the resulting release based Install for our
> packaging into our installer.
>
>
>
> We change the prefix variable CMAKE_INSTALL_PREFIX, to
> ${CMAKE_BINARY_DIR}/Install, as well as having a each application call a
> function that places a .user.vcxproj that sets the PATH appropriately.
>
>
>
> It really works great, except there is one caveat.  VC++ has libraries that
> are debug vs release dependent, so if your debug build happens to pick up a
> release DLL (or vice versa) you can (will) be in trouble in random ways.
>
>
>
> Typically, when I change over, I simply delete the install, and re-install.
>
>
>
> Ideally, I would like to know is there any way to set the
> CMAKE_INSTALL_PREFIX variable separately for debug vs release? If so how?
>
>
>
> A second option, which I thought of…
>
>
>
> Is to generate a file “DEBUG.BUILD.TXT” and then at the START of the
> installation process, run a script for debug builds, that says if the file
> doesn’t exist, delete everything and carry on.  If running for a release
> install, if it DOES exist delete and carry on.
>
>
>
>
>
> Any thoughts on this?
>
> Thanks
>
>
> Scott
>
>
>
>
>
> --
>
> 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
>
>
> --
>
> 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
-- 

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 link shared lib on windows (visual studio 2014).

2016-04-25 Thread J Decker
On Apr 25, 2016 6:41 PM, "J. Caleb Wherry"  wrote:
>
> (1)
>
> You typically want to define the entry point in the source itself. You
can use the 'CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS' in CMake but you usually do
something like this in the source:
>
> #ifdef WIN32
> #define PUBLIC_API __declspec(dllexport)
> #else
> #define PUBLIC_API
> #endif
>
> PUBLIC_API void HelloFunc();
>
> That way when you are building a shared lib on windows it will export
those symbols which in turn creates the .lib. Without the exported symbols,
you will not have an import lib.
>
> (2)
>
> The missing DLL is a pain that you are just going to have to deal with
unless you want to do a bunch of voodoo with the registry or copy the DLLs.
Typically, there are POST_BUILD steps that copy the needed DLLs into the
same directory as the exe. There are many stackoverflow questions dealing
with this, first one googled here:
>

Could just set the path environment variable... No registry hack.. Or
include install rules and just build install before running.
>
http://stackoverflow.com/questions/5765986/how-can-i-run-an-exe-with-dlls-in-separate-directory
>
> -Caleb
>
>
> On Mon, Apr 25, 2016 at 9:01 PM, Chaos Zhang  wrote:
>>
>> Hi,
>>
>> I faced this problem when i try built a shared lib  and linked it on
>> windows. The structure of my project as below:
>> -test_dir/
>>  -sub_hello/
>>CMakeLists.txt
>>hello.c
>>  -top/
>>main.c
>>CMakeLists.txt
>>  CMakeLists.txt
>>
>> The content of each file:
>> ①test_dir/CMakeLists.txt:
>> PROJECT(TESTLIB)
>> add_subdirectory(sub_hello sub_hello)
>> add_subdirectory(top top)
>>
>> ②test_dir/sub_hello/CMakeLists.txt:
>> message("message from sub_hello")
>> add_library(hello_lib  SHARED hello.c)
>>
>> ③test_dir/top/CMakeLists.txt:
>> include_directories(../sub_hello)
>> add_executable(main main.c)
>> target_link_libraries(main hello_lib)
>>
>> ④test_dir/sub_hello/hello.c:
>> #include 
>> void HelloFunc()
>> {
>> printf("###hello###\n");
>> }
>>
>> ⑤test_dir/top/main.c:
>> int main()
>> {
>> HelloFunc();
>> return 0;
>> }
>>
>> After i cmake this project, generated .sln and .proj files, then i built
it
>> and i get an error in vs:
>>
>> Error   LNK1104 can't open file "..\sub_hello\Debug\hello_lib.lib"
>>
>> In folder ..\sub_hello\Debug\ , there was not a hello_lib.lib existed.
>> Then i look thorough and found a solution:
>>
>> Add "set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS YES)" in file
>> test_dir/sub_hello/hello.c
>>
>> Then i built this solution again, this time it success, and hello_lib.lib
>> and main.exe was generated. But when i try to run main.exe, an error
>> occured: "lose hello_lib.dll". And i moved hello_lib.dll into the folder
of
>> main.exe, and it worked well.
>>
>> There are two questions i could not figure out:
>> ①Is this "..\sub_hello\Debug\hello_lib.lib" associates with
>> "..\sub_hello\Debug\hello_lib.dll"? For windows can not use .dll
directly,
>> and use a .lib to record the .dll's  entrance and location.
>> ②How to solve the problem of main.exe can not find .dll file.
>>
>> Best regards,
>> Chao Zhang
>>
>>
>>
>>
>>
>> --
>> View this message in context:
http://cmake.3232098.n2.nabble.com/How-to-link-shared-lib-on-windows-visual-studio-2014-tp7593346.html
>> Sent from the CMake mailing list archive at Nabble.com.
>> --
>>
>> 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
>
>
>
>
> --
> J. Caleb Wherry
> Scientific Software Engineer
>
> http://www.calebwherry.com
> +1 (615) 708-5651
> calebwhe...@gmail.com
>
> --
>
> 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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware 

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

2016-04-25 Thread J Decker
Add __declspec(dllexport) before void HelloFunc()
On Apr 25, 2016 6:01 PM, "Chaos Zhang"  wrote:

> Hi,
>
> I faced this problem when i try built a shared lib  and linked it on
> windows. The structure of my project as below:
> -test_dir/
>  -sub_hello/
>CMakeLists.txt
>hello.c
>  -top/
>main.c
>CMakeLists.txt
>  CMakeLists.txt
>
> The content of each file:
> ①test_dir/CMakeLists.txt:
> PROJECT(TESTLIB)
> add_subdirectory(sub_hello sub_hello)
> add_subdirectory(top top)
>
> ②test_dir/sub_hello/CMakeLists.txt:
> message("message from sub_hello")
> add_library(hello_lib  SHARED hello.c)
>
> ③test_dir/top/CMakeLists.txt:
> include_directories(../sub_hello)
> add_executable(main main.c)
> target_link_libraries(main hello_lib)
>
> ④test_dir/sub_hello/hello.c:
> #include 
> void HelloFunc()
> {
> printf("###hello###\n");
> }
>
> ⑤test_dir/top/main.c:
> int main()
> {
> HelloFunc();
> return 0;
> }
>
> After i cmake this project, generated .sln and .proj files, then i built it
> and i get an error in vs:
>
> Error   LNK1104 can't open file "..\sub_hello\Debug\hello_lib.lib"
>
> In folder ..\sub_hello\Debug\ , there was not a hello_lib.lib existed.
> Then i look thorough and found a solution:
>
> Add "set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS YES)" in file
> test_dir/sub_hello/hello.c
>
> Then i built this solution again, this time it success, and hello_lib.lib
> and main.exe was generated. But when i try to run main.exe, an error
> occured: "lose hello_lib.dll". And i moved hello_lib.dll into the folder of
> main.exe, and it worked well.
>
> There are two questions i could not figure out:
> ①Is this "..\sub_hello\Debug\hello_lib.lib" associates with
> "..\sub_hello\Debug\hello_lib.dll"? For windows can not use .dll directly,
> and use a .lib to record the .dll's  entrance and location.
> ②How to solve the problem of main.exe can not find .dll file.
>
> Best regards,
> Chao Zhang
>
>
>
>
>
> --
> View this message in context:
> http://cmake.3232098.n2.nabble.com/How-to-link-shared-lib-on-windows-visual-studio-2014-tp7593346.html
> Sent from the CMake mailing list archive at Nabble.com.
> --
>
> 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
-- 

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 add dependency relations between libs and executable

2016-04-20 Thread J Decker
On Wed, Apr 20, 2016 at 6:21 PM, vakano  wrote:
> Hi, Chuck,
>
> Thanks for the explanation, it is very clear now.
>
> One last question is:
>
> *folder/proj_a*
> CMakeLists.txt:
> add_executable(A main.cpp)
> target_link_libraries(A B C)
>
> *folder/proj_b*
> CMakeLists.txt:
> project(proj_b)
> add_library(B proj_b.cpp)
>
> 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?
>
> Thanks,
> vakano
>

Targets are global.  ... Add_library( ${target_name} ${sources} )
later becomes $ as generator expressions also...

add_executable( /*target_name*/ [WIN32 CONSOLE (default console)] ... )
add_library( /*target_name */  [STATIC or SHARED (default STATIC... ] ... )

actually there's a way to control what the defaults are if you don't
specify anything.. but that tends to apply to the whole make system so
if you just add_subdirectory( ../bullet3  bullet3 ) for instance it
might end up doing things like appending 'd' to output names :)  (it
doesn't anymore)


Sub-projects can also be built individually by going into theiry
direcotry and doing a make (selecting the target and building in a
gui) and it will build everything it's related to.

>
>
> Chuck Atkins wrote
>>> 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 , lib_C can
>>> be invoked directly without import in proj_a?
>>>
>>
>> If you configure the top level project, you can always invoke make on only
>> the B or C targets via "make A" or "make B".  However, by having the
>> "project' command in the CMakeLists.txt for proj_b and proj_c, then those
>> can also be treated as fully independent projects of their own, meaning
>> they can either be configured by themselves or as a part of the top-level.
>>
>> - Chuck
>>
>> --
>>
>> 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
>
>
>
>
>
> --
> View this message in context: 
> http://cmake.3232098.n2.nabble.com/How-to-add-dependency-relations-between-libs-and-executable-tp7593264p7593305.html
> Sent from the CMake mailing list archive at Nabble.com.
> --
>
> 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
-- 

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] Howto install executables that aren't targets

2016-03-09 Thread J Decker
use INSTALL( PROGRAMS ) ...  FILES drops executable bit on linux

On Wed, Mar 9, 2016 at 5:38 AM, J. Caleb Wherry  wrote:
> "install(FILES..." should work, that is how you install non-target files.
> Are you sure it isn't a permission issue? Do other install commands work
> that copy to /usr/bin?
>
> We'll need a little more information to diagnose the issue, an simple CMake
> example would be nice.
>
> Caleb
>
>
> On Wednesday, March 9, 2016, Winfried  wrote:
>>
>> Hi,
>> the build system of a qt-based visual robot programming teaching platform
>> shall be ported from autotools to cmake.
>> For the build process of the platform the underlying compilers and some
>> shell scripts aiming diffenent robot targets are not built but just have
>> to
>> be installed (copied) to /usr/bin.
>>
>> I tried different ways to do this:
>> install(FILES  DESTINATION /usr/bin)
>> ->  file INSTALL cannot copy file
>>   "/opt/build/tuxminds_3.96_cmake/tools/tuxm_aar-04_make.sh" to
>>   "/usr/bin/tuxm_aar-04_make.sh".
>>
>> install(TARGETS  RUNTIME DESTINATION /usr/bin)
>> ->  install TARGETS given target "tuxm_aar-04_make.sh" which does not
>> exist in
>>   this directory.
>>
>> install(TARGETS ${CMAKE_CURRENT_SOURCE_DIR}/
>> ${CMAKE_CURRENT_SOURCE_DIR}/
>> ...
>> RUNTIME DESTINATION /usr/bin)
>> ->  install TARGETS given target
>>   "/opt/build/tuxminds_3.96_cmake/tools/tuxm_aar-04_make.sh" which
>>   does not exist in this directory.
>>
>> (The files are located in ${CMAKE_CURRENT_SOURCE_DIR} .)
>>
>> So, I would be glad, if someone could help me with this topic.
>> Thanks in advance!
>> Winfried
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://cmake.3232098.n2.nabble.com/Howto-install-executables-that-aren-t-targets-tp7592951.html
>> Sent from the CMake mailing list archive at Nabble.com.
>> --
>>
>> 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
>
>
>
> --
> Sent from my iPhone 4s
>
> --
>
> 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
-- 

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 does cmake "discover" Visual Studio C++ compilers?

2016-02-15 Thread J Decker
Is a registry setting...

6.0, 7.0, 7.1, 8.0, 9.0, 10.0,..
HKLM\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\InstallDir

HKLM\SOFTWARE\Wow6432Node\Microsoft\VCExpress\12.0\Setup\VC
HKLM\SOFTWARE\Wow6432Node\Microsoft\VCExpress\14.0\Setup\VC

On Mon, Feb 15, 2016 at 8:23 PM, Eric Erhardt
 wrote:
> I am trying to get our continuous integration system working in a Windows
> Docker container.
>
>
>
> We use CMake along with the Visual C++ compilers shipped with VS 2015.
>
>
>
> I have installed cmake-3.4.3-win32-x86 on the windows container, and also VS
> 2015 community with just the '/InstallSelectableItems',
> 'NativeLanguageSupport_VC', so just the C++ tools are installed.
>
>
>
> However, when I run cmake -G "Visual Studio 14 2015 Win64", I first get:
>
>
>
> The C compiler identification is unknown
>
> The CXX compiler identification is unknown
>
>
>
>
>
> But then I try running it again, and then the compiler is picked up.
>
>
>
> I know the recommendation is “run cmake in a VS developer command prompt”,
> but I’m in a Docker container, so I can’t pick my command prompt.
>
>
>
> I’ve tried running vcvarsall.bat in the container during the build before
> calling cmake -G, but it doesn’t fix the issue.
>
>
>
> So my question is:  exactly what does cmake look for to pick up the VS
> compilers?  Does “cl.exe” need to be on the PATH?  Does a certain
> environment variable need to be set?  Or a registry setting?
>
>
>
> Thanks in advance,
>
> Eric Erhardt
>
>
> --
>
> 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
-- 

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] Windows Whole Program Optimization options

2016-02-11 Thread J Decker
By default Cmake generates project files with no
 set in uhmm...these sections...

  
DynamicLibrary
false
MultiByte
v140
  


Default for VS14 is - when creating a new project includes
true



nothing defaults to 'No Whole Program Optimization'
true equates to 'Use Link Time Code Generation'

There's also guided profile optimization options... but probably less
important for automated builds like cmake produces.

I bring this up because in release mode, with No Whole Program
Optimization there's a bug in the compiler that optimizes away certain
code.  This makes several of my projects fail.  In late december they
confirmed it, but have as of yet not seen any updates to fix said
issue.  Plus, having the optimization option able to be set would be a
bonus anyway since it makes programs smaller.  (Yes, it's kind of
silly that not having optimization doesn't work, one would think that
the optimize option would remove it)

Any thoughts on how this might be specified in cmake?
-- 

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] MinGW Error having sh.exe

2016-02-04 Thread J Decker
When using -G "MinGW Makefiles" I keep getting an error

---

CMake Error at 
C:/General/tools/unix/cmake/share/cmake-3.5/Modules/CMakeMinGWFindMake.cmake:22
(message):
  sh.exe was found in your PATH, here:

  C:/Program Files/Git/bin/sh.exe

  For MinGW make to work correctly sh.exe must NOT be in your path.

  Run cmake from a shell that does not have sh.exe in your PATH.

  If you want to use a UNIX shell, then use MSYS Makefiles.

Call Stack (most recent call first):
  CMakeLists.txt:8 (project)


CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

-

if I just re-run the cmake It completes fine and even compiles correctly.

It's getting sh because GIT uses it... and it's not something I can
really bypass, and I sometimes do NEED git in my path.

if I just edit the CmakeMinGWFIndMake.cmake file and comment out the
mesage box and make program override it also works just fine.

once upon a time ... maybe a decade ago sh.exe in the path caused
erorrs... but this sin't such an issue anymore. ( Since Mingw32-make
ignores -j # option?)

-
if(CMAKE_SH)

  #message(FATAL_ERROR "sh.exe was found in your PATH,
here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT
be in your path.\nRun cmake from a shell that does not have sh.exe in
your PATH.\nIf you want to use a UNIX shell, then use MSYS
Makefiles.\n")

  #set(CMAKE_MAKE_PROGRAM NOTFOUND)

endif()
-
-- 

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] undefined reference to 'pthread_create'

2016-02-04 Thread J Decker
Probably didn't previously need pthreads until you updated to use
C++11 features which brings in pthreads in the deadstart code...


On Thu, Feb 4, 2016 at 8:53 AM, rpela...@archlinux.info
 wrote:
> I believe that doesn't have anything to do with C11 flags. You are just
> missing the link to the pthread library. I could be wrong.
>
> Try and add this to your cmake file:
>
> find_package (Threads)
>
> target_link_libraries (myexecutable/lib ${CMAKE_THREAD_LIBS_INIT})
>
>
>
> Sent from my iPhone
>
> On Feb 4, 2016, at 10:42 AM, Aaron Boxer  wrote:
>
> Hello,
> I have a cmake project that uses C++11 threads.
> I have added the lines
>
> set (CMAKE_CXX_STANDARD 14)
> set(CMAKE_CXX_STANDARD_REQUIRED ON)
>
>
> CMAKE version is 3.2.2, running on Ubuntu.
>
> When I try to build, I get the error
>
> undefined reference to `pthread_create`
>
> Any ideas on how to fix this?
>
> Thanks!
> Aaron
>
> --
>
> 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
>
>
> --
>
> 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
-- 

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


  1   2   3   4   5   6   >