Re: [CMake] COMPONENT question

2016-10-31 Thread iosif neitzke
On 10/31/2016 11:42 AM, Dave Flogeras wrote:
> Hi, are static libraries able to be added to a component?

Yes!

> 
> The following minimal example doesn't work as I expected:
> 
> CMAKE_MINIMUM_REQUIRED( VERSION 3.0.0 )
> PROJECT( foo )
> 
> ADD_LIBRARY( foo foo.c )
> INSTALL( TARGETS foo ARCHIVE DESTINATION lib
>  RUNTIME DESTINATION bin
>  LIBRARY DESTINATION bin
>  COMPONENT bar )
> 
> INCLUDE( CPack )
> 
> If I run "make list_install_components" it says "Unspecified"
> 
> However, if I add "SHARED" to the ADD_LIBRARY call (or set
> BUILD_SHARED_LIBS), it lists the component as "bar" which is what I'd
> expect.
> 

Try something like:
INSTALL( TARGETS foo ARCHIVE DESTINATION lib COMPONENT bar
 RUNTIME DESTINATION bin COMPONENT bar
 LIBRARY DESTINATION bin COMPONENT bar )

The nesting of brackets "[]" in docs [0], requires a COMPONENT keyword
and argument (should you choose to use components) for each kind of
target file keyword (ARCHIVE, RUNTIME, LIBRARY, etc..) you use.

I believe you get the puzzling behavior varying with STATIC versus
SHARED library type because of the way the command is parsed.  When
building a STATIC library, there is only an ARCHIVE, which has no
COMPONENT listed, so you get "Unspecified" when listing components.
When building a SHARED library on non-DLL platforms, the binary is a
LIBRARY target, which has the COMPONENT "bar" listed.

Each kind of target file keyword (ARCHIVE, RUNTIME, LIBRARY, etc..) has
its own list of subsequent properties.

[0]
https://cmake.org/cmake/help/v3.7/command/install.html#installing-targets

[1] example in ParaView:
https://github.com/Kitware/ParaView/blob/6714c5c4d1e643f451421dd1004d9540d8607524/CMakeLists.txt#L710

> Is this a bug, or by design?  I'm attempting to figure out how I can
> separate shared/static libraries in my project for different install
> types.  For example, if I am packaging a binary only install, I don't
> need to install static libraries, but I would need the runtime libraries.
> 
> Dave
> 
> 
-- 

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] make_directory deprecated. What's the correct solution to generate directories at build time now?

2016-10-11 Thread iosif neitzke
I think only the cmake script command make_directory is deprecated, not
the cmake command-line tool -E mode make_directory?

On Tue, Oct 11, 2016 at 5:21 PM, Paulo Waelkens
 wrote:
> Hello,
>
> to create a cmake directory at build time
> (http://stackoverflow.com/questions/3702115/creating-a-directory-in-cmake)
> you could use
>
> add_custom_target(build-time-make-directory ALL
> COMMAND ${CMAKE_COMMAND} -E make_directory ${directory})
>
> "make_directory" is now listed as deprecated in the new cmake documentation
> (https://cmake.org/cmake/help/v3.6/command/make_directory.html).
>
> How exactly could I repeat the original behaviour without using deprecated
> functionality?
> I understand that I'm supposed to use file(MAKE_DIRECTORY ${directory})
> somehow, but don't understand how exactly to connect this with COMMAND.
>
> I've tried to use
> COMMAND ${CMAKE_COMMAND} -E file ...   (definitely wrong, because
> cmake.exe -E  [args...] does not list "file" as an available
> command)
> COMMAND file(MAKE_DIRECTORY ${directory})   (wrong, again, 'file' is not
> recognized as an internal or external command)
>
> Does anyone know how to do this right? I'll keep using the deprecated stuff
> for now, but that's kind of sad.
>
> Thanks for the help! Cheers,
> Paulo
>
>
> --
>
> 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] Visual Studio : can I add a references to a cmake generated vcxproj ?

2016-05-19 Thread iosif neitzke
We did on a regular basis during a transition period to hook up
existing .vcproj files to a CMake generated solution as we were
converting fully to CMake.  I believe you can control what GUID gets
generated by CMake by using target properties in your CMakeLists.txt
file:

https://stackoverflow.com/questions/15415007/can-i-get-the-guid-generated-by-cmake-for-a-specific-vcproj-at-cmake-time

On Thu, May 19, 2016 at 8:07 AM, Benjamin Ballet via CMake
 wrote:
> Hi folks
>
> Is there a reason not to add a references to a cmake generated project from
> a classic visual studio project ?
>
> Anyone does it on a daily basis ?
>
> I'm worrying about the generated ProjectGUID :
> The guid of the project is stored in the classic visual studio project as
> well as in the generated vcxproj.
> I guess that guid may be different between two cmake generation ? If then
> what will happen ?
>
> Thank you !
>
> --
> Benjamin BALLET
> Ingénieur R
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.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] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread iosif neitzke
I'm sorry, I'm not sure I understand.  In your example, there is
target_link_libraries(lib3 PUBLIC lib1).  It looks like lib2 has
target_link_libraries(lib2 PRIVATE lib1).

http://public.kitware.com/pipermail/cmake/2016-May/063382.html

On Thu, May 12, 2016 at 9:10 AM, Patrick Boettcher
<patrick.boettc...@posteo.de> wrote:
> On Thu, 12 May 2016 09:04:10 -0500
> iosif neitzke <iosif.neitzke+cm...@gmail.com> wrote:
>
>> target_include_directories(lib1 INTERFACE /tmp) means /tmp is
>> propagated with lib1, but not used to build lib1.
>
> I know. Could you elaborate how this is related with lib3 PRIVATEly linking to
> lib1?
>
> regards,
> --
> Patrick.
-- 

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] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread iosif neitzke
I guess the key is static libraries don't exactly adhere to the rules
of PUBLIC or PRIVATE, so you end up with a library that CMake passes
along with a populated INTERFACE_INCLUDE_DIRECTORIES, and so exe1 uses
it because it is there?  Not sure how it is supposed to work at this point.

On Thu, May 12, 2016 at 9:26 AM, Patrick Boettcher
<patrick.boettc...@posteo.de> wrote:
> On Thu, 12 May 2016 09:20:10 -0500
> iosif neitzke <iosif.neitzke+cm...@gmail.com> wrote:
>
>> I'm sorry, I'm not sure I understand.  In your example, there is
>> target_link_libraries(lib3 PUBLIC lib1).  It looks like lib2 has
>> target_link_libraries(lib2 PRIVATE lib1).
>
> Yes. That is correct.
>
> When building the code for lib2 and lib3 the include-path of lib1 is
> provided (as expected).
>
> Then when building exe1 (links to lib2) and exe2 (links to lib3) the
> lib1's include-path is present in both cases.
>
> Whereas it should not be present with exe1, at least that is my
> understanding.
>
> --
> Patrick.
-- 

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] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread iosif neitzke
target_include_directories(lib1 INTERFACE /tmp) means /tmp is
propagated with lib1, but not used to build lib1.

"The INTERFACE, PUBLIC and PRIVATE keywords are required to specify
the scope of the following arguments. PRIVATE and PUBLIC items will
populate the INCLUDE_DIRECTORIES property of . PUBLIC and
INTERFACE items will populate the INTERFACE_INCLUDE_DIRECTORIES
property of ."

https://cmake.org/cmake/help/v3.5/command/target_include_directories.html

On Thu, May 12, 2016 at 8:59 AM, Patrick Boettcher
<patrick.boettc...@posteo.de> wrote:
> On Thu, 12 May 2016 08:47:33 -0500
> iosif neitzke <iosif.neitzke+cm...@gmail.com> wrote:
>
>> My reading of your examples:
>>
>> exe1 gets linked to lib2, and lib2/bin is included.  exe1 probably
>> won't link ultimately because lib2 may need symbols from lib1.
>> Depends on the structure of the C code between lib2 and lib1.   See
>> John Lakos for further information on that.
>
> It links - because it is a STATIC library - so propagated even though
> it's PRIVATE.
>
> My problem is just the include-dir of lib1 (/tmp) which should _not_ be
> propagated to exe1, but it is propagated.
>
> regards,
> --
> Patrick.
-- 

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] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-12 Thread iosif neitzke
My reading of your examples:

exe1 gets linked to lib2, and lib2/bin is included.  exe1 probably
won't link ultimately because lib2 may need symbols from lib1.
Depends on the structure of the C code between lib2 and lib1.   See
John Lakos for further information on that.

exe2 gets linked to lib3, and gets lib3/bin included because lib3 has
PUBLIC in its own target_include_directories command.  Because exe2
gets lib3, it also gets lib1 and lib1/tmp.

On Thu, May 12, 2016 at 8:19 AM, Patrick Boettcher
 wrote:
