Skip to content

Commit 0c1ab10

Browse files
committed
CMake: fixed pkgconfig file install from sfizz-ui project
1 parent 899e988 commit 0c1ab10

File tree

3 files changed

+41
-12
lines changed

3 files changed

+41
-12
lines changed

clients/CMakeLists.txt

+31-9
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,43 @@ string(TIMESTAMP MAN_TODAY "%Y-%m-%d")
22

33
if(SFIZZ_JACK)
44
add_executable(sfizz_jack MidiHelpers.h jack_client.cpp)
5-
target_link_libraries(sfizz_jack PRIVATE sfizz::import sfizz::sfizz sfizz::jack sfizz::spin_mutex absl::flags_parse)
5+
target_link_libraries(sfizz_jack PRIVATE
6+
absl::flags_parse
7+
sfizz::import
8+
sfizz::jack
9+
sfizz::sfizz
10+
sfizz::spin_mutex
11+
)
612
sfizz_enable_lto_if_needed(sfizz_jack)
713
configure_file(sfizz_jack.man.in sfizz_jack.man @ONLY)
8-
install(TARGETS sfizz_jack DESTINATION ${CMAKE_INSTALL_BINDIR}
9-
COMPONENT "jack" OPTIONAL)
10-
install(FILES ${PROJECT_BINARY_DIR}/clients/sfizz_jack.man DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
11-
RENAME sfizz_jack.1 COMPONENT "jack" OPTIONAL)
14+
install(TARGETS sfizz_jack
15+
DESTINATION ${CMAKE_INSTALL_BINDIR}
16+
COMPONENT "jack" OPTIONAL
17+
)
18+
install(FILES ${PROJECT_BINARY_DIR}/clients/sfizz_jack.man
19+
RENAME sfizz_jack.1
20+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
21+
COMPONENT "jack" OPTIONAL
22+
)
1223
endif()
1324

1425
if(SFIZZ_RENDER)
1526
add_executable(sfizz_render MidiHelpers.h sfizz_render.cpp)
16-
target_link_libraries(sfizz_render PRIVATE sfizz::internal sfizz::fmidi sfizz::cxxopts st_audiofile_formats)
27+
target_link_libraries(sfizz_render PRIVATE
28+
sfizz::cxxopts
29+
sfizz::fmidi
30+
sfizz::internal
31+
st_audiofile_formats
32+
)
1733
sfizz_enable_lto_if_needed(sfizz_render)
1834
configure_file(sfizz_render.man.in sfizz_render.man @ONLY)
19-
install(TARGETS sfizz_render DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT "render" OPTIONAL)
20-
install(FILES ${PROJECT_BINARY_DIR}/clients/sfizz_render.man DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
21-
RENAME sfizz_render.1 COMPONENT "render" OPTIONAL)
35+
install(TARGETS sfizz_render
36+
DESTINATION ${CMAKE_INSTALL_BINDIR}
37+
COMPONENT "render" OPTIONAL
38+
)
39+
install(FILES ${PROJECT_BINARY_DIR}/clients/sfizz_render.man
40+
RENAME sfizz_render.1
41+
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
42+
COMPONENT "render" OPTIONAL
43+
)
2244
endif()

cmake/SfizzConfig.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1818
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
1919
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
2020

21+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library/lib)
22+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library/lib)
23+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/library/bin)
24+
2125
# Set C++ compatibility level
2226
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" AND CMAKE_CXX_STANDARD LESS 17)
2327
set(CMAKE_CXX_STANDARD 17)

src/CMakeLists.txt

+6-3
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,13 @@ if(SFIZZ_SHARED)
348348
if(SFIZZ_USE_SNDFILE)
349349
set(SFIZZ_PC_REQUIRES "${SFIZZ_PC_REQUIRES} sndfile")
350350
endif()
351-
configure_file(${PROJECT_SOURCE_DIR}/scripts/sfizz.pc.in sfizz.pc @ONLY)
352-
install(FILES ${CMAKE_BINARY_DIR}/src/sfizz.pc
351+
configure_file(${PROJECT_SOURCE_DIR}/scripts/sfizz.pc.in
352+
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pkgconfig/sfizz.pc @ONLY
353+
)
354+
install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/pkgconfig/sfizz.pc
353355
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
354-
COMPONENT "development")
356+
COMPONENT "development"
357+
)
355358
endif()
356359
endif()
357360

0 commit comments

Comments
 (0)