1
0

CMakeLists.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. LINK_DIRECTORIES(${Complex_BINARY_DIR}/../../Source/kwsys)
  9. # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to
  10. SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
  11. LINK_LIBRARIES(${COMPLEX_LIBS})
  12. ADD_EXECUTABLE(complex complex)
  13. ADD_EXECUTABLE(complex.file complex.file.cxx)
  14. IF (UNIX)
  15. TARGET_LINK_LIBRARIES(complex CMakeLib cmsys ${CMAKE_DL_LIBS})
  16. ELSE(UNIX)
  17. TARGET_LINK_LIBRARIES(complex CMakeLib cmsys)
  18. IF (NOT BORLAND)
  19. IF(NOT MINGW)
  20. TARGET_LINK_LIBRARIES(complex rpcrt4.lib)
  21. ENDIF(NOT MINGW)
  22. ENDIF(NOT BORLAND)
  23. ENDIF (UNIX)
  24. SET_SOURCE_FILES_PROPERTIES(complex
  25. COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS"
  26. OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
  27. )
  28. ADD_CUSTOM_COMMAND(
  29. TARGET complex
  30. SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
  31. COMMAND ${CMAKE_COMMAND}
  32. ARGS -E copy ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in
  33. ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
  34. OUTPUTS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h
  35. DEPENDS ${CMAKE_COMMAND}
  36. )
  37. #
  38. # Output the files required by 'complex' to a file.
  39. #
  40. # This test has been moved to the 'required' subdir so that it
  41. # has no side-effects on the current Makefile (duplicated source file
  42. # due to source list expansion done twice).
  43. #
  44. SUBDIRS(Temp)
  45. #
  46. # Extra coverage.Not used.
  47. #
  48. INSTALL_TARGETS(/tmp complex)
  49. INSTALL_PROGRAMS(/tmp complex)
  50. CONFIGURE_FILE(
  51. ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in
  52. ${Complex_BINARY_DIR}/cmVersion.h)
  53. SOURCE_GROUP(A_GROUP ".cxx")
  54. SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx")
  55. SOURCE_GROUP(C_GROUP FILES complex.cxx)