android/win build ok
This commit is contained in:
143
CMakeLists.txt
143
CMakeLists.txt
@@ -11,8 +11,10 @@ set(CMAKE_MODULE_PATH
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/pip/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/qad/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/qglengine/cmake"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cd_utils/cmake"
|
||||
)
|
||||
set(ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
include(QtWraps)
|
||||
include(SHSTKMacros)
|
||||
@@ -20,8 +22,8 @@ include(SHSTKMacros)
|
||||
shstk_begin_project("" "")
|
||||
|
||||
option(CROSSTOOLS "Crosstools minimal build" OFF)
|
||||
option(QGLVIEW "Build QGLView library and utils" OFF)
|
||||
option(QGLENGINE "Build QGLEngine library and utils" OFF)
|
||||
option(QGLVIEW "Build QGLView library and utils" ON)
|
||||
option(QGLENGINE "Build QGLEngine library and utils" ON)
|
||||
option(UTILS "Build various utils" ${_plugins_default_})
|
||||
option(DESIGNER_PLUGINS "Build Qt designer plugins" ${_plugins_default_})
|
||||
if (CROSSTOOLS)
|
||||
@@ -33,142 +35,31 @@ if (CROSSTOOLS)
|
||||
endif()
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
add_subdirectory(cmake)
|
||||
|
||||
add_subdirectory(pip)
|
||||
find_package(PIP REQUIRED)
|
||||
|
||||
find_qt(Core QUIET)
|
||||
if (SOME_QT_FOUND)
|
||||
if (NOT CROSSTOOLS)
|
||||
|
||||
add_subdirectory(qad)
|
||||
find_package(QAD REQUIRED)
|
||||
|
||||
endif()
|
||||
|
||||
#message("cmg = \"${PIP_CMG}\"")
|
||||
#if (PIP_FOUND)
|
||||
# message("found pip = \"${PIP_FOUND}\"")
|
||||
#endif()
|
||||
#message("inc = \"${PIP_INCLUDES}\"")
|
||||
|
||||
qt_add_executable(aaa ${CMAKE_CURRENT_SOURCE_DIR}/pip/main.cpp)
|
||||
qt_target_link_libraries(aaa QAD::PIQtUtils)
|
||||
#deploy_target(aaa DEPLOY_DIR ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
return()
|
||||
|
||||
add_subdirectory(cmake)
|
||||
|
||||
if (CROSSTOOLS)
|
||||
|
||||
add_subdirectory(pip)
|
||||
file(GLOB CMAKES "qad/cmake/*.cmake" "qad/cmake/*.in")
|
||||
install(FILES ${CMAKES} DESTINATION ${CMAKE_ROOT}/Modules)
|
||||
|
||||
else()
|
||||
|
||||
include(QtWraps)
|
||||
find_qt(Core QUIET)
|
||||
set(QtVersions)
|
||||
set(SomeQtFound 0)
|
||||
foreach(_v ${_QT_VERSIONS_})
|
||||
option(Qt${_v} "Build for Qt${_v}" 1)
|
||||
if (Qt${_v})
|
||||
#message("Qt${_v} -> ${LOCAL_FOUND${_v}}")
|
||||
if (LOCAL_FOUND${_v})
|
||||
list(APPEND QtVersions Qt${_v})
|
||||
set(SomeQtFound 1)
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
if (SOME_QT_FOUND)
|
||||
|
||||
#if(UTILS)
|
||||
# message(STATUS "Building with utils")
|
||||
#else()
|
||||
# message(STATUS "Building only libraries")
|
||||
#endif()
|
||||
|
||||
add_subdirectory(pip)
|
||||
foreach(F ${PIP_MAIN_FOLDERS})
|
||||
list(APPEND PIP_INCLUDES "${F}")
|
||||
endforeach(F)
|
||||
add_subdirectory(cd_utils)
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/cd_utils" "${CMAKE_CURRENT_BINARY_DIR}/cd_utils")
|
||||
set(_DIRS)
|
||||
if (SomeQtFound)
|
||||
#message(STATUS "Building Qt-derived targets for ${QtVersions}")
|
||||
add_subdirectory(qad)
|
||||
include_directories(${qad_includes})
|
||||
add_subdirectory(piqt)
|
||||
include_directories(${piqt_includes})
|
||||
set(_DIRS)
|
||||
if (Qt5)
|
||||
if (QGLVIEW)
|
||||
list(APPEND _DIRS qglview)
|
||||
endif()
|
||||
if (QGLENGINE)
|
||||
list(APPEND _DIRS qglengine)
|
||||
endif()
|
||||
find_package(QAD REQUIRED)
|
||||
|
||||
if (QGLENGINE)
|
||||
add_subdirectory(qglengine)
|
||||
endif()
|
||||
foreach(_D ${_DIRS})
|
||||
list(APPEND QT_MULTILIB_LIST ${_D})
|
||||
add_subdirectory(${_D})
|
||||
endforeach(_D)
|
||||
|
||||
macro(align_list _list _out)
|
||||
set(_max_len 0)
|
||||
foreach(_m ${_list})
|
||||
string(LENGTH "${_m}" _clen)
|
||||
if (_clen GREATER _max_len)
|
||||
set(_max_len ${_clen})
|
||||
endif()
|
||||
endforeach()
|
||||
set(${_out})
|
||||
foreach(_m ${_list})
|
||||
set(_am "${_m}")
|
||||
while(TRUE)
|
||||
string(LENGTH "${_am}" _clen)
|
||||
if (_clen GREATER_EQUAL ${_max_len})
|
||||
break()
|
||||
endif()
|
||||
string(APPEND _am " ")
|
||||
endwhile()
|
||||
list(APPEND ${_out} "${_am}")
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(print_list _list _name)
|
||||
if (NOT "x${_list}" STREQUAL "x")
|
||||
message("")
|
||||
message(" ${_name}:")
|
||||
#align_list("${_list}" _alist)
|
||||
foreach(_m ${_list})
|
||||
message(" * ${_m}")
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
message("----------QAD-----------")
|
||||
message(" Build for ${QtVersions}")
|
||||
message(" QAD Version: ${QAD_VERSION}")
|
||||
message(" QAD Linkage: ${QAD_LIB_TYPE_MSG}")
|
||||
message(" PIQt Version: ${PIQt_VERSION}")
|
||||
message(" PIQt Linkage: ${PIQt_LIB_TYPE_MSG}")
|
||||
print_list("${_qt_libs}" "Libraries")
|
||||
print_list("${_qt_apps}" "Applications")
|
||||
print_list("${_qt_plugs}" "Plugins")
|
||||
message("-----------------------")
|
||||
message("")
|
||||
|
||||
else()
|
||||
message(STATUS "None of Qt found, skip Qt-derived targets")
|
||||
endif()
|
||||
|
||||
add_subdirectory(cd)
|
||||
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
foreach(PIP_LT ${PIP_MODULES})
|
||||
if (SomeQtFound)
|
||||
qt_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pip/lib${PIP_LT}.dll" DESTINATION QtBin)
|
||||
endif()
|
||||
if(WIN32 AND SOME_QT_FOUND)
|
||||
foreach(_l ${PIP_MODULES} ${CD_MODULES})
|
||||
qt_install(TARGETS ${_l} RUNTIME DESTINATION QtBin)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user