1 cmake_minimum_required (VERSION 3.5)
4 # Some systems do not seem to support rpath with spaces.
5 if(CMAKE_SYSTEM_NAME MATCHES "QNX")
6 set(CMAKE_SKIP_BUILD_RPATH 1)
9 # be able to see output from make on dashboards
10 set(CMAKE_VERBOSE_MAKEFILE 1)
11 message("${CMAKE_MAKE_PROGRAM}")
13 if("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
14 message("wmake does not support () in path")
15 set(CMAKE_PAREN FALSE)
16 elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make")
17 execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} no_such_target --version
18 RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_VARIABLE out)
19 if("${out}" MATCHES "GNU Make 3.82")
20 # GNU Make 3.82 fails on parens: http://savannah.gnu.org/bugs/?30612
21 message(STATUS "GNU Make 3.82 sometimes fails on () in path")
22 set(CMAKE_PAREN FALSE)
27 add_definitions(-DCMAKE_PAREN=1)
28 subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples")
30 subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples")
33 write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
34 #WATCOM WMAKE does not support + in the name of a file!
37 "Another Subdir/pair_int.int.c"
38 vcl_algorithm_vcl_pair_double.foo.c)
41 "Another Subdir/pair+int.int.c"
42 vcl_algorithm+vcl_pair+double.foo.c)
45 add_executable(TestFromSubdir
46 "Another Subdir/testfromsubdir.c"
47 "Another Subdir/secondone"
51 aux_source_directory(ThirdSubDir SOURCES)
54 if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
56 set(SOURCES2 ${f} ${SOURCES2})
59 set(SOURCES ${SOURCES2})
60 set(SOURCES ${SOURCES}
61 vcl_algorithm_vcl_pair_double.foo.c)
64 if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
66 set(SOURCES2 ${f} ${SOURCES2})
69 set(SOURCES ${SOURCES2})
70 set(SOURCES ${SOURCES}
71 vcl_algorithm+vcl_pair+double.foo.c)
73 add_executable(TestWithAuxSourceDir ${SOURCES})
75 target_link_libraries(TestWithAuxSourceDir testOddPath)