aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2020-04-10 10:50:30 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2020-04-10 10:50:30 +0200
commitbdea5d072d4b0124e8c21bf11c8b168481358c9f (patch)
tree2b5f6725c0e235a10eb1fe89fa6464a0e1360dc9
parenta8111bba830524fd7d572836d07d72a137cc32f0 (diff)
downloadnextpnr-bdea5d072d4b0124e8c21bf11c8b168481358c9f.tar.gz
nextpnr-bdea5d072d4b0124e8c21bf11c8b168481358c9f.tar.bz2
nextpnr-bdea5d072d4b0124e8c21bf11c8b168481358c9f.zip
Support custom PROGRAM_PREFIX
-rw-r--r--CMakeLists.txt22
1 files changed, 12 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 487db42b..c1d9f1a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -43,6 +43,8 @@ if (EXTERNAL_CHIPDB)
add_definitions("-DEXTERNAL_CHIPDB_ROOT=\"${EXTERNAL_CHIPDB_ROOT}\"")
endif()
+set(PROGRAM_PREFIX "" CACHE STRING "Name prefix for executables")
+
# List of families to build
set(FAMILIES generic ice40 ecp5)
@@ -226,9 +228,9 @@ foreach (family ${ARCH})
endif()
# Add the CLI binary target
- add_executable(nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES})
- install(TARGETS nextpnr-${family} RUNTIME DESTINATION bin)
- target_compile_definitions(nextpnr-${family} PRIVATE MAIN_EXECUTABLE)
+ add_executable(${PROGRAM_PREFIX}nextpnr-${family} ${COMMON_FILES} ${${ufamily}_FILES})
+ install(TARGETS ${PROGRAM_PREFIX}nextpnr-${family} RUNTIME DESTINATION bin)
+ target_compile_definitions(${PROGRAM_PREFIX}nextpnr-${family} PRIVATE MAIN_EXECUTABLE)
# Add any new per-architecture targets here
if (BUILD_TESTS)
@@ -237,8 +239,8 @@ foreach (family ${ARCH})
set(COVERAGE_LCOV_EXCLUDES '/usr/include/*' '3rdparty/*' 'generated/*' 'bba/*' 'tests/*')
SETUP_TARGET_FOR_COVERAGE_LCOV(
NAME ${family}-coverage
- EXECUTABLE nextpnr-${family}-test
- DEPENDENCIES nextpnr-${family}-test
+ EXECUTABLE ${PROGRAM_PREFIX}nextpnr-${family}-test
+ DEPENDENCIES ${PROGRAM_PREFIX}nextpnr-${family}-test
)
endif()
@@ -247,19 +249,19 @@ foreach (family ${ARCH})
aux_source_directory(tests/gui/ GUI_TEST_FILES)
endif()
- add_executable(nextpnr-${family}-test ${${ufamily}_TEST_FILES}
+ add_executable(${PROGRAM_PREFIX}nextpnr-${family}-test ${${ufamily}_TEST_FILES}
${COMMON_FILES} ${${ufamily}_FILES} ${GUI_TEST_FILES})
- target_link_libraries(nextpnr-${family}-test PRIVATE gtest_main)
- add_sanitizers(nextpnr-${family}-test)
+ target_link_libraries(${PROGRAM_PREFIX}nextpnr-${family}-test PRIVATE gtest_main)
+ add_sanitizers(${PROGRAM_PREFIX}nextpnr-${family}-test)
add_test(${family}-test ${CMAKE_CURRENT_BINARY_DIR}/nextpnr-${family}-test)
endif()
# Set ${family_targets} to the list of targets being build for this family
- set(family_targets nextpnr-${family})
+ set(family_targets ${PROGRAM_PREFIX}nextpnr-${family})
if (BUILD_TESTS)
- set(family_targets ${family_targets} nextpnr-${family}-test)
+ set(family_targets ${family_targets} ${PROGRAM_PREFIX}nextpnr-${family}-test)
endif()
# Include the family-specific CMakeFile