cmake refactoring
This commit is contained in:
@@ -17,12 +17,10 @@ include(SHSTKMacros)
|
||||
|
||||
shstk_is_parent_exists(hasParent PARENT_DIRECTORY)
|
||||
|
||||
shstk_set_find_dirs(cd CD)
|
||||
set(_SEARCH_DIR ${cd_LIBDIR})
|
||||
shstk_set_find_dirs(CD)
|
||||
|
||||
if (NOT BUILDING_cd)
|
||||
list(APPEND _SEARCH_DIR $ENV{SMSDK_DIR}/lib)
|
||||
shstk_find_header(cd CD "cd_version.h" "")
|
||||
if (NOT BUILDING_CD)
|
||||
shstk_find_header(CD "cd_version.h" ${CD_INCDIR})
|
||||
endif()
|
||||
|
||||
if(CD_FIND_VERSION VERSION_GREATER CD_VERSION)
|
||||
@@ -37,9 +35,9 @@ set( __inc_core "")
|
||||
set(__libs_core "")
|
||||
set(__deps_core "PIP")
|
||||
|
||||
if (BUILDING_cd)
|
||||
if (BUILDING_CD)
|
||||
|
||||
if (NOT SET_TARGETS_cd)
|
||||
if (NOT SET_TARGETS_CD)
|
||||
#message("create aliases")
|
||||
foreach (_l ${__libs})
|
||||
set(_m ${__module_${_l}})
|
||||
@@ -55,12 +53,12 @@ else()
|
||||
#message("create interfaces")
|
||||
foreach (_l ${__libs})
|
||||
set(_m ${__module_${_l}})
|
||||
find_library(CD_LIBRARY_${_l} cd_${_l} HINTS ${_SEARCH_DIR})
|
||||
find_library(CD_LIBRARY_${_l} cd_${_l} HINTS ${CD_LIBDIR})
|
||||
if((NOT TARGET CD::${_m}) AND CD_LIBRARY_${_l})
|
||||
add_library(CD::${_m} UNKNOWN IMPORTED)
|
||||
set_target_properties(CD::${_m} PROPERTIES
|
||||
IMPORTED_LOCATION "${CD_LIBRARY_${_l}}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${cd_INCLUDES};${__inc_${_l}}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CD_INCLUDES};${__inc_${_l}}"
|
||||
INTERFACE_LINK_LIBRARIES "${__deps_${_l}};${__libs_${_l}}")
|
||||
#message("imported CD::${_m} = ${CD_LIBRARY_${_l}} ${__deps_${_l}} ${__libs_${_l}} ${__inc_${_l}}")
|
||||
endif()
|
||||
@@ -78,10 +76,10 @@ if (QAD_FOUND OR BUILDING_qad)
|
||||
set(__libs_qt "")
|
||||
set(__deps_qt "QAD::PIQt;QAD::Graphic;CD::Core")
|
||||
|
||||
if (BUILDING_cd)
|
||||
if (BUILDING_CD)
|
||||
|
||||
if (NOT SET_TARGETS_cd)
|
||||
set(SET_TARGETS_cd ON CACHE BOOL "")
|
||||
if (NOT SET_TARGETS_CD)
|
||||
set(SET_TARGETS_CD ON CACHE BOOL "")
|
||||
#message("create aliases")
|
||||
foreach(_l ${__libs})
|
||||
foreach(_v ${_QT_VERSIONS_})
|
||||
@@ -102,7 +100,7 @@ if (QAD_FOUND OR BUILDING_qad)
|
||||
foreach(_l ${__libs})
|
||||
foreach(_v ${_QT_VERSIONS_})
|
||||
set(_m ${__module_${_l}})
|
||||
find_library(CD_LIBRARY_${_l}${_v} cd_${_l}${_v} HINTS ${cd_LIBDIR})
|
||||
find_library(CD_LIBRARY_${_l}${_v} cd_${_l}${_v} HINTS ${CD_LIBDIR})
|
||||
#message("found ${_l}${_v} = ${CD_LIBRARY_${_l}${_v}}")
|
||||
if((NOT TARGET CD::${_m}${_v}) AND CD_LIBRARY_${_l}${_v})
|
||||
#message("imported CD::${_m}${_v} = ${CD_LIBRARY_${_l}${_v}}")
|
||||
@@ -118,7 +116,7 @@ if (QAD_FOUND OR BUILDING_qad)
|
||||
endforeach()
|
||||
set_target_properties(CD::${_m}${_v} PROPERTIES
|
||||
IMPORTED_LOCATION "${CD_LIBRARY_${_l}${_v}}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${cd_INCLUDES}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${CD_INCLUDES}"
|
||||
INTERFACE_LINK_LIBRARIES "${_deps}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
Reference in New Issue
Block a user