ChimeraTK / project-template

Template for new projects. Can also be used to update cmake scripts in existing projects by merging the changes. This repository intentionally does not have a README.md (which would create conflicts in the projects using this template). For documentation, please follow this link:
https://github.com/ChimeraTK/project-template/blob/master/HowTo_project-template.md
GNU Lesser General Public License v3.0
1 stars 3 forks source link

CMake does not work if no build type is specified #6

Closed killenb closed 5 years ago

killenb commented 5 years ago

efd3d21b49b31fc3cd79c0cd160a235275ad929c introduces changing CMakeBuildType to upper case. However if no build type is specified the string operation fails.

Jenkins did not catch this because it always specifies a build type.

Either introduce a check or revert this commit. I think we have multiple places where the exact upper-lower case of the build type is required. If you keep it carefully grep that you don't miss any to really make it work.

vargheseg commented 5 years ago

efd3d21 introduces changing CMakeBuildType to upper case

This is not true; content inside CMAKE_BUILD_TYPE will not change; the build system must not fail to add the coverage target when cmake is invoked for example as:

cmake -DCMAKE_BUILD_TYPE=debug ../

The above invocation is valid AFAIK.

vargheseg commented 5 years ago

The issue is, on the invocation below we have an error:

cmake ../
CMake Error at CMakeLists.txt: (string):
  string no output variable specified

This is caused by missing " around CMAKE_BUILD_TYPE and consequently the string command ends up with one argument when CMAKE_BUILD_TYPE is not set. Intended behavior is to invoke string with an empty string and output variable as parameters in this case.

bd0bfc3aef9938f5c9ab9134d97ef0725ec90ee3 should fix this.