cmake_minimum_required( VERSION 2.8 ) set(CMAKE_BUILD_TYPE Release) project (ssl CXX) find_package(PkgConfig) pkg_check_modules(ALSA alsa REQUIRED) add_executable (my_exe sound-source-loc.cpp) target_link_libraries (my_exe ${ALSA_LIBRARIES}) target_compile_options(my_exe PUBLIC ${ALSA_CFLAGS_OTHER}) target_include_directories(my_exe PUBLIC ${ALSA_INCLUDE_DIRS}) #set_target_properties(my_exe PROPERTIES LINKER_LANGUAGE C) #add_library(asoundlib.h STATIC IMPORTED /usr/include/alsa) #target_include_directories(my_exe PUBLIC ${LIBASOUND2-DEV_INCLUDE_DIRS}) install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/my_exe DESTINATION bin RENAME ${CMAKE_PROJECT_NAME}-my_exe)