Skip to content

[Enhancement] Defining a special CMake variable to indicate that CMake.js is being used #48

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

Closed
maddouri opened this issue Apr 6, 2016 · 1 comment

Comments

@maddouri
Copy link

maddouri commented Apr 6, 2016

Hello,

I would like to suggest adding a new CMake variable (e.g. NPM_CMAKEJS) to the set of variables defined by CMake.js when configuring the project. (i.e. something like D.push({"NPM_CMAKEJS": "TRUE"}); in cMake.js)

This would indicate that CMake has been invoked by CMake.js. (as opposed to a call from the command line or by an IDE such as CLion)

Having such a variable allows more flexibility in the CMakeLists.txt. For instance, when working on a complex project, it can be used to switch between sub-projects:

if (NPM_CMAKEJS)
    add_subdirectory(node_addon)
else()
    add_subdirectory(other_subproject)
endif()

Thanks :)

@unbornchikken
Copy link
Member

https://github.com/cmake-js/cmake-js#cmake-specific

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

No branches or pull requests

2 participants