-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
39 lines (30 loc) · 1013 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.12)
project(jparser)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS "-O3 -g")
set(JPARSER_VERSION 0.1.0)
get_filename_component(JPARSER_INSTALL_DIR ${CMAKE_INSTALL_PREFIX} ABSOLUTE)
add_library(jparser STATIC
src/AST.cpp
src/Matcher.cpp
src/Scanner.cpp
src/StringVisitor.cpp
)
target_include_directories(jparser PUBLIC include)
configure_file(enable.in ${CMAKE_SOURCE_DIR}/enable @ONLY)
configure_file(jparser.pc.in ${CMAKE_BINARY_DIR}/jparser.pc @ONLY)
install(TARGETS jparser DESTINATION lib)
install(DIRECTORY include DESTINATION .)
install(FILES ${CMAKE_BINARY_DIR}/jparser.pc DESTINATION lib/pkgconfig)
add_custom_target(
CompileCommands ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink
${CMAKE_BINARY_DIR}/compile_commands.json
${CMAKE_SOURCE_DIR}/compile_commands.json
)
enable_testing()
add_subdirectory(tools)
add_subdirectory(tests)