mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 18:09:42 -05:00
1edf138506
For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
32 lines
772 B
CMake
32 lines
772 B
CMake
enable_language(C)
|
|
|
|
# Create framework and ensure header is placed in Headers
|
|
set(input_header "${CMAKE_SOURCE_DIR}/Gui.h")
|
|
add_library(Gui SHARED Gui.c "${input_header}")
|
|
set_target_properties(Gui PROPERTIES
|
|
PUBLIC_HEADER "${input_header}"
|
|
FRAMEWORK TRUE
|
|
)
|
|
|
|
add_executable(app main.c)
|
|
|
|
target_link_libraries(app PRIVATE Gui)
|
|
|
|
|
|
# Same test but with generation done in custom directories
|
|
add_library(Gui2 SHARED Gui.c "${input_header}")
|
|
set_target_properties(Gui2 PROPERTIES
|
|
PUBLIC_HEADER "${input_header}"
|
|
FRAMEWORK TRUE
|
|
LIBRARY_OUTPUT_DIRECTORY lib
|
|
)
|
|
|
|
add_executable(app2 main2.c)
|
|
set_target_properties(Gui2 PROPERTIES
|
|
PUBLIC_HEADER "${input_header}"
|
|
FRAMEWORK TRUE
|
|
RUNTIME_OUTPUT_DIRECTORY bin
|
|
)
|
|
|
|
target_link_libraries(app2 PRIVATE Gui2)
|