Install step

This commit is contained in:
Robin Jadoul 2017-01-30 16:21:31 +01:00
parent 0f6f923666
commit f4f9de8391
4 changed files with 26 additions and 7 deletions

View File

@ -78,7 +78,7 @@ include_directories(${G3LOG_INCLUDE_DIR})
find_package(Lexesis QUIET) find_package(Lexesis QUIET)
if (NOT LEXESIS_FOUND) if (NOT LEXESIS_FOUND)
ExternalProject_Add(ext-lexesis ExternalProject_Add(ext-lexesis
GIT_REPOSITORY git@gitlab.com:Robin_Jadoul/Lexesis.git GIT_REPOSITORY https://gitlab.com/Robin_Jadoul/Lexesis.git
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=. CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=.
) )
add_library(templ IMPORTED STATIC GLOBAL) add_library(templ IMPORTED STATIC GLOBAL)
@ -157,8 +157,6 @@ if(DOXYGEN_FOUND)
add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation" VERBATIM) add_custom_target(doc ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Generating API documentation" VERBATIM)
endif(DOXYGEN_FOUND) endif(DOXYGEN_FOUND)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}")
##Warning level ##Warning level
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
@ -179,3 +177,7 @@ install(DIRECTORY templates
install(DIRECTORY include/Parsodus install(DIRECTORY include/Parsodus
DESTINATION include) DESTINATION include)
install(EXPORT ParsodusTargets DESTINATION lib/cmake/Parsodus)
install(FILES cmake/ParsodusConfig.cmake DESTINATION lib/cmake/Parsodus)
install(DIRECTORY man/man1 man/man5 DESTINATION man)

View File

@ -52,10 +52,9 @@ Get your terminal in the source tree and run the following commands:
cd build cd build
cmake .. cmake ..
make make
make install sudo make install
This will place the Parsodus executable in the `build/bin` folder, with some extra needed data for Parsodus in `build/share` You can now simply run `Parsodus` with the arguments you like (see below and in the man pages for an overview).
You can now simply run `./bin/Parsodus` with the arguments you like (see below and in the man pages for an overview).
If you want to build the documentation as well, simply run If you want to build the documentation as well, simply run
@ -65,6 +64,18 @@ The output should be located in `build/doc`, with the main *html* page in `build
### Running tests ### Running tests
First, build Parsodus in debug mode. The first difference with the normal building, is the line where you call cmake. That line should read
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=.
instead. Afterwards, after calling make install (which now installs locally in the build folder, so you don't need the sudo), build all the examples as well with
cmake .
make examples
since they are used to test the functionality of the generated parsers.
To run the unit tests: simply run `make test` To run the unit tests: simply run `make test`
To run the tests for the generated parser: build the examples and run `python3 ./run_tests.py` in the project root To run the tests for the generated parser: build the examples and run `python3 ./run_tests.py` in the project root

View File

@ -0,0 +1,5 @@
get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${SELF_DIR}/ParsodusTargets.cmake)
get_filename_component(PARSODUS_INCLUDE_DIRS "${SELF_DIR}/../../../include/" ABSOLUTE)
get_filename_component(PARSODUS_EXE "${SELF_DIR}/../../../bin/Parsodus" ABSOLUTE)
set(PARSODUS_FOUND TRUE)

View File

@ -55,9 +55,10 @@ target_link_libraries(Parsodus
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
) )
install(TARGETS Parsodus pds Parsodus-util Parsodus-tables install(TARGETS Parsodus pds Parsodus-util Parsodus-tables EXPORT ParsodusTargets
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib ARCHIVE DESTINATION lib
INCLUDES DESTINATION include
) )