Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Issue 1409753003: Change CMAKE_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. (Closed)

Created:
5 years, 1 month ago by bungeman-chromium
Modified:
5 years, 1 month ago
CC:
gyp-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/gyp.git@master
Target Ref:
refs/heads/master
Project:
gyp
Visibility:
Public.

Description

Change CMAKE_SOURCE_DIR to CMAKE_CURRENT_LIST_DIR. In projects with just one CMakeLists.txt, these two variables are equivalent. In multiproject builds, however, CMAKE_SOURCE_DIR always points to the top level CMakeLists.txt while CMAKE_CURRENT_LIST_DIR points to the CMakeLists.txt that is currently being evaluated. CMAKE_CURRENT_LIST_DIR was added in cmake 2.8.3. The generator constructs paths relative to the generated CMakeLists.txt rather than to the build root. Therefore, CMAKE_CURRENT_LIST_DIR is the more appropriate variable. This change makes it possible to integrate a gyp-generated cmake into a multi-project build without needing to switch the entire build over to gyp. It also enables projects where the top level cmake is handwritten (and possibly responsible for running gyp to generate other cmake files). This makes usage in IDEs a bit more convenient; at the very least, it stops CLion from complaining that the source files don't live underneath the directory where CMakeLists.txt lives. This also works with KDevelop, which has had support for CMAKE_CURRENT_LIST_DIR since 4.1.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -6 lines) Patch
M pylib/gyp/generator/cmake.py View 5 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
bungeman-chromium
5 years, 1 month ago (2015-10-30 19:29:40 UTC) #3
bungeman-chromium
Apparently the win and win_try bots have been offline for a while, and the linux_try ...
5 years, 1 month ago (2015-10-30 19:55:46 UTC) #4
bungeman-chromium
5 years, 1 month ago (2015-11-05 19:40:47 UTC) #5
Message was sent while issue was closed.
Closed after committing https://codereview.chromium.org/1408993007/ .

Powered by Google App Engine
This is Rietveld 408576698