> On Wed, 11 May 2016 21:58:34 +1000
> Craig Scott  wrote:
>
> [..]
>> If you were paying careful attention, you would have noticed that
>> when A links in B as PRIVATE, the include directories of B never
>> propagate to something linking to A, but if A is a static library,
>> then the *linking* of B behaves as though the relationship was
>> PUBLIC. This PRIVATE-becomes-PUBLIC behaviour for static libraries
>> only applies to the *linking*, not to the other dependencies
>> (compiler options/flags and include search paths). The upshot of all
>> this is that if you select PRIVATE, PUBLIC or INTERFACE based on the
>> explanations in the dot points above, then CMake will ensure
>> dependencies propagate through to where they are required, regardless
>> of whether libraries are static or shared. This does, of course, rely
>> on you the developer not missing any dependencies or specifying the
>> wrong PRIVATE/PUBLIC/INTERFACE relationship.
>
> Thank you for you long explanation. It was exactly my understanding.
>
> So cmake 3.5.0 has a bug then because I don't see the behavior you
> describe. Have you seen my example I sent in my first mail?
>
> http://public.kitware.com/pipermail/cmake/2016-May/063382.html
>
> Include-dirs from B are propagated to C which links to A which itself
> linked privately to B.
>
> Should I file a bug?
>
> regards,
> --
> Patrick.
>
>
>
>
>
>
>
>
-- 

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] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-11 Thread iosif neitzke
> When A links in B as PRIVATE, it is saying that A uses B in its
> implementation, but B is not used in any part of A's public API.

> When A links in B as INTERFACE, it is saying that A does not use B in its
> implementation, but B is used in A's public API.

> When A links in B as PUBLIC, it is essentially a combination of PRIVATE and
> INTERFACE. It says that A uses B in its implementation and B is also used in
> A's public API.

All totally correct, and that is how visibility for target_link and
target_include commands idiomatically should be used, but I don't
believe anything in CMake ensures the code architecture adheres to
this scheme.
-- 

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] Difference between PRIVATE and PUBLIC with target_link_libraries

2016-05-11 Thread iosif neitzke
>> I *think* that these public/private rules behave a bit differently
>> for static libraries than they do for shared ones.

They do.  Assuming main calls a() and b() defined in A_lib and B_lib
respectively, for:
add_library(A_lib STATIC a.c)
add_library(B_lib STATIC b.c)
target_link_libraries(A_lib PRIVATE B_lib)
add_executable(main main.c)
target_link_libraries(main A_lib)

The PRIVATE in "target_link_libraries(A_lib PRIVATE B_lib)" is
useless.  It is the same as writing "target_link_libraries(A_lib
PUBLIC B_lib)", only more confusing to the reader. Static libraries
always link to their dependencies publically.

https://cmake.org/cmake/help/v3.5/command/target_link_libraries.html#libraries-for-a-target-and-or-its-dependents

However, if you change A_lib to be a shared library with
"add_library(A_lib SHARED a.c)" and left the rest of the code the
same, you would now get link errors for main not able to find b(),
because A_lib now does not pass on its dependency on B, it hides it
from main.   Change the last line to "target_link_libraries(main A_lib
B_lib)" and main builds again.
-- 

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 deal with generated source files (w/ dependency tracking) for globs

2016-04-06 Thread iosif neitzke
I think it depends on when you want the output files from Nim
generated and which files are the most frequently developed.
If it is usually a one-time generation per clean development session,
the simplest case, where the *.NIM source files are not the files
most likely to be changed, I would think execute_process should
work okay?

cmake_minimum_required( VERSION 2.8.11 )

project( GenerateSomeFilesAndBuildThem C )

execute_process( COMMAND touch a.c a.h b.c b.h c.c c.h
   COMMAND echo "Generating some C files using NIM..."
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} )

