File: CMakeLists.txt

package info (click to toggle)
plplot 5.15.0%2Bdfsg-19
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,312 kB
  • sloc: ansic: 79,707; xml: 28,583; cpp: 20,033; ada: 19,456; tcl: 12,081; f90: 11,431; ml: 7,276; java: 6,863; python: 6,792; sh: 3,274; perl: 828; lisp: 75; makefile: 50; sed: 34; fortran: 5
file content (44 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (4)
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
41
42
43
44
# src_executable/CMakeLists.txt

if(BUILD_TEST)

  if(CORE_BUILD)
    include_directories(${CMAKE_BINARY_DIR}/src_lib)
  else(CORE_BUILD)
    include_directories(${FORTRAN_MOD_DIR})
  endif(CORE_BUILD)

  add_executable(hello hello.f90)

  target_link_libraries(hello hello_1)

  # configure file to compare with output of hello executable.
  file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/compare_hello.out
    "hello, world"
    )

  # Add test_noninteractive custom_target to compare hello executable output
  # with file configure above.
  add_custom_command(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hello.out
    COMMAND
    hello > ${CMAKE_CURRENT_BINARY_DIR}/hello.out
    COMMAND
    ${CMP_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/hello.out ${CMAKE_CURRENT_BINARY_DIR}/compare_hello.out
    DEPENDS
    hello
    VERBATIM
    )
  add_custom_target(test_noninteractive
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/hello.out
    )

endif(BUILD_TEST)

if(CORE_BUILD)
  install(FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
    ${CMAKE_CURRENT_SOURCE_DIR}/hello.f90
    DESTINATION ${DATA_DIR}/examples/fortran
    )
endif(CORE_BUILD)