Re: [CMake] cmake cannot find source file (new to cmake)
> > When I ran "cmake .." in bin, cmake complained that it could not find > source file src1.h in add_executable. What is wrong here? > Hi Lei, Alex hit several of these points, but to wrap it up together: A couple of things... - There's no need for a CMakeLists.txt in a directory if it's not actually going to do anything. i.e. if you're not adding targets or executing any other CMake code then just traversing the directories doesn't serve any particular purpose. - The list of source files that a target uses to build don't have to necessarily be full paths, they can be absolute or relative paths, but the relative paths need to be relative to where the target is created, i.e. the add_executable(...) call. So in your case, the target is "exec" in the "src" folder so all paths to source files, if relative paths and not absolute paths, need to be relative to the src directory. - include_directories is the older style CMake and will apply to all targets created after it. Use target_include_directories instead for the more modern target-centric approach of having commands only apply to the appropriate target instead of globally. - Rather than use a list of sources, you can also use the target_sources command to programmatically add source files to a target based on necessary logic. The same restriction applies though that the sources added need to be relative to the target location or an absolute path. - The preferred project layout for CMake is to really have out-of-source builds. So instead having bin as a sub-directory of your project, just eliminate that level entirely. You can certainly create your structure however you want but that's the suggested and preferred way of organising. Combining these things, you could have nested CMakeLists.txt in which the subdirectories are explicitly adding the sources: - Top Level: - CMakeLists.txt cmake_minimum_required(VERSION 3.8) project(proj) add_executable(exec) add_subdirectory(common) add_subdirectory(dir1) - common/ - src1.h - CMakeLists.txt target_include_directories(exec PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_sources(exec PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src1.h) - dir1/ - src1.c - src2.c - CMakeLists.txt target_sources(exec PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src1.c ${CMAKE_CURRENT_SOURCE_DIR}/src2.c ) Or a much simpler single file where no nested CMakeLists.txt are needed since they wouldn't be doing anything: - Top Level: - CMakeLists.txt cmake_minimum_required(VERSION 3.8) project(proj) add_executable(exec common/src1.h dir1/src1.c dir1/src2.c ) target_include_directories(exec common) - common/ - src1.h - dir1/ - src1.c - src2.c Both are valid, the first is overkill for this simple example but illustrates a way of doing things that can be helpful with much more complex projects. Either way, you also have a build directory completely detached and outside your source tree instead of a sub-directory. - Chuck -- 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
[CMake] Fwd: cmake cannot find source file (new to cmake)
Forwarding to the list and replying to some parts. > I removed add_subdirectories and added path to each of the source > file according to your instruction and things worked! I just have a > quick question: why should I remove the add_subdirectories in the src > CMakeLists.txt? I thought add_subdirectories should tell cmake to look > for files in the directories? add_subdirectory() tells CMake that there's yet another listfile (CMakeLists.txt) in a subdirectory, which will be processed recursively until no further listfiles are found inside. Then the normal procedural flow continues. So it doesn't say anything about project files, just that new script code that might involve the project files needs to be processed. >>> Toplevel >>> >>>|- CMakeLists.txt >>> >>>|- src |--CMakeLists.txt >>> >>>| >>> |--common---|---CMakeLists.txt >>> >>>| |--dir1-| >>> |--- src1.h >>> >>>| |-CMakeLists.txt >>> >>>|bin|-src2.c >>> >>> |-src3.c >> >> It's quite hard to figure out what's going on here, but I assume src1.h >> is under src/common. Please post the output of 'tree' command next time, >> if you are on a Unix. >> >>> set(src_files src1.h src2.c src3.c) >> >> You don't have to add headers as target dependencies unless you program >> in an IDE (just fyi). >> >>> CMakeLists.txt in common and dir1 are empty. >> >> So, either partially move your CMake scripts into these subdirectories, >> or don't do `add_subdirectory()`. For example: >> >> src/CMakeLists.txt: >> add_executable(exec dir1/src1.c dir1/src2.c dir1/src3.c) >> target_include_directories(exec PRIVATE >> "${CMAKE_CURRENT_SOURCE_DIR}/common") -- Alex -- 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
Re: [CMake] cmake cannot find source file (new to cmake)
> Toplevel > > |- CMakeLists.txt > > |- src |--CMakeLists.txt > > | > |--common---|---CMakeLists.txt > > | |--dir1-| > |--- src1.h > > | |-CMakeLists.txt > > |bin |-src2.c > > |-src3.c It's quite hard to figure out what's going on here, but I assume src1.h is under src/common. Please post the output of 'tree' command next time, if you are on a Unix. > set(src_files src1.h src2.c src3.c) You don't have to add headers as target dependencies unless you program in an IDE (just fyi). > CMakeLists.txt in common and dir1 are empty. So, either partially move your CMake scripts into these subdirectories, or don't do `add_subdirectory()`. For example: src/CMakeLists.txt: add_executable(exec dir1/src1.c dir1/src2.c dir1/src3.c) target_include_directories(exec PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/common") -- Alex signature.asc Description: OpenPGP digital signature -- 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
[CMake] cmake cannot find source file (new to cmake)
Hi, I tried to follow some examples and wrote some cmake files to build my code. But cmake is complaining that it cannot find a source file. Here is the code structure: Toplevel |- CMakeLists.txt |- src |--CMakeLists.txt | |--common---|---CMakeLists.txt | |--dir1-| |--- src1.h | |-CMakeLists.txt |bin|-src2.c |-src3.c Here is the CMakeLists.txt in toplevel: project(proj) add_subdirectory(src) Here is the CMakeLists.txt in src: project(proj) add_subdirectory(common) add_subdirectory(dir1) include_directories(common) set(src_files src1.h src2.c src3.c) add_executable(exec ${src_files}) CMakeLists.txt in common and dir1 are empty. When I ran "cmake .." in bin, cmake complained that it could not find source file src1.h in add_executable. What is wrong here? Thanks, Lei -- 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
Re: [CMake] Cannot find source file:
On 24 June 2017 at 05:06, Sean Waylandwrote: > Hi all, > I am having trouble getting an application to build. > I keep getting this error "cannot find source file" > > > /Users/seanwayland/Desktop/CATSMAT-masterfri/catsmat/catsmat/Analysis/src/*.cpp > > This is the first folder containing sources and when it doesn't find > anything here it stops. > > There are indeed .cpp files in that directory. > I tried putting a ./ at the start of the directory tree but it didn't help. > > My cmake file is below .. I am using CLION 2017.1.1 and OSX 10.12.1 > > Can anyone shed any light ?? My high level comment would be to not glob for source files. This an anti-pattern and will break your incremental builds. For example if you add a new source files say "foo.cpp" and then run "make" (or whatever your CMake generator is) the build will fail if "foo.cpp" is actually needed because CMake will not know it needs to re-configure to discover "foo.cpp" and so will not try to build "foo.cpp". By listing source files manually in "CMakeLists.txt" files you will force CMake to re-configure when you add/remove source files from the build. I also note you are setting a very old minimum CMake version and are using the old style condition syntax (condition appears in `endif()` and `else()`). I'd really advise you don't use that syntax and set a high minimum CMake version so you get some of the useful new features in CMake unless you have a specific reason for supporting such an old version of CMake. As for your globbing problem * This is definitely wrong ``` set (CATSMAT_DIR ./Users/seanwayland/Desktop/CATSMAT-masterfri/catsmat/catsmat/ ) ``` The leading `.` means current directory and I doubt there's a `Users` folder in your current directory. Also hard coding paths like is very bad style and is not portable. * This doesn't make sense ``` file (GLOB CORESRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SRC}) ``` "${SRC}" is a list of absolute paths but then you tell the `file()` command to assume the paths are relative to `${CMAKE_CURRENT_SOURCE_DIR}`. -- 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: http://public.kitware.com/mailman/listinfo/cmake
[CMake] Cannot find source file:
Hi all, I am having trouble getting an application to build. I keep getting this error "cannot find source file" /Users/seanwayland/Desktop/CATSMAT-masterfri/catsmat/catsmat/Analysis/src/*.cpp This is the first folder containing sources and when it doesn't find anything here it stops. There are indeed .cpp files in that directory. I tried putting a ./ at the start of the directory tree but it didn't help. My cmake file is below .. I am using CLION 2017.1.1 and OSX 10.12.1 Can anyone shed any light ?? Thanks for your help! Best Sean ### # CMAKE CATSTMAT ### cmake_minimum_required(VERSION 2.4) set(CMAKE_CXX_STANDARD 11) if(CMAKE_CONFIGURATION_TYPES) set(CMAKE_CONFIGURATION_TYPES Debug Release) endif() if(UNIX) add_definitions(-Wall -DGCC) endif(UNIX) # RPATH SETTING # set(CMAKE_MACOSX_RPATH 1) #if(APPLE) # set (CMAKE_OSX_ARCHITECTURES "x86_64 i386") # if (${CMAKE_SYSTEM_VERSION} VERSION_LESS 9.0.0) # set (CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk) # elseif (${CMAKE_SYSTEM_VERSION} VERSION_LESS 10.8.0) # set (CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) # elseif (${XCODE_VERSION} VERSION_LESS 4.0.0) # set (CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk) # else () # set (CMAKE_OSX_SYSROOT "macosx10.7") # endif () # set (CMAKE_C++_FLAGS -mmacosx-version-min=10.4) #endif(APPLE) # #if(WIN32) # add_definitions(-DWINVER=0x0400 -DWIN32) # if(${CMAKE_GENERATOR} STREQUAL "Visual Studio 6") # add_definitions(-DVC6) # elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005") # add_definitions(-DVC2005) # endif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 6") #endif(WIN32) ### BOOST LIBRARIES ### if (APPLE) set(BOOST_ROOT "/usr/local/boost") set(BOOST_FILESYSTEM_LIB /usr/local/boost/lib/libboost_filesystem.dylib) set(BOOST_SYSTEM_LIB /usr/local/boost/lib/libboost_system.dylib) else () set(BOOST_ROOT "C:/local/boost_1_58_0") set(BOOST_FILESYSTEM_LIB C:/local/boost_1_58_0/lib64-msvc-12.0) set(BOOST_SYSTEM_LIB C:/local/boost_1_58_0/lib64-msvc-12.0) endif () FIND_PACKAGE( Boost 1.58.0 REQUIRED ) INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} ) ### # set directories, src and headers. set (CATSMAT_DIR ./Users/seanwayland/Desktop/CATSMAT-masterfri/catsmat/catsmat/ ) set (libIMUSANT_DIR${CMAKE_CURRENT_SOURCE_DIR}/../../libIMUSANT) set (LOKI_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../Loki) set (SUFFIX_TREE_DIR${CMAKE_CURRENT_SOURCE_DIR}/../../SuffixTree) set (GOOGLE_TEST_INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../googletest-master/googletest/include) set (IMUSANT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../libIMUSANT) set (LIBMUSICXML_DIR${CMAKE_CURRENT_SOURCE_DIR}/../../libMusicXMLv3) set (SRCFOLDERS ${CATSMAT_DIR}/Analysis/src ${CATSMAT_DIR}/CounterpointAnalysis/src ${CATSMAT_DIR}/GeneralAnalysis/src ${CATSMAT_DIR}/Segmentation/FixedPeriodDetection/src ${CATSMAT_DIR}/Segmentation/LocalBoundaryDetectionModel/src ${CATSMAT_DIR}/Application ${CATSMAT_DIR}/Segmentation/LocalBoundaryDetectionModel/src ${CATSMAT_DIR}/Segmentation ${CATSMAT_DIR}/Utilities ) set (INCFOLDERS ${libIMUSANT_DIR} ${CATSMAT_DIR}/Analysis/inc ${CATSMAT_DIR}/Application ${CATSMAT_DIR}/CounterpointAnalysis/inc ${CATSMAT_DIR}/GeneralAnalysis/inc ${CATSMAT_DIR}/Segmentation ${CATSMAT_DIR}/Segmentation/FixedPeriodDetection/inc ${CATSMAT_DIR}/Segmentation/LocalBoundaryDetectionModel/inc ${CATSMAT_DIR}/Utilities ${libIMUSANT_DIR}/DomainObjects/inc ${libIMUSANT_DIR}/Utilities/inc ${libIMUSANT_DIR}/FileProcessing/inc ${libIMUSANT_DIR}/Converters/MusicXML_v3 ${libIMUSANT_DIR}/Converters/MusicXML_v3/inc ${libIMUSANT_DIR}/Converters/MusicXML_v3/shared/inc ${IMUSANT_DIR}/DomainObjects/inc ${IMUSANT_DIR}/Converters/MusicXML_v3 ${IMUSANT_DIR}/Converters/MusicXML_v3/inc ${IMUSANT_DIR}/Converters/Shared/inc ${IMUSANT_DIR}/FileProcessing/inc ${IMUSANT_DIR}/Utilities/inc ${SUFFIXTREE_DIR} ${LIBMUSICXML_DIR}/libmusicxml-3.00-src/src ${LIBMUSICXML_DIR}/libmusicxml-3.00-src/src/lib ${LIBMUSICXML_DIR}/libmusicxml-3.00-src/src/visitors ${LIBMUSICXML_DIR}/libmusicxml-3.00-src/src/parser ${LOKI_DIR} ${SUFFIX_TREE_DIR} ${GOOGLE_TEST_INC_DIR} ) foreach(folder ${SRCFOLDERS}) set(SRC ${SRC} "${folder}/*.cpp") # add source files endforeach(folder) file (GLOB CORESRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${SRC}) foreach(folder ${INCFOLDERS}) set(HEADERS ${HEADERS} "${folder}/*.h") # add header files set(INCL ${INCL} "${folder}") # add include folders endforeach(folder) file (GLOB COREH RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${HEADERS}) ### # set includes include_directories( ${INCL}) set_source_files_properties (${COREH} PROPERTIES HEADER_FILE_ONLY TRUE) ### # set library
Re: [CMake] Cannot find source file: *.rc
On 05/26/2011 06:45 PM, aaron_wri...@selinc.com wrote: From: Michael Wild them...@gmail.com To: cmake@cmake.org Date: 05/25/2011 10:08 PM Subject: Re: [CMake] Cannot find source file: *.rc Sent by: cmake-boun...@cmake.org On 05/25/2011 11:40 PM, aaron_wri...@selinc.com wrote: I use mc.exe to generate an *.rc file and some headers for my program. The *.rc file is listed as an output of a custom command and as a source to an executable. During configuration CMake tells me it can't find a source file and lists the *.rc file. I've check the generated property of the *.rc file and it is true, so why does CMake expect it to be present during configuration? I've tried to make a small example, but when I try to do that everything works. What I'm looking for is a reason why it would only effect large build systems on not small build system, or why does this only effect this *.rc and none of the other twenty or thirty files I generate? Is there something special about *.rc files? I'm really just grabbing at straws here because I've been trying to fix this for months, with no luck. So any ideas are welcome. --- Aaron Wright Is the add_custom_command call generating the *.rc file in the same directory as your add_executable call? Michael It is neither in the same CMakeLists.txt nor is the *.rc file generated anywhere close to the executable. I did work around this by writing a dummy file at configure time with FILE(WRITE. Thought that seems a little hacky. That is the problem. GENERATED source files only seem to work when used in the same directory. Michael ___ 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
Re: [CMake] Cannot find source file: *.rc
On 05/27/2011 11:46 AM, Michael Wild wrote: On 05/26/2011 06:45 PM, aaron_wri...@selinc.com wrote: From: Michael Wild them...@gmail.com To: cmake@cmake.org Date: 05/25/2011 10:08 PM Subject: Re: [CMake] Cannot find source file: *.rc Sent by: cmake-boun...@cmake.org On 05/25/2011 11:40 PM, aaron_wri...@selinc.com wrote: I use mc.exe to generate an *.rc file and some headers for my program. The *.rc file is listed as an output of a custom command and as a source to an executable. During configuration CMake tells me it can't find a source file and lists the *.rc file. I've check the generated property of the *.rc file and it is true, so why does CMake expect it to be present during configuration? I've tried to make a small example, but when I try to do that everything works. What I'm looking for is a reason why it would only effect large build systems on not small build system, or why does this only effect this *.rc and none of the other twenty or thirty files I generate? Is there something special about *.rc files? I'm really just grabbing at straws here because I've been trying to fix this for months, with no luck. So any ideas are welcome. --- Aaron Wright Is the add_custom_command call generating the *.rc file in the same directory as your add_executable call? Michael It is neither in the same CMakeLists.txt nor is the *.rc file generated anywhere close to the executable. I did work around this by writing a dummy file at configure time with FILE(WRITE. Thought that seems a little hacky. That is the problem. GENERATED source files only seem to work when used in the same directory. Michael This is even documented explicitly: In the CMake manual, search for in the same directory (CMakeLists.txt file), and see FAQ 4.7. If a custom command's output is to be referred to from another CMakeLists.txt file, one must trigger it by a custom target, e.g. Moreover, note that source properties like GENERATED are not only associated to source files, but also restricted to directories, i.e. a source file marked as GENERATED in one CMakeLists.txt won't bear this mark in another CMakeLists.txt. Regards, Michael ___ 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
Re: [CMake] Cannot find source file: *.rc
From: Michael Wild them...@gmail.com To: cmake@cmake.org Date: 05/25/2011 10:08 PM Subject: Re: [CMake] Cannot find source file: *.rc Sent by: cmake-boun...@cmake.org On 05/25/2011 11:40 PM, aaron_wri...@selinc.com wrote: I use mc.exe to generate an *.rc file and some headers for my program. The *.rc file is listed as an output of a custom command and as a source to an executable. During configuration CMake tells me it can't find a source file and lists the *.rc file. I've check the generated property of the *.rc file and it is true, so why does CMake expect it to be present during configuration? I've tried to make a small example, but when I try to do that everything works. What I'm looking for is a reason why it would only effect large build systems on not small build system, or why does this only effect this *.rc and none of the other twenty or thirty files I generate? Is there something special about *.rc files? I'm really just grabbing at straws here because I've been trying to fix this for months, with no luck. So any ideas are welcome. --- Aaron Wright Is the add_custom_command call generating the *.rc file in the same directory as your add_executable call? Michael It is neither in the same CMakeLists.txt nor is the *.rc file generated anywhere close to the executable. I did work around this by writing a dummy file at configure time with FILE(WRITE. Thought that seems a little hacky.___ 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
[CMake] Cannot find source file: *.rc
I use mc.exe to generate an *.rc file and some headers for my program. The *.rc file is listed as an output of a custom command and as a source to an executable. During configuration CMake tells me it can't find a source file and lists the *.rc file. I've check the generated property of the *.rc file and it is true, so why does CMake expect it to be present during configuration? I've tried to make a small example, but when I try to do that everything works. What I'm looking for is a reason why it would only effect large build systems on not small build system, or why does this only effect this *.rc and none of the other twenty or thirty files I generate? Is there something special about *.rc files? I'm really just grabbing at straws here because I've been trying to fix this for months, with no luck. So any ideas are welcome. --- Aaron Wright Software Engineer - Synchrophasors Schweitzer Engineering Laboratories, Inc. Pullman, WA 99163 509-334-8087 ___ 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
Re: [CMake] Cannot find source file: *.rc
On 05/25/2011 11:40 PM, aaron_wri...@selinc.com wrote: I use mc.exe to generate an *.rc file and some headers for my program. The *.rc file is listed as an output of a custom command and as a source to an executable. During configuration CMake tells me it can't find a source file and lists the *.rc file. I've check the generated property of the *.rc file and it is true, so why does CMake expect it to be present during configuration? I've tried to make a small example, but when I try to do that everything works. What I'm looking for is a reason why it would only effect large build systems on not small build system, or why does this only effect this *.rc and none of the other twenty or thirty files I generate? Is there something special about *.rc files? I'm really just grabbing at straws here because I've been trying to fix this for months, with no luck. So any ideas are welcome. --- Aaron Wright Software Engineer - Synchrophasors Schweitzer Engineering Laboratories, Inc. Pullman, WA 99163 509-334-8087 Is the add_custom_command call generating the *.rc file in the same directory as your add_executable call? Michael ___ 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
Re: [CMake] Cannot find source file.
I would contend that this should be a warning vs. an error, which prevents generation. Cheers, Tim On Thu, Dec 10, 2009 at 3:18 PM, Alexander Neundorf a.neundorf-w...@gmx.net wrote: On Thursday 10 December 2009, Tyler Roscoe wrote: On Thu, Dec 10, 2009 at 02:14:28PM -0600, Tim St. Clair wrote: Do all files *have* to be present during generation? Or is there some lazy evaluation? Look at the GENERATED property for source files. The file it is looking for is one of many gen'd files. It would be a pain if I had to update all the command outputs in order to create the deps. Having well-constructed links between command outputs and dependencies sounds like a really good idea to me. Yes, it's even necessary. If your add_custom_commands() don't list all the files they generate and if not all generated files are listed as sources for the target which needs them then the dependencies will be incomplete, and builds (or at least parallel builds) will break. Alex -- Cheers, Timothy St. Clair ___ 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
[CMake] Cannot find source file.
Do all files *have* to be present during generation? Or is there some lazy evaluation? The file it is looking for is one of many gen'd files. It would be a pain if I had to update all the command outputs in order to create the deps. -- Cheers, Timothy St. Clair ___ 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
Re: [CMake] Cannot find source file.
On Thu, Dec 10, 2009 at 02:14:28PM -0600, Tim St. Clair wrote: Do all files *have* to be present during generation? Or is there some lazy evaluation? Look at the GENERATED property for source files. The file it is looking for is one of many gen'd files. It would be a pain if I had to update all the command outputs in order to create the deps. Having well-constructed links between command outputs and dependencies sounds like a really good idea to me. tyler ___ 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
Re: [CMake] Cannot find source file.
On Thursday 10 December 2009, Tyler Roscoe wrote: On Thu, Dec 10, 2009 at 02:14:28PM -0600, Tim St. Clair wrote: Do all files *have* to be present during generation? Or is there some lazy evaluation? Look at the GENERATED property for source files. The file it is looking for is one of many gen'd files. It would be a pain if I had to update all the command outputs in order to create the deps. Having well-constructed links between command outputs and dependencies sounds like a really good idea to me. Yes, it's even necessary. If your add_custom_commands() don't list all the files they generate and if not all generated files are listed as sources for the target which needs them then the dependencies will be incomplete, and builds (or at least parallel builds) will break. Alex ___ 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
[CMake] Cmake cannot find source file / Cmake can not determine linker language
Simply, in a subdirectory: ADD_LIBRARY (sift_h common.hxx) and altho the file common.hpp is there, he returns 'Cmake cannot find source file .../.../common.hxx for target sift_h tried extensions ... .hpp ...' if i change the CMakeLists in that subdirectory to ADD_LIBRARY (sift_h common.hpp) he doesn't complain at first, but when Ok is clicked 'Cmake can not determine linker language for target:sift_h' .. wth? the CMakeLists in ROOT is PROJECT (SIFT) ADD_SUBDIRECTORY (includes) ADD_EXECUTABLE (siftpp main.cpp) TARGET_LINK_LIBRARIES (siftpp sift_h) -- Dario Figueira ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Cmake cannot find source file / Cmake can not determine linker language
I am guessing here, but I _think_ cmake really wants a .cpp/cxx/c file instead of a header file. -- Mike Jackson Senior Research Engineer Innovative Management Technology Services On Feb 29, 2008, at 11:21 AM, Dario Figueira wrote: ADD_LIBRARY (sift_h common.hpp) ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake