CMakeLists.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. CMAKE_MINIMUM_REQUIRED(VERSION 1.3)
  2. #
  3. # Create exe.
  4. #
  5. SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS")
  6. # Link to CMake lib
  7. LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source)
  8. # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
  9. SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
  10. LINK_LIBRARIES(${COMPLEX_LIBS})
  11. ADD_EXECUTABLE(complex complex)
  12. IF (UNIX)
  13. TARGET_LINK_LIBRARIES(complex CMakeLib ${CMAKE_DL_LIBS})
  14. ELSE(UNIX)
  15. TARGET_LINK_LIBRARIES(complex CMakeLib)
  16. IF (NOT BORLAND)
  17. TARGET_LINK_LIBRARIES(complex rpcrt4.lib)
  18. ENDIF(NOT BORLAND)
  19. ENDIF (UNIX)
  20. SET_SOURCE_FILES_PROPERTIES(complex
  21. COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS"
  22. OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
  23. )
  24. ADD_CUSTOM_COMMAND(
  25. TARGET complex
  26. SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
  27. COMMAND ${CMAKE_COMMAND}
  28. ARGS -E copy ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
  29. ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
  30. OUTPUTS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
  31. DEPENDS ${CMAKE_COMMAND}
  32. )
  33. #
  34. # Output the files required by 'complex' to a file.
  35. #
  36. # This test has been moved to the 'required' subdir so that it
  37. # has no side-effects on the current Makefile (duplicated source file
  38. # due to source list expansion done twice).
  39. #
  40. SUBDIRS(Temp)
  41. #
  42. # Extra coverage.Not used.
  43. #
  44. INSTALL_TARGETS(/tmp complex)
  45. INSTALL_PROGRAMS(/tmp complex)
  46. CONFIGURE_FILE(
  47. ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in
  48. ${Complex_BINARY_DIR}/cmVersion.h)
  49. SOURCE_GROUP(A_GROUP ".cxx")