Open cevich opened 9 years ago
Looking at the suggested policy details, CMP0022
seems to suggest a fix which will also be compatible with older cmake versions (re: cmake/Platform/Arduino.cmake
line 983):
Warning-free future-compatible code which works with CMake 2.8.9 onwards
can be written by using the ``LINK_PRIVATE`` and ``LINK_PUBLIC`` keywords
of ``target_link_libraries()``.
However, I'm not enough of a cmake guru to know what this means, or how to fix it :cry:
Just by total guessing and some poking around, I found this makes all the warnings go away (though I don't know if it is a correct fix, or will work with older versions of cmake):
diff --git a/cmake/Platform/Arduino.cmake b/cmake/Platform/Arduino.cmake
index 22ba5d8..d42a7ec 100644
--- a/cmake/Platform/Arduino.cmake
+++ b/cmake/Platform/Arduino.cmake
@@ -1001,7 +1001,7 @@ function(setup_arduino_library VAR_NAME BOARD_ID LIB_PATH COMPILE_FLAGS LINK_FLA
LINK_FLAGS "${ARDUINO_LINK_FLAGS} ${LINK_FLAGS}")
list(APPEND LIB_INCLUDES "-I\"${LIB_PATH}\" -I\"${LIB_PATH}/utility\"")
- target_link_libraries(${TARGET_LIB_NAME} ${BOARD_ID}_CORE ${LIB_TARGETS})
+ target_link_libraries(${TARGET_LIB_NAME} ${BOARD_ID}_CORE)
list(APPEND LIB_TARGETS ${TARGET_LIB_NAME})
endif()
It does end the complaining, and all the examples seem to build fine as well.
Here's a pull-request with this change if by chance I guessed correctly (please double-check): #94
Bump. Anyone ever figure out what's going on with these?
Dunno, but I've been running with #94 applied and it seems to address the issue. But again, I'm not a CMAKE expert, just know enough to be dangerous :smile:
Under Fedora 21 beta, using Fedora 20 toolchain (bugzilla 1134394), CMake 2.8.12 gives the following warnings: