vcpkg compliant CMake example project for shared/static cross-platform builds? #23093
SamuelMarks
started this conversation in
General
Replies: 1 comment 5 replies
-
Don't do
Notes:
This is required by header only ports. Alternatively you can set |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Given (essentially) this directory layout:
For reuse as boilerplate across my decent number of C projects, I took https://gitlab.kitware.com/cmake/cmake/-/blob/master/Help/guide/tutorial/Complete :
use strict
style guards:set(CMAKE_C_STANDARD 90)
set(CMAKE_C_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN YES)
"$<${gcc_like}:$<BUILD_INTERFACE:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused;-pedantic>>"
"$<${msvc}:$<BUILD_INTERFACE:-W3;-WX;-Zi;-permissive->>"
GenerateExportHeader
;set
separateSource_Files
andHeader_Files
vars [withsource_groups
] for installation [and IDE assist]INSTALL(EXPORT
lines.Unfortunately where I've got up to so far isn't far enough…
CMakeLists.txt
libcurl-simple-https/CMakeLists.txt
:All my attempts at creating simple C projects that were subsequently offered as vcpkg ports:
CMakeLists.txt
I tried settingRUNTIME
/LIBRARY
/ARCHIVE
DESTINATION
and different globalOUTPUT_DIRECTORY
)What am I doing wrong? - Is there an example project boilerplate I can follow? - Even the oft-copied
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
in myportfile.cmake
seems wrong…Thanks for suggestions
Beta Was this translation helpful? Give feedback.
All reactions