You can solve this by treating those local projects as external projects;
then they can be built with independant flags....

include( ExternalProject )

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

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

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


On Fri, Apr 27, 2018 at 3:06 PM, Scott Bloom <sc...@towel42.com> wrote:

> I have a rather complicated Qt based project.
>
>
>
> We are looking at rolling out a subset tool, and it will be significantly
> smaller in functionality.
>
>
>
> For that mode, I would like to set a CMake variable LITEVERSION that
> builds the tool with -DLITEVERSION defined.
>
> however, one (or two) folders, the main executable (and possibly the main
> window folder), and I would like include into the tool with this turned on,
> and with it turned off
>
>
>
> Is that possible?
>
>
>
> Other times I have done this, I just have two build areas.. But 90% of
> this code base is the same, and will be built independent of the flag. So
> Id rather not build it twice
>
>
>
> Scott
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
>
-- 

Powered by www.kitware.com

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

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

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

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

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

Reply via email to