From cd53d13fd12f8dd86514b2894e62ee6612566975 Mon Sep 17 00:00:00 2001 From: open-license-manager <rillf@maildrop.cc> Date: 周一, 04 8月 2014 00:38:17 +0800 Subject: [PATCH] linux tests ok --- CMakeLists.txt | 25 +++++++++++++++---------- 1 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f1fe56..cf99d3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,8 @@ SET(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "CMake verbose" FORCE) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) +SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/modules/") + if(WIN32) SET(PLATFORM_LIBS "") if(CMAKE_CL_64) @@ -29,7 +31,7 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -fmessage-length=0 -Wall -Wuninitialized -fPIC") SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -pipe" CACHE INTERNAL "Linker flags") SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} -Wl,--strip-all") - #SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) #.so for dynamic libraries + SET(CMAKE_FIND_LIBRARY_SUFFIXES .a) #.so for dynamic libraries #you need to "force" the change in cmake_install_prefix after the project keyword IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) SET(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install path prefix" FORCE) @@ -43,16 +45,10 @@ endif(CMAKE_SIZEOF_VOID_P EQUAL 8) set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG) - -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/modules/") #find_package(CryptoPP REQUIRED) #include_directories(${CRYPTOPP_INCLUDE_DIRS}) #link_directories ( ${Boost_LIBRARY_DIRS} ) -find_package(OpenSSL REQUIRED) -include_directories(${OPENSSL_INCLUDE_DIR}) -list(APPEND EXTERNAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) -#link_directories ( ${OPENSSL_LIBRARIES} ) SET(Boost_USE_STATIC_LIBS ON) # static runtime requires /MT @@ -61,6 +57,18 @@ find_package(Boost COMPONENTS date_time program_options filesystem system unit_test_framework) #include_directories(${Boost_INCLUDE_DIRS}) #link_directories ( ${Boost_LIBRARY_DIRS} ) + +#find a static version of openssl crypto library +find_package(OpenSSL REQUIRED) +include_directories(${OPENSSL_INCLUDE_DIR}) +list(APPEND EXTERNAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) + +if(NOT WIN32) + FIND_PACKAGE(Dbus REQUIRED) + include_directories(${DBUS_INCLUDE_DIR}) + include_directories(${DBUS_ARCH_INCLUDE_DIR}) + list(APPEND EXTERNAL_LIBS ${DBUS_LIBRARIES}) +endif(NOT WIN32) FIND_PACKAGE(Doxygen) @@ -98,7 +106,6 @@ #include build directory to find build_properties.h include_directories(${CMAKE_BINARY_DIR}) - add_subdirectory(src) #test are done with boost_tests:disable them if boost not found. @@ -113,8 +120,6 @@ ENDIF(Boost_FOUND) #include(build/modules/CmakeDebugVariables.txt) - - message("") message( STATUS "C compiler: " ${CMAKE_C_COMPILER}) -- Gitblit v1.9.1