file( GLOB SRC ${CMAKE_CURRENT_BINARY_DIR}/*.c
   ${CMAKE_CURRENT_BINARY_DIR}/*.h )

add_executable( generated main.c ${SRC} )

target_include_directories( generated PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )

...

The C compiler identification is GNU 5.2.1
Check for working C compiler: /usr/bin/cc
Check for working C compiler: /usr/bin/cc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Generating some C files using NIM...

Configuring done
Generating done

...

make
Scanning dependencies of target generated
[ 25%] Building C object CMakeFiles/generated.dir/main.c.o
[ 50%] Building C object CMakeFiles/generated.dir/c.c.o
[ 75%] Building C object CMakeFiles/generated.dir/a.c.o
[100%] Building C object CMakeFiles/generated.dir/b.c.o
Linking C executable generated
[100%] Built target generated

On Wed, Apr 6, 2016 at 8:55 AM, Nicholas Braden
 wrote:
> Okay, so I tried my own suggesting and found that it doesn't work at
> all (it's more complicated than I thought). However I want to ask you
> about your logic here - you say that when the configure step runs, it
> cancels XCode's build and so the user has to run the build a second
> time. If we use a script to generate a file or just touch one of the
> cmake files for every build, that means that every build will be
> cancelled and XCode will never move on to actually compile anything.
> The only way to actually let a build not be cancelled is either to run
> `cmake --build .` from the command line instead of using the IDE, or
> to not modify any CMake file, which requires some pretty elaborate
> scripting to accomplish. Even just touching the modified date of a
> CMake file will cause the configure step to run. At this point I think
> you should just tell your users to manually run the configure step
> whenever they add or remove a nim source file, because either way it
> will be a two-click process. There is no way I see to have the magic
> single-click build you want given XCode's limitations. But if you ever
> do find a way I'd be interested to hear.
>
> (Though, I don't know how XCode treats External Projects - maybe you
> could get it to work that way, but it'd be ugly)
>
> On Wed, Apr 6, 2016 at 6:28 AM, Eric Wing  wrote:
>> On 4/4/16, Nicholas Braden  wrote:
>>> I haven't tested this myself, but instead of using a glob, you could
>>> have a build step that generates a CMake script file with the list of
>>> generated files in it (e.g. via execute_process to run another CMake
>>> script whose only job is to generate the CMake script inception-style)
>>> and just include the generated file - CMake will see that the CMake
>>> file has been modified during every build but will still handle source
>>> file changes correctly. Worth a shot.
>>>
>>
>> Thanks for the reply. So if I understand this correctly, this is what
>> the workflow is going to feel like.
>>
>> - User adds their Nim file to the CMakeLists.txt
>> - CMake detects a change and a bootstrap generate/update takes place,
>> and my stuff re-runs the Nim compiler.
>> - Also during this phase, I need to generate another CMake script
>> which contains the list of files the Nim compiler output.
>> - Since this other script is also under CMake change tracking, this
>> will trigger another CMake change detection and
>> bootstrap/generate/update.
>> - Now the generated build system has the updated list of generated .c
>> files to compile and will finally compile it.
>>
>> Does this sound right?
>>
>> My major concern is that the two bootstrap phases kind of break the
>> flow. What I mean by that is that in Xcode for example, when a
>> bootstrap/generate/update happens, it actually causes your Build/Run
>> (run button) action to abort midway through. You sit there expecting
>> it to build, but CMake's regeneration was the only thing that
>> happened. You must hit the Run button again to actually build/run.
>> Kind of annoying and also really confusing for people who don't
>> understand this because it isn't obvious why this happened.
>>
>> But in the above example, there are now two bootstrap phases. So
>> assuming this works, I think the user will have to hit the Run button
>> at least 3 times before something actually builds/runs. I think this
>> is going to feel real 

Re: [CMake] include_external_msproject

2016-01-26 Thread iosif neitzke
No, I do not believe so.

https://cmake.org/cmake/help/v3.4/command/include_external_msproject.html

Keyword being 'project'.

On Tue, Jan 26, 2016 at 8:43 AM, Lars  wrote:
> Appreciate some help understanding include_external_msproject.
> Using Windows 7 and cmake 3.3
>
> This is what has been done so far,
>
> 1. Opened Visual Studio 2012 and created a new project (Windows Forms
> Application) and saved it under c:\temp\test.
>
> 2. Used the following to an cmake;
> include_external_msproject(ext_test c:/test/test/test.sln)
>
> This generates an error MSB4126: The specified solution configuration
> "Debug|x86" is invalid. Please specify a valid solution configuration using
> the configuration and platform properties...
>
> 3. So update the cmake file (below), clear build folder and build again;
> include_external_msproject(ext_test c:/test/test/test.sln PLATFORM "Any
> CPU")
>
> This generate the exact same error message as above. So the PLATFORM keyword
> does not appear to be used in this context. Anyone care to explain how
> PLATFORM works and howto specify correct configuration and platform?
>
> 4. To workaround the problem we open the visual studio project and added the
> configuration and platform combo "Debug" and "x86" which cmake appears to
> require. We use the original cmake script (below), clear build folder and
> build again.
> include_external_msproject(ext_test c:/test/test/test.sln)
>
> The following error is produced;
> c:\temp\test\test\test.sln.metaproj : error MSB4057: The target
> "GetNativeManifest" does not exists in the project.
>
> Searched all files in source and build directory and cannot find any
> reference to "GetNativeManifest". See some issue online in regards to build
> order but cannot see how that applies to this simple example. Really do not
> understand this issue. Any ideas?
>
> 6. Update cmake and use .csproj instead of the solution file and it works.
> The test.exe file is build. The cmake looks like this
> include_external_msproject(ext_test c:/test/test/test.csproj)
>
> Does include_external_msproject support solution files?
>
>
> --
>
> 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] Changing the the current generator in CMake GUI

2016-01-16 Thread iosif neitzke

http://reactiongifs.me/krysten-ritter-eyeroll/
--

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] Imported libraries and cyclic dependencies

2016-01-07 Thread iosif neitzke

Which version of CMake are you using?

On 01/07/2016 04:28 PM, Rainer Poisel wrote:

Hi,

I am having troubles with linking a bunch of imported libraries that
have cyclic dependencies.

This is what I am doing:

8<===
find_library(ESP8266_SDK_LIB_MAIN main ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_main UNKNOWN IMPORTED)
set_property(TARGET esp8266_main PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_MAIN}")

find_library(ESP8266_SDK_LIB_PHY phy ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_phy UNKNOWN IMPORTED)
set_property(TARGET esp8266_phy PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_PHY}")

find_library(ESP8266_SDK_LIB_PP pp ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_pp UNKNOWN IMPORTED)
set_property(TARGET esp8266_pp PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_PP}")

find_library(ESP8266_SDK_LIB_LWIP lwip ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_lwip UNKNOWN IMPORTED)
set_property(TARGET esp8266_lwip PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_LWIP}")

target_link_libraries(ESP8266_SDK INTERFACE
gcc
esp8266_lwip
esp8266_main
esp8266_phy
esp8266_pp
)

target_link_libraries(esp8266_main INTERFACE
esp8266_lwip
esp8266_pp
esp8266_phy
)
8<===

The given example is not complete. However, I hope it is sufficient to
give you an idea of what I want to achieve: I would like to specify
the dependencies between imported libraries. Subsequently I want to
make the linker call mention my libraries several times in order to
make the linker resolve all dependency cycles (multiplicity).

This is the corresponding error message:

8<===
CMake Error at external/esp8266-cmake/sdk/nonos-1.4.0.cmake:111
(target_link_libraries):
Cannot specify link libraries for target "esp8266_main" which is not built
by this project.
8<===

As a workaround I added the -Wl,--start-group (referred to as
BUILD_LINK_PREFIX) and the -Wl,--end-group (referred to as
BUILD_LINK_SUFFIX) arguments (yes, it is a GCC) directly to the
invocation of target_link_libraries() of my executable which has been
defined by add_executable() beforehand. But I think that this is just
a botch-up.

Here is an example of the complete code (using the before-mentioned workaround):
  * https://github.com/rpoisel/esp8266-mqtt
  * https://github.com/rpoisel/esp8266-cmake/blob/master/main/CMakeLists.txt

Thanks for any suggestions in advance,
  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:
http://public.kitware.com/mailman/listinfo/cmake


Re: [CMake] Feature request: expose curl to cmake -E

2015-12-19 Thread iosif neitzke
Mostly yes.

On Sat, Dec 19, 2015 at 8:45 AM, Greg Marr <greg.m...@autodesk.com> wrote:
> iosif neitzke wrote:
>>On Fri, Dec 18, 2015 at 2:18 PM, Jakob van Bethlehem 
>><jsvanbethle...@gmail.com> wrote:
>>> Depending on what you precisely wish to achieve, maybe file(DOWNLOAD) 
>>> already fits your needs?
>>> https://cmake.org/cmake/help/v3.1/command/file.html
>>
>>It does, generally, in the way that ExternalProject also fits, but I think 
>>would require writing wrapper >scripts.  My specific use case was something 
>>like:
>>
>>cmake -E curl http://jenkins/buildA/artifacts/stuff.tar
>>cmake -E tar xzf stuff.tar
>>cmake -Hstuff/path/to/CMakeLists/ -Bbuild_dir cmake --build build_dir
>>
>>I thought 'curl' is sort of at the level of 'tar', in being a useful tool that
>>could be exposed fairly easily in a cmake portable command.
>>Those portable commands are another thing that CMake offers that makes working
>>on Windows a little easier, if you don't already have Cygwin or the like.
>
> curl is already portable.  Are you just trying to avoid installing curl?
>
-- 

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] Feature request: expose curl to cmake -E

2015-12-18 Thread iosif neitzke
It would be nice to have curl as a platform-independent command like
'md5sum', 'tar', and 'compare_files'.
-- 

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] structured introduction to CMake?

2015-12-18 Thread iosif neitzke
some CMake introductory references:

CMake's own Tutorial: https://cmake.org/cmake-tutorial/ (probably want
to start here)

Mastering CMake (by Kitware):
http://www.amazon.com/Mastering-CMake-Ken-Martin/dp/1930934319/ref=sr_1_1?s=books=UTF8=1450465685=1-1

Introduction to CMake:
http://www.amazon.com/Introduction-CMake-Software-Tool-Book-ebook/dp/B00KE807Q0/ref=la_B00GPU8HLS_1_1?s=books=UTF8=1450465758=1-1

John Lamp's CMake Tutorial: https://www.johnlamp.net/cmake-tutorial.html

Eric Noulard's Tutorial Presentation: https://github.com/TheErk/CMake-tutorial

Jan Engels' CMake Tutorial: http://docslide.us/documents/cmake-tutorial.html

Daniel Pfeifer's CMake Introduction and best practices:
http://www.slideshare.net/DanielPfeifer1/cmake-48475415


On Thu, Dec 17, 2015 at 11:10 AM, Victorious  wrote:
> Hi,
>
>
>
> While there’s plenty of documentation for CMake, it seems to be targeted
> more towards experienced users, and is in the style of reference
> documentation. I haven’t been able to find many good tutorials that teach
> the concepts incrementally, e.g how the custom scripting language works etc.
>
>
>
> Does anyone have any suggestions on where I could look?
>
>
>
> Thanks,
>
> -Vic
>
>
> --
>
> 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] Feature request: expose curl to cmake -E

2015-12-18 Thread iosif neitzke
On Fri, Dec 18, 2015 at 2:18 PM, Jakob van Bethlehem
 wrote:
> Depending on what you precisely wish to achieve, maybe file(DOWNLOAD) already 
> fits your needs?
> https://cmake.org/cmake/help/v3.1/command/file.html

It does, generally, in the way that ExternalProject also fits, but I
think would require writing wrapper scripts.  My specific use case was
something like:

cmake -E curl http://jenkins/buildA/artifacts/stuff.tar
cmake -E tar xzf stuff.tar
cmake -Hstuff/path/to/CMakeLists/ -Bbuild_dir
cmake --build build_dir

I thought 'curl' is sort of at the level of 'tar', in being a useful
tool that could be exposed fairly easily in a cmake portable command.
Those portable commands are another thing that CMake offers that makes
working on Windows a little easier, if you don't already have Cygwin
or the like.
-- 

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] Link errors - can I get more verbose messages?

2015-12-16 Thread iosif neitzke
If this [0] is the current code, I also could not get it to build on
Xubuntu 15.10.  FindPkgConfig.cmake failed with "package 'glfw3' not
found" at line 506 (_pkg_check_modules_internal).

Running

pkg-config --modversion glfw3

returns 3.1.1.

[0] https://github.com/openglsuperbible/sb7code

On Wed, Dec 16, 2015 at 11:55 PM, DJ  wrote:
> My bad.
>
> Just in case the original author of the OpenGL SuperBible should happen to
> read this:
>
> The problem was that I was using an old codebase - one for the previous
> edition of the book. The current one IS properly set up.
>
> So, now I need to send myself to bed without supper. Sigh.
>
> Best,
>
> - Jake -
>
> --
>
> 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] transitive dependencies (again)

2015-12-14 Thread iosif neitzke
If you can build Ada sources first, you might wish to make that a
standalone project that is consumed downstream natively as an Imported
Library.  Do you generate the import library from a .def file, or via
some other means?

On Mon, Dec 14, 2015 at 9:59 AM, Tom Kacvinsky
 wrote:
> Hi Petr,
>
>
> On Mon, Dec 14, 2015 at 10:53 AM, Petr Kmoch  wrote:
>> Hi Tom,
>>
>> linking the static archive into the DLL should not be done by
>> add_dependencies(), but by target_link_libraries(). There, you can
>> explicitly list the archive as PRIVATE so that it does not become a part of
>> the linking interface of the DLL:
>>
>> add_library(staticArchive STATIC ...)
>>
>> add_library(theDLL SHARED ...)
>>
>> target_link_libraries(theDLL PRIVATE staticArchive)
>>
>
> Thanks for the tip.   I'll try it out.  I hope it works as I am not
> using the MSVC tool chain
> to build the DLL (i.e., not using add_library and target_link_libraries).
>
> I sent a separate reply detailing what I am using to build the DLL.
>>
>> On Mon, Dec 14, 2015 at 3:34 PM, Tom Kacvinsky
>>  wrote:
>>>
>>> I am getting link errors because cmake is adding transitive
>>> dependencies.  I am building a DLL which depends on a static archive
>>> (and is marked as such with add_dependencies), but when I link an
>>> executable that depends on the DLL, both libraries (import library for
>>> the DLL and static archive) are specified on the link. leading to
>>> duplicate symbol errors as the symbol are exported form the DLL and
>>> defined in the static archive.
>>>
>>> How do I work around this?  This is the one thing that has frustrated
>>> me over the last couple of years - I have never received an answer
>>> telling me how to turn off transitive dependencies.
>>>
>>> Sorry for the minor rant.
>>>
>>> Regards,
>>>
>>> Tom
>>> --
>>>
>>> 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] organizing includes statements

2015-12-10 Thread iosif neitzke
I would think

add_library( lib1 SHARED lib1/lib1.c )
target_include_directories( lib1 PUBLIC lib1/headers )

is simpler.  Are the generator expressions needed for target export
install commands, and is exporting targets at install preferred to
add_subdirectory() ?

On Thu, Dec 10, 2015 at 1:48 AM, Owen Alanzo Hogarth
 wrote:
> my main CMakeLists.txt file already has a few directives that move the libs
> to an output folder so the binaries go to /bin while static and shared
> libraries go to /lib
>
> set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
> set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
> set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
>
>
> it seems like this line in your reply above
> install( TARGETS lib1 lib2 DESTINATION lib )
>
> moves the shared libraries to the lib folder and this line below moves the
> header files to the newly created include directory.
>
> install( FILES lib1/headers/lib1.h lib2/headers/lib2.h DESTINATION include )
>
> is that right?
>
> On Thu, Dec 10, 2015 at 1:46 PM, Attila Krasznahorkay
>  wrote:
>>
>> Hi Owen,
>>
>> This seems like a textbook example of using target_include_directories(…)
>> with generator expressions. Let’s take the example where:
>>
>> lib1/headers/lib1.h
>> lib1/lib1.c
>> lib2/headers/lib2.h
>> lib2/lib2.c
>>
>> If you want to be able to include lib1.h and lib2.h with simply
>>
>> #include “lib1.h”
>>
>> and
>>
>> #include “lib2.h”
>>
>> in your user code, and in the library code itself, you’d do something
>> like:
>>
>> add_library( lib1 SHARED lib1/lib1.c )
>> target_include_directories( lib1 PUBLIC
>>$
>>$ )
>>
>> add_library( lib2 SHARED lib2/lib2.c )
>> target_include_directories( lib2 PUBLIC
>>$
>>$ )
>> target_link_libraries( lib2 lib1 )
>>
>> install( FILES lib1/headers/lib1.h lib2/headers/lib2.h DESTINATION include
>> )
>> install( TARGETS lib1 lib2 DESTINATION lib )
>>
>> In this setup “lib1” should get a -I${CMAKE_SOURCE_DIR}/lib1/headers flag,
>> and “lib2” should get both -I${CMAKE_SOURCE_DIR}/lib1/headers and
>> -I${CMAKE_SOURCE_DIR}/lib2/headers. Finally the headers both get installed
>> into the same include directory, so an outside user will just have to be
>> able to find that one directory. (Or if you export CMake’s targets, the
>> lib1/2 imported targets will know that their header files are in that
>> directory.)
>>
>> Cheers,
>> Attila
>>
>> > On Dec 10, 2015, at 12:07 AM, Owen Alanzo Hogarth 
>> > wrote:
>> >
>> > hi
>> >
>> > I am building a shared library project that's composed of many smaller
>> > shared library files.
>> >
>> > Here's the main shared library project and a list of all the sub
>> > projects.
>> >
>> > SET(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/headers/main_lib.h)
>> > SET(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/main_lib.c)
>> > SET(TARGET_LIBS core_math point2d line2d quad2d timer_utils)
>> >
>> > ADD_LIBRARY(main_lib SHARED ${SRC_FILES} ${HEADER_FILES})
>> > TARGET_LINK_LIBRARIES(core_engine ${TARGET_LIBS})
>> >
>> > i have each module setup like this.
>> > module
>> > module/headers/module.h
>> > module/module.c
>> >
>> > then the module.c will look like this
>> > #include "headers/module.h"
>> >
>> > the file main_lib.h depends on all those target libs, which makes my
>> > main_lib.h file's include statement look like this
>> >
>> > #include "../../module/headers/module.h"
>> > #include "../../module1/headers/module1.h"
>> > #include "../../module2/headers/module2.h"
>> >
>> >
>> > is there any way that I can clean up these includes?
>> >
>> > For example if I want to use io functions I can just do #include
>> >  or #include 
>> >
>> > for math functions.
>> >
>> > I would like to make my include statements not relative to the files
>> > actual location, the way it's currently hard coded.
>> > --
>> >
>> > 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: 

Re: [CMake] How to generate for Ninja + MSVC?

2015-12-02 Thread iosif neitzke
Ah, okay, thanks.  From cmake-gui the solution equivalent would be
selecting the Ninja generator but specifying native compilers (cl.exe
for this example) instead of using the default native compilers?
-- 

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 generate for Ninja + MSVC?

2015-12-02 Thread iosif neitzke
Isn't this what Generator Toolset selection is for?

ex. cmake -G Ninja -T v140

http://cmake.blogspot.com/2013/05/cmake-2811-available-for-download.html
-- 

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-developers] Obtaining header file dependencies of a source file manually

2015-11-30 Thread iosif neitzke
What does output_required_files() [0] do, and is it applicable here?

[0] https://cmake.org/cmake/help/v3.4/command/output_required_files.html

On Mon, Nov 30, 2015 at 2:09 AM, Petr Kmoch  wrote:
> Hi Dan,
>
> you could look into the IMPLICIT_DEPENDS argument of add_custom_command:
> https://cmake.org/cmake/help/latest/command/add_custom_command.html
>
> I don't have direct experience with it, but it looks like it could do what
> you're looking for.
>
> Petr
>
> On Sun, Nov 29, 2015 at 10:47 AM, Dan Liew  wrote:
>>
>> Hi,
>>
>> # TL;DR
>>
>> I need a way of determining the header file dependencies of a source
>> file and inform CMake about them. CMake doesn't do this automatically
>> because I'm using custom commands for the compilation step so CMake
>> doesn't do it's usual magic of automatically inferring source file
>> header dependencies. This is because this part of the compilation step
>> requires a separate C++ compiler (completely independent from the one
>> that CMake detects at configure time).
>>
>> Is there a way of doing this that will also regenerate the
>> dependencies if the source file changes?
>>
>> # Long version
>>
>> A C++ project that I work on [1] is (amongst other things) a compiler.
>> In order to compile applications it needs to link in a supporting
>> runtime that is compiled to LLVM bitcode which is linked into the
>> applications it compiles.
>>
>> The supporting runtime is written in C++ and compiled with Clang. The
>> compilation of the runtime is currently achieved using
>> ``add_custom_command()`` and so I am not using CMake's in built
>> support for detecting header file dependencies. The reason for doing
>> it this way is because the LLVM bitcode compiler (i.e. Clang) **is
>> not** the same compiler as the host C++ compiler for the project. For
>> example the host code might be built with MSVC but the supporting
>> runtime is **always** built with Clang.
>>
>> To see this concretely take a look at [2].
>>
>> The build works correctly if you build from a clean build directory.
>> It does not work correctly if you perform a rebuild and change one of
>> the header files that the supporting runtime depends on. This is
>> because CMake doesn't know that the runtime source files depend on the
>> header files and so doesn't rebuild the relevant source files.
>>
>> I can obviously tell CMake about these manually (adding more entries
>> under ``DEPENDS`` in the ``add_custom_command()`` invocation) but this
>> is very cumbersome.
>>
>> What I really need is a way to
>>
>> * Automatically infer the dependencies of a source file and tell CMake
>> about them
>> * Have the dependencies automatically regenerated if the source file
>> changes (someone could add or remove a header file include).
>>
>> In a simple Makefile build system this typically achieved by doing
>> something like this:
>>
>> ```
>> all:: $(SRCS:.cpp:.o)
>>
>> SRCS := foo.cpp bar.cpp
>>
>> # Include SRC file dependencies generated by the compiler if they exist
>> -include $(SRCs:.cpp=.d)
>>
>> %.o : %.cpp
>>   $(CXX) -c $< -o $@ -MP -MMD -MF $*.d
>> ```
>>
>> Note the ``-M*`` flags get the compiler when it runs to generate
>> additional makefile rules that will get included next time a build
>> happens.
>>
>> I don't really know how to do the same thing with CMake. One idea is
>> at configure time invoke Clang with the ``-MP -MMD -MF`` flags on each
>> runtime source file, extract the dependencies then pass them to
>> ``DEPENDS`` in ``add_custom_command()``. If I wanted the dependencies
>> regenerated if the runtime source file changes then I would need to
>> somehow get CMake to reconfigure every time this happens.
>>
>> I don't like this idea very much due to
>>
>> * Having to invoke Clang manually to determine the dependencies. CMake
>> already knows how to determine source file dependencies, but this
>> functionality (AFAIK) isn't exposed to me.
>>
>> * Reconfiguring every time one of the runtime source file changes is
>> annoying (configuring can be slow sometimes).
>>
>> Does anyone have any other ideas? CMake obviously knows how to do all
>> this stuff already for source files being compiled for the detected
>> host C++ compiler, I just don't know how to get at this logic for
>> source files that need to be built with a second independent C++
>> compiler.
>>
>> [1] https://github.com/halide/Halide
>> [2] https://github.com/halide/Halide/blob/master/src/CMakeLists.txt#L140
>>
>> Thanks,
>> Dan.
>> --
>>
>> 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 

Re: [CMake] Ctest executable dll/so search path

2015-11-08 Thread Iosif Neitzke
A problem long-suffered on Windows and when lacking RPATH.  Have seen
approaches where DLL dependencies are POST_BUILD
customed-command-copied-if-different into the executable directory, or
gymnastics with add_test WORKING_DIRECTORY, or setting a test's
ENVIRONMENT property.

On Fri, Nov 6, 2015 at 3:14 PM, Scott Aron Bloom  wrote:
> I have a unit test, that I have have avoided deploying, because its
> executable (gmock/gtest based) depends on a third party dll.  Essentially
> it’s a unit test to test our interface to the thirdparty library. So for
> much of the application unittesting, I have a mock to simulate the 3rd party
> lib.. But for this set of tests, I really want to make sure the ACTUAL
> interface works.
>
>
>
> How can I add/set the PATH for an executable to run with so it picks up the
> DLL (or so on linux)?
>
>
> 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] add_dependencies being ignored for add_custom_command?

2015-10-31 Thread Iosif Neitzke
Yes, Header.hpp will be generated before the target is built.  I do
not believe the order of files listed in add_library() matters at all.

On Mon, Oct 26, 2015 at 5:31 PM, Martin Braun <martin.br...@ettus.com> wrote:
> Gotcha, Iosif,
>
> thanks for clearing that up for me. To summarize, I should ...
>
> On 26.10.2015 12:51, Iosif Neitzke wrote:
>> [...]
>> add_library( somelib ${CMAKE_CURRENT_BINARY_DIR}/Header.hpp
>> ${CMAKE_CURRENT_BINARY_DIR}/Header.cpp source.cpp )
>
> ...add the generated files as to the target.
>
> That leads me to another question, though (hopefully the last): If
> source.cpp depends on Header.hpp, is it guaranteed that Header.hpp will
> be generated before the compiler tries to compile source.cpp? Does the
> list order of the files inside add_library() matter?
>
> Cheers,
> Martin
> --
>
> 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] add_dependencies being ignored for add_custom_command?

2015-10-26 Thread Iosif Neitzke
On Mon, Oct 26, 2015 at 12:32 PM, Martin Braun  wrote:
> What exactly is a target? I thought if I do add_library(foo ${sources}),
> then 'foo' is a target? You seem to suggest otherwise, which means I'm
> misunderstanding some concepts.

You are correct, "foo" is a target, but in one of your previous
examples you had listed:

add_dependencies(baz ${CMAKE_BINARY_DIR}/path/to/foo.hpp)

Which should generate a warning like:

"CMake Warning (dev) at CMakeLists.txt: (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.

The dependency target "/tmp/path/to/foo.hpp" of target "baz" does not exist.
This warning is for project developers. Use -Wno-dev to suppress it."

Here is the simplest code I can think of that creates files required
by a target:

add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Header.hpp
${CMAKE_CURRENT_BINARY_DIR}/Header.cpp
  COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/Header.cpp
  COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/Header.hpp
  COMMENT "Running pre-build step for a target" )

add_library( somelib ${CMAKE_CURRENT_BINARY_DIR}/Header.hpp
${CMAKE_CURRENT_BINARY_DIR}/Header.cpp source.cpp )

target_include_directories( somelib PRIVATE ${CMAKE_CURRENT_BINARY_DIR} )

Which outputs:

make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/iosif/tmp/prebuild_header_ex
[ 33%] Running pre-build step for a target
Scanning dependencies of target somelib
[ 66%] Building CXX object CMakeFiles/Headers.dir/Header.cpp.o
[100%] Building CXX object CMakeFiles/Headers.dir/source.cpp.o
Linking CXX static library libsomelib.a
[100%] Built target somelib
-- 

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] add_dependencies being ignored for add_custom_command?

2015-10-23 Thread Iosif Neitzke
The command "add_dependencies" [0] only works on targets.

See the CMake Tutorial for how to generate files as part of the build
that later targets rely on. [1].

[0] https://cmake.org/cmake/help/v2.8.12/cmake.html#command:add_dependencies

[1] https://cmake.org/cmake-tutorial/#s5

On Fri, Oct 23, 2015 at 7:35 PM, Martin Braun  wrote:
> Hey,
>
> I'm at a loss here:
>
> I have a command that's run with add_custom_command(). I need to run it
> before compiling a library that I add with add_library(), because it
> generates some header files.
>
> This was my first try:
>
> file1:
> {{{
> add_custom_command(
> OUTPUT foo.hpp
> COMMAND bar
> )
> }}}
>
> file2:
> {{{
> add_library(baz ${sources})
> add_dependencies(baz ${CMAKE_BINARY_DIR}/path/to/foo.hpp)
> }}}
>
> ==> This didn't work. If I run make -j4, it will always try and compile
> my ${sources} before it ran the command. Maybe I'm specifying targets
> the wrong way?
>
> Next try:
>
> file1:
> {{{
> add_custom_command(TARGET baz
> PRE_BUILD
> OUTPUT foo.hpp
> COMMAND bar
> )
> }}}
>
> file2:
> {{{
> add_library(baz ${sources})
> }}}
>
>
> ==> Same behaviour.
>
> I'm using CMake 2.8.2.12. Really, I need something that works with CMake
> 2.8.0 because that's the minimum we guarantee our customers.
>
> Any ideas? Thanks in advance!
>
> Cheers,
> Martin
> --
>
> 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 create a custom solution with Visual Studio 2010 generator?

2015-09-22 Thread Iosif Neitzke
Just as a point of information illustrating the opposite, we like
using a CMakeList file for each target that contains a project()
command where the name of the project is the name of the target.  This
is nice (for us) in that you get many .sln files generated from the
larger source tree where you can open a .sln file anywhere in the
build tree hierarchy with the name of the target you want to work on
and get a sub-tree development environment with only that target and
its dependencies, instead of everything in the top-level solution
(which may contain 100+ targets).

On Tue, Sep 22, 2015 at 4:46 AM, Hendrik Sattler
 wrote:
> Hi,
>
>
> Am 22. September 2015 08:49:57 MESZ, schrieb "Golebiewski, Jakub" 
> :
>>I have about 620 targets (VS projects) so when I open Main Project.sln
>>(with 620 projects) in VS it is impossible to work with.
>>Currently cmake produces .sln for each Sub Project but includes
>>dependencies from other projects and that's something I don’t want
>>Since the amount of projects in each .sln increases the further I go
>>and most of them (later in the dependency chain) are not possible to
>>work
>>with either. I'm trying to divide it into .slns that developers could
>>work with in VS.
>
> That is exactly what imported targets are for. However, they refer to already 
> built projects. I'd also suggest a two-step approach: first configure and 
> build the thing with all projects in the solution. The libraries need to 
> create cmake build tree export config files. After that step, define a cmake 
> variable to switch to using the previously created export config files only. 
> These create the imported targets and don't show up in the IDE.
>
> HS
>
> --
>
> 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] Using add_subdirectory to manage project dependencies that aren't actually in a subdirectory

2015-09-18 Thread Iosif Neitzke
Why not just go one directory up?  Add /path/to/CMakeLists.txt
containing at least:

add_subdirectory(A)
add_subdirectory(B)

https://github.com/toomuchatonce/cmake-examples/blob/master/staticlibs-add_subdir/CMakeLists.txt

On Fri, Sep 18, 2015 at 5:42 PM, Joe  wrote:
> Hi.  I was hoping to get some guidance on if this is bad practice.  I am
> simply trying to find a way to manage internal dependencies of my project
> but with a file structure that is distributed.  It looks like this:
>
> /path/to/A
>
> /path/to/B
>
> B depends on A.  I cannot change this directory structure.  The solution we
> have chose is to create the following:
>
> /path/to/modules/FindA.cmake:
>
> ...
> if (NOT TARGET A)
>set(PATH_TO_A ${CMAKE_CURRENT_LIST_DIR}../A)
>add_subdirectory(${PATH_TO_A} ${PATH_TO_A}/build)
> endif()
> ...
>
> This way, A' CMakeLists is invoked and the library is compiled and built.
> Then in B's CMakeLists.txt:
>
> ...
> set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
>${CMAKE_CURRENT_LIST_DIR}/../modules)
>
> find_package(A)
> add_executable(main_B src/main_B.cpp)
> target_link_libraries(main_B A)
> ...
>
> Is this bad practice?  I tried to figure out find_package in CONFIG mode but
> every example I've found seems complicated and obtuse.  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:
> 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] CMake and Visual Studio multiconfig solution

2015-08-22 Thread Iosif Neitzke
DEBUG_POSTFIX?

http://www.cmake.org/cmake/help/v3.3/prop_tgt/DEBUG_POSTFIX.html

On Sat, Aug 22, 2015 at 12:11 PM, Mauro Ziliani
mauro.ziliani@gmail.com wrote:
 Hi all.
 My name is mauro and i am a freelance programmer and I work different
 platforms: windows and Linux.
 I'm trying cmake 3.3.1 and I am in trouble to do this.

 I need to compile my app with visual studio and achieve the follow behavior.
 If I compile the app in debug configuration I need to append the suffix _dbg
 to the app name, nothing in release configuration.
 That is, if the app's name is test in debug configuration I'd like to obtain
 test_dbg.exe.

 Using makefile and make command I can obtain the same behavior by
 conditional compilation with command

 make BUILD=debug  test_dbg.exe

 My CMakeLists.txt is

 
 cmake_minimum_required(VERSION 3.3)

 Project(test_vs)

 add_executable(test test.cpp)

 set_target_properties(test PROPERTIES DEBUG_SUFFIX _dbg)
 --

 But it doesn't work.

 Either for debug and release configuration the app's name is test.exe

 Any ideas?

 Best regards,
Mauro

 --

 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] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Iosif Neitzke
Dependencies listed with the DEPENDS argument may reference files and
outputs of custom commands created with add_custom_command() in the
same directory (CMakeLists.txt file).

http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:add_custom_target

On Tue, Aug 4, 2015 at 4:15 PM, Dan Liew d...@su-root.co.uk wrote:
 foolib is defined in this CMakeLists.txt:
 https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt

 That is the (only) context in which you can extend the definition of the
 target with custom commands.

 Since when? I haven't seen that documented anywhere. IMHO this
 behavior is counter-intuitive, in general I expect the scope of a
 target to not depend on the cmake command I am trying to use. Seeing
 as targets seem to be visible globally to all the commands (that I've
 used so far) it seems to reasonable to me to expect
 add_custom_command() to be able to see these targets too.
 --

 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] [BUG] add_custom_command(TARGET ...) can't see in scope target

2015-08-04 Thread Iosif Neitzke
And:

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.

http://www.cmake.org/cmake/help/v3.3/command/add_custom_command.html

But it's not super clear in the documentation.

On Tue, Aug 4, 2015 at 4:24 PM, Nils Gladitz nilsglad...@gmail.com wrote:
 On 04.08.2015 23:15, Dan Liew wrote:

 foolib is defined in this CMakeLists.txt:

 https://github.com/delcypher/cmake_add_custom_command_bug/blob/master/lib/CMakeLists.txt

 That is the (only) context in which you can extend the definition of the
 target with custom commands.

 Since when?


 As far as I know it has always been this way.

   I haven't seen that documented anywhere. IMHO this
 behavior is counter-intuitive, in general I expect the scope of a
 target to not depend on the cmake command I am trying to use.


 I think it is sensible that the definition of a target is scoped to one
 single directory.
 Where the definition of a target consists of e.g. sources, properties,
 dependencies and custom commands related to the target.

 You can reference/query global targets in other directories but you can not
 change them.

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

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_COLOR_MAKEFILE

2015-06-09 Thread Iosif Neitzke
The CMake variable CMAKE_COLOR_MAKEFILE sets the preference to
generate a colored Makefile at Configure time.

At Build time, regardless if CMAKE_COLOR_MAKEFILE=ON, you can use
'make target COLOR=0' to turn off Makefile color dynamically.

Running through cmake with 'cmake --build dir -- COLOR=0' does the same thing.

You could also set COLOR=0 as an environment variable.

I don't believe a Makefile generated with CMAKE_COLOR_MAKEFILE=OFF can
have color turned back on dynamically, however.

On Tue, Jun 9, 2015 at 9:17 PM, Dave Yost d...@yost.com wrote:
 Hey, I love colors. But one of my users doesn’t.

 Why doesn’t this work?

 CMAKE_COLOR_MAKEFILE=OFF cmake ..

 If that worked, he could set it and forget it.

 Instead, he has to do this:

 cmake -DCMAKE_COLOR_MAKEFILE=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:
 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 purpose of INSTALL_DIR in ExternalProject_Add command?

2015-04-09 Thread Iosif Neitzke
Install Step
The INSTALL_DIR is underneath the calling project’s binary directory.
Use INSTALL_DIR to specify a different location. Note that in addition
to setting INSTALL_DIR, you also have to pass -DCMAKE_INSTALL_PREFIX
or --prefix to the CMake or configure command. It is not used
automatically in the configure step since not all projects follow this
convention.

From http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html

On Thu, Apr 9, 2015 at 5:44 AM, David Cole via CMake cmake@cmake.org wrote:
 You need to tell eigen where to install, probably as an argument to its
 configure step. If it builds with CMake, you can use:

 -DCMAKE_INSTALL_PREFIX=INSTALL_DIR

 as one of the CMake args. If it has a non-CMake configure step, you'll have
 to call that and pass in INSTALL_DIR as an argument.


 HTH,
 David C.


 On Thursday, April 9, 2015, Cedric Doucet cedric.dou...@inria.fr wrote:


 Hello!

 I try to download, extract, configure, build and install a library with
 CMake.
 My CMakeLists.txt contains the following lines:

 cmake_minimum_required (VERSION 2.6)
 project (example CXX)
 set(CMAKE_VERBOSE_MAKEFILE ON)
 include(ExternalProject)
 include(ProcessorCount)
 ProcessorCount(N)
 if(NOT N EQUAL 0)
   set(CMAKE_BUILD_FLAGS -j${N})
 endif()
 ExternalProject_Add(eigen
 PREFIX third_party
 DOWNLOAD_DIR third_party/eigen/download
 SOURCE_DIR third_party/eigen/src
 BINARY_DIR third_party/eigen/build
 INSTALL_DIR third_party/eigen/install
 DOWNLOAD_COMMAND wget
 http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz  tar xvzf 3.2.4.tar.gz
 -C ../src --strip-components=1
)

 In this example, the installation step fails with the following error
 message:

 CMake Error at cmake_install.cmake:38 (FILE):
   file cannot create directory: /usr/local/include/eigen3.  Maybe need
   administrative privileges.

 It means that the value of INSTALL_DIR is not taken into account during
 the configuration process.

 Why? What am I do wrong?

 Thank you very much for your help.

 Best regards,

 Cédric Doucet
 --

 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 build a target on install (only)?

2015-02-15 Thread Iosif Neitzke
For conditional file install, you could try something like cmake -E
copy_if_different.

On Sun, Feb 15, 2015 at 1:59 PM, Paul Smith p...@mad-scientist.net wrote:
 On Sun, 2015-02-15 at 12:16 -0500, David Cole wrote:
 The easiest thing is probably to use the install(SCRIPT or
 install(CODE signature of the install command rather than having a
 build time custom command.

 Hm.  That has the disadvantage that it runs every time, even if the
 binary hasn't been modified, but it does work:

   install(CODE message(STATUS \Creating dSYM for ${target} in ${dir}\))
   install(CODE execute_process(COMMAND dsymutil \${dir}/${target}\ 
 OUTPUT_QUIET))

 It's too bad that execute_process() doesn't have a COMMENT field, but
 this works OK.  It wasn't clear to me how to pass arguments to a SCRIPT
 so I used CODE instead.

 It'd be nice if I could make it a real target that only is invoked on
 install, so that we'd not re-run the command if it wasn't necessary, but
 this gets the work done; thanks for the pointer!

 --

 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] creating start menu items

2015-02-13 Thread Iosif Neitzke
As a side note, remember that CPACK_PACKAGE_EXECUTABLES is problematic
in another way too; it requires listed executables to be installed to
PACKAGING_INSTALL_DIR/bin/.

On Fri, Feb 13, 2015 at 1:56 AM, Nils Gladitz nilsglad...@gmail.com wrote:
 On 02/13/2015 07:52 AM, Paul Anton Letnes wrote:

 I have been unable to come across any documentation on how the WiX CPack
 generator can create start menu items. I'll need to create items both
 for a few PDFs (documentation) and for an executable or two. Is this
 supported, or do I need to write my own XML patch file and give that to
 WiX?


 The WIX generator implements the generic CPACK_PACKAGE_EXECUTABLES [1] which
 like the name suggests is only for executables though.

 I was pondering adding another installed file property [2] for the creation
 of start menu / desktop shortcuts for convenience but for now
 CPACK_WIX_PATCH_FILE [3] should work for non-executables.

 Nils

 [1] http://www.cmake.org/cmake/help/v3.1/module/CPack.html

 [2]
 http://www.cmake.org/cmake/help/v3.1/manual/cmake-properties.7.html#properties-on-installed-files

 [3] http://www.cmake.org/cmake/help/v3.1/module/CPackWIX.html
 --

 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] Setting CPACK_PACKAGE_FILE_NAME per COMPONENT

2015-01-30 Thread Iosif Neitzke
Unfortunately it would take more than one run of CPack, but you may
find useful something like:

in CMakeLists.txt:
set( CPACK_PROJECT_CONFIG_FILE
${CMAKE_CURRENT_SOURCE_DIR}/CMakeCPackOptions.cmake )

in CMakeCPackOptions.cmake:

set( CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME} )

which would let you run for each component:
cpack -G DEB -D CPACK_COMPONENTS_ALL=ComponentX -P PackageNameForComponentX

to produce a PackageNameForComponentX.deb for each run of cpack

https://github.com/Kitware/CMake/blob/master/CMakeCPackOptions.cmake.in

On Fri, Jan 30, 2015 at 6:05 AM, Rob Harris rob.har...@gmail.com wrote:
 On 01/29/2015 11:24 PM, Iosif Neitzke wrote:

 Where for a single run of CPack, each component name produces a
 corresponding named .deb file or ...?

 Yes. Exactly.

 Have you tried using CPACK_PROJECT_CONFIG_FILE [0]?  This allows you
 to set a few options at packaging time which can change the final
 output package file name.

 [0] http://www.cmake.org/cmake/help/v3.1/module/CPack.html

 Maybe I'm missing something, but how does that help me if there isn't an
 accessible variable that contains the name of the component actively being
 packaged?

 -R

-- 

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] Setting CPACK_PACKAGE_FILE_NAME per COMPONENT

2015-01-29 Thread Iosif Neitzke
Where for a single run of CPack, each component name produces a
corresponding named .deb file or ...?

Have you tried using CPACK_PROJECT_CONFIG_FILE [0]?  This allows you
to set a few options at packaging time which can change the final
output package file name.

[0] http://www.cmake.org/cmake/help/v3.1/module/CPack.html

On Tue, Jan 27, 2015 at 10:33 AM, Rob Harris rob.har...@gmail.com wrote:
 All,

 I'm trying to have CPack create filenames in the debian-conformant format
 using my component definitions.

 It looks like there was an issue in place to resolve this (0012997) by
 exposing a CPACK_COMPONENT_NAME variable, but it doesn't look like it was
 ever resolved/committed.

 Is there another way to solve this problem? R'ing TFM and Googling proved
 fruitless.

 Thanks.
 -Rob Harris


 --

 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] Books on cmake

2014-12-09 Thread Iosif Neitzke
Pretty much.  There is also the slim e-book Introduction to CMake [0].

[0] 
http://www.amazon.com/Introduction-CMake-Software-Tool-Book-ebook/dp/B00KE807Q0/ref=la_B00GPU8HLS_1_1?s=booksie=UTF8qid=1418153199sr=1-1

On Tue, Dec 9, 2014 at 9:47 AM, Dan Kegel d...@kegel.com wrote:
 Is Mastering CMake still the only book out there?

 BTW, the doc site for 3.0 is great, I really appreciate the effort
 that went into it.
 - Dan
 --

 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] CMake can't find Boost versions 1.55

2014-11-19 Thread Iosif Neitzke
Seconded!

On Wed, Nov 19, 2014 at 5:16 PM, Stephen Kelly steve...@gmail.com wrote:
 Robert Ramey wrote:

 The module FindBoost is quite elaborate.  Unfortunately it seems to depend
 upon searching for specific version numbers found in a list.  This list
 only
 goes up to 1.55 so it can't find later versions of Boost.  Better would be
 to eliminate the list so module doesn't expire

 It would be awesome if you could teach bjam to generate cmake config
 packages:

  http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

 Qt uses qmake to generate those, and LLVM generates them with a non-CMake
 buildsystem too.

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

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] Generic XML output file of project heirarchy

2014-11-18 Thread Iosif Neitzke
How about parsing GraphViz files?

On Tue, Nov 18, 2014 at 3:08 PM, Stephen Kelly steve...@gmail.com wrote:
 Michael Jackson wrote:

 Yep, that is pretty much the discussion that I was wanting. Now, has there
 been any movement on any of the implementations?

 Nothing is reported beyond that thread.

 If you want to pick up the implementation or a creator patch, I'd say go
 ahead.

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

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 CMake equivalent for autotools make dist ?

2014-10-11 Thread Iosif Neitzke
With CPack enabled, make help will show all the valid targets.  The
package_source target should be one of those targets.

A simple project on Linux built with make package_source gives me:

${CMAKE_BINARY_DIR}/_CPack_Packages/Linux-Source/{TZ,TGZ,TBZ2}/CPack_Example-0.1.1-Linux.tar.{bz2,gz,Z}

All three files contain all the source files in my
${CMAKE_SOURCE_DIR}.  (Including CMakeLists.txt)



On Sat, Oct 11, 2014 at 12:05 PM, houssen hous...@ipgp.fr wrote:
 Hello,

 What is the CMake equivalent for autotools make dist ?
 By autotools make dist, I mean a way to wrap all sources and test files
 needed to build and test the package and / or to be ready for dev.

 I googled this question : I heard about CPack (and make package), but, I
 am not sure to understand if this is designed to answer the same question.
 Using CPack and make package, I get a tar.gz that contains the executable
 (the binary in a bin directory) but without the source : this is not what I
 want as sources are missing (the tar.gz is not ready for dev).

 Is this the expected behavior ? (make package is intended to provide only
 binaries to be installed ? Not the source / test files ?)
 Did I miss something ? Did I forgot something in the CMakeLists.txt ?
 I am supposed to tar the root directory (= project directory containing
 hello.cpp and CMakeLists.txt) after I suppressed all BUILD directories that
 could have been built previously ?

 FH
 --

 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] Modify nsis command?

2014-09-20 Thread Iosif Neitzke
Which defines, for example?

On Sat, Sep 20, 2014 at 11:45 AM, Richard Shaw hobbes1...@gmail.com wrote:
 In my continued efforts to convert a project from autotools to CMake I've
 gotten to the point of creating an NSIS package.

 I'm trying not to modify any existing source files and the current method
 passes some defines to the nsis binary but I can't see any way to do that
 with the available CPACK variables.

 Anyone else run into this?

 Thanks,
 Richard

 --

 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] Should CPack command-line options -P and -R do more?

2014-09-11 Thread Iosif Neitzke
For a project that uses include(CPack) and produces
CPack_Example-0.1.1-Linux.sh when cpack is run and produces
CPack_Example-0.1.1-Linux.exe when cpack -G NSIS is run, am I remiss
for thinking that

cpack -G NSIS -P NEW_NAME -R 3.1.4

should produce NEW_NAME-3.1.4-Linux.exe?

As always, thanks.
-- 

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] Should CPack command-line options -P and -R do more?

2014-09-11 Thread Iosif Neitzke
Or are these customizing CPack command line options mostly meant to be
used with a CPACK_PROJECT_CONFIG_FILE?

On Thu, Sep 11, 2014 at 9:07 AM, Iosif Neitzke
iosif.neitzke+cm...@gmail.com wrote:
 For a project that uses include(CPack) and produces
 CPack_Example-0.1.1-Linux.sh when cpack is run and produces
 CPack_Example-0.1.1-Linux.exe when cpack -G NSIS is run, am I remiss
 for thinking that

 cpack -G NSIS -P NEW_NAME -R 3.1.4

 should produce NEW_NAME-3.1.4-Linux.exe?

 As always, thanks.
-- 

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] Ctest building with Multiple Processors

2014-09-04 Thread Iosif Neitzke
Does ctest -j jobs, or ctest --parallel jobs behave differently?

http://www.cmake.org/cmake/help/v3.0/manual/ctest.1.html

On Wed, Sep 3, 2014 at 2:31 PM, Michael Jackson
mike.jack...@bluequartz.net wrote:
 I am exploring CTest/CDash with out project and I was trying to figure out 
 how to have CTest use all my cores for builds. So far no luck with some 
 snippets from Google. So far I have the following in a file called 
 CTestConfig.cmake at the top level of my project.

  set(CTEST_PROJECT_NAME DREAM3D)
 set(CTEST_NIGHTLY_START_TIME 01:00:00 UTC)

 set(CTEST_DROP_METHOD http)
 set(CTEST_DROP_SITE my.cdash.org)
 set(CTEST_DROP_LOCATION /submit.php?project=DREAM3D)
 set(CTEST_DROP_SITE_CDASH TRUE)

 # Use multiple CPU cores to build
 include(ProcessorCount)
 ProcessorCount(N)
 if(NOT N EQUAL 0)
   if(NOT WIN32)
 set(CTEST_BUILD_FLAGS -j${N})
   endif(NOT WIN32)
   set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})

 endif()


 And then I execute CTest like this from my terminal

 ctest -D Experimental


 but monitoring my processors says that only a single processor is being used.

 Thanks for any help

 ---
 Mike Jackson www.bluequartz.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:
 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] Spaces in a command

2014-07-25 Thread Iosif Neitzke
If VERBATIM is given then all arguments to the commands will be
escaped properly for the build tool so that the invoked command
receives each argument unchanged. Note that one level of escapes is
still used by the CMake language processor before add_custom_command
even sees the arguments. Use of VERBATIM is recommended as it enables
correct behavior. When VERBATIM is not given the behavior is platform
specific because there is no protection of tool-specific special
characters.

http://www.cmake.org/cmake/help/v3.0/command/add_custom_command.html

On Fri, Jul 25, 2014 at 11:20 AM, Bill Newcomb bnewc...@nvidia.com wrote:
 I want to add stuff to a custom command based on some definition:

 cmake_minimum_required(VERSION 2.6)

 set(DO_RELAX 1)
 if(DO_RELAX)
 set(OR_RELAX || echo \no big deal\)
 else()
 set(OR_RELAX )
 endif()

 add_custom_command(OUTPUT foo COMMAND generate-foo ${OR_RELAX})
 add_custom_target(do-foo ALL DEPENDS foo)


 However, this produces the following rule in the generated makefile:

 foo:
 $(CMAKE_COMMAND) -E cmake_progress_report 
 /home/bnewcomb/tmp/cmake-tests/custom-or/CMakeFiles $(CMAKE_PROGRESS_1)
 @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold 
 Generating foo
 generate-foo ||\ echo\ no\ big\ deal

 Is there some way I can get cmake to not escape all of the
 spaces in the value of OR_RELAX?

 Thanks,
 B.

 ---
 This email message is for the sole use of the intended recipient(s) and may 
 contain
 confidential information.  Any unauthorized review, use, disclosure or 
 distribution
 is prohibited.  If you are not the intended recipient, please contact the 
 sender by
 reply email and destroy all copies of the original message.
 ---
 --

 Powered by www.kitware.com

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

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

 CMake Support: http://cmake.org/cmake/help/support.html
 CMake Consulting: http://cmake.org/cmake/help/consulting.html
 CMake Training Courses: http://cmake.org/cmake/help/training.html

 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html

 Follow this link to subscribe/unsubscribe:
 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] Mastering CMake book

2014-07-11 Thread Iosif Neitzke
The latest edition of Mastering CMake is 6th edition (September 13,
2013), covering versions of CMake up to and including 2.8.12.

On Fri, Jul 11, 2014 at 8:34 AM, Petar Petrov pip...@gmail.com wrote:
 Hello,
 just wondering how up to date is the Mastering CMakebook. Does it
 cover all 3.0 changes ?

 Greetings,
 Petar
 --

 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] cmake project patterns / examples

2014-06-04 Thread Iosif Neitzke
The terminology of in-source and out-of-source for where the
CMakeLists.txt and *.cmake files exist temporarily threw me off, as
with CMake, in-source and out-of-source usually refer to where the
generated build files are placed.

On Wed, Jun 4, 2014 at 12:23 AM, Adam adam707b...@gmail.com wrote:
 Thanks for the comments I've update the wiki. Top-level only now marked as
 anti-pattern
 https://github.com/toomuchatonce/cmake-examples/wiki/cmake-patterns-and-examples

 If there are other patterns / anti-patterns you've seen please send me a
 pull request and I'll add them.

 I'm particularly interested in super-build patterns that allow sub-projects
 (for both inhouse and 3rdparty components) to be shared between projects.





 On Wed, Jun 4, 2014 at 5:56 AM, Chuck Atkins chuck.atk...@kitware.com
 wrote:

 Just put all the build commands in the top level cmake file.

 Definitely an anti-pattern.  As you mentioned, it definitely doesn't
 scale.  The problem with even doing this for a simple project is that it
 builds this behavior for people trying to learn cmake through simple
 examples.  This very very quickly turns in to a 3k line top level
 CMakeLists.txt  for even moderately sized projects.  I would really
 discourage this one as don't do it ever because of the bad behaviours it
 builds early on.

 - Chuck

 On Tue, Jun 3, 2014 at 1:22 PM, Iosif Neitzke
 iosif.neitzke+cm...@gmail.com wrote:

 Great to see these examples with pros and cons.

 I believe the staticlibs-include example [0] pattern, though mentioned
 in Mastering CMake [1], generally is deprecated in favor of
 add_subdirectory with CMakeLists.txt at each level for self-contained
 projects.

 [0]
 https://github.com/toomuchatonce/cmake-examples/tree/master/staticlibs-include

 [1] Mastering CMake, 6th Edition, Chapter 7: Converting Existing
 Systems to CMake, Source Code Directory Structures, page 116

 On Mon, Jun 2, 2014 at 5:23 PM, Adam Boseley adam707b...@gmail.com
 wrote:
 
  There's a lot of legacy examples around the web but not too many using
  the
  newer features.  What is the current best practise?
 
  Here's some simple examples
 
  https://github.com/toomuchatonce/cmake-examples/wiki/cmake-patterns-and-examples
 
  Are these patterns or anti-patterns?
 
  Regards,
  Adam
 
  --
 
  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://www.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:
 http://www.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:
 http://www.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:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake project patterns / examples

2014-06-03 Thread Iosif Neitzke
Great to see these examples with pros and cons.

I believe the staticlibs-include example [0] pattern, though mentioned
in Mastering CMake [1], generally is deprecated in favor of
add_subdirectory with CMakeLists.txt at each level for self-contained
projects.

[0] 
https://github.com/toomuchatonce/cmake-examples/tree/master/staticlibs-include

[1] Mastering CMake, 6th Edition, Chapter 7: Converting Existing
Systems to CMake, Source Code Directory Structures, page 116

On Mon, Jun 2, 2014 at 5:23 PM, Adam Boseley adam707b...@gmail.com wrote:

 There's a lot of legacy examples around the web but not too many using the
 newer features.  What is the current best practise?

 Here's some simple examples
 https://github.com/toomuchatonce/cmake-examples/wiki/cmake-patterns-and-examples

 Are these patterns or anti-patterns?

 Regards,
 Adam

 --

 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://www.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:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Define a subfolder for SWIG project

2014-05-20 Thread Iosif Neitzke
Assuming USE_FOLDERS is set [0], does set_property( TARGET test_swig
PROPERTY FOLDER PYTHON ) work?

[0] http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_global:USE_FOLDERS

On Fri, May 16, 2014 at 4:45 PM, Giumas giu...@yahoo.it wrote:

 Good morning,

 I am working for the first time with SWIG, I have been able to build and use
 a python module based on a C++ class.
 CMake makes a huge job to make the building very easy, but there is an issue
 I cannot figure out..

 In brief, I would like to put the SWIG project in a specific sub-folder in
 the solution (e.g. PYTHON) as I did for other projects in my MSVC solution.
 I have attempted with the classic:
 set_target_properties( test_swigPROPERTIES FOLDER PYTHON )

 but it does not work..

 Could anybody help me ?

 G.
 __
 ---

 --

 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://www.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:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cmake - configuration roolback to default

2014-04-12 Thread Iosif Neitzke
Is this usage what you are describing?

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

On Sat, Apr 12, 2014 at 7:48 AM,  shahi...@mycrypto.biz wrote:
 Hi,

 i want to change CMAKE_C_COMPILER and CMAKE_CXX_COMPILER to gcc-4.7 and 
 g++-4.7. But when i run cmake, the configuration rollback to default. Can 
 somebody help me?

 == CMakeCCompiler.cmake ==
 SET(CMAKE_C_COMPILER /usr/bin/gcc)
 SET(CMAKE_C_COMPILER_ARG1 )
 SET(CMAKE_C_COMPILER_ID GNU)
 SET(CMAKE_C_PLATFORM_ID Linux)

 SET(CMAKE_AR /usr/bin/ar)
 SET(CMAKE_RANLIB /usr/bin/ranlib)
 SET(CMAKE_LINKER /usr/bin/ld)
 SET(CMAKE_COMPILER_IS_GNUCC 1)
 SET(CMAKE_C_COMPILER_LOADED 1)

 == CMakeCXXCompiler.cmake ==
 SET(CMAKE_CXX_COMPILER /usr/bin/c++)
 SET(CMAKE_CXX_COMPILER_ARG1 )
 SET(CMAKE_CXX_COMPILER_ID GNU)
 SET(CMAKE_CXX_PLATFORM_ID Linux)

 SET(CMAKE_AR /usr/bin/ar)
 SET(CMAKE_RANLIB /usr/bin/ranlib)
 SET(CMAKE_LINKER /usr/bin/ld)
 SET(CMAKE_COMPILER_IS_GNUCXX 1)
 SET(CMAKE_CXX_COMPILER_LOADED 1)




 regards,
 Naim S.
 --

 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://www.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:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CPack error : Problem checking NSIS version with command: C:/NSIS/makensis.exe /VERSION

2014-03-19 Thread Iosif Neitzke
On both Windows 7 and Windows XP makensis.exe /VERSION seems to exit
normally, but it must be a bad return value or regex failure:

https://github.com/Kitware/CMake/blob/master/Source/CPack/cmCPackNSISGenerator.cxx#L437
-- 

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] CPack error : Problem checking NSIS version with command: C:/NSIS/makensis.exe /VERSION

2014-03-19 Thread Iosif Neitzke
Apparently NSIS 2.15 lacks a v in the version output string, which
causes the regular expression used in cmCPackNSISGenerator [0] to
fail.

The v was added back to the version string in 2.16 [1], and
presumably exists all the way through NSIS version 2.46.

[0] 
https://github.com/Kitware/CMake/blob/master/Source/CPack/cmCPackNSISGenerator.cxx#L435

[1] http://sourceforge.net/p/nsis/code/4550/
-- 

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://www.cmake.org/mailman/listinfo/cmake


[CMake] CPack error : Problem checking NSIS version with command: C:/NSIS/makensis.exe /VERSION

2014-03-18 Thread Iosif Neitzke
When trying to run CPack with NSIS 2.15, i get:

CPack error : Problem checking NSIS version with command:
C:/NSIS/makensis.exe /VERSION

Please check ./NSISOutput.log for errors

CPack error : Cannot initialize the generator NSIS

NSISOutput.log:
# Run command: C:/NSIS/makensis.exe /VERSION
# Output:
2.15

This happens with CMake 2.8.11 and 2.8.12.
-- 

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://www.cmake.org/mailman/listinfo/cmake