Created
December 9, 2014 12:42
-
-
Save igilham/3672f49e9afefc4ae080 to your computer and use it in GitHub Desktop.
CMake add_sources Macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(SRCS "") | |
macro (add_sources) | |
foreach (_src ${ARGN}) | |
if (_relPath) | |
list (APPEND SRCS "${_src}") | |
else() | |
list (APPEND SRCS "${_src}") | |
endif() | |
endforeach() | |
if (_relPath) | |
# propagate SRCS to parent directory | |
set (SRCS ${SRCS} PARENT_SCOPE) | |
endif() | |
endmacro() | |
add_sources(main.cpp inc.h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment