Skip to content

Bump CMake minimum to 3.12 and refactor accordingly. #2348

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

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Sep 24, 2019

Must take steps to install a newer cmake for the one Travis matrix case
where the old "trusty" image didn't contain a new enough one. In all
the other CI cases, a new enough cmake was already present.

Get rid of legacy cmake policy directives.

With newer cmake, change many add_definitions to more proper
add_compile_options. Get rid of unnecessary cmake definitions.

Refactor Makefile wrapper with better/standard target names: install,
build, config, etc. And don't replicate code for make vs ninja --
instead, use cmake --build.

Now that CMake 3.12 is the minimum, we can count on any FindFoo.cmake
having its searches automatically include hints for having defined
-DFoo_ROOT=... or a defined environment variable Foo_ROOT, without
our needing to separately define or handle them. This leads to a huge
refactor ond simplification, as well as a normalization of this as the
one true naming convention for dependency location hints (versus a
hodgepodge of FOO_ROOT_DIR, FOOHOME, FOO_PATH, FOO_HOME, and more).

A lot of the repetitive logic of finding dependencies has been
coalesced in new oiio_find_package macro, which wraps the build-in
find_package() with some nicities, including color coded clear status
messages about which deps were found, which optional ones were not,
and which the user disabled.

The crown jewel of this patch is externalpackages.cmake, that's the one
thing to look at if you want to see how much nicer the dependency finding code is.

@lgritz lgritz force-pushed the lg-cmake312 branch 5 times, most recently from b266b63 to 4adec71 Compare September 25, 2019 16:54
Must take steps to install a newer cmake for the one Travis matrix case
where the old "trusty" image didn't contain a new enough one. In all
the other CI cases, a new enough cmake was already present.

Get rid of legacy cmake policy directives.

With newer cmake, change many add_definitions to more proper
add_compile_options. Get rid of unnecessary cmake definitions.

Refactor Makefile wrapper with better/standard target names: install,
build, config, etc. And don't replicate code for make vs ninja --
instead, use cmake --build.

Now that CMake 3.12 is the minimum, we can count on any FindFoo.cmake
having its searches automatically include hints for having defined
`-DFoo_ROOT=...` or a defined environment variable `Foo_ROOT`, without
our needing to separately define or handle them. This leads to a huge
refactor ond simplification, as well as a normalization of this as the
one true naming convention for dependency location hints (versus a
hodgepodge of FOO_ROOT_DIR, FOOHOME, FOO_PATH, FOO_HOME, and more).

A lot of the repetitive logic of finding dependencies has been
coalesced in new oiio_find_package macro, which wraps the build-in
find_package() with some nicities, including color coded clear status
messages about which deps were found, which optional ones were not,
and which the user disabled.

Along the way, we bump the Travis macosx setup to xcode11.
@lgritz lgritz merged commit 75ecdc4 into AcademySoftwareFoundation:master Sep 27, 2019
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.

1 participant