On 2018-04-06 14:34, Michael Dickens wrote:
> The issue being that if a port's configure checks for the build type (e.g., 
> {{{
> if(${CMAKE_BUILD_TYPE} STREQUAL "Release") then
> ...
> elseif
> }}}
> and so forth, and if "MacPorts" is not in BUILD_TYPEs list -- no matter 
> whether it has settings available for use by CMake already --, then cmake 
> errors out. See, e.g., < 
> https://github.com/gnuradio/gnuradio/blob/master/cmake/Modules/GrBuildTypes.cmake
>  >. Yes, I know I can always add "MacPorts" to the list and/or tweak the 
> CMAKE_BUILD_TYPE in the portfile to be something acceptable. Again: That 
> takes (a little) work and testing /debugging to make sure it's correct. It 
> also removes some of the point of updating to cmake 1.1 PG: to simplify 
> Portfiles and add MP-specific options for building. Although the cmake 1.0 PG 
> works out of the for my ports (per design), I will update those ports that 
> don't check for the BUILD_TYPE to the 1.1 PG as I find time. I'm not sure 
> what I'll do with my ports that do check the BUILD_TYPE. 

I think the problem was that -DCMAKE_BUILD_TYPE=Release would already
add some compiler flags like "-O3 -DNDEBUG", but we specify our own
flags in CFLAGS and CXXFLAGS and we end up with both on the command line.

Sounds like it should actually be -DCMAKE_BUILD_TYPE=None in the
cmake-1.1 port group and the wanted compiler flags can then be passed
via CFLAGS and CXXFLAGS in the environment (as we already do).

https://cmake.org/Wiki/CMake_Useful_Variables#Compilers_and_Tools

As "None" is generated by default by CMake, it should work with all
projects.

Rainer

Reply via email to