Set separate directory to place binaries

This commit is contained in:
Andriy Senkovych 2014-11-11 17:16:51 +02:00
parent 5cceb9e37a
commit d69991fa11
4 changed files with 6 additions and 3 deletions

View File

@ -11,6 +11,9 @@ set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VE
# compile in release with debug info mode by default
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build Type")
# Build all binaries in a separate directory
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON)
option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON)
option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON)

View File

@ -15,5 +15,5 @@ set(EXAMPLES
tutorial)
foreach (example ${EXAMPLES})
add_executable(${example}_ ${example}/${example}.cpp)
add_executable(${example} ${example}/${example}.cpp)
endforeach()

View File

@ -7,5 +7,5 @@ set(PERFTEST_SOURCES
add_executable(perftest ${PERFTEST_SOURCES})
target_link_libraries(perftest ${TEST_LIBRARIES})
add_test(NAME perftest
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/perftest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)

View File

@ -13,5 +13,5 @@ set(UNITTEST_SOURCES
add_executable(unittest ${UNITTEST_SOURCES})
target_link_libraries(unittest ${TEST_LIBRARIES})
add_test(NAME unittest
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/unittest
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)