hello community,

I am receiving a|fatal error: foobar_version.h: No such file or directory|for|foobar_version.h|. The reason is that the source file is generated in|${CMAKE_CURRENT_BINARY_DIR}/foobar_version.cpp|while the header file is in|${CMAKE_CURRENT_SOURCE_DIR}|as seen here:

1234|configure_file(foobar_version.cpp.in foobar_version.cpp @ONLY) # configure_file(foobar_version.h foobar_version.h @ONLY) add_library(foobar_version STATIC ${CMAKE_CURRENT_BINARY_DIR}/foobar_version.cpp) |//

In the source I simply|#include "foobar_version.h"|but the file is in a different location.

Why is this|CMakeLists.txt|file placing the files in different locations? What should I do about it?

------------------------------------------------------------------------

also, what is the purpose of|mylib.cpp|, I had to create it otherwise I receive:|No SOURCES given to target: fooToolkit|. The build is successful but my file is currently empty. Here are all build steps:

123456789|configure_file(foobar_version.cpp.in foobar_version.cpp @ONLY) configure_file(foobar_version.h foobar_version.h @ONLY) add_library(foobar_version STATIC ${CMAKE_CURRENT_BINARY_DIR}/foobar_version.cpp) add_executable(foobar main.cpp) target_link_libraries(foobar PRIVATE foobar_version) add_library(fooToolkit mylib.cpp) target_link_libraries(fooToolkit PRIVATE foobar_version) |//

------------------------------------------------------------------------

thank you

-- 

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