https://gitlab.opengeosys.org/ogs/ogs.git
Raw File
Tip revision: 9b2d0280672d27ec5f11020de1a0f989c101b07a authored by Dmitry Yu. Naumov on 11 December 2017, 20:57:27 UTC
Merge pull request #2019 from wenqing/fixing
Tip revision: 9b2d028
CMakeLists.txt
GET_SOURCE_FILES(SOURCES)
APPEND_SOURCE_FILES(SOURCES IO)

APPEND_SOURCE_FILES(SOURCES IO/XmlIO)

if(Qt5XmlPatterns_FOUND)
    APPEND_SOURCE_FILES(SOURCES IO/XmlIO/Qt)
endif()

list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/BuildInfo.cpp" BuildInfo.h)

# Create the library
add_library(BaseLib ${SOURCES})

include(GenerateExportHeader)
generate_export_header(BaseLib)
target_include_directories(BaseLib PUBLIC ${CMAKE_CURRENT_BINARY_DIR})

set_target_properties(BaseLib PROPERTIES LINKER_LANGUAGE CXX)

target_link_libraries(BaseLib PUBLIC logog)

if(MSVC)
    target_link_libraries(BaseLib PUBLIC WinMM) # needed for timeGetTime
endif()

if(Qt5XmlPatterns_FOUND)
    target_link_libraries(BaseLib PUBLIC Qt5::Xml Qt5::XmlPatterns)
    if(WIN32 AND CMAKE_CROSSCOMPILING AND OPENSSL_FOUND)
        target_link_libraries(BaseLib PUBLIC Qt5::Network ${OPENSSL_LIBRARIES} ws2_32)
    endif()
endif()

if(TARGET Eigen)
    add_dependencies(BaseLib Eigen)
endif()
if(TARGET Boost)
    add_dependencies(BaseLib Boost)
endif()

if(OGS_USE_PCH)
    cotire(BaseLib)
endif()
back to top