summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Ninja/TwoLibs.cmake
diff options
context:
space:
mode:
authorNicolas Despres <nicolas.despres@gmail.com>2016-05-13 23:18:20 (GMT)
committerBrad King <brad.king@kitware.com>2016-05-17 13:34:12 (GMT)
commit8a862a4d4b852c9f61ae4ed7fc46042b00a83123 (patch)
tree591906a0300c9619e57394105455d93126dab939 /Tests/RunCMake/Ninja/TwoLibs.cmake
parent038e7716e58e4cf79bda6ba72b92814a14978a8f (diff)
downloadCMake-8a862a4d4b852c9f61ae4ed7fc46042b00a83123.zip
CMake-8a862a4d4b852c9f61ae4ed7fc46042b00a83123.tar.gz
CMake-8a862a4d4b852c9f61ae4ed7fc46042b00a83123.tar.bz2
Ninja: Support embedding of CMake as subninja project
Add a `CMAKE_NINJA_OUTPUT_PATH_PREFIX` variable. When it is set, CMake generates a `build.ninja` file suitable for embedding into another ninja project potentially generated by an alien generator.
Diffstat (limited to 'Tests/RunCMake/Ninja/TwoLibs.cmake')
-rw-r--r--Tests/RunCMake/Ninja/TwoLibs.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/TwoLibs.cmake b/Tests/RunCMake/Ninja/TwoLibs.cmake
new file mode 100644
index 0000000..666452f
--- /dev/null
+++ b/Tests/RunCMake/Ninja/TwoLibs.cmake
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.5)
+project(hello C)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib-static")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+
+add_library(greeting SHARED greeting.c)
+add_library(greeting2 STATIC greeting2.c)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+add_executable(hello hello_with_two_greetings.c)
+target_link_libraries(hello greeting greeting2)
+
+set(HELLO_OUTPUT_STRING "Hello world!\nHello world 2!\n")
+include(CheckOutput.cmake)
+
+include(CheckNoPrefixSubDir.cmake)