Skip to content

Commit

Permalink
Fix more nits with the CMake conversion
Browse files Browse the repository at this point in the history
- examples was missed entirely in the conversion
- fix cache paths to be relative to the install root

Signed-off-by: Kyle Evans <[email protected]>
  • Loading branch information
kevans91 committed Jan 24, 2024
1 parent ec74a93 commit e5e1d6b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ if(NOT LUA_FOUND)
message(FATAL_ERROR "No Lua installation found; please install Lua")
endif()

set(LUA_MODLIBDIR "/usr/local/lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
set(LUA_MODLIBDIR "lib/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
CACHE PATH "Path to install lua dynamic library modules into")
set(LUA_MODSHAREDIR "/usr/local/share/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
set(LUA_MODSHAREDIR "share/lua/${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
CACHE PATH "Path to install lua modules into")
set(ORCHLUA_PATH "${LUA_MODSHAREDIR}"
CACHE PATH "Path to install orch.lua into")
set(ORCHLUA_BINDIR "/usr/bin"
set(ORCHLUA_BINDIR "bin"
CACHE PATH "Path to install orch(1) into")
set(ORCHLUA_EXAMPLESDIR "share/${CMAKE_PROJECT_NAME}/examples"
CACHE PATH "Path to install .orch examples into")

add_subdirectory(examples)
add_subdirectory(lib)
add_subdirectory(man)
add_subdirectory(src)
Expand Down
8 changes: 8 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

set(EXAMPLES
cat.orch
nc.orch
)

install(FILES ${EXAMPLES} DESTINATION
${ORCHLUA_EXAMPLESDIR})
9 changes: 0 additions & 9 deletions examples/Makefile.inc

This file was deleted.

2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
add_subdirectory(core)

install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/orch.lua"
DESTINATION "${CMAKE_INSTALL_PREFIX}${LUA_MODSHAREDIR}")
DESTINATION "${LUA_MODSHAREDIR}")
add_custom_target(lint
COMMAND luacheck "${CMAKE_CURRENT_SOURCE_DIR}/orch.lua")
2 changes: 1 addition & 1 deletion lib/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ target_include_directories(core_static PRIVATE ${core_INCDIRS})
target_link_libraries(core "${LUA_LIBRARIES}")

install(TARGETS core
DESTINATION "${CMAKE_INSTALL_PREFIX}${LUA_MODLIBDIR}/orch")
DESTINATION "${LUA_MODLIBDIR}/orch")
3 changes: 2 additions & 1 deletion man/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

set(MANSECTIONS 5)
set(MANSECTIONS 1 5)

set(MAN1 orch.1)
set(MAN5 orch.5)

foreach(sect IN LISTS MANSECTIONS)
Expand Down
4 changes: 1 addition & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,5 @@ set(orch_INCDIRS "${CMAKE_SOURCE_DIR}/include" "${LUA_INCLUDE_DIR}")
target_include_directories(orch PRIVATE ${orch_INCDIRS})
target_link_libraries(orch core_static "${LUA_LIBRARIES}")

#install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/orch.lua"
# DESTINATION "${CMAKE_INSTALL_PREFIX}${LUA_MODSHAREDIR}")
install(TARGETS orch
DESTINATION "${CMAKE_INSTALL_PREFIX}${ORCHLUA_BINDIR}")
DESTINATION "${ORCHLUA_BINDIR}")

0 comments on commit e5e1d6b

Please sign in to comment.