File: CMakeLists.txt

package info (click to toggle)
cmake 2.8.11.1-1~bpo70+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 37,056 kB
  • sloc: cpp: 157,219; ansic: 137,155; yacc: 3,254; sh: 2,745; xml: 2,483; lex: 1,028; lisp: 215; python: 199; objc: 134; f90: 105; perl: 99; fortran: 93; makefile: 65; tcl: 55; asm: 28; php: 25; ruby: 22; java: 20
file content (42 lines) | stat: -rw-r--r-- 1,506 bytes parent folder | download | duplicates (11)
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
cmake_minimum_required(VERSION 2.6)
project(TestsWorkingDirectoryProj)

add_executable(WorkingDirectory main.c)

enable_testing()

set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")

add_test(NAME WorkingDirectory0 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")

add_test(NAME WorkingDirectory1 COMMAND WorkingDirectory "${CMAKE_BINARY_DIR}")
set_tests_properties(WorkingDirectory1 PROPERTIES
  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)

string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_BINARY_DIR}")

add_test(NAME WorkingDirectory2 COMMAND WorkingDirectory "${_parent_dir}")
set_tests_properties(WorkingDirectory2 PROPERTIES
  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/.."
)

set(_default_cwd "${CMAKE_BINARY_DIR}")

# FIXME: How to deal with /debug, /release, etc. with VS or Xcode?
if(${CMAKE_GENERATOR} MATCHES "Makefiles")
add_test(WorkingDirectory3 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd})
endif()

add_test(NAME WorkingDirectory4 WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND WorkingDirectory ${CMAKE_BINARY_DIR})

string(REGEX REPLACE "/[^/]*$" "" _parent_dir "${CMAKE_BINARY_DIR}")

add_test(NAME WorkingDirectory5 WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/.. COMMAND WorkingDirectory ${_parent_dir})

# FIXME: How to deal with /debug, /release, etc. with VS or Xcode?
if(${CMAKE_GENERATOR} MATCHES "Makefiles")
add_test(WorkingDirectory6 ${EXECUTABLE_OUTPUT_PATH}/WorkingDirectory ${_default_cwd} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/..)
endif()

add_subdirectory(subdir)