mirror of
https://github.com/clangen/musikcube.git
synced 2024-11-19 11:10:52 +00:00
Improved dependency detection; also look for asio before attempting to compile.
This commit is contained in:
parent
9965708858
commit
719fa0b3d1
20
.cmake/DependencyDetection.cmake
Normal file
20
.cmake/DependencyDetection.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
macro(find_vendor_library target_var library_name)
|
||||
find_library(${target_var} NAMES ${library_name} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH NO_CACHE)
|
||||
message(STATUS "[dependency-detection] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
|
||||
endmacro(find_vendor_library)
|
||||
|
||||
macro(find_header header_name)
|
||||
find_path(TEMP ${header_name} HINTS ${PROJECT_INCLUDE_DIRECTORIES} REQUIRED NO_CACHE)
|
||||
if (${TEMP} MATCHES "TEMP-NOTFOUND")
|
||||
message(STATUS "[dependency-detection] ${BoldRed}'${header_name}' COULD NOT BE FOUND!${ColorReset}")
|
||||
else()
|
||||
message(STATUS "[dependency-detection] ${BoldBlue}'${header_name}' resolved to '${TEMP}'${ColorReset}")
|
||||
endif()
|
||||
unset(TEMP)
|
||||
endmacro(find_library_and_header)
|
||||
|
||||
macro(find_library_and_header target_var library_name header_name)
|
||||
find_library(${target_var} NAMES ${library_name} NO_CACHE)
|
||||
message(STATUS "[dependency-detection] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
|
||||
find_header(${header_name})
|
||||
endmacro(find_library_and_header)
|
@ -1,17 +0,0 @@
|
||||
macro(find_vendor_library target_var library_name)
|
||||
find_library(${target_var} NAMES ${library_name} PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH NO_CACHE)
|
||||
message(STATUS "[find-vendor-library] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
|
||||
endmacro(find_vendor_library)
|
||||
|
||||
macro(find_library_and_header target_var library_name header_name)
|
||||
find_library(${target_var} NAMES ${library_name} NO_CACHE)
|
||||
message(STATUS "[find-library-and-header] ${BoldBlue}'${library_name}' library resolved to '${${target_var}}'${ColorReset}")
|
||||
|
||||
find_path(TEMP ${header_name} REQUIRED NO_CACHE)
|
||||
if (${TEMP} MATCHES "TEMP-NOTFOUND")
|
||||
message(STATUS "[find-library-and-header] ${BoldRed}'${header_name}' COULD NOT BE FOUND!${ColorReset}")
|
||||
else()
|
||||
message(STATUS "[find-library-and-header] ${BoldBlue}'${header_name}' resolved to '${TEMP}'${ColorReset}")
|
||||
endif()
|
||||
unset(TEMP)
|
||||
endmacro(find_library_and_header)
|
@ -27,7 +27,7 @@ include(AddDarwinSystemLibs)
|
||||
include(AddLinuxSystemLibs)
|
||||
include(ConfigureCurses)
|
||||
include(ConfigureCompilerFlags)
|
||||
include(FindVendorLibrary)
|
||||
include(DependencyDetection)
|
||||
|
||||
if (NOT DEFINED ENV{HOMEBREW_PREFIX} AND NOT ${BUILD_STANDALONE} MATCHES "true")
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
@ -52,7 +52,9 @@ message(STATUS "[vendor-link-directories] ${VENDOR_LINK_DIRECTORIES}")
|
||||
message(STATUS "[vendor-include-directories] ${VENDOR_INCLUDE_DIRECTORIES}")
|
||||
message(STATUS "[os-system-libs] ${DEFAULT_OS_SYSTEM_LIBS}")
|
||||
|
||||
include_directories(
|
||||
list(
|
||||
APPEND
|
||||
PROJECT_INCLUDE_DIRECTORIES
|
||||
"${musikcube_SOURCE_DIR}/src"
|
||||
"${musikcube_SOURCE_DIR}/src/musikcore"
|
||||
"${musikcube_SOURCE_DIR}/src/musikcube"
|
||||
@ -60,6 +62,8 @@ include_directories(
|
||||
"${musikcube_SOURCE_DIR}/src/3rdparty/include"
|
||||
"${musikcube_SOURCE_DIR}/src/3rdparty/asio/asio/include")
|
||||
|
||||
include_directories(${PROJECT_INCLUDE_DIRECTORIES})
|
||||
|
||||
link_directories("${musikcube_SOURCE_DIR}/bin/plugins")
|
||||
|
||||
# these are used to (1) disable the standalone ASIO from trying to use
|
||||
|
@ -88,6 +88,7 @@ add_library(musikcore SHARED ${CORE_SOURCES})
|
||||
set_target_properties(musikcore PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${musikcube_SOURCE_DIR}/bin)
|
||||
target_link_libraries(musikcore ${musikcube_LINK_LIBS})
|
||||
target_include_directories(musikcore BEFORE PRIVATE ${VENDOR_INCLUDE_DIRECTORIES})
|
||||
find_header(asio.hpp)
|
||||
|
||||
if (ENABLE_PCH MATCHES "true")
|
||||
message(STATUS "[musikcore] enabling precompiled headers")
|
||||
|
Loading…
Reference in New Issue
Block a user