Can only build by running cmake again after make
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Smoke-GObject |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Steps to reproduce:
1. Get a fresh checkout of smoke-gobject
2. cmake .
3. make
Expected outcome:
make succeeds
Actual outcome:
make fails with errors during linking of tests/helloworl
Linking CXX executable helloworld
CMakeFiles/
main.cpp:
main.cpp:
main.cpp:
main.cpp:
main.cpp:
main.cpp:
collect2: ld returned 1 exit status
make[2]: *** [tests/
Running cmake and then make again after this causes make to succeed.
This is caused by the use of FILE( GLOB ) for finding the sources for modules libraries. gtk/CMakeLists. txt: "FILE(GLOB GTK_CPP "${CMAKE_ CURRENT_ BINARY_ DIR}/*. cpp")"
in modules/
This glob is only evaluated at cmake time, and in the case of a clean build tree the generated sources does not exist. Consequently they are not compiled or linked into the library, and the majority of symbols are missing. This affects all the modules.
I could not find any way to tell cmake to use a glob that is evaluated at make time.
Other ideas on how to fix the issue:
- Run the gsmoke generator at cmake time with a flag to create the list of files that will be generated, and should be compiled into the library.
This requires the generator to be built before cmake happens in the modules. This can either be accomplished by separating out the modules into a separate repository, or by creating a make target that runs cmake and then make inside the modules.
Let the generator output the names of the files that will be generated