diff --git a/CMakeLists.txt b/CMakeLists.txt index 44513de..1e845f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..5c95186 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,8 @@ + +set(EXAMPLES + cat.orch + nc.orch +) + +install(FILES ${EXAMPLES} DESTINATION + ${ORCHLUA_EXAMPLESDIR}) diff --git a/examples/Makefile.inc b/examples/Makefile.inc deleted file mode 100644 index e859339..0000000 --- a/examples/Makefile.inc +++ /dev/null @@ -1,9 +0,0 @@ - -FILESGROUPS+= EXAMPLES - -EXAMPLESDIR?= /usr/share/${PROG}/examples - -.PATH: ${.PARSEDIR} - -EXAMPLES+= cat.orch -EXAMPLES+= nc.orch diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 256a98b..bb8313c 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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") diff --git a/lib/core/CMakeLists.txt b/lib/core/CMakeLists.txt index d6a97a8..9f2cc78 100644 --- a/lib/core/CMakeLists.txt +++ b/lib/core/CMakeLists.txt @@ -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") diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt index 15a0141..4440e14 100644 --- a/man/CMakeLists.txt +++ b/man/CMakeLists.txt @@ -1,6 +1,7 @@ -set(MANSECTIONS 5) +set(MANSECTIONS 1 5) +set(MAN1 orch.1) set(MAN5 orch.5) foreach(sect IN LISTS MANSECTIONS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0b11f64..70017d4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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}")