Commit b52b516f authored by Dr. Carsten Kemena's avatar Dr. Carsten Kemena
Browse files

update cmakefile, fixed error messages when using makeradsdb

parent 0ddec15f
Pipeline #117100 failed with stages
in 1 minute and 5 seconds
cmake_minimum_required(VERSION 3.0)
project (RADS LANGUAGES CXX VERSION 3.0.1)
SET(MAJOR_VERSION 3)
SET(MINOR_VERSION 0)
SET(PATCH_VERSION 1)
project (RADS LANGUAGES CXX VERSION 3.0.2)
SET(CMAKE_CXX_FLAGS_COVERAGE
......@@ -56,9 +54,9 @@ set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
# boost
if (WITH_UNIT_TEST)
FIND_PACKAGE(Boost 1.54 COMPONENTS system program_options iostreams filesystem regex unit_test_framework REQUIRED)
FIND_PACKAGE(Boost 1.65 COMPONENTS system program_options iostreams filesystem regex unit_test_framework REQUIRED)
else (WITH_UNIT_TEST)
FIND_PACKAGE(Boost 1.54 COMPONENTS system program_options iostreams filesystem regex REQUIRED)
FIND_PACKAGE(Boost 1.65 COMPONENTS system program_options iostreams filesystem regex REQUIRED)
endif (WITH_UNIT_TEST)
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIR})
......@@ -68,11 +66,11 @@ ADD_DEFINITIONS( "-DHAS_BOOST" )
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmakeConfig")
find_package(sqlite3 REQUIRED)
if (SQLITE3_FOUND)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
link_directories(${SQLITE3_LIBRARY_DIRS})
endif (SQLITE3_FOUND)
find_package(SQLite3 REQUIRED)
if (SQLite3_FOUND)
INCLUDE_DIRECTORIES(${SQLite3_INCLUDE_DIR})
link_directories(${SQLite3_LIBRARY_DIRS})
endif (SQLite3_FOUND)
find_package (Threads REQUIRED)
......@@ -102,14 +100,14 @@ SET(rads_src ${PROJECT_SOURCE_DIR}/src/rads.cpp ${PROJECT_SOURCE_DIR}/src/DBAcce
SET(rads_exe rads )
ADD_EXECUTABLE(${rads_exe} ${rads_src})
target_link_libraries(${rads_exe}
${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES} ${SQLite3_LIBRARY} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}
)
SET(makeDB_src ${PROJECT_SOURCE_DIR}/src/makeRadsDB.cpp ${PROJECT_SOURCE_DIR}/src/external/SQLiteDB.cpp ${PROJECT_SOURCE_DIR}/src/DBCreator.cpp ${BSDL_src})
SET(makeDB_exe makeRadsDB)
ADD_EXECUTABLE(${makeDB_exe} ${makeDB_src})
target_link_libraries(${makeDB_exe}
${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES}
${Boost_LIBRARIES} ${SQLite3_LIBRARY} ${ZLIB_LIBRARIES}
)
if (WITH_UNIT_TEST)
......
#define QUOTE(x) #x
#define STR(x) QUOTE(x)
#ifndef VERSION_HPP
#define VERSION_HPP
#define MAJOR_VERSION @MAJOR_VERSION@
#define MINOR_VERSION @MINOR_VERSION@
#define PATCH_VERSION @PATCH_VERSION@
#define MAJOR_VERSION "@PROJECT_VERSION_MAJOR@"
#define MINOR_VERSION "@PROJECT_VERSION_MINOR@"
#define PATCH_VERSION "@PROJECT_VERSION_PATCH@"
#endif // VERSION_HPP
......@@ -63,7 +63,7 @@ main(int argc, char *argv[])
input_command += " ";
}
std::string version(std::string(STR(MAJOR_VERSION)) + "." + std::string(STR(MINOR_VERSION)) + "." + std::string(STR(PATCH_VERSION)));
std::string version(std::string(MAJOR_VERSION) + "." + std::string(MINOR_VERSION) + "." + std::string(PATCH_VERSION));
po::options_description allOpts("makeRadsDB " + version + " (C) 2016-2018 Carsten Kemena\nThis program comes with ABSOLUTELY NO WARRANTY;\n\nAllowed options are displayed below.");
fs::path interProFile;
......@@ -99,14 +99,19 @@ main(int argc, char *argv[])
cout << allOpts<< "\n";
return EXIT_SUCCESS;
}
po::notify(vm);
if ((!interProFile.empty()) && (database.empty()))
{
throw boost::program_options::error("Error! You need to specify the database to use when providing an InterPro file!");
}
if (!vm.count("InterPro") && !vm.count("input"))
{
throw boost::program_options::error("Error! At least one input file using either '-i/--input' or '-I/--InterPro' needs to be provided!");
}
po::notify(vm);
}
catch (boost::program_options::error &e)
{
......
......@@ -114,7 +114,7 @@ printResult(const RadsQueryResult &results, BSDL::Output &outS, bool listAlignme
int
main(int argc, char *argv[])
{
std::string version(std::string(STR(MAJOR_VERSION)) + "." + std::string(STR(MINOR_VERSION)) + "." + std::string(STR(PATCH_VERSION)) );
std::string version(std::string(MAJOR_VERSION) + "." + std::string(MINOR_VERSION) + "." + std::string(PATCH_VERSION));
fs::path queryDomainFile, querySeqFile, outFile, domainDB;
bool listAlignments;
fs::path prefix;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment