gcontini
2020-02-01 edd954f9f31863710f404ef3e6f0ebd2a16ce489
CMakeLists.txt
@@ -35,17 +35,21 @@
ENDIF()
SET (OPENSSL_USE_STATIC_LIBS ON)
find_package(OpenSSL COMPONENTS Crypto)
find_package(OpenSSL COMPONENTS Crypto QUIET)
IF(OPENSSL_FOUND)
   MESSAGE(STATUS "Found openssl version ${OPENSSL_VERSION}")
ELSE(OPENSSL_FOUND)
   MESSAGE(STATUS "OpenSSL not found")
ENDIF(OPENSSL_FOUND)
if(UNIX) #this is true for all the linux systems but not for cross compiling "linux->windows"
   IF(NOT OPENSSL_FOUND)
      MESSAGE(SEND_ERROR "Openssl required in Linux, please install it or specify -DOPENSSL_ROOT")
   ENDIF(NOT OPENSSL_FOUND)
   #Zlib required when openssl version < 1.0.1f (centos 7)
   SET ( ZLIB_USE_STATIC_LIBS ON )
   find_package(ZLIB REQUIRED)
   list(APPEND EXTERNAL_LIBS ${ZLIB_LIBRARIES})
   MESSAGE(STATUS "Found zlib version ${ZLIB_VERSION} ")
   
    find_package(Threads)
   if(THREADS_HAVE_PTHREAD_ARG)
@@ -68,6 +72,9 @@
   endif(USE_DBUS_IDENTIFIER)  
   set(main_lib_dest "lib/${PROJECT_NAME}")  
else(UNIX)
   IF(NOT OPENSSL_FOUND)
      MESSAGE(STATUS "Openssl not found, configuring the library without it (running in wine not supported).")
   ENDIF(NOT OPENSSL_FOUND)
   if(MSVC)
      include(target_arch)
      target_architecture( TARGET_ARCHITECTURE )
@@ -135,7 +142,6 @@
endif()
SET( Boost_USE_STATIC_LIBS ON )
find_package(Boost COMPONENTS unit_test_framework system filesystem)
#if boost is found enable tests
IF(Boost_FOUND)
   INCLUDE(CTest)
@@ -148,6 +154,19 @@
   message(WARNING "Boost not found, disabling tests")
ENDIF(Boost_FOUND)
find_package(Doxygen COMPONENTS dot)
IF(Doxygen_FOUND)
    message(STATUS "Doxygen found, generating docs.")
    SET(DOXYGEN_EXCLUDE_PATTERNS "*/library/ini/*;*/doc/resources/*")
    SET(DOXYGEN_DISABLE_INDEX YES)
    SET(DOXYGEN_GENERATE_TREEVIEW YES)
    SET(DOXYGEN_LAYOUT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/doc/DoxygenLayout.xml")
   doxygen_add_docs(docs doc src include/licensecc COMMENT "doxygen docs")
   file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/doc/resources/" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/html")
ELSE(Doxygen_FOUND)
   message(STATUS "Doxygen not found, not generating docs.")
ENDIF(Doxygen_FOUND)
install(DIRECTORY ${LCC_INCLUDE_DIR} DESTINATION include/${PROJECT_NAME})
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION include)
install(FILES src/cmake/licensecc-config.cmake DESTINATION ${main_lib_dest})
@@ -156,3 +175,4 @@
write_basic_package_version_file(${CMAKE_BINARY_DIR}/licensecc-config-version.cmake COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_BINARY_DIR}/licensecc-config-version.cmake DESTINATION ${main_lib_dest})