hello community,

Following an example on the usage of IMPORTED_OBJECTS from the book "Professional CMake"

I receive the following error:

/Error evaluating generator expression://
//
//    $<TARGET_SOURCES://myObjLib>//
//
//  Expression did not evaluate to a known generator expression/


I wonder if there is a mistake in the code snippet? I was able to make it work using TARGET_OBJECTS instead of TARGET_SOURCES (CMake 3.15).

this is the original CMakeLists.txt:

add_library(myObjLib OBJECT IMPORTED)
set_target_properties(myObjLib PROPERTIES
   IMPORTED_OBJECTS /some/path/obj1.obj
                    /some/path/obj2.obj
)

add_executable(myExe $<TARGET_SOURCES:myObjLib>)


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to