list(APPEND RESOURCES ${CMAKE_CURRENT_LIST_DIR}/native.rc)
endif()
+function(set_common_libs TargetType)
+
+ # Libraries used for exe projects
+ if (${TargetType} STREQUAL "exe")
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
+ target_link_libraries (${DOTNET_PROJECT_NAME} "pthread")
+ endif()
+
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ target_link_libraries (${DOTNET_PROJECT_NAME} "dl")
+ endif()
+ endif()
+
+ # Specify the import library to link against for Arm32 build since the default set is minimal
+ if (CLI_CMAKE_PLATFORM_ARCH_ARM)
+ if (WIN32)
+ target_link_libraries(${DOTNET_PROJECT_NAME} shell32.lib)
+ else()
+ target_link_libraries(${DOTNET_PROJECT_NAME} atomic.a)
+ endif()
+ endif()
+endfunction()
install(TARGETS ${DOTNET_PROJECT_NAME} DESTINATION bin)
-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
- target_link_libraries (${DOTNET_PROJECT_NAME} "pthread")
-endif()
-
-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- target_link_libraries (${DOTNET_PROJECT_NAME} "dl")
-endif()
-
-# Specify the import library to link against for Arm32 build since the default set is minimal
-if (WIN32 AND CLI_CMAKE_PLATFORM_ARCH_ARM)
- target_link_libraries(${DOTNET_PROJECT_NAME} shell32.lib)
-endif()
+set_common_libs("exe")
set_target_properties(${DOTNET_PROJECT_NAME} PROPERTIES MACOSX_RPATH TRUE)
-# Specify the import library to link against for Arm32 build since the default set is minimal
-if (WIN32 AND CLI_CMAKE_PLATFORM_ARCH_ARM)
- target_link_libraries(${DOTNET_PROJECT_NAME} shell32.lib)
-endif()
\ No newline at end of file
+set_common_libs("lib")