#Uncomment the following two lines to compile the sources as an individual cmake porject. Change the as you wanted. #cmake_minimum_required(VERSION 3.15.2) #project() #Set executable name here set(name sh2xyz) aux_source_directory(. "${name}_src") add_executable(${name} ${${name}_src}) set_target_properties(${name} PROPERTIES CXX_STANDARD 11) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) install(TARGETS ${name} RUNTIME DESTINATION sbin) #Find and link openmp library find_package(OpenMP REQUIRED) if (OpenMP_CXX_FOUND) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") endif() target_link_libraries(${name} PUBLIC OpenMP::OpenMP_CXX)