things
This commit is contained in:
parent
e3ea52114d
commit
0685e3556b
6 changed files with 50 additions and 15 deletions
|
|
@ -3,7 +3,28 @@ project(
|
|||
mdebase
|
||||
)
|
||||
|
||||
macro(PKGCONF_ADD dest name)
|
||||
pkg_check_modules(${name} REQUIRED ${name})
|
||||
target_include_directories(
|
||||
${dest}
|
||||
PRIVATE
|
||||
${${name}_INCLUDE_DIRS}
|
||||
)
|
||||
target_link_directories(
|
||||
${dest}
|
||||
PRIVATE
|
||||
${${name}_LIBRARY_DIRS}
|
||||
)
|
||||
target_link_libraries(
|
||||
${dest}
|
||||
PRIVATE
|
||||
${${name}_LIBRARIES}
|
||||
)
|
||||
endmacro()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
configure_file(include/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_subdirectory(mdm)
|
||||
add_subdirectory(milkwm)
|
||||
|
||||
configure_file(include/config.h.in config.h)
|
||||
|
|
|
|||
|
|
@ -2,5 +2,7 @@
|
|||
#define __CONFIG_H__
|
||||
|
||||
#define PREFIX "@CMAKE_INSTALL_PREFIX@"
|
||||
#define CONFDIR "@CMAKE_INSTALL_FULL_SYSCONFDIR@"
|
||||
#define DATADIR "@CMAKE_INSTALL_FULL_DATAROOTDIR@"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ project(
|
|||
)
|
||||
|
||||
find_package(PkgConfig)
|
||||
pkg_check_modules(X11 REQUIRED x11)
|
||||
|
||||
file(
|
||||
GLOB
|
||||
|
|
@ -16,26 +15,28 @@ add_executable(
|
|||
${mdm_SRC}
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
mdm
|
||||
PRIVATE
|
||||
${X11_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_directories(
|
||||
mdm
|
||||
PRIVATE
|
||||
${X11_LIBRARY_DIRS}
|
||||
)
|
||||
PKGCONF_ADD(mdm x11)
|
||||
PKGCONF_ADD(mdm inih)
|
||||
|
||||
target_link_libraries(
|
||||
mdm
|
||||
PRIVATE
|
||||
${X11_LIBRARIES} MDELib Mw
|
||||
MDELib Mw
|
||||
)
|
||||
|
||||
|
||||
include(GNUInstallDirs)
|
||||
configure_file(mdmrc.in mdmrc)
|
||||
|
||||
install(
|
||||
TARGETS mdm
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
|
||||
)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/mdmrc
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/examples/mdm
|
||||
)
|
||||
install(
|
||||
FILES mdm.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mdm
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
#include "mdm.h"
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <MDE/File.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
int is_launch_x = 1;
|
||||
|
||||
|
|
@ -19,6 +25,9 @@ int main(int argc, char** argv){
|
|||
}
|
||||
}
|
||||
|
||||
if(access(CONFDIR "/mdm", F_OK) != 0) mkdir(CONFDIR "/mdm", 0755);
|
||||
if(access(CONFDIR "/mdm/mdmrc", F_OK) != 0) MDEFileCopy(DATADIR "/examples/mdm/mdmrc", CONFDIR "/mdm/mdmrc");
|
||||
|
||||
if(is_launch_x){
|
||||
if((st = launch_x()) != 0) return st;
|
||||
}
|
||||
|
|
|
|||
BIN
mdm/mdm.png
Normal file
BIN
mdm/mdm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.9 KiB |
2
mdm/mdmrc.in
Normal file
2
mdm/mdmrc.in
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
[MDM Entry]
|
||||
Picture=@CMAKE_INSTALL_FULL_DATAROOTDIR@/mdm/mdm.png
|
||||
Loading…
Add table
Add a link
Reference in a new issue