Variable expansion in target_include_directories fails (depending on position)
The variable expansion ${TARGET_PLATFORM_INCLUDE_DIRECTORIES}" works or fails depending on its positiion relative to other statements inside of target_include_directories:
CMake Error at CMakeLists.txt:12 (target_include_directories): target_include_directories called with invalid arguments
CMakeLists.txt:
cmake_minimum_required (VERSION 3.0)
project (Foo)
add_library( Foo SHARED
foo.c
)
set( TARGET_PLATFORM_INCLUDE_DIRECTORIES "PUBLIC macosx")
message( STATUS "TARGET_PLATFORM_INCLUDE_DIRECTORIES is
${TARGET_PLATFORM_INCLUDE_DIRECTORIES}")
target_include_directories( Foo BEFORE
${TARGET_PLATFORM_INCLUDE_DIRECTORIES}
PRIVATE private
# ${TARGET_PLATFORM_INCLUDE_DIRECTORIES}
)
Using cmake version 3.7.1 on MacOSX 10.10.
Ciao Nat!
P.S. Subscribed to mailing list, but posting generated a bounce.