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
...
diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt
index 0c923ba..322add9 100755
--- a/expat/CMakeLists.txt
+++ b/expat/CMakeLists.txt
@@ -86,6 +86,7 @@
)
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 @@
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)