Skip to content

Commit

Permalink
allow override of Windows static lib name
Browse files Browse the repository at this point in the history
* also changed name back to original default of yaml, as the change in #10 to `yaml_static` broke things that relied on that
  • Loading branch information
nitzmahone committed Mar 2, 2019
1 parent 78e6ebf commit 99e0a15
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set (YAML_VERSION_PATCH 7)
set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERSION_PATCH}")

option(BUILD_SHARED_LIBS "Build libyaml as a shared library" OFF)
option(YAML_STATIC_LIB_NAME "base name of static library output" yaml)

This comment has been minimized.

Copy link
@school510587

school510587 Nov 28, 2019

The "option" command is used to define ON/OFF options. Due to this line, the compiled static library becomes libOFF.a. String options should be defined like this:
set(YAML_STATIC_LIB_NAME "yaml" CACHE STRING "base name of static library output")


#
# Output directories for a build tree
Expand Down Expand Up @@ -56,8 +57,8 @@ add_library(yaml ${SRCS})

if(NOT BUILD_SHARED_LIBS)
set_target_properties(yaml
PROPERTIES OUTPUT_NAME yaml_static
)
PROPERTIES OUTPUT_NAME ${YAML_STATIC_LIB_NAME}
)
endif()

set_target_properties(yaml
Expand Down

0 comments on commit 99e0a15

Please sign in to comment.