Skip to content

Commit 2a1fa49

Browse files
committed
🐛 Fix: CMake couldn't auto copy built target.
1 parent 15f0500 commit 2a1fa49

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

CMakeLists.txt

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,11 @@ if(WIN32)
2828
string(REGEX REPLACE "/RTC(su|[1su])" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
2929
message("${CMAKE_CXX_FLAGS_RELEASE}")
3030

31+
set(OBS_BUILDDIR_ARCH "build")
3132
if(ARCH EQUAL 64)
3233
set(OBS_ARCH_NAME "64bit")
33-
set(OBS_BUILDDIR_ARCH "build64")
3434
else()
3535
set(OBS_ARCH_NAME "32bit")
36-
set(OBS_BUILDDIR_ARCH "build32")
3736
add_definitions(/arch:SSE2)
3837
endif()
3938

@@ -48,32 +47,34 @@ if(WIN32)
4847
COMMAND if $<CONFIG:Release>==1 (
4948
"${CMAKE_COMMAND}" -E make_directory
5049
"${RELEASE_DIR}/data/obs-plugins/obs-streamlink"
51-
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}")
50+
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}") else (call)
5251

5352
COMMAND if $<CONFIG:Release>==1 (
5453
"${CMAKE_COMMAND}" -E copy_directory
5554
"${PROJECT_SOURCE_DIR}/data"
56-
"${RELEASE_DIR}/data/obs-plugins/obs-streamlink")
55+
"${RELEASE_DIR}/data/obs-plugins/obs-streamlink") else (call)
5756

5857
COMMAND if $<CONFIG:Release>==1 (
5958
"${CMAKE_COMMAND}" -E copy
6059
"$<TARGET_FILE:obs-streamlink>"
61-
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}")
60+
"${RELEASE_DIR}/obs-plugins/${OBS_ARCH_NAME}") else (call)
61+
)
6262

63+
add_custom_command(TARGET obs-streamlink POST_BUILD
6364
# Copy to obs-studio dev environment for immediate testing
6465
COMMAND if $<CONFIG:Debug>==1 (
6566
"${CMAKE_COMMAND}" -E copy
6667
"$<TARGET_FILE:obs-streamlink>"
67-
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${OBS_ARCH_NAME}")
68+
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${OBS_ARCH_NAME}") else (call)
6869

6970
COMMAND if $<CONFIG:Debug>==1 (
7071
"${CMAKE_COMMAND}" -E make_directory
71-
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-streamlink")
72+
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-streamlink") else (call)
7273

7374
COMMAND if $<CONFIG:Debug>==1 (
7475
"${CMAKE_COMMAND}" -E copy_directory
7576
"${PROJECT_SOURCE_DIR}/data"
76-
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-streamlink")
77+
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-streamlink") else (call)
7778
)
7879
endif()
7980

main.cpp

Lines changed: 0 additions & 1 deletion
This file was deleted.

obs-streamlink.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ OBS_MODULE_USE_DEFAULT_LOCALE("obs-streamlink", "en-US")
1414
#define info(format, ...) blog(LOG_INFO, format, ##__VA_ARGS__)
1515
#define warn(format, ...) blog(LOG_WARNING, format, ##__VA_ARGS__)
1616

17-
bool obs_module_load(void)
17+
bool obs_module_load()
1818
{
19-
info("Initialized");
19+
info("Initialized!");
2020
return true;
2121
}
2222

23-
MODULE_EXPORT const char* obs_module_description(void)
23+
MODULE_EXPORT const char* obs_module_description()
2424
{
2525
return "OBS source plugin to receive stream using streamlink.";
2626
}

0 commit comments

Comments
 (0)