Skip to content

Commit

Permalink
build command line client only when using Debug build mode
Browse files Browse the repository at this point in the history
  • Loading branch information
thekvs committed Jan 31, 2017
1 parent 2183a6d commit 9f5469b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif()

set(TARGET_VERSION_MAJOR 0)
set(TARGET_VERSION_MINOR 2)
set(TARGET_VERSION_PATCH 10)
set(TARGET_VERSION_PATCH 11)
set(APP_VERSION "${TARGET_VERSION_MAJOR}.${TARGET_VERSION_MINOR}.${TARGET_VERSION_PATCH}")

add_subdirectory(src)
Expand Down
52 changes: 30 additions & 22 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,37 @@ target_compile_definitions(radiotray-lite PRIVATE -DELPP_DISABLE_DEFAULT_CRASH_H
target_compile_definitions(radiotray-lite PRIVATE -DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
target_compile_definitions(radiotray-lite PRIVATE -DAPP_VERSION="${APP_VERSION}")

add_executable(
radiotray-lite-cli
radiotray-lite-cli.cpp
player.cpp
playlist.cpp
config.cpp
${PLAYLIST_DECODERS}
${THIRD_PARTY}
)
target_link_libraries(
radiotray-lite-cli
${LIBXML2_LIBRARIES}
${GSTREAMERMM_LIBRARIES}
${CURL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
set_target_properties(radiotray-lite-cli PROPERTIES COMPILE_FLAGS "-std=c++11")
target_compile_definitions(radiotray-lite-cli PRIVATE -DELPP_DISABLE_DEFAULT_CRASH_HANDLING)
target_compile_definitions(radiotray-lite-cli PRIVATE -DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
target_compile_definitions(radiotray-lite-cli PRIVATE -DAPP_VERSION="${APP_VERSION}")

install(
TARGETS radiotray-lite radiotray-lite-cli
TARGETS radiotray-lite
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_executable(
radiotray-lite-cli
radiotray-lite-cli.cpp
player.cpp
playlist.cpp
config.cpp
${PLAYLIST_DECODERS}
${THIRD_PARTY}
)
target_link_libraries(
radiotray-lite-cli
${LIBXML2_LIBRARIES}
${GSTREAMERMM_LIBRARIES}
${CURL_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)
set_target_properties(radiotray-lite-cli PROPERTIES COMPILE_FLAGS "-std=c++11")
target_compile_definitions(radiotray-lite-cli PRIVATE -DELPP_DISABLE_DEFAULT_CRASH_HANDLING)
target_compile_definitions(radiotray-lite-cli PRIVATE -DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
target_compile_definitions(radiotray-lite-cli PRIVATE -DAPP_VERSION="${APP_VERSION}")

install(
TARGETS radiotray-lite-cli
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
endif()

0 comments on commit 9f5469b

Please sign in to comment.