2015-06-19 23:12:43 +03:00
|
|
|
project(autoexport)
|
|
|
|
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${autoexport_BINARY_DIR}/bin)
|
|
|
|
add_subdirectory(sub)
|
2016-07-20 18:26:55 +03:00
|
|
|
add_library(objlib OBJECT objlib.c)
|
|
|
|
set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
|
|
|
|
add_library(autoexport SHARED hello.cxx world.cxx foo.c $<TARGET_OBJECTS:objlib>)
|
2016-07-10 20:24:43 +03:00
|
|
|
|
2015-06-19 23:12:43 +03:00
|
|
|
add_executable(say say.cxx)
|
2016-07-10 20:24:43 +03:00
|
|
|
if(MSVC)
|
|
|
|
set_target_properties(say PROPERTIES ENABLE_EXPORTS ON)
|
|
|
|
add_library(autoexport_for_exec SHARED hello2.c)
|
|
|
|
target_link_libraries(autoexport_for_exec say)
|
|
|
|
endif()
|
2015-06-19 23:12:43 +03:00
|
|
|
target_link_libraries(say autoexport autoexport2)
|