Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 56a64f6

Browse files
committed
Fixing CMake build
1 parent 00e5a8b commit 56a64f6

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

CMakeLists.txt

+30-23
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,47 @@
11
cmake_minimum_required(VERSION 3.0)
22

33
project(jsgfkitxx
4-
VERSION 1.0
5-
LANGUAGES CXX)
4+
VERSION 1.1
5+
LANGUAGES CXX
6+
)
7+
8+
set(JSGF_KIT_XX_SOURCES
9+
src/grammar.cpp
10+
src/expansion.cpp
11+
src/rule.cpp
12+
src/matchinfo.cpp
13+
src/matchresult.cpp
14+
src/tag.cpp
15+
src/unparsedsection.cpp
16+
src/kleenestar.cpp
17+
src/plusoperator.cpp
18+
src/optionalgrouping.cpp
19+
src/requiredgrouping.cpp
20+
src/sequence.cpp
21+
src/alternativeset.cpp
22+
src/token.cpp
23+
src/rulereference.cpp
24+
)
25+
26+
add_library(jsgfkitxx STATIC ${JSGF_KIT_XX_SOURCES})
27+
target_include_directories(jsgfkitxx PUBLIC ${PROJECT_SOURCE_DIR}/include)
628

729
include(GNUInstallDirs)
830

9-
option(ENABLE_DEBUG "Enables debugging messages" OFF)
10-
11-
set(KIT_SOURCES src/grammar.cpp src/expansion.cpp src/rule.cpp src/matchinfo.cpp src/matchresult.cpp src/tag.cpp
12-
src/unparsedsection.cpp src/kleenestar.cpp src/plusoperator.cpp
13-
src/optionalgrouping.cpp src/requiredgrouping.cpp src/sequence.cpp
14-
src/alternativeset.cpp src/token.cpp src/rulereference.cpp)
15-
16-
set(KIT_HEADERS include/rule.h include/expansion.h include/grammar.h
17-
include/unparsedsection.h include/kleenestar.h
18-
include/alternativeset.h include/token.h include/tag.h include/matchinfo.h
19-
include/matchresult.h include/sequence.h include/plusoperator.h include/requiredgrouping.h
20-
include/optionalgrouping.h include/rulereference.h)
21-
22-
add_library(jsgfkit STATIC ${KIT_SOURCES})
23-
target_include_directories(jsgfkit PUBLIC ${PROJECT_BINARY_DIR}/include)
24-
2531
#Set variables for the .pc file
2632
set(prefix "${CMAKE_INSTALL_PREFIX}")
2733
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
2834
set(libdir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
2935
set(includedir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}")
30-
configure_file(jsgfkit.pc.in jsgfkit.pc @ONLY)
36+
configure_file(jsgfkitxx.pc.in jsgfkitxx.pc @ONLY)
3137

32-
install(TARGETS jsgfkit
33-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
38+
install(TARGETS jsgfkitxx
39+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
40+
)
3441

35-
install(FILES ${KIT_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jsgfkit)
42+
install(FILES ${KIT_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/jsgfkitxx)
3643

37-
install(FILES jsgfkit.pc DESTINATION ${CMAKE_INSTALL_DATAROOT_DIR}/pkgconfig)
44+
install(FILES jsgfkitxx.pc DESTINATION ${CMAKE_INSTALL_DATAROOT_DIR}/pkgconfig)
3845

3946
# Build Tests
4047
enable_testing ()

jsgfkit.pc.in renamed to jsgfkitxx.pc.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ exec_prefix=@exec_prefix@
33
libdir=@libdir@
44
includedir=@includedir@
55

6-
Name: jsgfkit
6+
Name: jsgfkitxx
77
Description: A C++ library for parsing and manipulating Java Speech Grammar Format files.
88
Version: 1.0
9-
Cflags: -I${includedir}/jsgfkit
10-
Libs: -L${libdir} -ljsgfkit
9+
Cflags: -I${includedir}/jsgfkitxx
10+
Libs: -L${libdir} -ljsgfkitxx

test/CMakeLists.txt

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11

2-
add_executable(parsetest ParseAndOutputJSGF.cpp)
3-
target_link_libraries(parsetest jsgfkit)
4-
target_include_directories(jsgfkit PUBLIC ${PROJECT_BINARY_DIR}/include)
2+
add_executable(parse-test ParseAndOutputJSGF.cpp)
3+
target_link_libraries(parse-test PRIVATE jsgfkitxx)
4+
target_include_directories(parse-test
5+
PUBLIC ${PROJECT_BINARY_DIR}/include
6+
)
57

6-
add_executable(expansiontypetest ExpansionTypeTest.cpp)
7-
target_link_libraries(expansiontypetest jsgfkit)
8-
target_include_directories(jsgfkit PUBLIC ${PROJECT_BINARY_DIR}/include)
8+
add_executable(expansion-type-test ExpansionTypeTest.cpp)
9+
target_link_libraries(expansion-type-test PRIVATE jsgfkitxx)
10+
target_include_directories(expansion-type-test
11+
PUBLIC ${PROJECT_BINARY_DIR}/include
12+
)
913

0 commit comments

Comments
 (0)