# Passing CMake options



## hopla (Mar 11, 2013)

Hi there,

I want to pass the following option to the mysql56-server port: https://dev.mysql.com/doc/refman/5....ion-options.html#option_cmake_default_charset . But I can't figure out how to pass it.

I want to compile it with -DDEFAULT_CHARSET=utf8.

I've already tried [cmd=]cd /usr/ports/databases/mysql56-server && make -DDEFAULT_CHARSET=utf8[/cmd].

And also used portconf: 
	
	



```
databases/mysql*: CONFIGURE_ARGS=--default_charset=utf8
```

But nothing works. I only have make or ./configure experience as a simple 'consumer', so I'm lacking the insight to see how this should be passed properly.

Anyone who can shed some light on this?


----------



## Carpetsmoker (Mar 12, 2013)

From /usr/ports/Mk/bsd.cmake.mk


```
# CMAKE_ENV     - Environment passed to cmake.
#               Default: ${CONFIGURE_ENV}
# CMAKE_ARGS        - Arguments passed to cmake
#               Default: see below
```

If you look at the mysql56-server Makefile:

```
CMAKE_ARGS+=-DINSTALL_DOCDIR="share/doc/mysql" \
[... etc ...]
```

So you can just use [cmd=]make install CMAKE_ARGS=-DDEFAULT_CHARSET=utf8[/cmd]

Note quite a few ports use CMAKE_ARGS*=* or CONFIGURE_ARGS*=*, rather than += (or perhaps ?=), this is *wrong* since it will override whatever you give on the commandline instead of adding to it. Always be on lookout for this.


----------



## hopla (Mar 13, 2013)

Alright, thanks! Good idea to look in the port Makefile!


----------

