Advertisement
Guest User

Untitled

a guest
Feb 11th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 0.37 KB | None | 0 0
  1. cmake_minimum_required(VERSION 3.4)
  2.  
  3. project(FooBar)
  4.  
  5. file(WRITE myexe.cpp [[
  6. __declspec(dllimport) void foo();
  7. int main() { foo(); }
  8. ]])
  9.  
  10. add_executable(myexe myexe.cpp)
  11. target_link_libraries(myexe PRIVATE mylib)
  12.  
  13. file(WRITE mylib.cpp "__declspec(dllexport) void foo() {}")
  14. add_library(mylib SHARED mylib.cpp)
  15.  
  16. set_property(TARGET mylib PROPERTY DEBUG_POSTFIX d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement