Skip to content
This repository was archived by the owner on Jun 9, 2022. It is now read-only.

Commit 7ddab2c

Browse files
author
syb0rg
committed
Fix compilation of library & programs
1 parent e7c2e5a commit 7ddab2c

File tree

6 files changed

+55
-18
lines changed

6 files changed

+55
-18
lines changed

CMakeLists.txt

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ PROJECT(${PROJECT_NAME})
88

99
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
1010
SET_DIRECTORY_PROPERTIES(PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/build-data)
11+
set(CMAKE_MACOSX_RPATH TRUE)
1112

1213
#
1314
# Setup compiler flags
@@ -29,17 +30,20 @@ INCLUDE_DIRECTORIES(include)
2930
ADD_SUBDIRECTORY(src)
3031
ADD_SUBDIRECTORY(test EXCLUDE_FROM_ALL)
3132

32-
ADD_LIBRARY(${PROJECT_NAME} STATIC
33+
ADD_LIBRARY(${PROJECT_NAME}_static STATIC
3334
$<TARGET_OBJECTS:libsphinxad>
3435
$<TARGET_OBJECTS:fe>
3536
$<TARGET_OBJECTS:feat>
3637
$<TARGET_OBJECTS:lm>
3738
$<TARGET_OBJECTS:util>
38-
$<TARGET_OBJECTS:sphinx_adtools>
39-
$<TARGET_OBJECTS:sphinx_cepview>
40-
$<TARGET_OBJECTS:sphinx_fe>
41-
$<TARGET_OBJECTS:sphinx_jsgf2fsg>
42-
$<TARGET_OBJECTS:sphinx_lmtools>
4339
)
4440

41+
ADD_LIBRARY(${PROJECT_NAME} SHARED
42+
$<TARGET_OBJECTS:libsphinxad>
43+
$<TARGET_OBJECTS:fe>
44+
$<TARGET_OBJECTS:feat>
45+
$<TARGET_OBJECTS:lm>
46+
$<TARGET_OBJECTS:util>
47+
)
48+
4549
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIBS})

src/sphinx_adtools/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
SET(SOURCES cont_seg.c
2-
sphinx_pitch.c
1+
set(PROGRAMS cont_seg
2+
sphinx_pitch
33
)
4-
5-
add_library(sphinx_adtools OBJECT ${SOURCES})
4+
5+
foreach (program ${PROGRAMS})
6+
add_executable(${program} ${program})
7+
target_link_libraries(${program} ${PROJECT_NAME})
8+
set_target_properties (${program}
9+
PROPERTIES
10+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
11+
)
12+
endforeach ()

src/sphinx_cepview/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
set(PROGRAM sphinx_cepview)
2+
13
SET(SOURCES main_cepview.c)
24

3-
add_library(sphinx_cepview OBJECT ${SOURCES})
5+
add_executable(${PROGRAM} ${SOURCES})
6+
target_link_libraries(${PROGRAM} ${PROJECT_NAME})
7+
set_target_properties (${PROGRAM}
8+
PROPERTIES
9+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
10+
)

src/sphinx_fe/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
SET(SOURCES sphinx_fe.c)
1+
set(PROGRAM sphinx_fe)
2+
set(SOURCES sphinx_fe.c)
23

3-
add_library(sphinx_fe OBJECT ${SOURCES})
4+
add_executable(${PROGRAM} ${SOURCES})
5+
target_link_libraries(${PROGRAM} ${PROJECT_NAME})
6+
set_target_properties (${PROGRAM}
7+
PROPERTIES
8+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
9+
)

src/sphinx_jsgf2fsg/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
SET(SOURCES main.c)
1+
set(PROGRAM sphinx_jsgf2fsg)
2+
set(SOURCES main.c)
23

3-
add_library(sphinx_jsgf2fsg OBJECT ${SOURCES})
4+
add_executable(${PROGRAM} ${SOURCES})
5+
target_link_libraries(${PROGRAM} ${PROJECT_NAME})
6+
set_target_properties (${PROGRAM}
7+
PROPERTIES
8+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
9+
)

src/sphinx_lmtools/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
SET(SOURCES sphinx_lm_convert.c
2-
sphinx_lm_eval.c
1+
set(PROGRAMS sphinx_lm_convert.c
2+
sphinx_lm_eval.c
33
)
44

5-
add_library(sphinx_lmtools OBJECT ${SOURCES})
5+
foreach (program ${PROGRAMS})
6+
add_executable(${program} ${program})
7+
target_link_libraries(${program} ${PROJECT_NAME})
8+
set_target_properties (${program}
9+
PROPERTIES
10+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
11+
)
12+
endforeach ()

0 commit comments

Comments
 (0)