tests: Use errno value rather than a specific int
[vpp.git] / src / cmake / exec.cmake
index b8277fa..3ccbeee 100644 (file)
 
 macro(add_vpp_executable exec)
   cmake_parse_arguments(ARG
-    "ENABLE_EXPORTS"
+    "ENABLE_EXPORTS;NO_INSTALL"
     ""
     "SOURCES;LINK_LIBRARIES;DEPENDS"
     ${ARGN}
   )
 
   add_executable(${exec} ${ARG_SOURCES})
+  target_compile_options(${exec} PUBLIC ${VPP_DEFAULT_MARCH_FLAGS})
   if(ARG_LINK_LIBRARIES)
     target_link_libraries(${exec} ${ARG_LINK_LIBRARIES})
   endif()
@@ -29,6 +30,8 @@ macro(add_vpp_executable exec)
   if(ARG_DEPENDS)
     add_dependencies(${exec} ${ARG_DEPENDS})
   endif()
-  install(TARGETS ${exec} DESTINATION bin)
+  if(NOT ARG_NO_INSTALL)
+    install(TARGETS ${exec} DESTINATION ${VPP_RUNTIME_DIR})
+  endif()
 endmacro()