Commit 8577114f authored by tseluyko's avatar tseluyko
Browse files

Updated lib build with cmake

--HG--
branch : UpdateCmake
parent 69c5e4d490f4
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.5)
project(Rdk)
# Put all the archive targets into ${PROJECT_NAME}/Lib/
set(A_OUTPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../Bin/Platform/Linux/Libs/")
file(MAKE_DIRECTORY ${A_OUTPUT_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${A_OUTPUT_DIR})
#Build Rdk options
option(BUILD_APPLICATION "Build Rdk with Application" OFF)
# Source files
include(RdkDefines.cmake)
# Rdk/Core directory
set(C_ENGINE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/Engine/")
set(C_ENGINE_FILES
"${C_ENGINE_SOURCE_DIR}/UEngine.cpp"
"${C_ENGINE_SOURCE_DIR}/UContainer.cpp"
"${C_ENGINE_SOURCE_DIR}/UPropertyInput.cpp"
"${C_ENGINE_SOURCE_DIR}/UADItem.cpp"
"${C_ENGINE_SOURCE_DIR}/UItem.cpp"
"${C_ENGINE_SOURCE_DIR}/UStorage.cpp"
"${C_ENGINE_SOURCE_DIR}/UComponent.cpp"
"${C_ENGINE_SOURCE_DIR}/ULocalProperty.cpp"
"${C_ENGINE_SOURCE_DIR}/UEnvironment.cpp"
"${C_ENGINE_SOURCE_DIR}/ULogger.cpp"
"${C_ENGINE_SOURCE_DIR}/UController.cpp"
"${C_ENGINE_SOURCE_DIR}/ULibrary.cpp"
"${C_ENGINE_SOURCE_DIR}/UModule.cpp"
"${C_ENGINE_SOURCE_DIR}/UXMLEnvSerialize.cpp"
"${C_ENGINE_SOURCE_DIR}/UConnector.cpp"
"${C_ENGINE_SOURCE_DIR}/UProperty.cpp"
"${C_ENGINE_SOURCE_DIR}/UPropertyIO.cpp"
"${C_ENGINE_SOURCE_DIR}/UPropertyOutput.cpp"
"${C_ENGINE_SOURCE_DIR}/UTime.cpp"
"${C_ENGINE_SOURCE_DIR}/UAModel.cpp"
"${C_ENGINE_SOURCE_DIR}/UContainerDescription.cpp"
"${C_ENGINE_SOURCE_DIR}/UNet.cpp"
"${C_ENGINE_SOURCE_DIR}/UBinaryEnvSerialize.cpp"
"${C_ENGINE_SOURCE_DIR}/UEPtr.cpp"
"${C_ENGINE_SOURCE_DIR}/UELockPtr.cpp"
"${C_ENGINE_SOURCE_DIR}/UEnvException.cpp"
"${C_ENGINE_SOURCE_DIR}/UEnvSupport.cpp"
"${C_ENGINE_SOURCE_DIR}/UELockVar.cpp"
"${C_ENGINE_SOURCE_DIR}/Engine.cpp"
"${C_ENGINE_SOURCE_DIR}/UPointer.cpp"
"${C_ENGINE_SOURCE_DIR}/UComponentDescription.cpp"
"${C_ENGINE_SOURCE_DIR}/UShare.cpp"
"${C_ENGINE_SOURCE_DIR}/UItemData.cpp"
"${C_ENGINE_SOURCE_DIR}/ULoggerEnv.cpp"
"${C_ENGINE_SOURCE_DIR}/UComponentFactory.cpp"
add_library(Rdk STATIC
../../../Core/Engine/Engine.cpp
../../../Core/Engine/UADItem.cpp
../../../Core/Engine/UAModel.cpp
../../../Core/Engine/UBinaryEnvSerialize.cpp
../../../Core/Engine/UComponent.cpp
../../../Core/Engine/UComponentDescription.cpp
../../../Core/Engine/UConnector.cpp
../../../Core/Engine/UContainer.cpp
../../../Core/Engine/UContainerDescription.cpp
../../../Core/Engine/UController.cpp
../../../Core/Engine/UELockPtr.cpp
../../../Core/Engine/UELockVar.cpp
../../../Core/Engine/UEngine.cpp
../../../Core/Engine/UEnvException.cpp
../../../Core/Engine/UEnvironment.cpp
../../../Core/Engine/UEnvSupport.cpp
../../../Core/Engine/UEPtr.cpp
../../../Core/Engine/UItem.cpp
../../../Core/Engine/UItemData.cpp
../../../Core/Engine/ULibrary.cpp
../../../Core/Engine/ULocalProperty.cpp
../../../Core/Engine/ULogger.cpp
../../../Core/Engine/UModule.cpp
../../../Core/Engine/UNet.cpp
../../../Core/Engine/UPointer.cpp
../../../Core/Engine/UProperty.cpp
../../../Core/Engine/UPropertyInput.cpp
../../../Core/Engine/UPropertyIO.cpp
../../../Core/Engine/UPropertyOutput.cpp
../../../Core/Engine/UShare.cpp
../../../Core/Engine/UComponentFactory.cpp
../../../Core/Engine/UStorage.cpp
../../../Core/Engine/UTime.cpp
../../../Core/Engine/UXMLEnvSerialize.cpp
../../../Core/Graphics/Graphics.cpp
../../../Core/Graphics/Gui.cpp
../../../Core/Graphics/Kernel.cpp
../../../Core/Graphics/UAGraphics.cpp
../../../Core/Graphics/UBitmap.cpp
../../../Core/Graphics/UBitmapVector.cpp
../../../Core/Graphics/UDrawEngine.cpp
../../../Core/Graphics/UFont.cpp
../../../Core/Graphics/UGraphics.cpp
../../../Core/Graphics/UGraphicsBinarySerialize.cpp
../../../Core/Graphics/UGraphicsIO.cpp
../../../Core/Graphics/UGraphicsXMLSerialize.cpp
../../../Core/Math/MCamera.cpp
../../../Core/Math/MCorrelation.cpp
../../../Core/Math/MDKalmanFilter.cpp
../../../Core/Math/MGeometry.cpp
../../../Core/Math/MGraphics.cpp
../../../Core/Math/MKalmanFilter.cpp
../../../Core/Math/MMatrix.cpp
../../../Core/Math/MMatrixBase.cpp
../../../Core/Math/MUBinarySerialize.cpp
../../../Core/Math/MUIOStream.cpp
../../../Core/Math/MUXMLSerialize.cpp
../../../Core/Math/MVector.cpp
../../../Core/Math/UMath.cpp
../../../Core/Math/UMath_lite.cpp
../../../Core/Serialize/Serialize.cpp
../../../Core/Serialize/Serialize_lite.cpp
../../../Core/Serialize/UBinaryStdSerialize.cpp
../../../Core/Serialize/UIOStream.cpp
../../../Core/Serialize/USerStorage.cpp
../../../Core/Serialize/USerStorageBinary.cpp
../../../Core/Serialize/USerStorageXML.cpp
../../../Core/Serialize/UXMLStdSerialize.cpp
../../../Core/System/UGenericMutex.cpp
../../../Core/Utilities/UException.cpp
../../../Core/Utilities/UIniFile.cpp
../../../Core/Utilities/UPtr.cpp
../../../Core/Utilities/URegistry.cpp
../../../Core/Utilities/USupport.cpp
../../../Core/Utilities/Utilities.cpp
../../../Core/Utilities/Utilities_lite.cpp
../../../Core/Utilities/UTimeStamp.cpp
../../../Core/Utilities/UTransferPacket.cpp
../../../Core/Utilities/UTree.cpp
../../../ThirdParty/ThirdParty.cpp
../../../ThirdParty/xmlParser/xmlParser.cpp
../../../ThirdParty/jpeg/JpegIntegration.cpp
../../../ThirdParty/jpeg/jpgd.cpp
../../../ThirdParty/jpeg/jpge.cpp
../../../Deploy/Include/rdk_rpc.cpp
../../../Deploy/Include/myrdk.cpp
../../../Deploy/Include/rdk.cpp
../../../Deploy/Include/rdk_cpp_initdll.cpp
../../../Deploy/Include/rdk_engine_support.cpp
../../../Deploy/Include/rdk_exceptions.ansi.cpp
../../../Deploy/Include/rdk_initdll.cpp
../../../Deploy/Include/rdk_new.cpp
../../../Core/Application/UIVisualController.cpp
../../../Core/Engine/ULoggerEnv.cpp
../../../Core/Application/UAppCore.cpp
../../../Core/Application/UApplication.cpp
../../../Core/Application/UBroadcasterInterface.cpp
../../../Core/Application/UChannelProfiler.cpp
../../../Core/Application/UEngineControl.cpp
../../../Core/Application/UEngineControlThread.cpp
../../../Core/Application/UEngineStateThread.cpp
../../../Core/Application/UProject.cpp
../../../Core/Application/URpcCommand.cpp
../../../Core/Application/URpcCommandInternal.cpp
../../../Core/Application/URpcDecoder.cpp
../../../Core/Application/URpcDecoderCommon.cpp
../../../Core/Application/URpcDecoderInternal.cpp
../../../Core/Application/URpcDispatcher.cpp
../../../Core/Application/URpcDispatcherQueues.cpp
../../../Core/Application/UServerControl.cpp
../../../Core/Application/UServerTransport.cpp
../../../Core/Application/UServerTransportTcp.cpp
../../../Core/Application/UTestManager.cpp
../../../Core/System/Gcc/pevents.cpp
../../../Core/Engine/UComponentFactory.cpp
../../../Deploy/Include/rdk_version.cpp
../../../Core/Application/UProjectDeployer.cpp
../../../Core/Application/Qt/UProjectDeployerQt.cpp
../../../Core/Application/UServerTransportHttp.cpp
../../../Core/System/Qt/rdk_system.qt.cpp
../../../Core/System/Qt/UDllLoader.qt.cpp
../../../Core/System/Qt/UGenericMutex.qt.cpp
../../../Core/System/Qt/USharedMemoryLoader.qt.cpp
)
set(C_GRAPHICS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/Graphics/")
set(C_GRAPHICS_FILES
"${C_GRAPHICS_SOURCE_DIR}/UBitmapVector.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UGraphicsIO.cpp"
"${C_GRAPHICS_SOURCE_DIR}/Gui.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UGraphicsBinarySerialize.cpp"
"${C_GRAPHICS_SOURCE_DIR}/Kernel.cpp"
"${C_GRAPHICS_SOURCE_DIR}/Graphics.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UGraphics.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UDrawEngine.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UGraphicsXMLSerialize.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UFont.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UBitmap.cpp"
"${C_GRAPHICS_SOURCE_DIR}/UAGraphics.cpp")
set(C_MATH_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/Math/")
set(C_MATH_FILES
"${C_MATH_SOURCE_DIR}/MCorrelation.cpp"
"${C_MATH_SOURCE_DIR}/MGraphics.cpp"
"${C_MATH_SOURCE_DIR}/MVector.cpp"
"${C_MATH_SOURCE_DIR}/MKalmanFilter.cpp"
"${C_MATH_SOURCE_DIR}/MMatrixBase.cpp"
"${C_MATH_SOURCE_DIR}/UMath_lite.cpp"
"${C_MATH_SOURCE_DIR}/MUBinarySerialize.cpp"
"${C_MATH_SOURCE_DIR}/MDKalmanFilter.cpp"
"${C_MATH_SOURCE_DIR}/MUIOStream.cpp"
"${C_MATH_SOURCE_DIR}/MGeometry.cpp"
"${C_MATH_SOURCE_DIR}/MMatrix.cpp"
"${C_MATH_SOURCE_DIR}/MCamera.cpp"
"${C_MATH_SOURCE_DIR}/UMath.cpp"
"${C_MATH_SOURCE_DIR}/MUXMLSerialize.cpp")
set(C_SERIALIZE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/Serialize/")
set(C_SERIALIZE_FILES
"${C_SERIALIZE_SOURCE_DIR}/UBinaryStdSerialize.cpp"
"${C_SERIALIZE_SOURCE_DIR}/UIOStream.cpp"
"${C_SERIALIZE_SOURCE_DIR}/UXMLStdSerialize.cpp"
"${C_SERIALIZE_SOURCE_DIR}/Serialize.cpp"
"${C_SERIALIZE_SOURCE_DIR}/Serialize_lite.cpp"
"${C_SERIALIZE_SOURCE_DIR}/USerStorageBinary.cpp"
"${C_SERIALIZE_SOURCE_DIR}/USerStorage.cpp"
"${C_SERIALIZE_SOURCE_DIR}/USerStorageXML.cpp")
set(C_SYSTEM_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/System/")
if(UNIX)
set(C_SYSTEM_FILES
"${C_SYSTEM_SOURCE_DIR}/Gcc/pevents.cpp"
"${C_SYSTEM_SOURCE_DIR}/Gcc/UGenericMutex.gcc.cpp"
"${C_SYSTEM_SOURCE_DIR}/Gcc/USharedMemoryLoader.gcc.cpp"
"${C_SYSTEM_SOURCE_DIR}/Gcc/rdk_system.gcc.cpp"
"${C_SYSTEM_SOURCE_DIR}/UGenericMutex.cpp")
endif(UNIX)
if(WIN32)
set(C_SYSTEM_FILES
"${C_SYSTEM_SOURCE_DIR}/Win/UDLLLoader.win.cpp"
"${C_SYSTEM_SOURCE_DIR}/Win/UGenericMutex.win.cpp"
"${C_SYSTEM_SOURCE_DIR}/Win/USharedMemoryLoader.win.cpp"
"${C_SYSTEM_SOURCE_DIR}/Win/rdk_system.win.cpp"
"${C_SYSTEM_SOURCE_DIR}/UGenericMutex.cpp")
endif(WIN32)
set(C_UTILITIES_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/Utilities/")
set(C_UTILITIES_FILES
"${C_UTILITIES_SOURCE_DIR}/UIniFile.cpp"
"${C_UTILITIES_SOURCE_DIR}/UTree.cpp"
"${C_UTILITIES_SOURCE_DIR}/Utilities_lite.cpp"
"${C_UTILITIES_SOURCE_DIR}/UTransferPacket.cpp"
"${C_UTILITIES_SOURCE_DIR}/Utilities.cpp"
"${C_UTILITIES_SOURCE_DIR}/UPtr.cpp"
"${C_UTILITIES_SOURCE_DIR}/UTimeStamp.cpp"
"${C_UTILITIES_SOURCE_DIR}/USupport.cpp"
"${C_UTILITIES_SOURCE_DIR}/URegistry.cpp"
"${C_UTILITIES_SOURCE_DIR}/UException.cpp")
# Rdk/Deploy directory
set(DEPLOY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Deploy/Include/")
set(DEPLOY_FILES
"${DEPLOY_SOURCE_DIR}/myrdk.cpp"
"${DEPLOY_SOURCE_DIR}/rdk_cpp_initdll.cpp"
"${DEPLOY_SOURCE_DIR}/rdk_engine_support.cpp"
"${DEPLOY_SOURCE_DIR}/rdk_exceptions.gcc.cpp"
"${DEPLOY_SOURCE_DIR}/rdk_new.cpp"
"${DEPLOY_SOURCE_DIR}/rdk_rpc.cpp"
"${DEPLOY_SOURCE_DIR}/rdk.cpp"
"${DEPLOY_SOURCE_DIR}/rdk.gcc.cpp"
"${DEPLOY_SOURCE_DIR}/rdk_version.cpp")
# Rdk/ThirdParty directory
set(THIRDPARTY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../ThirdParty/")
set(THIRDPARTY_FILES
"${THIRDPARTY_SOURCE_DIR}/xmlParser/xmlParser.cpp"
"${THIRDPARTY_SOURCE_DIR}/jpeg/JpegIntegration.cpp"
"${THIRDPARTY_SOURCE_DIR}/ThirdParty.cpp")
# Rdk/Application
set(APPLICATION_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../Core/Application/")
set(APPLICATION_SOURCE_FILES
"${APPLICATION_SOURCE_DIR}/UAppCore.cpp"
"${APPLICATION_SOURCE_DIR}/UApplication.cpp"
"${APPLICATION_SOURCE_DIR}/UBroadcasterInterface.cpp"
"${APPLICATION_SOURCE_DIR}/UChannelProfiler.cpp"
"${APPLICATION_SOURCE_DIR}/UEngineControl.cpp"
"${APPLICATION_SOURCE_DIR}/UEngineControlThread.cpp"
"${APPLICATION_SOURCE_DIR}/UEngineStateThread.cpp"
"${APPLICATION_SOURCE_DIR}/UIVisualController.cpp"
"${APPLICATION_SOURCE_DIR}/UProject.cpp"
"${APPLICATION_SOURCE_DIR}/URpcCommand.cpp"
"${APPLICATION_SOURCE_DIR}/URpcCommandInternal.cpp"
"${APPLICATION_SOURCE_DIR}/URpcDecoder.cpp"
"${APPLICATION_SOURCE_DIR}/URpcDecoderCommon.cpp"
"${APPLICATION_SOURCE_DIR}/URpcDecoderInternal.cpp"
"${APPLICATION_SOURCE_DIR}/URpcDispatcher.cpp"
"${APPLICATION_SOURCE_DIR}/URpcDispatcherQueues.cpp"
"${APPLICATION_SOURCE_DIR}/UServerControl.cpp"
"${APPLICATION_SOURCE_DIR}/UServerTransport.cpp"
"${APPLICATION_SOURCE_DIR}/UServerTransportTcp.cpp"
)
# Put all the files together
set(SOURCE_FILES
${C_ENGINE_FILES}
${C_GRAPHICS_FILES}
${C_MATH_FILES}
${C_SERIALIZE_FILES}
${C_SYSTEM_FILES}
${C_UTILITIES_FILES}
${DEPLOY_FILES}
${THIRDPARTY_FILES}
)
if(BUILD_APPLICATION)
List(APPEND SOURCE_FILES ${APPLICATION_SOURCE_FILES})
endif()
# Headers
include_directories(
${C_ENGINE_SOURCE_DIR}
${C_GRAPHICS_SOURCE_DIR}
${C_MATH_SOURCE_DIR}
${C_SERIALIZE_SOURCE_DIR}
${C_SYSTEM_SOURCE_DIR}
${C_UTILITIES_SOURCE_DIR}
${DEPLOY_SOURCE_DIR}
${THIRDPARTY_SOURCE_DIR}
)
if(BUILD_APPLICATION)
List(APPEND include_directories ${APPLICATION_SOURCE_DIR})
endif()
# Create target file
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES})
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.9")
set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()
target_link_libraries(Rdk
Boost::thread
Boost::system
Boost::program_options
pthread
Qt5::Core
Qt5::Widgets
Qt5::PrintSupport
Qt5::Charts
)
\ No newline at end of file
set(VERSION)
find_package(Hg)
if(HG_FOUND)
HG_WC_INFO(${PROJECT_SOURCE_DIR} Rdk)
message("Current Rdk revision is ${Rdk_WC_REVISION}")
message("Current Rdk changeset is ${Rdk_WC_CHANGESET}")
set(VERSION "${Rdk_WC_REVISION}")
endif()
set(DEF_VERSION "-DRDK_CORE_VERSION=${VERSION}")
ADD_DEFINITIONS(-DLIBRDK_LIBRARY_EXPORT
#-DRDK_UNICODE_RUN
-DRDK_QT
-DBOOST_PYTHON_STATIC_LIB
-DQT_NO_VERSION_TAGGING
-DBOOST_NUMPY_STATIC_LIB
${DEF_VERSION}
)
if("RDK_USE_CUDA" IN_LIST FOUND_DEFINES)
message("RDK_USE_CUDA defined")
ADD_DEFINITIONS(-DGPU)
endif()
if("RDK_USE_PYTHON" IN_LIST FOUND_DEFINES)
message("RDK_USE_PYTHON defined")
set(RDK_PYTHON_MAJOR 3)
set(RDK_PYTHON_MINOR 6)
endif()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment