| | |
| | | #make it compatible with find_boost (exchange lowercase to camelcase) |
| | | #fix shared libraries activation |
| | | |
| | | cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) |
| | | #cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) |
| | | cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) |
| | | |
| | | #version variables, major and minor must be 1 character only |
| | | SET(LICENSECC_MAJOR_VERSION 1) |
| | |
| | | SET(LICENSECC_VERSION "${LICENSECC_MAJOR_VERSION}.${LICENSECC_MINOR_VERSION}.${LICENSECC_PATCH_VERSION}") |
| | | SET(LICENSECC_SHORT_LICENSE "BSD Software License") |
| | | |
| | | # add this options before PROJECT keyword |
| | | SET(CMAKE_DISABLE_SOURCE_CHANGES OFF) |
| | | SET(CMAKE_DISABLE_SOURCE_CHANGES ON) |
| | | SET(CMAKE_DISABLE_IN_SOURCE_BUILD ON) |
| | | SET(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "CMake verbose" FORCE) |
| | | |
| | |
| | | endif(CMAKE_BUILD_TYPE) |
| | | |
| | | if(WIN32) |
| | | |
| | | SET(PLATFORM_LIBS "") |
| | | if(CMAKE_CL_64) |
| | | SET(CMAKE_EXE_LINKER_FLAGS "/machine:X64 /INCREMENTAL:NO" CACHE STRING "Linker flags") |
| | | endif(CMAKE_CL_64) |
| | | include(target_arch) |
| | | target_architecture( TARGET_ARCHITECTURE ) |
| | | message(STATUS "architecture detected: ${TARGET_ARCHITECTURE}") |
| | | #force to patch an error in cmake |
| | | if(TARGET_ARCHITECTURE STREQUAL "x86_64") |
| | | SET(CMAKE_EXE_LINKER_FLAGS "/machine:X64" CACHE STRING "Linker flags" FORCE) |
| | | SET(CMAKE_MODULE_LINKER_FLAGS "/machine:X64" CACHE STRING "Module Linker flags" FORCE) |
| | | SET(CMAKE_SHARED_LINKER_FLAGS "/machine:X64" CACHE STRING "Shared Linker flags" FORCE) |
| | | endif() |
| | | SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib ) #${CMAKE_FIND_LIBRARY_SUFFIXES} |
| | | add_definitions("/D_CRT_SECURE_NO_WARNINGS") |
| | | else(WIN32) |
| | |
| | | find_package(OpenSSL REQUIRED) |
| | | include_directories(${OPENSSL_INCLUDE_DIR}) |
| | | list(APPEND EXTERNAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) |
| | | FIND_PACKAGE(Dbus REQUIRED) |
| | | include_directories(${DBUS_INCLUDE_DIR}) |
| | | include_directories(${DBUS_ARCH_INCLUDE_DIR}) |
| | | list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES}) |
| | | MESSAGE(STATUS "Found openssl version ${OPENSSL_VERSION}") |
| | | |
| | | #Zlib required when openssl version < 1.0.1f |
| | | find_package(ZLIB REQUIRED) |
| | | list(APPEND EXTERNAL_LIBS ${ZLIB_LIBRARIES}) |
| | | |
| | | if(USE_DBUS_IDENTIFIER) |
| | | FIND_PACKAGE(Dbus REQUIRED) |
| | | add_definitions(-DUSE_DBUS) |
| | | include_directories(${DBUS_INCLUDE_DIR}) |
| | | include_directories(${DBUS_ARCH_INCLUDE_DIR}) |
| | | list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES}) |
| | | endif(USE_DBUS_IDENTIFIER) |
| | | list(APPEND EXTERNAL_LIBS dl) |
| | | endif(NOT WIN32) |
| | | |
| | |
| | | add_subdirectory(test) |
| | | |
| | | #include(build/modules/CmakeDebugVariables.txt) |
| | | |
| | | message("") |
| | | message( STATUS "C compiler: " ${CMAKE_C_COMPILER}) |
| | | message( STATUS "C compiler flags: " ${CMAKE_C_FLAGS}) |
| | | message( STATUS "CXX compiler: " ${CMAKE_CXX_COMPILER}) |
| | | message( STATUS "CXX compiler flags: " ${CMAKE_CXX_FLAGS}) |
| | | if(CMAKE_BUILD_TYPE) |
| | | message( STATUS "Build type: " ${CMAKE_BUILD_TYPE}) |
| | | endif(CMAKE_BUILD_TYPE) |