Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor CMake improvements #2080

Closed
wants to merge 15 commits into from

Conversation

mrpilot2
Copy link
Contributor

Thank you for creating a pull request to contribute to FreeCAD! To ease integration, please confirm the following:

  • Branch rebased on latest master git pull --rebase upstream master
  • Unit tests confirmed to pass by running ./bin/FreeCAD --run-test 0
  • Commit message is well-written
  • Commit message includes issue #<id> or fixes #<id> where <id> is the associated MantisBT issue id if one exists

And please remember to update the Wiki with the features added or changed once this PR is merged.
Note: If you don't have wiki access, then please mention your contribution on the 0.19 Changelog Forum Thread.


Did some minor CMake improvements

structuring of project command and policies, project name, removing unused code, indentation

mrpilot2 and others added 15 commits April 11, 2019 23:42
trunk is a term from version control systems and has nothing to do with
CMake. Now the variable PROJECT_NAME defined by CMake and PACKAGE_NAME
are the same, therefore replaced PACKAGE_NAME with PROJECT_NAME
as the comment and https://crascit.com/2016/04/09/using-ccache-with-cmake/
suggest, setting CCache should be done before project command,
because then CMake checks if the compiler can be invoked through CCache
append to it to allow setting it from outside
couldn't find DEBUG/RELEASE_MAIN_OUTPUT_PATH anywhere else
Excerpt from CMake documentation:

The if command was written very early in CMake’s history, predating the ${} variable evaluation syntax, and for
convenience evaluates variables named by its arguments as shown in the above signatures. Note that normal variable
evaluation with ${} applies before the if command even receives the arguments. Therefore code like:

set(var1 OFF)
set(var2 "var1")
if(${var2})

appears to the if command as:

if(var1)

and is evaluated according to the if(<variable>) case documented above. The result is OFF which is false. However, if we remove the ${} from the example then the command sees:

if(var2)

which is true because var2 is defined to “var1” which is not a false constant.
TODO: there is still something wrong with indentation, there
are some IFs on the same level without a ENDIF in between
BuildAll.bat was removed with commit daee73a
wasn't touched for 5 years, probably not needed anymore
this should work for all generators on all systems
project was renamed in commit 98e3027
@wwmayer
Copy link
Contributor

wwmayer commented May 26, 2019

Merged.

@wwmayer wwmayer closed this May 26, 2019
@mrpilot2 mrpilot2 deleted the cmake_improvements branch May 28, 2019 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants