Hello,
How can I simply & cleanly implement different functions which share the same name?
Here is a first attempt:
- Function Calling: common.cmake:
get_extension(MACRO_EXTENSION)
- Implementation 1: cpp/CMakeLists.txt:
function(get_extension MACRO_EXTENSION)
set(MACRO_EXTENSION "C" PARENT_SCOPE)
endfunction()
include(${CMAKE_CURRENT_SOURCE_DIR}/../common.cmake)
- Implementation 2: python/CMakeLists.txt:
function(get_extension MACRO_EXTENSION)
set(MACRO_EXTENSION "py" PARENT_SCOPE)
endfunction()
include(${CMAKE_CURRENT_SOURCE_DIR}/../common.cmake)
Best Regards,
Salomon