0

I need to add exe as a resourse to another exe. I am using Windows. I tried many things in CMake that i found on google but when I open the exe after compiling and linking on CFF explorer i dont see anything.

I tried things like:

add_executable(ExecutableTarget
        main.c
        hello.exe)

set(RESOURCE_FILES
        hello.exe)

set_target_properties(ExecutableTarget PROPERTIES
        MACOSX_BUNDLE TRUE
        MACOSX_FRAMEWORK_IDENTIFIER org.cmake.ExecutableTarget
        RESOURCE "${RESOURCE_FILES}")

can someone help me please?

MikeCAT
  • 73,922
  • 11
  • 45
  • 70
sh-ch
  • 1
  • 1

1 Answers1

0

Usually, if you need to have a program splitted into different parts that solve different problems, you should use dynamic libraries (dll files), not separated exe. Normally, there is only 1 executable and several dll files containing functions or classes that solve different problems. If you only need to run the exe try only to use the system("") function to call the exe, there is no need to put it as cmake resource. Maybe you can put it into a folder to simply locate it.

To link a dll see this answer: Link shared dll

  • I have a program that need to take a file (exe) and write it to another file. The problam is that if the program is on another computer it will not have the file there so i thinking to add this as a resource – sh-ch Mar 28 '21 at 13:30