Fix cmake generation warnings on Windows.
A target must exist before its properties can be set. Defer
libwebm target rename on windows until after creation of the
webm library target.
Change-Id: I29c5e90f1f653a00ff156316c03b0ffd78e9a998
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6a2dd6..8724afb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,12 +31,6 @@
# Set up compiler flags and build properties.
include_directories("${LIBWEBM_SRC_DIR}")
-if (WIN32)
- # Use libwebm and libwebm.lib for project and library name on Windows (instead
- # webm and webm.lib).
- set_target_properties(webm PROPERTIES PROJECT_LABEL libwebm)
- set_target_properties(webm PROPERTIES PREFIX lib)
-endif ()
if (MSVC)
add_cxx_flag_if_supported("/W4")
@@ -326,6 +320,13 @@
$<TARGET_OBJECTS:mkvmuxer>
$<TARGET_OBJECTS:mkvparser>)
+if (WIN32)
+ # Use libwebm and libwebm.lib for project and library name on Windows (instead
+ # webm and webm.lib).
+ set_target_properties(webm PROPERTIES PROJECT_LABEL libwebm)
+ set_target_properties(webm PROPERTIES PREFIX lib)
+endif ()
+
add_executable(mkvparser_sample ${mkvparser_sample_sources})
target_link_libraries(mkvparser_sample LINK_PUBLIC webm)