diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f47494..925f9fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,36 +4,6 @@ project( ) include(GNUInstallDirs) -macro(setup_lib dir name) - project( - mde${dir} - ) - - file( - GLOB - MDE${name}_SRC - *.c - ) - - add_library( - MDE${name} - SHARED - ${MDE${name}_SRC} - ) - - target_include_directories( - MDE${name} - PUBLIC - ../include - ) - - install( - TARGETS MDE${name} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - ) -endmacro() add_subdirectory(core) add_subdirectory(audio) diff --git a/audio/CMakeLists.txt b/audio/CMakeLists.txt index 3cee3d2..ed1946c 100644 --- a/audio/CMakeLists.txt +++ b/audio/CMakeLists.txt @@ -1,11 +1,7 @@ +include(MDEBase) include(MDEPkgConfig) -setup_lib(audio Audio) -target_link_libraries( - MDEAudio - PRIVATE - MDECore -) +setup_library(MDEAudio) find_package(PkgConfig) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 585b83e..d5c5cc2 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,9 +1,6 @@ -setup_lib(core Core) -target_link_libraries( - MDECore - PRIVATE - Mw -) +include(MDEBase) + +setup_library(MDECore ${CMAKE_INSTALL_LIBDIR}) if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") target_link_libraries( MDECore diff --git a/sound/CMakeLists.txt b/sound/CMakeLists.txt index d1f1d70..50b8e9c 100644 --- a/sound/CMakeLists.txt +++ b/sound/CMakeLists.txt @@ -1,10 +1,6 @@ +include(MDEBase) include(MDEPkgConfig) -setup_lib(sound Sound) -target_link_libraries( - MDESound - PRIVATE - MDECore Mw -) +setup_library(MDESound ${CMAKE_INSTALL_LIBDIR}) pkg_config_add(MDESound vorbisfile)