Advertisement
Guest User

asd

a guest
Nov 24th, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.46 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.0.0)
  2. project(ConnectorSimulator VERSION 0.0.0)
  3. SET(CMAKE_C_COMPILER /usr/bin/clang)
  4. SET(CMAKE_CXX_COMPILER /usr/bin/clang++)
  5. set(CMAKE_VERBOSE_MAKEFILE ON)
  6. set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
  7.  
  8. include(CTest)
  9. enable_testing()
  10. add_definitions(-std=c++11)
  11. add_definitions("-D_SCL_SECURE_NO_WARNINGS")
  12. add_definitions("-fPIE")
  13. #Static Start
  14. set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
  15.  
  16. # Boost Include
  17. set(Boost_USE_STATIC_LIBS   ON)
  18. find_package(Boost 1.61 COMPONENTS program_options system filesystem REQUIRED)
  19. # MySQL Include
  20. #set(FINDMYSQL_DEBUG ON)
  21. #set(MYSQLCLIENT_STATIC_LINKING ON)
  22. find_package(MySQL REQUIRED)
  23. #include_directories(${MySQL_INCLUDE_DIRS})
  24. set(MY_TARGET_LINK_LIBRARIES mysqlcppconn-static)
  25. set(MY_TARGET_LINK_LIBRARIES ${MY_TARGET_LINK_LIBRARIES} mysqlclient pthread z m rt atomic dl)
  26.  
  27. #Static Linking
  28. set(BUILD_SHARED_LIBRARIES OFF)
  29. set(CMAKE_EXE_LINKER_FLAGS "-static")
  30.  
  31.  
  32. #Compiling
  33. add_executable(ConnectorSimulator main.cpp Database.cpp Database.h Worker.cpp Worker.h easylogging.h easylogging.cc)
  34.  
  35. #Linking
  36. target_link_libraries(ConnectorSimulator Boost::program_options)
  37. target_link_libraries(ConnectorSimulator Boost::filesystem)
  38. target_link_libraries(ConnectorSimulator Boost::system)
  39. target_link_libraries(ConnectorSimulator ${MY_TARGET_LINK_LIBRARIES})
  40.  
  41. set(CPACK_PROJECT_NAME ${PROJECT_NAME})
  42. set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
  43. include(CPack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement