You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.3 KiB

  1. add_custom_target(resources)
  2. add_custom_target(test-resources)
  3. include(ExternalProject)
  4. ExternalProject_Add(
  5. xercesc
  6. SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/xercesc-3.1.2
  7. CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/xercesc-3.1.2/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2 --libdir=${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2/lib CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=-O3 CXXFLAGS=-O3
  8. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/xercesc-3.1.2
  9. BUILD_COMMAND make
  10. BUILD_IN_SOURCE 0
  11. LOG_CONFIGURE ON
  12. LOG_BUILD ON
  13. LOG_INSTALL ON
  14. )
  15. add_dependencies(resources xercesc)
  16. ExternalProject_Add(
  17. glpk
  18. DOWNLOAD_COMMAND ""
  19. PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57
  20. SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57
  21. CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/glpk-4.57/configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57 --libdir=${CMAKE_CURRENT_BINARY_DIR}/glpk-4.57/lib CC=${CMAKE_C_COMPILER}
  22. BUILD_COMMAND make "CFLAGS=-O2 -w"
  23. INSTALL_COMMAND make install
  24. BUILD_IN_SOURCE 0
  25. LOG_CONFIGURE ON
  26. LOG_BUILD ON
  27. LOG_INSTALL ON
  28. )
  29. add_dependencies(resources glpk)
  30. ExternalProject_Add(
  31. googletest
  32. #For downloads (may be useful later!)
  33. #SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
  34. #TIMEOUT 10
  35. DOWNLOAD_COMMAND ""
  36. SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gtest-1.7.0"
  37. # Force separate output paths for debug and release builds to allow easy
  38. # identification of correct lib in subsequent TARGET_LINK_LIBRARIES
  39. CMAKE_ARGS -Dgtest_force_shared_crt=ON -DCXX=${CMAKE_CXX_COMPILER}
  40. # Disable install step
  41. INSTALL_COMMAND ""
  42. BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/gtest-1.7.0"
  43. INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/gtest-1.7.0"
  44. # Wrap download, configure and build steps in a script to log output
  45. LOG_CONFIGURE ON
  46. LOG_BUILD ON)
  47. # Specify include dir
  48. ExternalProject_Get_Property(googletest source_dir)
  49. set(GTEST_INCLUDE_DIR ${source_dir}/include PARENT_SCOPE)
  50. # Specify MainTest's link libraries
  51. ExternalProject_Get_Property(googletest binary_dir)
  52. set(GTEST_LIBRARIES ${binary_dir}/libgtest.a ${binary_dir}/libgtest_main.a PARENT_SCOPE)
  53. add_dependencies(test-resources googletest)