Greetings consider my small 'learn cmake/qt4 project' It generates a library testLIB-static in $CMAKE_SOURCE_DIR}/testLIB and an executible testBIN in ${CMAKE_SOURCE_DIR}/upstream/bin
A) For the library I used add_library(testLIB-static testLIB.cpp ) B) For the executible I use the sip generator to generate code like so add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generatedfile1.cpp ---- --- COMMAND ${SIP_EXECUTABLE} -c${CMAKE_CURRENT_BINARY_DIR} -I${SIP_PATH} -s ".cpp" -t WS_X11 -t Qt$version -w ${CMAKE_SOURCE_DIR}/path/to/generator.sip DEPENDS ${CMAKE_SOURCE_DIR}/path/to/generator.sip MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/path/to/generator.sip COMMENT "Processing ${CMAKE_SOURCE_DIR}/path/to/generator.sip" VERBATIM ) add_execitible(testBIN testBIN.cpp generatedfile1.cpp ) target_link_libraries(testLIB-static) ############### these are my findings ----If I add find_library(XXX testLIB-static) before I use the add_executible() command cmake contends that testLIB-static is set to NOTFOUND. ----If I do not use find_library(XXX testLIB-static) and run make, make goes to 100 per cent and then all hell breaks loose with linking problems. If I change the second line of the add_custom_command() statement to use 'absolute paths that I can understand such as:- ${CMAKE_SOURCE_DIR}/upstream/bin/generatedfile1.cpp the SIP generator fails to generate generatedfile1.cpp Advice ould be appreciated. luxInteg _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake