Re: [CMake] Unable to find source files in different directory using target_sources(INTERFACE)

2016-07-09 Thread Robert Dailey
Thanks, I just verified that doing absolute path works. I find it frustrating though that relative paths aren't calculated to absolute at the time the function is called, though. I feel like CMake should be doing this for me. On Sat, Jul 9, 2016 at 7:23 PM, Craig Scott wrote: > Sorry, hit the sen

Re: [CMake] Unable to find source files in different directory using target_sources(INTERFACE)

2016-07-09 Thread Craig Scott
Sorry, hit the send button prematurely. To achieve your desired goal of creating a header only library as a target in Visual Studio, it somewhat depends on what you want to do with that library. If you just want it to be there so you can see the header in the IDE, then simply defining a dummy custo

Re: [CMake] Unable to find source files in different directory using target_sources(INTERFACE)

2016-07-09 Thread Craig Scott
When using target_sources(), if you specify the source file(s) with a relative path, CMake does not convert that to an absolute path when storing it in the target's SOURCES property (that's my interpretation anyway). The end result is that the source you specify is going to be interpreted as being

[CMake] Unable to find source files in different directory using target_sources(INTERFACE)

2016-07-09 Thread Robert Dailey
I have the following: cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR) project(foo) add_library(foo INTERFACE) target_sources(foo INTERFACE foo.h) add_subdirectory(subdir) And inside subdir, I specify add_executable() and then target_link_libraries(myexe foo). I get an error: Cannot find sourc