From 0ab8564db67a4d9e391ddfbc63f82de33c118197 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 2 Mar 2016 16:36:32 +0100 Subject: [PATCH] CMakeLists.txt: Align binary locations with Autotools Target "xmlwf" even collided with the source folder of the same name, previously: $ cmake . && make ... [ 82%] Linking C executable xmlwf .../ld: cannot open output file xmlwf: Is a directory collect2: error: ld returned 1 exit status ... --- expat/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 0c923baa..322add90 100755 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -86,6 +86,7 @@ if(BUILD_tools AND NOT WINCE) ) add_executable(xmlwf ${xmlwf_SRCS}) + set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf) target_link_libraries(xmlwf expat) install(TARGETS xmlwf DESTINATION bin) install(FILES doc/xmlwf.1 DESTINATION share/man/man1) @@ -93,19 +94,23 @@ endif(BUILD_tools AND NOT WINCE) if(BUILD_examples) add_executable(elements examples/elements.c) + set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) target_link_libraries(elements expat) add_executable(outline examples/outline.c) + set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) target_link_libraries(outline expat) endif(BUILD_examples) if(BUILD_tests) ## these are unittests that can be run on any platform add_executable(runtests tests/runtests.c tests/chardata.c tests/minicheck.c) + set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) target_link_libraries(runtests expat) - add_test(runtests runtests) + add_test(runtests tests/runtests) add_executable(runtestspp tests/runtestspp.cpp tests/chardata.c tests/minicheck.c) + set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) target_link_libraries(runtestspp expat) - add_test(runtestspp runtestspp) + add_test(runtestspp tests/runtestspp) endif(BUILD_tests)