Re: [CMake] Multiple "projects" one directory

2018-04-28 Thread Scott Bloom
Thanks I'll look into it.



~~Scott


 Original message 
From: "Alan W. Irwin" 
Date: 4/28/18 01:07 (GMT-08:00)
To: Scott Bloom 
Cc: cmake@cmake.org
Subject: Re: [CMake] Multiple "projects" one directory

On 2018-04-27 22:06- Scott Bloom wrote:

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

Hi Scott:

My opinion is two build areas is actually the way to go.  Also, have
you considered using ccache?  With that software (see
, rebuild costs tend to be negligible so
that two build areas which build largely the same code will not cost
that much more to build than one build area.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Help Accommodating Ninja when including CMAKE_CURRENT_BINARY_DIR

2018-04-28 Thread Stephen McDowell
​After much deliberation, I was never successful in getting a synthetic
target to work as expected.  The dilemma is that `add_custom_command`
cannot specify both `TARGET` and `OUTPUT`, the work flow was something like

add_custom_target(resource-dependency)
add_custom_command(TARGET resource-dependency ... PRE_BUILD)
add_custom_command(OUTPUT  DEPENDS
resource-dependency)
...
add_library(actual-obj-library OBJECt  ... others
...)
add_dependencies(actual-obj-library resource-dependency)

I'm sure that's a flawed approach, but in the end I realized I can actually
generate these files at *configure* time <3  The add_custom_command was
just a call to ${CMAKE_COMMAND} ... resources/bin2c.cmake.  So in the end,
it's actually a lot cleaner for us to just include(resources/bin2c.cmake).

I doubt this solution will be widely applicable to many projects, but if
you ever find yourself in a situation where you are doing
add_custom_command, where the custom command is calling ${CMAKE_COMMAND},
don't rely on PRE_BUILD because it's not a guarantee.  If you can, just
execute the script at configure time via an include(...) call.
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] error during bootstrap in cygwin

2018-04-28 Thread Ganesh S
hi All,I'm trying to run bootstrap in cygwin. I get the following error:19: 
error: ‘environ’ undeclared (first use in this function)  
 return ((int*)(&environ))[argc];          
         ^~~What am I supposed to do? -- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Multiple "projects" one directory

2018-04-28 Thread Alan W. Irwin

On 2018-04-27 22:06- Scott Bloom wrote:


I have a rather complicated Qt based project.

We are looking at rolling out a subset tool, and it will be significantly 
smaller in functionality.

For that mode, I would like to set a CMake variable LITEVERSION that builds the 
tool with -DLITEVERSION defined.

however, one (or two) folders, the main executable (and possibly the main 
window folder), and I would like include into the tool with this turned on, and 
with it turned off

Is that possible?

Other times I have done this, I just have two build areas.. But 90% of this 
code base is the same, and will be built independent of the flag. So Id rather 
not build it twice


Hi Scott:

My opinion is two build areas is actually the way to go.  Also, have
you considered using ccache?  With that software (see
, rebuild costs tend to be negligible so
that two build areas which build largely the same code will not cost
that much more to build than one build area.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__

Linux-powered Science
__
--

Powered by www.kitware.com

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

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

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

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

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