cmake: Fix build_by_default: false, install: true (fixes #6737)

pull/6756/head
Daniel Mensinger 5 years ago committed by Jussi Pakkanen
parent 7234316dc7
commit 91976a3489
  1. 2
      mesonbuild/cmake/interpreter.py
  2. 4
      test cases/cmake/3 advanced no dep/subprojects/cmMod/CMakeLists.txt
  3. 4
      test cases/cmake/3 advanced no dep/test.json

@ -1124,7 +1124,7 @@ class CMakeInterpreter:
# Generate target kwargs
tgt_kwargs = {
'build_by_default': False,
'build_by_default': tgt.install,
'link_args': tgt.link_flags + tgt.link_libraries,
'link_with': link_with,
'include_directories': id_node(inc_var),

@ -16,9 +16,11 @@ generate_export_header(cmModLib)
set_target_properties(cmModLib PROPERTIES VERSION 1.0.1)
add_executable(testEXE main.cpp)
add_executable(testEXE2 main.cpp)
target_link_libraries(testEXE cmModLib)
target_link_libraries(testEXE2 cmModLib)
target_compile_definitions(cmModLibStatic PUBLIC CMMODLIB_STATIC_DEFINE)
install(TARGETS cmModLib testEXE LIBRARY DESTINATION lib RUNTIME DESTINATION bin)
install(TARGETS cmModLib testEXE testEXE2 LIBRARY DESTINATION lib RUNTIME DESTINATION bin)

@ -5,6 +5,8 @@
{"type": "implib", "platform": "!cygwin", "file": "usr/bin/libcm_cmModLib"},
{"type": "pdb", "file": "usr/bin/cm_cmModLib"},
{"type": "pdb", "file": "usr/bin/cm_testEXE"},
{"type": "exe", "file": "usr/bin/cm_testEXE"}
{"type": "exe", "file": "usr/bin/cm_testEXE"},
{"type": "pdb", "file": "usr/bin/cm_testEXE2"},
{"type": "exe", "file": "usr/bin/cm_testEXE2"}
]
}

Loading…
Cancel
Save