diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d9aa4ab0aa..7969d6810dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ IF(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0003 NEW) IF (CMAKE_MAJOR_VERSION GREATER 2) CMAKE_POLICY(SET CMP0026 OLD) + CMAKE_POLICY(SET CMP0045 NEW) CMAKE_POLICY(SET CMP0050 OLD) ENDIF() ENDIF(COMMAND CMAKE_POLICY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bd29619b295..c98f304e14a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -160,9 +160,11 @@ TARGET_LINK_LIBRARIES(lmms ) FOREACH(LIB ${LMMS_REQUIRED_LIBS}) - GET_TARGET_PROPERTY(INCLUDE_DIRS ${LIB} INTERFACE_INCLUDE_DIRECTORIES) - if (INCLUDE_DIRS) - TARGET_INCLUDE_DIRECTORIES(lmmsobjs PRIVATE ${INCLUDE_DIRS}) + IF(TARGET ${LIB}) + GET_TARGET_PROPERTY(INCLUDE_DIRS ${LIB} INTERFACE_INCLUDE_DIRECTORIES) + if (INCLUDE_DIRS) + TARGET_INCLUDE_DIRECTORIES(lmmsobjs PRIVATE ${INCLUDE_DIRS}) + ENDIF() ENDIF() ENDFOREACH()