CMake fixes

This commit is contained in:
IlyaShurupov 2023-10-27 15:33:33 +03:00
parent b7a89b714e
commit 5a55011911
19 changed files with 82 additions and 168 deletions

View file

@ -1,8 +1,3 @@
cmake_minimum_required(VERSION 3.2)
set(CMAKE_CXX_STANDARD 23)
project(Parser)
### ---------------------- Static Library --------------------- ###
@ -13,7 +8,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC ./public/)
target_link_libraries(${PROJECT_NAME} PUBLIC Tokenizer)
### -------------------------- Applications -------------------------- ###
add_executable(cfg ./applications/Cfg.cpp )
add_executable(cfg ./applications/Cfg.cpp)
target_link_libraries(cfg ${PROJECT_NAME} CommandLine)
configure_file(rsc/grammar.txt grammar.txt COPYONLY)
@ -22,7 +17,5 @@ configure_file(rsc/grammar.txt grammar.txt COPYONLY)
enable_testing()
file(GLOB TEST_SOURCES "./tests/*.cpp")
add_executable(${PROJECT_NAME}Tests ${TEST_SOURCES})
target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} Utils)
add_test(NAME ${PROJECT_NAME}Tests COMMAND ${PROJECT_NAME}Tests)
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib)
target_link_libraries(${PROJECT_NAME}Tests ${PROJECT_NAME} Utils)
add_test(NAME ${PROJECT_NAME}Tests COMMAND ${PROJECT_NAME}Tests)