mirror of
https://github.com/reactos/CMake.git
synced 2024-12-19 01:27:11 +00:00
9db3116226
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
34 lines
1.2 KiB
CMake
34 lines
1.2 KiB
CMake
cmake_minimum_required (VERSION 2.6)
|
|
project(RuntimePath C)
|
|
|
|
# Add a simple chain of shared libraries that must be found.
|
|
add_library(foo1 SHARED foo1.c)
|
|
set_property(TARGET foo1 PROPERTY OUTPUT_NAME foo)
|
|
set_property(TARGET foo1 PROPERTY LIBRARY_OUTPUT_DIRECTORY A)
|
|
|
|
add_library(bar1 SHARED bar1.c)
|
|
set_property(TARGET bar1 PROPERTY OUTPUT_NAME bar)
|
|
set_property(TARGET bar1 PROPERTY VERSION 1)
|
|
set_property(TARGET bar1 PROPERTY LIBRARY_OUTPUT_DIRECTORY B)
|
|
target_link_libraries(bar1 foo1)
|
|
|
|
add_executable(RuntimePath main.c)
|
|
target_link_libraries(RuntimePath bar1)
|
|
|
|
# Add a library that provides a conflicting location to make sure
|
|
# rpath ordering works.
|
|
add_library(foo2 SHARED foo2.c)
|
|
set_property(TARGET foo2 PROPERTY OUTPUT_NAME foo)
|
|
set_property(TARGET foo2 PROPERTY LIBRARY_OUTPUT_DIRECTORY B)
|
|
|
|
# Add a library that would provide a conflicting location if not for
|
|
# soname analysis in rpath ordering. This will also break the old
|
|
# link directory ordering to make sure files are linked with full
|
|
# paths.
|
|
if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
|
|
add_library(bar2 SHARED bar2.c)
|
|
set_property(TARGET bar2 PROPERTY OUTPUT_NAME bar)
|
|
set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A)
|
|
target_link_libraries(bar2 foo2)
|
|
endif()
|