Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between "${CMAKE_CURRENT_SOURCE_DIR}" and "." in INCLUDE_DIRECTORIES?

Tags:

cmake

Should I use

INCLUDE_DIRECTORIES(
    .
)

or

INCLUDE_DIRECTORIES(
    ${CMAKE_CURRENT_SOURCE_DIR}
)

What is the difference, if any? I've seen mostly "." in existing code, but searching for a dot on the Internet is kind of difficult ...

like image 201
Jens Müller Avatar asked Jun 08 '15 09:06

Jens Müller


1 Answers

Both uses generate nearly the same output, since CMake tracks the current directory and replaces the occurrence of "." with "${CMAKE_CURRENT_SOURCE_DIR}/.". The only difference is that the "." variant has the extra path component "/." appended.

Whichever you choose is a matter of taste here.

like image 70
Rudi Avatar answered Sep 30 '22 12:09

Rudi