Fixed link and load errors in example, added exception (rather than segfault) if file not found.

release/4.3a0
Frank Dellaert 2012-05-15 01:01:31 +00:00
parent f7349704f8
commit 33cdd30173
4 changed files with 8 additions and 4 deletions

View File

@ -24,8 +24,8 @@ gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_fu
# add examples
foreach(example schedulingExample schedulingQuals12)
add_executable(${example} "examples/${example}.cpp")
add_dependencies(${example} gtsam-static)
target_link_libraries(${example} gtsam-static)
add_dependencies(${example} gtsam-static gtsam_unstable-static)
target_link_libraries(${example} gtsam-static gtsam_unstable-static)
add_custom_target(${example}.run ${EXECUTABLE_OUTPUT_PATH}${example} ${ARGN})
endforeach(example)

View File

@ -29,6 +29,10 @@ namespace gtsam {
// open file
ifstream is(filename.c_str());
if (!is) {
cerr << "Scheduler: could not open file " << filename << endl;
throw runtime_error("Scheduler: could not open file " + filename);
}
string line; // buffer

View File

@ -53,7 +53,7 @@ void addStudent(Scheduler& s, size_t i) {
}
/* ************************************************************************* */
Scheduler largeExample(size_t nrStudents = 7) {
string path("/Users/dellaert/borg/gtsam/gtsam/discrete/examples/");
string path("../../../gtsam_unstable/discrete/examples/");
Scheduler s(nrStudents, path + "Doodle.csv");
s.addArea("Harvey Lipkin", "Mechanics");

View File

@ -65,7 +65,7 @@ void addStudent(Scheduler& s, size_t i) {
/* ************************************************************************* */
Scheduler largeExample(size_t nrStudents = NRSTUDENTS) {
string path("/Users/dellaert/borg/gtsam/gtsam/discrete/examples/");
string path("../../../gtsam_unstable/discrete/examples/");
Scheduler s(nrStudents, path + "Doodle2012.csv");
s.addArea("Harvey Lipkin", "Mechanics");