CMakeLists.txt
1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 2.6)
PROJECT(DDClient)
add_definitions( -DLINUX )
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/bin/)
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/build/${CMAKE_BUILD_TYPE}/lib/)
if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
#64 bits
MESSAGE( STATUS "64 bits" )
set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread")
set(CMAKE_C_FLAGS_RELEASE "-DLINUX -Dlinux -m64 -march=core2 -fPIC -D_REENTRANT -pthread")
set(CMAKE_CXX_FLAGS_DEBUG "-std=c++0x -fPIC -Wall -Wextra -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread")
set(CMAKE_CXX_FLAGS_RELEASE "-std=c++0x -Wall -Wextra -fPIC -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread -O3 -DNDEBUG")
set(USRLIB_DIR "/usr/lib64/:/usr/local/lib64/")
else( CMAKE_SIZEOF_VOID_P EQUAL 8 )
#32 bits
MESSAGE( STATUS "32 bits" )
set(CMAKE_C_FLAGS_DEBUG "-ggdb -DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread")
set(CMAKE_C_FLAGS_DEBUG "-DLINUX -march=i686 -fPIC -Dlinux -D_REENTRANT -malign-double -pthread")
set(CMAKE_CXX_FLAGS_DEBUG "-std=c++0x -fPIC -Wall -Wextra -ggdb -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread")
set(CMAKE_CXX_FLAGS_RELEASE "-std=c++0x -Wall -Wextra -fPIC -DLINUX -Dlinux -D_REENTRANT -malign-double -pthread -O3 -DNDEBUG")
set(USRLIB_DIR "/usr/lib/:/usr/local/lib/")
endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
find_package( Threads REQUIRED )
MESSAGE( STATUS "Build DDClient Project" )
add_subdirectory(src/DDClientLibC)
add_subdirectory(src/DDClientLibCpp)
add_subdirectory(src/TOOLS/DDCheckUser)
add_subdirectory(src/TOOLS/DDHtmlLogin)
add_subdirectory(src/TOOLS/DDLogin)
add_subdirectory(src/TOOLS/DDSimpleTestGetData)
add_subdirectory(src/TOOLS/DDSimpleTestGetMultiData)
install(DIRECTORY "src/DDClientLibC/INCLUDE/" DESTINATION "include/DDClientLibC")
install(DIRECTORY "src/DDClientLibC/INCLUDE/" DESTINATION "include/DDClientLibCpp")
SET(CMAKE_VERBOSE_MAKEFILE ON)