-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·40 lines (30 loc) · 1.61 KB
/
CMakeLists.txt
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
cmake_minimum_required( VERSION 2.8 )
project( rodbc CXX )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra" )
if( NOT CMAKE_BUILD_TYPE MATCHES Debug )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto" )
endif()
set( RODBC_SANITIZER "" CACHE STRING "Sanitizer for building library and tests." )
if( NOT RODBC_SANITIZER STREQUAL "" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${RODBC_SANITIZER}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=${RODBC_SANITIZER}" )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${RODBC_SANITIZER}" )
endif()
find_package( Boost 1.58 COMPONENTS thread REQUIRED )
include_directories( include ${Boost_INCLUDE_DIR} )
add_library( rodbc SHARED src/types.cpp src/connection.cpp src/statement.cpp src/table.cpp src/connection_pool.cpp )
set_target_properties( rodbc PROPERTIES VERSION 0.1 SOVERSION 0 )
target_link_libraries( rodbc odbc ${Boost_LIBRARIES} )
find_package( Doxygen REQUIRED )
add_custom_target( doc ALL ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
install( TARGETS rodbc LIBRARY DESTINATION lib64 )
install( DIRECTORY include/ DESTINATION include/rodbc )
install( DIRECTORY doc/ DESTINATION share/doc/rodbc )
set( CPACK_PACKAGE_VERSION 0.1 )
set( CPACK_RPM_PACKAGE_LICENSE LGPLv3+ )
set( CPACK_RPM_PACKAGE_URL https://github.com/adamreichold/rodbc )
include( CPack )
enable_testing()
add_subdirectory( test )