Skip to content

Commit

Permalink
cmake: Output executables to top-level /bin dir
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast committed May 21, 2021
1 parent de0c5d1 commit 23110dd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ project(evmc)
set(PROJECT_VERSION 8.1.0-alpha.0)

include(GNUInstallDirs) # Must be included after any language is enabled.
if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
# By default put every executable in top-level /bin dir.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
endif()


cable_configure_compiler(NO_STACK_PROTECTION)
if(CABLE_COMPILER_GNULIKE)
Expand Down
1 change: 0 additions & 1 deletion test/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ target_link_libraries(
evmc::hex
GTest::gtest_main
)
set_target_properties(evmc-unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ..)

gtest_add_tests(TARGET evmc-unittests TEST_PREFIX ${PROJECT_NAME}/unittests/ TEST_LIST unittests)

Expand Down
4 changes: 1 addition & 3 deletions tools/evmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ find_package(CLI11 REQUIRED)

add_executable(evmc-tool main.cpp)
add_executable(evmc::tool ALIAS evmc-tool)
set_target_properties(evmc-tool PROPERTIES
OUTPUT_NAME evmc
RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
set_target_properties(evmc-tool PROPERTIES OUTPUT_NAME evmc)
set_source_files_properties(main.cpp PROPERTIES
COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(evmc-tool PRIVATE evmc::tool-commands evmc::loader CLI11::CLI11)
1 change: 0 additions & 1 deletion tools/vmtester/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ find_package(GTest CONFIG REQUIRED)
set_target_properties(GTest::gtest PROPERTIES INTERFACE_COMPILE_DEFINITIONS GTEST_HAS_TR1_TUPLE=0)

add_executable(evmc-vmtester vmtester.hpp vmtester.cpp tests.cpp)
set_target_properties(evmc-vmtester PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
target_link_libraries(evmc-vmtester PRIVATE evmc::loader evmc::mocked_host GTest::gtest)
set_source_files_properties(vmtester.cpp PROPERTIES COMPILE_DEFINITIONS PROJECT_VERSION="${PROJECT_VERSION}")
add_executable(evmc::evmc-vmtester ALIAS evmc-vmtester)
Expand Down

0 comments on commit 23110dd

Please sign in to comment.