mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-04-03 01:12:08 +00:00
Update CMake related files
This commit is contained in:
parent
50ea4b05e9
commit
5ef7180a12
@ -23,6 +23,7 @@ target_include_directories(peglib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|||||||
option(BUILD_TESTS "Build cpp-peglib tests" ON)
|
option(BUILD_TESTS "Build cpp-peglib tests" ON)
|
||||||
option(PEGLIB_BUILD_LINT "Build cpp-peglib lint utility" OFF)
|
option(PEGLIB_BUILD_LINT "Build cpp-peglib lint utility" OFF)
|
||||||
option(PEGLIB_BUILD_EXAMPLES "Build cpp-peglib examples" OFF)
|
option(PEGLIB_BUILD_EXAMPLES "Build cpp-peglib examples" OFF)
|
||||||
|
option(PEGLIB_BUILD_PL0 "Build pl0 interpreter" OFF)
|
||||||
|
|
||||||
if (${BUILD_TESTS})
|
if (${BUILD_TESTS})
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
@ -37,4 +38,8 @@ if (${PEGLIB_BUILD_EXAMPLES})
|
|||||||
add_subdirectory(example)
|
add_subdirectory(example)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (${PEGLIB_BUILD_PL0})
|
||||||
|
add_subdirectory(pl0)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(FILES peglib.h DESTINATION include)
|
install(FILES peglib.h DESTINATION include)
|
||||||
|
@ -1,34 +1,42 @@
|
|||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(example)
|
project(example)
|
||||||
|
|
||||||
include_directories(..)
|
|
||||||
|
|
||||||
add_executable(calc calc.cc)
|
add_executable(calc calc.cc)
|
||||||
|
target_include_directories(calc PRIVATE ..)
|
||||||
target_link_libraries(calc ${add_link_deps})
|
target_link_libraries(calc ${add_link_deps})
|
||||||
|
|
||||||
add_executable(calc2 calc2.cc)
|
add_executable(calc2 calc2.cc)
|
||||||
|
target_include_directories(calc2 PRIVATE ..)
|
||||||
target_link_libraries(calc2 ${add_link_deps})
|
target_link_libraries(calc2 ${add_link_deps})
|
||||||
|
|
||||||
add_executable(calc3 calc3.cc)
|
add_executable(calc3 calc3.cc)
|
||||||
|
target_include_directories(calc3 PRIVATE ..)
|
||||||
target_link_libraries(calc3 ${add_link_deps})
|
target_link_libraries(calc3 ${add_link_deps})
|
||||||
|
|
||||||
add_executable(calc4 calc4.cc)
|
add_executable(calc4 calc4.cc)
|
||||||
|
target_include_directories(calc4 PRIVATE ..)
|
||||||
target_link_libraries(calc4 ${add_link_deps})
|
target_link_libraries(calc4 ${add_link_deps})
|
||||||
|
|
||||||
add_executable(calc5 calc5.cc)
|
add_executable(calc5 calc5.cc)
|
||||||
|
target_include_directories(calc5 PRIVATE ..)
|
||||||
target_link_libraries(calc5 ${add_link_deps})
|
target_link_libraries(calc5 ${add_link_deps})
|
||||||
|
|
||||||
add_executable(indent indent.cc)
|
add_executable(indent indent.cc)
|
||||||
|
target_include_directories(indent PRIVATE ..)
|
||||||
target_link_libraries(indent ${add_link_deps})
|
target_link_libraries(indent ${add_link_deps})
|
||||||
|
|
||||||
add_executable(docx docx.cc)
|
add_executable(docx docx.cc)
|
||||||
|
target_include_directories(docx PRIVATE ..)
|
||||||
target_link_libraries(docx ${add_link_deps})
|
target_link_libraries(docx ${add_link_deps})
|
||||||
|
|
||||||
add_executable(sequence sequence.cc)
|
add_executable(sequence sequence.cc)
|
||||||
|
target_include_directories(sequence PRIVATE ..)
|
||||||
target_link_libraries(sequence ${add_link_deps})
|
target_link_libraries(sequence ${add_link_deps})
|
||||||
|
|
||||||
add_executable(enter_leave enter_leave.cc)
|
add_executable(enter_leave enter_leave.cc)
|
||||||
|
target_include_directories(enter_leave PRIVATE ..)
|
||||||
target_link_libraries(enter_leave ${add_link_deps})
|
target_link_libraries(enter_leave ${add_link_deps})
|
||||||
|
|
||||||
add_executable(choice choice.cc)
|
add_executable(choice choice.cc)
|
||||||
|
target_include_directories(choice PRIVATE ..)
|
||||||
target_link_libraries(choice ${add_link_deps})
|
target_link_libraries(choice ${add_link_deps})
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(peglint)
|
project(peglint)
|
||||||
|
|
||||||
include_directories(..)
|
|
||||||
|
|
||||||
add_executable(peglint peglint.cc)
|
add_executable(peglint peglint.cc)
|
||||||
|
target_include_directories(peglint PRIVATE ..)
|
||||||
target_link_libraries(peglint ${add_link_deps})
|
target_link_libraries(peglint ${add_link_deps})
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
/Users/yhirose/Projects/cpp-peglib/.travis.yml
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(pl0)
|
project(pl0)
|
||||||
|
|
||||||
include_directories(..)
|
find_package(LLVM REQUIRED CONFIG)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter")
|
||||||
|
|
||||||
add_executable(pl0 pl0.cc)
|
add_executable(pl0 pl0.cc)
|
||||||
find_package(LLVM REQUIRED CONFIG)
|
|
||||||
set(add_link_deps ${add_link_deps} LLVM)
|
set(add_link_deps ${add_link_deps} LLVM)
|
||||||
target_include_directories(pl0 PUBLIC ${LLVM_INCLUDE_DIRS})
|
target_include_directories(pl0 PUBLIC ${LLVM_INCLUDE_DIRS})
|
||||||
|
target_include_directories(pl0 PRIVATE ..)
|
||||||
target_link_libraries(pl0 ${add_link_deps})
|
target_link_libraries(pl0 ${add_link_deps})
|
||||||
|
@ -4,7 +4,7 @@ project(test)
|
|||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
googletest
|
googletest
|
||||||
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
|
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
|
||||||
)
|
)
|
||||||
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
# For Windows: Prevent overriding the parent project's compiler/linker settings
|
||||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||||
|
Loading…
Reference in New Issue
Block a user