smanders / externpro

build external projects with cmake
MIT License
13 stars 12 forks source link

lua executables added to targets file #351

Closed smanders closed 2 years ago

smanders commented 2 years ago

the lua executables (lua and luac) should be added to the targets file so we aren't jumping through hoops like the following https://isrhub.usurf.usu.edu/bdecker/PluginLibraries/blob/7e863e08ace10c1748e1367f732b3d211bdb0467/LuaLib/test/CMakeLists.txt

xpGetPkgVar(Lua VER) # sets LUA_VER
set(test_name ${lib_name}Test)
########################
set(${test_name}_srcs 
  test.lua
  )

string(REPLACE " [externpro]" "" luaVersion ${LUA_VER})
set(LUA_EXE ${externpro_DIR}/bin/lua_${luaVersion}${CMAKE_EXECUTABLE_SUFFIX})
add_test(
  NAME ${test_name}
  COMMAND ${LUA_EXE} test.lua
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  )
xpSourceListAppend("${${test_name}_srcs}")
smanders commented 2 years ago

completed with commits referenced above