# Conflicting "define" values

**URL:** <https://discourse.cmake.org/t/conflicting-define-values/9825>\
**Category:** Code\
**Created:** [January 11, 2024, 9:30am UTC](https://discourse.cmake.org/t/conflicting-define-values/9825 "2024-01-11T09:30:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oodini](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/o/db5fbb/32.png) [@Oodini](https://discourse.cmake.org/u/Oodini)\
**Post date:** [January 11, 2024, 9:30am UTC](https://discourse.cmake.org/t/conflicting-define-values/9825/1 "2024-01-11T09:30:39Z")

</div>

Hello,

The project I am working on uses a lot of scripts (.bat) to define some stuff finally used by CMake, which is called at the end.  
When CMake is called, a value is defined and passed as argument :  
`cmake -D PLATFORM=%PLATFORM%` (the value may be x86 or x64)

I am now trying to use a library through the **FetchContent** feature.  
The problem is that library has a CMake script which uses/defines also **PLATFORM** , but with an other meaning :

> <https://github.com/raysan5/raylib/blob/2c124c96dfdb1b81aa3fef099739442ce2d9fa9d/CMakeOptions.txt#L5>

Both meanings are legitimate, but how avoiding this conflict ? I guess I could simply rename **PLATFORM** in my scripts/CMakeLists.txt (although it annoys me), but I think this kind of situation may happen frequently.  
Is there a good way to resolve that ?

Thanks.

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [January 11, 2024, 2:03pm UTC](https://discourse.cmake.org/t/conflicting-define-values/9825/2 "2024-01-11T14:03:40Z")

</div>

> [@Oodini](#):
>
> Is there a good way to resolve that ?

I recommend that you namespace your own options. It keeps them nicely grouped and if vendoring happens (your project being vendored or vendoring another), it keeps projects from stepping on each other’s toes.

So I would name things I see here like `RAYLIB_PLATFORM`, `RAYLIB_OPENGL_VERSION`, `RAYLIB_BUILD_EXAMPLES`, etc.

---

<div class="post-metadata">

**Author:** ![Oodini](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/o/db5fbb/32.png) [@Oodini](https://discourse.cmake.org/u/Oodini)\
**Post date:** [January 11, 2024, 2:59pm UTC](https://discourse.cmake.org/t/conflicting-define-values/9825/3 "2024-01-11T14:59:00Z")

</div>

OK, thanks.

I opened an issue on the library’s Github.
